Version Description
- Release date: August 10th, 2016
Performance Enhancements:
- Weve improved Jetpacks performance by making calls to the database more efficient; essentially, Jetpack is doing less on each page load, making things faster. #4281, #4316
- Weve ensured that every feature uses information that is up to date by completely refactoring the way information was synchronized between your site and WordPress.com.
- We've improved the way Jetpack queries for information about features, which results in less overall queries.
Exciting Feature and UI Improvements:
- We now track your visitor views of Carousel images in stats.
- You can now customize advanced typographic settings like ligatures in the Custom CSS editor with new support for the
font-feature-settings
property. - Weve improved the experience when you dont actually have enough posts to Infinitely Scroll.
- Our Contact Info Widget allows you to enter a Google Maps API Key which is now required by Google if you want to display a map.
Security:
- Were continuing our efforts to harden Jetpack security, by implementing the
hash_equals()
function to avoid timing attacks when comparing strings. We also improved security on CSVs exported from your contact form.
Slightly Less Exciting Feature Improvements:
- The Cartodb shortcode has been changed to match the new product name, Carto.
- The YouTube shortcode now uses the content width defined by the theme when available, even if an embed size was defined in an old version of WordPress.
- Breadcrumbs now support hierarchical post types and taxonomies.
- Weve added the Portfolio Post Type to the WordPress.com REST API whitelist.
- There are a few new parameters for the Dailymotion shortcode.
Improved Compatibility:
- We now work well with WP Stagecoach staging sites, so you should not see any future impact on production sites.
- We had some PHP notices popping up in the WooCommerce plugin wizard screen, these are gone.
Bug Fixes:
- We stopped loading compatibility stylesheets on the default theme's singular views for Infinite Scroll.
- Debug tests forwarded through the contact form in the Jetpack Debug menu are now successfully sent to the support team.
- Weve removed the PHP notices you might have seen when moderating comments.
- There are no longer PHP notices cropping up when publishing via Cron.
- Weve fixed the official Sharing buttons so they now line up just right.
- The PHP warnings of Sitemaps stylesheets have been eliminated.
- Weve done away with the warnings that appeared when Tonesque processes a file which claims to be one filetype, but is actually another.
- Weve exterminated PHP notices that appeared when using Random Redirect, as well as when the author wasn't set.
Download this release
Release Info
Developer | samhotchkiss |
Plugin | Jetpack by WordPress.com |
Version | 4.2 |
Comparing to | |
See all releases |
Code changes from version 4.1.1 to 4.2
- 3rd-party/3rd-party.php +3 -1
- 3rd-party/bitly.php +2 -2
- 3rd-party/polldaddy.php +7 -0
- 3rd-party/vaultpress.php +0 -13
- _inc/jquery.jetpack-sync.js +0 -68
- _inc/lib/tonesque.php +1 -21
- changelog.txt +6 -6
- class.jetpack-admin.php +1 -2
- class.jetpack-bbpress-json-api-compat.php +0 -10
- class.jetpack-cli.php +4 -4
- class.jetpack-client-server.php +18 -16
- class.jetpack-debugger.php +68 -34
- class.jetpack-heartbeat.php +4 -0
- class.jetpack-modules-list-table.php +3 -0
- class.jetpack-options.php +21 -11
- class.jetpack-signature.php +3 -3
- class.jetpack-sync.php +0 -1104
- class.jetpack-twitter-cards.php +1 -1
- class.jetpack-user-agent.php +70 -15
- class.jetpack-xmlrpc-server.php +1 -53
- class.jetpack.php +166 -569
- css/jetpack-admin.css.map +1 -1
- css/jetpack-rtl.css +1 -1
- css/jetpack.css +1 -1
- functions.opengraph.php +2 -2
- jetpack.php +3 -4
- json-endpoints.php +125 -2
- json-endpoints/class.wpcom-json-api-comment-endpoint.php +2 -0
- json-endpoints/class.wpcom-json-api-get-site-endpoint.php +3 -2
- json-endpoints/class.wpcom-json-api-post-endpoint.php +0 -1
- json-endpoints/class.wpcom-json-api-site-settings-endpoint.php +2 -2
- json-endpoints/class.wpcom-json-api-update-comment-endpoint.php +1 -1
- json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php +2 -1
- json-endpoints/jetpack/class.jetpack-json-api-plugins-install-endpoint.php +2 -1
- json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php +168 -5
- json-endpoints/jetpack/json-api-jetpack-endpoints.php +114 -0
- modules/after-the-deadline.php +1 -1
- modules/carousel/jetpack-carousel.js +8 -0
- modules/carousel/jetpack-carousel.php +22 -4
- modules/comments.php +0 -9
- modules/contact-form/grunion-contact-form.php +36 -8
- modules/custom-css/csstidy/class.csstidy.php +1 -1
- modules/custom-css/csstidy/class.csstidy_optimise.php +1 -1
- modules/custom-css/csstidy/class.csstidy_print.php +1 -1
- modules/custom-css/csstidy/data-wp.inc.php +1 -0
- modules/custom-css/custom-css.php +4 -7
- modules/custom-post-types/portfolios.php +13 -1
- modules/custom-post-types/testimonial.php +1 -1
- modules/enhanced-distribution.php +21 -3
- modules/gravatar-hovercards.php +1 -1
- modules/infinite-scroll.php +1 -1
- modules/infinite-scroll/infinity.js +4 -8
- modules/infinite-scroll/infinity.php +19 -6
- modules/infinite-scroll/themes/twentyeleven.php +4 -2
- modules/infinite-scroll/themes/twentyfifteen.php +4 -2
- modules/infinite-scroll/themes/twentyfourteen.php +3 -1
- modules/infinite-scroll/themes/twentysixteen.php +4 -2
- modules/infinite-scroll/themes/twentyten.php +4 -2
- modules/infinite-scroll/themes/twentythirteen.php +3 -1
- modules/infinite-scroll/themes/twentytwelve.php +4 -2
- modules/json-api.php +1 -4
- modules/likes.php +45 -99
- modules/manage.php +0 -13
- modules/markdown/easy-markdown.php +3 -3
- modules/minileven.php +1 -1
- modules/minileven/minileven.php +1 -1
- modules/minileven/theme/pub/minileven/footer.php +1 -1
- modules/monitor.php +0 -3
- modules/notes.php +0 -23
- modules/post-by-email.php +0 -7
- modules/protect.php +6 -4
- modules/publicize.php +0 -33
- modules/publicize/publicize-jetpack.php +34 -4
- modules/publicize/publicize.php +5 -1
- modules/related-posts.php +0 -16
- modules/related-posts/jetpack-related-posts.php +2 -2
- modules/sharedaddy/sharedaddy.php +1 -1
- modules/sharedaddy/sharing-sources.php +10 -12
- modules/sharedaddy/sharing.css +1 -2
- modules/sharedaddy/sharing.js +1 -1
- modules/shortcodes.php +4 -3
- modules/shortcodes/cartodb.php +12 -9
- modules/shortcodes/dailymotion.php +97 -17
- modules/shortcodes/slideshow.php +1 -1
- modules/shortcodes/soundcloud.php +1 -1
- modules/shortcodes/vimeo.php +3 -5
- modules/shortcodes/wufoo.php +1 -1
- modules/shortcodes/youtube.php +12 -11
- modules/site-icon.php +0 -2
- modules/site-icon/jetpack-site-icon.php +1 -1
- modules/sitemaps/sitemap-xsl.php +30 -2
- modules/sso.php +2 -2
- modules/sso/jetpack-sso-login-rtl.css +6 -0
- modules/sso/jetpack-sso-login-rtl.min.css +1 -1
- modules/sso/jetpack-sso-login.css +6 -0
- modules/sso/jetpack-sso-login.js +1 -1
- modules/sso/jetpack-sso-login.min.css +1 -1
- modules/stats.php +0 -23
- modules/subscriptions.php +0 -18
- modules/theme-tools/random-redirect.php +4 -2
- modules/theme-tools/site-breadcrumbs.php +56 -14
- modules/tiled-gallery/tiled-gallery.php +1 -1
- modules/verification-tools/blog-verification-tools.php +1 -1
- modules/videopress/js/videopress-admin.js +1 -1
- modules/widgets/contact-info.php +35 -37
- modules/widgets/contact-info/contact-info-admin.js +8 -0
- modules/widgets/contact-info/contact-info-map.css +4 -11
- modules/widgets/contact-info/contact-info-map.js +0 -41
- modules/widgets/gravatar-profile.php +1 -1
- modules/widgets/social-media-icons.php +1 -1
- modules/widgets/top-posts.php +1 -1
- modules/widgets/top-posts/style.css +1 -1
- modules/widgets/twitter-timeline.php +1 -1
- readme.txt +48 -3
- sal/class.json-api-links.php +4 -4
- sal/class.json-api-post-base.php +0 -1
- sal/class.json-api-site-base.php +1 -1
- sal/class.json-api-site-jetpack-base.php +26 -13
- sal/class.json-api-site-jetpack.php +29 -4
- sync/class.jetpack-sync-actions.php +248 -0
- sync/class.jetpack-sync-defaults.php +256 -0
- sync/class.jetpack-sync-functions.php +157 -0
- sync/class.jetpack-sync-json-deflate-codec.php +58 -0
- sync/class.jetpack-sync-listener.php +154 -0
- sync/class.jetpack-sync-module-attachments.php +28 -0
- sync/class.jetpack-sync-module-callables.php +144 -0
- sync/class.jetpack-sync-module-comments.php +129 -0
- sync/class.jetpack-sync-module-constants.php +123 -0
- sync/class.jetpack-sync-module-full-sync.php +241 -0
- sync/class.jetpack-sync-module-meta.php +34 -0
- sync/class.jetpack-sync-module-network-options.php +112 -0
- sync/class.jetpack-sync-module-options.php +141 -0
- sync/class.jetpack-sync-module-plugins.php +14 -0
- sync/class.jetpack-sync-module-posts.php +132 -0
- sync/class.jetpack-sync-module-protect.php +16 -0
- sync/class.jetpack-sync-module-terms.php +112 -0
- sync/class.jetpack-sync-module-themes.php +71 -0
- sync/class.jetpack-sync-module-updates.php +85 -0
- sync/class.jetpack-sync-module-users.php +197 -0
- sync/class.jetpack-sync-module.php +115 -0
- sync/class.jetpack-sync-modules.php +90 -0
- sync/class.jetpack-sync-queue.php +415 -0
- sync/class.jetpack-sync-sender.php +322 -0
- sync/class.jetpack-sync-server.php +106 -0
- sync/class.jetpack-sync-settings.php +75 -0
- sync/class.jetpack-sync-users.php +81 -0
- sync/class.jetpack-sync-wp-replicastore.php +694 -0
- sync/interface.jetpack-sync-codec.php +14 -0
- sync/interface.jetpack-sync-replicastore.php +125 -0
- uninstall.php +8 -2
- views/admin/my-jetpack-page.php +1 -0
3rd-party/3rd-party.php
CHANGED
@@ -10,4 +10,6 @@ require_once( JETPACK__PLUGIN_DIR . '3rd-party/wpml.php' );
|
|
10 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php' );
|
11 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php' );
|
12 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php' );
|
13 |
-
|
|
|
|
10 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bitly.php' );
|
11 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/bbpress.php' );
|
12 |
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce.php' );
|
13 |
+
|
14 |
+
// We can't load this conditionally since polldaddy add the call in class constuctor.
|
15 |
+
require_once( JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php' );
|
3rd-party/bitly.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/*
|
4 |
* Fixes issues with the Official Bitly for WordPress
|
5 |
-
*
|
6 |
*/
|
7 |
if( class_exists( 'Bitly' ) ) {
|
8 |
|
@@ -10,7 +10,7 @@ if( class_exists( 'Bitly' ) ) {
|
|
10 |
if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
|
11 |
remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
|
12 |
}
|
13 |
-
|
14 |
add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
|
15 |
}
|
16 |
|
2 |
|
3 |
/*
|
4 |
* Fixes issues with the Official Bitly for WordPress
|
5 |
+
* https://wordpress.org/plugins/bitly/
|
6 |
*/
|
7 |
if( class_exists( 'Bitly' ) ) {
|
8 |
|
10 |
if ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {
|
11 |
remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
|
12 |
}
|
13 |
+
|
14 |
add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
|
15 |
}
|
16 |
|
3rd-party/polldaddy.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync {
|
4 |
+
static function sync_options() {
|
5 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2', 'jetpack_options_whitelist filter' );
|
6 |
+
}
|
7 |
+
}
|
3rd-party/vaultpress.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* For backward compatibility with VaultPress 1.8.3 to play nicely with Jetpack 4.1
|
5 |
-
*/
|
6 |
-
add_action( 'init', 'jetpack_vaultpress_sync_options' );
|
7 |
-
function jetpack_vaultpress_sync_options() {
|
8 |
-
if ( ! class_exists( 'VaultPress' ) ) {
|
9 |
-
return;
|
10 |
-
}
|
11 |
-
$vaultpress = VaultPress::init();
|
12 |
-
Jetpack_Sync::sync_options( __FILE__, $vaultpress->auto_register_option, $vaultpress->option_name );
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jquery.jetpack-sync.js
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
/* global ajaxurl */
|
2 |
-
jQuery( document ).ready( function($) {
|
3 |
-
var update = function( cooldown ) {
|
4 |
-
var self = $( '.jetpack_sync_reindex_control' ),
|
5 |
-
data;
|
6 |
-
|
7 |
-
self
|
8 |
-
.find( '.jetpack_sync_reindex_control_action' )
|
9 |
-
.attr( 'disabled', true );
|
10 |
-
|
11 |
-
self
|
12 |
-
.find( '.jetpack_sync_reindex_control_status' )
|
13 |
-
.html( '…' );
|
14 |
-
|
15 |
-
if ( 'DONE' === self.data( 'status' ) ) {
|
16 |
-
data = { action:'jetpack-sync-reindex-trigger' };
|
17 |
-
} else {
|
18 |
-
data = { action:'jetpack-sync-reindex-status' };
|
19 |
-
}
|
20 |
-
|
21 |
-
$.getJSON(
|
22 |
-
ajaxurl,
|
23 |
-
data,
|
24 |
-
function( response ) {
|
25 |
-
var self = $( '.jetpack_sync_reindex_control' ),
|
26 |
-
strings,
|
27 |
-
status;
|
28 |
-
|
29 |
-
if ( 0 === self.length ) {
|
30 |
-
return;
|
31 |
-
}
|
32 |
-
|
33 |
-
strings = self.data( 'strings' );
|
34 |
-
status = strings[response.status].status;
|
35 |
-
|
36 |
-
if ( 'INDEXING' === response.status ) {
|
37 |
-
status += ' (' + Math.floor( 100 * response.posts.imported / response.posts.total ) + '%)';
|
38 |
-
}
|
39 |
-
|
40 |
-
self
|
41 |
-
.data( 'status', response.status );
|
42 |
-
|
43 |
-
self
|
44 |
-
.find( '.jetpack_sync_reindex_control_action' )
|
45 |
-
.val( strings[response.status].action );
|
46 |
-
|
47 |
-
self
|
48 |
-
.find( '.jetpack_sync_reindex_control_status' )
|
49 |
-
.text( status );
|
50 |
-
|
51 |
-
setTimeout( function() {
|
52 |
-
$( '.jetpack_sync_reindex_control' )
|
53 |
-
.find( '.jetpack_sync_reindex_control_action' )
|
54 |
-
.attr( 'disabled', false );
|
55 |
-
}, cooldown );
|
56 |
-
}
|
57 |
-
);
|
58 |
-
};
|
59 |
-
|
60 |
-
$( '.jetpack_sync_reindex_control' )
|
61 |
-
.find( '.jetpack_sync_reindex_control_action' )
|
62 |
-
.live( 'click', function( event ) {
|
63 |
-
event.preventDefault();
|
64 |
-
update( 5000 );
|
65 |
-
} );
|
66 |
-
|
67 |
-
update( 1000 );
|
68 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tonesque.php
CHANGED
@@ -37,27 +37,7 @@ class Tonesque {
|
|
37 |
}
|
38 |
|
39 |
public static function imagecreatefromurl( $image_url ) {
|
40 |
-
|
41 |
-
$file = strtolower( pathinfo( $image_url, PATHINFO_EXTENSION ) );
|
42 |
-
$file = explode( '?', $file );
|
43 |
-
$file = $file[ 0 ];
|
44 |
-
|
45 |
-
switch ( $file ) {
|
46 |
-
case 'gif' :
|
47 |
-
$image_obj = imagecreatefromgif( $image_url );
|
48 |
-
break;
|
49 |
-
case 'png' :
|
50 |
-
$image_obj = imagecreatefrompng( $image_url );
|
51 |
-
break;
|
52 |
-
case 'jpg' :
|
53 |
-
case 'jpeg' :
|
54 |
-
$image_obj = imagecreatefromjpeg( $image_url );
|
55 |
-
break;
|
56 |
-
default:
|
57 |
-
return false;
|
58 |
-
}
|
59 |
-
|
60 |
-
return $image_obj;
|
61 |
}
|
62 |
|
63 |
/**
|
37 |
}
|
38 |
|
39 |
public static function imagecreatefromurl( $image_url ) {
|
40 |
+
return imagecreatefromstring( file_get_contents( $image_url ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
changelog.txt
CHANGED
@@ -103,7 +103,7 @@ Bug Fixes:
|
|
103 |
* We accidentally removed the ability for Open Graph to select images from slideshows, it’s up and running again.
|
104 |
* There was an issue where Open Graph meta tags weren’t being set when your homepage is a “Static Front Page”, it’s working again.
|
105 |
* In rare cases when developers were customizing Photon they were seeing a PHP notice when arguments were passed as a string rather than an array. This has been fixed.
|
106 |
-
* We’ve fixed an issue where Protect’s backup math form wasn’t showing on custom
|
107 |
* When setting up WooCommerce you might have seen a Related Posts notice which didn’t belong. We’ve eliminated them.
|
108 |
* If you’ve been using our sharing tool with unofficial sharing buttons you might have noticed your sharing numbers were missing. They’re now back.
|
109 |
* In unique situations where special characters were used in sitemap stylesheets an error would occur; that has been remedied.
|
@@ -1282,7 +1282,7 @@ Release Post: http://wp.me/p1moTy-oR
|
|
1282 |
* Bug Fix: Contact Form - RTL styles
|
1283 |
* Bug Fix: Contact Form - Better handle MP6 icons
|
1284 |
* Bug Fix: Custom CSS - array_shift() took a variable by reference, so avoid passing it the result of a function
|
1285 |
-
* Bug Fix: Custom CSS - Allow case-insensitive CSS properties (<a href="
|
1286 |
* Bug Fix: Infinite Scroll - Maintain main query's `post__not_in` values when querying posts for IS
|
1287 |
* Bug Fix: Infinite Scroll - Ensure that IS's `pre_get_posts` method isn't applied in the admin. Also fixes an incorrect use of `add_filter()` where `add_action()` was meant. Fixes #1696-plugins
|
1288 |
* Bug Fix: Infinite Scroll - CSS update - IS footer was too large in Firefox
|
@@ -1475,7 +1475,7 @@ Release Post: http://wp.me/p1moTy-lT
|
|
1475 |
Release Date: December 14, 2012
|
1476 |
Release Post: http://wp.me/p1moTy-lJ
|
1477 |
|
1478 |
-
* Enhancement: Infinite Scroll: support [VideoPress](
|
1479 |
* Enhancement: Photon: Apply to all images retrieved from the Media Library.
|
1480 |
* Enhancement: Photon: Retina image support.
|
1481 |
* Enhancement: Custom CSS: Refined editor interface.
|
@@ -1495,7 +1495,7 @@ Release Post: http://wp.me/p1moTy-lu
|
|
1495 |
Release Date: November 21, 2012
|
1496 |
Release Post: http://wp.me/p1moTy-lc
|
1497 |
|
1498 |
-
* Enhancement: Photon: Support for the [Lazy Load](
|
1499 |
* Bug Fix: Photon: Fix warped images with un- or under-specified dimensions.
|
1500 |
* Bug Fix: Photon: Fix warped images with pre-photonized URLs; don't try to photonize them twice.
|
1501 |
* Bug Fix: Infinite Scroll: Check a child theme's parent theme for infinite scroll support.
|
@@ -1552,7 +1552,7 @@ Release Post: http://wp.me/p1moTy-hC
|
|
1552 |
* Enhancement: Contact Form: Overhaul of the contact form code to fix incompatibilites with other plugins.
|
1553 |
* Bug Fix: Only allow users with manage_options permission to enable/disable modules
|
1554 |
* Bug Fix: Custom CSS: allow '/' in media query units; e.g. (-o-min-device-pixel-ratio: 3/2)
|
1555 |
-
* Bug Fix: Custom CSS: leave comments alone in CSS when editing but minify on the
|
1556 |
* Bug Fix: Sharing: Keep "more" pane open so Google+ Button isn't obscured
|
1557 |
* Bug Fix: Carousel: Make sure the original size is used, even when it is exceedingly large.
|
1558 |
* Bug Fix: Exclude iPad from Twitter on iPhone mobile browsing
|
@@ -1788,7 +1788,7 @@ Release Post: http://wp.me/p1moTy-8x
|
|
1788 |
* Enhancement: Stats: More responsive stats dashboard.
|
1789 |
* Enhancement: Shortcodes: Google Maps, VideoPress
|
1790 |
* Enhancement: Sharing: Google+, LinkedIn
|
1791 |
-
* Enhancement: Enhanced Distribution: Added Jetpack blogs to
|
1792 |
* Bug Fix: Spelling and Grammar: WordPress 3.3 compatibility.
|
1793 |
* Bug Fix: Translatable module names/descriptinos.
|
1794 |
* Bug Fix: Correctly detect host's ability to make outgoing HTTPS requests.
|
103 |
* We accidentally removed the ability for Open Graph to select images from slideshows, it’s up and running again.
|
104 |
* There was an issue where Open Graph meta tags weren’t being set when your homepage is a “Static Front Page”, it’s working again.
|
105 |
* In rare cases when developers were customizing Photon they were seeing a PHP notice when arguments were passed as a string rather than an array. This has been fixed.
|
106 |
+
* We’ve fixed an issue where Protect’s backup math form wasn’t showing on custom front end login forms.
|
107 |
* When setting up WooCommerce you might have seen a Related Posts notice which didn’t belong. We’ve eliminated them.
|
108 |
* If you’ve been using our sharing tool with unofficial sharing buttons you might have noticed your sharing numbers were missing. They’re now back.
|
109 |
* In unique situations where special characters were used in sitemap stylesheets an error would occur; that has been remedied.
|
1282 |
* Bug Fix: Contact Form - RTL styles
|
1283 |
* Bug Fix: Contact Form - Better handle MP6 icons
|
1284 |
* Bug Fix: Custom CSS - array_shift() took a variable by reference, so avoid passing it the result of a function
|
1285 |
+
* Bug Fix: Custom CSS - Allow case-insensitive CSS properties (<a href="https://wordpress.org/support/topic/two-issues-with-jetpack-css-module?replies=9">ref</a>)
|
1286 |
* Bug Fix: Infinite Scroll - Maintain main query's `post__not_in` values when querying posts for IS
|
1287 |
* Bug Fix: Infinite Scroll - Ensure that IS's `pre_get_posts` method isn't applied in the admin. Also fixes an incorrect use of `add_filter()` where `add_action()` was meant. Fixes #1696-plugins
|
1288 |
* Bug Fix: Infinite Scroll - CSS update - IS footer was too large in Firefox
|
1475 |
Release Date: December 14, 2012
|
1476 |
Release Post: http://wp.me/p1moTy-lJ
|
1477 |
|
1478 |
+
* Enhancement: Infinite Scroll: support [VideoPress](https://wordpress.org/plugins/video/) plugin.
|
1479 |
* Enhancement: Photon: Apply to all images retrieved from the Media Library.
|
1480 |
* Enhancement: Photon: Retina image support.
|
1481 |
* Enhancement: Custom CSS: Refined editor interface.
|
1495 |
Release Date: November 21, 2012
|
1496 |
Release Post: http://wp.me/p1moTy-lc
|
1497 |
|
1498 |
+
* Enhancement: Photon: Support for the [Lazy Load](https://wordpress.org/plugins/lazy-load/) plugin.
|
1499 |
* Bug Fix: Photon: Fix warped images with un- or under-specified dimensions.
|
1500 |
* Bug Fix: Photon: Fix warped images with pre-photonized URLs; don't try to photonize them twice.
|
1501 |
* Bug Fix: Infinite Scroll: Check a child theme's parent theme for infinite scroll support.
|
1552 |
* Enhancement: Contact Form: Overhaul of the contact form code to fix incompatibilites with other plugins.
|
1553 |
* Bug Fix: Only allow users with manage_options permission to enable/disable modules
|
1554 |
* Bug Fix: Custom CSS: allow '/' in media query units; e.g. (-o-min-device-pixel-ratio: 3/2)
|
1555 |
+
* Bug Fix: Custom CSS: leave comments alone in CSS when editing but minify on the front end
|
1556 |
* Bug Fix: Sharing: Keep "more" pane open so Google+ Button isn't obscured
|
1557 |
* Bug Fix: Carousel: Make sure the original size is used, even when it is exceedingly large.
|
1558 |
* Bug Fix: Exclude iPad from Twitter on iPhone mobile browsing
|
1788 |
* Enhancement: Stats: More responsive stats dashboard.
|
1789 |
* Enhancement: Shortcodes: Google Maps, VideoPress
|
1790 |
* Enhancement: Sharing: Google+, LinkedIn
|
1791 |
+
* Enhancement: Enhanced Distribution: Added Jetpack blogs to https://en.wordpress.com/firehose/
|
1792 |
* Bug Fix: Spelling and Grammar: WordPress 3.3 compatibility.
|
1793 |
* Bug Fix: Translatable module names/descriptinos.
|
1794 |
* Bug Fix: Correctly detect host's ability to make outgoing HTTPS requests.
|
class.jetpack-admin.php
CHANGED
@@ -36,14 +36,13 @@ class Jetpack_Admin {
|
|
36 |
if ( isset( $_POST['jetpack-set-master-user'] ) ) {
|
37 |
add_action( 'init', array( $this->my_jetpack_page, 'jetpack_my_jetpack_change_user' ) );
|
38 |
}
|
39 |
-
|
40 |
// Add hooks for admin menus
|
41 |
add_action( 'admin_menu', array( $this->landing_page, 'add_actions' ), 998 );
|
42 |
add_action( 'jetpack_admin_menu', array( $this, 'admin_menu_debugger' ) );
|
43 |
add_action( 'jetpack_admin_menu', array( $this->settings_page, 'add_actions' ) );
|
44 |
add_action( 'jetpack_admin_menu', array( $this->my_jetpack_page, 'add_actions' ) );
|
45 |
|
46 |
-
|
47 |
// Add redirect to current page for activation/deactivation of modules
|
48 |
add_action( 'jetpack_pre_activate_module', array( $this, 'fix_redirect' ), 10, 2 );
|
49 |
add_action( 'jetpack_pre_deactivate_module', array( $this, 'fix_redirect' ) );
|
36 |
if ( isset( $_POST['jetpack-set-master-user'] ) ) {
|
37 |
add_action( 'init', array( $this->my_jetpack_page, 'jetpack_my_jetpack_change_user' ) );
|
38 |
}
|
39 |
+
|
40 |
// Add hooks for admin menus
|
41 |
add_action( 'admin_menu', array( $this->landing_page, 'add_actions' ), 998 );
|
42 |
add_action( 'jetpack_admin_menu', array( $this, 'admin_menu_debugger' ) );
|
43 |
add_action( 'jetpack_admin_menu', array( $this->settings_page, 'add_actions' ) );
|
44 |
add_action( 'jetpack_admin_menu', array( $this->my_jetpack_page, 'add_actions' ) );
|
45 |
|
|
|
46 |
// Add redirect to current page for activation/deactivation of modules
|
47 |
add_action( 'jetpack_pre_activate_module', array( $this, 'fix_redirect' ), 10, 2 );
|
48 |
add_action( 'jetpack_pre_deactivate_module', array( $this, 'fix_redirect' ) );
|
class.jetpack-bbpress-json-api-compat.php
CHANGED
@@ -21,11 +21,6 @@ class bbPress_Jetpack_REST_API {
|
|
21 |
}
|
22 |
|
23 |
function allow_bbpress_post_types( $allowed_post_types ) {
|
24 |
-
|
25 |
-
// only run for REST API requests
|
26 |
-
if ( ! defined( 'REST_API_REQUEST' ) || ! REST_API_REQUEST )
|
27 |
-
return $allowed_post_types;
|
28 |
-
|
29 |
$allowed_post_types[] = 'forum';
|
30 |
$allowed_post_types[] = 'topic';
|
31 |
$allowed_post_types[] = 'reply';
|
@@ -33,11 +28,6 @@ class bbPress_Jetpack_REST_API {
|
|
33 |
}
|
34 |
|
35 |
function allow_bbpress_public_metadata( $allowed_meta_keys ) {
|
36 |
-
|
37 |
-
// only run for REST API requests
|
38 |
-
if ( ! defined( 'REST_API_REQUEST' ) || ! REST_API_REQUEST )
|
39 |
-
return $allowed_meta_keys;
|
40 |
-
|
41 |
$allowed_meta_keys[] = '_bbp_forum_id';
|
42 |
$allowed_meta_keys[] = '_bbp_topic_id';
|
43 |
$allowed_meta_keys[] = '_bbp_status';
|
21 |
}
|
22 |
|
23 |
function allow_bbpress_post_types( $allowed_post_types ) {
|
|
|
|
|
|
|
|
|
|
|
24 |
$allowed_post_types[] = 'forum';
|
25 |
$allowed_post_types[] = 'topic';
|
26 |
$allowed_post_types[] = 'reply';
|
28 |
}
|
29 |
|
30 |
function allow_bbpress_public_metadata( $allowed_meta_keys ) {
|
|
|
|
|
|
|
|
|
|
|
31 |
$allowed_meta_keys[] = '_bbp_forum_id';
|
32 |
$allowed_meta_keys[] = '_bbp_topic_id';
|
33 |
$allowed_meta_keys[] = '_bbp_status';
|
class.jetpack-cli.php
CHANGED
@@ -215,7 +215,7 @@ class Jetpack_CLI extends WP_CLI_Command {
|
|
215 |
_e( "Resetting default modules...\n", "jetpack" );
|
216 |
usleep( 500000 ); // Take a breath
|
217 |
$default_modules = Jetpack::get_default_modules();
|
218 |
-
|
219 |
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
220 |
|
221 |
// Jumpstart option is special
|
@@ -224,7 +224,7 @@ class Jetpack_CLI extends WP_CLI_Command {
|
|
224 |
break;
|
225 |
case 'modules':
|
226 |
$default_modules = Jetpack::get_default_modules();
|
227 |
-
|
228 |
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
229 |
break;
|
230 |
case 'prompt':
|
@@ -306,7 +306,7 @@ class Jetpack_CLI extends WP_CLI_Command {
|
|
306 |
break;
|
307 |
case 'activate_all':
|
308 |
$modules = Jetpack::get_available_modules();
|
309 |
-
|
310 |
WP_CLI::success( __( 'All modules activated!', 'jetpack' ) );
|
311 |
break;
|
312 |
case 'deactivate':
|
@@ -316,7 +316,7 @@ class Jetpack_CLI extends WP_CLI_Command {
|
|
316 |
WP_CLI::success( sprintf( __( '%s has been deactivated.', 'jetpack' ), $module['name'] ) );
|
317 |
break;
|
318 |
case 'deactivate_all':
|
319 |
-
|
320 |
WP_CLI::success( __( 'All modules deactivated!', 'jetpack' ) );
|
321 |
break;
|
322 |
case 'toggle':
|
215 |
_e( "Resetting default modules...\n", "jetpack" );
|
216 |
usleep( 500000 ); // Take a breath
|
217 |
$default_modules = Jetpack::get_default_modules();
|
218 |
+
Jetpack::update_active_modules( $default_modules );
|
219 |
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
220 |
|
221 |
// Jumpstart option is special
|
224 |
break;
|
225 |
case 'modules':
|
226 |
$default_modules = Jetpack::get_default_modules();
|
227 |
+
Jetpack::update_active_modules( $default_modules );
|
228 |
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
229 |
break;
|
230 |
case 'prompt':
|
306 |
break;
|
307 |
case 'activate_all':
|
308 |
$modules = Jetpack::get_available_modules();
|
309 |
+
Jetpack::update_active_modules( $modules );
|
310 |
WP_CLI::success( __( 'All modules activated!', 'jetpack' ) );
|
311 |
break;
|
312 |
case 'deactivate':
|
316 |
WP_CLI::success( sprintf( __( '%s has been deactivated.', 'jetpack' ), $module['name'] ) );
|
317 |
break;
|
318 |
case 'deactivate_all':
|
319 |
+
Jetpack::delete_active_modules();
|
320 |
WP_CLI::success( __( 'All modules deactivated!', 'jetpack' ) );
|
321 |
break;
|
322 |
case 'toggle':
|
class.jetpack-client-server.php
CHANGED
@@ -12,8 +12,7 @@ class Jetpack_Client_Server {
|
|
12 |
function client_authorize() {
|
13 |
$data = stripslashes_deep( $_GET );
|
14 |
$data['auth_type'] = 'client';
|
15 |
-
$
|
16 |
-
$role = $jetpack->translate_current_user_to_role();
|
17 |
$redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : '';
|
18 |
|
19 |
$this->check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" );
|
@@ -29,6 +28,15 @@ class Jetpack_Client_Server {
|
|
29 |
$this->wp_safe_redirect( Jetpack::admin_url() );
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$this->do_exit();
|
33 |
}
|
34 |
|
@@ -48,7 +56,7 @@ class Jetpack_Client_Server {
|
|
48 |
update_option( 'jetpack_unique_connection', $jetpack_unique_connection );
|
49 |
|
50 |
//track unique connection
|
51 |
-
$jetpack =
|
52 |
|
53 |
$jetpack->stat( 'connections', 'unique-connection' );
|
54 |
$jetpack->do_stats( 'server_side' );
|
@@ -58,14 +66,13 @@ class Jetpack_Client_Server {
|
|
58 |
$jetpack_unique_connection['connected'] += 1;
|
59 |
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
60 |
|
61 |
-
$
|
62 |
-
$role = $jetpack->translate_current_user_to_role();
|
63 |
|
64 |
if ( ! $role ) {
|
65 |
return new Jetpack_Error( 'no_role', 'Invalid request.', 400 );
|
66 |
}
|
67 |
|
68 |
-
$cap =
|
69 |
if ( ! $cap ) {
|
70 |
return new Jetpack_Error( 'no_cap', 'Invalid request.', 400 );
|
71 |
}
|
@@ -116,17 +123,13 @@ class Jetpack_Client_Server {
|
|
116 |
|
117 |
$redirect_on_activation_error = ( 'client' === $data['auth_type'] ) ? true : false;
|
118 |
if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
|
119 |
-
|
120 |
|
121 |
Jetpack::activate_default_modules( 999, 1, $active_modules, $redirect_on_activation_error );
|
122 |
} else {
|
123 |
Jetpack::activate_default_modules( false, false, array(), $redirect_on_activation_error );
|
124 |
}
|
125 |
-
|
126 |
-
// Sync all registers options and constants
|
127 |
-
/** This action is documented in class.jetpack.php */
|
128 |
-
do_action( 'jetpack_sync_all_registered_options' );
|
129 |
-
|
130 |
// Start nonce cleaner
|
131 |
wp_clear_scheduled_hook( 'jetpack_clean_nonces' );
|
132 |
wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' );
|
@@ -158,8 +161,7 @@ class Jetpack_Client_Server {
|
|
158 |
* @return object|WP_Error
|
159 |
*/
|
160 |
function get_token( $data ) {
|
161 |
-
$
|
162 |
-
$role = $jetpack->translate_current_user_to_role();
|
163 |
|
164 |
if ( ! $role ) {
|
165 |
return new Jetpack_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack' ) );
|
@@ -236,11 +238,11 @@ class Jetpack_Client_Server {
|
|
236 |
return new Jetpack_Error( 'scope', 'Malformed Scope', $code );
|
237 |
}
|
238 |
|
239 |
-
if (
|
240 |
return new Jetpack_Error( 'scope', 'Invalid Scope', $code );
|
241 |
}
|
242 |
|
243 |
-
if ( ! $cap =
|
244 |
return new Jetpack_Error( 'scope', 'No Cap', $code );
|
245 |
}
|
246 |
|
12 |
function client_authorize() {
|
13 |
$data = stripslashes_deep( $_GET );
|
14 |
$data['auth_type'] = 'client';
|
15 |
+
$role = Jetpack::translate_current_user_to_role();
|
|
|
16 |
$redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : '';
|
17 |
|
18 |
$this->check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" );
|
28 |
$this->wp_safe_redirect( Jetpack::admin_url() );
|
29 |
}
|
30 |
|
31 |
+
/**
|
32 |
+
* Fires after the Jetpack client is authorized to communicate with WordPress.com.
|
33 |
+
*
|
34 |
+
* @since 4.2.0
|
35 |
+
*
|
36 |
+
* @param int Jetpack Blog ID.
|
37 |
+
*/
|
38 |
+
do_action( 'jetpack_client_authorized', Jetpack_Options::get_option( 'id' ) );
|
39 |
+
|
40 |
$this->do_exit();
|
41 |
}
|
42 |
|
56 |
update_option( 'jetpack_unique_connection', $jetpack_unique_connection );
|
57 |
|
58 |
//track unique connection
|
59 |
+
$jetpack = $this->get_jetpack();;
|
60 |
|
61 |
$jetpack->stat( 'connections', 'unique-connection' );
|
62 |
$jetpack->do_stats( 'server_side' );
|
66 |
$jetpack_unique_connection['connected'] += 1;
|
67 |
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
68 |
|
69 |
+
$role = Jetpack::translate_current_user_to_role();
|
|
|
70 |
|
71 |
if ( ! $role ) {
|
72 |
return new Jetpack_Error( 'no_role', 'Invalid request.', 400 );
|
73 |
}
|
74 |
|
75 |
+
$cap = Jetpack::translate_role_to_cap( $role );
|
76 |
if ( ! $cap ) {
|
77 |
return new Jetpack_Error( 'no_cap', 'Invalid request.', 400 );
|
78 |
}
|
123 |
|
124 |
$redirect_on_activation_error = ( 'client' === $data['auth_type'] ) ? true : false;
|
125 |
if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
|
126 |
+
Jetpack::delete_active_modules();
|
127 |
|
128 |
Jetpack::activate_default_modules( 999, 1, $active_modules, $redirect_on_activation_error );
|
129 |
} else {
|
130 |
Jetpack::activate_default_modules( false, false, array(), $redirect_on_activation_error );
|
131 |
}
|
132 |
+
|
|
|
|
|
|
|
|
|
133 |
// Start nonce cleaner
|
134 |
wp_clear_scheduled_hook( 'jetpack_clean_nonces' );
|
135 |
wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' );
|
161 |
* @return object|WP_Error
|
162 |
*/
|
163 |
function get_token( $data ) {
|
164 |
+
$role = Jetpack::translate_current_user_to_role();
|
|
|
165 |
|
166 |
if ( ! $role ) {
|
167 |
return new Jetpack_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack' ) );
|
238 |
return new Jetpack_Error( 'scope', 'Malformed Scope', $code );
|
239 |
}
|
240 |
|
241 |
+
if ( Jetpack::sign_role( $role ) !== $json->scope ) {
|
242 |
return new Jetpack_Error( 'scope', 'Invalid Scope', $code );
|
243 |
}
|
244 |
|
245 |
+
if ( ! $cap = Jetpack::translate_role_to_cap( $role ) ) {
|
246 |
return new Jetpack_Error( 'scope', 'No Cap', $code );
|
247 |
}
|
248 |
|
class.jetpack-debugger.php
CHANGED
@@ -18,6 +18,27 @@ class Jetpack_Debugger {
|
|
18 |
}
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
public static function jetpack_increase_timeout() {
|
22 |
return 30; // seconds
|
23 |
}
|
@@ -60,6 +81,40 @@ class Jetpack_Debugger {
|
|
60 |
$debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
|
61 |
$debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
foreach ( array (
|
64 |
'HTTP_HOST',
|
65 |
'SERVER_PORT',
|
@@ -172,7 +227,7 @@ class Jetpack_Debugger {
|
|
172 |
<h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
|
173 |
<h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
|
174 |
<ol>
|
175 |
-
<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" target="_blank">known conflicts</a> with Jetpack – check the <a href="%2$s" target="_blank">list</a>. (You can also browse the <a href="%3$s" target="_blank">Jetpack support pages</a> or <a href="%4$s" target="_blank">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/', '
|
176 |
<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>
|
177 |
<li>
|
178 |
<b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b>
|
@@ -203,11 +258,6 @@ class Jetpack_Debugger {
|
|
203 |
<div id="connected-user-details">
|
204 |
<p><?php printf( __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ), esc_html( Jetpack::get_master_user_email() ) ); ?></p>
|
205 |
</div>
|
206 |
-
<hr />
|
207 |
-
<div id="sync-related-posts">
|
208 |
-
<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>
|
209 |
-
<?php echo Jetpack::init()->sync->reindex_ui() ?>
|
210 |
-
</div>
|
211 |
<?php endif; ?>
|
212 |
</div>
|
213 |
<div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
|
@@ -236,7 +286,7 @@ class Jetpack_Debugger {
|
|
236 |
?>
|
237 |
<div class="formbox">
|
238 |
<label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
|
239 |
-
<textarea name="message" cols="40" rows="7" id="did"
|
240 |
</div>
|
241 |
|
242 |
<div id="name_div" class="formbox">
|
@@ -264,7 +314,7 @@ class Jetpack_Debugger {
|
|
264 |
|
265 |
<div id="blog_div" class="formbox">
|
266 |
<div id="submit_div" class="contact-support">
|
267 |
-
<input type="submit" name="submit" value="<?php esc_html_e( 'Submit »', 'jetpack' ); ?>">
|
268 |
</div>
|
269 |
</div>
|
270 |
<div style="clear: both;"></div>
|
@@ -274,7 +324,7 @@ class Jetpack_Debugger {
|
|
274 |
<div id="toggle_debug_info"><a href="#"><?php _e( 'View Advanced Debug Results', 'jetpack' ); ?></a></div>
|
275 |
<div id="debug_info_div" style="display:none">
|
276 |
<h4><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></h4>
|
277 |
-
<div id="debug_info"><?php echo
|
278 |
</div>
|
279 |
</div>
|
280 |
<?php
|
@@ -326,13 +376,11 @@ class Jetpack_Debugger {
|
|
326 |
|
327 |
form#contactme {
|
328 |
border: 1px solid #dfdfdf;
|
329 |
-
background: #
|
330 |
padding: 20px;
|
331 |
margin: 10px;
|
332 |
-
background-color: #
|
333 |
-
border-radius: 5px;
|
334 |
font-size: 15px;
|
335 |
-
font-family: "Open Sans", "Helvetica Neue", sans-serif;
|
336 |
}
|
337 |
|
338 |
form#contactme label.h {
|
@@ -349,31 +397,17 @@ class Jetpack_Debugger {
|
|
349 |
|
350 |
.formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea, #debug_info_div {
|
351 |
border: 1px solid #e5e5e5;
|
352 |
-
border-radius: 11px;
|
353 |
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
|
354 |
color: #666;
|
355 |
font-size: 14px;
|
356 |
padding: 10px;
|
357 |
width: 97%;
|
358 |
}
|
359 |
-
|
360 |
-
|
361 |
-
margin:
|
362 |
-
|
363 |
-
|
364 |
-
font-size: 13pt !important;
|
365 |
-
height: auto !important;
|
366 |
-
margin: 0 0 2em 10px !important;
|
367 |
-
padding: 8px 16px !important;
|
368 |
-
background-color: #ddd;
|
369 |
-
border: 1px solid rgba(0,0,0,0.05);
|
370 |
-
border-top-color: rgba(255,255,255,0.1);
|
371 |
-
border-bottom-color: rgba(0,0,0,0.15);
|
372 |
-
color: #333;
|
373 |
-
font-weight: 400;
|
374 |
-
display: inline-block;
|
375 |
-
text-align: center;
|
376 |
-
text-decoration: none;
|
377 |
}
|
378 |
|
379 |
.formbox span.errormsg {
|
@@ -397,7 +431,7 @@ class Jetpack_Debugger {
|
|
397 |
}
|
398 |
|
399 |
#debug_info_div, #toggle_debug_info, #debug_info_div p {
|
400 |
-
font-size:
|
401 |
}
|
402 |
|
403 |
</style>
|
@@ -444,7 +478,7 @@ class Jetpack_Debugger {
|
|
444 |
if ( validation_error ) {
|
445 |
return false;
|
446 |
}
|
447 |
-
message.val( message.val() + "\r\n\r\n----------------------------------------------\r\n\r\nDEBUG INFO:\r\n" + $('#
|
448 |
return true;
|
449 |
});
|
450 |
|
18 |
}
|
19 |
}
|
20 |
|
21 |
+
static function seconds_to_time( $seconds ) {
|
22 |
+
$units = array(
|
23 |
+
"week" => 7*24*3600,
|
24 |
+
"day" => 24*3600,
|
25 |
+
"hour" => 3600,
|
26 |
+
"minute" => 60,
|
27 |
+
"second" => 1,
|
28 |
+
);
|
29 |
+
// specifically handle zero
|
30 |
+
if ( $seconds == 0 ) return "0 seconds";
|
31 |
+
$human_readable = "";
|
32 |
+
foreach ( $units as $name => $divisor ) {
|
33 |
+
if ( $quot = intval( $seconds / $divisor) ) {
|
34 |
+
$human_readable .= "$quot $name";
|
35 |
+
$human_readable .= ( abs( $quot ) > 1 ? "s" : "" ) . ", ";
|
36 |
+
$seconds -= $quot * $divisor;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
return substr( $human_readable, 0, -2 );
|
40 |
+
}
|
41 |
+
|
42 |
public static function jetpack_increase_timeout() {
|
43 |
return 30; // seconds
|
44 |
}
|
81 |
$debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
|
82 |
$debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
|
83 |
|
84 |
+
$debug_info .= "\r\n";
|
85 |
+
require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-modules.php';
|
86 |
+
$sync_module = Jetpack_Sync_Modules::get_module( 'full-sync' );
|
87 |
+
$sync_statuses = $sync_module->get_status();
|
88 |
+
$human_readable_sync_status = array();
|
89 |
+
foreach( $sync_statuses as $sync_status => $sync_status_value ) {
|
90 |
+
$human_readable_sync_status[ $sync_status ] =
|
91 |
+
in_array( $sync_status, array( 'started', 'queue_finished', 'sent_started', 'finished' ) )
|
92 |
+
? date( 'r', $sync_status_value ) : $sync_status_value ;
|
93 |
+
}
|
94 |
+
|
95 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Jetpack Sync Full Status: `%1$s`', 'jetpack' ), print_r( $human_readable_sync_status, 1 ) );
|
96 |
+
|
97 |
+
$next_schedules = wp_next_scheduled( 'jetpack_sync_full' );
|
98 |
+
if( $next_schedules ) {
|
99 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Next Jetpack Full Sync Schedule: `%1$s`', 'jetpack' ), date( 'r', $next_schedules ) );
|
100 |
+
} else {
|
101 |
+
$debug_info .= "\r\n". esc_html__( "Next Jetpack Full Sync Schedule: Not Scheduled", 'jetpack' );
|
102 |
+
}
|
103 |
+
|
104 |
+
require_once JETPACK__PLUGIN_DIR. 'sync/class.jetpack-sync-sender.php';
|
105 |
+
|
106 |
+
$queue = Jetpack_Sync_Sender::get_instance()->get_sync_queue();
|
107 |
+
|
108 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Sync Queue size: %1$s', 'jetpack' ), $queue->size() );
|
109 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Sync Queue lag: %1$s', 'jetpack' ), self::seconds_to_time( $queue->lag() ) );
|
110 |
+
|
111 |
+
$full_sync_queue = Jetpack_Sync_Sender::get_instance()->get_full_sync_queue();
|
112 |
+
|
113 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Full Sync Queue size: %1$s', 'jetpack' ), $full_sync_queue->size() );
|
114 |
+
$debug_info .= "\r\n". sprintf( esc_html__( 'Full Sync Queue lag: %1$s', 'jetpack' ), self::seconds_to_time( $full_sync_queue->lag() ) );
|
115 |
+
|
116 |
+
$debug_info .= "\r\n";
|
117 |
+
|
118 |
foreach ( array (
|
119 |
'HTTP_HOST',
|
120 |
'SERVER_PORT',
|
227 |
<h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
|
228 |
<h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
|
229 |
<ol>
|
230 |
+
<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" target="_blank">known conflicts</a> with Jetpack – check the <a href="%2$s" target="_blank">list</a>. (You can also browse the <a href="%3$s" target="_blank">Jetpack support pages</a> or <a href="%4$s" target="_blank">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/', 'https://wordpress.org/support/plugin/jetpack' ); ?></li>
|
231 |
<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>
|
232 |
<li>
|
233 |
<b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b>
|
258 |
<div id="connected-user-details">
|
259 |
<p><?php printf( __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ), esc_html( Jetpack::get_master_user_email() ) ); ?></p>
|
260 |
</div>
|
|
|
|
|
|
|
|
|
|
|
261 |
<?php endif; ?>
|
262 |
</div>
|
263 |
<div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
|
286 |
?>
|
287 |
<div class="formbox">
|
288 |
<label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
|
289 |
+
<textarea name="message" cols="40" rows="7" id="did"><?php echo ( isset( $_GET['note'] ) ? esc_textarea( $_GET['note'] ) : '' ); ?></textarea>
|
290 |
</div>
|
291 |
|
292 |
<div id="name_div" class="formbox">
|
314 |
|
315 |
<div id="blog_div" class="formbox">
|
316 |
<div id="submit_div" class="contact-support">
|
317 |
+
<input type="submit" name="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Submit »', 'jetpack' ); ?>">
|
318 |
</div>
|
319 |
</div>
|
320 |
<div style="clear: both;"></div>
|
324 |
<div id="toggle_debug_info"><a href="#"><?php _e( 'View Advanced Debug Results', 'jetpack' ); ?></a></div>
|
325 |
<div id="debug_info_div" style="display:none">
|
326 |
<h4><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></h4>
|
327 |
+
<div id="debug_info"><pre><?php echo esc_html( $debug_info ) ; ?></pre></div>
|
328 |
</div>
|
329 |
</div>
|
330 |
<?php
|
376 |
|
377 |
form#contactme {
|
378 |
border: 1px solid #dfdfdf;
|
379 |
+
background: #FFF;
|
380 |
padding: 20px;
|
381 |
margin: 10px;
|
382 |
+
background-color: #F3F6F8;
|
|
|
383 |
font-size: 15px;
|
|
|
384 |
}
|
385 |
|
386 |
form#contactme label.h {
|
397 |
|
398 |
.formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea, #debug_info_div {
|
399 |
border: 1px solid #e5e5e5;
|
|
|
400 |
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
|
401 |
color: #666;
|
402 |
font-size: 14px;
|
403 |
padding: 10px;
|
404 |
width: 97%;
|
405 |
}
|
406 |
+
#debug_info_div {
|
407 |
+
border-radius: 0;
|
408 |
+
margin-top: 16px;
|
409 |
+
background: #FFF;
|
410 |
+
padding: 16px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
}
|
412 |
|
413 |
.formbox span.errormsg {
|
431 |
}
|
432 |
|
433 |
#debug_info_div, #toggle_debug_info, #debug_info_div p {
|
434 |
+
font-size: 12px;
|
435 |
}
|
436 |
|
437 |
</style>
|
478 |
if ( validation_error ) {
|
479 |
return false;
|
480 |
}
|
481 |
+
message.val( message.val() + "\r\n\r\n----------------------------------------------\r\n\r\nDEBUG INFO:\r\n" + $('#debug_form_info').val() );
|
482 |
return true;
|
483 |
});
|
484 |
|
class.jetpack-heartbeat.php
CHANGED
@@ -139,6 +139,10 @@ class Jetpack_Heartbeat {
|
|
139 |
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active( $slug ) ? 'on' : 'off';
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
142 |
return $return;
|
143 |
}
|
144 |
|
139 |
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active( $slug ) ? 'on' : 'off';
|
140 |
}
|
141 |
|
142 |
+
require_once dirname(__FILE__).'/sync/class.jetpack-sync-wp-replicastore.php';
|
143 |
+
$store = new Jetpack_Sync_WP_Replicastore();
|
144 |
+
$return["{$prefix}sync-checksum"] = json_encode( $store->checksum_all() );
|
145 |
+
|
146 |
return $return;
|
147 |
}
|
148 |
|
class.jetpack-modules-list-table.php
CHANGED
@@ -150,6 +150,9 @@ class Jetpack_Modules_List_Table extends WP_List_Table {
|
|
150 |
continue;
|
151 |
}
|
152 |
$key = sanitize_title( $title );
|
|
|
|
|
|
|
153 |
$display_title = esc_html( wptexturize( $title ) );
|
154 |
$url = esc_url( add_query_arg( 'module_tag', urlencode( $title ) ) );
|
155 |
$current = '';
|
150 |
continue;
|
151 |
}
|
152 |
$key = sanitize_title( $title );
|
153 |
+
if ( 'centralized-management' === $key && Jetpack::is_module_active( 'manage' ) ) {
|
154 |
+
continue;
|
155 |
+
}
|
156 |
$display_title = esc_html( wptexturize( $title ) );
|
157 |
$url = esc_url( add_query_arg( 'module_tag', urlencode( $title ) ) );
|
158 |
$current = '';
|
class.jetpack-options.php
CHANGED
@@ -23,7 +23,6 @@ class Jetpack_Options {
|
|
23 |
'wpcc_options',
|
24 |
'relatedposts',
|
25 |
'file_data',
|
26 |
-
'security_report',
|
27 |
'autoupdate_plugins', // (array) An array of plugin ids ( eg. jetpack/jetpack ) that should be autoupdated
|
28 |
'autoupdate_themes', // (array) An array of theme ids ( eg. twentyfourteen ) that should be autoupdated
|
29 |
'autoupdate_core', // (bool) Whether or not to autoupdate core
|
@@ -63,8 +62,6 @@ class Jetpack_Options {
|
|
63 |
'identity_crisis_whitelist', // (array) An array of options, each having an array of the values whitelisted for it.
|
64 |
'gplus_authors', // (array) The Google+ authorship information for connected users.
|
65 |
'last_heartbeat', // (int) The timestamp of the last heartbeat that fired.
|
66 |
-
'last_security_report', // (int) The timestamp of the last security report that was run.
|
67 |
-
'sync_bulk_reindexing', // (bool) If a bulk reindex is currently underway.
|
68 |
'jumpstart', // (string) A flag for whether or not to show the Jump Start. Accepts: new_connection, jumpstart_activated, jetpack_action_taken, jumpstart_dismissed.
|
69 |
'hide_jitm' // (array) A list of just in time messages that we should not show because they have been dismissed by the user
|
70 |
);
|
@@ -121,6 +118,26 @@ class Jetpack_Options {
|
|
121 |
return $default;
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
private static function update_grouped_option( $group, $name, $value ) {
|
125 |
$options = get_option( self::$grouped_options[ $group ] );
|
126 |
if ( ! is_array( $options ) ) {
|
@@ -149,14 +166,7 @@ class Jetpack_Options {
|
|
149 |
*/
|
150 |
do_action( 'pre_update_jetpack_option_' . $name, $name, $value );
|
151 |
if ( self::is_valid( $name, 'non_compact' ) ) {
|
152 |
-
|
153 |
-
* Allowing update_option to change autoload status only shipped in WordPress v4.2
|
154 |
-
* @link https://github.com/WordPress/WordPress/commit/305cf8b95
|
155 |
-
*/
|
156 |
-
if ( version_compare( $GLOBALS['wp_version'], '4.2', '>=' ) ) {
|
157 |
-
return update_option( "jetpack_$name", $value, $autoload );
|
158 |
-
}
|
159 |
-
return update_option( "jetpack_$name", $value );
|
160 |
}
|
161 |
|
162 |
foreach ( array_keys( self::$grouped_options ) as $group ) {
|
23 |
'wpcc_options',
|
24 |
'relatedposts',
|
25 |
'file_data',
|
|
|
26 |
'autoupdate_plugins', // (array) An array of plugin ids ( eg. jetpack/jetpack ) that should be autoupdated
|
27 |
'autoupdate_themes', // (array) An array of theme ids ( eg. twentyfourteen ) that should be autoupdated
|
28 |
'autoupdate_core', // (bool) Whether or not to autoupdate core
|
62 |
'identity_crisis_whitelist', // (array) An array of options, each having an array of the values whitelisted for it.
|
63 |
'gplus_authors', // (array) The Google+ authorship information for connected users.
|
64 |
'last_heartbeat', // (int) The timestamp of the last heartbeat that fired.
|
|
|
|
|
65 |
'jumpstart', // (string) A flag for whether or not to show the Jump Start. Accepts: new_connection, jumpstart_activated, jetpack_action_taken, jumpstart_dismissed.
|
66 |
'hide_jitm' // (array) A list of just in time messages that we should not show because they have been dismissed by the user
|
67 |
);
|
118 |
return $default;
|
119 |
}
|
120 |
|
121 |
+
/**
|
122 |
+
* Returns the requested option, and ensures it's autoloaded in the future.
|
123 |
+
* This does _not_ adjust the prefix in any way (does not prefix jetpack_%)
|
124 |
+
*
|
125 |
+
* @param string $name Option name
|
126 |
+
* @param mixed $default (optional)
|
127 |
+
*
|
128 |
+
* @return mixed|void
|
129 |
+
*/
|
130 |
+
public static function get_option_and_ensure_autoload( $name, $default ) {
|
131 |
+
$value = get_option( $name );
|
132 |
+
|
133 |
+
if ( $value === false && $default !== false ) {
|
134 |
+
update_option( $name, $default );
|
135 |
+
$value = $default;
|
136 |
+
}
|
137 |
+
|
138 |
+
return $value;
|
139 |
+
}
|
140 |
+
|
141 |
private static function update_grouped_option( $group, $name, $value ) {
|
142 |
$options = get_option( self::$grouped_options[ $group ] );
|
143 |
if ( ! is_array( $options ) ) {
|
166 |
*/
|
167 |
do_action( 'pre_update_jetpack_option_' . $name, $name, $value );
|
168 |
if ( self::is_valid( $name, 'non_compact' ) ) {
|
169 |
+
return update_option( "jetpack_$name", $value, $autoload );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
}
|
171 |
|
172 |
foreach ( array_keys( self::$grouped_options ) as $group ) {
|
class.jetpack-signature.php
CHANGED
@@ -43,14 +43,14 @@ class Jetpack_Signature {
|
|
43 |
// with SSL termination proxies (self-served, Cloudflare, etc.) don't need to fiddle with
|
44 |
// the JETPACK_SIGNATURE__HTTPS_PORT constant. The code also implies we can't talk to a
|
45 |
// site at https://example.com:80/ (which would be a strange configuration).
|
46 |
-
// JETPACK_SIGNATURE__HTTPS_PORT: Set this constant in wp-config.php to the
|
47 |
// if the site is behind a proxy running on port 443 without
|
48 |
-
// X-Forwarded-Port and the
|
49 |
// though, to configure the proxy to send X-Forwarded-Port.
|
50 |
$port = in_array( $host_port, array( 443, 80, JETPACK_SIGNATURE__HTTPS_PORT ) ) ? '' : $host_port;
|
51 |
} else {
|
52 |
// 80: Standard Port
|
53 |
-
// JETPACK_SIGNATURE__HTTPS_PORT: Set this constant in wp-config.php to the
|
54 |
// if the site is behind a proxy running on port 80 without
|
55 |
// X-Forwarded-Port. It's better, though, to configure the proxy to
|
56 |
// send X-Forwarded-Port.
|
43 |
// with SSL termination proxies (self-served, Cloudflare, etc.) don't need to fiddle with
|
44 |
// the JETPACK_SIGNATURE__HTTPS_PORT constant. The code also implies we can't talk to a
|
45 |
// site at https://example.com:80/ (which would be a strange configuration).
|
46 |
+
// JETPACK_SIGNATURE__HTTPS_PORT: Set this constant in wp-config.php to the back end webserver's port
|
47 |
// if the site is behind a proxy running on port 443 without
|
48 |
+
// X-Forwarded-Port and the back end's port is *not* 80. It's better,
|
49 |
// though, to configure the proxy to send X-Forwarded-Port.
|
50 |
$port = in_array( $host_port, array( 443, 80, JETPACK_SIGNATURE__HTTPS_PORT ) ) ? '' : $host_port;
|
51 |
} else {
|
52 |
// 80: Standard Port
|
53 |
+
// JETPACK_SIGNATURE__HTTPS_PORT: Set this constant in wp-config.php to the back end webserver's port
|
54 |
// if the site is behind a proxy running on port 80 without
|
55 |
// X-Forwarded-Port. It's better, though, to configure the proxy to
|
56 |
// send X-Forwarded-Port.
|
class.jetpack-sync.php
DELETED
@@ -1,1104 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Request that a piece of data on this WordPress install be synced back to the
|
5 |
-
* Jetpack server for remote processing/notifications/etc
|
6 |
-
*/
|
7 |
-
class Jetpack_Sync {
|
8 |
-
// What modules want to sync what content
|
9 |
-
public $sync_conditions = array( 'posts' => array(), 'comments' => array() );
|
10 |
-
|
11 |
-
// We keep track of all the options registered for sync so that we can sync them all if needed
|
12 |
-
public $sync_options = array();
|
13 |
-
|
14 |
-
public $sync_constants = array();
|
15 |
-
|
16 |
-
// Keep trac of status transitions, which we wouldn't always know about on the Jetpack Servers but are important when deciding what to do with the sync.
|
17 |
-
public $post_transitions = array();
|
18 |
-
public $comment_transitions = array();
|
19 |
-
|
20 |
-
// Objects to sync
|
21 |
-
public $sync = array();
|
22 |
-
|
23 |
-
function __construct() {
|
24 |
-
// WP Cron action. Only used on upgrade
|
25 |
-
add_action( 'jetpack_sync_all_registered_options', array( $this, 'sync_all_registered_options' ) );
|
26 |
-
add_action( 'jetpack_heartbeat', array( $this, 'sync_all_registered_options' ) );
|
27 |
-
|
28 |
-
// Sync constants on heartbeat and plugin upgrade and connects
|
29 |
-
add_action( 'init', array( $this, 'register_constants_as_options' ) );
|
30 |
-
add_action( 'jetpack_sync_all_registered_options', array( $this, 'sync_all_constants' ) );
|
31 |
-
add_action( 'jetpack_heartbeat', array( $this, 'sync_all_constants' ) );
|
32 |
-
|
33 |
-
add_action( 'jetpack_activate_module', array( $this, 'sync_module_constants' ), 10, 1 );
|
34 |
-
}
|
35 |
-
|
36 |
-
/* Static Methods for Modules */
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param string $file __FILE__
|
40 |
-
* @param array settings:
|
41 |
-
* post_types => array( post_type slugs ): The post types to sync. Default: post, page
|
42 |
-
* post_stati => array( post_status slugs ): The post stati to sync. Default: publish
|
43 |
-
*/
|
44 |
-
static function sync_posts( $file, array $settings = null ) {
|
45 |
-
if ( is_network_admin() ) return;
|
46 |
-
$jetpack = Jetpack::init();
|
47 |
-
$args = func_get_args();
|
48 |
-
return call_user_func_array( array( $jetpack->sync, 'posts' ), $args );
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* @param string $file __FILE__
|
53 |
-
* @param array settings:
|
54 |
-
* post_types => array( post_type slugs ): The post types to sync. Default: post, page
|
55 |
-
* post_stati => array( post_status slugs ): The post stati to sync. Default: publish
|
56 |
-
* comment_types => array( comment_type slugs ): The comment types to sync. Default: '', comment, trackback, pingback
|
57 |
-
* comment_stati => array( comment_status slugs ): The comment stati to sync. Default: approved
|
58 |
-
*/
|
59 |
-
static function sync_comments( $file, array $settings = null ) {
|
60 |
-
if ( is_network_admin() ) return;
|
61 |
-
$jetpack = Jetpack::init();
|
62 |
-
$args = func_get_args();
|
63 |
-
return call_user_func_array( array( $jetpack->sync, 'comments' ), $args );
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @param string $file __FILE__
|
68 |
-
* @param string $option, Option name to sync
|
69 |
-
* @param string $option ...
|
70 |
-
*/
|
71 |
-
static function sync_options( $file, $option /*, $option, ... */ ) {
|
72 |
-
if ( is_network_admin() ) return;
|
73 |
-
$jetpack = Jetpack::init();
|
74 |
-
$args = func_get_args();
|
75 |
-
return call_user_func_array( array( $jetpack->sync, 'options' ), $args );
|
76 |
-
}
|
77 |
-
/**
|
78 |
-
* @param string $file __FILE__
|
79 |
-
* @param string $option, Option name to sync
|
80 |
-
* @param string $option ...
|
81 |
-
*/
|
82 |
-
static function sync_constant( $file, $constant ) {
|
83 |
-
if ( is_network_admin() ) return;
|
84 |
-
$jetpack = Jetpack::init();
|
85 |
-
$args = func_get_args();
|
86 |
-
return call_user_func_array( array( $jetpack->sync, 'constant' ), $args );
|
87 |
-
}
|
88 |
-
|
89 |
-
/* Internal Methods */
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Create a sync object/request
|
93 |
-
*
|
94 |
-
* @param string $object Type of object to sync -- [ post | comment | option ]
|
95 |
-
* @param int $id Unique identifier
|
96 |
-
* @param array $settings
|
97 |
-
*/
|
98 |
-
function register( $object, $id = false, array $settings = null ) {
|
99 |
-
// Since we've registered something for sync, hook it up to execute on shutdown if we haven't already
|
100 |
-
if ( !$this->sync ) {
|
101 |
-
if ( function_exists( 'ignore_user_abort' ) ) {
|
102 |
-
ignore_user_abort( true );
|
103 |
-
}
|
104 |
-
add_action( 'shutdown', array( $this, 'sync' ), 9 ); // Right before async XML-RPC
|
105 |
-
}
|
106 |
-
|
107 |
-
$defaults = array(
|
108 |
-
'on_behalf_of' => array(), // What modules want this data
|
109 |
-
);
|
110 |
-
$settings = wp_parse_args( $settings, $defaults );
|
111 |
-
|
112 |
-
if ( !isset( $this->sync[$object] ) ) {
|
113 |
-
$this->sync[$object] = array();
|
114 |
-
}
|
115 |
-
|
116 |
-
// Store the settings for this object
|
117 |
-
if (
|
118 |
-
// First time for this object
|
119 |
-
!isset( $this->sync[$object][$id] )
|
120 |
-
) {
|
121 |
-
// Easy: store the current settings
|
122 |
-
$this->sync[$object][$id] = $settings;
|
123 |
-
} else {
|
124 |
-
// Not as easy: we have to manually merge the settings from previous runs for this object with the settings for this run
|
125 |
-
|
126 |
-
$this->sync[$object][$id]['on_behalf_of'] = array_unique( array_merge( $this->sync[$object][$id]['on_behalf_of'], $settings['on_behalf_of'] ) );
|
127 |
-
}
|
128 |
-
|
129 |
-
$delete_prefix = 'delete_';
|
130 |
-
if ( 0 === strpos( $object, $delete_prefix ) ) {
|
131 |
-
$unset_object = substr( $object, strlen( $delete_prefix ) );
|
132 |
-
} else {
|
133 |
-
$unset_object = "{$delete_prefix}{$object}";
|
134 |
-
}
|
135 |
-
|
136 |
-
// Ensure post ... delete_post yields a delete operation
|
137 |
-
// Ensure delete_post ... post yields a sync post operation
|
138 |
-
// Ensure update_option() ... delete_option() ends up as a delete
|
139 |
-
// Ensure delete_option() ... update_option() ends up as an update
|
140 |
-
// Etc.
|
141 |
-
unset( $this->sync[$unset_object][$id] );
|
142 |
-
|
143 |
-
return true;
|
144 |
-
}
|
145 |
-
|
146 |
-
function get_common_sync_data() {
|
147 |
-
$available_modules = Jetpack::get_available_modules();
|
148 |
-
$active_modules = Jetpack::get_active_modules();
|
149 |
-
$modules = array();
|
150 |
-
foreach ( $available_modules as $available_module ) {
|
151 |
-
$modules[$available_module] = in_array( $available_module, $active_modules );
|
152 |
-
}
|
153 |
-
$modules['vaultpress'] = class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' );
|
154 |
-
|
155 |
-
$sync_data = array(
|
156 |
-
'modules' => $modules,
|
157 |
-
'version' => JETPACK__VERSION,
|
158 |
-
'is_multisite' => is_multisite(),
|
159 |
-
);
|
160 |
-
|
161 |
-
return $sync_data;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Set up all the data and queue it for the outgoing XML-RPC request
|
166 |
-
*/
|
167 |
-
function sync() {
|
168 |
-
if ( !$this->sync ) {
|
169 |
-
return false;
|
170 |
-
}
|
171 |
-
|
172 |
-
// Don't sync anything from a staging site.
|
173 |
-
if ( Jetpack::is_development_mode() || Jetpack::is_staging_site() ) {
|
174 |
-
return false;
|
175 |
-
}
|
176 |
-
|
177 |
-
$sync_data = $this->get_common_sync_data();
|
178 |
-
|
179 |
-
$wp_importing = defined( 'WP_IMPORTING' ) && WP_IMPORTING;
|
180 |
-
|
181 |
-
foreach ( $this->sync as $sync_operation_type => $sync_operations ) {
|
182 |
-
switch ( $sync_operation_type ) {
|
183 |
-
case 'post':
|
184 |
-
if ( $wp_importing ) {
|
185 |
-
break;
|
186 |
-
}
|
187 |
-
|
188 |
-
$global_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null;
|
189 |
-
$GLOBALS['post'] = null;
|
190 |
-
foreach ( $sync_operations as $post_id => $settings ) {
|
191 |
-
$sync_data['post'][$post_id] = $this->get_post( $post_id );
|
192 |
-
if ( isset( $this->post_transitions[$post_id] ) ) {
|
193 |
-
$sync_data['post'][$post_id]['transitions'] = $this->post_transitions[$post_id];
|
194 |
-
} else {
|
195 |
-
$sync_data['post'][$post_id]['transitions'] = array( false, false );
|
196 |
-
}
|
197 |
-
$sync_data['post'][$post_id]['on_behalf_of'] = $settings['on_behalf_of'];
|
198 |
-
}
|
199 |
-
$GLOBALS['post'] = $global_post;
|
200 |
-
unset( $global_post );
|
201 |
-
break;
|
202 |
-
case 'comment':
|
203 |
-
if ( $wp_importing ) {
|
204 |
-
break;
|
205 |
-
}
|
206 |
-
|
207 |
-
$global_comment = isset( $GLOBALS['comment'] ) ? $GLOBALS['comment'] : null;
|
208 |
-
unset( $GLOBALS['comment'] );
|
209 |
-
foreach ( $sync_operations as $comment_id => $settings ) {
|
210 |
-
$sync_data['comment'][$comment_id] = $this->get_comment( $comment_id );
|
211 |
-
if ( isset( $this->comment_transitions[$comment_id] ) ) {
|
212 |
-
$sync_data['comment'][$comment_id]['transitions'] = $this->comment_transitions[$comment_id];
|
213 |
-
} else {
|
214 |
-
$sync_data['comment'][$comment_id]['transitions'] = array( false, false );
|
215 |
-
}
|
216 |
-
$sync_data['comment'][$comment_id]['on_behalf_of'] = $settings['on_behalf_of'];
|
217 |
-
}
|
218 |
-
$GLOBALS['comment'] = $global_comment;
|
219 |
-
unset( $global_comment );
|
220 |
-
break;
|
221 |
-
case 'option' :
|
222 |
-
foreach ( $sync_operations as $option => $settings ) {
|
223 |
-
$sync_data['option'][ $option ] = array( 'value' => get_option( $option ) );
|
224 |
-
}
|
225 |
-
break;
|
226 |
-
|
227 |
-
case 'constant' :
|
228 |
-
foreach( $sync_operations as $constant => $settings ) {
|
229 |
-
$sync_data['constant'][ $constant ] = array( 'value' => $this->get_constant( $constant ) );
|
230 |
-
}
|
231 |
-
break;
|
232 |
-
|
233 |
-
case 'delete_post':
|
234 |
-
case 'delete_comment':
|
235 |
-
foreach ( $sync_operations as $object_id => $settings ) {
|
236 |
-
$sync_data[$sync_operation_type][$object_id] = array( 'on_behalf_of' => $settings['on_behalf_of'] );
|
237 |
-
}
|
238 |
-
break;
|
239 |
-
case 'delete_option' :
|
240 |
-
foreach ( $sync_operations as $object_id => $settings ) {
|
241 |
-
$sync_data[$sync_operation_type][$object_id] = true;
|
242 |
-
}
|
243 |
-
break;
|
244 |
-
}
|
245 |
-
}
|
246 |
-
Jetpack::xmlrpc_async_call( 'jetpack.syncContent', $sync_data );
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Format and return content data from a direct xmlrpc request for it.
|
251 |
-
*
|
252 |
-
* @param array $content_ids: array( 'posts' => array of ids, 'comments' => array of ids, 'options' => array of options )
|
253 |
-
*/
|
254 |
-
function get_content( $content_ids ) {
|
255 |
-
$sync_data = $this->get_common_sync_data();
|
256 |
-
|
257 |
-
if ( isset( $content_ids['posts'] ) ) {
|
258 |
-
foreach ( $content_ids['posts'] as $id ) {
|
259 |
-
$sync_data['post'][$id] = $this->get_post( $id );
|
260 |
-
}
|
261 |
-
}
|
262 |
-
|
263 |
-
if ( isset( $content_ids['comments'] ) ) {
|
264 |
-
foreach ( $content_ids['comments'] as $id ) {
|
265 |
-
$sync_data['comment'][$id] = $this->get_post( $id );
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
if ( isset( $content_ids['options'] ) ) {
|
270 |
-
foreach ( $content_ids['options'] as $option ) {
|
271 |
-
$sync_data['option'][$option] = array( 'value' => get_option( $option ) );
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
return $sync_data;
|
276 |
-
}
|
277 |
-
|
278 |
-
/**
|
279 |
-
* Helper method for registering a post for sync
|
280 |
-
*
|
281 |
-
* @param int $id wp_posts.ID
|
282 |
-
* @param array $settings Sync data
|
283 |
-
*/
|
284 |
-
function register_post( $id, array $settings = null ) {
|
285 |
-
$id = (int) $id;
|
286 |
-
if ( !$id ) {
|
287 |
-
return false;
|
288 |
-
}
|
289 |
-
|
290 |
-
$post = get_post( $id );
|
291 |
-
if ( !$post ) {
|
292 |
-
return false;
|
293 |
-
}
|
294 |
-
|
295 |
-
$settings = wp_parse_args( $settings, array(
|
296 |
-
'on_behalf_of' => array(),
|
297 |
-
) );
|
298 |
-
|
299 |
-
return $this->register( 'post', $id, $settings );
|
300 |
-
}
|
301 |
-
|
302 |
-
/**
|
303 |
-
* Helper method for registering a comment for sync
|
304 |
-
*
|
305 |
-
* @param int $id wp_comments.comment_ID
|
306 |
-
* @param array $settings Sync data
|
307 |
-
*/
|
308 |
-
function register_comment( $id, array $settings = null ) {
|
309 |
-
$id = (int) $id;
|
310 |
-
if ( !$id ) {
|
311 |
-
return false;
|
312 |
-
}
|
313 |
-
|
314 |
-
$comment = get_comment( $id );
|
315 |
-
if ( !$comment || empty( $comment->comment_post_ID ) ) {
|
316 |
-
return false;
|
317 |
-
}
|
318 |
-
|
319 |
-
$post = get_post( $comment->comment_post_ID );
|
320 |
-
if ( !$post ) {
|
321 |
-
return false;
|
322 |
-
}
|
323 |
-
|
324 |
-
$settings = wp_parse_args( $settings, array(
|
325 |
-
'on_behalf_of' => array(),
|
326 |
-
) );
|
327 |
-
|
328 |
-
return $this->register( 'comment', $id, $settings );
|
329 |
-
}
|
330 |
-
|
331 |
-
/* Posts Sync */
|
332 |
-
|
333 |
-
function posts( $file, array $settings = null ) {
|
334 |
-
$module_slug = Jetpack::get_module_slug( $file );
|
335 |
-
|
336 |
-
$defaults = array(
|
337 |
-
'post_types' => array( 'post', 'page' ),
|
338 |
-
'post_stati' => array( 'publish' ),
|
339 |
-
);
|
340 |
-
|
341 |
-
$this->sync_conditions['posts'][$module_slug] = wp_parse_args( $settings, $defaults );
|
342 |
-
|
343 |
-
add_action( 'transition_post_status', array( $this, 'transition_post_status_action' ), 10, 3 );
|
344 |
-
add_action( 'delete_post', array( $this, 'delete_post_action' ) );
|
345 |
-
}
|
346 |
-
|
347 |
-
function delete_post_action( $post_id ) {
|
348 |
-
$post = get_post( $post_id );
|
349 |
-
if ( !$post ) {
|
350 |
-
return $this->register( 'delete_post', (int) $post_id );
|
351 |
-
}
|
352 |
-
|
353 |
-
$this->transition_post_status_action( 'delete', $post->post_status, $post );
|
354 |
-
}
|
355 |
-
|
356 |
-
function transition_post_status_action( $new_status, $old_status, $post ) {
|
357 |
-
$sync = $this->get_post_sync_operation( $new_status, $old_status, $post, $this->sync_conditions['posts'] );
|
358 |
-
if ( !$sync ) {
|
359 |
-
// No module wants to sync this post
|
360 |
-
return false;
|
361 |
-
}
|
362 |
-
|
363 |
-
// Track post transitions
|
364 |
-
if ( isset( $this->post_transitions[$post->ID] ) ) {
|
365 |
-
// status changed more than once - keep tha most recent $new_status
|
366 |
-
$this->post_transitions[$post->ID][0] = $new_status;
|
367 |
-
} else {
|
368 |
-
$this->post_transitions[$post->ID] = array( $new_status, $old_status );
|
369 |
-
}
|
370 |
-
|
371 |
-
$operation = $sync['operation'];
|
372 |
-
unset( $sync['operation'] );
|
373 |
-
|
374 |
-
switch ( $operation ) {
|
375 |
-
case 'delete' :
|
376 |
-
return $this->register( 'delete_post', (int) $post->ID, $sync );
|
377 |
-
case 'submit' :
|
378 |
-
return $this->register_post( (int) $post->ID, $sync );
|
379 |
-
}
|
380 |
-
}
|
381 |
-
|
382 |
-
function get_post_sync_operation( $new_status, $old_status, $post, $module_conditions ) {
|
383 |
-
$delete_on_behalf_of = array();
|
384 |
-
$submit_on_behalf_of = array();
|
385 |
-
$delete_stati = array( 'delete' );
|
386 |
-
$cache_cleared = false;
|
387 |
-
|
388 |
-
foreach ( $module_conditions as $module => $conditions ) {
|
389 |
-
if ( !in_array( $post->post_type, $conditions['post_types'] ) ) {
|
390 |
-
continue;
|
391 |
-
}
|
392 |
-
|
393 |
-
$deleted_post = in_array( $new_status, $delete_stati );
|
394 |
-
|
395 |
-
if ( $deleted_post ) {
|
396 |
-
$delete_on_behalf_of[] = $module;
|
397 |
-
} else {
|
398 |
-
if ( ! $cache_cleared ) {
|
399 |
-
// inefficient to clear cache more than once
|
400 |
-
clean_post_cache( $post->ID );
|
401 |
-
$cache_cleared = true;
|
402 |
-
}
|
403 |
-
$new_status = get_post_status( $post->ID ); // Inherited status is resolved here
|
404 |
-
}
|
405 |
-
|
406 |
-
$old_status_in_stati = in_array( $old_status, $conditions['post_stati'] );
|
407 |
-
$new_status_in_stati = in_array( $new_status, $conditions['post_stati'] );
|
408 |
-
|
409 |
-
if ( $old_status_in_stati && !$new_status_in_stati ) {
|
410 |
-
// Jetpack no longer needs the post
|
411 |
-
if ( !$deleted_post ) {
|
412 |
-
$delete_on_behalf_of[] = $module;
|
413 |
-
} // else, we've already flagged it above
|
414 |
-
continue;
|
415 |
-
}
|
416 |
-
|
417 |
-
if ( !$new_status_in_stati ) {
|
418 |
-
continue;
|
419 |
-
}
|
420 |
-
|
421 |
-
// At this point, we know we want to sync the post, not delete it
|
422 |
-
$submit_on_behalf_of[] = $module;
|
423 |
-
}
|
424 |
-
|
425 |
-
if ( !empty( $submit_on_behalf_of ) ) {
|
426 |
-
return array( 'operation' => 'submit', 'on_behalf_of' => $submit_on_behalf_of );
|
427 |
-
}
|
428 |
-
|
429 |
-
if ( !empty( $delete_on_behalf_of ) ) {
|
430 |
-
return array( 'operation' => 'delete', 'on_behalf_of' => $delete_on_behalf_of );
|
431 |
-
}
|
432 |
-
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
|
436 |
-
/**
|
437 |
-
* Get a post and associated data in the standard JP format.
|
438 |
-
* Cannot be called statically
|
439 |
-
*
|
440 |
-
* @param int $id Post ID
|
441 |
-
* @return Array containing full post details
|
442 |
-
*/
|
443 |
-
function get_post( $id ) {
|
444 |
-
$post_obj = get_post( $id );
|
445 |
-
if ( !$post_obj )
|
446 |
-
return false;
|
447 |
-
|
448 |
-
if ( is_callable( $post_obj, 'to_array' ) ) {
|
449 |
-
// WP >= 3.5
|
450 |
-
$post = $post_obj->to_array();
|
451 |
-
} else {
|
452 |
-
// WP < 3.5
|
453 |
-
$post = get_object_vars( $post_obj );
|
454 |
-
}
|
455 |
-
|
456 |
-
if ( 0 < strlen( $post['post_password'] ) ) {
|
457 |
-
$post['post_password'] = 'auto-' . wp_generate_password( 10, false ); // We don't want the real password. Just pass something random.
|
458 |
-
}
|
459 |
-
|
460 |
-
// local optimizations
|
461 |
-
unset(
|
462 |
-
$post['filter'],
|
463 |
-
$post['ancestors'],
|
464 |
-
$post['post_content_filtered'],
|
465 |
-
$post['to_ping'],
|
466 |
-
$post['pinged']
|
467 |
-
);
|
468 |
-
|
469 |
-
if ( $this->is_post_public( $post ) ) {
|
470 |
-
$post['post_is_public'] = Jetpack_Options::get_option( 'public' );
|
471 |
-
} else {
|
472 |
-
//obscure content
|
473 |
-
$post['post_content'] = '';
|
474 |
-
$post['post_excerpt'] = '';
|
475 |
-
$post['post_is_public'] = false;
|
476 |
-
}
|
477 |
-
$post_type_obj = get_post_type_object( $post['post_type'] );
|
478 |
-
$post['post_is_excluded_from_search'] = $post_type_obj->exclude_from_search;
|
479 |
-
|
480 |
-
$post['tax'] = array();
|
481 |
-
$taxonomies = get_object_taxonomies( $post_obj );
|
482 |
-
foreach ( $taxonomies as $taxonomy ) {
|
483 |
-
$terms = get_object_term_cache( $post_obj->ID, $taxonomy );
|
484 |
-
if ( empty( $terms ) )
|
485 |
-
$terms = wp_get_object_terms( $post_obj->ID, $taxonomy );
|
486 |
-
$term_names = array();
|
487 |
-
foreach ( $terms as $term ) {
|
488 |
-
$term_names[] = $term->name;
|
489 |
-
}
|
490 |
-
$post['tax'][$taxonomy] = $term_names;
|
491 |
-
}
|
492 |
-
|
493 |
-
$meta = get_post_meta( $post_obj->ID, false );
|
494 |
-
$post['meta'] = array();
|
495 |
-
foreach ( $meta as $key => $value ) {
|
496 |
-
$post['meta'][$key] = array_map( 'maybe_unserialize', $value );
|
497 |
-
}
|
498 |
-
|
499 |
-
$post['extra'] = array(
|
500 |
-
'author' => get_the_author_meta( 'display_name', $post_obj->post_author ),
|
501 |
-
'author_email' => get_the_author_meta( 'email', $post_obj->post_author ),
|
502 |
-
'dont_email_post_to_subs' => get_post_meta( $post_obj->ID, '_jetpack_dont_email_post_to_subs', true ),
|
503 |
-
);
|
504 |
-
|
505 |
-
if ( $fid = get_post_thumbnail_id( $id ) ) {
|
506 |
-
$feature = wp_get_attachment_image_src( $fid, 'large' );
|
507 |
-
if ( ! empty( $feature[0] ) ) {
|
508 |
-
$post['extra']['featured_image'] = $feature[0];
|
509 |
-
}
|
510 |
-
|
511 |
-
$attachment = get_post( $fid );
|
512 |
-
if ( ! empty( $attachment ) ) {
|
513 |
-
$metadata = wp_get_attachment_metadata( $fid );
|
514 |
-
|
515 |
-
$post['extra']['post_thumbnail'] = array(
|
516 |
-
'ID' => (int) $fid,
|
517 |
-
'URL' => (string) wp_get_attachment_url( $fid ),
|
518 |
-
'guid' => (string) $attachment->guid,
|
519 |
-
'mime_type' => (string) $attachment->post_mime_type,
|
520 |
-
'width' => (int) isset( $metadata['width'] ) ? $metadata['width'] : 0,
|
521 |
-
'height' => (int) isset( $metadata['height'] ) ? $metadata['height'] : 0,
|
522 |
-
);
|
523 |
-
|
524 |
-
if ( isset( $metadata['duration'] ) ) {
|
525 |
-
$post['extra']['post_thumbnail'] = (int) $metadata['duration'];
|
526 |
-
}
|
527 |
-
|
528 |
-
/**
|
529 |
-
* Filters the Post Thumbnail information returned for a specific post.
|
530 |
-
*
|
531 |
-
* @since 3.3.0
|
532 |
-
*
|
533 |
-
* @param array $post['extra']['post_thumbnail'] {
|
534 |
-
* Array of details about the Post Thumbnail.
|
535 |
-
* @param int ID Post Thumbnail ID.
|
536 |
-
* @param string URL Post thumbnail URL.
|
537 |
-
* @param string guid Post thumbnail guid.
|
538 |
-
* @param string mime_type Post thumbnail mime type.
|
539 |
-
* @param int width Post thumbnail width.
|
540 |
-
* @param int height Post thumbnail height.
|
541 |
-
* }
|
542 |
-
*/
|
543 |
-
$post['extra']['post_thumbnail'] = (object) apply_filters( 'get_attachment', $post['extra']['post_thumbnail'] );
|
544 |
-
}
|
545 |
-
}
|
546 |
-
|
547 |
-
$post['permalink'] = get_permalink( $post_obj->ID );
|
548 |
-
$post['shortlink'] = wp_get_shortlink( $post_obj->ID );
|
549 |
-
/**
|
550 |
-
* Allow modules to send extra info on the sync post process.
|
551 |
-
*
|
552 |
-
* @since 2.8.0
|
553 |
-
*
|
554 |
-
* @param array $args Array of custom data to attach to a post.
|
555 |
-
* @param Object $post_obj Object returned by get_post() for a given post ID.
|
556 |
-
*/
|
557 |
-
$post['module_custom_data'] = apply_filters( 'jetpack_sync_post_module_custom_data', array(), $post_obj );
|
558 |
-
return $post;
|
559 |
-
}
|
560 |
-
|
561 |
-
/**
|
562 |
-
* Decide whether a post/page/attachment is visible to the public.
|
563 |
-
*
|
564 |
-
* @param array $post
|
565 |
-
* @return bool
|
566 |
-
*/
|
567 |
-
function is_post_public( $post ) {
|
568 |
-
if ( !is_array( $post ) ) {
|
569 |
-
$post = (array) $post;
|
570 |
-
}
|
571 |
-
|
572 |
-
if ( 0 < strlen( $post['post_password'] ) )
|
573 |
-
return false;
|
574 |
-
if ( ! in_array( $post['post_type'], get_post_types( array( 'public' => true ) ) ) )
|
575 |
-
return false;
|
576 |
-
$post_status = get_post_status( $post['ID'] ); // Inherited status is resolved here.
|
577 |
-
if ( ! in_array( $post_status, get_post_stati( array( 'public' => true ) ) ) )
|
578 |
-
return false;
|
579 |
-
return true;
|
580 |
-
}
|
581 |
-
|
582 |
-
/* Comments Sync */
|
583 |
-
|
584 |
-
function comments( $file, array $settings = null ) {
|
585 |
-
$module_slug = Jetpack::get_module_slug( $file );
|
586 |
-
|
587 |
-
$defaults = array(
|
588 |
-
'post_types' => array( 'post', 'page' ), // For what post types will we sync comments?
|
589 |
-
'post_stati' => array( 'publish' ), // For what post stati will we sync comments?
|
590 |
-
'comment_types' => array( '', 'comment', 'trackback', 'pingback' ), // What comment types will we sync?
|
591 |
-
'comment_stati' => array( 'approved' ), // What comment stati will we sync?
|
592 |
-
);
|
593 |
-
|
594 |
-
$settings = wp_parse_args( $settings, $defaults );
|
595 |
-
|
596 |
-
$this->sync_conditions['comments'][$module_slug] = $settings;
|
597 |
-
|
598 |
-
add_action( 'wp_insert_comment', array( $this, 'wp_insert_comment_action' ), 10, 2 );
|
599 |
-
add_action( 'transition_comment_status', array( $this, 'transition_comment_status_action' ), 10, 3 );
|
600 |
-
add_action( 'edit_comment', array( $this, 'edit_comment_action' ) );
|
601 |
-
}
|
602 |
-
|
603 |
-
/*
|
604 |
-
* This is really annoying. If you edit a comment, but don't change the status, WordPress doesn't fire the transition_comment_status hook.
|
605 |
-
* That means we have to catch these comments on the edit_comment hook, but ignore comments on that hook when the transition_comment_status does fire.
|
606 |
-
*/
|
607 |
-
function edit_comment_action( $comment_id ) {
|
608 |
-
$comment = get_comment( $comment_id );
|
609 |
-
$new_status = $this->translate_comment_status( $comment->comment_approved );
|
610 |
-
add_action( "comment_{$new_status}_{$comment->comment_type}", array( $this, 'transition_comment_status_for_comments_whose_status_does_not_change' ), 10, 2 );
|
611 |
-
}
|
612 |
-
|
613 |
-
function wp_insert_comment_action( $comment_id, $comment ) {
|
614 |
-
$this->transition_comment_status_action( $comment->comment_approved, 'new', $comment );
|
615 |
-
}
|
616 |
-
|
617 |
-
function transition_comment_status_for_comments_whose_status_does_not_change( $comment_id, $comment ) {
|
618 |
-
if ( isset( $this->comment_transitions[$comment_id] ) ) {
|
619 |
-
return $this->transition_comment_status_action( $comment->comment_approved, $this->comment_transitions[$comment_id][1], $comment );
|
620 |
-
}
|
621 |
-
|
622 |
-
return $this->transition_comment_status_action( $comment->comment_approved, $comment->comment_approved, $comment );
|
623 |
-
}
|
624 |
-
|
625 |
-
function translate_comment_status( $status ) {
|
626 |
-
switch ( (string) $status ) {
|
627 |
-
case '0' :
|
628 |
-
case 'hold' :
|
629 |
-
return 'unapproved';
|
630 |
-
case '1' :
|
631 |
-
case 'approve' :
|
632 |
-
return 'approved';
|
633 |
-
}
|
634 |
-
|
635 |
-
return $status;
|
636 |
-
}
|
637 |
-
|
638 |
-
function transition_comment_status_action( $new_status, $old_status, $comment ) {
|
639 |
-
$post = get_post( $comment->comment_post_ID );
|
640 |
-
if ( !$post ) {
|
641 |
-
return false;
|
642 |
-
}
|
643 |
-
|
644 |
-
foreach ( array( 'new_status', 'old_status' ) as $_status ) {
|
645 |
-
$$_status = $this->translate_comment_status( $$_status );
|
646 |
-
}
|
647 |
-
|
648 |
-
// Track comment transitions
|
649 |
-
if ( isset( $this->comment_transitions[$comment->comment_ID] ) ) {
|
650 |
-
// status changed more than once - keep tha most recent $new_status
|
651 |
-
$this->comment_transitions[$comment->comment_ID][0] = $new_status;
|
652 |
-
} else {
|
653 |
-
$this->comment_transitions[$comment->comment_ID] = array( $new_status, $old_status );
|
654 |
-
}
|
655 |
-
|
656 |
-
$post_sync = $this->get_post_sync_operation( $post->post_status, '_jetpack_test_sync', $post, $this->sync_conditions['comments'] );
|
657 |
-
|
658 |
-
if ( !$post_sync ) {
|
659 |
-
// No module wants to sync this comment because its post doesn't match any sync conditions
|
660 |
-
return false;
|
661 |
-
}
|
662 |
-
|
663 |
-
if ( 'delete' == $post_sync['operation'] ) {
|
664 |
-
// Had we been looking at post sync operations (instead of comment sync operations),
|
665 |
-
// this comment's post would have been deleted. Don't sync the comment.
|
666 |
-
return false;
|
667 |
-
}
|
668 |
-
|
669 |
-
$delete_on_behalf_of = array();
|
670 |
-
$submit_on_behalf_of = array();
|
671 |
-
$delete_stati = array( 'delete' );
|
672 |
-
|
673 |
-
foreach ( $this->sync_conditions['comments'] as $module => $conditions ) {
|
674 |
-
if ( !in_array( $comment->comment_type, $conditions['comment_types'] ) ) {
|
675 |
-
continue;
|
676 |
-
}
|
677 |
-
|
678 |
-
$deleted_comment = in_array( $new_status, $delete_stati );
|
679 |
-
|
680 |
-
if ( $deleted_comment ) {
|
681 |
-
$delete_on_behalf_of[] = $module;
|
682 |
-
}
|
683 |
-
|
684 |
-
$old_status_in_stati = in_array( $old_status, $conditions['comment_stati'] );
|
685 |
-
$new_status_in_stati = in_array( $new_status, $conditions['comment_stati'] );
|
686 |
-
|
687 |
-
if ( $old_status_in_stati && !$new_status_in_stati ) {
|
688 |
-
// Jetpack no longer needs the comment
|
689 |
-
if ( !$deleted_comment ) {
|
690 |
-
$delete_on_behalf_of[] = $module;
|
691 |
-
} // else, we've already flagged it above
|
692 |
-
continue;
|
693 |
-
}
|
694 |
-
|
695 |
-
if ( !$new_status_in_stati ) {
|
696 |
-
continue;
|
697 |
-
}
|
698 |
-
|
699 |
-
// At this point, we know we want to sync the comment, not delete it
|
700 |
-
$submit_on_behalf_of[] = $module;
|
701 |
-
}
|
702 |
-
|
703 |
-
if ( ! empty( $submit_on_behalf_of ) ) {
|
704 |
-
$this->register_post( $comment->comment_post_ID, array( 'on_behalf_of' => $submit_on_behalf_of ) );
|
705 |
-
return $this->register_comment( $comment->comment_ID, array( 'on_behalf_of' => $submit_on_behalf_of ) );
|
706 |
-
}
|
707 |
-
|
708 |
-
if ( !empty( $delete_on_behalf_of ) ) {
|
709 |
-
return $this->register( 'delete_comment', $comment->comment_ID, array( 'on_behalf_of' => $delete_on_behalf_of ) );
|
710 |
-
}
|
711 |
-
|
712 |
-
return false;
|
713 |
-
}
|
714 |
-
|
715 |
-
/**
|
716 |
-
* Get a comment and associated data in the standard JP format.
|
717 |
-
* Cannot be called statically
|
718 |
-
*
|
719 |
-
* @param int $id Comment ID
|
720 |
-
* @return Array containing full comment details
|
721 |
-
*/
|
722 |
-
function get_comment( $id ) {
|
723 |
-
$comment_obj = get_comment( $id );
|
724 |
-
if ( !$comment_obj )
|
725 |
-
return false;
|
726 |
-
$comment = get_object_vars( $comment_obj );
|
727 |
-
|
728 |
-
$meta = get_comment_meta( $id, false );
|
729 |
-
$comment['meta'] = array();
|
730 |
-
foreach ( $meta as $key => $value ) {
|
731 |
-
$comment['meta'][$key] = array_map( 'maybe_unserialize', $value );
|
732 |
-
}
|
733 |
-
|
734 |
-
return $comment;
|
735 |
-
}
|
736 |
-
|
737 |
-
/* Options Sync */
|
738 |
-
|
739 |
-
/* Ah... so much simpler than Posts and Comments :) */
|
740 |
-
function options( $file, $option /*, $option, ... */ ) {
|
741 |
-
$options = func_get_args();
|
742 |
-
$file = array_shift( $options );
|
743 |
-
|
744 |
-
$module_slug = Jetpack::get_module_slug( $file );
|
745 |
-
|
746 |
-
if ( !isset( $this->sync_options[$module_slug] ) ) {
|
747 |
-
$this->sync_options[$module_slug] = array();
|
748 |
-
}
|
749 |
-
|
750 |
-
foreach ( $options as $option ) {
|
751 |
-
$this->sync_options[$module_slug][] = $option;
|
752 |
-
add_action( "delete_option_{$option}", array( $this, 'deleted_option_action' ) );
|
753 |
-
add_action( "update_option_{$option}", array( $this, 'updated_option_action' ) );
|
754 |
-
add_action( "add_option_{$option}", array( $this, 'added_option_action' ) );
|
755 |
-
}
|
756 |
-
|
757 |
-
$this->sync_options[$module_slug] = array_unique( $this->sync_options[$module_slug] );
|
758 |
-
}
|
759 |
-
|
760 |
-
function deleted_option_action( $option ) {
|
761 |
-
$this->register( 'delete_option', $option );
|
762 |
-
}
|
763 |
-
|
764 |
-
function updated_option_action() {
|
765 |
-
// The value of $option isn't passed to the filter
|
766 |
-
// Calculate it
|
767 |
-
$option = current_filter();
|
768 |
-
$prefix = 'update_option_';
|
769 |
-
if ( 0 !== strpos( $option, $prefix ) ) {
|
770 |
-
return;
|
771 |
-
}
|
772 |
-
$option = substr( $option, strlen( $prefix ) );
|
773 |
-
|
774 |
-
$this->added_option_action( $option );
|
775 |
-
}
|
776 |
-
|
777 |
-
function added_option_action( $option ) {
|
778 |
-
$this->register( 'option', $option );
|
779 |
-
}
|
780 |
-
|
781 |
-
function sync_all_module_options( $module_slug ) {
|
782 |
-
if ( empty( $this->sync_options[$module_slug] ) ) {
|
783 |
-
return;
|
784 |
-
}
|
785 |
-
|
786 |
-
foreach ( $this->sync_options[$module_slug] as $option ) {
|
787 |
-
$this->added_option_action( $option );
|
788 |
-
}
|
789 |
-
}
|
790 |
-
|
791 |
-
function sync_all_registered_options() {
|
792 |
-
if ( 'jetpack_sync_all_registered_options' == current_filter() ) {
|
793 |
-
add_action( 'shutdown', array( $this, 'register_all_options' ), 8 );
|
794 |
-
} else {
|
795 |
-
wp_schedule_single_event( time(), 'jetpack_sync_all_registered_options', array( $this->sync_options ) );
|
796 |
-
}
|
797 |
-
}
|
798 |
-
|
799 |
-
/**
|
800 |
-
* All the options that are defined in modules as well as class.jetpack.php will get synced.
|
801 |
-
* Registers all options to be synced.
|
802 |
-
*/
|
803 |
-
function register_all_options() {
|
804 |
-
$all_registered_options = array_unique( call_user_func_array( 'array_merge', $this->sync_options ) );
|
805 |
-
foreach ( $all_registered_options as $option ) {
|
806 |
-
$this->added_option_action( $option );
|
807 |
-
}
|
808 |
-
}
|
809 |
-
|
810 |
-
/* Constants Sync */
|
811 |
-
|
812 |
-
function get_all_constants() {
|
813 |
-
return array(
|
814 |
-
'EMPTY_TRASH_DAYS',
|
815 |
-
'WP_POST_REVISIONS',
|
816 |
-
'AUTOMATIC_UPDATER_DISABLED',
|
817 |
-
'ABSPATH',
|
818 |
-
'WP_CONTENT_DIR',
|
819 |
-
'FS_METHOD',
|
820 |
-
'DISALLOW_FILE_EDIT',
|
821 |
-
'DISALLOW_FILE_MODS',
|
822 |
-
'WP_AUTO_UPDATE_CORE',
|
823 |
-
'WP_HTTP_BLOCK_EXTERNAL',
|
824 |
-
'WP_ACCESSIBLE_HOSTS',
|
825 |
-
);
|
826 |
-
}
|
827 |
-
/**
|
828 |
-
* This lets us get the constant value like get_option( 'jetpack_constant_CONSTANT' );
|
829 |
-
* Not the best way to get the constant value but necessery in some cases like in the API.
|
830 |
-
*/
|
831 |
-
function register_constants_as_options() {
|
832 |
-
foreach( $this->get_all_constants() as $constant ) {
|
833 |
-
add_filter( 'pre_option_jetpack_constant_'. $constant, array( $this, 'get_default_constant' ) );
|
834 |
-
}
|
835 |
-
}
|
836 |
-
|
837 |
-
function sync_all_constants() {
|
838 |
-
// add the constant to sync.
|
839 |
-
foreach( $this->get_all_constants() as $constant ) {
|
840 |
-
$this->register_constant( $constant );
|
841 |
-
}
|
842 |
-
add_action( 'shutdown', array( $this, 'register_all_module_constants' ), 8 );
|
843 |
-
}
|
844 |
-
|
845 |
-
/**
|
846 |
-
* Returns default values of Constants
|
847 |
-
*/
|
848 |
-
function default_constant( $constant ) {
|
849 |
-
switch( $constant ) {
|
850 |
-
case 'WP_AUTO_UPDATE_CORE':
|
851 |
-
return 'minor';
|
852 |
-
break;
|
853 |
-
|
854 |
-
default:
|
855 |
-
return null;
|
856 |
-
break;
|
857 |
-
}
|
858 |
-
}
|
859 |
-
|
860 |
-
function register_all_module_constants() {
|
861 |
-
// also add the contstants from each module to be synced.
|
862 |
-
foreach( $this->sync_constants as $module ) {
|
863 |
-
foreach( $module as $constant ) {
|
864 |
-
$this->register_constant( $constant );
|
865 |
-
}
|
866 |
-
}
|
867 |
-
}
|
868 |
-
|
869 |
-
/**
|
870 |
-
* Sync constants required by the module that was just activated.
|
871 |
-
* If you add Jetpack_Sync::sync_constant( __FILE__, 'HELLO_WORLD' );
|
872 |
-
* to the module it will start syncing the constant after the constant has been updated.
|
873 |
-
*
|
874 |
-
* This function gets called on module activation.
|
875 |
-
*/
|
876 |
-
function sync_module_constants( $module ) {
|
877 |
-
|
878 |
-
if ( isset( $this->sync_constants[ $module ] ) && is_array( $this->sync_constants[ $module ] ) ) {
|
879 |
-
// also add the contstants from each module to be synced.
|
880 |
-
foreach( $this->sync_constants[ $module ] as $constant ) {
|
881 |
-
$this->register_constant( $constant );
|
882 |
-
}
|
883 |
-
}
|
884 |
-
}
|
885 |
-
|
886 |
-
public function reindex_needed() {
|
887 |
-
return ( $this->_get_post_count_local() != $this->_get_post_count_cloud() );
|
888 |
-
}
|
889 |
-
|
890 |
-
public function reindex_trigger() {
|
891 |
-
$response = array( 'status' => 'ERROR' );
|
892 |
-
|
893 |
-
// Force a privacy check
|
894 |
-
Jetpack::check_privacy( JETPACK__PLUGIN_FILE );
|
895 |
-
|
896 |
-
Jetpack::load_xml_rpc_client();
|
897 |
-
$client = new Jetpack_IXR_Client( array(
|
898 |
-
'user_id' => JETPACK_MASTER_USER,
|
899 |
-
) );
|
900 |
-
|
901 |
-
$client->query( 'jetpack.reindexTrigger' );
|
902 |
-
|
903 |
-
if ( !$client->isError() ) {
|
904 |
-
$response = $client->getResponse();
|
905 |
-
Jetpack_Options::update_option( 'sync_bulk_reindexing', true );
|
906 |
-
}
|
907 |
-
|
908 |
-
return $response;
|
909 |
-
}
|
910 |
-
|
911 |
-
public function reindex_status() {
|
912 |
-
$response = array( 'status' => 'ERROR' );
|
913 |
-
|
914 |
-
// Assume reindexing is done if it was not triggered in the first place
|
915 |
-
if ( false === Jetpack_Options::get_option( 'sync_bulk_reindexing' ) ) {
|
916 |
-
return array( 'status' => 'DONE' );
|
917 |
-
}
|
918 |
-
|
919 |
-
Jetpack::load_xml_rpc_client();
|
920 |
-
$client = new Jetpack_IXR_Client( array(
|
921 |
-
'user_id' => JETPACK_MASTER_USER,
|
922 |
-
) );
|
923 |
-
|
924 |
-
$client->query( 'jetpack.reindexStatus' );
|
925 |
-
|
926 |
-
if ( !$client->isError() ) {
|
927 |
-
$response = $client->getResponse();
|
928 |
-
if ( 'DONE' == $response['status'] ) {
|
929 |
-
Jetpack_Options::delete_option( 'sync_bulk_reindexing' );
|
930 |
-
}
|
931 |
-
}
|
932 |
-
|
933 |
-
return $response;
|
934 |
-
}
|
935 |
-
|
936 |
-
public function reindex_ui() {
|
937 |
-
$strings = json_encode( array(
|
938 |
-
'WAITING' => array(
|
939 |
-
'action' => __( 'Refresh Status', 'jetpack' ),
|
940 |
-
'status' => __( 'Indexing request queued and waiting…', 'jetpack' ),
|
941 |
-
),
|
942 |
-
'INDEXING' => array(
|
943 |
-
'action' => __( 'Refresh Status', 'jetpack' ),
|
944 |
-
'status' => __( 'Indexing posts', 'jetpack' ),
|
945 |
-
),
|
946 |
-
'DONE' => array(
|
947 |
-
'action' => __( 'Reindex Posts', 'jetpack' ),
|
948 |
-
'status' => __( 'Posts indexed.', 'jetpack' ),
|
949 |
-
),
|
950 |
-
'ERROR' => array(
|
951 |
-
'action' => __( 'Refresh Status', 'jetpack' ),
|
952 |
-
'status' => __( 'Status unknown.', 'jetpack' ),
|
953 |
-
),
|
954 |
-
'ERROR:LARGE' => array(
|
955 |
-
'action' => __( 'Refresh Status', 'jetpack' ),
|
956 |
-
'status' => __( 'This site is too large, please contact Jetpack support to sync.', 'jetpack' ),
|
957 |
-
),
|
958 |
-
) );
|
959 |
-
|
960 |
-
wp_enqueue_script(
|
961 |
-
'jetpack_sync_reindex_control',
|
962 |
-
plugins_url( '_inc/jquery.jetpack-sync.js', JETPACK__PLUGIN_FILE ),
|
963 |
-
array( 'jquery' ),
|
964 |
-
JETPACK__VERSION
|
965 |
-
);
|
966 |
-
|
967 |
-
$template = <<<EOT
|
968 |
-
<p class="jetpack_sync_reindex_control" id="jetpack_sync_reindex_control" data-strings="%s">
|
969 |
-
<input type="submit" class="jetpack_sync_reindex_control_action button" value="%s" disabled />
|
970 |
-
<span class="jetpack_sync_reindex_control_status">…</span>
|
971 |
-
</p>
|
972 |
-
EOT;
|
973 |
-
|
974 |
-
return sprintf(
|
975 |
-
$template,
|
976 |
-
esc_attr( $strings ),
|
977 |
-
esc_attr__( 'Refresh Status', 'jetpack' )
|
978 |
-
);
|
979 |
-
}
|
980 |
-
|
981 |
-
private function _get_post_count_local() {
|
982 |
-
global $wpdb;
|
983 |
-
return (int) $wpdb->get_var(
|
984 |
-
"SELECT count(*)
|
985 |
-
FROM {$wpdb->posts}
|
986 |
-
WHERE post_status = 'publish' AND post_password = ''"
|
987 |
-
);
|
988 |
-
}
|
989 |
-
|
990 |
-
private function _get_post_count_cloud() {
|
991 |
-
$blog_id = Jetpack::init()->get_option( 'id' );
|
992 |
-
|
993 |
-
$body = array(
|
994 |
-
'size' => 1,
|
995 |
-
);
|
996 |
-
|
997 |
-
$response = wp_remote_post(
|
998 |
-
"https://public-api.wordpress.com/rest/v1/sites/$blog_id/search",
|
999 |
-
array(
|
1000 |
-
'timeout' => 10,
|
1001 |
-
'user-agent' => 'jetpack_related_posts',
|
1002 |
-
'sslverify' => true,
|
1003 |
-
'body' => $body,
|
1004 |
-
)
|
1005 |
-
);
|
1006 |
-
|
1007 |
-
if ( is_wp_error( $response ) ) {
|
1008 |
-
return 0;
|
1009 |
-
}
|
1010 |
-
|
1011 |
-
$results = json_decode( wp_remote_retrieve_body( $response ), true );
|
1012 |
-
|
1013 |
-
return isset( $results['results'] ) && isset( $results['results']['total'] ) ? (int) $results['results']['total'] : 0;
|
1014 |
-
}
|
1015 |
-
|
1016 |
-
/**
|
1017 |
-
* Sometimes we need to fake options to be able to sync data with .com
|
1018 |
-
* This is a helper function. That will make it easier to do just that.
|
1019 |
-
*
|
1020 |
-
* It will make sure that the options are synced when do_action( 'jetpack_sync_all_registered_options' );
|
1021 |
-
*
|
1022 |
-
* Which should happen everytime we update Jetpack to a new version or daily by Jetpack_Heartbeat.
|
1023 |
-
*
|
1024 |
-
* $callback is a function that is passed into a filter that returns the value of the option.
|
1025 |
-
* This value should never be false. Since we want to short circuit the get_option function
|
1026 |
-
* to return the value of the our callback.
|
1027 |
-
*
|
1028 |
-
* You can also trigger an update when a something else changes by calling the
|
1029 |
-
* do_action( 'add_option_jetpack_' . $option, 'jetpack_'.$option, $callback_function );
|
1030 |
-
* on the action that should that would trigger the update.
|
1031 |
-
*
|
1032 |
-
*
|
1033 |
-
* @param string $option Option will always be prefixed with Jetpack and be saved on .com side
|
1034 |
-
* @param string or array $callback
|
1035 |
-
*/
|
1036 |
-
function mock_option( $option , $callback ) {
|
1037 |
-
add_filter( 'pre_option_jetpack_'. $option, $callback );
|
1038 |
-
// This shouldn't happen but if it does we return the same as before.
|
1039 |
-
add_filter( 'option_jetpack_'. $option, $callback );
|
1040 |
-
// Instead of passing a file we just pass in a string.
|
1041 |
-
$this->options( 'mock-option' , 'jetpack_' . $option );
|
1042 |
-
|
1043 |
-
}
|
1044 |
-
/**
|
1045 |
-
* Sometimes you need to sync constants to .com
|
1046 |
-
* Using the function will allow you to do just that.
|
1047 |
-
*
|
1048 |
-
* @param 'string' $constant Constants defined in code.
|
1049 |
-
*
|
1050 |
-
*/
|
1051 |
-
function register_constant( $constant ) {
|
1052 |
-
$this->register( 'constant', $constant );
|
1053 |
-
}
|
1054 |
-
|
1055 |
-
function get_default_constant() {
|
1056 |
-
$filter = current_filter();
|
1057 |
-
// We don't know what the constant is so we get it from the current filter.
|
1058 |
-
if ( 'pre_option_jetpack_constant_' === substr( $filter, 0, 28 ) ) {
|
1059 |
-
$constant = substr( $filter, 28 );
|
1060 |
-
if ( defined( $constant ) ) {
|
1061 |
-
// If constant is set to false we will not shortcut the get_option function and will return the default value.
|
1062 |
-
// Hance we set it to null. Which in most cases would produce the same result.
|
1063 |
-
return false === constant( $constant ) ? null : constant( $constant );
|
1064 |
-
}
|
1065 |
-
return $this->default_constant( $constant );
|
1066 |
-
}
|
1067 |
-
}
|
1068 |
-
/**
|
1069 |
-
* Simular to $this->options() function.
|
1070 |
-
* Add the constant to be synced to .com when we activate the module.
|
1071 |
-
* As well as on heartbeat and plugin upgrade and connection to .com.
|
1072 |
-
*
|
1073 |
-
* @param string $file
|
1074 |
-
* @param string $constant
|
1075 |
-
*/
|
1076 |
-
function constant( $file, $constant ) {
|
1077 |
-
$constants = func_get_args();
|
1078 |
-
$file = array_shift( $constants );
|
1079 |
-
|
1080 |
-
$module_slug = Jetpack::get_module_slug( $file );
|
1081 |
-
|
1082 |
-
if ( ! isset( $this->sync_constants[ $module_slug ] ) ) {
|
1083 |
-
$this->sync_constants[ $module_slug ] = array();
|
1084 |
-
}
|
1085 |
-
|
1086 |
-
foreach ( $constants as $constant ) {
|
1087 |
-
$this->sync_constants[ $module_slug ][] = $constant;
|
1088 |
-
}
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
/**
|
1092 |
-
* Helper function to return the constants value.
|
1093 |
-
*
|
1094 |
-
* @param string $constant
|
1095 |
-
* @return value of the constant or null if the constant is set to false or doesn't exits.
|
1096 |
-
*/
|
1097 |
-
static function get_constant( $constant ) {
|
1098 |
-
if ( defined( $constant ) ) {
|
1099 |
-
return constant( $constant );
|
1100 |
-
}
|
1101 |
-
|
1102 |
-
return null;
|
1103 |
-
}
|
1104 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-twitter-cards.php
CHANGED
@@ -178,7 +178,7 @@ class Jetpack_Twitter_Cards {
|
|
178 |
}
|
179 |
|
180 |
static function site_tag() {
|
181 |
-
$site_tag =
|
182 |
if ( empty( $site_tag ) ) {
|
183 |
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
184 |
return 'wordpressdotcom';
|
178 |
}
|
179 |
|
180 |
static function site_tag() {
|
181 |
+
$site_tag = Jetpack_Options::get_option_and_ensure_autoload( 'jetpack-twitter-cards-site-tag', '' );
|
182 |
if ( empty( $site_tag ) ) {
|
183 |
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
184 |
return 'wordpressdotcom';
|
class.jetpack-user-agent.php
CHANGED
@@ -1,47 +1,84 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
|
4 |
-
static $kinds
|
5 |
-
static $first_run
|
6 |
static $matched_agent = '';
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
$ua_info = new Jetpack_User_Agent_Info();
|
9 |
|
10 |
-
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) || strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ), 'ipad' ) )
|
11 |
return false;
|
|
|
12 |
|
13 |
// Remove Samsung Galaxy tablets (SCH-I800) from being mobile devices
|
14 |
-
if ( strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ) , 'sch-i800') )
|
15 |
return false;
|
|
|
16 |
|
17 |
-
if( $ua_info->is_android_tablet() && $ua_info->is_kindle_touch() === false )
|
18 |
return false;
|
|
|
19 |
|
20 |
-
if( $ua_info->is_blackberry_tablet() )
|
21 |
return false;
|
|
|
22 |
|
23 |
if ( $first_run ) {
|
24 |
$first_run = false;
|
25 |
|
26 |
//checks for iPhoneTier devices & RichCSS devices
|
27 |
if ( $ua_info->isTierIphone() || $ua_info->isTierRichCSS() ) {
|
28 |
-
|
29 |
-
|
30 |
}
|
31 |
|
32 |
-
if (
|
33 |
// if smart, we are not dumb so no need to check
|
34 |
$dumb_agents = $ua_info->dumb_agents;
|
35 |
-
$agent
|
|
|
36 |
foreach ( $dumb_agents as $dumb_agent ) {
|
37 |
if ( false !== strpos( $agent, $dumb_agent ) ) {
|
38 |
$kinds['dumb'] = true;
|
39 |
$matched_agent = $dumb_agent;
|
|
|
40 |
break;
|
41 |
}
|
42 |
}
|
43 |
|
44 |
-
if (
|
45 |
if ( isset( $_SERVER['HTTP_X_WAP_PROFILE'] ) ) {
|
46 |
$kinds['dumb'] = true;
|
47 |
$matched_agent = 'http_x_wap_profile';
|
@@ -52,14 +89,32 @@ function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
|
|
52 |
}
|
53 |
}
|
54 |
|
55 |
-
if ( $kinds['dumb'] || $kinds['smart'] )
|
56 |
$kinds['any'] = true;
|
|
|
57 |
}
|
58 |
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
-
return $
|
63 |
}
|
64 |
|
65 |
class Jetpack_User_Agent_Info {
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Determine if the current User Agent matches the passed $kind
|
5 |
+
*
|
6 |
+
* @param string $kind Category of mobile device to check for.
|
7 |
+
* Either: any, dumb, smart.
|
8 |
+
* @param bool $return_matched_agent Boolean indicating if the UA should be returned
|
9 |
+
*
|
10 |
+
* @return bool|string Boolean indicating if current UA matches $kind. If
|
11 |
+
* $return_matched_agent is true, returns the UA string
|
12 |
+
*/
|
13 |
function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
|
14 |
+
static $kinds = array( 'smart' => false, 'dumb' => false, 'any' => false );
|
15 |
+
static $first_run = true;
|
16 |
static $matched_agent = '';
|
17 |
|
18 |
+
if ( function_exists( 'apply_filters' ) ) {
|
19 |
+
/**
|
20 |
+
* Filter the value of jetpack_is_mobile before it is calculated.
|
21 |
+
*
|
22 |
+
* Passing a truthy value to the filter will short-circuit determining the
|
23 |
+
* mobile type, returning the passed value instead.
|
24 |
+
*
|
25 |
+
* @since 4.2.0
|
26 |
+
*
|
27 |
+
* @param bool|string $matches Boolean if current UA matches $kind or not. If
|
28 |
+
* $return_matched_agent is true, should return the UA string
|
29 |
+
* @param string $kind Category of mobile device being checked
|
30 |
+
* @param bool $return_matched_agent Boolean indicating if the UA should be returned
|
31 |
+
*/
|
32 |
+
$pre = apply_filters( 'pre_jetpack_is_mobile', null, $kind, $return_matched_agent );
|
33 |
+
|
34 |
+
if ( null !== $pre ) {
|
35 |
+
return $pre;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
$ua_info = new Jetpack_User_Agent_Info();
|
40 |
|
41 |
+
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) || strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ), 'ipad' ) ) {
|
42 |
return false;
|
43 |
+
}
|
44 |
|
45 |
// Remove Samsung Galaxy tablets (SCH-I800) from being mobile devices
|
46 |
+
if ( strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ) , 'sch-i800') ) {
|
47 |
return false;
|
48 |
+
}
|
49 |
|
50 |
+
if( $ua_info->is_android_tablet() && $ua_info->is_kindle_touch() === false ) {
|
51 |
return false;
|
52 |
+
}
|
53 |
|
54 |
+
if( $ua_info->is_blackberry_tablet() ) {
|
55 |
return false;
|
56 |
+
}
|
57 |
|
58 |
if ( $first_run ) {
|
59 |
$first_run = false;
|
60 |
|
61 |
//checks for iPhoneTier devices & RichCSS devices
|
62 |
if ( $ua_info->isTierIphone() || $ua_info->isTierRichCSS() ) {
|
63 |
+
$kinds['smart'] = true;
|
64 |
+
$matched_agent = $ua_info->matched_agent;
|
65 |
}
|
66 |
|
67 |
+
if ( ! $kinds['smart'] ) {
|
68 |
// if smart, we are not dumb so no need to check
|
69 |
$dumb_agents = $ua_info->dumb_agents;
|
70 |
+
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
71 |
+
|
72 |
foreach ( $dumb_agents as $dumb_agent ) {
|
73 |
if ( false !== strpos( $agent, $dumb_agent ) ) {
|
74 |
$kinds['dumb'] = true;
|
75 |
$matched_agent = $dumb_agent;
|
76 |
+
|
77 |
break;
|
78 |
}
|
79 |
}
|
80 |
|
81 |
+
if ( ! $kinds['dumb'] ) {
|
82 |
if ( isset( $_SERVER['HTTP_X_WAP_PROFILE'] ) ) {
|
83 |
$kinds['dumb'] = true;
|
84 |
$matched_agent = 'http_x_wap_profile';
|
89 |
}
|
90 |
}
|
91 |
|
92 |
+
if ( $kinds['dumb'] || $kinds['smart'] ) {
|
93 |
$kinds['any'] = true;
|
94 |
+
}
|
95 |
}
|
96 |
|
97 |
+
$value = $kinds[ $kind ];
|
98 |
+
|
99 |
+
if ( $return_matched_agent ) {
|
100 |
+
$value = $matched_agent;
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( function_exists( 'apply_filters' ) ) {
|
104 |
+
/**
|
105 |
+
* Filter the value of jetpack_is_mobile
|
106 |
+
*
|
107 |
+
* @since 4.2.0
|
108 |
+
*
|
109 |
+
* @param bool|string $matches Boolean if current UA matches $kind or not. If
|
110 |
+
* $return_matched_agent is true, should return the UA string
|
111 |
+
* @param string $kind Category of mobile device being checked
|
112 |
+
* @param bool $return_matched_agent Boolean indicating if the UA should be returned
|
113 |
+
*/
|
114 |
+
$value = apply_filters( 'jetpack_is_mobile', $value, $kind, $return_matched_agent );
|
115 |
+
}
|
116 |
|
117 |
+
return $value;
|
118 |
}
|
119 |
|
120 |
class Jetpack_User_Agent_Info {
|
class.jetpack-xmlrpc-server.php
CHANGED
@@ -28,10 +28,6 @@ class Jetpack_XMLRPC_Server {
|
|
28 |
'jetpack.testAPIUserCode' => array( $this, 'test_api_user_code' ),
|
29 |
'jetpack.featuresAvailable' => array( $this, 'features_available' ),
|
30 |
'jetpack.featuresEnabled' => array( $this, 'features_enabled' ),
|
31 |
-
'jetpack.getPost' => array( $this, 'get_post' ),
|
32 |
-
'jetpack.getPosts' => array( $this, 'get_posts' ),
|
33 |
-
'jetpack.getComment' => array( $this, 'get_comment' ),
|
34 |
-
'jetpack.getComments' => array( $this, 'get_comments' ),
|
35 |
'jetpack.disconnectBlog' => array( $this, 'disconnect_blog' ),
|
36 |
'jetpack.unlinkUser' => array( $this, 'unlink_user' ),
|
37 |
) );
|
@@ -301,7 +297,7 @@ class Jetpack_XMLRPC_Server {
|
|
301 |
'code' => (string) $api_user_code,
|
302 |
) ), $jetpack_token->secret );
|
303 |
|
304 |
-
if ( $hmac
|
305 |
return false;
|
306 |
}
|
307 |
|
@@ -359,54 +355,6 @@ class Jetpack_XMLRPC_Server {
|
|
359 |
return $modules;
|
360 |
}
|
361 |
|
362 |
-
function get_post( $id ) {
|
363 |
-
if ( !$id = (int) $id ) {
|
364 |
-
return false;
|
365 |
-
}
|
366 |
-
|
367 |
-
$jetpack = Jetpack::init();
|
368 |
-
|
369 |
-
$post = $jetpack->sync->get_post( $id );
|
370 |
-
return $post;
|
371 |
-
}
|
372 |
-
|
373 |
-
function get_posts( $args ) {
|
374 |
-
list( $post_ids ) = $args;
|
375 |
-
$post_ids = array_map( 'intval', (array) $post_ids );
|
376 |
-
$jp = Jetpack::init();
|
377 |
-
$sync_data = $jp->sync->get_content( array( 'posts' => $post_ids ) );
|
378 |
-
|
379 |
-
return $sync_data;
|
380 |
-
}
|
381 |
-
|
382 |
-
function get_comment( $id ) {
|
383 |
-
if ( !$id = (int) $id ) {
|
384 |
-
return false;
|
385 |
-
}
|
386 |
-
|
387 |
-
$jetpack = Jetpack::init();
|
388 |
-
|
389 |
-
$comment = $jetpack->sync->get_comment( $id );
|
390 |
-
if ( !is_array( $comment ) )
|
391 |
-
return false;
|
392 |
-
|
393 |
-
$post = $jetpack->sync->get_post( $comment['comment_post_ID'] );
|
394 |
-
if ( !$post ) {
|
395 |
-
return false;
|
396 |
-
}
|
397 |
-
|
398 |
-
return $comment;
|
399 |
-
}
|
400 |
-
|
401 |
-
function get_comments( $args ) {
|
402 |
-
list( $comment_ids ) = $args;
|
403 |
-
$comment_ids = array_map( 'intval', (array) $comment_ids );
|
404 |
-
$jp = Jetpack::init();
|
405 |
-
$sync_data = $jp->sync->get_content( array( 'comments' => $comment_ids ) );
|
406 |
-
|
407 |
-
return $sync_data;
|
408 |
-
}
|
409 |
-
|
410 |
function update_attachment_parent( $args ) {
|
411 |
$attachment_id = (int) $args[0];
|
412 |
$parent_id = (int) $args[1];
|
28 |
'jetpack.testAPIUserCode' => array( $this, 'test_api_user_code' ),
|
29 |
'jetpack.featuresAvailable' => array( $this, 'features_available' ),
|
30 |
'jetpack.featuresEnabled' => array( $this, 'features_enabled' ),
|
|
|
|
|
|
|
|
|
31 |
'jetpack.disconnectBlog' => array( $this, 'disconnect_blog' ),
|
32 |
'jetpack.unlinkUser' => array( $this, 'unlink_user' ),
|
33 |
) );
|
297 |
'code' => (string) $api_user_code,
|
298 |
) ), $jetpack_token->secret );
|
299 |
|
300 |
+
if ( ! hash_equals( $hmac, $verify ) ) {
|
301 |
return false;
|
302 |
}
|
303 |
|
355 |
return $modules;
|
356 |
}
|
357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
function update_attachment_parent( $args ) {
|
359 |
$attachment_id = (int) $args[0];
|
360 |
$parent_id = (int) $args[1];
|
class.jetpack.php
CHANGED
@@ -71,7 +71,7 @@ class Jetpack {
|
|
71 |
'latex' => array( 'wp-latex/wp-latex.php', 'WP LaTeX' )
|
72 |
);
|
73 |
|
74 |
-
|
75 |
'administrator' => 'manage_options',
|
76 |
'editor' => 'edit_others_posts',
|
77 |
'author' => 'publish_posts',
|
@@ -278,13 +278,6 @@ class Jetpack {
|
|
278 |
*/
|
279 |
public $stats = array();
|
280 |
|
281 |
-
/**
|
282 |
-
* Allows us to build a temporary security report
|
283 |
-
*
|
284 |
-
* @var array
|
285 |
-
*/
|
286 |
-
static $security_report = array();
|
287 |
-
|
288 |
/**
|
289 |
* Jetpack_Sync object
|
290 |
*/
|
@@ -316,7 +309,6 @@ class Jetpack {
|
|
316 |
self::$instance = new Jetpack;
|
317 |
|
318 |
self::$instance->plugin_upgrade();
|
319 |
-
|
320 |
}
|
321 |
|
322 |
return self::$instance;
|
@@ -334,30 +326,83 @@ class Jetpack {
|
|
334 |
$unfiltered_modules = Jetpack::get_active_modules();
|
335 |
$modules = array_filter( $unfiltered_modules, array( 'Jetpack', 'is_module' ) );
|
336 |
if ( array_diff( $unfiltered_modules, $modules ) ) {
|
337 |
-
|
338 |
}
|
339 |
|
340 |
-
|
341 |
-
|
342 |
-
* Fires when synchronizing all registered options and constants.
|
343 |
-
*
|
344 |
-
* @since 3.3.0
|
345 |
-
*/
|
346 |
-
do_action( 'jetpack_sync_all_registered_options' );
|
347 |
|
|
|
348 |
Jetpack::maybe_set_version_option();
|
349 |
}
|
350 |
}
|
351 |
}
|
352 |
|
353 |
static function activate_manage( ) {
|
354 |
-
|
355 |
if ( did_action( 'init' ) || current_filter() == 'init' ) {
|
356 |
self::activate_module( 'manage', false, false );
|
357 |
} else if ( ! has_action( 'init' , array( __CLASS__, 'activate_manage' ) ) ) {
|
358 |
add_action( 'init', array( __CLASS__, 'activate_manage' ) );
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
|
|
|
|
|
|
|
|
|
|
|
361 |
}
|
362 |
|
363 |
/**
|
@@ -369,19 +414,6 @@ class Jetpack {
|
|
369 |
*/
|
370 |
add_action( 'init', array( $this, 'deprecated_hooks' ) );
|
371 |
|
372 |
-
/**
|
373 |
-
* We need sync object even in Multisite mode
|
374 |
-
*/
|
375 |
-
$this->sync = new Jetpack_Sync;
|
376 |
-
|
377 |
-
/**
|
378 |
-
* Trigger a wp_version sync when updating WP versions
|
379 |
-
**/
|
380 |
-
add_action( 'upgrader_process_complete', array( 'Jetpack', 'update_get_wp_version' ), 10, 2 );
|
381 |
-
$this->sync->mock_option( 'wp_version', array( 'Jetpack', 'get_wp_version' ) );
|
382 |
-
|
383 |
-
add_action( 'init', array( $this, 'sync_update_data') );
|
384 |
-
add_action( 'init', array( $this, 'sync_theme_data' ) );
|
385 |
|
386 |
/*
|
387 |
* Load things that should only be in Network Admin.
|
@@ -392,85 +424,8 @@ class Jetpack {
|
|
392 |
*/
|
393 |
if( is_multisite() ) {
|
394 |
Jetpack_Network::init();
|
395 |
-
|
396 |
-
// Only sync this info if we are on a multi site
|
397 |
-
// @since 3.7
|
398 |
-
$this->sync->mock_option( 'network_name', array( 'Jetpack', 'network_name' ) );
|
399 |
-
$this->sync->mock_option( 'network_allow_new_registrations', array( 'Jetpack', 'network_allow_new_registrations' ) );
|
400 |
-
$this->sync->mock_option( 'network_add_new_users', array( 'Jetpack', 'network_add_new_users' ) );
|
401 |
-
$this->sync->mock_option( 'network_site_upload_space', array( 'Jetpack', 'network_site_upload_space' ) );
|
402 |
-
$this->sync->mock_option( 'network_upload_file_types', array( 'Jetpack', 'network_upload_file_types' ) );
|
403 |
-
$this->sync->mock_option( 'network_enable_administration_menus', array( 'Jetpack', 'network_enable_administration_menus' ) );
|
404 |
-
|
405 |
-
if( is_network_admin() ) {
|
406 |
-
// Sync network site data if it is updated or not.
|
407 |
-
add_action( 'update_wpmu_options', array( $this, 'update_jetpack_network_settings' ) );
|
408 |
-
return; // End here to prevent single site actions from firing
|
409 |
-
}
|
410 |
}
|
411 |
|
412 |
-
|
413 |
-
$theme_slug = get_option( 'stylesheet' );
|
414 |
-
|
415 |
-
|
416 |
-
// Modules should do Jetpack_Sync::sync_options( __FILE__, $option, ... ); instead
|
417 |
-
// We access the "internal" method here only because the Jetpack object isn't instantiated yet
|
418 |
-
$this->sync->options(
|
419 |
-
JETPACK__PLUGIN_DIR . 'jetpack.php',
|
420 |
-
'home',
|
421 |
-
'siteurl',
|
422 |
-
'blogname',
|
423 |
-
'gmt_offset',
|
424 |
-
'timezone_string',
|
425 |
-
'security_report',
|
426 |
-
'stylesheet',
|
427 |
-
"theme_mods_{$theme_slug}",
|
428 |
-
'jetpack_sync_non_public_post_stati',
|
429 |
-
'jetpack_options',
|
430 |
-
'site_icon', // (int) - ID of core's Site Icon attachment ID
|
431 |
-
'default_post_format',
|
432 |
-
'default_category',
|
433 |
-
'large_size_w',
|
434 |
-
'large_size_h',
|
435 |
-
'thumbnail_size_w',
|
436 |
-
'thumbnail_size_h',
|
437 |
-
'medium_size_w',
|
438 |
-
'medium_size_h',
|
439 |
-
'thumbnail_crop',
|
440 |
-
'image_default_link_type'
|
441 |
-
);
|
442 |
-
|
443 |
-
foreach( Jetpack_Options::get_option_names( 'non-compact' ) as $option ) {
|
444 |
-
$this->sync->options( __FILE__, 'jetpack_' . $option );
|
445 |
-
}
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Sometimes you want to sync data to .com without adding options to .org sites.
|
449 |
-
* The mock option allows you to do just that.
|
450 |
-
*/
|
451 |
-
$this->sync->mock_option( 'is_main_network', array( $this, 'is_main_network_option' ) );
|
452 |
-
$this->sync->mock_option( 'is_multi_site', array( $this, 'is_multisite' ) );
|
453 |
-
$this->sync->mock_option( 'main_network_site', array( $this, 'jetpack_main_network_site_option' ) );
|
454 |
-
$this->sync->mock_option( 'single_user_site', array( 'Jetpack', 'is_single_user_site' ) );
|
455 |
-
$this->sync->mock_option( 'stat_data', array( $this, 'get_stat_data' ) );
|
456 |
-
|
457 |
-
$this->sync->mock_option( 'has_file_system_write_access', array( 'Jetpack', 'file_system_write_access' ) );
|
458 |
-
$this->sync->mock_option( 'is_version_controlled', array( 'Jetpack', 'is_version_controlled' ) );
|
459 |
-
$this->sync->mock_option( 'max_upload_size', 'wp_max_upload_size' );
|
460 |
-
$this->sync->mock_option( 'content_width', array( 'Jetpack', 'get_content_width' ) );
|
461 |
-
|
462 |
-
/**
|
463 |
-
* Trigger an update to the main_network_site when we update the blogname of a site.
|
464 |
-
*
|
465 |
-
*/
|
466 |
-
add_action( 'update_option_siteurl', array( $this, 'update_jetpack_main_network_site_option' ) );
|
467 |
-
|
468 |
-
add_action( 'update_option', array( $this, 'log_settings_change' ), 10, 3 );
|
469 |
-
|
470 |
-
// Update the settings everytime the we register a new user to the site or we delete a user.
|
471 |
-
add_action( 'user_register', array( $this, 'is_single_user_site_invalidate' ) );
|
472 |
-
add_action( 'deleted_user', array( $this, 'is_single_user_site_invalidate' ) );
|
473 |
-
|
474 |
// Unlink user before deleting the user from .com
|
475 |
add_action( 'deleted_user', array( $this, 'unlink_user' ), 10, 1 );
|
476 |
add_action( 'remove_user_from_blog', array( $this, 'unlink_user' ), 10, 1 );
|
@@ -533,9 +488,6 @@ class Jetpack {
|
|
533 |
// Filter the dashboard meta box order to swap the new one in in place of the old one.
|
534 |
add_filter( 'get_user_option_meta-box-order_dashboard', array( $this, 'get_user_option_meta_box_order_dashboard' ) );
|
535 |
|
536 |
-
add_action( 'wp_ajax_jetpack-sync-reindex-trigger', array( $this, 'sync_reindex_trigger' ) );
|
537 |
-
add_action( 'wp_ajax_jetpack-sync-reindex-status', array( $this, 'sync_reindex_status' ) );
|
538 |
-
|
539 |
// returns HTTPS support status
|
540 |
add_action( 'wp_ajax_jetpack-recheck-ssl', array( $this, 'ajax_recheck_ssl' ) );
|
541 |
|
@@ -562,12 +514,12 @@ class Jetpack {
|
|
562 |
add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) );
|
563 |
add_action( 'admin_enqueue_scripts', array( $this, 'devicepx' ) );
|
564 |
|
565 |
-
add_action( 'jetpack_activate_module', array( $this, 'activate_module_actions' ) );
|
566 |
-
|
567 |
add_action( 'plugins_loaded', array( $this, 'extra_oembed_providers' ), 100 );
|
568 |
|
569 |
add_action( 'jetpack_notices', array( $this, 'show_development_mode_notice' ) );
|
570 |
|
|
|
|
|
571 |
/**
|
572 |
* These actions run checks to load additional files.
|
573 |
* They check for external files or plugins, so they need to run as late as possible.
|
@@ -598,33 +550,6 @@ class Jetpack {
|
|
598 |
add_action( 'wp_print_footer_scripts', array( $this, 'implode_frontend_css' ), -1 ); // Run first to trigger before `print_late_styles`
|
599 |
}
|
600 |
|
601 |
-
// Sync Core Icon: Detect changes in Core's Site Icon and make it syncable.
|
602 |
-
add_action( 'add_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
603 |
-
add_action( 'update_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
604 |
-
add_action( 'delete_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
605 |
-
add_action( 'jetpack_heartbeat', array( $this, 'jetpack_sync_core_icon' ) );
|
606 |
-
|
607 |
-
}
|
608 |
-
|
609 |
-
/*
|
610 |
-
* Make sure any site icon added to core can get
|
611 |
-
* synced back to dotcom, so we can display it there.
|
612 |
-
*/
|
613 |
-
function jetpack_sync_core_icon() {
|
614 |
-
if ( function_exists( 'get_site_icon_url' ) ) {
|
615 |
-
$url = get_site_icon_url();
|
616 |
-
} else {
|
617 |
-
return;
|
618 |
-
}
|
619 |
-
|
620 |
-
require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
|
621 |
-
// If there's a core icon, maybe update the option. If not, fall back to Jetpack's.
|
622 |
-
if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
|
623 |
-
// This is the option that is synced with dotcom
|
624 |
-
Jetpack_Options::update_option( 'site_icon_url', $url );
|
625 |
-
} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
|
626 |
-
Jetpack_Options::delete_option( 'site_icon_url' );
|
627 |
-
}
|
628 |
}
|
629 |
|
630 |
function jetpack_admin_ajax_tracks_callback() {
|
@@ -930,13 +855,7 @@ class Jetpack {
|
|
930 |
// Don't let anyone authenticate
|
931 |
$_COOKIE = array();
|
932 |
remove_all_filters( 'authenticate' );
|
933 |
-
|
934 |
-
/**
|
935 |
-
* For the moment, remove Limit Login Attempts if its xmlrpc for Jetpack.
|
936 |
-
* If Limit Login Attempts is installed as a mu-plugin, it can occasionally
|
937 |
-
* generate false-positives.
|
938 |
-
*/
|
939 |
-
remove_filter( 'wp_login_failed', 'limit_login_failed' );
|
940 |
|
941 |
if ( Jetpack::is_active() ) {
|
942 |
// Allow Jetpack authentication
|
@@ -1003,7 +922,7 @@ class Jetpack {
|
|
1003 |
jetpack_register_genericons();
|
1004 |
|
1005 |
/**
|
1006 |
-
* Register the social logos
|
1007 |
*/
|
1008 |
require_once( JETPACK__PLUGIN_DIR . '_inc/social-logos.php' );
|
1009 |
jetpack_register_social_logos();
|
@@ -1200,51 +1119,15 @@ class Jetpack {
|
|
1200 |
* @return null
|
1201 |
*/
|
1202 |
function update_jetpack_main_network_site_option() {
|
1203 |
-
|
1204 |
-
/**
|
1205 |
-
* Fires when the site URL is updated.
|
1206 |
-
* Determines if the site is the main site of a Mulitiste network.
|
1207 |
-
*
|
1208 |
-
* @since 3.3.0
|
1209 |
-
*
|
1210 |
-
* @param string jetpack_main_network_site.
|
1211 |
-
* @param string network_site_url() Site URL for the "main" site of the current Multisite network.
|
1212 |
-
*/
|
1213 |
-
do_action( 'add_option_jetpack_main_network_site', 'jetpack_main_network_site', network_site_url() );
|
1214 |
-
/**
|
1215 |
-
* Fires when the site URL is updated.
|
1216 |
-
* Determines if the is part of a multi network.
|
1217 |
-
*
|
1218 |
-
* @since 3.3.0
|
1219 |
-
*
|
1220 |
-
* @param string jetpack_is_main_network.
|
1221 |
-
* @param bool Jetpack::is_multi_network() Is the site part of a multi network.
|
1222 |
-
*/
|
1223 |
-
do_action( 'add_option_jetpack_is_main_network', 'jetpack_is_main_network', (string) (bool) Jetpack::is_multi_network() );
|
1224 |
-
/**
|
1225 |
-
* Fires when the site URL is updated.
|
1226 |
-
* Determines if the site is part of a multisite network.
|
1227 |
-
*
|
1228 |
-
* @since 3.4.0
|
1229 |
-
*
|
1230 |
-
* @param string jetpack_is_multi_site.
|
1231 |
-
* @param bool is_multisite() Is the site part of a mutlisite network.
|
1232 |
-
*/
|
1233 |
-
do_action( 'add_option_jetpack_is_multi_site', 'jetpack_is_multi_site', (string) (bool) is_multisite() );
|
1234 |
}
|
1235 |
/**
|
1236 |
* Triggered after a user updates the network settings via Network Settings Admin Page
|
1237 |
*
|
1238 |
*/
|
1239 |
function update_jetpack_network_settings() {
|
|
|
1240 |
// Only sync this info for the main network site.
|
1241 |
-
do_action( 'add_option_jetpack_network_name', 'jetpack_network_name', Jetpack::network_name() );
|
1242 |
-
do_action( 'add_option_jetpack_network_allow_new_registrations', 'jetpack_network_allow_new_registrations', Jetpack::network_allow_new_registrations() );
|
1243 |
-
do_action( 'add_option_jetpack_network_add_new_users', 'jetpack_network_add_new_users', Jetpack::network_add_new_users() );
|
1244 |
-
do_action( 'add_option_jetpack_network_site_upload_space', 'jetpack_network_site_upload_space', Jetpack::network_site_upload_space() );
|
1245 |
-
do_action( 'add_option_jetpack_network_upload_file_types', 'jetpack_network_upload_file_types', Jetpack::network_upload_file_types() );
|
1246 |
-
do_action( 'add_option_jetpack_network_enable_administration_menus', 'jetpack_network_enable_administration_menus', Jetpack::network_enable_administration_menus() );
|
1247 |
-
|
1248 |
}
|
1249 |
|
1250 |
/**
|
@@ -1253,7 +1136,6 @@ class Jetpack {
|
|
1253 |
* @return bool
|
1254 |
*/
|
1255 |
public static function is_single_user_site() {
|
1256 |
-
|
1257 |
$user_query = new WP_User_Query( array(
|
1258 |
'blog_id' => get_current_blog_id(),
|
1259 |
'fields' => 'ID',
|
@@ -1292,17 +1174,8 @@ class Jetpack {
|
|
1292 |
* @return string ( '1' | '0' )
|
1293 |
**/
|
1294 |
public static function is_version_controlled() {
|
1295 |
-
|
1296 |
-
|
1297 |
-
require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
1298 |
-
}
|
1299 |
-
$updater = new WP_Automatic_Updater();
|
1300 |
-
$is_version_controlled = strval( $updater->is_vcs_checkout( $context = ABSPATH ) );
|
1301 |
-
// transients should not be empty
|
1302 |
-
if ( empty( $is_version_controlled ) ) {
|
1303 |
-
$is_version_controlled = '0';
|
1304 |
-
}
|
1305 |
-
return $is_version_controlled;
|
1306 |
}
|
1307 |
|
1308 |
/**
|
@@ -1310,59 +1183,10 @@ class Jetpack {
|
|
1310 |
* @return string ( '1' | '0' )
|
1311 |
*/
|
1312 |
public static function featured_images_enabled() {
|
|
|
1313 |
return current_theme_supports( 'post-thumbnails' ) ? '1' : '0';
|
1314 |
}
|
1315 |
|
1316 |
-
/*
|
1317 |
-
* Sync back wp_version
|
1318 |
-
*/
|
1319 |
-
public static function get_wp_version() {
|
1320 |
-
global $wp_version;
|
1321 |
-
return $wp_version;
|
1322 |
-
}
|
1323 |
-
|
1324 |
-
/**
|
1325 |
-
* Keeps wp_version in sync with .com when WordPress core updates
|
1326 |
-
**/
|
1327 |
-
public static function update_get_wp_version( $update, $meta_data ) {
|
1328 |
-
if ( 'update' === $meta_data['action'] && 'core' === $meta_data['type'] ) {
|
1329 |
-
/** This action is documented in wp-includes/option.php */
|
1330 |
-
/**
|
1331 |
-
* This triggers the sync for the jetpack version
|
1332 |
-
* See Jetpack_Sync options method for more info.
|
1333 |
-
*/
|
1334 |
-
do_action( 'add_option_jetpack_wp_version', 'jetpack_wp_version', (string) Jetpack::get_wp_version() );
|
1335 |
-
}
|
1336 |
-
}
|
1337 |
-
|
1338 |
-
/**
|
1339 |
-
* Triggers a sync of update counts and update details
|
1340 |
-
*/
|
1341 |
-
function sync_update_data() {
|
1342 |
-
// Anytime WordPress saves update data, we'll want to sync update data
|
1343 |
-
add_action( 'set_site_transient_update_plugins', array( 'Jetpack', 'refresh_update_data' ) );
|
1344 |
-
add_action( 'set_site_transient_update_themes', array( 'Jetpack', 'refresh_update_data' ) );
|
1345 |
-
add_action( 'set_site_transient_update_core', array( 'Jetpack', 'refresh_update_data' ) );
|
1346 |
-
// Anytime a connection to jetpack is made, sync the update data
|
1347 |
-
add_action( 'jetpack_site_registered', array( 'Jetpack', 'refresh_update_data' ) );
|
1348 |
-
// Anytime the Jetpack Version changes, sync the the update data
|
1349 |
-
add_action( 'updating_jetpack_version', array( 'Jetpack', 'refresh_update_data' ) );
|
1350 |
-
|
1351 |
-
if ( current_user_can( 'update_core' ) && current_user_can( 'update_plugins' ) && current_user_can( 'update_themes' ) ) {
|
1352 |
-
$this->sync->mock_option( 'updates', array( 'Jetpack', 'get_updates' ) );
|
1353 |
-
}
|
1354 |
-
|
1355 |
-
$this->sync->mock_option( 'update_details', array( 'Jetpack', 'get_update_details' ) );
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
/**
|
1359 |
-
* Triggers a sync of information specific to the current theme.
|
1360 |
-
*/
|
1361 |
-
function sync_theme_data() {
|
1362 |
-
add_action( 'switch_theme', array( 'Jetpack', 'refresh_theme_data' ) );
|
1363 |
-
$this->sync->mock_option( 'featured_images_enabled', array( 'Jetpack', 'featured_images_enabled' ) );
|
1364 |
-
}
|
1365 |
-
|
1366 |
/**
|
1367 |
* jetpack_updates is saved in the following schema:
|
1368 |
*
|
@@ -1404,58 +1228,12 @@ class Jetpack {
|
|
1404 |
}
|
1405 |
|
1406 |
public static function refresh_update_data() {
|
1407 |
-
|
1408 |
-
/**
|
1409 |
-
* Fires whenever the amount of updates needed for a site changes.
|
1410 |
-
* Syncs an array that includes the number of theme, plugin, and core updates available, as well as the latest core version available.
|
1411 |
-
*
|
1412 |
-
* @since 3.7.0
|
1413 |
-
*
|
1414 |
-
* @param string jetpack_updates
|
1415 |
-
* @param array Update counts calculated by Jetpack::get_updates
|
1416 |
-
*/
|
1417 |
-
do_action( 'add_option_jetpack_updates', 'jetpack_updates', Jetpack::get_updates() );
|
1418 |
-
}
|
1419 |
-
/**
|
1420 |
-
* Fires whenever the amount of updates needed for a site changes.
|
1421 |
-
* Syncs an array of core, theme, and plugin data, and which of each is out of date
|
1422 |
-
*
|
1423 |
-
* @since 3.7.0
|
1424 |
-
*
|
1425 |
-
* @param string jetpack_update_details
|
1426 |
-
* @param array Update details calculated by Jetpack::get_update_details
|
1427 |
-
*/
|
1428 |
-
do_action( 'add_option_jetpack_update_details', 'jetpack_update_details', Jetpack::get_update_details() );
|
1429 |
-
}
|
1430 |
|
1431 |
-
public static function refresh_theme_data() {
|
1432 |
-
/**
|
1433 |
-
* Fires whenever a theme change is made.
|
1434 |
-
*
|
1435 |
-
* @since 3.8.1
|
1436 |
-
*
|
1437 |
-
* @param string featured_images_enabled
|
1438 |
-
* @param boolean Whether featured images are enabled or not
|
1439 |
-
*/
|
1440 |
-
do_action( 'add_option_jetpack_featured_images_enabled', 'jetpack_featured_images_enabled', Jetpack::featured_images_enabled() );
|
1441 |
}
|
1442 |
|
1443 |
-
|
1444 |
-
|
1445 |
-
*
|
1446 |
-
* @return null
|
1447 |
-
*/
|
1448 |
-
function is_single_user_site_invalidate() {
|
1449 |
-
/**
|
1450 |
-
* Fires when a user is added or removed from a site.
|
1451 |
-
* Determines if the site is a single user site.
|
1452 |
-
*
|
1453 |
-
* @since 3.4.0
|
1454 |
-
*
|
1455 |
-
* @param string jetpack_single_user_site.
|
1456 |
-
* @param bool Jetpack::is_single_user_site() Is the current site a single user site.
|
1457 |
-
*/
|
1458 |
-
do_action( 'update_option_jetpack_single_user_site', 'jetpack_single_user_site', (bool) Jetpack::is_single_user_site() );
|
1459 |
}
|
1460 |
|
1461 |
/**
|
@@ -1537,6 +1315,25 @@ class Jetpack {
|
|
1537 |
}
|
1538 |
}
|
1539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1540 |
/**
|
1541 |
* Whether Jetpack's version maps to a public release, or a development version.
|
1542 |
*/
|
@@ -1552,6 +1349,7 @@ class Jetpack {
|
|
1552 |
if ( ! $user_id ) {
|
1553 |
return false;
|
1554 |
}
|
|
|
1555 |
return (bool) Jetpack_Data::get_access_token( $user_id );
|
1556 |
}
|
1557 |
|
@@ -1623,47 +1421,8 @@ class Jetpack {
|
|
1623 |
* Synchronize connected user role changes
|
1624 |
*/
|
1625 |
function user_role_change( $user_id ) {
|
1626 |
-
|
1627 |
-
|
1628 |
-
wp_set_current_user( $user_id );
|
1629 |
-
$role = $this->translate_current_user_to_role();
|
1630 |
-
$signed_role = $this->sign_role( $role );
|
1631 |
-
wp_set_current_user( $current_user_id );
|
1632 |
-
|
1633 |
-
$master_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
|
1634 |
-
$master_user_id = absint( $master_token->external_user_id );
|
1635 |
-
|
1636 |
-
if ( ! $master_user_id )
|
1637 |
-
return; // this shouldn't happen
|
1638 |
-
|
1639 |
-
Jetpack::xmlrpc_async_call( 'jetpack.updateRole', $user_id, $signed_role );
|
1640 |
-
//@todo retry on failure
|
1641 |
-
|
1642 |
-
//try to choose a new master if we're demoting the current one
|
1643 |
-
if ( $user_id == $master_user_id && 'administrator' != $role ) {
|
1644 |
-
$query = new WP_User_Query(
|
1645 |
-
array(
|
1646 |
-
'fields' => array( 'id' ),
|
1647 |
-
'role' => 'administrator',
|
1648 |
-
'orderby' => 'id',
|
1649 |
-
'exclude' => array( $master_user_id ),
|
1650 |
-
)
|
1651 |
-
);
|
1652 |
-
$new_master = false;
|
1653 |
-
foreach ( $query->results as $result ) {
|
1654 |
-
$uid = absint( $result->id );
|
1655 |
-
if ( $uid && Jetpack::is_user_connected( $uid ) ) {
|
1656 |
-
$new_master = $uid;
|
1657 |
-
break;
|
1658 |
-
}
|
1659 |
-
}
|
1660 |
-
|
1661 |
-
if ( $new_master ) {
|
1662 |
-
Jetpack_Options::update_option( 'master_user', $new_master );
|
1663 |
-
}
|
1664 |
-
// else disconnect..?
|
1665 |
-
}
|
1666 |
-
}
|
1667 |
}
|
1668 |
|
1669 |
/**
|
@@ -1729,7 +1488,7 @@ class Jetpack {
|
|
1729 |
|
1730 |
if ( ! @include( Jetpack::get_module_path( $module ) ) ) {
|
1731 |
unset( $modules[ $index ] );
|
1732 |
-
|
1733 |
continue;
|
1734 |
}
|
1735 |
|
@@ -1810,7 +1569,8 @@ class Jetpack {
|
|
1810 |
if ( ! function_exists( 'get_plugins' ) ) {
|
1811 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
1812 |
}
|
1813 |
-
|
|
|
1814 |
$active_plugins = Jetpack::get_active_plugins();
|
1815 |
|
1816 |
$plugins = array();
|
@@ -1936,53 +1696,6 @@ class Jetpack {
|
|
1936 |
}
|
1937 |
}
|
1938 |
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
/*
|
1943 |
-
*
|
1944 |
-
* Jetpack Security Reports
|
1945 |
-
*
|
1946 |
-
* Allowed types: login_form, backup, file_scanning, spam
|
1947 |
-
*
|
1948 |
-
* Args for login_form and spam: 'blocked'=>(int)(optional), 'status'=>(string)(ok, warning, error), 'message'=>(optional, disregarded if status is ok, allowed tags: a, em, strong)
|
1949 |
-
*
|
1950 |
-
* Args for backup and file_scanning: 'last'=>(timestamp)(optional), 'next'=>(timestamp)(optional), 'status'=>(string)(ok, warning, error), 'message'=>(optional, disregarded if status is ok, allowed tags: a, em, strong)
|
1951 |
-
*
|
1952 |
-
*
|
1953 |
-
* Example code to submit a security report:
|
1954 |
-
*
|
1955 |
-
* function akismet_submit_jetpack_security_report() {
|
1956 |
-
* Jetpack::submit_security_report( 'spam', __FILE__, $args = array( 'blocked' => 138284, status => 'ok' ) );
|
1957 |
-
* }
|
1958 |
-
* add_action( 'jetpack_security_report', 'akismet_submit_jetpack_security_report' );
|
1959 |
-
*
|
1960 |
-
*/
|
1961 |
-
|
1962 |
-
|
1963 |
-
/**
|
1964 |
-
* Calls for security report submissions.
|
1965 |
-
*
|
1966 |
-
* @return null
|
1967 |
-
*/
|
1968 |
-
public static function perform_security_reporting() {
|
1969 |
-
$no_check_needed = get_site_transient( 'security_report_performed_recently' );
|
1970 |
-
|
1971 |
-
if ( $no_check_needed ) {
|
1972 |
-
return;
|
1973 |
-
}
|
1974 |
-
|
1975 |
-
/**
|
1976 |
-
* Fires before a security report is created.
|
1977 |
-
*
|
1978 |
-
* @since 3.4.0
|
1979 |
-
*/
|
1980 |
-
do_action( 'jetpack_security_report' );
|
1981 |
-
|
1982 |
-
Jetpack_Options::update_option( 'security_report', self::$security_report );
|
1983 |
-
set_site_transient( 'security_report_performed_recently', 1, 15 * MINUTE_IN_SECONDS );
|
1984 |
-
}
|
1985 |
-
|
1986 |
/**
|
1987 |
* Allows plugins to submit security reports.
|
1988 |
*
|
@@ -1991,79 +1704,9 @@ class Jetpack {
|
|
1991 |
* @param array $args See definitions above
|
1992 |
*/
|
1993 |
public static function submit_security_report( $type = '', $plugin_file = '', $args = array() ) {
|
1994 |
-
|
1995 |
-
if( !doing_action( 'jetpack_security_report' ) ) {
|
1996 |
-
return new WP_Error( 'not_collecting_report', 'Not currently collecting security reports. Please use the jetpack_security_report hook.' );
|
1997 |
-
}
|
1998 |
-
|
1999 |
-
if( !is_string( $type ) || !is_string( $plugin_file ) ) {
|
2000 |
-
return new WP_Error( 'invalid_security_report', 'Invalid Security Report' );
|
2001 |
-
}
|
2002 |
-
|
2003 |
-
if( !function_exists( 'get_plugin_data' ) ) {
|
2004 |
-
include( ABSPATH . 'wp-admin/includes/plugin.php' );
|
2005 |
-
}
|
2006 |
-
|
2007 |
-
//Get rid of any non-allowed args
|
2008 |
-
$args = array_intersect_key( $args, array_flip( array( 'blocked', 'last', 'next', 'status', 'message' ) ) );
|
2009 |
-
|
2010 |
-
$plugin = get_plugin_data( $plugin_file );
|
2011 |
-
|
2012 |
-
if ( !$plugin['Name'] ) {
|
2013 |
-
return new WP_Error( 'security_report_missing_plugin_name', 'Invalid Plugin File Provided' );
|
2014 |
-
}
|
2015 |
-
|
2016 |
-
// Sanitize everything to make sure we're not syncing something wonky
|
2017 |
-
$type = sanitize_key( $type );
|
2018 |
-
|
2019 |
-
$args['plugin'] = $plugin;
|
2020 |
-
|
2021 |
-
// Cast blocked, last and next as integers.
|
2022 |
-
// Last and next should be in unix timestamp format
|
2023 |
-
if ( isset( $args['blocked'] ) ) {
|
2024 |
-
$args['blocked'] = (int) $args['blocked'];
|
2025 |
-
}
|
2026 |
-
if ( isset( $args['last'] ) ) {
|
2027 |
-
$args['last'] = (int) $args['last'];
|
2028 |
-
}
|
2029 |
-
if ( isset( $args['next'] ) ) {
|
2030 |
-
$args['next'] = (int) $args['next'];
|
2031 |
-
}
|
2032 |
-
if ( !in_array( $args['status'], array( 'ok', 'warning', 'error' ) ) ) {
|
2033 |
-
$args['status'] = 'ok';
|
2034 |
-
}
|
2035 |
-
if ( isset( $args['message'] ) ) {
|
2036 |
-
|
2037 |
-
if( $args['status'] == 'ok' ) {
|
2038 |
-
unset( $args['message'] );
|
2039 |
-
}
|
2040 |
-
|
2041 |
-
$allowed_html = array(
|
2042 |
-
'a' => array(
|
2043 |
-
'href' => array(),
|
2044 |
-
'title' => array()
|
2045 |
-
),
|
2046 |
-
'em' => array(),
|
2047 |
-
'strong' => array(),
|
2048 |
-
);
|
2049 |
-
|
2050 |
-
$args['message'] = wp_kses( $args['message'], $allowed_html );
|
2051 |
-
}
|
2052 |
-
|
2053 |
-
$plugin_name = $plugin[ 'Name' ];
|
2054 |
-
|
2055 |
-
self::$security_report[ $type ][ $plugin_name ] = $args;
|
2056 |
-
}
|
2057 |
-
|
2058 |
-
/**
|
2059 |
-
* Collects a new report if needed, then returns it.
|
2060 |
-
*/
|
2061 |
-
public function get_security_report() {
|
2062 |
-
self::perform_security_reporting();
|
2063 |
-
return Jetpack_Options::get_option( 'security_report' );
|
2064 |
}
|
2065 |
|
2066 |
-
|
2067 |
/* Jetpack Options API */
|
2068 |
|
2069 |
public static function get_option_names( $type = 'compact' ) {
|
@@ -2539,23 +2182,14 @@ class Jetpack {
|
|
2539 |
public static function get_file_data( $file, $headers ) {
|
2540 |
//Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated
|
2541 |
$file_name = basename( $file );
|
2542 |
-
$
|
2543 |
-
$key = md5( $file_name . serialize( $headers ) );
|
2544 |
-
$refresh_cache = is_admin() && isset( $_GET['page'] ) && 'jetpack' === substr( $_GET['page'], 0, 7 );
|
2545 |
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
}
|
2550 |
|
2551 |
-
|
2552 |
-
|
2553 |
-
// Strip out any old Jetpack versions that are cluttering the option.
|
2554 |
-
$file_data_option = array_intersect_key( (array) $file_data_option, array( JETPACK__VERSION => null ) );
|
2555 |
-
$file_data_option[ JETPACK__VERSION ][ $key ] = $data;
|
2556 |
-
Jetpack_Options::update_option( 'file_data', $file_data_option );
|
2557 |
-
|
2558 |
-
return $data;
|
2559 |
}
|
2560 |
|
2561 |
/**
|
@@ -2717,7 +2351,7 @@ class Jetpack {
|
|
2717 |
foreach ( $modules as $module ) {
|
2718 |
if ( did_action( "jetpack_module_loaded_$module" ) ) {
|
2719 |
$active[] = $module;
|
2720 |
-
|
2721 |
continue;
|
2722 |
}
|
2723 |
|
@@ -2749,14 +2383,7 @@ class Jetpack {
|
|
2749 |
Jetpack::state( 'module', $module );
|
2750 |
ob_start();
|
2751 |
require $file;
|
2752 |
-
|
2753 |
-
* Fires when a specific module is activated.
|
2754 |
-
*
|
2755 |
-
* @since 1.9.0
|
2756 |
-
*
|
2757 |
-
* @param string $module Module slug.
|
2758 |
-
*/
|
2759 |
-
do_action( 'jetpack_activate_module', $module );
|
2760 |
$active[] = $module;
|
2761 |
$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
|
2762 |
if ( $active_state = Jetpack::state( $state ) ) {
|
@@ -2766,7 +2393,8 @@ class Jetpack {
|
|
2766 |
}
|
2767 |
$active_state[] = $module;
|
2768 |
Jetpack::state( $state, implode( ',', $active_state ) );
|
2769 |
-
|
|
|
2770 |
ob_end_clean();
|
2771 |
}
|
2772 |
Jetpack::state( 'error', false );
|
@@ -2841,10 +2469,10 @@ class Jetpack {
|
|
2841 |
Jetpack::catch_errors( true );
|
2842 |
ob_start();
|
2843 |
require Jetpack::get_module_path( $module );
|
2844 |
-
|
2845 |
-
do_action( 'jetpack_activate_module', $module );
|
2846 |
$active[] = $module;
|
2847 |
-
|
|
|
2848 |
Jetpack::state( 'error', false ); // the override
|
2849 |
Jetpack::state( 'message', 'module_activated' );
|
2850 |
Jetpack::state( 'module', $module );
|
@@ -2871,17 +2499,7 @@ class Jetpack {
|
|
2871 |
}
|
2872 |
|
2873 |
function activate_module_actions( $module ) {
|
2874 |
-
|
2875 |
-
* Fires when a module is activated.
|
2876 |
-
* The dynamic part of the filter, $module, is the module slug.
|
2877 |
-
*
|
2878 |
-
* @since 1.9.0
|
2879 |
-
*
|
2880 |
-
* @param string $module Module slug.
|
2881 |
-
*/
|
2882 |
-
do_action( "jetpack_activate_module_$module", $module );
|
2883 |
-
|
2884 |
-
$this->sync->sync_all_module_options( $module );
|
2885 |
}
|
2886 |
|
2887 |
public static function deactivate_module( $module ) {
|
@@ -2899,16 +2517,6 @@ class Jetpack {
|
|
2899 |
$active = Jetpack::get_active_modules();
|
2900 |
$new = array_filter( array_diff( $active, (array) $module ) );
|
2901 |
|
2902 |
-
/**
|
2903 |
-
* Fires when a module is deactivated.
|
2904 |
-
* The dynamic part of the filter, $module, is the module slug.
|
2905 |
-
*
|
2906 |
-
* @since 1.9.0
|
2907 |
-
*
|
2908 |
-
* @param string $module Module slug.
|
2909 |
-
*/
|
2910 |
-
do_action( "jetpack_deactivate_module_$module", $module );
|
2911 |
-
|
2912 |
// A flag for Jump Start so it's not shown again.
|
2913 |
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
2914 |
Jetpack_Options::update_option( 'jumpstart', 'jetpack_action_taken' );
|
@@ -2919,7 +2527,7 @@ class Jetpack {
|
|
2919 |
$jetpack->do_stats( 'server_side' );
|
2920 |
}
|
2921 |
|
2922 |
-
return
|
2923 |
}
|
2924 |
|
2925 |
public static function enable_module_configurable( $module ) {
|
@@ -3108,6 +2716,10 @@ p {
|
|
3108 |
|
3109 |
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
3110 |
|
|
|
|
|
|
|
|
|
3111 |
// Disable the Heartbeat cron
|
3112 |
Jetpack_Heartbeat::init()->deactivate();
|
3113 |
}
|
@@ -3308,7 +2920,7 @@ p {
|
|
3308 |
// If the plugin is not connected, display a connect message.
|
3309 |
if (
|
3310 |
// the plugin was auto-activated and needs its candy
|
3311 |
-
Jetpack_Options::
|
3312 |
||
|
3313 |
// the plugin is active, but was never activated. Probably came from a site-wide network activation
|
3314 |
! Jetpack_Options::get_option( 'activated' )
|
@@ -3353,9 +2965,6 @@ p {
|
|
3353 |
if ( Jetpack::is_active() || Jetpack::is_development_mode() ) {
|
3354 |
// Artificially throw errors in certain whitelisted cases during plugin activation
|
3355 |
add_action( 'activate_plugin', array( $this, 'throw_error_on_activate_plugin' ) );
|
3356 |
-
|
3357 |
-
// Kick off synchronization of user role when it changes
|
3358 |
-
add_action( 'set_user_role', array( $this, 'user_role_change' ) );
|
3359 |
}
|
3360 |
|
3361 |
// Jetpack Manage Activation Screen from .com
|
@@ -4557,8 +4166,8 @@ p {
|
|
4557 |
return $url;
|
4558 |
}
|
4559 |
|
4560 |
-
function translate_current_user_to_role() {
|
4561 |
-
foreach (
|
4562 |
if ( current_user_can( $role ) || current_user_can( $cap ) ) {
|
4563 |
return $role;
|
4564 |
}
|
@@ -4567,15 +4176,15 @@ p {
|
|
4567 |
return false;
|
4568 |
}
|
4569 |
|
4570 |
-
function translate_role_to_cap( $role ) {
|
4571 |
-
if ( ! isset(
|
4572 |
return false;
|
4573 |
}
|
4574 |
|
4575 |
-
return
|
4576 |
}
|
4577 |
|
4578 |
-
function sign_role( $role ) {
|
4579 |
if ( ! $user_id = (int) get_current_user_id() ) {
|
4580 |
return false;
|
4581 |
}
|
@@ -4613,8 +4222,8 @@ p {
|
|
4613 |
$gp_locale = GP_Locales::by_field( 'wp_locale', get_locale() );
|
4614 |
}
|
4615 |
|
4616 |
-
$role =
|
4617 |
-
$signed_role =
|
4618 |
|
4619 |
$user = wp_get_current_user();
|
4620 |
|
@@ -4626,7 +4235,7 @@ p {
|
|
4626 |
|
4627 |
$secrets = Jetpack::init()->generate_secrets( 'authorize' );
|
4628 |
@list( $secret ) = explode( ':', $secrets );
|
4629 |
-
|
4630 |
$site_icon = ( function_exists( 'has_site_icon') && has_site_icon() )
|
4631 |
? get_site_icon_url()
|
4632 |
: false;
|
@@ -4891,24 +4500,6 @@ p {
|
|
4891 |
return ( $a['sort'] < $b['sort'] ) ? -1 : 1;
|
4892 |
}
|
4893 |
|
4894 |
-
function sync_reindex_trigger() {
|
4895 |
-
if ( $this->current_user_is_connection_owner() && current_user_can( 'manage_options' ) ) {
|
4896 |
-
echo json_encode( $this->sync->reindex_trigger() );
|
4897 |
-
} else {
|
4898 |
-
echo '{"status":"ERROR"}';
|
4899 |
-
}
|
4900 |
-
exit;
|
4901 |
-
}
|
4902 |
-
|
4903 |
-
function sync_reindex_status(){
|
4904 |
-
if ( $this->current_user_is_connection_owner() && current_user_can( 'manage_options' ) ) {
|
4905 |
-
echo json_encode( $this->sync->reindex_status() );
|
4906 |
-
} else {
|
4907 |
-
echo '{"status":"ERROR"}';
|
4908 |
-
}
|
4909 |
-
exit;
|
4910 |
-
}
|
4911 |
-
|
4912 |
function ajax_recheck_ssl() {
|
4913 |
check_ajax_referer( 'recheck-ssl', 'ajax-nonce' );
|
4914 |
$result = Jetpack::permit_ssl( true );
|
@@ -5018,7 +4609,7 @@ p {
|
|
5018 |
<span id="jetpack-recheck-ssl-output"><?php echo get_transient( 'jetpack_https_test_message' ); ?></span>
|
5019 |
</p>
|
5020 |
<p>
|
5021 |
-
<?php printf( __( 'For more help, try our <a href="%1$s">connection debugger</a> or <a href="%2$s" target="_blank">troubleshooting tips</a>.', 'jetpack' ),
|
5022 |
esc_url( Jetpack::admin_url( array( 'page' => 'jetpack-debugger' ) ) ),
|
5023 |
esc_url( 'https://jetpack.com/support/getting-started-with-jetpack/troubleshooting-tips/' ) ); ?>
|
5024 |
</p>
|
@@ -5246,6 +4837,12 @@ p {
|
|
5246 |
list( $version ) = explode( ':', Jetpack_Options::get_option( 'version' ) );
|
5247 |
if ( JETPACK__VERSION != $version ) {
|
5248 |
Jetpack_Options::update_option( 'version', JETPACK__VERSION . ':' . time() );
|
|
|
|
|
|
|
|
|
|
|
|
|
5249 |
return true;
|
5250 |
}
|
5251 |
return false;
|
@@ -6044,8 +5641,6 @@ p {
|
|
6044 |
|
6045 |
if ( is_array( $identity_options ) ) {
|
6046 |
foreach( $identity_options as $identity_option ) {
|
6047 |
-
Jetpack_Sync::sync_options( __FILE__, $identity_option );
|
6048 |
-
|
6049 |
/**
|
6050 |
* Fires when a shadow site option is updated.
|
6051 |
* These options are updated via the Identity Crisis UI.
|
@@ -6165,13 +5760,13 @@ p {
|
|
6165 |
* Written so that we don't have re-check $key and $value params every time
|
6166 |
* we want to check if this site is whitelisted, for example in footer.php
|
6167 |
*
|
6168 |
-
* @return bool True = already
|
6169 |
*/
|
6170 |
public static function is_staging_site() {
|
6171 |
$is_staging = false;
|
6172 |
|
6173 |
$current_whitelist = Jetpack_Options::get_option( 'identity_crisis_whitelist' );
|
6174 |
-
if ( $current_whitelist ) {
|
6175 |
$options_to_check = Jetpack::identity_crisis_options_to_check();
|
6176 |
$cloud_options = Jetpack::init()->get_cloud_site_options( $options_to_check );
|
6177 |
|
@@ -6181,15 +5776,18 @@ p {
|
|
6181 |
break;
|
6182 |
}
|
6183 |
}
|
|
|
|
|
6184 |
}
|
6185 |
$known_staging = array(
|
6186 |
'urls' => array(
|
6187 |
-
'#\.staging\.wpengine\.com$#i',
|
6188 |
),
|
6189 |
'constants' => array(
|
6190 |
-
'IS_WPE_SNAPSHOT',
|
6191 |
-
'KINSTA_DEV_ENV',
|
6192 |
-
'
|
|
|
6193 |
)
|
6194 |
);
|
6195 |
/**
|
@@ -6430,21 +6028,6 @@ p {
|
|
6430 |
return false;
|
6431 |
}
|
6432 |
|
6433 |
-
/**
|
6434 |
-
* Sends a ping to the Jetpack servers to toggle on/off remote portions
|
6435 |
-
* required by some modules.
|
6436 |
-
*
|
6437 |
-
* @param string $module_slug
|
6438 |
-
*/
|
6439 |
-
public function toggle_module_on_wpcom( $module_slug ) {
|
6440 |
-
Jetpack::init()->sync->register( 'noop' );
|
6441 |
-
|
6442 |
-
if ( false !== strpos( current_filter(), 'jetpack_activate_module_' ) ) {
|
6443 |
-
self::check_privacy( $module_slug );
|
6444 |
-
}
|
6445 |
-
|
6446 |
-
}
|
6447 |
-
|
6448 |
/**
|
6449 |
* Throws warnings for deprecated hooks to be removed from Jetpack
|
6450 |
*/
|
@@ -6458,11 +6041,25 @@ p {
|
|
6458 |
* If there is no replacement us null for replacement_name
|
6459 |
*/
|
6460 |
$deprecated_list = array(
|
6461 |
-
'jetpack_bail_on_shortcode'
|
6462 |
-
'wpl_sharing_2014_1'
|
6463 |
-
'jetpack-tools-to-include'
|
6464 |
-
'jetpack_identity_crisis_options_to_check'
|
6465 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6466 |
);
|
6467 |
|
6468 |
// This is a silly loop depth. Better way?
|
@@ -6556,7 +6153,7 @@ p {
|
|
6556 |
}
|
6557 |
|
6558 |
/**
|
6559 |
-
* This methods removes all of the registered css files on the
|
6560 |
* from Jetpack in favor of using a single file. In effect "imploding"
|
6561 |
* all the files into one file.
|
6562 |
*
|
@@ -7068,7 +6665,7 @@ p {
|
|
7068 |
*/
|
7069 |
function jetpack_user_col_style() {
|
7070 |
global $current_screen;
|
7071 |
-
if ( 'users' == $current_screen->base ) { ?>
|
7072 |
<style>
|
7073 |
.fixed .column-user_jetpack {
|
7074 |
width: 21px;
|
71 |
'latex' => array( 'wp-latex/wp-latex.php', 'WP LaTeX' )
|
72 |
);
|
73 |
|
74 |
+
static $capability_translations = array(
|
75 |
'administrator' => 'manage_options',
|
76 |
'editor' => 'edit_others_posts',
|
77 |
'author' => 'publish_posts',
|
278 |
*/
|
279 |
public $stats = array();
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
/**
|
282 |
* Jetpack_Sync object
|
283 |
*/
|
309 |
self::$instance = new Jetpack;
|
310 |
|
311 |
self::$instance->plugin_upgrade();
|
|
|
312 |
}
|
313 |
|
314 |
return self::$instance;
|
326 |
$unfiltered_modules = Jetpack::get_active_modules();
|
327 |
$modules = array_filter( $unfiltered_modules, array( 'Jetpack', 'is_module' ) );
|
328 |
if ( array_diff( $unfiltered_modules, $modules ) ) {
|
329 |
+
Jetpack::update_active_modules( $modules );
|
330 |
}
|
331 |
|
332 |
+
// Reset cached module data
|
333 |
+
Jetpack_Options::delete_option( 'file_data' );
|
|
|
|
|
|
|
|
|
|
|
334 |
|
335 |
+
add_action( 'init', array( __CLASS__, 'activate_new_modules' ) );
|
336 |
Jetpack::maybe_set_version_option();
|
337 |
}
|
338 |
}
|
339 |
}
|
340 |
|
341 |
static function activate_manage( ) {
|
|
|
342 |
if ( did_action( 'init' ) || current_filter() == 'init' ) {
|
343 |
self::activate_module( 'manage', false, false );
|
344 |
} else if ( ! has_action( 'init' , array( __CLASS__, 'activate_manage' ) ) ) {
|
345 |
add_action( 'init', array( __CLASS__, 'activate_manage' ) );
|
346 |
}
|
347 |
+
}
|
348 |
+
|
349 |
+
static function update_active_modules( $modules ) {
|
350 |
+
$current_modules = Jetpack_Options::get_option( 'active_modules', array() );
|
351 |
+
|
352 |
+
$success = Jetpack_Options::update_option( 'active_modules', array_unique( $modules ) );
|
353 |
+
|
354 |
+
if ( is_array( $modules ) && is_array( $current_modules ) ) {
|
355 |
+
$new_active_modules = array_diff( $modules, $current_modules );
|
356 |
+
foreach( $new_active_modules as $module ) {
|
357 |
+
/**
|
358 |
+
* Fires when a specific module is activated.
|
359 |
+
*
|
360 |
+
* @since 1.9.0
|
361 |
+
*
|
362 |
+
* @param string $module Module slug.
|
363 |
+
* @param boolean $success whether the module was activated. @since 4.2
|
364 |
+
*/
|
365 |
+
do_action( 'jetpack_activate_module', $module, $success );
|
366 |
+
|
367 |
+
/**
|
368 |
+
* Fires when a module is activated.
|
369 |
+
* The dynamic part of the filter, $module, is the module slug.
|
370 |
+
*
|
371 |
+
* @since 1.9.0
|
372 |
+
*
|
373 |
+
* @param string $module Module slug.
|
374 |
+
*/
|
375 |
+
do_action( "jetpack_activate_module_$module", $module );
|
376 |
+
}
|
377 |
+
|
378 |
+
$new_deactive_modules = array_diff( $current_modules, $modules );
|
379 |
+
foreach( $new_deactive_modules as $module ) {
|
380 |
+
/**
|
381 |
+
* Fired after a module has been deactivated.
|
382 |
+
*
|
383 |
+
* @since 4.2.0
|
384 |
+
*
|
385 |
+
* @param string $module Module slug.
|
386 |
+
* @param boolean $success whether the module was deactivated.
|
387 |
+
*/
|
388 |
+
do_action( 'jetpack_deactivate_module', $module, $success );
|
389 |
+
/**
|
390 |
+
* Fires when a module is deactivated.
|
391 |
+
* The dynamic part of the filter, $module, is the module slug.
|
392 |
+
*
|
393 |
+
* @since 1.9.0
|
394 |
+
*
|
395 |
+
* @param string $module Module slug.
|
396 |
+
*/
|
397 |
+
do_action( "jetpack_deactivate_module_$module", $module );
|
398 |
+
}
|
399 |
+
}
|
400 |
|
401 |
+
return $success;
|
402 |
+
}
|
403 |
+
|
404 |
+
static function delete_active_modules() {
|
405 |
+
self::update_active_modules( array() );
|
406 |
}
|
407 |
|
408 |
/**
|
414 |
*/
|
415 |
add_action( 'init', array( $this, 'deprecated_hooks' ) );
|
416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
|
418 |
/*
|
419 |
* Load things that should only be in Network Admin.
|
424 |
*/
|
425 |
if( is_multisite() ) {
|
426 |
Jetpack_Network::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
}
|
428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
// Unlink user before deleting the user from .com
|
430 |
add_action( 'deleted_user', array( $this, 'unlink_user' ), 10, 1 );
|
431 |
add_action( 'remove_user_from_blog', array( $this, 'unlink_user' ), 10, 1 );
|
488 |
// Filter the dashboard meta box order to swap the new one in in place of the old one.
|
489 |
add_filter( 'get_user_option_meta-box-order_dashboard', array( $this, 'get_user_option_meta_box_order_dashboard' ) );
|
490 |
|
|
|
|
|
|
|
491 |
// returns HTTPS support status
|
492 |
add_action( 'wp_ajax_jetpack-recheck-ssl', array( $this, 'ajax_recheck_ssl' ) );
|
493 |
|
514 |
add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) );
|
515 |
add_action( 'admin_enqueue_scripts', array( $this, 'devicepx' ) );
|
516 |
|
|
|
|
|
517 |
add_action( 'plugins_loaded', array( $this, 'extra_oembed_providers' ), 100 );
|
518 |
|
519 |
add_action( 'jetpack_notices', array( $this, 'show_development_mode_notice' ) );
|
520 |
|
521 |
+
add_action( 'jetpack_notices', array( $this, 'show_sync_lag_notice' ) );
|
522 |
+
|
523 |
/**
|
524 |
* These actions run checks to load additional files.
|
525 |
* They check for external files or plugins, so they need to run as late as possible.
|
550 |
add_action( 'wp_print_footer_scripts', array( $this, 'implode_frontend_css' ), -1 ); // Run first to trigger before `print_late_styles`
|
551 |
}
|
552 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
}
|
554 |
|
555 |
function jetpack_admin_ajax_tracks_callback() {
|
855 |
// Don't let anyone authenticate
|
856 |
$_COOKIE = array();
|
857 |
remove_all_filters( 'authenticate' );
|
858 |
+
remove_all_actions( 'wp_login_failed' );
|
|
|
|
|
|
|
|
|
|
|
|
|
859 |
|
860 |
if ( Jetpack::is_active() ) {
|
861 |
// Allow Jetpack authentication
|
922 |
jetpack_register_genericons();
|
923 |
|
924 |
/**
|
925 |
+
* Register the social logos
|
926 |
*/
|
927 |
require_once( JETPACK__PLUGIN_DIR . '_inc/social-logos.php' );
|
928 |
jetpack_register_social_logos();
|
1119 |
* @return null
|
1120 |
*/
|
1121 |
function update_jetpack_main_network_site_option() {
|
1122 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1123 |
}
|
1124 |
/**
|
1125 |
* Triggered after a user updates the network settings via Network Settings Admin Page
|
1126 |
*
|
1127 |
*/
|
1128 |
function update_jetpack_network_settings() {
|
1129 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2' );
|
1130 |
// Only sync this info for the main network site.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1131 |
}
|
1132 |
|
1133 |
/**
|
1136 |
* @return bool
|
1137 |
*/
|
1138 |
public static function is_single_user_site() {
|
|
|
1139 |
$user_query = new WP_User_Query( array(
|
1140 |
'blog_id' => get_current_blog_id(),
|
1141 |
'fields' => 'ID',
|
1174 |
* @return string ( '1' | '0' )
|
1175 |
**/
|
1176 |
public static function is_version_controlled() {
|
1177 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2', 'Jetpack_Sync_Functions::is_version_controlled' );
|
1178 |
+
return (string) (int) Jetpack_Sync_Functions::is_version_controlled();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1179 |
}
|
1180 |
|
1181 |
/**
|
1183 |
* @return string ( '1' | '0' )
|
1184 |
*/
|
1185 |
public static function featured_images_enabled() {
|
1186 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2' );
|
1187 |
return current_theme_supports( 'post-thumbnails' ) ? '1' : '0';
|
1188 |
}
|
1189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1190 |
/**
|
1191 |
* jetpack_updates is saved in the following schema:
|
1192 |
*
|
1228 |
}
|
1229 |
|
1230 |
public static function refresh_update_data() {
|
1231 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1233 |
}
|
1234 |
|
1235 |
+
public static function refresh_theme_data() {
|
1236 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1237 |
}
|
1238 |
|
1239 |
/**
|
1315 |
}
|
1316 |
}
|
1317 |
|
1318 |
+
public static function show_sync_lag_notice() {
|
1319 |
+
if ( ! Jetpack::is_active() && Jetpack::is_staging_site() && Jetpack::is_development_mode() ) {
|
1320 |
+
return;
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-listener.php';
|
1324 |
+
$listener = Jetpack_Sync_Listener::get_instance();
|
1325 |
+
$queue = $listener->get_sync_queue();
|
1326 |
+
|
1327 |
+
if ( ! $listener->can_add_to_queue( $queue ) ) { // Display notice if the lag is large then 24 hours.
|
1328 |
+
$contact_url = admin_url( "admin.php?page=jetpack-debugger&contact=1¬e=Jetpack is not able to talk to WordPress.com." );
|
1329 |
+
$notice = sprintf(
|
1330 |
+
__( 'Oh no! Jetpack is unable to communicate with WordPress.com. This affects a number of features you may be using. Please check your server logs for errors and <a href="%s">contact Jetpack support</a>.', 'jetpack' ),
|
1331 |
+
esc_url( $contact_url )
|
1332 |
+
);
|
1333 |
+
echo '<div class="error" style="border-color: #dc3232;"><p>' . $notice . '</p></div>';
|
1334 |
+
}
|
1335 |
+
}
|
1336 |
+
|
1337 |
/**
|
1338 |
* Whether Jetpack's version maps to a public release, or a development version.
|
1339 |
*/
|
1349 |
if ( ! $user_id ) {
|
1350 |
return false;
|
1351 |
}
|
1352 |
+
|
1353 |
return (bool) Jetpack_Data::get_access_token( $user_id );
|
1354 |
}
|
1355 |
|
1421 |
* Synchronize connected user role changes
|
1422 |
*/
|
1423 |
function user_role_change( $user_id ) {
|
1424 |
+
_deprecated_function( __METHOD__, 'jetpack-4.2', 'Jetpack_Sync_Users::user_role_change()' );
|
1425 |
+
Jetpack_Sync_Users::user_role_change( $user_id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1426 |
}
|
1427 |
|
1428 |
/**
|
1488 |
|
1489 |
if ( ! @include( Jetpack::get_module_path( $module ) ) ) {
|
1490 |
unset( $modules[ $index ] );
|
1491 |
+
self::update_active_modules( array_values( $modules ) );
|
1492 |
continue;
|
1493 |
}
|
1494 |
|
1569 |
if ( ! function_exists( 'get_plugins' ) ) {
|
1570 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
1571 |
}
|
1572 |
+
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
|
1573 |
+
$all_plugins = apply_filters( 'all_plugins', get_plugins() );
|
1574 |
$active_plugins = Jetpack::get_active_plugins();
|
1575 |
|
1576 |
$plugins = array();
|
1696 |
}
|
1697 |
}
|
1698 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1699 |
/**
|
1700 |
* Allows plugins to submit security reports.
|
1701 |
*
|
1704 |
* @param array $args See definitions above
|
1705 |
*/
|
1706 |
public static function submit_security_report( $type = '', $plugin_file = '', $args = array() ) {
|
1707 |
+
_deprecated_function( __FUNCTION__, 'jetpack-4.2', null );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1708 |
}
|
1709 |
|
|
|
1710 |
/* Jetpack Options API */
|
1711 |
|
1712 |
public static function get_option_names( $type = 'compact' ) {
|
2182 |
public static function get_file_data( $file, $headers ) {
|
2183 |
//Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated
|
2184 |
$file_name = basename( $file );
|
2185 |
+
$file_data = Jetpack_Options::get_option( 'file_data', array() );
|
|
|
|
|
2186 |
|
2187 |
+
if ( ! array_key_exists( $file_name, $file_data ) ) {
|
2188 |
+
$file_data[ $file_name ] = get_file_data( $file, $headers );
|
2189 |
+
Jetpack_Options::update_option( 'file_data', $file_data );
|
2190 |
}
|
2191 |
|
2192 |
+
return $file_data[ $file_name ];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2193 |
}
|
2194 |
|
2195 |
/**
|
2351 |
foreach ( $modules as $module ) {
|
2352 |
if ( did_action( "jetpack_module_loaded_$module" ) ) {
|
2353 |
$active[] = $module;
|
2354 |
+
self::update_active_modules( $active );
|
2355 |
continue;
|
2356 |
}
|
2357 |
|
2383 |
Jetpack::state( 'module', $module );
|
2384 |
ob_start();
|
2385 |
require $file;
|
2386 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2387 |
$active[] = $module;
|
2388 |
$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
|
2389 |
if ( $active_state = Jetpack::state( $state ) ) {
|
2393 |
}
|
2394 |
$active_state[] = $module;
|
2395 |
Jetpack::state( $state, implode( ',', $active_state ) );
|
2396 |
+
Jetpack::update_active_modules( $active );
|
2397 |
+
|
2398 |
ob_end_clean();
|
2399 |
}
|
2400 |
Jetpack::state( 'error', false );
|
2469 |
Jetpack::catch_errors( true );
|
2470 |
ob_start();
|
2471 |
require Jetpack::get_module_path( $module );
|
2472 |
+
|
|
|
2473 |
$active[] = $module;
|
2474 |
+
Jetpack::update_active_modules( $active );
|
2475 |
+
|
2476 |
Jetpack::state( 'error', false ); // the override
|
2477 |
Jetpack::state( 'message', 'module_activated' );
|
2478 |
Jetpack::state( 'module', $module );
|
2499 |
}
|
2500 |
|
2501 |
function activate_module_actions( $module ) {
|
2502 |
+
_deprecated_function( __METHOD__, 'jeptack-4.2' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2503 |
}
|
2504 |
|
2505 |
public static function deactivate_module( $module ) {
|
2517 |
$active = Jetpack::get_active_modules();
|
2518 |
$new = array_filter( array_diff( $active, (array) $module ) );
|
2519 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2520 |
// A flag for Jump Start so it's not shown again.
|
2521 |
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
2522 |
Jetpack_Options::update_option( 'jumpstart', 'jetpack_action_taken' );
|
2527 |
$jetpack->do_stats( 'server_side' );
|
2528 |
}
|
2529 |
|
2530 |
+
return self::update_active_modules( $new );
|
2531 |
}
|
2532 |
|
2533 |
public static function enable_module_configurable( $module ) {
|
2716 |
|
2717 |
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
2718 |
|
2719 |
+
// Delete all the sync related data. Since it could be taking up space.
|
2720 |
+
require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-sender.php';
|
2721 |
+
Jetpack_Sync_Sender::get_instance()->uninstall();
|
2722 |
+
|
2723 |
// Disable the Heartbeat cron
|
2724 |
Jetpack_Heartbeat::init()->deactivate();
|
2725 |
}
|
2920 |
// If the plugin is not connected, display a connect message.
|
2921 |
if (
|
2922 |
// the plugin was auto-activated and needs its candy
|
2923 |
+
Jetpack_Options::get_option_and_ensure_autoload( 'do_activate', '0' )
|
2924 |
||
|
2925 |
// the plugin is active, but was never activated. Probably came from a site-wide network activation
|
2926 |
! Jetpack_Options::get_option( 'activated' )
|
2965 |
if ( Jetpack::is_active() || Jetpack::is_development_mode() ) {
|
2966 |
// Artificially throw errors in certain whitelisted cases during plugin activation
|
2967 |
add_action( 'activate_plugin', array( $this, 'throw_error_on_activate_plugin' ) );
|
|
|
|
|
|
|
2968 |
}
|
2969 |
|
2970 |
// Jetpack Manage Activation Screen from .com
|
4166 |
return $url;
|
4167 |
}
|
4168 |
|
4169 |
+
static function translate_current_user_to_role() {
|
4170 |
+
foreach ( self::$capability_translations as $role => $cap ) {
|
4171 |
if ( current_user_can( $role ) || current_user_can( $cap ) ) {
|
4172 |
return $role;
|
4173 |
}
|
4176 |
return false;
|
4177 |
}
|
4178 |
|
4179 |
+
static function translate_role_to_cap( $role ) {
|
4180 |
+
if ( ! isset( self::$capability_translations[$role] ) ) {
|
4181 |
return false;
|
4182 |
}
|
4183 |
|
4184 |
+
return self::$capability_translations[$role];
|
4185 |
}
|
4186 |
|
4187 |
+
static function sign_role( $role ) {
|
4188 |
if ( ! $user_id = (int) get_current_user_id() ) {
|
4189 |
return false;
|
4190 |
}
|
4222 |
$gp_locale = GP_Locales::by_field( 'wp_locale', get_locale() );
|
4223 |
}
|
4224 |
|
4225 |
+
$role = self::translate_current_user_to_role();
|
4226 |
+
$signed_role = self::sign_role( $role );
|
4227 |
|
4228 |
$user = wp_get_current_user();
|
4229 |
|
4235 |
|
4236 |
$secrets = Jetpack::init()->generate_secrets( 'authorize' );
|
4237 |
@list( $secret ) = explode( ':', $secrets );
|
4238 |
+
|
4239 |
$site_icon = ( function_exists( 'has_site_icon') && has_site_icon() )
|
4240 |
? get_site_icon_url()
|
4241 |
: false;
|
4500 |
return ( $a['sort'] < $b['sort'] ) ? -1 : 1;
|
4501 |
}
|
4502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4503 |
function ajax_recheck_ssl() {
|
4504 |
check_ajax_referer( 'recheck-ssl', 'ajax-nonce' );
|
4505 |
$result = Jetpack::permit_ssl( true );
|
4609 |
<span id="jetpack-recheck-ssl-output"><?php echo get_transient( 'jetpack_https_test_message' ); ?></span>
|
4610 |
</p>
|
4611 |
<p>
|
4612 |
+
<?php printf( __( 'For more help, try our <a href="%1$s">connection debugger</a> or <a href="%2$s" target="_blank">troubleshooting tips</a>.', 'jetpack' ),
|
4613 |
esc_url( Jetpack::admin_url( array( 'page' => 'jetpack-debugger' ) ) ),
|
4614 |
esc_url( 'https://jetpack.com/support/getting-started-with-jetpack/troubleshooting-tips/' ) ); ?>
|
4615 |
</p>
|
4837 |
list( $version ) = explode( ':', Jetpack_Options::get_option( 'version' ) );
|
4838 |
if ( JETPACK__VERSION != $version ) {
|
4839 |
Jetpack_Options::update_option( 'version', JETPACK__VERSION . ':' . time() );
|
4840 |
+
|
4841 |
+
if ( version_compare( JETPACK__VERSION, $version, '>' ) ) {
|
4842 |
+
/** This action is documented in class.jetpack.php */
|
4843 |
+
do_action( 'updating_jetpack_version', JETPACK__VERSION, $version );
|
4844 |
+
}
|
4845 |
+
|
4846 |
return true;
|
4847 |
}
|
4848 |
return false;
|
5641 |
|
5642 |
if ( is_array( $identity_options ) ) {
|
5643 |
foreach( $identity_options as $identity_option ) {
|
|
|
|
|
5644 |
/**
|
5645 |
* Fires when a shadow site option is updated.
|
5646 |
* These options are updated via the Identity Crisis UI.
|
5760 |
* Written so that we don't have re-check $key and $value params every time
|
5761 |
* we want to check if this site is whitelisted, for example in footer.php
|
5762 |
*
|
5763 |
+
* @return bool True = already whitelisted False = not whitelisted
|
5764 |
*/
|
5765 |
public static function is_staging_site() {
|
5766 |
$is_staging = false;
|
5767 |
|
5768 |
$current_whitelist = Jetpack_Options::get_option( 'identity_crisis_whitelist' );
|
5769 |
+
if ( $current_whitelist && ! get_transient( 'jetpack_checked_is_staging' ) ) {
|
5770 |
$options_to_check = Jetpack::identity_crisis_options_to_check();
|
5771 |
$cloud_options = Jetpack::init()->get_cloud_site_options( $options_to_check );
|
5772 |
|
5776 |
break;
|
5777 |
}
|
5778 |
}
|
5779 |
+
// set a flag so we don't check again for an hour
|
5780 |
+
set_transient( 'jetpack_checked_is_staging', 1, HOUR_IN_SECONDS );
|
5781 |
}
|
5782 |
$known_staging = array(
|
5783 |
'urls' => array(
|
5784 |
+
'#\.staging\.wpengine\.com$#i', // WP Engine
|
5785 |
),
|
5786 |
'constants' => array(
|
5787 |
+
'IS_WPE_SNAPSHOT', // WP Engine
|
5788 |
+
'KINSTA_DEV_ENV', // Kinsta.com
|
5789 |
+
'WPSTAGECOACH_STAGING', // WP Stagecoach
|
5790 |
+
'JETPACK_STAGING_MODE', // Generic
|
5791 |
)
|
5792 |
);
|
5793 |
/**
|
6028 |
return false;
|
6029 |
}
|
6030 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6031 |
/**
|
6032 |
* Throws warnings for deprecated hooks to be removed from Jetpack
|
6033 |
*/
|
6041 |
* If there is no replacement us null for replacement_name
|
6042 |
*/
|
6043 |
$deprecated_list = array(
|
6044 |
+
'jetpack_bail_on_shortcode' => 'jetpack_shortcodes_to_include',
|
6045 |
+
'wpl_sharing_2014_1' => null,
|
6046 |
+
'jetpack-tools-to-include' => 'jetpack_tools_to_include',
|
6047 |
+
'jetpack_identity_crisis_options_to_check' => null,
|
6048 |
+
'update_option_jetpack_single_user_site' => null,
|
6049 |
+
'audio_player_default_colors' => null,
|
6050 |
+
'add_option_jetpack_featured_images_enabled' => null,
|
6051 |
+
'add_option_jetpack_update_details' => null,
|
6052 |
+
'add_option_jetpack_updates' => null,
|
6053 |
+
'add_option_jetpack_network_name' => null,
|
6054 |
+
'add_option_jetpack_network_allow_new_registrations' => null,
|
6055 |
+
'add_option_jetpack_network_add_new_users' => null,
|
6056 |
+
'add_option_jetpack_network_site_upload_space' => null,
|
6057 |
+
'add_option_jetpack_network_upload_file_types' => null,
|
6058 |
+
'add_option_jetpack_network_enable_administration_menus' => null,
|
6059 |
+
'add_option_jetpack_is_multi_site' => null,
|
6060 |
+
'add_option_jetpack_is_main_network' => null,
|
6061 |
+
'add_option_jetpack_main_network_site' => null,
|
6062 |
+
'jetpack_sync_all_registered_options' => null,
|
6063 |
);
|
6064 |
|
6065 |
// This is a silly loop depth. Better way?
|
6153 |
}
|
6154 |
|
6155 |
/**
|
6156 |
+
* This methods removes all of the registered css files on the front end
|
6157 |
* from Jetpack in favor of using a single file. In effect "imploding"
|
6158 |
* all the files into one file.
|
6159 |
*
|
6665 |
*/
|
6666 |
function jetpack_user_col_style() {
|
6667 |
global $current_screen;
|
6668 |
+
if ( ! empty( $current_screen->base ) && 'users' == $current_screen->base ) { ?>
|
6669 |
<style>
|
6670 |
.fixed .column-user_jetpack {
|
6671 |
width: 21px;
|
css/jetpack-admin.css.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["../scss/_utilities/_grid.scss","jetpack-admin.css","../scss/_utilities/mixins/_breakpoint.scss","../scss/atoms/typography/_typography.scss","../scss/atoms/_media.scss","../scss/atoms/_animations.scss","../scss/pages/_protect.scss"],"names":[],"mappings":"AAKA;;;GCFE;ADKD;EAEC,aAAA;EACA,gBAAA;ECJD;ADOA;EACC,cAAA;ECLA,gBAAA;EACD;ADQD;EACC,aAAA;ECNA;;AAED;EACE,iBAAA;EACA,aAAA;EDSF,aAAA;EACC,oBAAA;ECPA;;AAED;EDMC;IAAU,iBAAA;ICHR;;EDIF;IAAU,kBAAA;ICAR;;EDCF;IAAU,YAAA;ICGR;;EDFF;IAAU,kBAAA;ICMR;;EDLF;IAAU,kBAAA;ICSR;;EDRF;IAAU,YAAA;ICYR;;EDXF;IAAU,kBAAA;ICeR;;EDdF;IAAU,kBAAA;ICkBR;;EDjBF;IAAU,YAAA;ICqBR;;EDpBF;IAAU,kBAAA;ICwBR;;EDvBF;IAAU,kBA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cAAA;EAocD;AACD;EAtJC,aAAA;EACD,cAAA;EAwJC;;AAED;EAjOA,WAAA;EAuJA;;AA8EA;EAtJC;IACD,gBAAA;IA3SE;EAwXD;IACD,oBAAA;IA1EA;;EA6EE;IACA,YAAA;IACD,oBAAA;IA1ED;EA1EC;IAuJA,aAAA;IA1ED;EArJA;IAkOC,kBAAA;IA6EE;EA3EH;IA1EC,YAAA;IACD;EAwJE;IA3EF,YAAA;IA1EA,aAAA;IA1EA,kCAAA;IA4EC,iCAAA;IACD;EA4EC;IA6EG,aAAY;IA3EhB,aAAA;IArJA,aAAA;IAuJC,cAAA;IA6EG,+BAA8B;IA3ElC,oBAAA;IA6EI,WAAU;IA7gBd;;EAghBE;IAtJF,cAAA;IA1EC;EAmOA;AA3ED;EA1EA;IA4EC,aAAA;IA6EG,YAAW;IA3Ef,oBAAA;IA1EA;EA4EC;IA6EG,aAAY;IA3EhB,aAAA;IA6EG;EACF;AACD;EACE;IAtJF,sBAAA;IA1EA;;EAoOE;IA3EF,8BAAA;IA1EA;EAwJC;AACD;EA3EA;IA3SA,mBAAA;IAAA;ECvpGG;IDs8GF,gBAAA;IACD;EA6EC;AACD;EA3EC;IA6EG,iBAAgB;IA3EpB;;EA1EA;IAyJI,gBAAe;IA3EnB;;EA8EE;IAvJA,kBAAA;IACD;;EA0JC;IACE,mBAAkB;IAlOrB,sBAAA;IAoOE;;EAED;IAvJA,UAAA;IAyJC;EACF;AACD;EACE,aAxJD;EAyJC,gBA5EC;EA6EF;AACD;EACE,aAxJD;EAyJA","file":"jetpack-admin.css"}
|
1 |
+
{"version":3,"sources":["../scss/_utilities/_grid.scss","jetpack-admin.css","../scss/_utilities/mixins/_breakpoint.scss","../scss/atoms/typography/_typography.scss","../scss/atoms/_media.scss","../scss/atoms/_animations.scss"],"names":[],"mappings":"AAKA;;;GCFE;ADKD;EAEC,aAAA;EACA,gBAAA;ECJD;ADOA;EACC,cAAA;ECLA,gBAAA;EACD;ADQD;EACC,aAAA;ECNA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ACE,aAxJD;EAyJC,gBA5EC;EA6EF;AACD;EACE,aAnOF;EAoOC","file":"jetpack-admin.css"}
|
css/jetpack-rtl.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/*!
|
2 |
* Do not modify this file directly. It is concatenated from individual module CSS files.
|
3 |
*/
|
4 |
-
.jp-carousel-wrap *{line-height:inherit}.jp-carousel-overlay{background:#000}div.jp-carousel-fadeaway{position:fixed;bottom:0;z-index:2147483647;width:100%;height:15px}.jp-carousel-next-button span,.jp-carousel-previous-button span{background:url(../modules/carousel/images/arrows.png) center center/200px 126px no-repeat}.jp-carousel-msg{font-family:"Open Sans",sans-serif;font-style:normal;display:inline-block;line-height:19px;padding:11px 15px;font-size:14px;text-align:center;margin:25px 2px 0 20px;background-color:#fff;border-right:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.jp-carousel-next-button span,.jp-carousel-previous-button span{background-image:url(../modules/carousel/images/arrows-2x.png)}}.jp-carousel-wrap{font-family:"Helvetica Neue",sans-serif!important}.jp-carousel-info{position:absolute;bottom:0;text-align:right!important;-webkit-font-smoothing:subpixel-antialiased!important}.jp-carousel-info ::selection{background:#68c9e8;color:#fff}.jp-carousel-info ::-moz-selection{background:#68c9e8;color:#fff}.jp-carousel-photo-info{position:relative;right:25%;width:50%}.jp-carousel-transitions .jp-carousel-photo-info{transition:400ms ease-out}.jp-carousel-info h2{background:none!important;border:none!important;color:#999;display:block!important;font:400 13px/1.25em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;margin:7px 0 0!important;padding:10px 0 0!important;overflow:hidden;text-align:right;text-shadow:none!important;text-transform:none!important;-webkit-font-smoothing:subpixel-antialiased}.jp-carousel-next-button,.jp-carousel-previous-button{text-indent:-9999px;overflow:hidden;cursor:pointer}.jp-carousel-next-button span,.jp-carousel-previous-button span{position:absolute;top:0;bottom:0;width:82px;zoom:1;filter:alpha(opacity=20);opacity:.2}.jp-carousel-transitions .jp-carousel-next-button span,.jp-carousel-transitions .jp-carousel-previous-button span{transition:500ms opacity ease-out}.jp-carousel-next-button:hover span,.jp-carousel-previous-button:hover span{filter:alpha(opacity=60);opacity:.6}.jp-carousel-next-button span{background-position:-110px center;left:0}.jp-carousel-previous-button span{background-position:-10px center;right:0}.jp-carousel-buttons{margin:-18px -20px 15px;padding:8px 10px;border-bottom:1px solid #222;background:#222;text-align:center}div.jp-carousel-buttons a{border:none!important;color:#999;font:400 11px/1.2em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;padding:5px 0 5px 2px;text-decoration:none!important;text-shadow:none!important;vertical-align:middle;-webkit-font-smoothing:subpixel-antialiased}div.jp-carousel-buttons a:hover{color:#68c9e8;border:none!important}.jp-carousel-transitions div.jp-carousel-buttons a:hover{transition:none!important}.jp-carousel-next-button,.jp-carousel-previous-button,.jp-carousel-slide,.jp-carousel-slide img{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.jp-carousel-slide{position:fixed;width:0;bottom:0;background-color:#000;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px}.jp-carousel-slide.selected{position:absolute!important;filter:alpha(opacity=100);opacity:1}.jp-carousel-slide{filter:alpha(opacity=25);opacity:.25}.jp-carousel-slide img{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;background:none!important;border:none!important;padding:0!important;box-shadow:0 2px 8px rgba(0,0,0,.1);zoom:1}.jp-carousel-transitions .jp-carousel-slide{transition:opacity 400ms linear}.jp-carousel-close-hint{color:#999;cursor:default;letter-spacing:0!important;padding:.35em 0 0;position:absolute;text-align:right;width:90%}.jp-carousel-transitions .jp-carousel-close-hint{transition:color 200ms linear}.jp-carousel-close-hint span{cursor:pointer;background-color:#000;background-color:rgba(0,0,0,.8);display:block;height:22px;font:400 24px/1 "Helvetica Neue",sans-serif!important;line-height:22px;margin:0 .4em 0 0;text-align:center;vertical-align:middle;width:22px;border-radius:4px}.jp-carousel-transitions .jp-carousel-close-hint span{transition:border-color 200ms linear}.jp-carousel-close-hint:hover{cursor:default;color:#fff}.jp-carousel-close-hint:hover span{border-color:#fff}a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background:url(../modules/carousel/images/carousel-sprite.png?5) 0 0/16px 200px no-repeat}div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{margin:0 0 0 14px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#303030;padding-left:8px!important;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;margin:0 -12px 0 2px!important}div.jp-carousel-buttons a.jp-carousel-reblog,div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{background-position:6px -36px;padding-left:auto!important;padding-right:26px!important;color:#999}div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -156px;padding-right:19px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{cursor:default}div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:6px -56px;color:#68c9e8}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background-image:url(../modules/carousel/images/carousel-sprite-2x.png?5)}}div#carousel-reblog-box{background:#222;padding:3px 0 0;display:none;margin:5px auto 0;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.9);height:74px;width:565px}#carousel-reblog-box textarea{background:#999;font:13px/1.4 "Helvetica Neue",sans-serif!important;color:#444;padding:3px 6px;width:370px;height:48px;float:right;margin:6px 9px 0;border:1px solid #666;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:2px}#carousel-reblog-box textarea:focus{background:#ccc;color:#222}#carousel-reblog-box label{color:#aaa;font-size:11px;padding-left:2px;padding-right:2px;display:inline;font-weight:400}#carousel-reblog-box select{width:110px;padding:0;font-size:12px;font-family:"Helvetica Neue",sans-serif!important;background:#333;color:#eee;border:1px solid #444;margin-top:5px}#carousel-reblog-box .submit,#wrapper #carousel-reblog-box p.response{float:right;width:154px;padding-top:0;padding-right:1px;overflow:hidden;height:34px;margin:3px 2px 0 0!important}#wrapper #carousel-reblog-box p.response{font-size:13px;clear:none;padding-right:2px;height:34px;color:#aaa}#carousel-reblog-box input#carousel-reblog-submit,#jp-carousel-comment-form-button-submit{font:13px/24px "Helvetica Neue",sans-serif!important;margin-top:8px;padding:0 10px!important;border-radius:1em;height:24px;color:#333;cursor:pointer;font-weight:400;background:#aaa;border:1px solid #444}#carousel-reblog-box input#carousel-reblog-submit:hover,#jp-carousel-comment-form-button-submit:hover{background:#ccc}#carousel-reblog-box .canceltext{color:#aaa;font-size:11px;line-height:24px}#carousel-reblog-box .canceltext a{color:#fff}.jp-carousel-titleanddesc{border-top:1px solid #222;color:#999;font-size:15px;padding-top:24px;margin-bottom:20px;font-weight:400}.jp-carousel-titleanddesc-title{font:300 1.5em/1.1 "Helvetica Neue",sans-serif!important;text-transform:none!important;color:#fff;margin:0 0 15px;padding:0}.jp-carousel-titleanddesc-desc p{color:#999;line-height:1.4;margin-bottom:.75em}.jp-carousel-comments p a,.jp-carousel-info h2 a,.jp-carousel-titleanddesc p a{color:#fff!important;border:none!important;text-decoration:underline!important;font-weight:400!important;font-style:normal!important}.jp-carousel-titleanddesc p b,.jp-carousel-titleanddesc p strong{font-weight:700;color:#999}.jp-carousel-titleanddesc p em,.jp-carousel-titleanddesc p i{font-style:italic;color:#999}.jp-carousel-comments p a:hover,.jp-carousel-info h2 a:hover,.jp-carousel-titleanddesc p a:hover{color:#68c9e8!important}.jp-carousel-titleanddesc p:empty{display:none}.jp-carousel-left-column-wrapper h1:after,.jp-carousel-left-column-wrapper h1:before,.jp-carousel-photo-info h1:after,.jp-carousel-photo-info h1:before{content:none!important}.jp-carousel-image-meta{background:#111;border:1px solid #222;color:#fff;font:12px/1.4 "Helvetica Neue",sans-serif!important;overflow:hidden;padding:18px 20px;width:209px!important}.jp-carousel-image-meta h5,.jp-carousel-image-meta li{font-family:"Helvetica Neue",sans-serif!important;position:inherit!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;background:none!important;border:none!important;font-weight:400!important;line-height:1.3em!important}.jp-carousel-image-meta ul{margin:0!important;padding:0!important;list-style:none!important}.jp-carousel-image-meta li{width:48%!important;float:right!important;margin:0 0 15px 2%!important;color:#fff!important;font-size:13px!important}.jp-carousel-image-meta h5{color:#999!important;text-transform:uppercase!important;font-size:10px!important;margin:0 0 2px!important;letter-spacing:.1em!important}a.jp-carousel-image-download{padding-right:23px;display:inline-block;clear:both;color:#999;line-height:1;font-weight:400;font-size:13px;text-decoration:none;background-position:0 -82px}a.jp-carousel-image-download span.photo-size{font-size:11px;border-radius:1em;margin-right:2px;display:inline-block}a.jp-carousel-image-download span.photo-size-times{padding:0 2px 0 1px}a.jp-carousel-image-download:hover{background-position:0 -122px;color:#68c9e8;border:none!important}.jp-carousel-image-map{position:relative;margin:-20px -20px 20px;border-bottom:1px solid rgba(255,255,255,.17);height:154px}.jp-carousel-image-map img.gmap-main{border-top-right-radius:6px;border-left:1px solid rgba(255,255,255,.17)}.jp-carousel-image-map div.gmap-topright{width:94px;height:154px;position:absolute;top:0;left:0}.jp-carousel-image-map div.imgclip{overflow:hidden;border-top-left-radius:6px}.jp-carousel-image-map div.gmap-topright img{margin-right:-40px}.jp-carousel-image-map img.gmap-bottomright{position:absolute;top:96px;left:0}.jp-carousel-comments{font:15px/1.7 "Helvetica Neue",sans-serif!important;font-weight:400;background:none}.jp-carousel-comments p a:active,.jp-carousel-comments p a:focus,.jp-carousel-comments p a:hover{color:#68c9e8!important}.jp-carousel-comment{background:none;color:#999;margin-bottom:20px;clear:right;overflow:auto;width:100%}.jp-carousel-comment p{color:#999!important}.jp-carousel-comment .comment-author{font-size:13px;font-weight:400;padding:0;width:auto;display:inline;float:none;border:none;margin:0}.jp-carousel-comment .comment-author a{color:#fff}.jp-carousel-comment .comment-gravatar{float:right}.jp-carousel-comment .comment-content{border:none;margin-right:85px;padding:0}.jp-carousel-comment .avatar{margin:0 0 0 20px;border-radius:4px;border:none!important;padding:0!important;background-color:transparent!important}.jp-carousel-comment .comment-date{color:#999;margin-top:4px;font-size:11px;display:inline;float:left}#jp-carousel-comment-form{margin:0 0 10px!important;float:right;width:100%}textarea#jp-carousel-comment-form-comment-field{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:15px/1.4 "Helvetica Neue",sans-serif!important;width:100%;padding:10px 10px 5px;margin:0;float:none;height:147px;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:3px;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box}textarea#jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#555}textarea#jp-carousel-comment-form-comment-field:focus{background:#ccc;color:#222}textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#aaa}#jp-carousel-comment-form-spinner{color:#fff;margin:22px 10px 0 0;display:block;width:20px;height:20px;float:right}#jp-carousel-comment-form-submit-and-info-wrapper{display:none;overflow:hidden;width:100%}#jp-carousel-comment-form-commenting-as input{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:13px/1.4 "Helvetica Neue",sans-serif!important;padding:3px 6px;float:right;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:2px;width:285px}#jp-carousel-comment-form-commenting-as input:focus{background:#ccc;color:#222}#jp-carousel-comment-form-commenting-as p{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:22px 0 0;float:right}#jp-carousel-comment-form-commenting-as fieldset{float:right;border:none;margin:20px 0 0;padding:0;clear:both}#jp-carousel-comment-form-commenting-as label{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:0 0 3px 20px;float:right;width:100px}#jp-carousel-comment-form-button-submit{margin-top:20px;float:left}#jp-carousel-comment-form-container,#js-carousel-comment-form-container{margin-bottom:15px;overflow:auto;width:100%}#jp-carousel-comment-post-results{display:none;overflow:auto;width:100%}#jp-carousel-comment-post-results span{display:block;text-align:center;margin-top:20px;width:100%;overflow:auto;padding:1em 0;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.7);border-radius:2px;font:13px/1.4 "Helvetica Neue",sans-serif!important;border:1px solid rgba(255,255,255,.17);box-shadow:inset 0 0 5px 5px rgba(0,0,0,1)}.jp-carousel-comment-post-error{color:#DF4926}#jp-carousel-comments-closed{display:none;color:#999}#jp-carousel-comments-loading{font:400 15px/1.7 "Helvetica Neue",sans-serif!important;display:none;color:#999;text-align:right;margin-bottom:20px}.jp-carousel-light .jp-carousel-overlay{background:#fff}.jp-carousel-light .jp-carousel-next-button:hover span,.jp-carousel-light .jp-carousel-previous-button:hover span{opacity:.8}.jp-carousel-light .jp-carousel-close-hint:hover,.jp-carousel-light .jp-carousel-titleanddesc div{color:#000!important}.jp-carousel-light .jp-carousel-comment .comment-author a,.jp-carousel-light .jp-carousel-comments p a,.jp-carousel-light .jp-carousel-info h2 a,.jp-carousel-light .jp-carousel-titleanddesc p a{color:#1e8cbe!important}.jp-carousel-light .jp-carousel-comment .comment-author a:hover,.jp-carousel-light .jp-carousel-comments p a:hover,.jp-carousel-light .jp-carousel-info h2 a:hover,.jp-carousel-light .jp-carousel-titleanddesc p a:hover{color:#f1831e!important}.jp-carousel-light .jp-carousel-comment,.jp-carousel-light .jp-carousel-comment p,.jp-carousel-light .jp-carousel-info h2,.jp-carousel-light .jp-carousel-titleanddesc,.jp-carousel-light .jp-carousel-titleanddesc p,.jp-carousel-light .jp-carousel-titleanddesc p b,.jp-carousel-light .jp-carousel-titleanddesc p em,.jp-carousel-light .jp-carousel-titleanddesc p i,.jp-carousel-light .jp-carousel-titleanddesc p strong,.jp-carousel-light div.jp-carousel-buttons a{color:#666}.jp-carousel-light .jp-carousel-buttons{border-bottom-color:#f0f0f0;background:#f5f5f5}.jp-carousel-light div.jp-carousel-buttons a:hover{text-decoration:none;color:#f1831e}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog,.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:4px -56px;padding-right:24px!important}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#2ea2cc;color:#fff}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -176px}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-position:5px -36px}.jp-carousel-light div#carousel-reblog-box{background:#eee;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd}.jp-carousel-light #carousel-reblog-box textarea{color:#666;border:1px solid #cfcfcf;background:#fff}.jp-carousel-light #carousel-reblog-box .canceltext{color:#888}.jp-carousel-light #carousel-reblog-box .canceltext a{color:#666}.jp-carousel-light #carousel-reblog-box select{background:#eee;color:#333;border:1px solid #aaa}#jp-carousel-comment-form-button-submit,.jp-carousel-light #carousel-reblog-box input#carousel-reblog-submit{color:#333;background:#fff;border:1px solid #aaa}.jp-carousel-light .jp-carousel-image-meta{background:#fafafa;border:1px solid #eee;border-top-color:#f5f5f5;border-right-color:#f5f5f5;color:#333}.jp-carousel-light .jp-carousel-image-meta li{color:#000!important}.jp-carousel-light .jp-carousel-close-hint{color:#ccc}.jp-carousel-light .jp-carousel-close-hint span{background-color:#fff;border-color:#ccc}.jp-carousel-light #jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#aaa}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus{color:#333}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#ddd}.jp-carousel-light a.jp-carousel-image-download{background-position:0 -122px}.jp-carousel-light a.jp-carousel-image-download:hover{background-position:0 -122px;color:#f1831e}.jp-carousel-light textarea#jp-carousel-comment-form-comment-field{background:#fbfbfb;color:#333;border:1px solid #dfdfdf;box-shadow:inset -2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input{background:#fbfbfb;border:1px solid #dfdfdf;color:#333;box-shadow:inset -2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input:focus{background:#fbfbfb;color:#333}.jp-carousel-light #jp-carousel-comment-post-results span{background:#f7f7f7;border:1px solid #dfdfdf;box-shadow:inset 0 0 5px rgba(0,0,0,.05)}.jp-carousel-light .jp-carousel-slide{background-color:#fff}.jp-carousel-light .jp-carousel-titleanddesc{border-top:1px solid #eee}@media only screen and (max-width:760px){.jp-carousel-info{margin:0 10px!important}.jp-carousel-buttons,.jp-carousel-next-button,.jp-carousel-previous-button{display:none!important}.jp-carousel-image-meta{float:none!important;width:100%!important;-moz-box-sizing:border-box;box-sizing:border-box}.jp-carousel-close-hint{font-weight:800!important;font-size:26px!important;position:fixed!important;top:-10px}.jp-carousel-slide img{filter:alpha(opacity=100);opacity:1}.jp-carousel-wrap{background-color:#000}.jp-carousel-fadeaway{display:none}#jp-carousel-comment-form-container{display:none!important}.jp-carousel-titleanddesc{padding-top:0!important;border:none!important}.jp-carousel-titleanddesc-title{font-size:1em!important}.jp-carousel-left-column-wrapper{padding:0;width:100%!important}.jp-carousel-photo-info{right:0!important;width:100%!important}}.contact-form .clear-form{clear:both}.contact-form input[type=email],.contact-form input[type=text]{width:300px;max-width:98%;margin-bottom:13px}.contact-form select{margin-bottom:13px}.contact-form textarea{height:200px;width:80%;float:none;margin-bottom:13px}.contact-form input[type=checkbox],.contact-form input[type=radio]{float:none;margin-bottom:13px}.contact-form label{margin-bottom:3px;float:none;font-weight:700;display:block}.contact-form label.checkbox,.contact-form label.radio{margin-bottom:3px;float:none;font-weight:700;display:inline-block}.contact-form label span{color:#AAA;margin-right:4px;font-weight:400}.contact-form-submission{margin-bottom:4em;padding:1.5em 1em}.contact-form-submission p{margin:0 auto}.form-errors .form-error-message{color:red}.textwidget .contact-form input[type=email],.textwidget .contact-form input[type=text],.textwidget .contact-form textarea{width:250px;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}#jetpack-check-feedback-spam{margin:1px 0 0 8px}.jetpack-check-feedback-spam-spinner{display:inline-block;margin-top:7px}.infinite-loader{color:#000;display:block;height:28px;text-indent:-9999px}#infinite-handle span{background:#333;border-radius:1px;color:#eee;cursor:pointer;font-size:13px;padding:6px 16px}#infinite-handle span button,#infinite-handle span button:focus,#infinite-handle span button:hover{display:inline;position:static;padding:0;margin:0;border:none;line-height:inherit;background:0 0;color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}#infinite-handle span button::-moz-focus-inner{margin:0;padding:0;border:none}@media (max-width:800px){#infinite-handle span:before{display:none}#infinite-handle span{display:block}}#infinite-footer{position:fixed;bottom:-50px;right:0;width:100%}#infinite-footer a{text-decoration:none}#infinite-footer .blog-credits a:hover,#infinite-footer .blog-info a:hover{color:#444;text-decoration:underline}#infinite-footer .container{background:rgba(255,255,255,.8);border-color:#ccc;border-color:rgba(0,0,0,.1);border-style:solid;border-width:1px 0 0;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 auto;overflow:hidden;padding:1px 20px;width:780px}#infinite-footer .blog-credits,#infinite-footer .blog-info{-moz-box-sizing:border-box;box-sizing:border-box;line-height:25px}#infinite-footer .blog-info{float:right;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap;width:40%}#infinite-footer .blog-credits{font-weight:400;float:left;width:60%}#infinite-footer .blog-info a{color:#111;font-size:14px;font-weight:700}#infinite-footer .blog-credits{color:#888;font-size:12px;text-align:left}#infinite-footer .blog-credits a{color:#666}.infinity-end.neverending #infinite-footer{display:none}@media (max-width:640px){#infinite-footer .container{-moz-box-sizing:border-box;box-sizing:border-box;width:100%}#infinite-footer .blog-info{width:30%}#infinite-footer .blog-credits{width:70%}#infinite-footer .blog-credits,#infinite-footer .blog-info a{font-size:10px}}@media (max-width:640px){#infinite-footer{position:static}}#wpadminbar li#wp-admin-bar-admin-bar-likes-widget{width:61px;overflow:hidden}#wpadminbar iframe.admin-bar-likes-widget{width:61px;height:28px;min-height:28px;border-width:0;position:absolute;top:0}div.jetpack-likes-widget-wrapper{width:100%;min-height:50px;position:relative}div.jetpack-likes-widget-wrapper .sd-link-color{font-size:12px}div.jetpack-likes-widget-wrapper.slim-likes-widget{width:1px;min-height:0}#likes-other-gravatars{display:none;position:absolute;padding:10px 10px 12px;background-color:#2e4453;border-width:0;box-shadow:0 0 10px #2e4453;box-shadow:0 0 10px rgba(46,68,83,.6);min-width:130px;z-index:1000}#likes-other-gravatars *{line-height:normal}#likes-other-gravatars .likes-text{color:#fff;font-size:12px;padding-bottom:8px}#likes-other-gravatars li,#likes-other-gravatars ul{margin:0;padding:0;text-indent:0;list-style-type:none}#likes-other-gravatars li::before{content:""}#likes-other-gravatars ul.wpl-avatars{overflow:auto;display:block;max-height:190px}#likes-other-gravatars ul.wpl-avatars li{width:32px;height:32px;float:right;margin:0 0 5px 5px}#likes-other-gravatars ul.wpl-avatars li a{margin:0 0 0 2px;border-bottom:none!important;display:block}#likes-other-gravatars ul.wpl-avatars li a img{background:0 0;border:none;margin:0!important;padding:0!important;position:static}div.sd-box{border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.13)}.comment-likes-widget,.entry-content .post-likes-widget,.post-likes-widget{margin:0;border-width:0;display:block}.post-likes-widget-placeholder{margin:0;border-width:0;position:relative}.post-likes-widget-placeholder .button{display:none}.post-likes-widget-placeholder .loading{color:#999;font-size:12px}.slim-likes-widget .post-likes-widget{width:auto;float:none}div.sharedaddy.sd-like-enabled .sd-like h3{display:none}div.sharedaddy.sd-like-enabled .sd-like .post-likes-widget{width:100%;float:none;position:absolute;top:0}.comment-likes-widget{width:100%}.pd-rating{display:block!important}.sd-gplus .sd-title{display:none}#jp-relatedposts{display:none;padding-top:1em;margin:1em 0;position:relative;clear:both}.jp-relatedposts:after{content:'';display:block;clear:both}#jp-relatedposts h3.jp-relatedposts-headline{margin:0 0 1em;display:inline-block;float:right;font-size:9pt;font-weight:700;font-family:inherit}#jp-relatedposts h3.jp-relatedposts-headline em:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.2);margin-bottom:1em}#jp-relatedposts h3.jp-relatedposts-headline em{font-style:normal;font-weight:700}#jp-relatedposts .jp-relatedposts-items{clear:right}#jp-relatedposts .jp-relatedposts-items-visual{margin-left:-20px}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{float:right;width:33%;margin:0 0 1em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post{padding-left:20px;filter:alpha(opacity=80);-moz-opacity:.8;opacity:.8}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4){clear:both}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover{filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items p,#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{font-size:14px;line-height:20px;margin:0}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs{position:relative}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay{position:absolute;top:0;bottom:0;right:0;left:0;display:block;border-bottom:0}#jp-relatedposts .jp-relatedposts-items p{margin-bottom:0}#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{text-transform:none;margin:0;font-family:inherit;display:block;max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a{font-size:inherit;font-weight:400;text-decoration:none;filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span{display:block;max-width:90%;overflow:hidden;text-overflow:ellipsis}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span{max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{opacity:.6}#jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt,.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{display:none}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt{overflow:hidden}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span{margin-bottom:1em}@media only screen and (max-width:640px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:50%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n){clear:right}#jp-relatedposts .jp-relatedposts-items-visual{margin-left:20px}}@media only screen and (max-width:320px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:100%;clear:both;margin:0 0 1em}}#jp-post-flair{padding-top:.5em}#content div.sharedaddy,#main div.sharedaddy,div.sharedaddy{clear:both}div.sharedaddy h3.sd-title{margin:0 0 1em;display:inline-block;line-height:1.2;font-size:9pt;font-weight:700}div.sharedaddy h3.sd-title:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;margin-bottom:1em}body.highlander-light h3.sd-title:before{border-top:1px solid rgba(0,0,0,.2)}body.highlander-dark h3.sd-title:before{border-top:1px solid rgba(255,255,255,.4)}.sd-content ul{padding:0!important;margin:0 0 .7em!important;list-style:none!important}.sd-content ul li{display:inline-block}.sd-block.sd-gplus{margin:0 0 .5em}.sd-gplus .sd-content{font-size:12px}#sharing_email .sharing_send,.sd-content ul li .option a.share-ustom,.sd-content ul li a.sd-button,.sd-content ul li.advanced a.share-more,.sd-content ul li.preview-item div.option.option-smart-off a,.sd-social-icon .sd-content ul li a.sd-button,.sd-social-icon-text .sd-content ul li a.sd-button,.sd-social-official .sd-content>ul>li .digg_button >a,.sd-social-official .sd-content>ul>li>a.sd-button,.sd-social-text .sd-content ul li a.sd-button{text-decoration:none!important;display:inline-block;margin:0 0 5px 5px;font-size:12px;font-family:"Open Sans",sans-serif;font-weight:400;border-radius:3px;color:#777!important;background:#f8f8f8;border:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.08);text-shadow:none;line-height:23px;padding:1px 5px 0 8px}.sd-content ul li .option a.share-ustom span,.sd-content ul li a.sd-button>span,.sd-content ul li.advanced a.share-more span,.sd-content ul li.preview-item div.option.option-smart-off a span,.sd-social-icon-text .sd-content ul li a.sd-button>span,.sd-social-official .sd-content>ul>li .digg_button >a span,.sd-social-official .sd-content>ul>li>a.sd-button span,.sd-social-text .sd-content ul li a.sd-button span{line-height:23px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button,.sd-social-official .sd-content>ul>li .digg_button>a,.sd-social-official .sd-content>ul>li>a.sd-button{line-height:17px;box-shadow:none;vertical-align:top}.sd-social-official .sd-content ul li a.sd-button>span{line-height:17px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a:before,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button:before,.sd-social-official .sd-content>ul>li .digg_button>a:before,.sd-social-official .sd-content>ul>li>a.sd-button:before{margin-bottom:-1px}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon .sd-content ul li a.sd-button:hover,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:hover,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li .digg_button>a:hover,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-official .sd-content>ul>li>a.sd-button:hover,.sd-social-text .sd-content ul li a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:hover{color:#555;background:#fafafa;border:1px solid #999}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:active{box-shadow:inset 0 1px 0 rgba(0,0,0,.16)}.sd-content ul li a.sd-button:before{display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:400 18px/1 social-logos;vertical-align:top;text-align:center}.sd-social-icon-text ul li a.sd-button:before{position:relative;top:2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-content ul li a.sd-button:before{position:relative;top:2px}}.sd-social-official ul li a.sd-button:before{position:relative;top:-2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-official ul li a.sd-button:before{top:0}}.sd-content ul li{margin:0!important;padding:0}.sd-content ul li.preview-item a.sd-button span,.sd-social-icon-text .sd-content ul li a span,.sd-social-official .sd-content ul li a.sd-button span{margin-right:3px}.sd-content ul li.preview-item.no-icon a.sd-button span{margin-right:0}.sd-content ul li.no-icon a:before,.sd-social-text .sd-content ul li a:before{display:none}body .sd-content ul li.share-custom.no-icon a span,body .sd-social-text .sd-content ul li.share-custom a span{background-image:none;background-position:-500px -500px!important;background-repeat:no-repeat!important;padding-right:0;height:0;line-height:inherit}.sd-social-icon .sd-content ul li a.share-more{position:relative;top:-4px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-icon .sd-content ul li a.share-more{top:2px}}@-moz-document url-prefix(){.sd-social-icon .sd-content ul li a.share-more{top:2px}}.sd-social-icon .sd-content ul li a.share-more span{margin-right:3px}.sd-content ul li.share-print div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-print a:before,.sd-social-icon-text .sd-content li.share-print a:before,.sd-social-official .sd-content li.share-print a:before,.sd-social-text .sd-content ul li.share-print a:before{content:'\f469'}.sd-content ul li.share-email div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-email a:before,.sd-social-icon-text .sd-content li.share-email a:before,.sd-social-official .sd-content li.share-email a:before,.sd-social-text .sd-content ul li.share-email a:before{content:'\f410'}.sd-content ul li.share-linkedin div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-linkedin a:before,.sd-social-icon-text .sd-content li.share-linkedin a:before,.sd-social-text .sd-content ul li.share-linkedin a:before{content:'\f207'}.sd-content ul li.share-twitter div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-twitter a:before,.sd-social-icon-text .sd-content li.share-twitter a:before,.sd-social-text .sd-content ul li.share-twitter a:before{content:'\f202'}.sd-content ul li.share-reddit div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-reddit a:before,.sd-social-icon-text .sd-content li.share-reddit a:before,.sd-social-text .sd-content ul li.share-reddit a:before{content:'\f222'}.sd-content ul li.share-tumblr div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-tumblr a:before,.sd-social-icon-text .sd-content li.share-tumblr a:before,.sd-social-text .sd-content ul li.share-tumblr a:before{content:'\f607'}.sd-content ul li.share-pocket div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pocket a:before,.sd-social-icon-text .sd-content li.share-pocket a:before,.sd-social-text .sd-content ul li.share-pocket a:before{content:'\f224'}.sd-content ul li.share-pinterest div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pinterest a:before,.sd-social-icon-text .sd-content li.share-pinterest a:before,.sd-social-text .sd-content ul li.share-pinterest a:before{content:'\f210'}.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-google-plus-1 a:before,.sd-social-icon-text .sd-content li.share-google-plus-1 a:before,.sd-social-text .sd-content ul li.share-google-plus-1 a:before{content:'\f218'}.sd-content ul li.share-facebook div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-facebook a:before,.sd-social-icon-text .sd-content li.share-facebook a:before,.sd-social-text .sd-content ul li.share-facebook a:before{content:'\f203'}.sd-content ul li.share-press-this div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-press-this a:before,.sd-social-icon-text .sd-content li.share-press-this a:before,.sd-social-official .sd-content li.share-press-this a:before,.sd-social-text .sd-content ul li.share-press-this a:before{content:'\f205'}.sd-social-official .sd-content li.share-press-this a:before{color:#2ba1cb}.sd-content ul li.share-telegram div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-telegram a:before,.sd-social-icon-text .sd-content li.share-telegram a:before,.sd-social-official .sd-content li.share-telegram a:before,.sd-social-text .sd-content ul li.share-telegram a:before{content:'\f606'}.sd-social-official .sd-content li.share-telegram a:before{color:#08c}.sd-content ul li.share-skype div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-skype a:before,.sd-social-icon-text .sd-content li.share-skype a:before,.sd-social-text .sd-content ul li.share-skype a:before{content:'\f220'}.sd-content ul li.advanced a.share-more:before,.sd-social-icon .sd-content ul a.share-more:before,.sd-social-icon-text .sd-content a.share-more:before,.sd-social-official .sd-content a.share-more:before,.sd-social-text .sd-content ul a.share-more:before{content:'\f415'}.sd-social-official .sd-content a.share-more:before{color:#2ba1cb}.sd-content ul li.share-jetpack-whatsapp div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-jetpack-whatsapp a:before,.sd-social-icon-text .sd-content li.share-jetpack-whatsapp a:before,.sd-social-official .sd-content li.share-jetpack-whatsapp a:before,.sd-social-text .sd-content ul li.share-jetpack-whatsapp a:before{content:'\f608'}.sd-social-official .sd-content li.share-jetpack-whatsapp a:before{color:#43d854}.sd-social-icon .sd-content ul li[class*=share-].share-jetpack-whatsapp a.sd-button{background:#43d854;color:#fff!important}.sd-social .sd-button .share-count{background:#2ea2cc;color:#fff;border-radius:10px;display:inline-block;text-align:center;font-size:10px;padding:1px 3px;line-height:1}.sd-social-official .sd-content ul,.sd-social-official .sd-content ul li{line-height:25px!important}.sd-social-official .sd-content>ul>li>a.sd-button span{line-height:1}.sd-social-official .sd-content ul:after{content:".";display:block;height:0;clear:both;visibility:hidden}.sd-social-official .sd-content li.share-press-this a{margin:0 0 5px}.sd-social-official .sd-content ul>li{display:block;float:right;margin:0 0 5px 10px!important;height:25px}.sd-social-official .fb-share-button>span{vertical-align:top!important}.sd-social-official .sd-content .pocket_button iframe{width:98px}.googleplus1_button .g-plus{vertical-align:top!important}.reddit_button iframe{margin-top:1px}.googleplus1_button iframe,.linkedin_button>span,.pinterest_button,.pocket_button iframe,.twitter_button{margin:0!important}.sd-social-official .sd-content .share-skype{width:55px}body .sd-social-official li a.share-more,body .sd-social-official li.share-custom a,body .sd-social-official li.share-digg a,body .sd-social-official li.share-email a,body .sd-social-official li.share-press-this a,body .sd-social-official li.share-print{position:relative;top:0}body .sd-social-icon .sd-content li.share-custom>a{padding:2px 3px 0;position:relative;top:4px}body .sd-content ul li.share-custom a.share-icon span,body .sd-social-icon .sd-content li.share-custom a span,body .sd-social-icon-text .sd-content li.share-custom a span,body .sd-social-official .sd-content li.share-custom a span,body .sd-social-text .sd-content li.share-custom a span{background-size:16px 16px;background-repeat:no-repeat;margin-right:0;padding:0 19px 0 0;display:inline-block;height:16px;line-height:16px}body .sd-social-icon .sd-content li.share-custom a span{width:0;padding-right:16px!important}.sharing-hidden .inner{position:absolute;z-index:2;border:1px solid #ccc;padding:10px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);border-radius:2px;margin-top:5px;max-width:400px}.sharing-hidden .inner ul{margin:0!important}.sd-social-official .sd-content .sharing-hidden ul>li.share-end{clear:both;margin:0!important;height:0!important}.sharing-hidden .inner:after,.sharing-hidden .inner:before{position:absolute;z-index:1;top:-8px;right:20px;width:0;height:0;border-right:6px solid transparent;border-left:6px solid transparent;border-bottom:8px solid #ccc;content:"";display:block}.sharing-hidden .inner:after{z-index:2;top:-7px;border-right:6px solid transparent;border-left:6px solid transparent;border-bottom:8px solid #fff}.sharing-hidden ul{margin:0}.sd-social-icon .sd-content ul li[class*=share-] a,.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a{border-radius:50%;-webkit-border-radius:50%;border:0;box-shadow:none;padding:7px;position:relative;top:-2px;line-height:1;width:auto;height:auto;margin-bottom:0}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button>span,.sd-social-icon .sd-content ul li[class*=share-] div.option a span{line-height:1}.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a:hover{border:none;opacity:.6}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button:before{top:1px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button.share-custom{padding:8px 8px 6px;top:5px}.sd-social-icon .sd-content ul li a.sd-button.share-more{margin-right:10px}.sd-social-icon .sd-content ul li:first-child a.sd-button.share-more{margin-right:0}.sd-social-icon .sd-button span.share-count{position:absolute;bottom:0;left:0;border-radius:0;background:#555;font-size:9px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button{background:#e9e9e9;margin-top:2px;text-indent:0}.sd-social-icon .sd-content ul li[class*=share-].share-tumblr a.sd-button{background:#2c4762;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-facebook a.sd-button{background:#3b5998;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-twitter a.sd-button{background:#00acee;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pinterest a.sd-button{background:#ca1f27;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-digg a.sd-button{color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-press-this a.sd-button{background:#1e8cbe;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-telegram a.sd-button{background:#08c;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-linkedin a.sd-button{background:#0077b5;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-google-plus-1 a.sd-button{background:#dd4b39;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pocket a.sd-button{background:#ee4056;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-reddit a.sd-button{background:#cee3f8;color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-skype a.sd-button{background:#00AFF0;color:#fff!important}.sharing-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.sharing-screen-reader-text:active,.sharing-screen-reader-text:focus,.sharing-screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#sharing_email{width:342px;position:absolute;z-index:1001;border:1px solid #ccc;padding:15px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);text-align:right}div.sharedaddy.sharedaddy-dark #sharing_email{border-color:#fff}#sharing_email .errors{color:#fff;background-color:#771a09;font-size:12px;padding:5px 8px;line-height:1;margin:10px 0 0}#sharing_email label{font-size:12px;color:#333;font-weight:700;display:block;padding:0 0 4px;text-align:right;text-shadow:none}#sharing_email form{margin:0}#sharing_email input[type=email],#sharing_email input[type=text]{width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #ccc;margin-bottom:1em;background:#fff;font-size:12px;color:#333;max-width:none;padding:1px 3px}#jetpack-source_f_name{display:none!important;position:absolute!important;right:-9000px}#sharing_email .sharing_cancel{padding:0 1em 0 0;font-size:12px;text-shadow:none}#sharing_email .recaptcha{width:312px;height:123px;margin:0 0 1em}.slideshow-window{background-color:#222;border:20px solid #222;border-radius:10px;height:0;margin-bottom:20px;overflow:hidden;padding-top:30px!important;padding-bottom:56.25%!important;position:relative;z-index:1}.slideshow-window.slideshow-white{background-color:#fff;border-color:#fff}.slideshow-window,.slideshow-window *{-moz-box-sizing:content-box;box-sizing:content-box}.slideshow-loading{height:100%;text-align:center;margin:auto}body div.slideshow-window * img{background-color:transparent!important;background-image:none!important;border-width:0!important;display:block;margin:0 auto;max-width:100%;max-height:100%;padding:0!important;position:relative;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%}.slideshow-loading img{vertical-align:middle}.slideshow-slide{display:none;height:100%!important;right:0;margin:auto;position:absolute;text-align:center;top:0;width:100%!important}.slideshow-slide img{vertical-align:middle}.slideshow-line-height-hack{overflow:hidden;width:0;font-size:0}.slideshow-slide-caption{font-size:13px;font-family:"Helvetica Neue",sans-serif;color:#f7f7f7;text-shadow:#222 -1px 1px 2px;line-height:25px;height:25px;position:absolute;bottom:5px;right:0;z-index:100;width:100%;text-align:center}.slideshow-controls{z-index:1000;position:absolute;bottom:30px;margin:auto;text-align:center;width:100%;-ms-filter:"alpha(Opacity=50)";opacity:.5;direction:rtl;transition:300ms opacity ease-out}.slideshow-window:hover .slideshow-controls{-ms-filter:"alpha(Opacity=100)";opacity:1}body div div.slideshow-controls a,body div div.slideshow-controls a:hover{border:2px solid rgba(255,255,255,.1)!important;background-color:#000!important;background-color:rgba(0,0,0,.6)!important;background-image:url(../modules/shortcodes/img/slideshow-controls.png)!important;background-repeat:no-repeat;background-size:142px 16px!important;background-position:-34px 8px!important;color:#222!important;margin:0 5px!important;padding:0!important;display:inline-block!important;zoom:1;height:32px!important;width:32px!important;line-height:32px!important;text-align:center!important;-khtml-border-radius:10em!important;border-radius:10em!important;transition:300ms border-color ease-out}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body div div.slideshow-controls a,body div div.slideshow-controls a:hover{background-image:url(../modules/shortcodes/img/slideshow-controls-2x.png)!important}}body div div.slideshow-controls a:hover{border-color:rgba(255,255,255,1)!important}body div div.slideshow-controls a:first-child{background-position:-76px 8px!important}body div div.slideshow-controls a:last-child{background-position:-117px 8px!important}body div div.slideshow-controls a.running,body div div.slideshow-controls a:nth-child(2){background-position:-34px 8px!important}body div div.slideshow-controls a.paused{background-position:9px 8px!important}.slideshow-controls a img{border:50px dotted #f0f}body.presentation-wrapper-fullscreen-parent,html.presentation-wrapper-fullscreen-parent{overflow:hidden!important}.presentation-wrapper-fullscreen-parent #wpadminbar{display:none}.presentation-wrapper-fullscreen,.presentation-wrapper-fullscreen-parent{min-width:100%!important;min-height:100%!important;position:absolute!important;top:0!important;left:0!important;bottom:0!important;right:0!important;margin:0!important;padding:0!important;z-index:10000!important}.presentation-wrapper-fullscreen{background-color:gray;border:none!important}.presentation-wrapper-fullscreen .nav-arrow-left,.presentation-wrapper-fullscreen .nav-arrow-right{z-index:20001}.presentation-wrapper-fullscreen .nav-fullscreen-button{z-index:20002}.presentation-wrapper{margin:20px auto;border:1px solid #e5e5e5;overflow:hidden;line-height:normal}.presentation{position:relative;margin:0;overflow:hidden;outline:0}.presentation,.presentation .step{background-repeat:no-repeat;background-position:center;background-size:100% 100%}.presentation .step.fade:not(.active){opacity:0}.presentation .slide-content{padding:30px}.presentation .nav-arrow-left,.presentation .nav-arrow-right,.presentation .nav-fullscreen-button{position:absolute;width:34px;background-repeat:no-repeat;z-index:2;opacity:0;transition:opacity .25s}.presentation .nav-arrow-left,.presentation .nav-arrow-right{height:100%;background-image:url(../modules/shortcodes/images/slide-nav.png);background-size:450% 61px}.presentation .nav-arrow-left{right:0;background-position:4px 50%}.presentation .nav-arrow-right{left:0;background-position:-120px 50%}.presentation .nav-fullscreen-button{width:32px;height:32px;margin:4px;bottom:0;left:0;z-index:3;background-image:url(../modules/shortcodes/images/expand.png);background-size:100% 100%}.presentation:hover .nav-arrow-left,.presentation:hover .nav-arrow-right{opacity:1}.presentation:hover .nav-fullscreen-button{opacity:.8}.presentation-wrapper-fullscreen .nav-fullscreen-button{background-image:url(../modules/shortcodes/images/collapse.png)}.presentation .autoplay-overlay{height:15%;width:80%;margin:30% 10%;position:relative;z-index:100;display:table;border-radius:50px;background-color:#e5e5e5;background-color:rgba(0,0,0,.75);transition:opacity .5s}.presentation .autoplay-overlay .overlay-msg{position:relative;display:table-cell;text-align:center;vertical-align:middle;color:#fff}.presentation .will-fade{opacity:0}.presentation .do-fade{opacity:1;transition:opacity .5s}#subscribe-email input{width:95%}.comment-subscription-form .subscribe-label{display:inline!important}.jetpack-video-wrapper{margin-bottom:1.6em}.jetpack-video-wrapper>.wp-video,.jetpack-video-wrapper>embed,.jetpack-video-wrapper>iframe,.jetpack-video-wrapper>object{margin-bottom:0}.jetpack-social-navigation ul{display:block;margin:0 0 1.5em;padding:0}.jetpack-social-navigation li{display:inline-block;margin:0;line-height:1}.jetpack-social-navigation a{border:0;height:1em;text-decoration:none;width:1em}.jetpack-social-navigation a:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:Genericons;font-size:1em;font-style:normal;font-weight:400;height:1em;line-height:1;speak:none;text-decoration:inherit;vertical-align:top;width:1em;content:"\f415"}.jetpack-social-navigation a[href*="codepen.io"]:before{content:"\f216"}.jetpack-social-navigation a[href*="digg.com"]:before{content:"\f221"}.jetpack-social-navigation a[href*="dribbble.com"]:before{content:"\f201"}.jetpack-social-navigation a[href*="dropbox.com"]:before{content:"\f225"}.jetpack-social-navigation a[href*="mailto:"]:before{content:"\f410"}.jetpack-social-navigation a[href*="facebook.com"]:before{content:"\f203"}.jetpack-social-navigation a[href*="flickr.com"]:before{content:"\f211"}.jetpack-social-navigation a[href*="foursquare.com"]:before{content:"\f226"}.jetpack-social-navigation a[href*="github.com"]:before{content:"\f200"}.jetpack-social-navigation a[href*="plus.google.com"]:before{content:"\f206"}.jetpack-social-navigation a[href*="instagram.com"]:before{content:"\f215"}.jetpack-social-navigation a[href*="linkedin.com"]:before{content:"\f208"}.jetpack-social-navigation a[href*="path.com"]:before{content:"\f219"}.jetpack-social-navigation a[href*="pinterest.com"]:before{content:"\f210"}.jetpack-social-navigation a[href*="getpocket.com"]:before{content:"\f224"}.jetpack-social-navigation a[href*="polldaddy.com"]:before{content:"\f217"}.jetpack-social-navigation a[href*="reddit.com"]:before{content:"\f222"}.jetpack-social-navigation a[href$="/feed/"]:before{content:"\f413"}.jetpack-social-navigation a[href*="skype:"]:before{content:"\f220"}.jetpack-social-navigation a[href*="spotify.com"]:before{content:"\f515"}.jetpack-social-navigation a[href*="stumbleupon.com"]:before{content:"\f223"}.jetpack-social-navigation a[href*="tumblr.com"]:before{content:"\f214"}.jetpack-social-navigation a[href*="twitch.tv"]:before{content:"\f516"}.jetpack-social-navigation a[href*="twitter.com"]:before{content:"\f202"}.jetpack-social-navigation a[href*="vimeo.com"]:before{content:"\f212"}.jetpack-social-navigation a[href*="vine.co"]:before{content:"\f517"}.jetpack-social-navigation a[href*="wordpress.com"]:before,.jetpack-social-navigation a[href*="wordpress.org"]:before{content:"\f205"}.jetpack-social-navigation a[href*="youtube.com"]:before{content:"\f213"}.tiled-gallery{clear:both;margin:0 0 20px;overflow:hidden}.tiled-gallery img{margin:2px!important}.tiled-gallery .gallery-group{float:right;position:relative}.tiled-gallery .tiled-gallery-item{float:right;margin:0;position:relative;width:inherit}.tiled-gallery .gallery-row{overflow:hidden}.tiled-gallery .tiled-gallery-item a{background:0 0;border:none;color:inherit;margin:0;padding:0;text-decoration:none;width:auto}.tiled-gallery .tiled-gallery-item img,.tiled-gallery .tiled-gallery-item img:hover{background:0 0;border:none;box-shadow:none;max-width:100%;padding:0;vertical-align:middle}.tiled-gallery-caption{background:#eee;background:rgba(255,255,255,.8);color:#333;font-size:13px;font-weight:400;overflow:hidden;padding:10px 0;position:absolute;bottom:0;text-indent:10px;text-overflow:ellipsis;width:100%;white-space:nowrap}.tiled-gallery .tiled-gallery-item-small .tiled-gallery-caption{font-size:11px}.widget-gallery .tiled-gallery-unresized{visibility:hidden;height:0;overflow:hidden}.tiled-gallery .tiled-gallery-item img.grayscale{position:absolute;right:0;top:0}.tiled-gallery .tiled-gallery-item img.grayscale:hover{opacity:0}.tiled-gallery.type-circle .tiled-gallery-item img{border-radius:50%!important}.tiled-gallery.type-circle .tiled-gallery-caption{display:none;opacity:0}.jetpack-display-remote-posts{margin:5px 0 20px}.jetpack-display-remote-posts h4{font-size:90%;margin:5px 0;padding:0}.jetpack-display-remote-posts h4 a{text-decoration:none}.jetpack-display-remote-posts p{margin:0!important;padding:0;line-height:1.4em!important;font-size:90%}.jetpack-display-remote-posts img{max-width:100%}.widget-grofile h4{margin:1em 0 .5em}.widget-grofile ul.grofile-urls{margin-right:0;overflow:hidden}.widget-grofile ul.grofile-accounts li{list-style:none;display:inline}.widget-grofile ul.grofile-accounts li::before{content:""!important}.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite.png);background-repeat:no-repeat;width:16px;height:16px;float:right;margin-left:8px;margin-bottom:8px}.rtl .widget-grofile .grofile-accounts-logo{margin-right:8px;margin-left:0}.grofile-thumbnail{width:500px;max-width:100%}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite-2x.png);background-size:16px 784px}}div[class^=gr_custom_container]{border:1px solid gray;border-radius:10px;padding:10px 5px;background-color:#FFF;color:#000}div[class^=gr_custom_container] a{color:#000}h2[class^=gr_custom_header]{display:none}div[class^=gr_custom_each_container]{width:100%;clear:both;margin-bottom:10px;overflow:auto;padding-bottom:4px;border-bottom:1px solid #aaa}div[class^=gr_custom_book_container]{float:left;overflow:hidden;height:60px;margin-right:4px;width:39px}div[class^=gr_custom_author]{font-size:10px}div[class^=gr_custom_tags]{font-size:10px;color:gray}div[class^=gr_custom_rating]{display:none}.widget_wpcom_social_media_icons_widget ul{list-style-type:none;margin-right:0}.widget_wpcom_social_media_icons_widget li{border:0;display:inline;margin-left:.5em}.widget_wpcom_social_media_icons_widget li a{border:0;text-decoration:none}.widget_wpcom_social_media_icons_widget .genericon{font-family:Genericons}.widget_wpcom_social_media_icons_widget .screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.widget_wpcom_social_media_icons_widget .screen-reader-text:active,.widget_wpcom_social_media_icons_widget .screen-reader-text:focus,.widget_wpcom_social_media_icons_widget .screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.widgets-grid-layout{width:100%}.widgets-grid-layout:after,.widgets-grid-layout:before{content:" ";display:table}.widgets-grid-layout:after{clear:both}.widget-grid-view-image{float:right;max-width:50%}.widget-grid-view-image a{display:block;margin:0 0 4px 2px}.widget-grid-view-image:image:nth-child(even){float:left}.widget-grid-view-image:nth-child(even) a{margin:0 2px 4px 0}.widgets-grid-layout .widget-grid-view-image img{max-width:100%;height:auto}.widgets-multi-column-grid ul{overflow:hidden;padding:0;margin:0;list-style-type:none}.widgets-multi-column-grid ul li{background:0 0;clear:none;float:right;margin:0 0 -3px -5px;padding:0 0 6px 8px;border:none;list-style-type:none!important}.widgets-multi-column-grid ul li a{background:0 0;margin:0;padding:0;border:0}.widgets-multi-column-grid .avatar{vertical-align:middle}.widgets-list-layout{padding:0;margin:0;list-style-type:none}.widgets-list-layout li:after,.widgets-list-layout li:before{content:"";display:table}.widgets-list-layout li:after{clear:both}.widgets-list-layout li{zoom:1;margin-bottom:1em;list-style-type:none!important}.widgets-list-layout .widgets-list-layout-blavatar{float:right;width:21.276596%;max-width:40px;height:auto}.widgets-list-layout-links{float:left;width:73.404255%}.widgets-list-layout span{opacity:.5}.widgets-list-layout span:hover{opacity:.8}
|
1 |
/*!
|
2 |
* Do not modify this file directly. It is concatenated from individual module CSS files.
|
3 |
*/
|
4 |
+
.jp-carousel-wrap *{line-height:inherit}.jp-carousel-overlay{background:#000}div.jp-carousel-fadeaway{position:fixed;bottom:0;z-index:2147483647;width:100%;height:15px}.jp-carousel-next-button span,.jp-carousel-previous-button span{background:url(../modules/carousel/images/arrows.png) center center/200px 126px no-repeat}.jp-carousel-msg{font-family:"Open Sans",sans-serif;font-style:normal;display:inline-block;line-height:19px;padding:11px 15px;font-size:14px;text-align:center;margin:25px 2px 0 20px;background-color:#fff;border-right:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.jp-carousel-next-button span,.jp-carousel-previous-button span{background-image:url(../modules/carousel/images/arrows-2x.png)}}.jp-carousel-wrap{font-family:"Helvetica Neue",sans-serif!important}.jp-carousel-info{position:absolute;bottom:0;text-align:right!important;-webkit-font-smoothing:subpixel-antialiased!important}.jp-carousel-info ::selection{background:#68c9e8;color:#fff}.jp-carousel-info ::-moz-selection{background:#68c9e8;color:#fff}.jp-carousel-photo-info{position:relative;right:25%;width:50%}.jp-carousel-transitions .jp-carousel-photo-info{transition:400ms ease-out}.jp-carousel-info h2{background:none!important;border:none!important;color:#999;display:block!important;font:400 13px/1.25em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;margin:7px 0 0!important;padding:10px 0 0!important;overflow:hidden;text-align:right;text-shadow:none!important;text-transform:none!important;-webkit-font-smoothing:subpixel-antialiased}.jp-carousel-next-button,.jp-carousel-previous-button{text-indent:-9999px;overflow:hidden;cursor:pointer}.jp-carousel-next-button span,.jp-carousel-previous-button span{position:absolute;top:0;bottom:0;width:82px;zoom:1;filter:alpha(opacity=20);opacity:.2}.jp-carousel-transitions .jp-carousel-next-button span,.jp-carousel-transitions .jp-carousel-previous-button span{transition:500ms opacity ease-out}.jp-carousel-next-button:hover span,.jp-carousel-previous-button:hover span{filter:alpha(opacity=60);opacity:.6}.jp-carousel-next-button span{background-position:-110px center;left:0}.jp-carousel-previous-button span{background-position:-10px center;right:0}.jp-carousel-buttons{margin:-18px -20px 15px;padding:8px 10px;border-bottom:1px solid #222;background:#222;text-align:center}div.jp-carousel-buttons a{border:none!important;color:#999;font:400 11px/1.2em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;padding:5px 0 5px 2px;text-decoration:none!important;text-shadow:none!important;vertical-align:middle;-webkit-font-smoothing:subpixel-antialiased}div.jp-carousel-buttons a:hover{color:#68c9e8;border:none!important}.jp-carousel-transitions div.jp-carousel-buttons a:hover{transition:none!important}.jp-carousel-next-button,.jp-carousel-previous-button,.jp-carousel-slide,.jp-carousel-slide img{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.jp-carousel-slide{position:fixed;width:0;bottom:0;background-color:#000;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px}.jp-carousel-slide.selected{position:absolute!important;filter:alpha(opacity=100);opacity:1}.jp-carousel-slide{filter:alpha(opacity=25);opacity:.25}.jp-carousel-slide img{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;background:none!important;border:none!important;padding:0!important;box-shadow:0 2px 8px rgba(0,0,0,.1);zoom:1}.jp-carousel-transitions .jp-carousel-slide{transition:opacity 400ms linear}.jp-carousel-close-hint{color:#999;cursor:default;letter-spacing:0!important;padding:.35em 0 0;position:absolute;text-align:right;width:90%}.jp-carousel-transitions .jp-carousel-close-hint{transition:color 200ms linear}.jp-carousel-close-hint span{cursor:pointer;background-color:#000;background-color:rgba(0,0,0,.8);display:block;height:22px;font:400 24px/1 "Helvetica Neue",sans-serif!important;line-height:22px;margin:0 .4em 0 0;text-align:center;vertical-align:middle;width:22px;border-radius:4px}.jp-carousel-transitions .jp-carousel-close-hint span{transition:border-color 200ms linear}.jp-carousel-close-hint:hover{cursor:default;color:#fff}.jp-carousel-close-hint:hover span{border-color:#fff}a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background:url(../modules/carousel/images/carousel-sprite.png?5) 0 0/16px 200px no-repeat}div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{margin:0 0 0 14px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#303030;padding-left:8px!important;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;margin:0 -12px 0 2px!important}div.jp-carousel-buttons a.jp-carousel-reblog,div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{background-position:6px -36px;padding-left:auto!important;padding-right:26px!important;color:#999}div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -156px;padding-right:19px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{cursor:default}div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:6px -56px;color:#68c9e8}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background-image:url(../modules/carousel/images/carousel-sprite-2x.png?5)}}div#carousel-reblog-box{background:#222;padding:3px 0 0;display:none;margin:5px auto 0;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.9);height:74px;width:565px}#carousel-reblog-box textarea{background:#999;font:13px/1.4 "Helvetica Neue",sans-serif!important;color:#444;padding:3px 6px;width:370px;height:48px;float:right;margin:6px 9px 0;border:1px solid #666;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:2px}#carousel-reblog-box textarea:focus{background:#ccc;color:#222}#carousel-reblog-box label{color:#aaa;font-size:11px;padding-left:2px;padding-right:2px;display:inline;font-weight:400}#carousel-reblog-box select{width:110px;padding:0;font-size:12px;font-family:"Helvetica Neue",sans-serif!important;background:#333;color:#eee;border:1px solid #444;margin-top:5px}#carousel-reblog-box .submit,#wrapper #carousel-reblog-box p.response{float:right;width:154px;padding-top:0;padding-right:1px;overflow:hidden;height:34px;margin:3px 2px 0 0!important}#wrapper #carousel-reblog-box p.response{font-size:13px;clear:none;padding-right:2px;height:34px;color:#aaa}#carousel-reblog-box input#carousel-reblog-submit,#jp-carousel-comment-form-button-submit{font:13px/24px "Helvetica Neue",sans-serif!important;margin-top:8px;padding:0 10px!important;border-radius:1em;height:24px;color:#333;cursor:pointer;font-weight:400;background:#aaa;border:1px solid #444}#carousel-reblog-box input#carousel-reblog-submit:hover,#jp-carousel-comment-form-button-submit:hover{background:#ccc}#carousel-reblog-box .canceltext{color:#aaa;font-size:11px;line-height:24px}#carousel-reblog-box .canceltext a{color:#fff}.jp-carousel-titleanddesc{border-top:1px solid #222;color:#999;font-size:15px;padding-top:24px;margin-bottom:20px;font-weight:400}.jp-carousel-titleanddesc-title{font:300 1.5em/1.1 "Helvetica Neue",sans-serif!important;text-transform:none!important;color:#fff;margin:0 0 15px;padding:0}.jp-carousel-titleanddesc-desc p{color:#999;line-height:1.4;margin-bottom:.75em}.jp-carousel-comments p a,.jp-carousel-info h2 a,.jp-carousel-titleanddesc p a{color:#fff!important;border:none!important;text-decoration:underline!important;font-weight:400!important;font-style:normal!important}.jp-carousel-titleanddesc p b,.jp-carousel-titleanddesc p strong{font-weight:700;color:#999}.jp-carousel-titleanddesc p em,.jp-carousel-titleanddesc p i{font-style:italic;color:#999}.jp-carousel-comments p a:hover,.jp-carousel-info h2 a:hover,.jp-carousel-titleanddesc p a:hover{color:#68c9e8!important}.jp-carousel-titleanddesc p:empty{display:none}.jp-carousel-left-column-wrapper h1:after,.jp-carousel-left-column-wrapper h1:before,.jp-carousel-photo-info h1:after,.jp-carousel-photo-info h1:before{content:none!important}.jp-carousel-image-meta{background:#111;border:1px solid #222;color:#fff;font:12px/1.4 "Helvetica Neue",sans-serif!important;overflow:hidden;padding:18px 20px;width:209px!important}.jp-carousel-image-meta h5,.jp-carousel-image-meta li{font-family:"Helvetica Neue",sans-serif!important;position:inherit!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;background:none!important;border:none!important;font-weight:400!important;line-height:1.3em!important}.jp-carousel-image-meta ul{margin:0!important;padding:0!important;list-style:none!important}.jp-carousel-image-meta li{width:48%!important;float:right!important;margin:0 0 15px 2%!important;color:#fff!important;font-size:13px!important}.jp-carousel-image-meta h5{color:#999!important;text-transform:uppercase!important;font-size:10px!important;margin:0 0 2px!important;letter-spacing:.1em!important}a.jp-carousel-image-download{padding-right:23px;display:inline-block;clear:both;color:#999;line-height:1;font-weight:400;font-size:13px;text-decoration:none;background-position:0 -82px}a.jp-carousel-image-download span.photo-size{font-size:11px;border-radius:1em;margin-right:2px;display:inline-block}a.jp-carousel-image-download span.photo-size-times{padding:0 2px 0 1px}a.jp-carousel-image-download:hover{background-position:0 -122px;color:#68c9e8;border:none!important}.jp-carousel-image-map{position:relative;margin:-20px -20px 20px;border-bottom:1px solid rgba(255,255,255,.17);height:154px}.jp-carousel-image-map img.gmap-main{border-top-right-radius:6px;border-left:1px solid rgba(255,255,255,.17)}.jp-carousel-image-map div.gmap-topright{width:94px;height:154px;position:absolute;top:0;left:0}.jp-carousel-image-map div.imgclip{overflow:hidden;border-top-left-radius:6px}.jp-carousel-image-map div.gmap-topright img{margin-right:-40px}.jp-carousel-image-map img.gmap-bottomright{position:absolute;top:96px;left:0}.jp-carousel-comments{font:15px/1.7 "Helvetica Neue",sans-serif!important;font-weight:400;background:none}.jp-carousel-comments p a:active,.jp-carousel-comments p a:focus,.jp-carousel-comments p a:hover{color:#68c9e8!important}.jp-carousel-comment{background:none;color:#999;margin-bottom:20px;clear:right;overflow:auto;width:100%}.jp-carousel-comment p{color:#999!important}.jp-carousel-comment .comment-author{font-size:13px;font-weight:400;padding:0;width:auto;display:inline;float:none;border:none;margin:0}.jp-carousel-comment .comment-author a{color:#fff}.jp-carousel-comment .comment-gravatar{float:right}.jp-carousel-comment .comment-content{border:none;margin-right:85px;padding:0}.jp-carousel-comment .avatar{margin:0 0 0 20px;border-radius:4px;border:none!important;padding:0!important;background-color:transparent!important}.jp-carousel-comment .comment-date{color:#999;margin-top:4px;font-size:11px;display:inline;float:left}#jp-carousel-comment-form{margin:0 0 10px!important;float:right;width:100%}textarea#jp-carousel-comment-form-comment-field{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:15px/1.4 "Helvetica Neue",sans-serif!important;width:100%;padding:10px 10px 5px;margin:0;float:none;height:147px;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:3px;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box}textarea#jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#555}textarea#jp-carousel-comment-form-comment-field:focus{background:#ccc;color:#222}textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#aaa}#jp-carousel-comment-form-spinner{color:#fff;margin:22px 10px 0 0;display:block;width:20px;height:20px;float:right}#jp-carousel-comment-form-submit-and-info-wrapper{display:none;overflow:hidden;width:100%}#jp-carousel-comment-form-commenting-as input{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:13px/1.4 "Helvetica Neue",sans-serif!important;padding:3px 6px;float:right;box-shadow:inset -2px 2px 2px rgba(0,0,0,.2);border-radius:2px;width:285px}#jp-carousel-comment-form-commenting-as input:focus{background:#ccc;color:#222}#jp-carousel-comment-form-commenting-as p{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:22px 0 0;float:right}#jp-carousel-comment-form-commenting-as fieldset{float:right;border:none;margin:20px 0 0;padding:0;clear:both}#jp-carousel-comment-form-commenting-as label{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:0 0 3px 20px;float:right;width:100px}#jp-carousel-comment-form-button-submit{margin-top:20px;float:left}#jp-carousel-comment-form-container,#js-carousel-comment-form-container{margin-bottom:15px;overflow:auto;width:100%}#jp-carousel-comment-post-results{display:none;overflow:auto;width:100%}#jp-carousel-comment-post-results span{display:block;text-align:center;margin-top:20px;width:100%;overflow:auto;padding:1em 0;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.7);border-radius:2px;font:13px/1.4 "Helvetica Neue",sans-serif!important;border:1px solid rgba(255,255,255,.17);box-shadow:inset 0 0 5px 5px rgba(0,0,0,1)}.jp-carousel-comment-post-error{color:#DF4926}#jp-carousel-comments-closed{display:none;color:#999}#jp-carousel-comments-loading{font:400 15px/1.7 "Helvetica Neue",sans-serif!important;display:none;color:#999;text-align:right;margin-bottom:20px}.jp-carousel-light .jp-carousel-overlay{background:#fff}.jp-carousel-light .jp-carousel-next-button:hover span,.jp-carousel-light .jp-carousel-previous-button:hover span{opacity:.8}.jp-carousel-light .jp-carousel-close-hint:hover,.jp-carousel-light .jp-carousel-titleanddesc div{color:#000!important}.jp-carousel-light .jp-carousel-comment .comment-author a,.jp-carousel-light .jp-carousel-comments p a,.jp-carousel-light .jp-carousel-info h2 a,.jp-carousel-light .jp-carousel-titleanddesc p a{color:#1e8cbe!important}.jp-carousel-light .jp-carousel-comment .comment-author a:hover,.jp-carousel-light .jp-carousel-comments p a:hover,.jp-carousel-light .jp-carousel-info h2 a:hover,.jp-carousel-light .jp-carousel-titleanddesc p a:hover{color:#f1831e!important}.jp-carousel-light .jp-carousel-comment,.jp-carousel-light .jp-carousel-comment p,.jp-carousel-light .jp-carousel-info h2,.jp-carousel-light .jp-carousel-titleanddesc,.jp-carousel-light .jp-carousel-titleanddesc p,.jp-carousel-light .jp-carousel-titleanddesc p b,.jp-carousel-light .jp-carousel-titleanddesc p em,.jp-carousel-light .jp-carousel-titleanddesc p i,.jp-carousel-light .jp-carousel-titleanddesc p strong,.jp-carousel-light div.jp-carousel-buttons a{color:#666}.jp-carousel-light .jp-carousel-buttons{border-bottom-color:#f0f0f0;background:#f5f5f5}.jp-carousel-light div.jp-carousel-buttons a:hover{text-decoration:none;color:#f1831e}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog,.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:4px -56px;padding-right:24px!important}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#2ea2cc;color:#fff}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -176px}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-position:5px -36px}.jp-carousel-light div#carousel-reblog-box{background:#eee;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd}.jp-carousel-light #carousel-reblog-box textarea{color:#666;border:1px solid #cfcfcf;background:#fff}.jp-carousel-light #carousel-reblog-box .canceltext{color:#888}.jp-carousel-light #carousel-reblog-box .canceltext a{color:#666}.jp-carousel-light #carousel-reblog-box select{background:#eee;color:#333;border:1px solid #aaa}#jp-carousel-comment-form-button-submit,.jp-carousel-light #carousel-reblog-box input#carousel-reblog-submit{color:#333;background:#fff;border:1px solid #aaa}.jp-carousel-light .jp-carousel-image-meta{background:#fafafa;border:1px solid #eee;border-top-color:#f5f5f5;border-right-color:#f5f5f5;color:#333}.jp-carousel-light .jp-carousel-image-meta li{color:#000!important}.jp-carousel-light .jp-carousel-close-hint{color:#ccc}.jp-carousel-light .jp-carousel-close-hint span{background-color:#fff;border-color:#ccc}.jp-carousel-light #jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#aaa}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus{color:#333}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#ddd}.jp-carousel-light a.jp-carousel-image-download{background-position:0 -122px}.jp-carousel-light a.jp-carousel-image-download:hover{background-position:0 -122px;color:#f1831e}.jp-carousel-light textarea#jp-carousel-comment-form-comment-field{background:#fbfbfb;color:#333;border:1px solid #dfdfdf;box-shadow:inset -2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input{background:#fbfbfb;border:1px solid #dfdfdf;color:#333;box-shadow:inset -2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input:focus{background:#fbfbfb;color:#333}.jp-carousel-light #jp-carousel-comment-post-results span{background:#f7f7f7;border:1px solid #dfdfdf;box-shadow:inset 0 0 5px rgba(0,0,0,.05)}.jp-carousel-light .jp-carousel-slide{background-color:#fff}.jp-carousel-light .jp-carousel-titleanddesc{border-top:1px solid #eee}@media only screen and (max-width:760px){.jp-carousel-info{margin:0 10px!important}.jp-carousel-buttons,.jp-carousel-next-button,.jp-carousel-previous-button{display:none!important}.jp-carousel-image-meta{float:none!important;width:100%!important;-moz-box-sizing:border-box;box-sizing:border-box}.jp-carousel-close-hint{font-weight:800!important;font-size:26px!important;position:fixed!important;top:-10px}.jp-carousel-slide img{filter:alpha(opacity=100);opacity:1}.jp-carousel-wrap{background-color:#000}.jp-carousel-fadeaway{display:none}#jp-carousel-comment-form-container{display:none!important}.jp-carousel-titleanddesc{padding-top:0!important;border:none!important}.jp-carousel-titleanddesc-title{font-size:1em!important}.jp-carousel-left-column-wrapper{padding:0;width:100%!important}.jp-carousel-photo-info{right:0!important;width:100%!important}}.contact-form .clear-form{clear:both}.contact-form input[type=email],.contact-form input[type=text]{width:300px;max-width:98%;margin-bottom:13px}.contact-form select{margin-bottom:13px}.contact-form textarea{height:200px;width:80%;float:none;margin-bottom:13px}.contact-form input[type=checkbox],.contact-form input[type=radio]{float:none;margin-bottom:13px}.contact-form label{margin-bottom:3px;float:none;font-weight:700;display:block}.contact-form label.checkbox,.contact-form label.radio{margin-bottom:3px;float:none;font-weight:700;display:inline-block}.contact-form label span{color:#AAA;margin-right:4px;font-weight:400}.contact-form-submission{margin-bottom:4em;padding:1.5em 1em}.contact-form-submission p{margin:0 auto}.form-errors .form-error-message{color:red}.textwidget .contact-form input[type=email],.textwidget .contact-form input[type=text],.textwidget .contact-form textarea{width:250px;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}#jetpack-check-feedback-spam{margin:1px 0 0 8px}.jetpack-check-feedback-spam-spinner{display:inline-block;margin-top:7px}.infinite-loader{color:#000;display:block;height:28px;text-indent:-9999px}#infinite-handle span{background:#333;border-radius:1px;color:#eee;cursor:pointer;font-size:13px;padding:6px 16px}#infinite-handle span button,#infinite-handle span button:focus,#infinite-handle span button:hover{display:inline;position:static;padding:0;margin:0;border:none;line-height:inherit;background:0 0;color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}#infinite-handle span button::-moz-focus-inner{margin:0;padding:0;border:none}@media (max-width:800px){#infinite-handle span:before{display:none}#infinite-handle span{display:block}}#infinite-footer{position:fixed;bottom:-50px;right:0;width:100%}#infinite-footer a{text-decoration:none}#infinite-footer .blog-credits a:hover,#infinite-footer .blog-info a:hover{color:#444;text-decoration:underline}#infinite-footer .container{background:rgba(255,255,255,.8);border-color:#ccc;border-color:rgba(0,0,0,.1);border-style:solid;border-width:1px 0 0;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 auto;overflow:hidden;padding:1px 20px;width:780px}#infinite-footer .blog-credits,#infinite-footer .blog-info{-moz-box-sizing:border-box;box-sizing:border-box;line-height:25px}#infinite-footer .blog-info{float:right;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap;width:40%}#infinite-footer .blog-credits{font-weight:400;float:left;width:60%}#infinite-footer .blog-info a{color:#111;font-size:14px;font-weight:700}#infinite-footer .blog-credits{color:#888;font-size:12px;text-align:left}#infinite-footer .blog-credits a{color:#666}.infinity-end.neverending #infinite-footer{display:none}@media (max-width:640px){#infinite-footer .container{-moz-box-sizing:border-box;box-sizing:border-box;width:100%}#infinite-footer .blog-info{width:30%}#infinite-footer .blog-credits{width:70%}#infinite-footer .blog-credits,#infinite-footer .blog-info a{font-size:10px}}@media (max-width:640px){#infinite-footer{position:static}}#wpadminbar li#wp-admin-bar-admin-bar-likes-widget{width:61px;overflow:hidden}#wpadminbar iframe.admin-bar-likes-widget{width:61px;height:28px;min-height:28px;border-width:0;position:absolute;top:0}div.jetpack-likes-widget-wrapper{width:100%;min-height:50px;position:relative}div.jetpack-likes-widget-wrapper .sd-link-color{font-size:12px}div.jetpack-likes-widget-wrapper.slim-likes-widget{width:1px;min-height:0}#likes-other-gravatars{display:none;position:absolute;padding:10px 10px 12px;background-color:#2e4453;border-width:0;box-shadow:0 0 10px #2e4453;box-shadow:0 0 10px rgba(46,68,83,.6);min-width:130px;z-index:1000}#likes-other-gravatars *{line-height:normal}#likes-other-gravatars .likes-text{color:#fff;font-size:12px;padding-bottom:8px}#likes-other-gravatars li,#likes-other-gravatars ul{margin:0;padding:0;text-indent:0;list-style-type:none}#likes-other-gravatars li::before{content:""}#likes-other-gravatars ul.wpl-avatars{overflow:auto;display:block;max-height:190px}#likes-other-gravatars ul.wpl-avatars li{width:32px;height:32px;float:right;margin:0 0 5px 5px}#likes-other-gravatars ul.wpl-avatars li a{margin:0 0 0 2px;border-bottom:none!important;display:block}#likes-other-gravatars ul.wpl-avatars li a img{background:0 0;border:none;margin:0!important;padding:0!important;position:static}div.sd-box{border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.13)}.comment-likes-widget,.entry-content .post-likes-widget,.post-likes-widget{margin:0;border-width:0;display:block}.post-likes-widget-placeholder{margin:0;border-width:0;position:relative}.post-likes-widget-placeholder .button{display:none}.post-likes-widget-placeholder .loading{color:#999;font-size:12px}.slim-likes-widget .post-likes-widget{width:auto;float:none}div.sharedaddy.sd-like-enabled .sd-like h3{display:none}div.sharedaddy.sd-like-enabled .sd-like .post-likes-widget{width:100%;float:none;position:absolute;top:0}.comment-likes-widget{width:100%}.pd-rating{display:block!important}.sd-gplus .sd-title{display:none}#jp-relatedposts{display:none;padding-top:1em;margin:1em 0;position:relative;clear:both}.jp-relatedposts:after{content:'';display:block;clear:both}#jp-relatedposts h3.jp-relatedposts-headline{margin:0 0 1em;display:inline-block;float:right;font-size:9pt;font-weight:700;font-family:inherit}#jp-relatedposts h3.jp-relatedposts-headline em:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.2);margin-bottom:1em}#jp-relatedposts h3.jp-relatedposts-headline em{font-style:normal;font-weight:700}#jp-relatedposts .jp-relatedposts-items{clear:right}#jp-relatedposts .jp-relatedposts-items-visual{margin-left:-20px}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{float:right;width:33%;margin:0 0 1em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post{padding-left:20px;filter:alpha(opacity=80);-moz-opacity:.8;opacity:.8}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4){clear:both}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover{filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items p,#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{font-size:14px;line-height:20px;margin:0}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs{position:relative}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay{position:absolute;top:0;bottom:0;right:0;left:0;display:block;border-bottom:0}#jp-relatedposts .jp-relatedposts-items p{margin-bottom:0}#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{text-transform:none;margin:0;font-family:inherit;display:block;max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a{font-size:inherit;font-weight:400;text-decoration:none;filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span{display:block;max-width:90%;overflow:hidden;text-overflow:ellipsis}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span{max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{opacity:.6}#jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt,.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{display:none}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt{overflow:hidden}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span{margin-bottom:1em}@media only screen and (max-width:640px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:50%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n){clear:right}#jp-relatedposts .jp-relatedposts-items-visual{margin-left:20px}}@media only screen and (max-width:320px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:100%;clear:both;margin:0 0 1em}}#jp-post-flair{padding-top:.5em}#content div.sharedaddy,#main div.sharedaddy,div.sharedaddy{clear:both}div.sharedaddy h3.sd-title{margin:0 0 1em;display:inline-block;line-height:1.2;font-size:9pt;font-weight:700}div.sharedaddy h3.sd-title:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;margin-bottom:1em}body.highlander-light h3.sd-title:before{border-top:1px solid rgba(0,0,0,.2)}body.highlander-dark h3.sd-title:before{border-top:1px solid rgba(255,255,255,.4)}.sd-content ul{padding:0!important;margin:0 0 .7em!important;list-style:none!important}.sd-content ul li{display:inline-block}.sd-block.sd-gplus{margin:0 0 .5em}.sd-gplus .sd-content{font-size:12px}#sharing_email .sharing_send,.sd-content ul li .option a.share-ustom,.sd-content ul li a.sd-button,.sd-content ul li.advanced a.share-more,.sd-content ul li.preview-item div.option.option-smart-off a,.sd-social-icon .sd-content ul li a.sd-button,.sd-social-icon-text .sd-content ul li a.sd-button,.sd-social-official .sd-content>ul>li .digg_button >a,.sd-social-official .sd-content>ul>li>a.sd-button,.sd-social-text .sd-content ul li a.sd-button{text-decoration:none!important;display:inline-block;font-size:12px;font-family:"Open Sans",sans-serif;font-weight:400;border-radius:3px;color:#777!important;background:#f8f8f8;border:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.08);text-shadow:none;line-height:23px;padding:1px 5px 0 8px}.sd-content ul li .option a.share-ustom span,.sd-content ul li a.sd-button>span,.sd-content ul li.advanced a.share-more span,.sd-content ul li.preview-item div.option.option-smart-off a span,.sd-social-icon-text .sd-content ul li a.sd-button>span,.sd-social-official .sd-content>ul>li .digg_button >a span,.sd-social-official .sd-content>ul>li>a.sd-button span,.sd-social-text .sd-content ul li a.sd-button span{line-height:23px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button,.sd-social-official .sd-content>ul>li .digg_button>a,.sd-social-official .sd-content>ul>li>a.sd-button{line-height:17px;box-shadow:none;vertical-align:top}.sd-social-official .sd-content ul li a.sd-button>span{line-height:17px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a:before,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button:before,.sd-social-official .sd-content>ul>li .digg_button>a:before,.sd-social-official .sd-content>ul>li>a.sd-button:before{margin-bottom:-1px}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon .sd-content ul li a.sd-button:hover,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:hover,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li .digg_button>a:hover,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-official .sd-content>ul>li>a.sd-button:hover,.sd-social-text .sd-content ul li a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:hover{color:#555;background:#fafafa;border:1px solid #999}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:active{box-shadow:inset 0 1px 0 rgba(0,0,0,.16)}.sd-content ul li a.sd-button:before{display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:400 18px/1 social-logos;vertical-align:top;text-align:center}.sd-social-icon-text ul li a.sd-button:before{position:relative;top:2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-content ul li a.sd-button:before{position:relative;top:2px}}.sd-social-official ul li a.sd-button:before{position:relative;top:-2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-official ul li a.sd-button:before{top:0}}.sd-content ul li{margin:0 0 5px 5px;padding:0}.sd-content ul li.preview-item a.sd-button span,.sd-social-icon-text .sd-content ul li a span,.sd-social-official .sd-content ul li a.sd-button span{margin-right:3px}.sd-content ul li.preview-item.no-icon a.sd-button span{margin-right:0}.sd-content ul li.no-icon a:before,.sd-social-text .sd-content ul li a:before{display:none}body .sd-content ul li.share-custom.no-icon a span,body .sd-social-text .sd-content ul li.share-custom a span{background-image:none;background-position:-500px -500px!important;background-repeat:no-repeat!important;padding-right:0;height:0;line-height:inherit}.sd-social-icon .sd-content ul li a.share-more{position:relative;top:-4px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-icon .sd-content ul li a.share-more{top:2px}}@-moz-document url-prefix(){.sd-social-icon .sd-content ul li a.share-more{top:2px}}.sd-social-icon .sd-content ul li a.share-more span{margin-right:3px}.sd-content ul li.share-print div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-print a:before,.sd-social-icon-text .sd-content li.share-print a:before,.sd-social-official .sd-content li.share-print a:before,.sd-social-text .sd-content ul li.share-print a:before{content:'\f469'}.sd-content ul li.share-email div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-email a:before,.sd-social-icon-text .sd-content li.share-email a:before,.sd-social-official .sd-content li.share-email a:before,.sd-social-text .sd-content ul li.share-email a:before{content:'\f410'}.sd-content ul li.share-linkedin div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-linkedin a:before,.sd-social-icon-text .sd-content li.share-linkedin a:before,.sd-social-text .sd-content ul li.share-linkedin a:before{content:'\f207'}.sd-content ul li.share-twitter div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-twitter a:before,.sd-social-icon-text .sd-content li.share-twitter a:before,.sd-social-text .sd-content ul li.share-twitter a:before{content:'\f202'}.sd-content ul li.share-reddit div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-reddit a:before,.sd-social-icon-text .sd-content li.share-reddit a:before,.sd-social-text .sd-content ul li.share-reddit a:before{content:'\f222'}.sd-content ul li.share-tumblr div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-tumblr a:before,.sd-social-icon-text .sd-content li.share-tumblr a:before,.sd-social-text .sd-content ul li.share-tumblr a:before{content:'\f607'}.sd-content ul li.share-pocket div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pocket a:before,.sd-social-icon-text .sd-content li.share-pocket a:before,.sd-social-text .sd-content ul li.share-pocket a:before{content:'\f224'}.sd-content ul li.share-pinterest div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pinterest a:before,.sd-social-icon-text .sd-content li.share-pinterest a:before,.sd-social-text .sd-content ul li.share-pinterest a:before{content:'\f210'}.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-google-plus-1 a:before,.sd-social-icon-text .sd-content li.share-google-plus-1 a:before,.sd-social-text .sd-content ul li.share-google-plus-1 a:before{content:'\f218'}.sd-content ul li.share-facebook div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-facebook a:before,.sd-social-icon-text .sd-content li.share-facebook a:before,.sd-social-text .sd-content ul li.share-facebook a:before{content:'\f203'}.sd-content ul li.share-press-this div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-press-this a:before,.sd-social-icon-text .sd-content li.share-press-this a:before,.sd-social-official .sd-content li.share-press-this a:before,.sd-social-text .sd-content ul li.share-press-this a:before{content:'\f205'}.sd-social-official .sd-content li.share-press-this a:before{color:#2ba1cb}.sd-content ul li.share-telegram div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-telegram a:before,.sd-social-icon-text .sd-content li.share-telegram a:before,.sd-social-official .sd-content li.share-telegram a:before,.sd-social-text .sd-content ul li.share-telegram a:before{content:'\f606'}.sd-social-official .sd-content li.share-telegram a:before{color:#08c}.sd-content ul li.share-skype div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-skype a:before,.sd-social-icon-text .sd-content li.share-skype a:before,.sd-social-text .sd-content ul li.share-skype a:before{content:'\f220'}.sd-content ul li.advanced a.share-more:before,.sd-social-icon .sd-content ul a.share-more:before,.sd-social-icon-text .sd-content a.share-more:before,.sd-social-official .sd-content a.share-more:before,.sd-social-text .sd-content ul a.share-more:before{content:'\f415'}.sd-social-official .sd-content a.share-more:before{color:#2ba1cb}.sd-content ul li.share-jetpack-whatsapp div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-jetpack-whatsapp a:before,.sd-social-icon-text .sd-content li.share-jetpack-whatsapp a:before,.sd-social-official .sd-content li.share-jetpack-whatsapp a:before,.sd-social-text .sd-content ul li.share-jetpack-whatsapp a:before{content:'\f608'}.sd-social-official .sd-content li.share-jetpack-whatsapp a:before{color:#43d854}.sd-social-icon .sd-content ul li[class*=share-].share-jetpack-whatsapp a.sd-button{background:#43d854;color:#fff!important}.sd-social .sd-button .share-count{background:#2ea2cc;color:#fff;border-radius:10px;display:inline-block;text-align:center;font-size:10px;padding:1px 3px;line-height:1}.sd-social-official .sd-content ul,.sd-social-official .sd-content ul li{line-height:25px!important}.sd-social-official .sd-content>ul>li>a.sd-button span{line-height:1}.sd-social-official .sd-content ul:after{content:".";display:block;height:0;clear:both;visibility:hidden}.sd-social-official .sd-content li.share-press-this a{margin:0 0 5px}.sd-social-official .sd-content ul>li{display:block;float:right;margin:0 0 5px 10px!important;height:25px}.sd-social-official .fb-share-button>span{vertical-align:top!important}.sd-social-official .sd-content .pocket_button iframe{width:98px}.googleplus1_button .g-plus{vertical-align:top!important}.reddit_button iframe{margin-top:1px}.googleplus1_button iframe,.linkedin_button>span,.pinterest_button,.pocket_button iframe,.twitter_button{margin:0!important}.sd-social-official .sd-content .share-skype{width:55px}body .sd-social-official li a.share-more,body .sd-social-official li.share-custom a,body .sd-social-official li.share-digg a,body .sd-social-official li.share-email a,body .sd-social-official li.share-press-this a,body .sd-social-official li.share-print{position:relative;top:0}body .sd-social-icon .sd-content li.share-custom>a{padding:2px 3px 0;position:relative;top:4px}body .sd-content ul li.share-custom a.share-icon span,body .sd-social-icon .sd-content li.share-custom a span,body .sd-social-icon-text .sd-content li.share-custom a span,body .sd-social-official .sd-content li.share-custom a span,body .sd-social-text .sd-content li.share-custom a span{background-size:16px 16px;background-repeat:no-repeat;margin-right:0;padding:0 19px 0 0;display:inline-block;height:16px;line-height:16px}body .sd-social-icon .sd-content li.share-custom a span{width:0;padding-right:16px!important}.sharing-hidden .inner{position:absolute;z-index:2;border:1px solid #ccc;padding:10px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);border-radius:2px;margin-top:5px;max-width:400px}.sharing-hidden .inner ul{margin:0!important}.sd-social-official .sd-content .sharing-hidden ul>li.share-end{clear:both;margin:0!important;height:0!important}.sharing-hidden .inner:after,.sharing-hidden .inner:before{position:absolute;z-index:1;top:-8px;right:20px;width:0;height:0;border-right:6px solid transparent;border-left:6px solid transparent;border-bottom:8px solid #ccc;content:"";display:block}.sharing-hidden .inner:after{z-index:2;top:-7px;border-right:6px solid transparent;border-left:6px solid transparent;border-bottom:8px solid #fff}.sharing-hidden ul{margin:0}.sd-social-icon .sd-content ul li[class*=share-] a,.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a{border-radius:50%;-webkit-border-radius:50%;border:0;box-shadow:none;padding:7px;position:relative;top:-2px;line-height:1;width:auto;height:auto;margin-bottom:0}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button>span,.sd-social-icon .sd-content ul li[class*=share-] div.option a span{line-height:1}.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a:hover{border:none;opacity:.6}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button:before{top:1px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button.share-custom{padding:8px 8px 6px;top:5px}.sd-social-icon .sd-content ul li a.sd-button.share-more{margin-right:10px}.sd-social-icon .sd-content ul li:first-child a.sd-button.share-more{margin-right:0}.sd-social-icon .sd-button span.share-count{position:absolute;bottom:0;left:0;border-radius:0;background:#555;font-size:9px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button{background:#e9e9e9;margin-top:2px;text-indent:0}.sd-social-icon .sd-content ul li[class*=share-].share-tumblr a.sd-button{background:#2c4762;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-facebook a.sd-button{background:#3b5998;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-twitter a.sd-button{background:#00acee;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pinterest a.sd-button{background:#ca1f27;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-digg a.sd-button{color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-press-this a.sd-button{background:#1e8cbe;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-telegram a.sd-button{background:#08c;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-linkedin a.sd-button{background:#0077b5;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-google-plus-1 a.sd-button{background:#dd4b39;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pocket a.sd-button{background:#ee4056;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-reddit a.sd-button{background:#cee3f8;color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-skype a.sd-button{background:#00AFF0;color:#fff!important}.sharing-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.sharing-screen-reader-text:active,.sharing-screen-reader-text:focus,.sharing-screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#sharing_email{width:342px;position:absolute;z-index:1001;border:1px solid #ccc;padding:15px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);text-align:right}div.sharedaddy.sharedaddy-dark #sharing_email{border-color:#fff}#sharing_email .errors{color:#fff;background-color:#771a09;font-size:12px;padding:5px 8px;line-height:1;margin:10px 0 0}#sharing_email label{font-size:12px;color:#333;font-weight:700;display:block;padding:0 0 4px;text-align:right;text-shadow:none}#sharing_email form{margin:0}#sharing_email input[type=email],#sharing_email input[type=text]{width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #ccc;margin-bottom:1em;background:#fff;font-size:12px;color:#333;max-width:none;padding:1px 3px}#jetpack-source_f_name{display:none!important;position:absolute!important;right:-9000px}#sharing_email .sharing_cancel{padding:0 1em 0 0;font-size:12px;text-shadow:none}#sharing_email .recaptcha{width:312px;height:123px;margin:0 0 1em}.slideshow-window{background-color:#222;border:20px solid #222;border-radius:10px;height:0;margin-bottom:20px;overflow:hidden;padding-top:30px!important;padding-bottom:56.25%!important;position:relative;z-index:1}.slideshow-window.slideshow-white{background-color:#fff;border-color:#fff}.slideshow-window,.slideshow-window *{-moz-box-sizing:content-box;box-sizing:content-box}.slideshow-loading{height:100%;text-align:center;margin:auto}body div.slideshow-window * img{background-color:transparent!important;background-image:none!important;border-width:0!important;display:block;margin:0 auto;max-width:100%;max-height:100%;padding:0!important;position:relative;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%}.slideshow-loading img{vertical-align:middle}.slideshow-slide{display:none;height:100%!important;right:0;margin:auto;position:absolute;text-align:center;top:0;width:100%!important}.slideshow-slide img{vertical-align:middle}.slideshow-line-height-hack{overflow:hidden;width:0;font-size:0}.slideshow-slide-caption{font-size:13px;font-family:"Helvetica Neue",sans-serif;color:#f7f7f7;text-shadow:#222 -1px 1px 2px;line-height:25px;height:25px;position:absolute;bottom:5px;right:0;z-index:100;width:100%;text-align:center}.slideshow-controls{z-index:1000;position:absolute;bottom:30px;margin:auto;text-align:center;width:100%;-ms-filter:"alpha(Opacity=50)";opacity:.5;direction:rtl;transition:300ms opacity ease-out}.slideshow-window:hover .slideshow-controls{-ms-filter:"alpha(Opacity=100)";opacity:1}body div div.slideshow-controls a,body div div.slideshow-controls a:hover{border:2px solid rgba(255,255,255,.1)!important;background-color:#000!important;background-color:rgba(0,0,0,.6)!important;background-image:url(../modules/shortcodes/img/slideshow-controls.png)!important;background-repeat:no-repeat;background-size:142px 16px!important;background-position:-34px 8px!important;color:#222!important;margin:0 5px!important;padding:0!important;display:inline-block!important;zoom:1;height:32px!important;width:32px!important;line-height:32px!important;text-align:center!important;-khtml-border-radius:10em!important;border-radius:10em!important;transition:300ms border-color ease-out}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body div div.slideshow-controls a,body div div.slideshow-controls a:hover{background-image:url(../modules/shortcodes/img/slideshow-controls-2x.png)!important}}body div div.slideshow-controls a:hover{border-color:rgba(255,255,255,1)!important}body div div.slideshow-controls a:first-child{background-position:-76px 8px!important}body div div.slideshow-controls a:last-child{background-position:-117px 8px!important}body div div.slideshow-controls a.running,body div div.slideshow-controls a:nth-child(2){background-position:-34px 8px!important}body div div.slideshow-controls a.paused{background-position:9px 8px!important}.slideshow-controls a img{border:50px dotted #f0f}body.presentation-wrapper-fullscreen-parent,html.presentation-wrapper-fullscreen-parent{overflow:hidden!important}.presentation-wrapper-fullscreen-parent #wpadminbar{display:none}.presentation-wrapper-fullscreen,.presentation-wrapper-fullscreen-parent{min-width:100%!important;min-height:100%!important;position:absolute!important;top:0!important;left:0!important;bottom:0!important;right:0!important;margin:0!important;padding:0!important;z-index:10000!important}.presentation-wrapper-fullscreen{background-color:gray;border:none!important}.presentation-wrapper-fullscreen .nav-arrow-left,.presentation-wrapper-fullscreen .nav-arrow-right{z-index:20001}.presentation-wrapper-fullscreen .nav-fullscreen-button{z-index:20002}.presentation-wrapper{margin:20px auto;border:1px solid #e5e5e5;overflow:hidden;line-height:normal}.presentation{position:relative;margin:0;overflow:hidden;outline:0}.presentation,.presentation .step{background-repeat:no-repeat;background-position:center;background-size:100% 100%}.presentation .step.fade:not(.active){opacity:0}.presentation .slide-content{padding:30px}.presentation .nav-arrow-left,.presentation .nav-arrow-right,.presentation .nav-fullscreen-button{position:absolute;width:34px;background-repeat:no-repeat;z-index:2;opacity:0;transition:opacity .25s}.presentation .nav-arrow-left,.presentation .nav-arrow-right{height:100%;background-image:url(../modules/shortcodes/images/slide-nav.png);background-size:450% 61px}.presentation .nav-arrow-left{right:0;background-position:4px 50%}.presentation .nav-arrow-right{left:0;background-position:-120px 50%}.presentation .nav-fullscreen-button{width:32px;height:32px;margin:4px;bottom:0;left:0;z-index:3;background-image:url(../modules/shortcodes/images/expand.png);background-size:100% 100%}.presentation:hover .nav-arrow-left,.presentation:hover .nav-arrow-right{opacity:1}.presentation:hover .nav-fullscreen-button{opacity:.8}.presentation-wrapper-fullscreen .nav-fullscreen-button{background-image:url(../modules/shortcodes/images/collapse.png)}.presentation .autoplay-overlay{height:15%;width:80%;margin:30% 10%;position:relative;z-index:100;display:table;border-radius:50px;background-color:#e5e5e5;background-color:rgba(0,0,0,.75);transition:opacity .5s}.presentation .autoplay-overlay .overlay-msg{position:relative;display:table-cell;text-align:center;vertical-align:middle;color:#fff}.presentation .will-fade{opacity:0}.presentation .do-fade{opacity:1;transition:opacity .5s}#subscribe-email input{width:95%}.comment-subscription-form .subscribe-label{display:inline!important}.jetpack-video-wrapper{margin-bottom:1.6em}.jetpack-video-wrapper>.wp-video,.jetpack-video-wrapper>embed,.jetpack-video-wrapper>iframe,.jetpack-video-wrapper>object{margin-bottom:0}.jetpack-social-navigation ul{display:block;margin:0 0 1.5em;padding:0}.jetpack-social-navigation li{display:inline-block;margin:0;line-height:1}.jetpack-social-navigation a{border:0;height:1em;text-decoration:none;width:1em}.jetpack-social-navigation a:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:Genericons;font-size:1em;font-style:normal;font-weight:400;height:1em;line-height:1;speak:none;text-decoration:inherit;vertical-align:top;width:1em;content:"\f415"}.jetpack-social-navigation a[href*="codepen.io"]:before{content:"\f216"}.jetpack-social-navigation a[href*="digg.com"]:before{content:"\f221"}.jetpack-social-navigation a[href*="dribbble.com"]:before{content:"\f201"}.jetpack-social-navigation a[href*="dropbox.com"]:before{content:"\f225"}.jetpack-social-navigation a[href*="mailto:"]:before{content:"\f410"}.jetpack-social-navigation a[href*="facebook.com"]:before{content:"\f203"}.jetpack-social-navigation a[href*="flickr.com"]:before{content:"\f211"}.jetpack-social-navigation a[href*="foursquare.com"]:before{content:"\f226"}.jetpack-social-navigation a[href*="github.com"]:before{content:"\f200"}.jetpack-social-navigation a[href*="plus.google.com"]:before{content:"\f206"}.jetpack-social-navigation a[href*="instagram.com"]:before{content:"\f215"}.jetpack-social-navigation a[href*="linkedin.com"]:before{content:"\f208"}.jetpack-social-navigation a[href*="path.com"]:before{content:"\f219"}.jetpack-social-navigation a[href*="pinterest.com"]:before{content:"\f210"}.jetpack-social-navigation a[href*="getpocket.com"]:before{content:"\f224"}.jetpack-social-navigation a[href*="polldaddy.com"]:before{content:"\f217"}.jetpack-social-navigation a[href*="reddit.com"]:before{content:"\f222"}.jetpack-social-navigation a[href$="/feed/"]:before{content:"\f413"}.jetpack-social-navigation a[href*="skype:"]:before{content:"\f220"}.jetpack-social-navigation a[href*="spotify.com"]:before{content:"\f515"}.jetpack-social-navigation a[href*="stumbleupon.com"]:before{content:"\f223"}.jetpack-social-navigation a[href*="tumblr.com"]:before{content:"\f214"}.jetpack-social-navigation a[href*="twitch.tv"]:before{content:"\f516"}.jetpack-social-navigation a[href*="twitter.com"]:before{content:"\f202"}.jetpack-social-navigation a[href*="vimeo.com"]:before{content:"\f212"}.jetpack-social-navigation a[href*="vine.co"]:before{content:"\f517"}.jetpack-social-navigation a[href*="wordpress.com"]:before,.jetpack-social-navigation a[href*="wordpress.org"]:before{content:"\f205"}.jetpack-social-navigation a[href*="youtube.com"]:before{content:"\f213"}.tiled-gallery{clear:both;margin:0 0 20px;overflow:hidden}.tiled-gallery img{margin:2px!important}.tiled-gallery .gallery-group{float:right;position:relative}.tiled-gallery .tiled-gallery-item{float:right;margin:0;position:relative;width:inherit}.tiled-gallery .gallery-row{overflow:hidden}.tiled-gallery .tiled-gallery-item a{background:0 0;border:none;color:inherit;margin:0;padding:0;text-decoration:none;width:auto}.tiled-gallery .tiled-gallery-item img,.tiled-gallery .tiled-gallery-item img:hover{background:0 0;border:none;box-shadow:none;max-width:100%;padding:0;vertical-align:middle}.tiled-gallery-caption{background:#eee;background:rgba(255,255,255,.8);color:#333;font-size:13px;font-weight:400;overflow:hidden;padding:10px 0;position:absolute;bottom:0;text-indent:10px;text-overflow:ellipsis;width:100%;white-space:nowrap}.tiled-gallery .tiled-gallery-item-small .tiled-gallery-caption{font-size:11px}.widget-gallery .tiled-gallery-unresized{visibility:hidden;height:0;overflow:hidden}.tiled-gallery .tiled-gallery-item img.grayscale{position:absolute;right:0;top:0}.tiled-gallery .tiled-gallery-item img.grayscale:hover{opacity:0}.tiled-gallery.type-circle .tiled-gallery-item img{border-radius:50%!important}.tiled-gallery.type-circle .tiled-gallery-caption{display:none;opacity:0}.jetpack-display-remote-posts{margin:5px 0 20px}.jetpack-display-remote-posts h4{font-size:90%;margin:5px 0;padding:0}.jetpack-display-remote-posts h4 a{text-decoration:none}.jetpack-display-remote-posts p{margin:0!important;padding:0;line-height:1.4em!important;font-size:90%}.jetpack-display-remote-posts img{max-width:100%}.widget-grofile h4{margin:1em 0 .5em}.widget-grofile ul.grofile-urls{margin-right:0;overflow:hidden}.widget-grofile ul.grofile-accounts li{list-style:none;display:inline}.widget-grofile ul.grofile-accounts li::before{content:""!important}.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite.png);background-repeat:no-repeat;width:16px;height:16px;float:right;margin-left:8px;margin-bottom:8px}.rtl .widget-grofile .grofile-accounts-logo{margin-right:8px;margin-left:0}.grofile-thumbnail{width:500px;max-width:100%}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite-2x.png);background-size:16px 784px}}div[class^=gr_custom_container]{border:1px solid gray;border-radius:10px;padding:10px 5px;background-color:#FFF;color:#000}div[class^=gr_custom_container] a{color:#000}h2[class^=gr_custom_header]{display:none}div[class^=gr_custom_each_container]{width:100%;clear:both;margin-bottom:10px;overflow:auto;padding-bottom:4px;border-bottom:1px solid #aaa}div[class^=gr_custom_book_container]{float:left;overflow:hidden;height:60px;margin-right:4px;width:39px}div[class^=gr_custom_author]{font-size:10px}div[class^=gr_custom_tags]{font-size:10px;color:gray}div[class^=gr_custom_rating]{display:none}.widget_wpcom_social_media_icons_widget ul{list-style-type:none;margin-right:0}.widget_wpcom_social_media_icons_widget li{border:0;display:inline;margin-left:.5em}.widget_wpcom_social_media_icons_widget li a{border:0;text-decoration:none}.widget_wpcom_social_media_icons_widget .genericon{font-family:Genericons}.widget_wpcom_social_media_icons_widget .screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.widget_wpcom_social_media_icons_widget .screen-reader-text:active,.widget_wpcom_social_media_icons_widget .screen-reader-text:focus,.widget_wpcom_social_media_icons_widget .screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.widgets-grid-layout{width:100%}.widgets-grid-layout:after,.widgets-grid-layout:before{content:" ";display:table}.widgets-grid-layout:after{clear:both}.widget-grid-view-image{float:right;max-width:50%}.widget-grid-view-image a{display:block;margin:0 0 4px 2px}.widget-grid-view-image:nth-child(even){float:left}.widget-grid-view-image:nth-child(even) a{margin:0 2px 4px 0}.widgets-grid-layout .widget-grid-view-image img{max-width:100%;height:auto}.widgets-multi-column-grid ul{overflow:hidden;padding:0;margin:0;list-style-type:none}.widgets-multi-column-grid ul li{background:0 0;clear:none;float:right;margin:0 0 -3px -5px;padding:0 0 6px 8px;border:none;list-style-type:none!important}.widgets-multi-column-grid ul li a{background:0 0;margin:0;padding:0;border:0}.widgets-multi-column-grid .avatar{vertical-align:middle}.widgets-list-layout{padding:0;margin:0;list-style-type:none}.widgets-list-layout li:after,.widgets-list-layout li:before{content:"";display:table}.widgets-list-layout li:after{clear:both}.widgets-list-layout li{zoom:1;margin-bottom:1em;list-style-type:none!important}.widgets-list-layout .widgets-list-layout-blavatar{float:right;width:21.276596%;max-width:40px;height:auto}.widgets-list-layout-links{float:left;width:73.404255%}.widgets-list-layout span{opacity:.5}.widgets-list-layout span:hover{opacity:.8}
|
css/jetpack.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
/*!
|
2 |
* Do not modify this file directly. It is concatenated from individual module CSS files.
|
3 |
*/
|
4 |
-
.jp-carousel-wrap *{line-height:inherit}.jp-carousel-overlay{background:#000}div.jp-carousel-fadeaway{position:fixed;bottom:0;z-index:2147483647;width:100%;height:15px}.jp-carousel-next-button span,.jp-carousel-previous-button span{background:url(../modules/carousel/images/arrows.png) center center/200px 126px no-repeat}.jp-carousel-msg{font-family:"Open Sans",sans-serif;font-style:normal;display:inline-block;line-height:19px;padding:11px 15px;font-size:14px;text-align:center;margin:25px 20px 0 2px;background-color:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.jp-carousel-next-button span,.jp-carousel-previous-button span{background-image:url(../modules/carousel/images/arrows-2x.png)}}.jp-carousel-wrap{font-family:"Helvetica Neue",sans-serif!important}.jp-carousel-info{position:absolute;bottom:0;text-align:left!important;-webkit-font-smoothing:subpixel-antialiased!important}.jp-carousel-info ::selection{background:#68c9e8;color:#fff}.jp-carousel-info ::-moz-selection{background:#68c9e8;color:#fff}.jp-carousel-photo-info{position:relative;left:25%;width:50%}.jp-carousel-transitions .jp-carousel-photo-info{transition:400ms ease-out}.jp-carousel-info h2{background:none!important;border:none!important;color:#999;display:block!important;font:400 13px/1.25em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;margin:7px 0 0!important;padding:10px 0 0!important;overflow:hidden;text-align:left;text-shadow:none!important;text-transform:none!important;-webkit-font-smoothing:subpixel-antialiased}.jp-carousel-next-button,.jp-carousel-previous-button{text-indent:-9999px;overflow:hidden;cursor:pointer}.jp-carousel-next-button span,.jp-carousel-previous-button span{position:absolute;top:0;bottom:0;width:82px;zoom:1;filter:alpha(opacity=20);opacity:.2}.jp-carousel-transitions .jp-carousel-next-button span,.jp-carousel-transitions .jp-carousel-previous-button span{transition:500ms opacity ease-out}.jp-carousel-next-button:hover span,.jp-carousel-previous-button:hover span{filter:alpha(opacity=60);opacity:.6}.jp-carousel-next-button span{background-position:-110px center;right:0}.jp-carousel-previous-button span{background-position:-10px center;left:0}.jp-carousel-buttons{margin:-18px -20px 15px;padding:8px 10px;border-bottom:1px solid #222;background:#222;text-align:center}div.jp-carousel-buttons a{border:none!important;color:#999;font:400 11px/1.2em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;padding:5px 2px 5px 0;text-decoration:none!important;text-shadow:none!important;vertical-align:middle;-webkit-font-smoothing:subpixel-antialiased}div.jp-carousel-buttons a:hover{color:#68c9e8;border:none!important}.jp-carousel-transitions div.jp-carousel-buttons a:hover{transition:none!important}.jp-carousel-next-button,.jp-carousel-previous-button,.jp-carousel-slide,.jp-carousel-slide img{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.jp-carousel-slide{position:fixed;width:0;bottom:0;background-color:#000;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px}.jp-carousel-slide.selected{position:absolute!important;filter:alpha(opacity=100);opacity:1}.jp-carousel-slide{filter:alpha(opacity=25);opacity:.25}.jp-carousel-slide img{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;background:none!important;border:none!important;padding:0!important;box-shadow:0 2px 8px rgba(0,0,0,.1);zoom:1}.jp-carousel-transitions .jp-carousel-slide{transition:opacity 400ms linear}.jp-carousel-close-hint{color:#999;cursor:default;letter-spacing:0!important;padding:.35em 0 0;position:absolute;text-align:left;width:90%}.jp-carousel-transitions .jp-carousel-close-hint{transition:color 200ms linear}.jp-carousel-close-hint span{cursor:pointer;background-color:#000;background-color:rgba(0,0,0,.8);display:block;height:22px;font:400 24px/1 "Helvetica Neue",sans-serif!important;line-height:22px;margin:0 0 0 .4em;text-align:center;vertical-align:middle;width:22px;border-radius:4px}.jp-carousel-transitions .jp-carousel-close-hint span{transition:border-color 200ms linear}.jp-carousel-close-hint:hover{cursor:default;color:#fff}.jp-carousel-close-hint:hover span{border-color:#fff}a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background:url(../modules/carousel/images/carousel-sprite.png?5) 0 0/16px 200px no-repeat}div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{margin:0 14px 0 0!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#303030;padding-right:8px!important;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;margin:0 2px 0 -12px!important}div.jp-carousel-buttons a.jp-carousel-reblog,div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{background-position:6px -36px;padding-right:auto!important;padding-left:26px!important;color:#999}div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -156px;padding-left:19px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{cursor:default}div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:6px -56px;color:#68c9e8}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background-image:url(../modules/carousel/images/carousel-sprite-2x.png?5)}}div#carousel-reblog-box{background:#222;padding:3px 0 0;display:none;margin:5px auto 0;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.9);height:74px;width:565px}#carousel-reblog-box textarea{background:#999;font:13px/1.4 "Helvetica Neue",sans-serif!important;color:#444;padding:3px 6px;width:370px;height:48px;float:left;margin:6px 9px 0;border:1px solid #666;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:2px}#carousel-reblog-box textarea:focus{background:#ccc;color:#222}#carousel-reblog-box label{color:#aaa;font-size:11px;padding-right:2px;padding-left:2px;display:inline;font-weight:400}#carousel-reblog-box select{width:110px;padding:0;font-size:12px;font-family:"Helvetica Neue",sans-serif!important;background:#333;color:#eee;border:1px solid #444;margin-top:5px}#carousel-reblog-box .submit,#wrapper #carousel-reblog-box p.response{float:left;width:154px;padding-top:0;padding-left:1px;overflow:hidden;height:34px;margin:3px 0 0 2px!important}#wrapper #carousel-reblog-box p.response{font-size:13px;clear:none;padding-left:2px;height:34px;color:#aaa}#carousel-reblog-box input#carousel-reblog-submit,#jp-carousel-comment-form-button-submit{font:13px/24px "Helvetica Neue",sans-serif!important;margin-top:8px;padding:0 10px!important;border-radius:1em;height:24px;color:#333;cursor:pointer;font-weight:400;background:#aaa;border:1px solid #444}#carousel-reblog-box input#carousel-reblog-submit:hover,#jp-carousel-comment-form-button-submit:hover{background:#ccc}#carousel-reblog-box .canceltext{color:#aaa;font-size:11px;line-height:24px}#carousel-reblog-box .canceltext a{color:#fff}.jp-carousel-titleanddesc{border-top:1px solid #222;color:#999;font-size:15px;padding-top:24px;margin-bottom:20px;font-weight:400}.jp-carousel-titleanddesc-title{font:300 1.5em/1.1 "Helvetica Neue",sans-serif!important;text-transform:none!important;color:#fff;margin:0 0 15px;padding:0}.jp-carousel-titleanddesc-desc p{color:#999;line-height:1.4;margin-bottom:.75em}.jp-carousel-comments p a,.jp-carousel-info h2 a,.jp-carousel-titleanddesc p a{color:#fff!important;border:none!important;text-decoration:underline!important;font-weight:400!important;font-style:normal!important}.jp-carousel-titleanddesc p b,.jp-carousel-titleanddesc p strong{font-weight:700;color:#999}.jp-carousel-titleanddesc p em,.jp-carousel-titleanddesc p i{font-style:italic;color:#999}.jp-carousel-comments p a:hover,.jp-carousel-info h2 a:hover,.jp-carousel-titleanddesc p a:hover{color:#68c9e8!important}.jp-carousel-titleanddesc p:empty{display:none}.jp-carousel-left-column-wrapper h1:after,.jp-carousel-left-column-wrapper h1:before,.jp-carousel-photo-info h1:after,.jp-carousel-photo-info h1:before{content:none!important}.jp-carousel-image-meta{background:#111;border:1px solid #222;color:#fff;font:12px/1.4 "Helvetica Neue",sans-serif!important;overflow:hidden;padding:18px 20px;width:209px!important}.jp-carousel-image-meta h5,.jp-carousel-image-meta li{font-family:"Helvetica Neue",sans-serif!important;position:inherit!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;background:none!important;border:none!important;font-weight:400!important;line-height:1.3em!important}.jp-carousel-image-meta ul{margin:0!important;padding:0!important;list-style:none!important}.jp-carousel-image-meta li{width:48%!important;float:left!important;margin:0 2% 15px 0!important;color:#fff!important;font-size:13px!important}.jp-carousel-image-meta h5{color:#999!important;text-transform:uppercase!important;font-size:10px!important;margin:0 0 2px!important;letter-spacing:.1em!important}a.jp-carousel-image-download{padding-left:23px;display:inline-block;clear:both;color:#999;line-height:1;font-weight:400;font-size:13px;text-decoration:none;background-position:0 -82px}a.jp-carousel-image-download span.photo-size{font-size:11px;border-radius:1em;margin-left:2px;display:inline-block}a.jp-carousel-image-download span.photo-size-times{padding:0 1px 0 2px}a.jp-carousel-image-download:hover{background-position:0 -122px;color:#68c9e8;border:none!important}.jp-carousel-image-map{position:relative;margin:-20px -20px 20px;border-bottom:1px solid rgba(255,255,255,.17);height:154px}.jp-carousel-image-map img.gmap-main{border-top-left-radius:6px;border-right:1px solid rgba(255,255,255,.17)}.jp-carousel-image-map div.gmap-topright{width:94px;height:154px;position:absolute;top:0;right:0}.jp-carousel-image-map div.imgclip{overflow:hidden;border-top-right-radius:6px}.jp-carousel-image-map div.gmap-topright img{margin-left:-40px}.jp-carousel-image-map img.gmap-bottomright{position:absolute;top:96px;right:0}.jp-carousel-comments{font:15px/1.7 "Helvetica Neue",sans-serif!important;font-weight:400;background:none}.jp-carousel-comments p a:active,.jp-carousel-comments p a:focus,.jp-carousel-comments p a:hover{color:#68c9e8!important}.jp-carousel-comment{background:none;color:#999;margin-bottom:20px;clear:left;overflow:auto;width:100%}.jp-carousel-comment p{color:#999!important}.jp-carousel-comment .comment-author{font-size:13px;font-weight:400;padding:0;width:auto;display:inline;float:none;border:none;margin:0}.jp-carousel-comment .comment-author a{color:#fff}.jp-carousel-comment .comment-gravatar{float:left}.jp-carousel-comment .comment-content{border:none;margin-left:85px;padding:0}.jp-carousel-comment .avatar{margin:0 20px 0 0;border-radius:4px;border:none!important;padding:0!important;background-color:transparent!important}.jp-carousel-comment .comment-date{color:#999;margin-top:4px;font-size:11px;display:inline;float:right}#jp-carousel-comment-form{margin:0 0 10px!important;float:left;width:100%}textarea#jp-carousel-comment-form-comment-field{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:15px/1.4 "Helvetica Neue",sans-serif!important;width:100%;padding:10px 10px 5px;margin:0;float:none;height:147px;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:3px;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box}textarea#jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#555}textarea#jp-carousel-comment-form-comment-field:focus{background:#ccc;color:#222}textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#aaa}#jp-carousel-comment-form-spinner{color:#fff;margin:22px 0 0 10px;display:block;width:20px;height:20px;float:left}#jp-carousel-comment-form-submit-and-info-wrapper{display:none;overflow:hidden;width:100%}#jp-carousel-comment-form-commenting-as input{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:13px/1.4 "Helvetica Neue",sans-serif!important;padding:3px 6px;float:left;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:2px;width:285px}#jp-carousel-comment-form-commenting-as input:focus{background:#ccc;color:#222}#jp-carousel-comment-form-commenting-as p{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:22px 0 0;float:left}#jp-carousel-comment-form-commenting-as fieldset{float:left;border:none;margin:20px 0 0;padding:0;clear:both}#jp-carousel-comment-form-commenting-as label{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:0 20px 3px 0;float:left;width:100px}#jp-carousel-comment-form-button-submit{margin-top:20px;float:right}#jp-carousel-comment-form-container,#js-carousel-comment-form-container{margin-bottom:15px;overflow:auto;width:100%}#jp-carousel-comment-post-results{display:none;overflow:auto;width:100%}#jp-carousel-comment-post-results span{display:block;text-align:center;margin-top:20px;width:100%;overflow:auto;padding:1em 0;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.7);border-radius:2px;font:13px/1.4 "Helvetica Neue",sans-serif!important;border:1px solid rgba(255,255,255,.17);box-shadow:inset 0 0 5px 5px rgba(0,0,0,1)}.jp-carousel-comment-post-error{color:#DF4926}#jp-carousel-comments-closed{display:none;color:#999}#jp-carousel-comments-loading{font:400 15px/1.7 "Helvetica Neue",sans-serif!important;display:none;color:#999;text-align:left;margin-bottom:20px}.jp-carousel-light .jp-carousel-overlay{background:#fff}.jp-carousel-light .jp-carousel-next-button:hover span,.jp-carousel-light .jp-carousel-previous-button:hover span{opacity:.8}.jp-carousel-light .jp-carousel-close-hint:hover,.jp-carousel-light .jp-carousel-titleanddesc div{color:#000!important}.jp-carousel-light .jp-carousel-comment .comment-author a,.jp-carousel-light .jp-carousel-comments p a,.jp-carousel-light .jp-carousel-info h2 a,.jp-carousel-light .jp-carousel-titleanddesc p a{color:#1e8cbe!important}.jp-carousel-light .jp-carousel-comment .comment-author a:hover,.jp-carousel-light .jp-carousel-comments p a:hover,.jp-carousel-light .jp-carousel-info h2 a:hover,.jp-carousel-light .jp-carousel-titleanddesc p a:hover{color:#f1831e!important}.jp-carousel-light .jp-carousel-comment,.jp-carousel-light .jp-carousel-comment p,.jp-carousel-light .jp-carousel-info h2,.jp-carousel-light .jp-carousel-titleanddesc,.jp-carousel-light .jp-carousel-titleanddesc p,.jp-carousel-light .jp-carousel-titleanddesc p b,.jp-carousel-light .jp-carousel-titleanddesc p em,.jp-carousel-light .jp-carousel-titleanddesc p i,.jp-carousel-light .jp-carousel-titleanddesc p strong,.jp-carousel-light div.jp-carousel-buttons a{color:#666}.jp-carousel-light .jp-carousel-buttons{border-bottom-color:#f0f0f0;background:#f5f5f5}.jp-carousel-light div.jp-carousel-buttons a:hover{text-decoration:none;color:#f1831e}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog,.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:4px -56px;padding-left:24px!important}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#2ea2cc;color:#fff}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -176px}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-position:5px -36px}.jp-carousel-light div#carousel-reblog-box{background:#eee;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd}.jp-carousel-light #carousel-reblog-box textarea{color:#666;border:1px solid #cfcfcf;background:#fff}.jp-carousel-light #carousel-reblog-box .canceltext{color:#888}.jp-carousel-light #carousel-reblog-box .canceltext a{color:#666}.jp-carousel-light #carousel-reblog-box select{background:#eee;color:#333;border:1px solid #aaa}#jp-carousel-comment-form-button-submit,.jp-carousel-light #carousel-reblog-box input#carousel-reblog-submit{color:#333;background:#fff;border:1px solid #aaa}.jp-carousel-light .jp-carousel-image-meta{background:#fafafa;border:1px solid #eee;border-top-color:#f5f5f5;border-left-color:#f5f5f5;color:#333}.jp-carousel-light .jp-carousel-image-meta li{color:#000!important}.jp-carousel-light .jp-carousel-close-hint{color:#ccc}.jp-carousel-light .jp-carousel-close-hint span{background-color:#fff;border-color:#ccc}.jp-carousel-light #jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#aaa}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus{color:#333}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#ddd}.jp-carousel-light a.jp-carousel-image-download{background-position:0 -122px}.jp-carousel-light a.jp-carousel-image-download:hover{background-position:0 -122px;color:#f1831e}.jp-carousel-light textarea#jp-carousel-comment-form-comment-field{background:#fbfbfb;color:#333;border:1px solid #dfdfdf;box-shadow:inset 2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input{background:#fbfbfb;border:1px solid #dfdfdf;color:#333;box-shadow:inset 2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input:focus{background:#fbfbfb;color:#333}.jp-carousel-light #jp-carousel-comment-post-results span{background:#f7f7f7;border:1px solid #dfdfdf;box-shadow:inset 0 0 5px rgba(0,0,0,.05)}.jp-carousel-light .jp-carousel-slide{background-color:#fff}.jp-carousel-light .jp-carousel-titleanddesc{border-top:1px solid #eee}@media only screen and (max-width:760px){.jp-carousel-info{margin:0 10px!important}.jp-carousel-buttons,.jp-carousel-next-button,.jp-carousel-previous-button{display:none!important}.jp-carousel-image-meta{float:none!important;width:100%!important;-moz-box-sizing:border-box;box-sizing:border-box}.jp-carousel-close-hint{font-weight:800!important;font-size:26px!important;position:fixed!important;top:-10px}.jp-carousel-slide img{filter:alpha(opacity=100);opacity:1}.jp-carousel-wrap{background-color:#000}.jp-carousel-fadeaway{display:none}#jp-carousel-comment-form-container{display:none!important}.jp-carousel-titleanddesc{padding-top:0!important;border:none!important}.jp-carousel-titleanddesc-title{font-size:1em!important}.jp-carousel-left-column-wrapper{padding:0;width:100%!important}.jp-carousel-photo-info{left:0!important;width:100%!important}}.contact-form .clear-form{clear:both}.contact-form input[type=email],.contact-form input[type=text]{width:300px;max-width:98%;margin-bottom:13px}.contact-form select{margin-bottom:13px}.contact-form textarea{height:200px;width:80%;float:none;margin-bottom:13px}.contact-form input[type=checkbox],.contact-form input[type=radio]{float:none;margin-bottom:13px}.contact-form label{margin-bottom:3px;float:none;font-weight:700;display:block}.contact-form label.checkbox,.contact-form label.radio{margin-bottom:3px;float:none;font-weight:700;display:inline-block}.contact-form label span{color:#AAA;margin-left:4px;font-weight:400}.contact-form-submission{margin-bottom:4em;padding:1.5em 1em}.contact-form-submission p{margin:0 auto}.form-errors .form-error-message{color:red}.textwidget .contact-form input[type=email],.textwidget .contact-form input[type=text],.textwidget .contact-form textarea{width:250px;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}#jetpack-check-feedback-spam{margin:1px 8px 0 0}.jetpack-check-feedback-spam-spinner{display:inline-block;margin-top:7px}.infinite-loader{color:#000;display:block;height:28px;text-indent:-9999px}#infinite-handle span{background:#333;border-radius:1px;color:#eee;cursor:pointer;font-size:13px;padding:6px 16px}#infinite-handle span button,#infinite-handle span button:focus,#infinite-handle span button:hover{display:inline;position:static;padding:0;margin:0;border:none;line-height:inherit;background:0 0;color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}#infinite-handle span button::-moz-focus-inner{margin:0;padding:0;border:none}@media (max-width:800px){#infinite-handle span:before{display:none}#infinite-handle span{display:block}}#infinite-footer{position:fixed;bottom:-50px;left:0;width:100%}#infinite-footer a{text-decoration:none}#infinite-footer .blog-credits a:hover,#infinite-footer .blog-info a:hover{color:#444;text-decoration:underline}#infinite-footer .container{background:rgba(255,255,255,.8);border-color:#ccc;border-color:rgba(0,0,0,.1);border-style:solid;border-width:1px 0 0;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 auto;overflow:hidden;padding:1px 20px;width:780px}#infinite-footer .blog-credits,#infinite-footer .blog-info{-moz-box-sizing:border-box;box-sizing:border-box;line-height:25px}#infinite-footer .blog-info{float:left;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:40%}#infinite-footer .blog-credits{font-weight:400;float:right;width:60%}#infinite-footer .blog-info a{color:#111;font-size:14px;font-weight:700}#infinite-footer .blog-credits{color:#888;font-size:12px;text-align:right}#infinite-footer .blog-credits a{color:#666}.infinity-end.neverending #infinite-footer{display:none}@media (max-width:640px){#infinite-footer .container{-moz-box-sizing:border-box;box-sizing:border-box;width:100%}#infinite-footer .blog-info{width:30%}#infinite-footer .blog-credits{width:70%}#infinite-footer .blog-credits,#infinite-footer .blog-info a{font-size:10px}}@media (max-width:640px){#infinite-footer{position:static}}#wpadminbar li#wp-admin-bar-admin-bar-likes-widget{width:61px;overflow:hidden}#wpadminbar iframe.admin-bar-likes-widget{width:61px;height:28px;min-height:28px;border-width:0;position:absolute;top:0}div.jetpack-likes-widget-wrapper{width:100%;min-height:50px;position:relative}div.jetpack-likes-widget-wrapper .sd-link-color{font-size:12px}div.jetpack-likes-widget-wrapper.slim-likes-widget{width:1px;min-height:0}#likes-other-gravatars{display:none;position:absolute;padding:10px 10px 12px;background-color:#2e4453;border-width:0;box-shadow:0 0 10px #2e4453;box-shadow:0 0 10px rgba(46,68,83,.6);min-width:130px;z-index:1000}#likes-other-gravatars *{line-height:normal}#likes-other-gravatars .likes-text{color:#fff;font-size:12px;padding-bottom:8px}#likes-other-gravatars li,#likes-other-gravatars ul{margin:0;padding:0;text-indent:0;list-style-type:none}#likes-other-gravatars li::before{content:""}#likes-other-gravatars ul.wpl-avatars{overflow:auto;display:block;max-height:190px}#likes-other-gravatars ul.wpl-avatars li{width:32px;height:32px;float:left;margin:0 5px 5px 0}#likes-other-gravatars ul.wpl-avatars li a{margin:0 2px 0 0;border-bottom:none!important;display:block}#likes-other-gravatars ul.wpl-avatars li a img{background:0 0;border:none;margin:0!important;padding:0!important;position:static}div.sd-box{border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.13)}.comment-likes-widget,.entry-content .post-likes-widget,.post-likes-widget{margin:0;border-width:0;display:block}.post-likes-widget-placeholder{margin:0;border-width:0;position:relative}.post-likes-widget-placeholder .button{display:none}.post-likes-widget-placeholder .loading{color:#999;font-size:12px}.slim-likes-widget .post-likes-widget{width:auto;float:none}div.sharedaddy.sd-like-enabled .sd-like h3{display:none}div.sharedaddy.sd-like-enabled .sd-like .post-likes-widget{width:100%;float:none;position:absolute;top:0}.comment-likes-widget{width:100%}.pd-rating{display:block!important}.sd-gplus .sd-title{display:none}#jp-relatedposts{display:none;padding-top:1em;margin:1em 0;position:relative;clear:both}.jp-relatedposts:after{content:'';display:block;clear:both}#jp-relatedposts h3.jp-relatedposts-headline{margin:0 0 1em;display:inline-block;float:left;font-size:9pt;font-weight:700;font-family:inherit}#jp-relatedposts h3.jp-relatedposts-headline em:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.2);margin-bottom:1em}#jp-relatedposts h3.jp-relatedposts-headline em{font-style:normal;font-weight:700}#jp-relatedposts .jp-relatedposts-items{clear:left}#jp-relatedposts .jp-relatedposts-items-visual{margin-right:-20px}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{float:left;width:33%;margin:0 0 1em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post{padding-right:20px;filter:alpha(opacity=80);-moz-opacity:.8;opacity:.8}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4){clear:both}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover{filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items p,#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{font-size:14px;line-height:20px;margin:0}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs{position:relative}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay{position:absolute;top:0;bottom:0;left:0;right:0;display:block;border-bottom:0}#jp-relatedposts .jp-relatedposts-items p{margin-bottom:0}#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{text-transform:none;margin:0;font-family:inherit;display:block;max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a{font-size:inherit;font-weight:400;text-decoration:none;filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span{display:block;max-width:90%;overflow:hidden;text-overflow:ellipsis}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span{max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{opacity:.6}#jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt,.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{display:none}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt{overflow:hidden}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span{margin-bottom:1em}@media only screen and (max-width:640px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:50%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n){clear:left}#jp-relatedposts .jp-relatedposts-items-visual{margin-right:20px}}@media only screen and (max-width:320px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:100%;clear:both;margin:0 0 1em}}#jp-post-flair{padding-top:.5em}#content div.sharedaddy,#main div.sharedaddy,div.sharedaddy{clear:both}div.sharedaddy h3.sd-title{margin:0 0 1em;display:inline-block;line-height:1.2;font-size:9pt;font-weight:700}div.sharedaddy h3.sd-title:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;margin-bottom:1em}body.highlander-light h3.sd-title:before{border-top:1px solid rgba(0,0,0,.2)}body.highlander-dark h3.sd-title:before{border-top:1px solid rgba(255,255,255,.4)}.sd-content ul{padding:0!important;margin:0 0 .7em!important;list-style:none!important}.sd-content ul li{display:inline-block}.sd-block.sd-gplus{margin:0 0 .5em}.sd-gplus .sd-content{font-size:12px}#sharing_email .sharing_send,.sd-content ul li .option a.share-ustom,.sd-content ul li a.sd-button,.sd-content ul li.advanced a.share-more,.sd-content ul li.preview-item div.option.option-smart-off a,.sd-social-icon .sd-content ul li a.sd-button,.sd-social-icon-text .sd-content ul li a.sd-button,.sd-social-official .sd-content>ul>li .digg_button >a,.sd-social-official .sd-content>ul>li>a.sd-button,.sd-social-text .sd-content ul li a.sd-button{text-decoration:none!important;display:inline-block;margin:0 5px 5px 0;font-size:12px;font-family:"Open Sans",sans-serif;font-weight:400;border-radius:3px;color:#777!important;background:#f8f8f8;border:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.08);text-shadow:none;line-height:23px;padding:1px 8px 0 5px}.sd-content ul li .option a.share-ustom span,.sd-content ul li a.sd-button>span,.sd-content ul li.advanced a.share-more span,.sd-content ul li.preview-item div.option.option-smart-off a span,.sd-social-icon-text .sd-content ul li a.sd-button>span,.sd-social-official .sd-content>ul>li .digg_button >a span,.sd-social-official .sd-content>ul>li>a.sd-button span,.sd-social-text .sd-content ul li a.sd-button span{line-height:23px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button,.sd-social-official .sd-content>ul>li .digg_button>a,.sd-social-official .sd-content>ul>li>a.sd-button{line-height:17px;box-shadow:none;vertical-align:top}.sd-social-official .sd-content ul li a.sd-button>span{line-height:17px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a:before,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button:before,.sd-social-official .sd-content>ul>li .digg_button>a:before,.sd-social-official .sd-content>ul>li>a.sd-button:before{margin-bottom:-1px}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon .sd-content ul li a.sd-button:hover,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:hover,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li .digg_button>a:hover,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-official .sd-content>ul>li>a.sd-button:hover,.sd-social-text .sd-content ul li a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:hover{color:#555;background:#fafafa;border:1px solid #999}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:active{box-shadow:inset 0 1px 0 rgba(0,0,0,.16)}.sd-content ul li a.sd-button:before{display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:400 18px/1 social-logos;vertical-align:top;text-align:center}.sd-social-icon-text ul li a.sd-button:before{position:relative;top:2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-content ul li a.sd-button:before{position:relative;top:2px}}.sd-social-official ul li a.sd-button:before{position:relative;top:-2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-official ul li a.sd-button:before{top:0}}.sd-content ul li{margin:0!important;padding:0}.sd-content ul li.preview-item a.sd-button span,.sd-social-icon-text .sd-content ul li a span,.sd-social-official .sd-content ul li a.sd-button span{margin-left:3px}.sd-content ul li.preview-item.no-icon a.sd-button span{margin-left:0}.sd-content ul li.no-icon a:before,.sd-social-text .sd-content ul li a:before{display:none}body .sd-content ul li.share-custom.no-icon a span,body .sd-social-text .sd-content ul li.share-custom a span{background-image:none;background-position:-500px -500px!important;background-repeat:no-repeat!important;padding-left:0;height:0;line-height:inherit}.sd-social-icon .sd-content ul li a.share-more{position:relative;top:-4px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-icon .sd-content ul li a.share-more{top:2px}}@-moz-document url-prefix(){.sd-social-icon .sd-content ul li a.share-more{top:2px}}.sd-social-icon .sd-content ul li a.share-more span{margin-left:3px}.sd-content ul li.share-print div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-print a:before,.sd-social-icon-text .sd-content li.share-print a:before,.sd-social-official .sd-content li.share-print a:before,.sd-social-text .sd-content ul li.share-print a:before{content:'\f469'}.sd-content ul li.share-email div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-email a:before,.sd-social-icon-text .sd-content li.share-email a:before,.sd-social-official .sd-content li.share-email a:before,.sd-social-text .sd-content ul li.share-email a:before{content:'\f410'}.sd-content ul li.share-linkedin div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-linkedin a:before,.sd-social-icon-text .sd-content li.share-linkedin a:before,.sd-social-text .sd-content ul li.share-linkedin a:before{content:'\f207'}.sd-content ul li.share-twitter div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-twitter a:before,.sd-social-icon-text .sd-content li.share-twitter a:before,.sd-social-text .sd-content ul li.share-twitter a:before{content:'\f202'}.sd-content ul li.share-reddit div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-reddit a:before,.sd-social-icon-text .sd-content li.share-reddit a:before,.sd-social-text .sd-content ul li.share-reddit a:before{content:'\f222'}.sd-content ul li.share-tumblr div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-tumblr a:before,.sd-social-icon-text .sd-content li.share-tumblr a:before,.sd-social-text .sd-content ul li.share-tumblr a:before{content:'\f607'}.sd-content ul li.share-pocket div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pocket a:before,.sd-social-icon-text .sd-content li.share-pocket a:before,.sd-social-text .sd-content ul li.share-pocket a:before{content:'\f224'}.sd-content ul li.share-pinterest div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pinterest a:before,.sd-social-icon-text .sd-content li.share-pinterest a:before,.sd-social-text .sd-content ul li.share-pinterest a:before{content:'\f210'}.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-google-plus-1 a:before,.sd-social-icon-text .sd-content li.share-google-plus-1 a:before,.sd-social-text .sd-content ul li.share-google-plus-1 a:before{content:'\f218'}.sd-content ul li.share-facebook div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-facebook a:before,.sd-social-icon-text .sd-content li.share-facebook a:before,.sd-social-text .sd-content ul li.share-facebook a:before{content:'\f203'}.sd-content ul li.share-press-this div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-press-this a:before,.sd-social-icon-text .sd-content li.share-press-this a:before,.sd-social-official .sd-content li.share-press-this a:before,.sd-social-text .sd-content ul li.share-press-this a:before{content:'\f205'}.sd-social-official .sd-content li.share-press-this a:before{color:#2ba1cb}.sd-content ul li.share-telegram div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-telegram a:before,.sd-social-icon-text .sd-content li.share-telegram a:before,.sd-social-official .sd-content li.share-telegram a:before,.sd-social-text .sd-content ul li.share-telegram a:before{content:'\f606'}.sd-social-official .sd-content li.share-telegram a:before{color:#08c}.sd-content ul li.share-skype div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-skype a:before,.sd-social-icon-text .sd-content li.share-skype a:before,.sd-social-text .sd-content ul li.share-skype a:before{content:'\f220'}.sd-content ul li.advanced a.share-more:before,.sd-social-icon .sd-content ul a.share-more:before,.sd-social-icon-text .sd-content a.share-more:before,.sd-social-official .sd-content a.share-more:before,.sd-social-text .sd-content ul a.share-more:before{content:'\f415'}.sd-social-official .sd-content a.share-more:before{color:#2ba1cb}.sd-content ul li.share-jetpack-whatsapp div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-jetpack-whatsapp a:before,.sd-social-icon-text .sd-content li.share-jetpack-whatsapp a:before,.sd-social-official .sd-content li.share-jetpack-whatsapp a:before,.sd-social-text .sd-content ul li.share-jetpack-whatsapp a:before{content:'\f608'}.sd-social-official .sd-content li.share-jetpack-whatsapp a:before{color:#43d854}.sd-social-icon .sd-content ul li[class*=share-].share-jetpack-whatsapp a.sd-button{background:#43d854;color:#fff!important}.sd-social .sd-button .share-count{background:#2ea2cc;color:#fff;border-radius:10px;display:inline-block;text-align:center;font-size:10px;padding:1px 3px;line-height:1}.sd-social-official .sd-content ul,.sd-social-official .sd-content ul li{line-height:25px!important}.sd-social-official .sd-content>ul>li>a.sd-button span{line-height:1}.sd-social-official .sd-content ul:after{content:".";display:block;height:0;clear:both;visibility:hidden}.sd-social-official .sd-content li.share-press-this a{margin:0 0 5px}.sd-social-official .sd-content ul>li{display:block;float:left;margin:0 10px 5px 0!important;height:25px}.sd-social-official .fb-share-button>span{vertical-align:top!important}.sd-social-official .sd-content .pocket_button iframe{width:98px}.googleplus1_button .g-plus{vertical-align:top!important}.reddit_button iframe{margin-top:1px}.googleplus1_button iframe,.linkedin_button>span,.pinterest_button,.pocket_button iframe,.twitter_button{margin:0!important}.sd-social-official .sd-content .share-skype{width:55px}body .sd-social-official li a.share-more,body .sd-social-official li.share-custom a,body .sd-social-official li.share-digg a,body .sd-social-official li.share-email a,body .sd-social-official li.share-press-this a,body .sd-social-official li.share-print{position:relative;top:0}body .sd-social-icon .sd-content li.share-custom>a{padding:2px 3px 0;position:relative;top:4px}body .sd-content ul li.share-custom a.share-icon span,body .sd-social-icon .sd-content li.share-custom a span,body .sd-social-icon-text .sd-content li.share-custom a span,body .sd-social-official .sd-content li.share-custom a span,body .sd-social-text .sd-content li.share-custom a span{background-size:16px 16px;background-repeat:no-repeat;margin-left:0;padding:0 0 0 19px;display:inline-block;height:16px;line-height:16px}body .sd-social-icon .sd-content li.share-custom a span{width:0;padding-left:16px!important}.sharing-hidden .inner{position:absolute;z-index:2;border:1px solid #ccc;padding:10px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);border-radius:2px;margin-top:5px;max-width:400px}.sharing-hidden .inner ul{margin:0!important}.sd-social-official .sd-content .sharing-hidden ul>li.share-end{clear:both;margin:0!important;height:0!important}.sharing-hidden .inner:after,.sharing-hidden .inner:before{position:absolute;z-index:1;top:-8px;left:20px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid #ccc;content:"";display:block}.sharing-hidden .inner:after{z-index:2;top:-7px;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid #fff}.sharing-hidden ul{margin:0}.sd-social-icon .sd-content ul li[class*=share-] a,.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a{border-radius:50%;-webkit-border-radius:50%;border:0;box-shadow:none;padding:7px;position:relative;top:-2px;line-height:1;width:auto;height:auto;margin-bottom:0}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button>span,.sd-social-icon .sd-content ul li[class*=share-] div.option a span{line-height:1}.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a:hover{border:none;opacity:.6}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button:before{top:1px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button.share-custom{padding:8px 8px 6px;top:5px}.sd-social-icon .sd-content ul li a.sd-button.share-more{margin-left:10px}.sd-social-icon .sd-content ul li:first-child a.sd-button.share-more{margin-left:0}.sd-social-icon .sd-button span.share-count{position:absolute;bottom:0;right:0;border-radius:0;background:#555;font-size:9px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button{background:#e9e9e9;margin-top:2px;text-indent:0}.sd-social-icon .sd-content ul li[class*=share-].share-tumblr a.sd-button{background:#2c4762;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-facebook a.sd-button{background:#3b5998;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-twitter a.sd-button{background:#00acee;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pinterest a.sd-button{background:#ca1f27;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-digg a.sd-button{color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-press-this a.sd-button{background:#1e8cbe;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-telegram a.sd-button{background:#08c;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-linkedin a.sd-button{background:#0077b5;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-google-plus-1 a.sd-button{background:#dd4b39;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pocket a.sd-button{background:#ee4056;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-reddit a.sd-button{background:#cee3f8;color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-skype a.sd-button{background:#00AFF0;color:#fff!important}.sharing-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.sharing-screen-reader-text:active,.sharing-screen-reader-text:focus,.sharing-screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#sharing_email{width:342px;position:absolute;z-index:1001;border:1px solid #ccc;padding:15px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);text-align:left}div.sharedaddy.sharedaddy-dark #sharing_email{border-color:#fff}#sharing_email .errors{color:#fff;background-color:#771a09;font-size:12px;padding:5px 8px;line-height:1;margin:10px 0 0}#sharing_email label{font-size:12px;color:#333;font-weight:700;display:block;padding:0 0 4px;text-align:left;text-shadow:none}#sharing_email form{margin:0}#sharing_email input[type=email],#sharing_email input[type=text]{width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #ccc;margin-bottom:1em;background:#fff;font-size:12px;color:#333;max-width:none;padding:1px 3px}#jetpack-source_f_name{display:none!important;position:absolute!important;left:-9000px}#sharing_email .sharing_cancel{padding:0 0 0 1em;font-size:12px;text-shadow:none}#sharing_email .recaptcha{width:312px;height:123px;margin:0 0 1em}.slideshow-window{background-color:#222;border:20px solid #222;border-radius:10px;height:0;margin-bottom:20px;overflow:hidden;padding-top:30px!important;padding-bottom:56.25%!important;position:relative;z-index:1}.slideshow-window.slideshow-white{background-color:#fff;border-color:#fff}.slideshow-window,.slideshow-window *{-moz-box-sizing:content-box;box-sizing:content-box}.slideshow-loading{height:100%;text-align:center;margin:auto}body div.slideshow-window * img{background-color:transparent!important;background-image:none!important;border-width:0!important;display:block;margin:0 auto;max-width:100%;max-height:100%;padding:0!important;position:relative;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%}.slideshow-loading img{vertical-align:middle}.slideshow-slide{display:none;height:100%!important;left:0;margin:auto;position:absolute;text-align:center;top:0;width:100%!important}.slideshow-slide img{vertical-align:middle}.slideshow-line-height-hack{overflow:hidden;width:0;font-size:0}.slideshow-slide-caption{font-size:13px;font-family:"Helvetica Neue",sans-serif;color:#f7f7f7;text-shadow:#222 1px 1px 2px;line-height:25px;height:25px;position:absolute;bottom:5px;left:0;z-index:100;width:100%;text-align:center}.slideshow-controls{z-index:1000;position:absolute;bottom:30px;margin:auto;text-align:center;width:100%;-ms-filter:"alpha(Opacity=50)";opacity:.5;direction:ltr;transition:300ms opacity ease-out}.slideshow-window:hover .slideshow-controls{-ms-filter:"alpha(Opacity=100)";opacity:1}body div div.slideshow-controls a,body div div.slideshow-controls a:hover{border:2px solid rgba(255,255,255,.1)!important;background-color:#000!important;background-color:rgba(0,0,0,.6)!important;background-image:url(../modules/shortcodes/img/slideshow-controls.png)!important;background-repeat:no-repeat;background-size:142px 16px!important;background-position:-34px 8px!important;color:#222!important;margin:0 5px!important;padding:0!important;display:inline-block!important;zoom:1;height:32px!important;width:32px!important;line-height:32px!important;text-align:center!important;-khtml-border-radius:10em!important;border-radius:10em!important;transition:300ms border-color ease-out}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body div div.slideshow-controls a,body div div.slideshow-controls a:hover{background-image:url(../modules/shortcodes/img/slideshow-controls-2x.png)!important}}body div div.slideshow-controls a:hover{border-color:rgba(255,255,255,1)!important}body div div.slideshow-controls a:first-child{background-position:-76px 8px!important}body div div.slideshow-controls a:last-child{background-position:-117px 8px!important}body div div.slideshow-controls a.running,body div div.slideshow-controls a:nth-child(2){background-position:-34px 8px!important}body div div.slideshow-controls a.paused{background-position:9px 8px!important}.slideshow-controls a img{border:50px dotted #f0f}body.presentation-wrapper-fullscreen-parent,html.presentation-wrapper-fullscreen-parent{overflow:hidden!important}.presentation-wrapper-fullscreen-parent #wpadminbar{display:none}.presentation-wrapper-fullscreen,.presentation-wrapper-fullscreen-parent{min-width:100%!important;min-height:100%!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important;margin:0!important;padding:0!important;z-index:10000!important}.presentation-wrapper-fullscreen{background-color:gray;border:none!important}.presentation-wrapper-fullscreen .nav-arrow-left,.presentation-wrapper-fullscreen .nav-arrow-right{z-index:20001}.presentation-wrapper-fullscreen .nav-fullscreen-button{z-index:20002}.presentation-wrapper{margin:20px auto;border:1px solid #e5e5e5;overflow:hidden;line-height:normal}.presentation{position:relative;margin:0;overflow:hidden;outline:0}.presentation,.presentation .step{background-repeat:no-repeat;background-position:center;background-size:100% 100%}.presentation .step.fade:not(.active){opacity:0}.presentation .slide-content{padding:30px}.presentation .nav-arrow-left,.presentation .nav-arrow-right,.presentation .nav-fullscreen-button{position:absolute;width:34px;background-repeat:no-repeat;z-index:2;opacity:0;transition:opacity .25s}.presentation .nav-arrow-left,.presentation .nav-arrow-right{height:100%;background-image:url(../modules/shortcodes/images/slide-nav.png);background-size:450% 61px}.presentation .nav-arrow-left{left:0;background-position:4px 50%}.presentation .nav-arrow-right{right:0;background-position:-120px 50%}.presentation .nav-fullscreen-button{width:32px;height:32px;margin:4px;bottom:0;right:0;z-index:3;background-image:url(../modules/shortcodes/images/expand.png);background-size:100% 100%}.presentation:hover .nav-arrow-left,.presentation:hover .nav-arrow-right{opacity:1}.presentation:hover .nav-fullscreen-button{opacity:.8}.presentation-wrapper-fullscreen .nav-fullscreen-button{background-image:url(../modules/shortcodes/images/collapse.png)}.presentation .autoplay-overlay{height:15%;width:80%;margin:30% 10%;position:relative;z-index:100;display:table;border-radius:50px;background-color:#e5e5e5;background-color:rgba(0,0,0,.75);transition:opacity .5s}.presentation .autoplay-overlay .overlay-msg{position:relative;display:table-cell;text-align:center;vertical-align:middle;color:#fff}.presentation .will-fade{opacity:0}.presentation .do-fade{opacity:1;transition:opacity .5s}#subscribe-email input{width:95%}.comment-subscription-form .subscribe-label{display:inline!important}.jetpack-video-wrapper{margin-bottom:1.6em}.jetpack-video-wrapper>.wp-video,.jetpack-video-wrapper>embed,.jetpack-video-wrapper>iframe,.jetpack-video-wrapper>object{margin-bottom:0}.jetpack-social-navigation ul{display:block;margin:0 0 1.5em;padding:0}.jetpack-social-navigation li{display:inline-block;margin:0;line-height:1}.jetpack-social-navigation a{border:0;height:1em;text-decoration:none;width:1em}.jetpack-social-navigation a:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:Genericons;font-size:1em;font-style:normal;font-weight:400;height:1em;line-height:1;speak:none;text-decoration:inherit;vertical-align:top;width:1em;content:"\f415"}.jetpack-social-navigation a[href*="codepen.io"]:before{content:"\f216"}.jetpack-social-navigation a[href*="digg.com"]:before{content:"\f221"}.jetpack-social-navigation a[href*="dribbble.com"]:before{content:"\f201"}.jetpack-social-navigation a[href*="dropbox.com"]:before{content:"\f225"}.jetpack-social-navigation a[href*="mailto:"]:before{content:"\f410"}.jetpack-social-navigation a[href*="facebook.com"]:before{content:"\f203"}.jetpack-social-navigation a[href*="flickr.com"]:before{content:"\f211"}.jetpack-social-navigation a[href*="foursquare.com"]:before{content:"\f226"}.jetpack-social-navigation a[href*="github.com"]:before{content:"\f200"}.jetpack-social-navigation a[href*="plus.google.com"]:before{content:"\f206"}.jetpack-social-navigation a[href*="instagram.com"]:before{content:"\f215"}.jetpack-social-navigation a[href*="linkedin.com"]:before{content:"\f208"}.jetpack-social-navigation a[href*="path.com"]:before{content:"\f219"}.jetpack-social-navigation a[href*="pinterest.com"]:before{content:"\f210"}.jetpack-social-navigation a[href*="getpocket.com"]:before{content:"\f224"}.jetpack-social-navigation a[href*="polldaddy.com"]:before{content:"\f217"}.jetpack-social-navigation a[href*="reddit.com"]:before{content:"\f222"}.jetpack-social-navigation a[href$="/feed/"]:before{content:"\f413"}.jetpack-social-navigation a[href*="skype:"]:before{content:"\f220"}.jetpack-social-navigation a[href*="spotify.com"]:before{content:"\f515"}.jetpack-social-navigation a[href*="stumbleupon.com"]:before{content:"\f223"}.jetpack-social-navigation a[href*="tumblr.com"]:before{content:"\f214"}.jetpack-social-navigation a[href*="twitch.tv"]:before{content:"\f516"}.jetpack-social-navigation a[href*="twitter.com"]:before{content:"\f202"}.jetpack-social-navigation a[href*="vimeo.com"]:before{content:"\f212"}.jetpack-social-navigation a[href*="vine.co"]:before{content:"\f517"}.jetpack-social-navigation a[href*="wordpress.com"]:before,.jetpack-social-navigation a[href*="wordpress.org"]:before{content:"\f205"}.jetpack-social-navigation a[href*="youtube.com"]:before{content:"\f213"}.tiled-gallery{clear:both;margin:0 0 20px;overflow:hidden}.tiled-gallery img{margin:2px!important}.tiled-gallery .gallery-group{float:left;position:relative}.tiled-gallery .tiled-gallery-item{float:left;margin:0;position:relative;width:inherit}.tiled-gallery .gallery-row{overflow:hidden}.tiled-gallery .tiled-gallery-item a{background:0 0;border:none;color:inherit;margin:0;padding:0;text-decoration:none;width:auto}.tiled-gallery .tiled-gallery-item img,.tiled-gallery .tiled-gallery-item img:hover{background:0 0;border:none;box-shadow:none;max-width:100%;padding:0;vertical-align:middle}.tiled-gallery-caption{background:#eee;background:rgba(255,255,255,.8);color:#333;font-size:13px;font-weight:400;overflow:hidden;padding:10px 0;position:absolute;bottom:0;text-indent:10px;text-overflow:ellipsis;width:100%;white-space:nowrap}.tiled-gallery .tiled-gallery-item-small .tiled-gallery-caption{font-size:11px}.widget-gallery .tiled-gallery-unresized{visibility:hidden;height:0;overflow:hidden}.tiled-gallery .tiled-gallery-item img.grayscale{position:absolute;left:0;top:0}.tiled-gallery .tiled-gallery-item img.grayscale:hover{opacity:0}.tiled-gallery.type-circle .tiled-gallery-item img{border-radius:50%!important}.tiled-gallery.type-circle .tiled-gallery-caption{display:none;opacity:0}.jetpack-display-remote-posts{margin:5px 0 20px}.jetpack-display-remote-posts h4{font-size:90%;margin:5px 0;padding:0}.jetpack-display-remote-posts h4 a{text-decoration:none}.jetpack-display-remote-posts p{margin:0!important;padding:0;line-height:1.4em!important;font-size:90%}.jetpack-display-remote-posts img{max-width:100%}.widget-grofile h4{margin:1em 0 .5em}.widget-grofile ul.grofile-urls{margin-left:0;overflow:hidden}.widget-grofile ul.grofile-accounts li{list-style:none;display:inline}.widget-grofile ul.grofile-accounts li::before{content:""!important}.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite.png);background-repeat:no-repeat;width:16px;height:16px;float:left;margin-right:8px;margin-bottom:8px}.rtl .widget-grofile .grofile-accounts-logo{margin-left:8px;margin-right:0}.grofile-thumbnail{width:500px;max-width:100%}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite-2x.png);background-size:16px 784px}}div[class^=gr_custom_container]{border:1px solid gray;border-radius:10px;padding:10px 5px;background-color:#FFF;color:#000}div[class^=gr_custom_container] a{color:#000}h2[class^=gr_custom_header]{display:none}div[class^=gr_custom_each_container]{width:100%;clear:both;margin-bottom:10px;overflow:auto;padding-bottom:4px;border-bottom:1px solid #aaa}div[class^=gr_custom_book_container]{float:right;overflow:hidden;height:60px;margin-left:4px;width:39px}div[class^=gr_custom_author]{font-size:10px}div[class^=gr_custom_tags]{font-size:10px;color:gray}div[class^=gr_custom_rating]{display:none}.widget_wpcom_social_media_icons_widget ul{list-style-type:none;margin-left:0}.widget_wpcom_social_media_icons_widget li{border:0;display:inline;margin-right:.5em}.widget_wpcom_social_media_icons_widget li a{border:0;text-decoration:none}.widget_wpcom_social_media_icons_widget .genericon{font-family:Genericons}.widget_wpcom_social_media_icons_widget .screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.widget_wpcom_social_media_icons_widget .screen-reader-text:active,.widget_wpcom_social_media_icons_widget .screen-reader-text:focus,.widget_wpcom_social_media_icons_widget .screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.widgets-grid-layout{width:100%}.widgets-grid-layout:after,.widgets-grid-layout:before{content:" ";display:table}.widgets-grid-layout:after{clear:both}.widget-grid-view-image{float:left;max-width:50%}.widget-grid-view-image a{display:block;margin:0 2px 4px 0}.widget-grid-view-image:image:nth-child(even){float:right}.widget-grid-view-image:nth-child(even) a{margin:0 0 4px 2px}.widgets-grid-layout .widget-grid-view-image img{max-width:100%;height:auto}.widgets-multi-column-grid ul{overflow:hidden;padding:0;margin:0;list-style-type:none}.widgets-multi-column-grid ul li{background:0 0;clear:none;float:left;margin:0 -5px -3px 0;padding:0 8px 6px 0;border:none;list-style-type:none!important}.widgets-multi-column-grid ul li a{background:0 0;margin:0;padding:0;border:0}.widgets-multi-column-grid .avatar{vertical-align:middle}.widgets-list-layout{padding:0;margin:0;list-style-type:none}.widgets-list-layout li:after,.widgets-list-layout li:before{content:"";display:table}.widgets-list-layout li:after{clear:both}.widgets-list-layout li{zoom:1;margin-bottom:1em;list-style-type:none!important}.widgets-list-layout .widgets-list-layout-blavatar{float:left;width:21.276596%;max-width:40px;height:auto}.widgets-list-layout-links{float:right;width:73.404255%}.widgets-list-layout span{opacity:.5}.widgets-list-layout span:hover{opacity:.8}
|
1 |
/*!
|
2 |
* Do not modify this file directly. It is concatenated from individual module CSS files.
|
3 |
*/
|
4 |
+
.jp-carousel-wrap *{line-height:inherit}.jp-carousel-overlay{background:#000}div.jp-carousel-fadeaway{position:fixed;bottom:0;z-index:2147483647;width:100%;height:15px}.jp-carousel-next-button span,.jp-carousel-previous-button span{background:url(../modules/carousel/images/arrows.png) center center/200px 126px no-repeat}.jp-carousel-msg{font-family:"Open Sans",sans-serif;font-style:normal;display:inline-block;line-height:19px;padding:11px 15px;font-size:14px;text-align:center;margin:25px 20px 0 2px;background-color:#fff;border-left:4px solid #ffba00;box-shadow:0 1px 1px 0 rgba(0,0,0,.1)}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.jp-carousel-next-button span,.jp-carousel-previous-button span{background-image:url(../modules/carousel/images/arrows-2x.png)}}.jp-carousel-wrap{font-family:"Helvetica Neue",sans-serif!important}.jp-carousel-info{position:absolute;bottom:0;text-align:left!important;-webkit-font-smoothing:subpixel-antialiased!important}.jp-carousel-info ::selection{background:#68c9e8;color:#fff}.jp-carousel-info ::-moz-selection{background:#68c9e8;color:#fff}.jp-carousel-photo-info{position:relative;left:25%;width:50%}.jp-carousel-transitions .jp-carousel-photo-info{transition:400ms ease-out}.jp-carousel-info h2{background:none!important;border:none!important;color:#999;display:block!important;font:400 13px/1.25em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;margin:7px 0 0!important;padding:10px 0 0!important;overflow:hidden;text-align:left;text-shadow:none!important;text-transform:none!important;-webkit-font-smoothing:subpixel-antialiased}.jp-carousel-next-button,.jp-carousel-previous-button{text-indent:-9999px;overflow:hidden;cursor:pointer}.jp-carousel-next-button span,.jp-carousel-previous-button span{position:absolute;top:0;bottom:0;width:82px;zoom:1;filter:alpha(opacity=20);opacity:.2}.jp-carousel-transitions .jp-carousel-next-button span,.jp-carousel-transitions .jp-carousel-previous-button span{transition:500ms opacity ease-out}.jp-carousel-next-button:hover span,.jp-carousel-previous-button:hover span{filter:alpha(opacity=60);opacity:.6}.jp-carousel-next-button span{background-position:-110px center;right:0}.jp-carousel-previous-button span{background-position:-10px center;left:0}.jp-carousel-buttons{margin:-18px -20px 15px;padding:8px 10px;border-bottom:1px solid #222;background:#222;text-align:center}div.jp-carousel-buttons a{border:none!important;color:#999;font:400 11px/1.2em "Helvetica Neue",sans-serif!important;letter-spacing:0!important;padding:5px 2px 5px 0;text-decoration:none!important;text-shadow:none!important;vertical-align:middle;-webkit-font-smoothing:subpixel-antialiased}div.jp-carousel-buttons a:hover{color:#68c9e8;border:none!important}.jp-carousel-transitions div.jp-carousel-buttons a:hover{transition:none!important}.jp-carousel-next-button,.jp-carousel-previous-button,.jp-carousel-slide,.jp-carousel-slide img{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.jp-carousel-slide{position:fixed;width:0;bottom:0;background-color:#000;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px}.jp-carousel-slide.selected{position:absolute!important;filter:alpha(opacity=100);opacity:1}.jp-carousel-slide{filter:alpha(opacity=25);opacity:.25}.jp-carousel-slide img{display:block;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;background:none!important;border:none!important;padding:0!important;box-shadow:0 2px 8px rgba(0,0,0,.1);zoom:1}.jp-carousel-transitions .jp-carousel-slide{transition:opacity 400ms linear}.jp-carousel-close-hint{color:#999;cursor:default;letter-spacing:0!important;padding:.35em 0 0;position:absolute;text-align:left;width:90%}.jp-carousel-transitions .jp-carousel-close-hint{transition:color 200ms linear}.jp-carousel-close-hint span{cursor:pointer;background-color:#000;background-color:rgba(0,0,0,.8);display:block;height:22px;font:400 24px/1 "Helvetica Neue",sans-serif!important;line-height:22px;margin:0 0 0 .4em;text-align:center;vertical-align:middle;width:22px;border-radius:4px}.jp-carousel-transitions .jp-carousel-close-hint span{transition:border-color 200ms linear}.jp-carousel-close-hint:hover{cursor:default;color:#fff}.jp-carousel-close-hint:hover span{border-color:#fff}a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background:url(../modules/carousel/images/carousel-sprite.png?5) 0 0/16px 200px no-repeat}div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{margin:0 14px 0 0!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#303030;padding-right:8px!important;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;margin:0 2px 0 -12px!important}div.jp-carousel-buttons a.jp-carousel-reblog,div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{background-position:6px -36px;padding-right:auto!important;padding-left:26px!important;color:#999}div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -156px;padding-left:19px!important}div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover{cursor:default}div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:6px -56px;color:#68c9e8}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){a.jp-carousel-image-download,div.jp-carousel-buttons a.jp-carousel-commentlink,div.jp-carousel-buttons a.jp-carousel-reblog{background-image:url(../modules/carousel/images/carousel-sprite-2x.png?5)}}div#carousel-reblog-box{background:#222;padding:3px 0 0;display:none;margin:5px auto 0;border-radius:2px;box-shadow:0 0 20px rgba(0,0,0,.9);height:74px;width:565px}#carousel-reblog-box textarea{background:#999;font:13px/1.4 "Helvetica Neue",sans-serif!important;color:#444;padding:3px 6px;width:370px;height:48px;float:left;margin:6px 9px 0;border:1px solid #666;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:2px}#carousel-reblog-box textarea:focus{background:#ccc;color:#222}#carousel-reblog-box label{color:#aaa;font-size:11px;padding-right:2px;padding-left:2px;display:inline;font-weight:400}#carousel-reblog-box select{width:110px;padding:0;font-size:12px;font-family:"Helvetica Neue",sans-serif!important;background:#333;color:#eee;border:1px solid #444;margin-top:5px}#carousel-reblog-box .submit,#wrapper #carousel-reblog-box p.response{float:left;width:154px;padding-top:0;padding-left:1px;overflow:hidden;height:34px;margin:3px 0 0 2px!important}#wrapper #carousel-reblog-box p.response{font-size:13px;clear:none;padding-left:2px;height:34px;color:#aaa}#carousel-reblog-box input#carousel-reblog-submit,#jp-carousel-comment-form-button-submit{font:13px/24px "Helvetica Neue",sans-serif!important;margin-top:8px;padding:0 10px!important;border-radius:1em;height:24px;color:#333;cursor:pointer;font-weight:400;background:#aaa;border:1px solid #444}#carousel-reblog-box input#carousel-reblog-submit:hover,#jp-carousel-comment-form-button-submit:hover{background:#ccc}#carousel-reblog-box .canceltext{color:#aaa;font-size:11px;line-height:24px}#carousel-reblog-box .canceltext a{color:#fff}.jp-carousel-titleanddesc{border-top:1px solid #222;color:#999;font-size:15px;padding-top:24px;margin-bottom:20px;font-weight:400}.jp-carousel-titleanddesc-title{font:300 1.5em/1.1 "Helvetica Neue",sans-serif!important;text-transform:none!important;color:#fff;margin:0 0 15px;padding:0}.jp-carousel-titleanddesc-desc p{color:#999;line-height:1.4;margin-bottom:.75em}.jp-carousel-comments p a,.jp-carousel-info h2 a,.jp-carousel-titleanddesc p a{color:#fff!important;border:none!important;text-decoration:underline!important;font-weight:400!important;font-style:normal!important}.jp-carousel-titleanddesc p b,.jp-carousel-titleanddesc p strong{font-weight:700;color:#999}.jp-carousel-titleanddesc p em,.jp-carousel-titleanddesc p i{font-style:italic;color:#999}.jp-carousel-comments p a:hover,.jp-carousel-info h2 a:hover,.jp-carousel-titleanddesc p a:hover{color:#68c9e8!important}.jp-carousel-titleanddesc p:empty{display:none}.jp-carousel-left-column-wrapper h1:after,.jp-carousel-left-column-wrapper h1:before,.jp-carousel-photo-info h1:after,.jp-carousel-photo-info h1:before{content:none!important}.jp-carousel-image-meta{background:#111;border:1px solid #222;color:#fff;font:12px/1.4 "Helvetica Neue",sans-serif!important;overflow:hidden;padding:18px 20px;width:209px!important}.jp-carousel-image-meta h5,.jp-carousel-image-meta li{font-family:"Helvetica Neue",sans-serif!important;position:inherit!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;background:none!important;border:none!important;font-weight:400!important;line-height:1.3em!important}.jp-carousel-image-meta ul{margin:0!important;padding:0!important;list-style:none!important}.jp-carousel-image-meta li{width:48%!important;float:left!important;margin:0 2% 15px 0!important;color:#fff!important;font-size:13px!important}.jp-carousel-image-meta h5{color:#999!important;text-transform:uppercase!important;font-size:10px!important;margin:0 0 2px!important;letter-spacing:.1em!important}a.jp-carousel-image-download{padding-left:23px;display:inline-block;clear:both;color:#999;line-height:1;font-weight:400;font-size:13px;text-decoration:none;background-position:0 -82px}a.jp-carousel-image-download span.photo-size{font-size:11px;border-radius:1em;margin-left:2px;display:inline-block}a.jp-carousel-image-download span.photo-size-times{padding:0 1px 0 2px}a.jp-carousel-image-download:hover{background-position:0 -122px;color:#68c9e8;border:none!important}.jp-carousel-image-map{position:relative;margin:-20px -20px 20px;border-bottom:1px solid rgba(255,255,255,.17);height:154px}.jp-carousel-image-map img.gmap-main{border-top-left-radius:6px;border-right:1px solid rgba(255,255,255,.17)}.jp-carousel-image-map div.gmap-topright{width:94px;height:154px;position:absolute;top:0;right:0}.jp-carousel-image-map div.imgclip{overflow:hidden;border-top-right-radius:6px}.jp-carousel-image-map div.gmap-topright img{margin-left:-40px}.jp-carousel-image-map img.gmap-bottomright{position:absolute;top:96px;right:0}.jp-carousel-comments{font:15px/1.7 "Helvetica Neue",sans-serif!important;font-weight:400;background:none}.jp-carousel-comments p a:active,.jp-carousel-comments p a:focus,.jp-carousel-comments p a:hover{color:#68c9e8!important}.jp-carousel-comment{background:none;color:#999;margin-bottom:20px;clear:left;overflow:auto;width:100%}.jp-carousel-comment p{color:#999!important}.jp-carousel-comment .comment-author{font-size:13px;font-weight:400;padding:0;width:auto;display:inline;float:none;border:none;margin:0}.jp-carousel-comment .comment-author a{color:#fff}.jp-carousel-comment .comment-gravatar{float:left}.jp-carousel-comment .comment-content{border:none;margin-left:85px;padding:0}.jp-carousel-comment .avatar{margin:0 20px 0 0;border-radius:4px;border:none!important;padding:0!important;background-color:transparent!important}.jp-carousel-comment .comment-date{color:#999;margin-top:4px;font-size:11px;display:inline;float:right}#jp-carousel-comment-form{margin:0 0 10px!important;float:left;width:100%}textarea#jp-carousel-comment-form-comment-field{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:15px/1.4 "Helvetica Neue",sans-serif!important;width:100%;padding:10px 10px 5px;margin:0;float:none;height:147px;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:3px;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box}textarea#jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#555}textarea#jp-carousel-comment-form-comment-field:focus{background:#ccc;color:#222}textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#aaa}#jp-carousel-comment-form-spinner{color:#fff;margin:22px 0 0 10px;display:block;width:20px;height:20px;float:left}#jp-carousel-comment-form-submit-and-info-wrapper{display:none;overflow:hidden;width:100%}#jp-carousel-comment-form-commenting-as input{background:rgba(34,34,34,.9);border:1px solid #3a3a3a;color:#aaa;font:13px/1.4 "Helvetica Neue",sans-serif!important;padding:3px 6px;float:left;box-shadow:inset 2px 2px 2px rgba(0,0,0,.2);border-radius:2px;width:285px}#jp-carousel-comment-form-commenting-as input:focus{background:#ccc;color:#222}#jp-carousel-comment-form-commenting-as p{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:22px 0 0;float:left}#jp-carousel-comment-form-commenting-as fieldset{float:left;border:none;margin:20px 0 0;padding:0;clear:both}#jp-carousel-comment-form-commenting-as label{font:400 13px/1.7 "Helvetica Neue",sans-serif!important;margin:0 20px 3px 0;float:left;width:100px}#jp-carousel-comment-form-button-submit{margin-top:20px;float:right}#jp-carousel-comment-form-container,#js-carousel-comment-form-container{margin-bottom:15px;overflow:auto;width:100%}#jp-carousel-comment-post-results{display:none;overflow:auto;width:100%}#jp-carousel-comment-post-results span{display:block;text-align:center;margin-top:20px;width:100%;overflow:auto;padding:1em 0;-moz-box-sizing:border-box;box-sizing:border-box;background:rgba(0,0,0,.7);border-radius:2px;font:13px/1.4 "Helvetica Neue",sans-serif!important;border:1px solid rgba(255,255,255,.17);box-shadow:inset 0 0 5px 5px rgba(0,0,0,1)}.jp-carousel-comment-post-error{color:#DF4926}#jp-carousel-comments-closed{display:none;color:#999}#jp-carousel-comments-loading{font:400 15px/1.7 "Helvetica Neue",sans-serif!important;display:none;color:#999;text-align:left;margin-bottom:20px}.jp-carousel-light .jp-carousel-overlay{background:#fff}.jp-carousel-light .jp-carousel-next-button:hover span,.jp-carousel-light .jp-carousel-previous-button:hover span{opacity:.8}.jp-carousel-light .jp-carousel-close-hint:hover,.jp-carousel-light .jp-carousel-titleanddesc div{color:#000!important}.jp-carousel-light .jp-carousel-comment .comment-author a,.jp-carousel-light .jp-carousel-comments p a,.jp-carousel-light .jp-carousel-info h2 a,.jp-carousel-light .jp-carousel-titleanddesc p a{color:#1e8cbe!important}.jp-carousel-light .jp-carousel-comment .comment-author a:hover,.jp-carousel-light .jp-carousel-comments p a:hover,.jp-carousel-light .jp-carousel-info h2 a:hover,.jp-carousel-light .jp-carousel-titleanddesc p a:hover{color:#f1831e!important}.jp-carousel-light .jp-carousel-comment,.jp-carousel-light .jp-carousel-comment p,.jp-carousel-light .jp-carousel-info h2,.jp-carousel-light .jp-carousel-titleanddesc,.jp-carousel-light .jp-carousel-titleanddesc p,.jp-carousel-light .jp-carousel-titleanddesc p b,.jp-carousel-light .jp-carousel-titleanddesc p em,.jp-carousel-light .jp-carousel-titleanddesc p i,.jp-carousel-light .jp-carousel-titleanddesc p strong,.jp-carousel-light div.jp-carousel-buttons a{color:#666}.jp-carousel-light .jp-carousel-buttons{border-bottom-color:#f0f0f0;background:#f5f5f5}.jp-carousel-light div.jp-carousel-buttons a:hover{text-decoration:none;color:#f1831e}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog,.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog:hover{background-position:4px -56px;padding-left:24px!important}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-color:#2ea2cc;color:#fff}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{background-position:0 -176px}.jp-carousel-light div.jp-carousel-buttons a.jp-carousel-reblog.reblogged{background-position:5px -36px}.jp-carousel-light div#carousel-reblog-box{background:#eee;box-shadow:0 2px 10px rgba(0,0,0,.1);border:1px solid #ddd}.jp-carousel-light #carousel-reblog-box textarea{color:#666;border:1px solid #cfcfcf;background:#fff}.jp-carousel-light #carousel-reblog-box .canceltext{color:#888}.jp-carousel-light #carousel-reblog-box .canceltext a{color:#666}.jp-carousel-light #carousel-reblog-box select{background:#eee;color:#333;border:1px solid #aaa}#jp-carousel-comment-form-button-submit,.jp-carousel-light #carousel-reblog-box input#carousel-reblog-submit{color:#333;background:#fff;border:1px solid #aaa}.jp-carousel-light .jp-carousel-image-meta{background:#fafafa;border:1px solid #eee;border-top-color:#f5f5f5;border-left-color:#f5f5f5;color:#333}.jp-carousel-light .jp-carousel-image-meta li{color:#000!important}.jp-carousel-light .jp-carousel-close-hint{color:#ccc}.jp-carousel-light .jp-carousel-close-hint span{background-color:#fff;border-color:#ccc}.jp-carousel-light #jp-carousel-comment-form-comment-field::-webkit-input-placeholder{color:#aaa}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus{color:#333}.jp-carousel-light #jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder{color:#ddd}.jp-carousel-light a.jp-carousel-image-download{background-position:0 -122px}.jp-carousel-light a.jp-carousel-image-download:hover{background-position:0 -122px;color:#f1831e}.jp-carousel-light textarea#jp-carousel-comment-form-comment-field{background:#fbfbfb;color:#333;border:1px solid #dfdfdf;box-shadow:inset 2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input{background:#fbfbfb;border:1px solid #dfdfdf;color:#333;box-shadow:inset 2px 2px 2px rgba(0,0,0,.1)}.jp-carousel-light #jp-carousel-comment-form-commenting-as input:focus{background:#fbfbfb;color:#333}.jp-carousel-light #jp-carousel-comment-post-results span{background:#f7f7f7;border:1px solid #dfdfdf;box-shadow:inset 0 0 5px rgba(0,0,0,.05)}.jp-carousel-light .jp-carousel-slide{background-color:#fff}.jp-carousel-light .jp-carousel-titleanddesc{border-top:1px solid #eee}@media only screen and (max-width:760px){.jp-carousel-info{margin:0 10px!important}.jp-carousel-buttons,.jp-carousel-next-button,.jp-carousel-previous-button{display:none!important}.jp-carousel-image-meta{float:none!important;width:100%!important;-moz-box-sizing:border-box;box-sizing:border-box}.jp-carousel-close-hint{font-weight:800!important;font-size:26px!important;position:fixed!important;top:-10px}.jp-carousel-slide img{filter:alpha(opacity=100);opacity:1}.jp-carousel-wrap{background-color:#000}.jp-carousel-fadeaway{display:none}#jp-carousel-comment-form-container{display:none!important}.jp-carousel-titleanddesc{padding-top:0!important;border:none!important}.jp-carousel-titleanddesc-title{font-size:1em!important}.jp-carousel-left-column-wrapper{padding:0;width:100%!important}.jp-carousel-photo-info{left:0!important;width:100%!important}}.contact-form .clear-form{clear:both}.contact-form input[type=email],.contact-form input[type=text]{width:300px;max-width:98%;margin-bottom:13px}.contact-form select{margin-bottom:13px}.contact-form textarea{height:200px;width:80%;float:none;margin-bottom:13px}.contact-form input[type=checkbox],.contact-form input[type=radio]{float:none;margin-bottom:13px}.contact-form label{margin-bottom:3px;float:none;font-weight:700;display:block}.contact-form label.checkbox,.contact-form label.radio{margin-bottom:3px;float:none;font-weight:700;display:inline-block}.contact-form label span{color:#AAA;margin-left:4px;font-weight:400}.contact-form-submission{margin-bottom:4em;padding:1.5em 1em}.contact-form-submission p{margin:0 auto}.form-errors .form-error-message{color:red}.textwidget .contact-form input[type=email],.textwidget .contact-form input[type=text],.textwidget .contact-form textarea{width:250px;max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box}#jetpack-check-feedback-spam{margin:1px 8px 0 0}.jetpack-check-feedback-spam-spinner{display:inline-block;margin-top:7px}.infinite-loader{color:#000;display:block;height:28px;text-indent:-9999px}#infinite-handle span{background:#333;border-radius:1px;color:#eee;cursor:pointer;font-size:13px;padding:6px 16px}#infinite-handle span button,#infinite-handle span button:focus,#infinite-handle span button:hover{display:inline;position:static;padding:0;margin:0;border:none;line-height:inherit;background:0 0;color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;font-family:inherit}#infinite-handle span button::-moz-focus-inner{margin:0;padding:0;border:none}@media (max-width:800px){#infinite-handle span:before{display:none}#infinite-handle span{display:block}}#infinite-footer{position:fixed;bottom:-50px;left:0;width:100%}#infinite-footer a{text-decoration:none}#infinite-footer .blog-credits a:hover,#infinite-footer .blog-info a:hover{color:#444;text-decoration:underline}#infinite-footer .container{background:rgba(255,255,255,.8);border-color:#ccc;border-color:rgba(0,0,0,.1);border-style:solid;border-width:1px 0 0;-moz-box-sizing:border-box;box-sizing:border-box;margin:0 auto;overflow:hidden;padding:1px 20px;width:780px}#infinite-footer .blog-credits,#infinite-footer .blog-info{-moz-box-sizing:border-box;box-sizing:border-box;line-height:25px}#infinite-footer .blog-info{float:left;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:40%}#infinite-footer .blog-credits{font-weight:400;float:right;width:60%}#infinite-footer .blog-info a{color:#111;font-size:14px;font-weight:700}#infinite-footer .blog-credits{color:#888;font-size:12px;text-align:right}#infinite-footer .blog-credits a{color:#666}.infinity-end.neverending #infinite-footer{display:none}@media (max-width:640px){#infinite-footer .container{-moz-box-sizing:border-box;box-sizing:border-box;width:100%}#infinite-footer .blog-info{width:30%}#infinite-footer .blog-credits{width:70%}#infinite-footer .blog-credits,#infinite-footer .blog-info a{font-size:10px}}@media (max-width:640px){#infinite-footer{position:static}}#wpadminbar li#wp-admin-bar-admin-bar-likes-widget{width:61px;overflow:hidden}#wpadminbar iframe.admin-bar-likes-widget{width:61px;height:28px;min-height:28px;border-width:0;position:absolute;top:0}div.jetpack-likes-widget-wrapper{width:100%;min-height:50px;position:relative}div.jetpack-likes-widget-wrapper .sd-link-color{font-size:12px}div.jetpack-likes-widget-wrapper.slim-likes-widget{width:1px;min-height:0}#likes-other-gravatars{display:none;position:absolute;padding:10px 10px 12px;background-color:#2e4453;border-width:0;box-shadow:0 0 10px #2e4453;box-shadow:0 0 10px rgba(46,68,83,.6);min-width:130px;z-index:1000}#likes-other-gravatars *{line-height:normal}#likes-other-gravatars .likes-text{color:#fff;font-size:12px;padding-bottom:8px}#likes-other-gravatars li,#likes-other-gravatars ul{margin:0;padding:0;text-indent:0;list-style-type:none}#likes-other-gravatars li::before{content:""}#likes-other-gravatars ul.wpl-avatars{overflow:auto;display:block;max-height:190px}#likes-other-gravatars ul.wpl-avatars li{width:32px;height:32px;float:left;margin:0 5px 5px 0}#likes-other-gravatars ul.wpl-avatars li a{margin:0 2px 0 0;border-bottom:none!important;display:block}#likes-other-gravatars ul.wpl-avatars li a img{background:0 0;border:none;margin:0!important;padding:0!important;position:static}div.sd-box{border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.13)}.comment-likes-widget,.entry-content .post-likes-widget,.post-likes-widget{margin:0;border-width:0;display:block}.post-likes-widget-placeholder{margin:0;border-width:0;position:relative}.post-likes-widget-placeholder .button{display:none}.post-likes-widget-placeholder .loading{color:#999;font-size:12px}.slim-likes-widget .post-likes-widget{width:auto;float:none}div.sharedaddy.sd-like-enabled .sd-like h3{display:none}div.sharedaddy.sd-like-enabled .sd-like .post-likes-widget{width:100%;float:none;position:absolute;top:0}.comment-likes-widget{width:100%}.pd-rating{display:block!important}.sd-gplus .sd-title{display:none}#jp-relatedposts{display:none;padding-top:1em;margin:1em 0;position:relative;clear:both}.jp-relatedposts:after{content:'';display:block;clear:both}#jp-relatedposts h3.jp-relatedposts-headline{margin:0 0 1em;display:inline-block;float:left;font-size:9pt;font-weight:700;font-family:inherit}#jp-relatedposts h3.jp-relatedposts-headline em:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;border-top:1px solid rgba(0,0,0,.2);margin-bottom:1em}#jp-relatedposts h3.jp-relatedposts-headline em{font-style:normal;font-weight:700}#jp-relatedposts .jp-relatedposts-items{clear:left}#jp-relatedposts .jp-relatedposts-items-visual{margin-right:-20px}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{float:left;width:33%;margin:0 0 1em;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post{padding-right:20px;filter:alpha(opacity=80);-moz-opacity:.8;opacity:.8}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4){clear:both}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover{filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items p,#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{font-size:14px;line-height:20px;margin:0}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs{position:relative}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs a.jp-relatedposts-post-aoverlay{position:absolute;top:0;bottom:0;left:0;right:0;display:block;border-bottom:0}#jp-relatedposts .jp-relatedposts-items p{margin-bottom:0}#jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title{text-transform:none;margin:0;font-family:inherit;display:block;max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a{font-size:inherit;font-weight:400;text-decoration:none;filter:alpha(opacity=100);-moz-opacity:1;opacity:1}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover{text-decoration:underline}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span{display:block;max-width:90%;overflow:hidden;text-overflow:ellipsis}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post img.jp-relatedposts-post-img,#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post span{max-width:100%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{opacity:.6}#jp-relatedposts .jp-relatedposts-items-visual div.jp-relatedposts-post-thumbs p.jp-relatedposts-post-excerpt,.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date{display:none}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt{overflow:hidden}#jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post-nothumbs span{margin-bottom:1em}@media only screen and (max-width:640px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:50%}#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:nth-child(3n){clear:left}#jp-relatedposts .jp-relatedposts-items-visual{margin-right:20px}}@media only screen and (max-width:320px){#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post{width:100%;clear:both;margin:0 0 1em}}#jp-post-flair{padding-top:.5em}#content div.sharedaddy,#main div.sharedaddy,div.sharedaddy{clear:both}div.sharedaddy h3.sd-title{margin:0 0 1em;display:inline-block;line-height:1.2;font-size:9pt;font-weight:700}div.sharedaddy h3.sd-title:before{content:"";display:block;width:100%;min-width:30px;border-top:1px solid #ddd;margin-bottom:1em}body.highlander-light h3.sd-title:before{border-top:1px solid rgba(0,0,0,.2)}body.highlander-dark h3.sd-title:before{border-top:1px solid rgba(255,255,255,.4)}.sd-content ul{padding:0!important;margin:0 0 .7em!important;list-style:none!important}.sd-content ul li{display:inline-block}.sd-block.sd-gplus{margin:0 0 .5em}.sd-gplus .sd-content{font-size:12px}#sharing_email .sharing_send,.sd-content ul li .option a.share-ustom,.sd-content ul li a.sd-button,.sd-content ul li.advanced a.share-more,.sd-content ul li.preview-item div.option.option-smart-off a,.sd-social-icon .sd-content ul li a.sd-button,.sd-social-icon-text .sd-content ul li a.sd-button,.sd-social-official .sd-content>ul>li .digg_button >a,.sd-social-official .sd-content>ul>li>a.sd-button,.sd-social-text .sd-content ul li a.sd-button{text-decoration:none!important;display:inline-block;font-size:12px;font-family:"Open Sans",sans-serif;font-weight:400;border-radius:3px;color:#777!important;background:#f8f8f8;border:1px solid #ccc;box-shadow:0 1px 0 rgba(0,0,0,.08);text-shadow:none;line-height:23px;padding:1px 8px 0 5px}.sd-content ul li .option a.share-ustom span,.sd-content ul li a.sd-button>span,.sd-content ul li.advanced a.share-more span,.sd-content ul li.preview-item div.option.option-smart-off a span,.sd-social-icon-text .sd-content ul li a.sd-button>span,.sd-social-official .sd-content>ul>li .digg_button >a span,.sd-social-official .sd-content>ul>li>a.sd-button span,.sd-social-text .sd-content ul li a.sd-button span{line-height:23px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button,.sd-social-official .sd-content>ul>li .digg_button>a,.sd-social-official .sd-content>ul>li>a.sd-button{line-height:17px;box-shadow:none;vertical-align:top}.sd-social-official .sd-content ul li a.sd-button>span{line-height:17px}.sd-social-official .sd-content .sharing-hidden .inner>ul>li .digg_button>a:before,.sd-social-official .sd-content .sharing-hidden .inner>ul>li>a.sd-button:before,.sd-social-official .sd-content>ul>li .digg_button>a:before,.sd-social-official .sd-content>ul>li>a.sd-button:before{margin-bottom:-1px}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon .sd-content ul li a.sd-button:hover,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:hover,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li .digg_button>a:hover,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-official .sd-content>ul>li>a.sd-button:hover,.sd-social-text .sd-content ul li a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:hover{color:#555;background:#fafafa;border:1px solid #999}.sd-social-icon .sd-content ul li a.sd-button:active,.sd-social-icon-text .sd-content ul li a.sd-button:active,.sd-social-official .sd-content>ul>li .digg_button>a:active,.sd-social-official .sd-content>ul>li>a.sd-button:active,.sd-social-text .sd-content ul li a.sd-button:active{box-shadow:inset 0 1px 0 rgba(0,0,0,.16)}.sd-content ul li a.sd-button:before{display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:400 18px/1 social-logos;vertical-align:top;text-align:center}.sd-social-icon-text ul li a.sd-button:before{position:relative;top:2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-content ul li a.sd-button:before{position:relative;top:2px}}.sd-social-official ul li a.sd-button:before{position:relative;top:-2px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-official ul li a.sd-button:before{top:0}}.sd-content ul li{margin:0 5px 5px 0;padding:0}.sd-content ul li.preview-item a.sd-button span,.sd-social-icon-text .sd-content ul li a span,.sd-social-official .sd-content ul li a.sd-button span{margin-left:3px}.sd-content ul li.preview-item.no-icon a.sd-button span{margin-left:0}.sd-content ul li.no-icon a:before,.sd-social-text .sd-content ul li a:before{display:none}body .sd-content ul li.share-custom.no-icon a span,body .sd-social-text .sd-content ul li.share-custom a span{background-image:none;background-position:-500px -500px!important;background-repeat:no-repeat!important;padding-left:0;height:0;line-height:inherit}.sd-social-icon .sd-content ul li a.share-more{position:relative;top:-4px}@media screen and (-webkit-min-device-pixel-ratio:0){.sd-social-icon .sd-content ul li a.share-more{top:2px}}@-moz-document url-prefix(){.sd-social-icon .sd-content ul li a.share-more{top:2px}}.sd-social-icon .sd-content ul li a.share-more span{margin-left:3px}.sd-content ul li.share-print div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-print a:before,.sd-social-icon-text .sd-content li.share-print a:before,.sd-social-official .sd-content li.share-print a:before,.sd-social-text .sd-content ul li.share-print a:before{content:'\f469'}.sd-content ul li.share-email div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-email a:before,.sd-social-icon-text .sd-content li.share-email a:before,.sd-social-official .sd-content li.share-email a:before,.sd-social-text .sd-content ul li.share-email a:before{content:'\f410'}.sd-content ul li.share-linkedin div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-linkedin a:before,.sd-social-icon-text .sd-content li.share-linkedin a:before,.sd-social-text .sd-content ul li.share-linkedin a:before{content:'\f207'}.sd-content ul li.share-twitter div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-twitter a:before,.sd-social-icon-text .sd-content li.share-twitter a:before,.sd-social-text .sd-content ul li.share-twitter a:before{content:'\f202'}.sd-content ul li.share-reddit div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-reddit a:before,.sd-social-icon-text .sd-content li.share-reddit a:before,.sd-social-text .sd-content ul li.share-reddit a:before{content:'\f222'}.sd-content ul li.share-tumblr div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-tumblr a:before,.sd-social-icon-text .sd-content li.share-tumblr a:before,.sd-social-text .sd-content ul li.share-tumblr a:before{content:'\f607'}.sd-content ul li.share-pocket div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pocket a:before,.sd-social-icon-text .sd-content li.share-pocket a:before,.sd-social-text .sd-content ul li.share-pocket a:before{content:'\f224'}.sd-content ul li.share-pinterest div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-pinterest a:before,.sd-social-icon-text .sd-content li.share-pinterest a:before,.sd-social-text .sd-content ul li.share-pinterest a:before{content:'\f210'}.sd-content ul li.share-google-plus-1 div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-google-plus-1 a:before,.sd-social-icon-text .sd-content li.share-google-plus-1 a:before,.sd-social-text .sd-content ul li.share-google-plus-1 a:before{content:'\f218'}.sd-content ul li.share-facebook div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-facebook a:before,.sd-social-icon-text .sd-content li.share-facebook a:before,.sd-social-text .sd-content ul li.share-facebook a:before{content:'\f203'}.sd-content ul li.share-press-this div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-press-this a:before,.sd-social-icon-text .sd-content li.share-press-this a:before,.sd-social-official .sd-content li.share-press-this a:before,.sd-social-text .sd-content ul li.share-press-this a:before{content:'\f205'}.sd-social-official .sd-content li.share-press-this a:before{color:#2ba1cb}.sd-content ul li.share-telegram div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-telegram a:before,.sd-social-icon-text .sd-content li.share-telegram a:before,.sd-social-official .sd-content li.share-telegram a:before,.sd-social-text .sd-content ul li.share-telegram a:before{content:'\f606'}.sd-social-official .sd-content li.share-telegram a:before{color:#08c}.sd-content ul li.share-skype div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-skype a:before,.sd-social-icon-text .sd-content li.share-skype a:before,.sd-social-text .sd-content ul li.share-skype a:before{content:'\f220'}.sd-content ul li.advanced a.share-more:before,.sd-social-icon .sd-content ul a.share-more:before,.sd-social-icon-text .sd-content a.share-more:before,.sd-social-official .sd-content a.share-more:before,.sd-social-text .sd-content ul a.share-more:before{content:'\f415'}.sd-social-official .sd-content a.share-more:before{color:#2ba1cb}.sd-content ul li.share-jetpack-whatsapp div.option.option-smart-off a:before,.sd-social-icon .sd-content ul li.share-jetpack-whatsapp a:before,.sd-social-icon-text .sd-content li.share-jetpack-whatsapp a:before,.sd-social-official .sd-content li.share-jetpack-whatsapp a:before,.sd-social-text .sd-content ul li.share-jetpack-whatsapp a:before{content:'\f608'}.sd-social-official .sd-content li.share-jetpack-whatsapp a:before{color:#43d854}.sd-social-icon .sd-content ul li[class*=share-].share-jetpack-whatsapp a.sd-button{background:#43d854;color:#fff!important}.sd-social .sd-button .share-count{background:#2ea2cc;color:#fff;border-radius:10px;display:inline-block;text-align:center;font-size:10px;padding:1px 3px;line-height:1}.sd-social-official .sd-content ul,.sd-social-official .sd-content ul li{line-height:25px!important}.sd-social-official .sd-content>ul>li>a.sd-button span{line-height:1}.sd-social-official .sd-content ul:after{content:".";display:block;height:0;clear:both;visibility:hidden}.sd-social-official .sd-content li.share-press-this a{margin:0 0 5px}.sd-social-official .sd-content ul>li{display:block;float:left;margin:0 10px 5px 0!important;height:25px}.sd-social-official .fb-share-button>span{vertical-align:top!important}.sd-social-official .sd-content .pocket_button iframe{width:98px}.googleplus1_button .g-plus{vertical-align:top!important}.reddit_button iframe{margin-top:1px}.googleplus1_button iframe,.linkedin_button>span,.pinterest_button,.pocket_button iframe,.twitter_button{margin:0!important}.sd-social-official .sd-content .share-skype{width:55px}body .sd-social-official li a.share-more,body .sd-social-official li.share-custom a,body .sd-social-official li.share-digg a,body .sd-social-official li.share-email a,body .sd-social-official li.share-press-this a,body .sd-social-official li.share-print{position:relative;top:0}body .sd-social-icon .sd-content li.share-custom>a{padding:2px 3px 0;position:relative;top:4px}body .sd-content ul li.share-custom a.share-icon span,body .sd-social-icon .sd-content li.share-custom a span,body .sd-social-icon-text .sd-content li.share-custom a span,body .sd-social-official .sd-content li.share-custom a span,body .sd-social-text .sd-content li.share-custom a span{background-size:16px 16px;background-repeat:no-repeat;margin-left:0;padding:0 0 0 19px;display:inline-block;height:16px;line-height:16px}body .sd-social-icon .sd-content li.share-custom a span{width:0;padding-left:16px!important}.sharing-hidden .inner{position:absolute;z-index:2;border:1px solid #ccc;padding:10px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);border-radius:2px;margin-top:5px;max-width:400px}.sharing-hidden .inner ul{margin:0!important}.sd-social-official .sd-content .sharing-hidden ul>li.share-end{clear:both;margin:0!important;height:0!important}.sharing-hidden .inner:after,.sharing-hidden .inner:before{position:absolute;z-index:1;top:-8px;left:20px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid #ccc;content:"";display:block}.sharing-hidden .inner:after{z-index:2;top:-7px;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:8px solid #fff}.sharing-hidden ul{margin:0}.sd-social-icon .sd-content ul li[class*=share-] a,.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a{border-radius:50%;-webkit-border-radius:50%;border:0;box-shadow:none;padding:7px;position:relative;top:-2px;line-height:1;width:auto;height:auto;margin-bottom:0}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button>span,.sd-social-icon .sd-content ul li[class*=share-] div.option a span{line-height:1}.sd-social-icon .sd-content ul li[class*=share-] a:hover,.sd-social-icon .sd-content ul li[class*=share-] div.option a:hover{border:none;opacity:.6}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button:before{top:1px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button.share-custom{padding:8px 8px 6px;top:5px}.sd-social-icon .sd-content ul li a.sd-button.share-more{margin-left:10px}.sd-social-icon .sd-content ul li:first-child a.sd-button.share-more{margin-left:0}.sd-social-icon .sd-button span.share-count{position:absolute;bottom:0;right:0;border-radius:0;background:#555;font-size:9px}.sd-social-icon .sd-content ul li[class*=share-] a.sd-button{background:#e9e9e9;margin-top:2px;text-indent:0}.sd-social-icon .sd-content ul li[class*=share-].share-tumblr a.sd-button{background:#2c4762;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-facebook a.sd-button{background:#3b5998;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-twitter a.sd-button{background:#00acee;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pinterest a.sd-button{background:#ca1f27;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-digg a.sd-button{color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-press-this a.sd-button{background:#1e8cbe;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-telegram a.sd-button{background:#08c;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-linkedin a.sd-button{background:#0077b5;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-google-plus-1 a.sd-button{background:#dd4b39;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-pocket a.sd-button{background:#ee4056;color:#fff!important}.sd-social-icon .sd-content ul li[class*=share-].share-reddit a.sd-button{background:#cee3f8;color:#555!important}.sd-social-icon .sd-content ul li[class*=share-].share-skype a.sd-button{background:#00AFF0;color:#fff!important}.sharing-screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.sharing-screen-reader-text:active,.sharing-screen-reader-text:focus,.sharing-screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#sharing_email{width:342px;position:absolute;z-index:1001;border:1px solid #ccc;padding:15px;background:#fff;box-shadow:0 5px 20px rgba(0,0,0,.2);text-align:left}div.sharedaddy.sharedaddy-dark #sharing_email{border-color:#fff}#sharing_email .errors{color:#fff;background-color:#771a09;font-size:12px;padding:5px 8px;line-height:1;margin:10px 0 0}#sharing_email label{font-size:12px;color:#333;font-weight:700;display:block;padding:0 0 4px;text-align:left;text-shadow:none}#sharing_email form{margin:0}#sharing_email input[type=email],#sharing_email input[type=text]{width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border:1px solid #ccc;margin-bottom:1em;background:#fff;font-size:12px;color:#333;max-width:none;padding:1px 3px}#jetpack-source_f_name{display:none!important;position:absolute!important;left:-9000px}#sharing_email .sharing_cancel{padding:0 0 0 1em;font-size:12px;text-shadow:none}#sharing_email .recaptcha{width:312px;height:123px;margin:0 0 1em}.slideshow-window{background-color:#222;border:20px solid #222;border-radius:10px;height:0;margin-bottom:20px;overflow:hidden;padding-top:30px!important;padding-bottom:56.25%!important;position:relative;z-index:1}.slideshow-window.slideshow-white{background-color:#fff;border-color:#fff}.slideshow-window,.slideshow-window *{-moz-box-sizing:content-box;box-sizing:content-box}.slideshow-loading{height:100%;text-align:center;margin:auto}body div.slideshow-window * img{background-color:transparent!important;background-image:none!important;border-width:0!important;display:block;margin:0 auto;max-width:100%;max-height:100%;padding:0!important;position:relative;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);top:50%}.slideshow-loading img{vertical-align:middle}.slideshow-slide{display:none;height:100%!important;left:0;margin:auto;position:absolute;text-align:center;top:0;width:100%!important}.slideshow-slide img{vertical-align:middle}.slideshow-line-height-hack{overflow:hidden;width:0;font-size:0}.slideshow-slide-caption{font-size:13px;font-family:"Helvetica Neue",sans-serif;color:#f7f7f7;text-shadow:#222 1px 1px 2px;line-height:25px;height:25px;position:absolute;bottom:5px;left:0;z-index:100;width:100%;text-align:center}.slideshow-controls{z-index:1000;position:absolute;bottom:30px;margin:auto;text-align:center;width:100%;-ms-filter:"alpha(Opacity=50)";opacity:.5;direction:ltr;transition:300ms opacity ease-out}.slideshow-window:hover .slideshow-controls{-ms-filter:"alpha(Opacity=100)";opacity:1}body div div.slideshow-controls a,body div div.slideshow-controls a:hover{border:2px solid rgba(255,255,255,.1)!important;background-color:#000!important;background-color:rgba(0,0,0,.6)!important;background-image:url(../modules/shortcodes/img/slideshow-controls.png)!important;background-repeat:no-repeat;background-size:142px 16px!important;background-position:-34px 8px!important;color:#222!important;margin:0 5px!important;padding:0!important;display:inline-block!important;zoom:1;height:32px!important;width:32px!important;line-height:32px!important;text-align:center!important;-khtml-border-radius:10em!important;border-radius:10em!important;transition:300ms border-color ease-out}@media only screen and (-webkit-min-device-pixel-ratio:1.5){body div div.slideshow-controls a,body div div.slideshow-controls a:hover{background-image:url(../modules/shortcodes/img/slideshow-controls-2x.png)!important}}body div div.slideshow-controls a:hover{border-color:rgba(255,255,255,1)!important}body div div.slideshow-controls a:first-child{background-position:-76px 8px!important}body div div.slideshow-controls a:last-child{background-position:-117px 8px!important}body div div.slideshow-controls a.running,body div div.slideshow-controls a:nth-child(2){background-position:-34px 8px!important}body div div.slideshow-controls a.paused{background-position:9px 8px!important}.slideshow-controls a img{border:50px dotted #f0f}body.presentation-wrapper-fullscreen-parent,html.presentation-wrapper-fullscreen-parent{overflow:hidden!important}.presentation-wrapper-fullscreen-parent #wpadminbar{display:none}.presentation-wrapper-fullscreen,.presentation-wrapper-fullscreen-parent{min-width:100%!important;min-height:100%!important;position:absolute!important;top:0!important;right:0!important;bottom:0!important;left:0!important;margin:0!important;padding:0!important;z-index:10000!important}.presentation-wrapper-fullscreen{background-color:gray;border:none!important}.presentation-wrapper-fullscreen .nav-arrow-left,.presentation-wrapper-fullscreen .nav-arrow-right{z-index:20001}.presentation-wrapper-fullscreen .nav-fullscreen-button{z-index:20002}.presentation-wrapper{margin:20px auto;border:1px solid #e5e5e5;overflow:hidden;line-height:normal}.presentation{position:relative;margin:0;overflow:hidden;outline:0}.presentation,.presentation .step{background-repeat:no-repeat;background-position:center;background-size:100% 100%}.presentation .step.fade:not(.active){opacity:0}.presentation .slide-content{padding:30px}.presentation .nav-arrow-left,.presentation .nav-arrow-right,.presentation .nav-fullscreen-button{position:absolute;width:34px;background-repeat:no-repeat;z-index:2;opacity:0;transition:opacity .25s}.presentation .nav-arrow-left,.presentation .nav-arrow-right{height:100%;background-image:url(../modules/shortcodes/images/slide-nav.png);background-size:450% 61px}.presentation .nav-arrow-left{left:0;background-position:4px 50%}.presentation .nav-arrow-right{right:0;background-position:-120px 50%}.presentation .nav-fullscreen-button{width:32px;height:32px;margin:4px;bottom:0;right:0;z-index:3;background-image:url(../modules/shortcodes/images/expand.png);background-size:100% 100%}.presentation:hover .nav-arrow-left,.presentation:hover .nav-arrow-right{opacity:1}.presentation:hover .nav-fullscreen-button{opacity:.8}.presentation-wrapper-fullscreen .nav-fullscreen-button{background-image:url(../modules/shortcodes/images/collapse.png)}.presentation .autoplay-overlay{height:15%;width:80%;margin:30% 10%;position:relative;z-index:100;display:table;border-radius:50px;background-color:#e5e5e5;background-color:rgba(0,0,0,.75);transition:opacity .5s}.presentation .autoplay-overlay .overlay-msg{position:relative;display:table-cell;text-align:center;vertical-align:middle;color:#fff}.presentation .will-fade{opacity:0}.presentation .do-fade{opacity:1;transition:opacity .5s}#subscribe-email input{width:95%}.comment-subscription-form .subscribe-label{display:inline!important}.jetpack-video-wrapper{margin-bottom:1.6em}.jetpack-video-wrapper>.wp-video,.jetpack-video-wrapper>embed,.jetpack-video-wrapper>iframe,.jetpack-video-wrapper>object{margin-bottom:0}.jetpack-social-navigation ul{display:block;margin:0 0 1.5em;padding:0}.jetpack-social-navigation li{display:inline-block;margin:0;line-height:1}.jetpack-social-navigation a{border:0;height:1em;text-decoration:none;width:1em}.jetpack-social-navigation a:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;font-family:Genericons;font-size:1em;font-style:normal;font-weight:400;height:1em;line-height:1;speak:none;text-decoration:inherit;vertical-align:top;width:1em;content:"\f415"}.jetpack-social-navigation a[href*="codepen.io"]:before{content:"\f216"}.jetpack-social-navigation a[href*="digg.com"]:before{content:"\f221"}.jetpack-social-navigation a[href*="dribbble.com"]:before{content:"\f201"}.jetpack-social-navigation a[href*="dropbox.com"]:before{content:"\f225"}.jetpack-social-navigation a[href*="mailto:"]:before{content:"\f410"}.jetpack-social-navigation a[href*="facebook.com"]:before{content:"\f203"}.jetpack-social-navigation a[href*="flickr.com"]:before{content:"\f211"}.jetpack-social-navigation a[href*="foursquare.com"]:before{content:"\f226"}.jetpack-social-navigation a[href*="github.com"]:before{content:"\f200"}.jetpack-social-navigation a[href*="plus.google.com"]:before{content:"\f206"}.jetpack-social-navigation a[href*="instagram.com"]:before{content:"\f215"}.jetpack-social-navigation a[href*="linkedin.com"]:before{content:"\f208"}.jetpack-social-navigation a[href*="path.com"]:before{content:"\f219"}.jetpack-social-navigation a[href*="pinterest.com"]:before{content:"\f210"}.jetpack-social-navigation a[href*="getpocket.com"]:before{content:"\f224"}.jetpack-social-navigation a[href*="polldaddy.com"]:before{content:"\f217"}.jetpack-social-navigation a[href*="reddit.com"]:before{content:"\f222"}.jetpack-social-navigation a[href$="/feed/"]:before{content:"\f413"}.jetpack-social-navigation a[href*="skype:"]:before{content:"\f220"}.jetpack-social-navigation a[href*="spotify.com"]:before{content:"\f515"}.jetpack-social-navigation a[href*="stumbleupon.com"]:before{content:"\f223"}.jetpack-social-navigation a[href*="tumblr.com"]:before{content:"\f214"}.jetpack-social-navigation a[href*="twitch.tv"]:before{content:"\f516"}.jetpack-social-navigation a[href*="twitter.com"]:before{content:"\f202"}.jetpack-social-navigation a[href*="vimeo.com"]:before{content:"\f212"}.jetpack-social-navigation a[href*="vine.co"]:before{content:"\f517"}.jetpack-social-navigation a[href*="wordpress.com"]:before,.jetpack-social-navigation a[href*="wordpress.org"]:before{content:"\f205"}.jetpack-social-navigation a[href*="youtube.com"]:before{content:"\f213"}.tiled-gallery{clear:both;margin:0 0 20px;overflow:hidden}.tiled-gallery img{margin:2px!important}.tiled-gallery .gallery-group{float:left;position:relative}.tiled-gallery .tiled-gallery-item{float:left;margin:0;position:relative;width:inherit}.tiled-gallery .gallery-row{overflow:hidden}.tiled-gallery .tiled-gallery-item a{background:0 0;border:none;color:inherit;margin:0;padding:0;text-decoration:none;width:auto}.tiled-gallery .tiled-gallery-item img,.tiled-gallery .tiled-gallery-item img:hover{background:0 0;border:none;box-shadow:none;max-width:100%;padding:0;vertical-align:middle}.tiled-gallery-caption{background:#eee;background:rgba(255,255,255,.8);color:#333;font-size:13px;font-weight:400;overflow:hidden;padding:10px 0;position:absolute;bottom:0;text-indent:10px;text-overflow:ellipsis;width:100%;white-space:nowrap}.tiled-gallery .tiled-gallery-item-small .tiled-gallery-caption{font-size:11px}.widget-gallery .tiled-gallery-unresized{visibility:hidden;height:0;overflow:hidden}.tiled-gallery .tiled-gallery-item img.grayscale{position:absolute;left:0;top:0}.tiled-gallery .tiled-gallery-item img.grayscale:hover{opacity:0}.tiled-gallery.type-circle .tiled-gallery-item img{border-radius:50%!important}.tiled-gallery.type-circle .tiled-gallery-caption{display:none;opacity:0}.jetpack-display-remote-posts{margin:5px 0 20px}.jetpack-display-remote-posts h4{font-size:90%;margin:5px 0;padding:0}.jetpack-display-remote-posts h4 a{text-decoration:none}.jetpack-display-remote-posts p{margin:0!important;padding:0;line-height:1.4em!important;font-size:90%}.jetpack-display-remote-posts img{max-width:100%}.widget-grofile h4{margin:1em 0 .5em}.widget-grofile ul.grofile-urls{margin-left:0;overflow:hidden}.widget-grofile ul.grofile-accounts li{list-style:none;display:inline}.widget-grofile ul.grofile-accounts li::before{content:""!important}.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite.png);background-repeat:no-repeat;width:16px;height:16px;float:left;margin-right:8px;margin-bottom:8px}.rtl .widget-grofile .grofile-accounts-logo{margin-left:8px;margin-right:0}.grofile-thumbnail{width:500px;max-width:100%}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){.widget-grofile .grofile-accounts-logo{background-image:url(//0.gravatar.com/images/grav-share-sprite-2x.png);background-size:16px 784px}}div[class^=gr_custom_container]{border:1px solid gray;border-radius:10px;padding:10px 5px;background-color:#FFF;color:#000}div[class^=gr_custom_container] a{color:#000}h2[class^=gr_custom_header]{display:none}div[class^=gr_custom_each_container]{width:100%;clear:both;margin-bottom:10px;overflow:auto;padding-bottom:4px;border-bottom:1px solid #aaa}div[class^=gr_custom_book_container]{float:right;overflow:hidden;height:60px;margin-left:4px;width:39px}div[class^=gr_custom_author]{font-size:10px}div[class^=gr_custom_tags]{font-size:10px;color:gray}div[class^=gr_custom_rating]{display:none}.widget_wpcom_social_media_icons_widget ul{list-style-type:none;margin-left:0}.widget_wpcom_social_media_icons_widget li{border:0;display:inline;margin-right:.5em}.widget_wpcom_social_media_icons_widget li a{border:0;text-decoration:none}.widget_wpcom_social_media_icons_widget .genericon{font-family:Genericons}.widget_wpcom_social_media_icons_widget .screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important;height:1px;width:1px;overflow:hidden}.widget_wpcom_social_media_icons_widget .screen-reader-text:active,.widget_wpcom_social_media_icons_widget .screen-reader-text:focus,.widget_wpcom_social_media_icons_widget .screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.widgets-grid-layout{width:100%}.widgets-grid-layout:after,.widgets-grid-layout:before{content:" ";display:table}.widgets-grid-layout:after{clear:both}.widget-grid-view-image{float:left;max-width:50%}.widget-grid-view-image a{display:block;margin:0 2px 4px 0}.widget-grid-view-image:nth-child(even){float:right}.widget-grid-view-image:nth-child(even) a{margin:0 0 4px 2px}.widgets-grid-layout .widget-grid-view-image img{max-width:100%;height:auto}.widgets-multi-column-grid ul{overflow:hidden;padding:0;margin:0;list-style-type:none}.widgets-multi-column-grid ul li{background:0 0;clear:none;float:left;margin:0 -5px -3px 0;padding:0 8px 6px 0;border:none;list-style-type:none!important}.widgets-multi-column-grid ul li a{background:0 0;margin:0;padding:0;border:0}.widgets-multi-column-grid .avatar{vertical-align:middle}.widgets-list-layout{padding:0;margin:0;list-style-type:none}.widgets-list-layout li:after,.widgets-list-layout li:before{content:"";display:table}.widgets-list-layout li:after{clear:both}.widgets-list-layout li{zoom:1;margin-bottom:1em;list-style-type:none!important}.widgets-list-layout .widgets-list-layout-blavatar{float:left;width:21.276596%;max-width:40px;height:auto}.widgets-list-layout-links{float:right;width:73.404255%}.widgets-list-layout span{opacity:.5}.widgets-list-layout span:hover{opacity:.8}
|
functions.opengraph.php
CHANGED
@@ -55,7 +55,7 @@ function jetpack_og_tags() {
|
|
55 |
$description_length = 197;
|
56 |
|
57 |
if ( is_home() || is_front_page() ) {
|
58 |
-
$site_type =
|
59 |
$tags['og:type'] = ! empty( $site_type ) ? $site_type : 'website';
|
60 |
$tags['og:title'] = get_bloginfo( 'name' );
|
61 |
$tags['og:description'] = get_bloginfo( 'description' );
|
@@ -67,7 +67,7 @@ function jetpack_og_tags() {
|
|
67 |
$tags['og:url'] = home_url( '/' );
|
68 |
|
69 |
// Associate a blog's root path with one or more Facebook accounts
|
70 |
-
$facebook_admins =
|
71 |
if ( ! empty( $facebook_admins ) )
|
72 |
$tags['fb:admins'] = $facebook_admins;
|
73 |
|
55 |
$description_length = 197;
|
56 |
|
57 |
if ( is_home() || is_front_page() ) {
|
58 |
+
$site_type = Jetpack_Options::get_option_and_ensure_autoload( 'open_graph_protocol_site_type', '' );
|
59 |
$tags['og:type'] = ! empty( $site_type ) ? $site_type : 'website';
|
60 |
$tags['og:title'] = get_bloginfo( 'name' );
|
61 |
$tags['og:description'] = get_bloginfo( 'description' );
|
67 |
$tags['og:url'] = home_url( '/' );
|
68 |
|
69 |
// Associate a blog's root path with one or more Facebook accounts
|
70 |
+
$facebook_admins = Jetpack_Options::get_option_and_ensure_autoload( 'facebook_admins', array() );
|
71 |
if ( ! empty( $facebook_admins ) )
|
72 |
$tags['fb:admins'] = $facebook_admins;
|
73 |
|
jetpack.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin URI: http://jetpack.com
|
6 |
* Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.
|
7 |
* Author: Automattic
|
8 |
-
* Version: 4.
|
9 |
* Author URI: http://jetpack.com
|
10 |
* License: GPL2+
|
11 |
* Text Domain: jetpack
|
@@ -14,7 +14,7 @@
|
|
14 |
|
15 |
define( 'JETPACK__MINIMUM_WP_VERSION', '4.4' );
|
16 |
|
17 |
-
define( 'JETPACK__VERSION', '4.
|
18 |
define( 'JETPACK_MASTER_USER', true );
|
19 |
define( 'JETPACK__API_VERSION', 1 );
|
20 |
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
@@ -43,13 +43,12 @@ function jetpack_require_lib_dir() {
|
|
43 |
add_filter( 'jetpack_require_lib_dir', 'jetpack_require_lib_dir' );
|
44 |
|
45 |
// @todo: Abstract out the admin functions, and only include them if is_admin()
|
46 |
-
// @todo: Only include things like class.jetpack-sync.php if we're connected.
|
47 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack.php' );
|
48 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-network.php' );
|
49 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client.php' );
|
50 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-data.php' );
|
51 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php' );
|
52 |
-
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-sync.php'
|
53 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-options.php' );
|
54 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php' );
|
55 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php' );
|
5 |
* Plugin URI: http://jetpack.com
|
6 |
* Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.
|
7 |
* Author: Automattic
|
8 |
+
* Version: 4.2
|
9 |
* Author URI: http://jetpack.com
|
10 |
* License: GPL2+
|
11 |
* Text Domain: jetpack
|
14 |
|
15 |
define( 'JETPACK__MINIMUM_WP_VERSION', '4.4' );
|
16 |
|
17 |
+
define( 'JETPACK__VERSION', '4.2' );
|
18 |
define( 'JETPACK_MASTER_USER', true );
|
19 |
define( 'JETPACK__API_VERSION', 1 );
|
20 |
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
43 |
add_filter( 'jetpack_require_lib_dir', 'jetpack_require_lib_dir' );
|
44 |
|
45 |
// @todo: Abstract out the admin functions, and only include them if is_admin()
|
|
|
46 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack.php' );
|
47 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-network.php' );
|
48 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client.php' );
|
49 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-data.php' );
|
50 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php' );
|
51 |
+
require_once( JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-actions.php' );
|
52 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-options.php' );
|
53 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php' );
|
54 |
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php' );
|
json-endpoints.php
CHANGED
@@ -85,6 +85,8 @@ require_once( $json_endpoints_dir . 'class.wpcom-json-api-update-customcss.php'
|
|
85 |
// v1.2
|
86 |
// **********
|
87 |
require_once( $json_endpoints_dir . 'class.wpcom-json-api-update-post-v1-2-endpoint.php' );
|
|
|
|
|
88 |
|
89 |
// Jetpack Only Endpoints
|
90 |
$json_jetpack_endpoints_dir = dirname( __FILE__ ) . '/json-endpoints/jetpack/';
|
@@ -116,6 +118,27 @@ new WPCOM_JSON_API_GET_Site_Endpoint( array(
|
|
116 |
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/',
|
117 |
) );
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
new WPCOM_JSON_API_GET_Post_Counts_V1_1_Endpoint( array(
|
120 |
'description' => 'Get number of posts in the post type groups by post status',
|
121 |
'group' => 'sites',
|
@@ -2385,6 +2408,26 @@ new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
|
2385 |
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/settings?pretty=1',
|
2386 |
) );
|
2387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2388 |
new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
2389 |
'description' => 'Update settings for a site.',
|
2390 |
'group' => '__do_not_document',
|
@@ -2396,6 +2439,80 @@ new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
|
2396 |
'$site' => '(int|string) Site ID or domain',
|
2397 |
),
|
2398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2399 |
'request_format' => array(
|
2400 |
'blogname' => '(string) Blog name',
|
2401 |
'blogdescription' => '(string) Blog description',
|
@@ -2432,6 +2549,7 @@ new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
|
2432 |
'moderation_keys' => '(string) Words or phrases that trigger comment moderation, one per line',
|
2433 |
'blacklist_keys' => '(string) Words or phrases that mark comment spam, one per line',
|
2434 |
'lang_id' => '(int) ID for language blog is written in',
|
|
|
2435 |
'wga' => '(array) Google Analytics Settings',
|
2436 |
'disabled_likes' => '(bool) Are likes globally disabled (they can still be turned on per post)?',
|
2437 |
'disabled_reblogs' => '(bool) Are reblogs disabled on posts?',
|
@@ -2443,14 +2561,19 @@ new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
|
2443 |
'twitter_via' => '(string) Twitter username to include in tweets when people share using the Twitter button',
|
2444 |
'jetpack-twitter-cards-site-tag' => '(string) The Twitter username of the owner of the site\'s domain.',
|
2445 |
'eventbrite_api_token' => '(int) The Keyring token ID for an Eventbrite token to associate with the site',
|
2446 |
-
'holidaysnow' => '(bool) Enable snowfall on
|
|
|
|
|
|
|
|
|
|
|
2447 |
),
|
2448 |
|
2449 |
'response_format' => array(
|
2450 |
'updated' => '(array)'
|
2451 |
),
|
2452 |
|
2453 |
-
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/settings?pretty=1',
|
2454 |
) );
|
2455 |
|
2456 |
/**
|
85 |
// v1.2
|
86 |
// **********
|
87 |
require_once( $json_endpoints_dir . 'class.wpcom-json-api-update-post-v1-2-endpoint.php' );
|
88 |
+
require_once( $json_endpoints_dir . 'class.wpcom-json-api-site-settings-v1-2-endpoint.php' );
|
89 |
+
require_once( $json_endpoints_dir . 'class.wpcom-json-api-get-site-v1-2-endpoint.php' );
|
90 |
|
91 |
// Jetpack Only Endpoints
|
92 |
$json_jetpack_endpoints_dir = dirname( __FILE__ ) . '/json-endpoints/jetpack/';
|
118 |
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/',
|
119 |
) );
|
120 |
|
121 |
+
new WPCOM_JSON_API_GET_Site_V1_2_Endpoint( array(
|
122 |
+
'description' => 'Get information about a site.',
|
123 |
+
'group' => 'sites',
|
124 |
+
'stat' => 'sites:X',
|
125 |
+
'allowed_if_flagged' => true,
|
126 |
+
'method' => 'GET',
|
127 |
+
'min_version' => '1.2',
|
128 |
+
'path' => '/sites/%s',
|
129 |
+
'path_labels' => array(
|
130 |
+
'$site' => '(int|string) Site ID or domain',
|
131 |
+
),
|
132 |
+
|
133 |
+
'query_parameters' => array(
|
134 |
+
'context' => false,
|
135 |
+
),
|
136 |
+
|
137 |
+
'response_format' => WPCOM_JSON_API_GET_Site_V1_2_Endpoint::$site_format,
|
138 |
+
|
139 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.2/sites/en.blog.wordpress.com/',
|
140 |
+
) );
|
141 |
+
|
142 |
new WPCOM_JSON_API_GET_Post_Counts_V1_1_Endpoint( array(
|
143 |
'description' => 'Get number of posts in the post type groups by post status',
|
144 |
'group' => 'sites',
|
2408 |
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/settings?pretty=1',
|
2409 |
) );
|
2410 |
|
2411 |
+
new WPCOM_JSON_API_Site_Settings_V1_2_Endpoint( array(
|
2412 |
+
'description' => 'Get detailed settings information about a site.',
|
2413 |
+
'group' => '__do_not_document',
|
2414 |
+
'stat' => 'sites:X',
|
2415 |
+
'min_version' => '1.2',
|
2416 |
+
'method' => 'GET',
|
2417 |
+
'path' => '/sites/%s/settings',
|
2418 |
+
'path_labels' => array(
|
2419 |
+
'$site' => '(int|string) Site ID or domain',
|
2420 |
+
),
|
2421 |
+
|
2422 |
+
'query_parameters' => array(
|
2423 |
+
'context' => false,
|
2424 |
+
),
|
2425 |
+
|
2426 |
+
'response_format' => WPCOM_JSON_API_Site_Settings_Endpoint::$site_format,
|
2427 |
+
|
2428 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.2/sites/en.blog.wordpress.com/settings?pretty=1',
|
2429 |
+
) );
|
2430 |
+
|
2431 |
new WPCOM_JSON_API_Site_Settings_Endpoint( array(
|
2432 |
'description' => 'Update settings for a site.',
|
2433 |
'group' => '__do_not_document',
|
2439 |
'$site' => '(int|string) Site ID or domain',
|
2440 |
),
|
2441 |
|
2442 |
+
'request_format' => array(
|
2443 |
+
'blogname' => '(string) Blog name',
|
2444 |
+
'blogdescription' => '(string) Blog description',
|
2445 |
+
'default_pingback_flag' => '(bool) Notify blogs linked from article?',
|
2446 |
+
'default_ping_status' => '(bool) Allow link notifications from other blogs?',
|
2447 |
+
'default_comment_status' => '(bool) Allow comments on new articles?',
|
2448 |
+
'blog_public' => '(string) Site visibility; -1: private, 0: discourage search engines, 1: allow search engines',
|
2449 |
+
'jetpack_sync_non_public_post_stati' => '(bool) allow sync of post and pages with non-public posts stati',
|
2450 |
+
'jetpack_relatedposts_enabled' => '(bool) Enable related posts?',
|
2451 |
+
'jetpack_relatedposts_show_headline' => '(bool) Show headline in related posts?',
|
2452 |
+
'jetpack_relatedposts_show_thumbnails' => '(bool) Show thumbnails in related posts?',
|
2453 |
+
'jetpack_protect_whitelist' => '(array) List of IP addresses to whitelist',
|
2454 |
+
'infinite_scroll' => '(bool) Support infinite scroll of posts?',
|
2455 |
+
'default_category' => '(int) Default post category',
|
2456 |
+
'default_post_format' => '(string) Default post format',
|
2457 |
+
'require_name_email' => '(bool) Require comment authors to fill out name and email?',
|
2458 |
+
'comment_registration' => '(bool) Require users to be registered and logged in to comment?',
|
2459 |
+
'close_comments_for_old_posts' => '(bool) Automatically close comments on old posts?',
|
2460 |
+
'close_comments_days_old' => '(int) Age at which to close comments',
|
2461 |
+
'thread_comments' => '(bool) Enable threaded comments?',
|
2462 |
+
'thread_comments_depth' => '(int) Depth to thread comments',
|
2463 |
+
'page_comments' => '(bool) Break comments into pages?',
|
2464 |
+
'comments_per_page' => '(int) Number of comments to display per page',
|
2465 |
+
'default_comments_page' => '(string) newest|oldest Which page of comments to display first',
|
2466 |
+
'comment_order' => '(string) asc|desc Order to display comments within page',
|
2467 |
+
'comments_notify' => '(bool) Email me when someone comments?',
|
2468 |
+
'moderation_notify' => '(bool) Email me when a comment is helf for moderation?',
|
2469 |
+
'social_notifications_like' => '(bool) Email me when someone likes my post?',
|
2470 |
+
'social_notifications_reblog' => '(bool) Email me when someone reblogs my post?',
|
2471 |
+
'social_notifications_subscribe' => '(bool) Email me when someone follows my blog?',
|
2472 |
+
'comment_moderation' => '(bool) Moderate comments for manual approval?',
|
2473 |
+
'comment_whitelist' => '(bool) Moderate comments unless author has a previously-approved comment?',
|
2474 |
+
'comment_max_links' => '(int) Moderate comments that contain X or more links',
|
2475 |
+
'moderation_keys' => '(string) Words or phrases that trigger comment moderation, one per line',
|
2476 |
+
'blacklist_keys' => '(string) Words or phrases that mark comment spam, one per line',
|
2477 |
+
'lang_id' => '(int) ID for language blog is written in',
|
2478 |
+
'wga' => '(array) Google Analytics Settings',
|
2479 |
+
'disabled_likes' => '(bool) Are likes globally disabled (they can still be turned on per post)?',
|
2480 |
+
'disabled_reblogs' => '(bool) Are reblogs disabled on posts?',
|
2481 |
+
'jetpack_comment_likes_enabled' => '(bool) Are comment likes enabled for all comments?',
|
2482 |
+
'sharing_button_style' => '(string) Style to use for sharing buttons (icon-text, icon, text, or official)',
|
2483 |
+
'sharing_label' => '(string) Label to use for sharing buttons, e.g. "Share this:"',
|
2484 |
+
'sharing_show' => '(string|array:string) Post type or array of types where sharing buttons are to be displayed',
|
2485 |
+
'sharing_open_links' => '(string) Link target for sharing buttons (same or new)',
|
2486 |
+
'twitter_via' => '(string) Twitter username to include in tweets when people share using the Twitter button',
|
2487 |
+
'jetpack-twitter-cards-site-tag' => '(string) The Twitter username of the owner of the site\'s domain.',
|
2488 |
+
'eventbrite_api_token' => '(int) The Keyring token ID for an Eventbrite token to associate with the site',
|
2489 |
+
'holidaysnow' => '(bool) Enable snowfall on front end of site?',
|
2490 |
+
'timezone_string' => '(string) PHP-compatible timezone string like \'UTC-5\'',
|
2491 |
+
'gmt_offset' => '(int) Site offset from UTC in hours',
|
2492 |
+
'jetpack_testimonial' => '(bool) Whether testimonial custom post type is enabled for the site',
|
2493 |
+
'jetpack_testimonial_posts_per_page' => '(int) Number of testimonials to show per page',
|
2494 |
+
'jetpack_portfolio' => '(bool) Whether portfolio custom post type is enabled for the site',
|
2495 |
+
'jetpack_portfolio_posts_per_page' => '(int) Number of portfolio projects to show per page',
|
2496 |
+
),
|
2497 |
+
|
2498 |
+
'response_format' => array(
|
2499 |
+
'updated' => '(array)'
|
2500 |
+
),
|
2501 |
+
|
2502 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/settings?pretty=1',
|
2503 |
+
) );
|
2504 |
+
|
2505 |
+
new WPCOM_JSON_API_Site_Settings_V1_2_Endpoint( array(
|
2506 |
+
'description' => 'Update settings for a site.',
|
2507 |
+
'group' => '__do_not_document',
|
2508 |
+
'stat' => 'sites:X',
|
2509 |
+
'min_version' => '1.2',
|
2510 |
+
'method' => 'POST',
|
2511 |
+
'path' => '/sites/%s/settings',
|
2512 |
+
'path_labels' => array(
|
2513 |
+
'$site' => '(int|string) Site ID or domain',
|
2514 |
+
),
|
2515 |
+
|
2516 |
'request_format' => array(
|
2517 |
'blogname' => '(string) Blog name',
|
2518 |
'blogdescription' => '(string) Blog description',
|
2549 |
'moderation_keys' => '(string) Words or phrases that trigger comment moderation, one per line',
|
2550 |
'blacklist_keys' => '(string) Words or phrases that mark comment spam, one per line',
|
2551 |
'lang_id' => '(int) ID for language blog is written in',
|
2552 |
+
'locale' => '(string) locale code for language blog is written in',
|
2553 |
'wga' => '(array) Google Analytics Settings',
|
2554 |
'disabled_likes' => '(bool) Are likes globally disabled (they can still be turned on per post)?',
|
2555 |
'disabled_reblogs' => '(bool) Are reblogs disabled on posts?',
|
2561 |
'twitter_via' => '(string) Twitter username to include in tweets when people share using the Twitter button',
|
2562 |
'jetpack-twitter-cards-site-tag' => '(string) The Twitter username of the owner of the site\'s domain.',
|
2563 |
'eventbrite_api_token' => '(int) The Keyring token ID for an Eventbrite token to associate with the site',
|
2564 |
+
'holidaysnow' => '(bool) Enable snowfall on front end of site?',
|
2565 |
+
'timezone_string' => '(string) PHP-compatible timezone string like \'UTC-5\'',
|
2566 |
+
'gmt_offset' => '(int) Site offset from UTC in hours',
|
2567 |
+
'seo_meta_description' => '(string) The seo meta description for the site.',
|
2568 |
+
'advanced_seo_title_formats' => '(array) SEO meta title formats. Allowed keys: front_page, posts, pages, groups, archives',
|
2569 |
+
'verification_services_codes' => '(array) Website verification codes. Allowed keys: google, pinterest, bing, yandex',
|
2570 |
),
|
2571 |
|
2572 |
'response_format' => array(
|
2573 |
'updated' => '(array)'
|
2574 |
),
|
2575 |
|
2576 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.2/sites/en.blog.wordpress.com/settings?pretty=1',
|
2577 |
) );
|
2578 |
|
2579 |
/**
|
json-endpoints/class.wpcom-json-api-comment-endpoint.php
CHANGED
@@ -80,6 +80,8 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint {
|
|
80 |
$comment->comment_author_email && $comment->comment_author
|
81 |
&&
|
82 |
isset( $this->api->token_details['user'] )
|
|
|
|
|
83 |
&&
|
84 |
$this->api->token_details['user']['user_email'] === $comment->comment_author_email
|
85 |
&&
|
80 |
$comment->comment_author_email && $comment->comment_author
|
81 |
&&
|
82 |
isset( $this->api->token_details['user'] )
|
83 |
+
&&
|
84 |
+
isset( $this->api->token_details['user']['user_email'] )
|
85 |
&&
|
86 |
$this->api->token_details['user']['user_email'] === $comment->comment_author_email
|
87 |
&&
|
json-endpoints/class.wpcom-json-api-get-site-endpoint.php
CHANGED
@@ -171,7 +171,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
|
|
171 |
array_intersect( $default_fields, $this->fields_to_include ) :
|
172 |
$default_fields;
|
173 |
|
174 |
-
if ( ! is_user_member_of_blog(
|
175 |
$response_keys = array_intersect( $response_keys, self::$no_member_fields );
|
176 |
}
|
177 |
|
@@ -459,7 +459,8 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
|
|
459 |
$response->{ $key } = $value;
|
460 |
}
|
461 |
|
462 |
-
|
|
|
463 |
$wpcom_member_response = $this->render_response_keys( self::$jetpack_response_field_member_additions );
|
464 |
|
465 |
foreach( $wpcom_member_response as $key => $value ) {
|
171 |
array_intersect( $default_fields, $this->fields_to_include ) :
|
172 |
$default_fields;
|
173 |
|
174 |
+
if ( ! is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) ) {
|
175 |
$response_keys = array_intersect( $response_keys, self::$no_member_fields );
|
176 |
}
|
177 |
|
459 |
$response->{ $key } = $value;
|
460 |
}
|
461 |
|
462 |
+
$token_details = (object) $this->api->token_details;
|
463 |
+
if ( is_user_member_of_blog( get_current_user_id(), get_current_blog_id() ) || 'blog' === $token_details->access ) {
|
464 |
$wpcom_member_response = $this->render_response_keys( self::$jetpack_response_field_member_additions );
|
465 |
|
466 |
foreach( $wpcom_member_response as $key => $value ) {
|
json-endpoints/class.wpcom-json-api-post-endpoint.php
CHANGED
@@ -630,7 +630,6 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint {
|
|
630 |
$result['duration'] = (int) $metadata['duration'];
|
631 |
}
|
632 |
|
633 |
-
/** This filter is documented in class.jetpack-sync.php */
|
634 |
return (object) apply_filters( 'get_attachment', $result );
|
635 |
}
|
636 |
|
630 |
$result['duration'] = (int) $metadata['duration'];
|
631 |
}
|
632 |
|
|
|
633 |
return (object) apply_filters( 'get_attachment', $result );
|
634 |
}
|
635 |
|
json-endpoints/class.wpcom-json-api-site-settings-endpoint.php
CHANGED
@@ -158,8 +158,8 @@ class WPCOM_JSON_API_Site_Settings_Endpoint extends WPCOM_JSON_API_Endpoint {
|
|
158 |
'jetpack_sync_non_public_post_stati' => (bool) Jetpack_Options::get_option( 'sync_non_public_post_stati' ),
|
159 |
'jetpack_relatedposts_allowed' => (bool) $this->jetpack_relatedposts_supported(),
|
160 |
'jetpack_relatedposts_enabled' => (bool) $jetpack_relatedposts_options[ 'enabled' ],
|
161 |
-
'jetpack_relatedposts_show_headline' => (bool) $jetpack_relatedposts_options[ 'show_headline' ],
|
162 |
-
'jetpack_relatedposts_show_thumbnails' => (bool) $jetpack_relatedposts_options[ 'show_thumbnails' ],
|
163 |
'default_category' => (int) get_option('default_category'),
|
164 |
'post_categories' => (array) $post_categories,
|
165 |
'default_post_format' => get_option( 'default_post_format' ),
|
158 |
'jetpack_sync_non_public_post_stati' => (bool) Jetpack_Options::get_option( 'sync_non_public_post_stati' ),
|
159 |
'jetpack_relatedposts_allowed' => (bool) $this->jetpack_relatedposts_supported(),
|
160 |
'jetpack_relatedposts_enabled' => (bool) $jetpack_relatedposts_options[ 'enabled' ],
|
161 |
+
'jetpack_relatedposts_show_headline' => (bool) isset( $jetpack_relatedposts_options[ 'show_headline' ] ) ? $jetpack_relatedposts_options[ 'show_headline' ] : false,
|
162 |
+
'jetpack_relatedposts_show_thumbnails' => (bool) isset( $jetpack_relatedposts_options[ 'show_thumbnails' ] ) ? $jetpack_relatedposts_options[ 'show_thumbnails' ] : false,
|
163 |
'default_category' => (int) get_option('default_category'),
|
164 |
'post_categories' => (array) $post_categories,
|
165 |
'default_post_format' => get_option( 'default_post_format' ),
|
json-endpoints/class.wpcom-json-api-update-comment-endpoint.php
CHANGED
@@ -168,7 +168,7 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp
|
|
168 |
}
|
169 |
|
170 |
$comment_status = wp_get_comment_status( $comment->comment_ID );
|
171 |
-
if ( $comment_status !== $update['
|
172 |
return new WP_Error( 'unauthorized', 'User cannot moderate comments', 403 );
|
173 |
}
|
174 |
|
168 |
}
|
169 |
|
170 |
$comment_status = wp_get_comment_status( $comment->comment_ID );
|
171 |
+
if ( $comment_status !== $update['comment_status'] && !current_user_can( 'moderate_comments' ) ) {
|
172 |
return new WP_Error( 'unauthorized', 'User cannot moderate comments', 403 );
|
173 |
}
|
174 |
|
json-endpoints/jetpack/class.jetpack-json-api-plugins-endpoint.php
CHANGED
@@ -120,7 +120,8 @@ abstract class Jetpack_JSON_API_Plugins_Endpoint extends Jetpack_JSON_API_Endpoi
|
|
120 |
|
121 |
protected function get_plugins() {
|
122 |
$plugins = array();
|
123 |
-
|
|
|
124 |
foreach( $this->plugins as $plugin ) {
|
125 |
if ( ! isset( $installed_plugins[ $plugin ] ) )
|
126 |
continue;
|
120 |
|
121 |
protected function get_plugins() {
|
122 |
$plugins = array();
|
123 |
+
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
|
124 |
+
$installed_plugins = apply_filters( 'all_plugins', get_plugins() );
|
125 |
foreach( $this->plugins as $plugin ) {
|
126 |
if ( ! isset( $installed_plugins[ $plugin ] ) )
|
127 |
continue;
|
json-endpoints/jetpack/class.jetpack-json-api-plugins-install-endpoint.php
CHANGED
@@ -72,7 +72,8 @@ class Jetpack_JSON_API_Plugins_Install_Endpoint extends Jetpack_JSON_API_Plugins
|
|
72 |
}
|
73 |
|
74 |
protected static function get_plugin_id_by_slug( $slug ) {
|
75 |
-
|
|
|
76 |
if ( ! is_array( $plugins ) ) {
|
77 |
return false;
|
78 |
}
|
72 |
}
|
73 |
|
74 |
protected static function get_plugin_id_by_slug( $slug ) {
|
75 |
+
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
|
76 |
+
$plugins = apply_filters( 'all_plugins', get_plugins() );
|
77 |
if ( ! is_array( $plugins ) ) {
|
78 |
return false;
|
79 |
}
|
json-endpoints/jetpack/class.jetpack-json-api-sync-endpoint.php
CHANGED
@@ -1,14 +1,177 @@
|
|
1 |
<?php
|
2 |
|
|
|
3 |
class Jetpack_JSON_API_Sync_Endpoint extends Jetpack_JSON_API_Endpoint {
|
4 |
-
// POST /sites/%s/sync
|
5 |
protected $needed_capabilities = 'manage_options';
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
protected function result() {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
}
|
1 |
<?php
|
2 |
|
3 |
+
// POST /sites/%s/sync
|
4 |
class Jetpack_JSON_API_Sync_Endpoint extends Jetpack_JSON_API_Endpoint {
|
|
|
5 |
protected $needed_capabilities = 'manage_options';
|
6 |
|
7 |
+
protected function validate_call( $_blog_id, $capability, $check_manage_active = true ) {
|
8 |
+
parent::validate_call( $_blog_id, $capability, false );
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function result() {
|
12 |
+
$args = $this->input();
|
13 |
+
|
14 |
+
$modules = null;
|
15 |
+
|
16 |
+
// convert list of modules in comma-delimited format into an array
|
17 |
+
// of "$modulename => true"
|
18 |
+
if ( isset( $args['modules'] ) && ! empty( $args['modules'] ) ) {
|
19 |
+
$modules = array_map( '__return_true', array_flip( array_map( 'trim', explode( ',', $args['modules'] ) ) ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
foreach ( array( 'posts', 'comments', 'users' ) as $module_name ) {
|
23 |
+
if ( isset( $args[ $module_name ] ) ) {
|
24 |
+
$ids = explode( ',', $args[ $module_name ] );
|
25 |
+
if ( count( $ids ) > 0 ) {
|
26 |
+
$modules[ $module_name ] = $ids;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
if ( empty( $modules ) ) {
|
32 |
+
$modules = null;
|
33 |
+
}
|
34 |
+
|
35 |
+
Jetpack_Sync_Actions::schedule_full_sync( $modules );
|
36 |
+
|
37 |
+
return array( 'scheduled' => true );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
// GET /sites/%s/sync/status
|
42 |
+
class Jetpack_JSON_API_Sync_Status_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {
|
43 |
+
protected function result() {
|
44 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-modules.php';
|
45 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-sender.php';
|
46 |
+
|
47 |
+
$sync_module = Jetpack_Sync_Modules::get_module( 'full-sync' );
|
48 |
+
$sender = Jetpack_Sync_Sender::get_instance();
|
49 |
+
$queue = $sender->get_sync_queue();
|
50 |
+
$full_queue = $sender->get_full_sync_queue();
|
51 |
+
|
52 |
+
return array_merge(
|
53 |
+
$sync_module->get_status(),
|
54 |
+
array(
|
55 |
+
'is_scheduled' => Jetpack_Sync_Actions::is_scheduled_full_sync(),
|
56 |
+
'queue_size' => $queue->size(),
|
57 |
+
'queue_lag' => $queue->lag(),
|
58 |
+
'full_queue_size' => $full_queue->size(),
|
59 |
+
'full_queue_lag' => $full_queue->lag()
|
60 |
+
)
|
61 |
+
);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
// GET /sites/%s/data-check
|
66 |
+
class Jetpack_JSON_API_Sync_Check_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {
|
67 |
protected function result() {
|
68 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-sender.php';
|
69 |
+
|
70 |
+
$sender = Jetpack_Sync_Sender::get_instance();
|
71 |
+
$sync_queue = $sender->get_sync_queue();
|
72 |
+
|
73 |
+
// lock sending from the queue while we compare checksums with the server
|
74 |
+
$result = $sync_queue->lock( 30 ); // tries to acquire the lock for up to 30 seconds
|
75 |
+
|
76 |
+
if ( ! $result ) {
|
77 |
+
$sync_queue->unlock();
|
78 |
+
|
79 |
+
return new WP_Error( 'unknown_error', 'Unknown error trying to lock the sync queue' );
|
80 |
+
}
|
81 |
+
|
82 |
+
if ( is_wp_error( $result ) ) {
|
83 |
+
$sync_queue->unlock();
|
84 |
+
|
85 |
+
return $result;
|
86 |
+
}
|
87 |
+
|
88 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-wp-replicastore.php';
|
89 |
+
|
90 |
+
$store = new Jetpack_Sync_WP_Replicastore();
|
91 |
+
|
92 |
+
$result = $store->checksum_all();
|
93 |
+
|
94 |
+
$sync_queue->unlock();
|
95 |
+
|
96 |
return $result;
|
97 |
+
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
// GET /sites/%s/data-histogram
|
102 |
+
class Jetpack_JSON_API_Sync_Histogram_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {
|
103 |
+
protected function result() {
|
104 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-sender.php';
|
105 |
+
|
106 |
+
$sender = Jetpack_Sync_Sender::get_instance();
|
107 |
+
$sync_queue = $sender->get_sync_queue();
|
108 |
+
|
109 |
+
// lock sending from the queue while we compare checksums with the server
|
110 |
+
$result = $sync_queue->lock( 30 ); // tries to acquire the lock for up to 30 seconds
|
111 |
+
|
112 |
+
if ( ! $result ) {
|
113 |
+
$sync_queue->unlock();
|
114 |
+
|
115 |
+
return new WP_Error( 'unknown_error', 'Unknown error trying to lock the sync queue' );
|
116 |
+
}
|
117 |
+
|
118 |
+
if ( is_wp_error( $result ) ) {
|
119 |
+
$sync_queue->unlock();
|
120 |
+
|
121 |
+
return $result;
|
122 |
+
}
|
123 |
+
|
124 |
+
$args = $this->query_args();
|
125 |
+
|
126 |
+
if ( isset( $args['columns'] ) ) {
|
127 |
+
$columns = array_map( 'trim', explode( ',', $args['columns'] ) );
|
128 |
+
} else {
|
129 |
+
$columns = null; // go with defaults
|
130 |
+
}
|
131 |
+
|
132 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-wp-replicastore.php';
|
133 |
+
|
134 |
+
$store = new Jetpack_Sync_WP_Replicastore();
|
135 |
+
|
136 |
+
$result = $store->checksum_histogram( $args['object_type'], $args['buckets'], $args['start_id'], $args['end_id'], $columns );
|
137 |
+
|
138 |
+
$sync_queue->unlock();
|
139 |
+
|
140 |
+
return $result;
|
141 |
+
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
// POST /sites/%s/sync/settings
|
146 |
+
class Jetpack_JSON_API_Sync_Modify_Settings_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {
|
147 |
+
protected function result() {
|
148 |
+
$args = $this->input();
|
149 |
+
|
150 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-settings.php';
|
151 |
+
|
152 |
+
$sync_settings = Jetpack_Sync_Settings::get_settings();
|
153 |
+
|
154 |
+
foreach ( $args as $key => $value ) {
|
155 |
+
if ( $value !== false ) {
|
156 |
+
if ( is_numeric( $value ) ) {
|
157 |
+
$value = (int) $value;
|
158 |
+
}
|
159 |
+
$sync_settings[ $key ] = $value;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
Jetpack_Sync_Settings::update_settings( $sync_settings );
|
164 |
+
|
165 |
+
// re-fetch so we see what's really being stored
|
166 |
+
return Jetpack_Sync_Settings::get_settings();
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
// GET /sites/%s/sync/settings
|
171 |
+
class Jetpack_JSON_API_Sync_Get_Settings_Endpoint extends Jetpack_JSON_API_Sync_Endpoint {
|
172 |
+
protected function result() {
|
173 |
+
require_once dirname( __FILE__ ) . '/../../sync/class.jetpack-sync-settings.php';
|
174 |
+
|
175 |
+
return Jetpack_Sync_Settings::get_settings();
|
176 |
}
|
177 |
}
|
json-endpoints/jetpack/json-api-jetpack-endpoints.php
CHANGED
@@ -565,6 +565,7 @@ new Jetpack_JSON_API_Core_Endpoint( array(
|
|
565 |
|
566 |
require_once( $json_jetpack_endpoints_dir . 'class.jetpack-json-api-sync-endpoint.php' );
|
567 |
|
|
|
568 |
new Jetpack_JSON_API_Sync_Endpoint( array(
|
569 |
'description' => 'Force sync of all options and constants',
|
570 |
'method' => 'POST',
|
@@ -573,12 +574,125 @@ new Jetpack_JSON_API_Sync_Endpoint( array(
|
|
573 |
'path_labels' => array(
|
574 |
'$site' => '(int|string) The site ID, The site domain'
|
575 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
'response_format' => array(
|
577 |
'scheduled' => '(bool) Whether or not the synchronisation was scheduled'
|
578 |
),
|
579 |
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/sync'
|
580 |
) );
|
581 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
require_once( $json_jetpack_endpoints_dir . 'class.jetpack-json-api-log-endpoint.php' );
|
583 |
|
584 |
new Jetpack_JSON_API_Jetpack_Log_Endpoint( array(
|
565 |
|
566 |
require_once( $json_jetpack_endpoints_dir . 'class.jetpack-json-api-sync-endpoint.php' );
|
567 |
|
568 |
+
// POST /sites/%s/sync
|
569 |
new Jetpack_JSON_API_Sync_Endpoint( array(
|
570 |
'description' => 'Force sync of all options and constants',
|
571 |
'method' => 'POST',
|
574 |
'path_labels' => array(
|
575 |
'$site' => '(int|string) The site ID, The site domain'
|
576 |
),
|
577 |
+
'request_format' => array(
|
578 |
+
'modules' => '(string) Comma-delimited set of sync modules to use (default: all of them)',
|
579 |
+
'posts' => '(string) Comma-delimited list of post IDs to sync',
|
580 |
+
'comments' => '(string) Comma-delimited list of comment IDs to sync',
|
581 |
+
'users' => '(string) Comma-delimited list of user IDs to sync',
|
582 |
+
),
|
583 |
'response_format' => array(
|
584 |
'scheduled' => '(bool) Whether or not the synchronisation was scheduled'
|
585 |
),
|
586 |
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/sync'
|
587 |
) );
|
588 |
|
589 |
+
// GET /sites/%s/sync/status
|
590 |
+
new Jetpack_JSON_API_Sync_Status_Endpoint( array(
|
591 |
+
'description' => 'Status of the current full sync or the previous full sync',
|
592 |
+
'method' => 'GET',
|
593 |
+
'path' => '/sites/%s/sync/status',
|
594 |
+
'stat' => 'sync-status',
|
595 |
+
'path_labels' => array(
|
596 |
+
'$site' => '(int|string) The site ID, The site domain'
|
597 |
+
),
|
598 |
+
'response_format' => array(
|
599 |
+
'started' => '(int|null) The unix timestamp when the last sync started',
|
600 |
+
'queue_finished' => '(int|null) The unix timestamp when the enqueuing was done for the last sync',
|
601 |
+
'sent_started' => '(int|null) The unix timestamp when the last sent process started',
|
602 |
+
'finished' => '(int|null) The unix timestamp when the last sync finished',
|
603 |
+
'total' => '(array) Count of actions that could be sent',
|
604 |
+
'queue' => '(array) Count of actions that have been added to the queue',
|
605 |
+
'sent' => '(array) Count of actions that have been sent',
|
606 |
+
'config' => '(array) Configuration of the last full sync',
|
607 |
+
'queue_size' => '(int) Number of items in the sync queue',
|
608 |
+
'queue_lag' => '(float) Time delay of the oldest item in the sync queue',
|
609 |
+
'full_queue_size' => '(int) Number of items in the full sync queue',
|
610 |
+
'full_queue_lag' => '(float) Time delay of the oldest item in the full sync queue',
|
611 |
+
'is_scheduled' => '(bool) Is a full sync scheduled via cron?'
|
612 |
+
),
|
613 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/sync/status'
|
614 |
+
) );
|
615 |
+
|
616 |
+
|
617 |
+
// GET /sites/%s/data-checksums
|
618 |
+
new Jetpack_JSON_API_Sync_Check_Endpoint( array(
|
619 |
+
'description' => 'Check that cacheable data on the site is in sync with wordpress.com',
|
620 |
+
'group' => '__do_not_document',
|
621 |
+
'method' => 'GET',
|
622 |
+
'path' => '/sites/%s/data-checksums',
|
623 |
+
'stat' => 'data-checksums',
|
624 |
+
'path_labels' => array(
|
625 |
+
'$site' => '(int|string) The site ID, The site domain'
|
626 |
+
),
|
627 |
+
'response_format' => array(
|
628 |
+
'posts' => '(string) Posts checksum',
|
629 |
+
'comments' => '(string) Comments checksum',
|
630 |
+
),
|
631 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/data-checksums'
|
632 |
+
) );
|
633 |
+
|
634 |
+
// GET /sites/%s/data-histogram
|
635 |
+
new Jetpack_JSON_API_Sync_Histogram_Endpoint( array(
|
636 |
+
'description' => 'Get a histogram of checksums for certain synced data',
|
637 |
+
'group' => '__do_not_document',
|
638 |
+
'method' => 'GET',
|
639 |
+
'path' => '/sites/%s/data-histogram',
|
640 |
+
'stat' => 'data-histogram',
|
641 |
+
'path_labels' => array(
|
642 |
+
'$site' => '(int|string) The site ID, The site domain'
|
643 |
+
),
|
644 |
+
'query_parameters' => array(
|
645 |
+
'object_type' => '(string=posts) The type of object to checksum - posts, comments or options',
|
646 |
+
'buckets' => '(int=10) The number of buckets for the checksums',
|
647 |
+
'start_id' => '(int=0) Starting ID for the range',
|
648 |
+
'end_id' => '(int=null) Ending ID for the range',
|
649 |
+
'columns' => '(string) Columns to checksum',
|
650 |
+
),
|
651 |
+
'response_format' => array(
|
652 |
+
'histogram' => '(array) Associative array of histograms by ID range, e.g. "500-999" => "abcd1234"'
|
653 |
+
),
|
654 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/data-histogram'
|
655 |
+
) );
|
656 |
+
|
657 |
+
$sync_settings_response = array(
|
658 |
+
'dequeue_max_bytes' => '(int|bool=false) Maximum bytes to read from queue in a single request',
|
659 |
+
'sync_wait_time' => '(int|bool=false) Wait time between requests in seconds if sync threshold exceeded',
|
660 |
+
'sync_wait_threshold' => '(int|bool=false) If a request to WPCOM exceeds this duration, wait sync_wait_time seconds before sending again',
|
661 |
+
'upload_max_bytes' => '(int|bool=false) Maximum bytes to send in a single request',
|
662 |
+
'upload_max_rows' => '(int|bool=false) Maximum rows to send in a single request',
|
663 |
+
'max_queue_size' => '(int|bool=false) Maximum queue size that that the queue is allowed to expand to in DB rows to prevent the DB from filling up. Needs to also meet the max_queue_lag limit.',
|
664 |
+
'max_queue_lag' => '(int|bool=false) Maximum queue lag in seconds used to prevent the DB from filling up. Needs to also meet the max_queue_size limit.',
|
665 |
+
);
|
666 |
+
|
667 |
+
// GET /sites/%s/sync/settings
|
668 |
+
new Jetpack_JSON_API_Sync_Get_Settings_Endpoint( array(
|
669 |
+
'description' => 'Update sync settings',
|
670 |
+
'method' => 'GET',
|
671 |
+
'group' => '__do_not_document',
|
672 |
+
'path' => '/sites/%s/sync/settings',
|
673 |
+
'stat' => 'write-sync-settings',
|
674 |
+
'path_labels' => array(
|
675 |
+
'$site' => '(int|string) The site ID, The site domain'
|
676 |
+
),
|
677 |
+
'response_format' => $sync_settings_response,
|
678 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/sync/settings'
|
679 |
+
) );
|
680 |
+
|
681 |
+
// POST /sites/%s/sync/settings
|
682 |
+
new Jetpack_JSON_API_Sync_Modify_Settings_Endpoint( array(
|
683 |
+
'description' => 'Update sync settings',
|
684 |
+
'method' => 'POST',
|
685 |
+
'group' => '__do_not_document',
|
686 |
+
'path' => '/sites/%s/sync/settings',
|
687 |
+
'stat' => 'write-sync-settings',
|
688 |
+
'path_labels' => array(
|
689 |
+
'$site' => '(int|string) The site ID, The site domain'
|
690 |
+
),
|
691 |
+
'request_format' => $sync_settings_response,
|
692 |
+
'response_format' => $sync_settings_response,
|
693 |
+
'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/example.wordpress.org/sync/settings'
|
694 |
+
) );
|
695 |
+
|
696 |
require_once( $json_jetpack_endpoints_dir . 'class.jetpack-json-api-log-endpoint.php' );
|
697 |
|
698 |
new Jetpack_JSON_API_Jetpack_Log_Endpoint( array(
|
modules/after-the-deadline.php
CHANGED
@@ -130,7 +130,7 @@ function register_AtD_button( $buttons ) {
|
|
130 |
function add_AtD_tinymce_plugin( $plugin_array ) {
|
131 |
$plugin = ATD_TINYMCE_4 ? 'plugin' : 'editor_plugin';
|
132 |
|
133 |
-
$plugin_array['AtD'] = plugins_url( 'after-the-deadline/tinymce/' . $plugin . '.js
|
134 |
return $plugin_array;
|
135 |
}
|
136 |
|
130 |
function add_AtD_tinymce_plugin( $plugin_array ) {
|
131 |
$plugin = ATD_TINYMCE_4 ? 'plugin' : 'editor_plugin';
|
132 |
|
133 |
+
$plugin_array['AtD'] = add_query_arg( 'v', ATD_VERSION, plugins_url( 'after-the-deadline/tinymce/' . $plugin . '.js', __FILE__ ) );
|
134 |
return $plugin_array;
|
135 |
}
|
136 |
|
modules/carousel/jetpack-carousel.js
CHANGED
@@ -692,6 +692,14 @@ jQuery(document).ready(function($) {
|
|
692 |
caption.fadeOut( 'fast' ).empty();
|
693 |
}
|
694 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
|
696 |
// Load the images for the next and previous slides.
|
697 |
$( next ).add( previous ).each( function() {
|
692 |
caption.fadeOut( 'fast' ).empty();
|
693 |
}
|
694 |
|
695 |
+
// Record pageview in WP Stats, for each new image loaded full-screen.
|
696 |
+
if ( jetpackCarouselStrings.stats ) {
|
697 |
+
new Image().src = document.location.protocol +
|
698 |
+
'//pixel.wp.com/g.gif?' +
|
699 |
+
jetpackCarouselStrings.stats +
|
700 |
+
'&post=' + encodeURIComponent( attachmentId ) +
|
701 |
+
'&rand=' + Math.random();
|
702 |
+
}
|
703 |
|
704 |
// Load the images for the next and previous slides.
|
705 |
$( next ).add( previous ).each( function() {
|
modules/carousel/jetpack-carousel.php
CHANGED
@@ -82,7 +82,7 @@ class Jetpack_Carousel {
|
|
82 |
*
|
83 |
* @since 1.6.0
|
84 |
*
|
85 |
-
* @param bool false Should Carousel be disabled? Default to
|
86 |
*/
|
87 |
return apply_filters( 'jp_carousel_maybe_disable', false );
|
88 |
}
|
@@ -166,9 +166,9 @@ class Jetpack_Carousel {
|
|
166 |
'lang' => strtolower( substr( get_locale(), 0, 2 ) ),
|
167 |
'ajaxurl' => set_url_scheme( admin_url( 'admin-ajax.php' ) ),
|
168 |
'nonce' => wp_create_nonce( 'carousel_nonce' ),
|
169 |
-
'display_exif' => $this->test_1or0_option(
|
170 |
-
'display_geo' => $this->test_1or0_option(
|
171 |
-
'background_color' => $this->carousel_background_color_sanitize(
|
172 |
'comment' => __( 'Comment', 'jetpack' ),
|
173 |
'post_comment' => __( 'Post Comment', 'jetpack' ),
|
174 |
'write_comment' => __( 'Write a Comment...', 'jetpack' ),
|
@@ -211,6 +211,24 @@ class Jetpack_Carousel {
|
|
211 |
}
|
212 |
}
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
/**
|
215 |
* Filter the strings passed to the Carousel's js file.
|
216 |
*
|
82 |
*
|
83 |
* @since 1.6.0
|
84 |
*
|
85 |
+
* @param bool false Should Carousel be disabled? Default to false.
|
86 |
*/
|
87 |
return apply_filters( 'jp_carousel_maybe_disable', false );
|
88 |
}
|
166 |
'lang' => strtolower( substr( get_locale(), 0, 2 ) ),
|
167 |
'ajaxurl' => set_url_scheme( admin_url( 'admin-ajax.php' ) ),
|
168 |
'nonce' => wp_create_nonce( 'carousel_nonce' ),
|
169 |
+
'display_exif' => $this->test_1or0_option( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_display_exif', true ) ),
|
170 |
+
'display_geo' => $this->test_1or0_option( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_display_geo', true ) ),
|
171 |
+
'background_color' => $this->carousel_background_color_sanitize( Jetpack_Options::get_option_and_ensure_autoload( 'carousel_background_color', '' ) ),
|
172 |
'comment' => __( 'Comment', 'jetpack' ),
|
173 |
'post_comment' => __( 'Post Comment', 'jetpack' ),
|
174 |
'write_comment' => __( 'Write a Comment...', 'jetpack' ),
|
211 |
}
|
212 |
}
|
213 |
|
214 |
+
/**
|
215 |
+
* Handle WP stats for images in full-screen.
|
216 |
+
* Build string with tracking info.
|
217 |
+
*/
|
218 |
+
if ( in_array( 'stats', Jetpack::get_active_modules() ) && ! Jetpack::is_development_mode() ) {
|
219 |
+
$localize_strings['stats'] = 'blog=' . Jetpack_Options::get_option( 'id' ) . '&host=' . parse_url( get_option( 'home' ), PHP_URL_HOST ) . '&v=ext&j=' . JETPACK__API_VERSION . ':' . JETPACK__VERSION;
|
220 |
+
|
221 |
+
// Set the stats as empty if user is logged in but logged-in users shouldn't be tracked.
|
222 |
+
if ( is_user_logged_in() && function_exists( 'stats_get_options' ) ) {
|
223 |
+
$stats_options = stats_get_options();
|
224 |
+
$track_loggedin_users = isset( $stats_options['reg_users'] ) ? (bool) $stats_options['reg_users'] : false;
|
225 |
+
|
226 |
+
if ( ! $track_loggedin_users ) {
|
227 |
+
$localize_strings['stats'] = '';
|
228 |
+
}
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
/**
|
233 |
* Filter the strings passed to the Carousel's js file.
|
234 |
*
|
modules/comments.php
CHANGED
@@ -17,15 +17,6 @@ if ( is_admin() ) {
|
|
17 |
require dirname( __FILE__ ) . '/comments/admin.php';
|
18 |
}
|
19 |
|
20 |
-
Jetpack_Sync::sync_options( __FILE__,
|
21 |
-
'comment_registration',
|
22 |
-
'require_name_email',
|
23 |
-
'show_avatars',
|
24 |
-
'avatar_default',
|
25 |
-
'highlander_comment_form_prompt',
|
26 |
-
'jetpack_comment_form_color_scheme'
|
27 |
-
);
|
28 |
-
|
29 |
function jetpack_comments_load() {
|
30 |
Jetpack::enable_module_configurable( __FILE__ );
|
31 |
Jetpack::module_configuration_load( __FILE__, 'jetpack_comments_configuration_load' );
|
17 |
require dirname( __FILE__ ) . '/comments/admin.php';
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
function jetpack_comments_load() {
|
21 |
Jetpack::enable_module_configurable( __FILE__ );
|
22 |
Jetpack::module_configuration_load( __FILE__, 'jetpack_comments_configuration_load' );
|
modules/contact-form/grunion-contact-form.php
CHANGED
@@ -195,20 +195,24 @@ class Grunion_Contact_Form_Plugin {
|
|
195 |
* Display the count of new feedback entries received. It's reset when user visits the Feedback screen.
|
196 |
*
|
197 |
* @since 4.1.0
|
|
|
|
|
198 |
*/
|
199 |
function unread_count( $screen ) {
|
200 |
if ( isset( $screen->post_type ) && 'feedback' == $screen->post_type ) {
|
201 |
update_option( 'feedback_unread_count', 0 );
|
202 |
} else {
|
203 |
global $menu;
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
210 |
}
|
211 |
-
break;
|
212 |
}
|
213 |
}
|
214 |
}
|
@@ -863,7 +867,7 @@ class Grunion_Contact_Form_Plugin {
|
|
863 |
* Put all the fields in `$current_row` array.
|
864 |
*/
|
865 |
foreach ( $fields as $single_field_name ) {
|
866 |
-
$current_row[] = $data[ $single_field_name ][ $i ];
|
867 |
}
|
868 |
|
869 |
/**
|
@@ -875,6 +879,30 @@ class Grunion_Contact_Form_Plugin {
|
|
875 |
fclose( $output );
|
876 |
}
|
877 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
878 |
/**
|
879 |
* Returns a string of HTML <option> items from an array of posts
|
880 |
*
|
195 |
* Display the count of new feedback entries received. It's reset when user visits the Feedback screen.
|
196 |
*
|
197 |
* @since 4.1.0
|
198 |
+
*
|
199 |
+
* @param object $screen Information about the current screen.
|
200 |
*/
|
201 |
function unread_count( $screen ) {
|
202 |
if ( isset( $screen->post_type ) && 'feedback' == $screen->post_type ) {
|
203 |
update_option( 'feedback_unread_count', 0 );
|
204 |
} else {
|
205 |
global $menu;
|
206 |
+
if ( isset( $menu ) && is_array( $menu ) && ! empty( $menu ) ) {
|
207 |
+
foreach ( $menu as $index => $menu_item ) {
|
208 |
+
if ( 'edit.php?post_type=feedback' == $menu_item[2] ) {
|
209 |
+
$unread = get_option( 'feedback_unread_count', 0 );
|
210 |
+
if ( $unread > 0 ) {
|
211 |
+
$unread_count = current_user_can( 'publish_pages' ) ? " <span class='feedback-unread count-{$unread} awaiting-mod'><span class='feedback-unread-count'>" . number_format_i18n( $unread ) . "</span></span>" : '';
|
212 |
+
$menu[ $index ][0] .= $unread_count;
|
213 |
+
}
|
214 |
+
break;
|
215 |
}
|
|
|
216 |
}
|
217 |
}
|
218 |
}
|
867 |
* Put all the fields in `$current_row` array.
|
868 |
*/
|
869 |
foreach ( $fields as $single_field_name ) {
|
870 |
+
$current_row[] = $this->esc_csv( $data[ $single_field_name ][ $i ] );
|
871 |
}
|
872 |
|
873 |
/**
|
879 |
fclose( $output );
|
880 |
}
|
881 |
|
882 |
+
/**
|
883 |
+
* Escape a string to be used in a CSV context
|
884 |
+
*
|
885 |
+
* Malicious input can inject formulas into CSV files, opening up the possibility for phishing attacks and
|
886 |
+
* disclosure of sensitive information.
|
887 |
+
*
|
888 |
+
* Additionally, Excel exposes the ability to launch arbitrary commands through the DDE protocol.
|
889 |
+
*
|
890 |
+
* @see http://www.contextis.com/resources/blog/comma-separated-vulnerabilities/
|
891 |
+
*
|
892 |
+
* @param string $field
|
893 |
+
*
|
894 |
+
* @return string
|
895 |
+
*/
|
896 |
+
function esc_csv( $field ) {
|
897 |
+
$active_content_triggers = array( '=', '+', '-', '@' );
|
898 |
+
|
899 |
+
if ( in_array( mb_substr( $field, 0, 1 ), $active_content_triggers, true ) ) {
|
900 |
+
$field = "'" . $field;
|
901 |
+
}
|
902 |
+
|
903 |
+
return $field;
|
904 |
+
}
|
905 |
+
|
906 |
/**
|
907 |
* Returns a string of HTML <option> items from an array of posts
|
908 |
*
|
modules/custom-css/csstidy/class.csstidy.php
CHANGED
@@ -246,7 +246,7 @@ class csstidy {
|
|
246 |
* @access private
|
247 |
* @version 1.3
|
248 |
*/
|
249 |
-
function
|
250 |
$this->settings['remove_bslash'] = true;
|
251 |
$this->settings['compress_colors'] = true;
|
252 |
$this->settings['compress_font-weight'] = true;
|
246 |
* @access private
|
247 |
* @version 1.3
|
248 |
*/
|
249 |
+
function __construct() {
|
250 |
$this->settings['remove_bslash'] = true;
|
251 |
$this->settings['compress_colors'] = true;
|
252 |
$this->settings['compress_font-weight'] = true;
|
modules/custom-css/csstidy/class.csstidy_optimise.php
CHANGED
@@ -47,7 +47,7 @@ class csstidy_optimise {
|
|
47 |
* @access private
|
48 |
* @version 1.0
|
49 |
*/
|
50 |
-
function
|
51 |
$this->parser = & $css;
|
52 |
$this->css = & $css->css;
|
53 |
$this->sub_value = & $css->sub_value;
|
47 |
* @access private
|
48 |
* @version 1.0
|
49 |
*/
|
50 |
+
function __construct(&$css) {
|
51 |
$this->parser = & $css;
|
52 |
$this->css = & $css->css;
|
53 |
$this->sub_value = & $css->sub_value;
|
modules/custom-css/csstidy/class.csstidy_print.php
CHANGED
@@ -66,7 +66,7 @@ class csstidy_print {
|
|
66 |
* @access private
|
67 |
* @version 1.0
|
68 |
*/
|
69 |
-
function
|
70 |
$this->parser = & $css;
|
71 |
$this->css = & $css->css;
|
72 |
$this->template = & $css->template;
|
66 |
* @access private
|
67 |
* @version 1.0
|
68 |
*/
|
69 |
+
function __construct(&$css) {
|
70 |
$this->parser = & $css;
|
71 |
$this->css = & $css->css;
|
72 |
$this->template = & $css->template;
|
modules/custom-css/csstidy/data-wp.inc.php
CHANGED
@@ -87,4 +87,5 @@ $GLOBALS['csstidy']['all_properties']['object-position'] = 'CSS3.0';
|
|
87 |
$GLOBALS['csstidy']['all_properties']['text-overflow'] = 'CSS3.0';
|
88 |
$GLOBALS['csstidy']['all_properties']['zoom'] = 'CSS3.0';
|
89 |
$GLOBALS['csstidy']['all_properties']['pointer-events'] = 'CSS3.0';
|
|
|
90 |
|
87 |
$GLOBALS['csstidy']['all_properties']['text-overflow'] = 'CSS3.0';
|
88 |
$GLOBALS['csstidy']['all_properties']['zoom'] = 'CSS3.0';
|
89 |
$GLOBALS['csstidy']['all_properties']['pointer-events'] = 'CSS3.0';
|
90 |
+
$GLOBALS['csstidy']['all_properties']['font-feature-settings'] = 'CSS3.0';
|
91 |
|
modules/custom-css/custom-css.php
CHANGED
@@ -522,7 +522,7 @@ class Jetpack_Custom_CSS {
|
|
522 |
return (bool) ( $custom_css_add === 'no' );
|
523 |
}
|
524 |
|
525 |
-
return (bool) (
|
526 |
}
|
527 |
}
|
528 |
}
|
@@ -721,7 +721,7 @@ class Jetpack_Custom_CSS {
|
|
721 |
$option = Jetpack_Custom_CSS::is_preview() ? 'safecss_preview' : 'safecss';
|
722 |
|
723 |
if ( 'safecss' == $option ) {
|
724 |
-
if (
|
725 |
$safecss_post = Jetpack_Custom_CSS::get_post();
|
726 |
|
727 |
if ( ! empty( $safecss_post['post_content'] ) ) {
|
@@ -737,7 +737,7 @@ class Jetpack_Custom_CSS {
|
|
737 |
|
738 |
// Fix for un-migrated Custom CSS
|
739 |
if ( empty( $safecss_post ) ) {
|
740 |
-
$_css =
|
741 |
if ( !empty( $_css ) ) {
|
742 |
$css = $_css;
|
743 |
}
|
@@ -997,7 +997,7 @@ class Jetpack_Custom_CSS {
|
|
997 |
* @param string $str Intro text appearing above the Custom CSS editor.
|
998 |
*/
|
999 |
echo apply_filters( 'safecss_intro_text', __( 'New to CSS? Start with a <a href="http://www.htmldog.com/guides/cssbeginner/" target="_blank">beginner tutorial</a>. Questions?
|
1000 |
-
Ask in the <a href="
|
1001 |
?></p>
|
1002 |
<p class="css-support"><?php echo __( 'Note: Custom CSS will be reset when changing themes.', 'jetpack' ); ?></p>
|
1003 |
|
@@ -1812,9 +1812,6 @@ function safecss_class() {
|
|
1812 |
require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
|
1813 |
|
1814 |
class safecss extends csstidy_optimise {
|
1815 |
-
function __construct( &$css ) {
|
1816 |
-
return $this->csstidy_optimise( $css );
|
1817 |
-
}
|
1818 |
|
1819 |
function postparse() {
|
1820 |
|
522 |
return (bool) ( $custom_css_add === 'no' );
|
523 |
}
|
524 |
|
525 |
+
return (bool) ( Jetpack_Options::get_option_and_ensure_autoload( 'safecss_add', '' ) == 'no' );
|
526 |
}
|
527 |
}
|
528 |
}
|
721 |
$option = Jetpack_Custom_CSS::is_preview() ? 'safecss_preview' : 'safecss';
|
722 |
|
723 |
if ( 'safecss' == $option ) {
|
724 |
+
if ( Jetpack_Options::get_option_and_ensure_autoload( 'safecss_revision_migrated', '0' ) ) {
|
725 |
$safecss_post = Jetpack_Custom_CSS::get_post();
|
726 |
|
727 |
if ( ! empty( $safecss_post['post_content'] ) ) {
|
737 |
|
738 |
// Fix for un-migrated Custom CSS
|
739 |
if ( empty( $safecss_post ) ) {
|
740 |
+
$_css = Jetpack_Options::get_option_and_ensure_autoload( 'safecss', '' );
|
741 |
if ( !empty( $_css ) ) {
|
742 |
$css = $_css;
|
743 |
}
|
997 |
* @param string $str Intro text appearing above the Custom CSS editor.
|
998 |
*/
|
999 |
echo apply_filters( 'safecss_intro_text', __( 'New to CSS? Start with a <a href="http://www.htmldog.com/guides/cssbeginner/" target="_blank">beginner tutorial</a>. Questions?
|
1000 |
+
Ask in the <a href="https://wordpress.org/support/forum/themes-and-templates" target="_blank">Themes and Templates forum</a>.', 'jetpack' ) );
|
1001 |
?></p>
|
1002 |
<p class="css-support"><?php echo __( 'Note: Custom CSS will be reset when changing themes.', 'jetpack' ); ?></p>
|
1003 |
|
1812 |
require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
|
1813 |
|
1814 |
class safecss extends csstidy_optimise {
|
|
|
|
|
|
|
1815 |
|
1816 |
function postparse() {
|
1817 |
|
modules/custom-post-types/portfolios.php
CHANGED
@@ -35,7 +35,10 @@ class Jetpack_Portfolio {
|
|
35 |
// Make sure the post types are loaded for imports
|
36 |
add_action( 'import_start', array( $this, 'register_post_types' ) );
|
37 |
|
38 |
-
|
|
|
|
|
|
|
39 |
|
40 |
// Bail early if Portfolio option is not set and the theme doesn't declare support
|
41 |
if ( empty( $setting ) && ! $this->site_supports_custom_post_type() ) {
|
@@ -470,6 +473,15 @@ class Jetpack_Portfolio {
|
|
470 |
return $post_types;
|
471 |
}
|
472 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
/**
|
474 |
* Our [portfolio] shortcode.
|
475 |
* Prints Portfolio data styled to look good on *any* theme.
|
35 |
// Make sure the post types are loaded for imports
|
36 |
add_action( 'import_start', array( $this, 'register_post_types' ) );
|
37 |
|
38 |
+
// Add to REST API post type whitelist
|
39 |
+
add_filter( 'rest_api_allowed_post_types', array( $this, 'allow_portfolio_rest_api_type' ) );
|
40 |
+
|
41 |
+
$setting = Jetpack_Options::get_option_and_ensure_autoload( self::OPTION_NAME, '0' );
|
42 |
|
43 |
// Bail early if Portfolio option is not set and the theme doesn't declare support
|
44 |
if ( empty( $setting ) && ! $this->site_supports_custom_post_type() ) {
|
473 |
return $post_types;
|
474 |
}
|
475 |
|
476 |
+
/**
|
477 |
+
* Add to REST API post type whitelist
|
478 |
+
*/
|
479 |
+
function allow_portfolio_rest_api_type( $post_types ) {
|
480 |
+
$post_types[] = self::CUSTOM_POST_TYPE;
|
481 |
+
|
482 |
+
return $post_types;
|
483 |
+
}
|
484 |
+
|
485 |
/**
|
486 |
* Our [portfolio] shortcode.
|
487 |
* Prints Portfolio data styled to look good on *any* theme.
|
modules/custom-post-types/testimonial.php
CHANGED
@@ -47,7 +47,7 @@ class Jetpack_Testimonial {
|
|
47 |
// Check on theme switch if theme supports CPT and setting is disabled
|
48 |
add_action( 'after_switch_theme', array( $this, 'activation_post_type_support' ) );
|
49 |
|
50 |
-
$setting =
|
51 |
|
52 |
// Bail early if Testimonial option is not set and the theme doesn't declare support
|
53 |
if ( empty( $setting ) && ! $this->site_supports_custom_post_type() ) {
|
47 |
// Check on theme switch if theme supports CPT and setting is disabled
|
48 |
add_action( 'after_switch_theme', array( $this, 'activation_post_type_support' ) );
|
49 |
|
50 |
+
$setting = Jetpack_Options::get_option_and_ensure_autoload( self::OPTION_NAME, '0' );
|
51 |
|
52 |
// Bail early if Testimonial option is not set and the theme doesn't declare support
|
53 |
if ( empty( $setting ) && ! $this->site_supports_custom_post_type() ) {
|
modules/enhanced-distribution.php
CHANGED
@@ -11,9 +11,6 @@
|
|
11 |
* Additional Search Queries: google, seo, firehose, search, broadcast, broadcasting
|
12 |
*/
|
13 |
|
14 |
-
Jetpack_Sync::sync_posts( __FILE__ );
|
15 |
-
Jetpack_Sync::sync_comments( __FILE__ );
|
16 |
-
|
17 |
function jetpack_enhanced_distribution_activate() {
|
18 |
Jetpack::check_privacy( __FILE__ );
|
19 |
}
|
@@ -53,3 +50,24 @@ if ( isset( $_GET['get_freshly_pressed_data'] ) ) {
|
|
53 |
}
|
54 |
}
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
* Additional Search Queries: google, seo, firehose, search, broadcast, broadcasting
|
12 |
*/
|
13 |
|
|
|
|
|
|
|
14 |
function jetpack_enhanced_distribution_activate() {
|
15 |
Jetpack::check_privacy( __FILE__ );
|
16 |
}
|
50 |
}
|
51 |
}
|
52 |
}
|
53 |
+
|
54 |
+
add_action( 'rss_head', 'jetpack_enhanced_distribution_feed_id' );
|
55 |
+
add_action( 'rss_item', 'jetpack_enhanced_distribution_post_id' );
|
56 |
+
add_action( 'rss2_head', 'jetpack_enhanced_distribution_feed_id' );
|
57 |
+
add_action( 'rss2_item', 'jetpack_enhanced_distribution_post_id' );
|
58 |
+
|
59 |
+
function jetpack_enhanced_distribution_feed_id(){
|
60 |
+
(int) $id = Jetpack_Options::get_option( 'id' );
|
61 |
+
if ( $id > 0 ) {
|
62 |
+
$output = sprintf( '<site xmlns="com-wordpress:feed-additions:1">%d</site>', $id );
|
63 |
+
echo $output;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
function jetpack_enhanced_distribution_post_id(){
|
68 |
+
$id = get_the_ID();
|
69 |
+
if ( $id ) {
|
70 |
+
$output = sprintf( '<post-id xmlns="com-wordpress:feed-additions:1">%d</post-id>', $id );
|
71 |
+
echo $output;
|
72 |
+
}
|
73 |
+
}
|
modules/gravatar-hovercards.php
CHANGED
@@ -181,7 +181,7 @@ function grofiles_attach_cards() {
|
|
181 |
}
|
182 |
|
183 |
// Is the display of Gravatar Hovercards disabled?
|
184 |
-
if ( 'disabled' ==
|
185 |
return;
|
186 |
}
|
187 |
|
181 |
}
|
182 |
|
183 |
// Is the display of Gravatar Hovercards disabled?
|
184 |
+
if ( 'disabled' == Jetpack_Options::get_option_and_ensure_autoload( 'gravatar_disable_hovercards', '0' ) ) {
|
185 |
return;
|
186 |
}
|
187 |
|
modules/infinite-scroll.php
CHANGED
@@ -171,7 +171,7 @@ class Jetpack_Infinite_Scroll_Extras {
|
|
171 |
}
|
172 |
|
173 |
// Check if Google Analytics tracking is requested
|
174 |
-
$settings['google_analytics'] = (bool)
|
175 |
|
176 |
return $settings;
|
177 |
}
|
171 |
}
|
172 |
|
173 |
// Check if Google Analytics tracking is requested
|
174 |
+
$settings['google_analytics'] = (bool) Jetpack_Options::get_option_and_ensure_autoload( $this->option_name_google_analytics, 0 );
|
175 |
|
176 |
return $settings;
|
177 |
}
|
modules/infinite-scroll/infinity.js
CHANGED
@@ -252,15 +252,8 @@ Scroller.prototype.refresh = function() {
|
|
252 |
return;
|
253 |
}
|
254 |
|
255 |
-
// If there are no remaining posts...
|
256 |
-
if ( response.type == 'empty' ) {
|
257 |
-
// Disable the scroller.
|
258 |
-
self.disabled = true;
|
259 |
-
// Update body classes, allowing the footer to return to static positioning
|
260 |
-
self.body.addClass( 'infinity-end' ).removeClass( 'infinity-success' );
|
261 |
-
|
262 |
// If we've succeeded...
|
263 |
-
|
264 |
// If additional scripts are required by the incoming set of posts, parse them
|
265 |
if ( response.scripts ) {
|
266 |
$( response.scripts ).each( function() {
|
@@ -356,6 +349,9 @@ Scroller.prototype.refresh = function() {
|
|
356 |
self.body.trigger( 'infinite-scroll-posts-more' );
|
357 |
}
|
358 |
}
|
|
|
|
|
|
|
359 |
}
|
360 |
|
361 |
// Update currentday to the latest value returned from the server
|
252 |
return;
|
253 |
}
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
// If we've succeeded...
|
256 |
+
if ( response.type == 'success' ) {
|
257 |
// If additional scripts are required by the incoming set of posts, parse them
|
258 |
if ( response.scripts ) {
|
259 |
$( response.scripts ).each( function() {
|
349 |
self.body.trigger( 'infinite-scroll-posts-more' );
|
350 |
}
|
351 |
}
|
352 |
+
} else if ( response.lastbatch ) {
|
353 |
+
self.disabled = true;
|
354 |
+
self.body.addClass( 'infinity-end' ).removeClass( 'infinity-success' );
|
355 |
}
|
356 |
|
357 |
// Update currentday to the latest value returned from the server
|
modules/infinite-scroll/infinity.php
CHANGED
@@ -255,7 +255,7 @@ class The_Neverending_Home_Page {
|
|
255 |
self::$settings = apply_filters( 'infinite_scroll_settings', $settings );
|
256 |
}
|
257 |
|
258 |
-
/** This filter is documented in modules/infinite-scroll/infinity.php */
|
259 |
return (object) apply_filters( 'infinite_scroll_settings', self::$settings );
|
260 |
}
|
261 |
|
@@ -300,7 +300,12 @@ class The_Neverending_Home_Page {
|
|
300 |
* Is this guaranteed to be the last batch of posts?
|
301 |
*/
|
302 |
static function is_last_batch() {
|
303 |
-
|
|
|
|
|
|
|
|
|
|
|
304 |
}
|
305 |
|
306 |
/**
|
@@ -369,18 +374,25 @@ class The_Neverending_Home_Page {
|
|
369 |
if ( empty( $id ) )
|
370 |
return;
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
// Make sure there are enough posts for IS
|
373 |
-
if (
|
374 |
return;
|
|
|
375 |
|
376 |
// Add a class to the body.
|
377 |
add_filter( 'body_class', array( $this, 'body_class' ) );
|
378 |
|
379 |
// Add our scripts.
|
380 |
-
wp_enqueue_script( 'the-neverending-homepage'
|
381 |
|
382 |
// Add our default styles.
|
383 |
-
wp_enqueue_style( 'the-neverending-homepage'
|
384 |
|
385 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_spinner_scripts' ) );
|
386 |
|
@@ -735,6 +747,7 @@ class The_Neverending_Home_Page {
|
|
735 |
}
|
736 |
}
|
737 |
}
|
|
|
738 |
unset( $post_type );
|
739 |
|
740 |
// Base JS settings
|
@@ -1429,7 +1442,7 @@ class The_Neverending_Home_Page {
|
|
1429 |
*/
|
1430 |
private function default_footer() {
|
1431 |
$credits = sprintf(
|
1432 |
-
'<a href="
|
1433 |
__( 'Proudly powered by WordPress', 'jetpack' )
|
1434 |
);
|
1435 |
$credits .= sprintf(
|
255 |
self::$settings = apply_filters( 'infinite_scroll_settings', $settings );
|
256 |
}
|
257 |
|
258 |
+
/** This filter is already documented in modules/infinite-scroll/infinity.php */
|
259 |
return (object) apply_filters( 'infinite_scroll_settings', self::$settings );
|
260 |
}
|
261 |
|
300 |
* Is this guaranteed to be the last batch of posts?
|
301 |
*/
|
302 |
static function is_last_batch() {
|
303 |
+
$post_type = get_post_type();
|
304 |
+
$entries = wp_count_posts( empty( $post_type ) ? 'post' : $post_type )->publish;
|
305 |
+
if ( self::wp_query()->get( 'paged' ) && self::wp_query()->get( 'paged' ) > 1 ) {
|
306 |
+
$entries -= self::get_settings()->posts_per_page * self::wp_query()->get( 'paged' );
|
307 |
+
}
|
308 |
+
return $entries <= self::get_settings()->posts_per_page;
|
309 |
}
|
310 |
|
311 |
/**
|
374 |
if ( empty( $id ) )
|
375 |
return;
|
376 |
|
377 |
+
// Add our scripts.
|
378 |
+
wp_register_script( 'the-neverending-homepage', plugins_url( 'infinity.js', __FILE__ ), array( 'jquery' ), '4.0.0', true );
|
379 |
+
|
380 |
+
// Add our default styles.
|
381 |
+
wp_register_style( 'the-neverending-homepage', plugins_url( 'infinity.css', __FILE__ ), array(), '20140422' );
|
382 |
+
|
383 |
// Make sure there are enough posts for IS
|
384 |
+
if ( self::is_last_batch() ) {
|
385 |
return;
|
386 |
+
}
|
387 |
|
388 |
// Add a class to the body.
|
389 |
add_filter( 'body_class', array( $this, 'body_class' ) );
|
390 |
|
391 |
// Add our scripts.
|
392 |
+
wp_enqueue_script( 'the-neverending-homepage' );
|
393 |
|
394 |
// Add our default styles.
|
395 |
+
wp_enqueue_style( 'the-neverending-homepage' );
|
396 |
|
397 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_spinner_scripts' ) );
|
398 |
|
747 |
}
|
748 |
}
|
749 |
}
|
750 |
+
|
751 |
unset( $post_type );
|
752 |
|
753 |
// Base JS settings
|
1442 |
*/
|
1443 |
private function default_footer() {
|
1444 |
$credits = sprintf(
|
1445 |
+
'<a href="https://wordpress.org/" target="_blank" rel="generator">%1$s</a> ',
|
1446 |
__( 'Proudly powered by WordPress', 'jetpack' )
|
1447 |
);
|
1448 |
$credits .= sprintf(
|
modules/infinite-scroll/themes/twentyeleven.php
CHANGED
@@ -20,8 +20,10 @@ add_action( 'init', 'twenty_eleven_infinite_scroll_init' );
|
|
20 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
21 |
*/
|
22 |
function twenty_eleven_infinite_scroll_enqueue_styles() {
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
add_action( 'wp_enqueue_scripts', 'twenty_eleven_infinite_scroll_enqueue_styles', 25 );
|
27 |
|
20 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
21 |
*/
|
22 |
function twenty_eleven_infinite_scroll_enqueue_styles() {
|
23 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
24 |
+
// Add theme specific styles.
|
25 |
+
wp_enqueue_style( 'infinity-twentyeleven', plugins_url( 'twentyeleven.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' );
|
26 |
+
}
|
27 |
}
|
28 |
add_action( 'wp_enqueue_scripts', 'twenty_eleven_infinite_scroll_enqueue_styles', 25 );
|
29 |
|
modules/infinite-scroll/themes/twentyfifteen.php
CHANGED
@@ -20,7 +20,9 @@ add_action( 'after_setup_theme', 'twentyfifteen_infinite_scroll_init' );
|
|
20 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
21 |
*/
|
22 |
function twentyfifteen_infinite_scroll_enqueue_styles() {
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
add_action( 'wp_enqueue_scripts', 'twentyfifteen_infinite_scroll_enqueue_styles', 25 );
|
20 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
21 |
*/
|
22 |
function twentyfifteen_infinite_scroll_enqueue_styles() {
|
23 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
24 |
+
wp_enqueue_style( 'infinity-twentyfifteen', plugins_url( 'twentyfifteen.css', __FILE__ ), array( 'the-neverending-homepage' ), '20141022' );
|
25 |
+
wp_style_add_data( 'infinity-twentyfifteen', 'rtl', 'replace' );
|
26 |
+
}
|
27 |
}
|
28 |
add_action( 'wp_enqueue_scripts', 'twentyfifteen_infinite_scroll_enqueue_styles', 25 );
|
modules/infinite-scroll/themes/twentyfourteen.php
CHANGED
@@ -42,6 +42,8 @@ if ( function_exists( 'jetpack_is_mobile' ) ) {
|
|
42 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
43 |
*/
|
44 |
function twentyfourteen_infinite_scroll_enqueue_styles() {
|
45 |
-
|
|
|
|
|
46 |
}
|
47 |
add_action( 'wp_enqueue_scripts', 'twentyfourteen_infinite_scroll_enqueue_styles', 25 );
|
42 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
43 |
*/
|
44 |
function twentyfourteen_infinite_scroll_enqueue_styles() {
|
45 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
46 |
+
wp_enqueue_style( 'infinity-twentyfourteen', plugins_url( 'twentyfourteen.css', __FILE__ ), array( 'the-neverending-homepage' ), '20131118' );
|
47 |
+
}
|
48 |
}
|
49 |
add_action( 'wp_enqueue_scripts', 'twentyfourteen_infinite_scroll_enqueue_styles', 25 );
|
modules/infinite-scroll/themes/twentysixteen.php
CHANGED
@@ -35,7 +35,9 @@ function twentysixteen_infinite_scroll_render() {
|
|
35 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
36 |
*/
|
37 |
function twentysixteen_infinite_scroll_enqueue_styles() {
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
}
|
41 |
add_action( 'wp_enqueue_scripts', 'twentysixteen_infinite_scroll_enqueue_styles', 25 );
|
35 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
36 |
*/
|
37 |
function twentysixteen_infinite_scroll_enqueue_styles() {
|
38 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
39 |
+
wp_enqueue_style( 'infinity-twentysixteen', plugins_url( 'twentysixteen.css', __FILE__ ), array( 'the-neverending-homepage' ), '20151102' );
|
40 |
+
wp_style_add_data( 'infinity-twentysixteen', 'rtl', 'replace' );
|
41 |
+
}
|
42 |
}
|
43 |
add_action( 'wp_enqueue_scripts', 'twentysixteen_infinite_scroll_enqueue_styles', 25 );
|
modules/infinite-scroll/themes/twentyten.php
CHANGED
@@ -31,8 +31,10 @@ function twenty_ten_infinite_scroll_render() {
|
|
31 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
32 |
*/
|
33 |
function twenty_ten_infinite_scroll_enqueue_styles() {
|
34 |
-
|
35 |
-
|
|
|
|
|
36 |
}
|
37 |
add_action( 'wp_enqueue_scripts', 'twenty_ten_infinite_scroll_enqueue_styles', 25 );
|
38 |
|
31 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
32 |
*/
|
33 |
function twenty_ten_infinite_scroll_enqueue_styles() {
|
34 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
35 |
+
// Add theme specific styles.
|
36 |
+
wp_enqueue_style( 'infinity-twentyten', plugins_url( 'twentyten.css', __FILE__ ), array( 'the-neverending-homepage' ), '20121002' );
|
37 |
+
}
|
38 |
}
|
39 |
add_action( 'wp_enqueue_scripts', 'twenty_ten_infinite_scroll_enqueue_styles', 25 );
|
40 |
|
modules/infinite-scroll/themes/twentythirteen.php
CHANGED
@@ -21,6 +21,8 @@ add_action( 'after_setup_theme', 'twentythirteen_infinite_scroll_init' );
|
|
21 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
22 |
*/
|
23 |
function twentythirteen_infinite_scroll_enqueue_styles() {
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
add_action( 'wp_enqueue_scripts', 'twentythirteen_infinite_scroll_enqueue_styles', 25 );
|
21 |
* Enqueue CSS stylesheet with theme styles for Infinite Scroll.
|
22 |
*/
|
23 |
function twentythirteen_infinite_scroll_enqueue_styles() {
|
24 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
25 |
+
wp_enqueue_style( 'infinity-twentythirteen', plugins_url( 'twentythirteen.css', __FILE__ ), array( 'the-neverending-homepage' ), '20130409' );
|
26 |
+
}
|
27 |
}
|
28 |
add_action( 'wp_enqueue_scripts', 'twentythirteen_infinite_scroll_enqueue_styles', 25 );
|
modules/infinite-scroll/themes/twentytwelve.php
CHANGED
@@ -20,8 +20,10 @@ add_action( 'after_setup_theme', 'twenty_twelve_infinite_scroll_init' );
|
|
20 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
21 |
*/
|
22 |
function twenty_twelve_infinite_scroll_enqueue_styles() {
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
add_action( 'wp_enqueue_scripts', 'twenty_twelve_infinite_scroll_enqueue_styles', 25 );
|
27 |
|
20 |
* Enqueue CSS stylesheet with theme styles for infinity.
|
21 |
*/
|
22 |
function twenty_twelve_infinite_scroll_enqueue_styles() {
|
23 |
+
if ( wp_script_is( 'the-neverending-homepage' ) ) {
|
24 |
+
// Add theme specific styles.
|
25 |
+
wp_enqueue_style( 'infinity-twentytwelve', plugins_url( 'twentytwelve.css', __FILE__ ), array( 'the-neverending-homepage' ), '20120817' );
|
26 |
+
}
|
27 |
}
|
28 |
add_action( 'wp_enqueue_scripts', 'twenty_twelve_infinite_scroll_enqueue_styles', 25 );
|
29 |
|
modules/json-api.php
CHANGED
@@ -8,7 +8,4 @@
|
|
8 |
* Auto Activate: Public
|
9 |
* Module Tags: Writing, Developers
|
10 |
* Additional Search Queries: api, rest, develop, developers, json, klout, oauth
|
11 |
-
*/
|
12 |
-
|
13 |
-
add_action( 'jetpack_activate_module_json-api', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
14 |
-
add_action( 'jetpack_deactivate_module_json-api', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
8 |
* Auto Activate: Public
|
9 |
* Module Tags: Writing, Developers
|
10 |
* Additional Search Queries: api, rest, develop, developers, json, klout, oauth
|
11 |
+
*/
|
|
|
|
|
|
modules/likes.php
CHANGED
@@ -38,9 +38,6 @@ class Jetpack_Likes {
|
|
38 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
39 |
|
40 |
if ( $this->in_jetpack ) {
|
41 |
-
add_action( 'jetpack_activate_module_likes', array( $this, 'maybe_sync_content' ) );
|
42 |
-
add_action( 'jetpack_activate_module_likes', array( $this, 'module_toggle' ) );
|
43 |
-
add_action( 'jetpack_deactivate_module_likes', array( $this, 'module_toggle' ) );
|
44 |
add_action( 'jetpack_activate_module_likes', array( $this, 'set_social_notifications_like' ) );
|
45 |
add_action( 'jetpack_deactivate_module_likes', array( $this, 'delete_social_notifications_like' ) );
|
46 |
|
@@ -70,9 +67,6 @@ class Jetpack_Likes {
|
|
70 |
add_filter( 'sharing_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
|
71 |
add_action( 'start_sharing_meta_box_content', array( $this, 'meta_box_content' ) );
|
72 |
}
|
73 |
-
|
74 |
-
Jetpack_Sync::sync_options( __FILE__, 'social_notifications_like' );
|
75 |
-
|
76 |
} else { // wpcom
|
77 |
add_action( 'wpmu_new_blog', array( $this, 'enable_comment_likes' ), 10, 1 );
|
78 |
add_action( 'admin_init', array( $this, 'add_meta_box' ) );
|
@@ -92,17 +86,6 @@ class Jetpack_Likes {
|
|
92 |
add_action( 'sharing_admin_update', array( $this, 'admin_settings_callback' ), 20 );
|
93 |
}
|
94 |
|
95 |
-
function maybe_sync_content() {
|
96 |
-
if ( Jetpack::init()->sync->reindex_needed() ) {
|
97 |
-
Jetpack::init()->sync->reindex_trigger();
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
function module_toggle() {
|
102 |
-
$jetpack = Jetpack::init();
|
103 |
-
$jetpack->sync->register( 'noop' );
|
104 |
-
}
|
105 |
-
|
106 |
/**
|
107 |
* Set the social_notifications_like option to `on` when the Likes module is activated.
|
108 |
*
|
@@ -140,14 +123,14 @@ class Jetpack_Likes {
|
|
140 |
// Do we really need `admin_styles`? With the new admin UI, it's breaking some bits.
|
141 |
// Jetpack::init()->admin_styles();
|
142 |
}
|
|
|
143 |
/**
|
144 |
-
* Load
|
145 |
* @return null
|
146 |
*/
|
147 |
function load_styles_register_scripts() {
|
148 |
-
|
149 |
-
|
150 |
-
if( $this->in_jetpack ) {
|
151 |
$this->register_scripts();
|
152 |
}
|
153 |
}
|
@@ -164,9 +147,8 @@ class Jetpack_Likes {
|
|
164 |
|
165 |
/**
|
166 |
* Replaces the "Sharing" title for the post screen metabox with "Likes and Shares"
|
167 |
-
* @param string $title The current title of the metabox, not needed/used.
|
168 |
*/
|
169 |
-
function add_likes_to_sharing_meta_box_title(
|
170 |
return __( 'Likes and Shares', 'jetpack' );
|
171 |
}
|
172 |
|
@@ -233,7 +215,6 @@ class Jetpack_Likes {
|
|
233 |
// site like setting.
|
234 |
if ( ( $this->is_enabled_sitewide() && empty( $_POST['wpl_enable_post_likes'] ) ) || ( ! $this->is_enabled_sitewide() && !empty( $_POST['wpl_enable_post_likes'] ) ) ) {
|
235 |
update_post_meta( $post_id, 'switch_like_status', 1 );
|
236 |
-
//$g_gif = file_get_contents( 'http://pixel.wp.com/g.gif?v=wpcom-no-pv&x_likes=switched_post_like_status' ); @todo stat
|
237 |
} else {
|
238 |
delete_post_meta( $post_id, 'switch_like_status' );
|
239 |
}
|
@@ -635,16 +616,6 @@ class Jetpack_Likes {
|
|
635 |
add_action( 'manage_pages_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );
|
636 |
add_action( 'admin_print_styles-edit.php', array( $this, 'load_admin_css' ) );
|
637 |
add_action( "admin_print_scripts-edit.php", array( $this, 'enqueue_admin_scripts' ) );
|
638 |
-
|
639 |
-
|
640 |
-
if ( $this->in_jetpack ) {
|
641 |
-
$post_stati = get_post_stati( array( 'public' => true ) ); // All public post stati
|
642 |
-
$post_stati[] = 'private'; // Content from private stati will be redacted
|
643 |
-
Jetpack_Sync::sync_posts( __FILE__, array(
|
644 |
-
'post_types' => get_post_types( array( 'public' => true ) ),
|
645 |
-
'post_stati' => $post_stati,
|
646 |
-
) );
|
647 |
-
}
|
648 |
}
|
649 |
|
650 |
function action_init() {
|
@@ -674,6 +645,7 @@ class Jetpack_Likes {
|
|
674 |
wp_enqueue_script( 'postmessage', '/wp-content/js/postmessage.js', array( 'jquery' ), JETPACK__VERSION, false );
|
675 |
wp_enqueue_script( 'jquery_inview', '/wp-content/js/jquery/jquery.inview.js', array( 'jquery' ), JETPACK__VERSION, false );
|
676 |
wp_enqueue_script( 'jetpack_resize', '/wp-content/js/jquery/jquery.jetpack-resize.js', array( 'jquery' ), JETPACK__VERSION, false );
|
|
|
677 |
wp_enqueue_style( 'jetpack_likes', plugins_url( 'jetpack-likes.css', __FILE__ ), array(), JETPACK__VERSION );
|
678 |
}
|
679 |
}
|
@@ -682,7 +654,6 @@ class Jetpack_Likes {
|
|
682 |
* Register scripts
|
683 |
*/
|
684 |
function register_scripts() {
|
685 |
-
// Lets register all the sciprts
|
686 |
wp_register_script( 'postmessage', plugins_url( '_inc/postmessage.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
687 |
wp_register_script( 'jquery_inview', plugins_url( '_inc/jquery.inview.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
688 |
wp_register_script( 'jetpack_resize', plugins_url( '_inc/jquery.jetpack-resize.js' , dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
@@ -693,66 +664,42 @@ class Jetpack_Likes {
|
|
693 |
* Load the CSS needed for the wp-admin area.
|
694 |
*/
|
695 |
function load_admin_css() {
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
display: none;
|
730 |
-
}
|
731 |
-
}
|
732 |
-
</style>
|
733 |
-
<?php else : // @todo Remove when 4.3 is minimum ?>
|
734 |
-
<style type="text/css">
|
735 |
-
.fixed .column-likes { width: 5em; padding-top: 8px; text-align: center !important; }
|
736 |
-
.fixed .column-stats { width: 5em; }
|
737 |
-
.fixed .column-likes .post-com-count { background-image: none; }
|
738 |
-
.fixed .column-likes .post-com-count::after { border: none !important; }
|
739 |
-
.fixed .column-likes .comment-count { background-color: #bbb; }
|
740 |
-
.fixed .column-likes .comment-count:hover { background-color: #2ea2cc; }
|
741 |
-
.fixed .column-likes .vers img { display: none; }
|
742 |
-
.fixed .column-likes .vers:before {
|
743 |
-
font: normal 20px/1 dashicons;
|
744 |
-
content: '\f155';
|
745 |
-
speak: none;
|
746 |
-
-webkit-font-smoothing: antialiased;
|
747 |
-
-moz-osx-font-smoothing: grayscale;
|
748 |
-
}
|
749 |
-
@media screen and (max-width: 782px) {
|
750 |
-
.fixed .column-likes {
|
751 |
-
display: none;
|
752 |
-
}
|
753 |
}
|
754 |
-
|
755 |
-
|
756 |
<?php
|
757 |
}
|
758 |
|
@@ -841,11 +788,11 @@ class Jetpack_Likes {
|
|
841 |
$wrapper = sprintf( 'like-post-wrapper-%1$d-%2$d-%3$s', $blog_id, $post->ID, $uniqid );
|
842 |
|
843 |
$html = "<div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='$wrapper' data-src='$src' data-name='$name'><h3 class='sd-title'>" . esc_html__( 'Like this:', 'jetpack' ) . '</h3>';
|
844 |
-
$html .= "<div class='likes-widget-placeholder post-likes-widget-placeholder' style='height:55px'><span class='button'><span>" . esc_html__( 'Like', 'jetpack' ) . '</span></span> <span class="loading">' . esc_html__( 'Loading...', 'jetpack' ) . '</span></div>';
|
845 |
$html .= "<span class='sd-text-color'></span><a class='sd-link-color'></a>";
|
846 |
$html .= '</div>';
|
847 |
|
848 |
-
//
|
849 |
wp_enqueue_script( 'jetpack_likes_queuehandler' );
|
850 |
|
851 |
return $content . $html;
|
@@ -1020,8 +967,8 @@ class Jetpack_Likes {
|
|
1020 |
* similar logic and filters apply here, too.
|
1021 |
*/
|
1022 |
function is_likes_visible() {
|
|
|
1023 |
|
1024 |
-
global $post, $wp_current_filter; // Used to apply 'sharing_show' filter
|
1025 |
// @todo: Remove this block when 4.5 is the minimum
|
1026 |
global $wp_version;
|
1027 |
$comment_popup = false;
|
@@ -1122,7 +1069,7 @@ class Jetpack_Likes {
|
|
1122 |
*
|
1123 |
* @param bool $option Are Likes enabled sitewide.
|
1124 |
*/
|
1125 |
-
return (bool) apply_filters( 'wpl_is_enabled_sitewide', !
|
1126 |
}
|
1127 |
|
1128 |
/**
|
@@ -1145,7 +1092,6 @@ class Jetpack_Likes {
|
|
1145 |
|
1146 |
/**
|
1147 |
* Returns if comment likes are enabled. Defaults to 'off'
|
1148 |
-
* @todo decide what the default should be
|
1149 |
* @return boolean true if we should show comment likes, false if not
|
1150 |
*/
|
1151 |
function is_comments_enabled() {
|
38 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
39 |
|
40 |
if ( $this->in_jetpack ) {
|
|
|
|
|
|
|
41 |
add_action( 'jetpack_activate_module_likes', array( $this, 'set_social_notifications_like' ) );
|
42 |
add_action( 'jetpack_deactivate_module_likes', array( $this, 'delete_social_notifications_like' ) );
|
43 |
|
67 |
add_filter( 'sharing_meta_box_title', array( $this, 'add_likes_to_sharing_meta_box_title' ) );
|
68 |
add_action( 'start_sharing_meta_box_content', array( $this, 'meta_box_content' ) );
|
69 |
}
|
|
|
|
|
|
|
70 |
} else { // wpcom
|
71 |
add_action( 'wpmu_new_blog', array( $this, 'enable_comment_likes' ), 10, 1 );
|
72 |
add_action( 'admin_init', array( $this, 'add_meta_box' ) );
|
86 |
add_action( 'sharing_admin_update', array( $this, 'admin_settings_callback' ), 20 );
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**
|
90 |
* Set the social_notifications_like option to `on` when the Likes module is activated.
|
91 |
*
|
123 |
// Do we really need `admin_styles`? With the new admin UI, it's breaking some bits.
|
124 |
// Jetpack::init()->admin_styles();
|
125 |
}
|
126 |
+
|
127 |
/**
|
128 |
+
* Load scripts and styles for front end.
|
129 |
* @return null
|
130 |
*/
|
131 |
function load_styles_register_scripts() {
|
132 |
+
if ( $this->in_jetpack ) {
|
133 |
+
wp_enqueue_style( 'jetpack_likes', plugins_url( 'likes/style.css', __FILE__ ), array(), JETPACK__VERSION );
|
|
|
134 |
$this->register_scripts();
|
135 |
}
|
136 |
}
|
147 |
|
148 |
/**
|
149 |
* Replaces the "Sharing" title for the post screen metabox with "Likes and Shares"
|
|
|
150 |
*/
|
151 |
+
function add_likes_to_sharing_meta_box_title() {
|
152 |
return __( 'Likes and Shares', 'jetpack' );
|
153 |
}
|
154 |
|
215 |
// site like setting.
|
216 |
if ( ( $this->is_enabled_sitewide() && empty( $_POST['wpl_enable_post_likes'] ) ) || ( ! $this->is_enabled_sitewide() && !empty( $_POST['wpl_enable_post_likes'] ) ) ) {
|
217 |
update_post_meta( $post_id, 'switch_like_status', 1 );
|
|
|
218 |
} else {
|
219 |
delete_post_meta( $post_id, 'switch_like_status' );
|
220 |
}
|
616 |
add_action( 'manage_pages_custom_column', array( $this, 'likes_edit_column' ), 10, 2 );
|
617 |
add_action( 'admin_print_styles-edit.php', array( $this, 'load_admin_css' ) );
|
618 |
add_action( "admin_print_scripts-edit.php", array( $this, 'enqueue_admin_scripts' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
}
|
620 |
|
621 |
function action_init() {
|
645 |
wp_enqueue_script( 'postmessage', '/wp-content/js/postmessage.js', array( 'jquery' ), JETPACK__VERSION, false );
|
646 |
wp_enqueue_script( 'jquery_inview', '/wp-content/js/jquery/jquery.inview.js', array( 'jquery' ), JETPACK__VERSION, false );
|
647 |
wp_enqueue_script( 'jetpack_resize', '/wp-content/js/jquery/jquery.jetpack-resize.js', array( 'jquery' ), JETPACK__VERSION, false );
|
648 |
+
wp_enqueue_script( 'jetpack_likes_queuehandler', plugins_url( 'queuehandler.js' , __FILE__ ), array( 'jquery', 'postmessage', 'jetpack_resize', 'jquery_inview' ), JETPACK__VERSION, true );
|
649 |
wp_enqueue_style( 'jetpack_likes', plugins_url( 'jetpack-likes.css', __FILE__ ), array(), JETPACK__VERSION );
|
650 |
}
|
651 |
}
|
654 |
* Register scripts
|
655 |
*/
|
656 |
function register_scripts() {
|
|
|
657 |
wp_register_script( 'postmessage', plugins_url( '_inc/postmessage.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
658 |
wp_register_script( 'jquery_inview', plugins_url( '_inc/jquery.inview.js', dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
659 |
wp_register_script( 'jetpack_resize', plugins_url( '_inc/jquery.jetpack-resize.js' , dirname(__FILE__) ), array( 'jquery' ), JETPACK__VERSION, false );
|
664 |
* Load the CSS needed for the wp-admin area.
|
665 |
*/
|
666 |
function load_admin_css() {
|
667 |
+
?>
|
668 |
+
<style type="text/css">
|
669 |
+
.vers img { display: none; }
|
670 |
+
.metabox-prefs .vers img { display: inline; }
|
671 |
+
.fixed .column-likes { width: 5.5em; padding: 8px 0; text-align: left; }
|
672 |
+
.fixed .column-stats { width: 5em; }
|
673 |
+
.fixed .column-likes .post-com-count {
|
674 |
+
-webkit-box-sizing: border-box;
|
675 |
+
-moz-box-sizing: border-box;
|
676 |
+
box-sizing: border-box;
|
677 |
+
display: inline-block;
|
678 |
+
padding: 0 8px;
|
679 |
+
height: 2em;
|
680 |
+
margin-top: 5px;
|
681 |
+
-webkit-border-radius: 5px;
|
682 |
+
border-radius: 5px;
|
683 |
+
background-color: #72777C;
|
684 |
+
color: #FFF;
|
685 |
+
font-size: 11px;
|
686 |
+
line-height: 21px;
|
687 |
+
}
|
688 |
+
.fixed .column-likes .post-com-count::after { border: none !important; }
|
689 |
+
.fixed .column-likes .post-com-count:hover { background-color: #0073AA; }
|
690 |
+
.fixed .column-likes .vers:before {
|
691 |
+
font: normal 20px/1 dashicons;
|
692 |
+
content: '\f155';
|
693 |
+
speak: none;
|
694 |
+
-webkit-font-smoothing: antialiased;
|
695 |
+
-moz-osx-font-smoothing: grayscale;
|
696 |
+
}
|
697 |
+
@media screen and (max-width: 782px) {
|
698 |
+
.fixed .column-likes {
|
699 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
700 |
}
|
701 |
+
}
|
702 |
+
</style>
|
703 |
<?php
|
704 |
}
|
705 |
|
788 |
$wrapper = sprintf( 'like-post-wrapper-%1$d-%2$d-%3$s', $blog_id, $post->ID, $uniqid );
|
789 |
|
790 |
$html = "<div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='$wrapper' data-src='$src' data-name='$name'><h3 class='sd-title'>" . esc_html__( 'Like this:', 'jetpack' ) . '</h3>';
|
791 |
+
$html .= "<div class='likes-widget-placeholder post-likes-widget-placeholder' style='height: 55px;'><span class='button'><span>" . esc_html__( 'Like', 'jetpack' ) . '</span></span> <span class="loading">' . esc_html__( 'Loading...', 'jetpack' ) . '</span></div>';
|
792 |
$html .= "<span class='sd-text-color'></span><a class='sd-link-color'></a>";
|
793 |
$html .= '</div>';
|
794 |
|
795 |
+
// Let's make sure that the script is enqueued
|
796 |
wp_enqueue_script( 'jetpack_likes_queuehandler' );
|
797 |
|
798 |
return $content . $html;
|
967 |
* similar logic and filters apply here, too.
|
968 |
*/
|
969 |
function is_likes_visible() {
|
970 |
+
global $post, $wp_current_filter; // Used to apply 'sharing_show' filter
|
971 |
|
|
|
972 |
// @todo: Remove this block when 4.5 is the minimum
|
973 |
global $wp_version;
|
974 |
$comment_popup = false;
|
1069 |
*
|
1070 |
* @param bool $option Are Likes enabled sitewide.
|
1071 |
*/
|
1072 |
+
return (bool) apply_filters( 'wpl_is_enabled_sitewide', ! Jetpack_Options::get_option_and_ensure_autoload( 'disabled_likes', 0 ) );
|
1073 |
}
|
1074 |
|
1075 |
/**
|
1092 |
|
1093 |
/**
|
1094 |
* Returns if comment likes are enabled. Defaults to 'off'
|
|
|
1095 |
* @return boolean true if we should show comment likes, false if not
|
1096 |
*/
|
1097 |
function is_comments_enabled() {
|
modules/manage.php
CHANGED
@@ -12,9 +12,6 @@
|
|
12 |
* Feature: Recommended
|
13 |
* Additional Search Queries: manage, management, remote
|
14 |
*/
|
15 |
-
|
16 |
-
add_action( 'jetpack_activate_module_manage', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
17 |
-
add_action( 'jetpack_deactivate_module_manage', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
18 |
add_action( 'customize_register', 'add_wpcom_to_allowed_redirect_hosts' );
|
19 |
|
20 |
// Add wordpress.com to the safe redirect whitelist if the Manage module is enabled
|
@@ -34,16 +31,6 @@ function allow_wpcom_domain( $domains ) {
|
|
34 |
return array_unique( $domains );
|
35 |
}
|
36 |
|
37 |
-
// Re add sync for non public posts when the optin is selected in Calypso.
|
38 |
-
// This will only work if you have manage enabled as well.
|
39 |
-
if ( Jetpack_Options::get_option( 'sync_non_public_post_stati' ) ) {
|
40 |
-
$sync_options = array(
|
41 |
-
'post_types' => get_post_types( array( 'public' => true ) ),
|
42 |
-
'post_stati' => get_post_stati(),
|
43 |
-
);
|
44 |
-
Jetpack_Sync::sync_posts( __FILE__, $sync_options );
|
45 |
-
}
|
46 |
-
|
47 |
Jetpack::module_configuration_screen( 'manage', 'jetpack_manage_config_screen' );
|
48 |
function jetpack_manage_config_screen() {
|
49 |
include ( JETPACK__PLUGIN_DIR . 'modules/manage/confirm-admin.php' );
|
12 |
* Feature: Recommended
|
13 |
* Additional Search Queries: manage, management, remote
|
14 |
*/
|
|
|
|
|
|
|
15 |
add_action( 'customize_register', 'add_wpcom_to_allowed_redirect_hosts' );
|
16 |
|
17 |
// Add wordpress.com to the safe redirect whitelist if the Manage module is enabled
|
31 |
return array_unique( $domains );
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
Jetpack::module_configuration_screen( 'manage', 'jetpack_manage_config_screen' );
|
35 |
function jetpack_manage_config_screen() {
|
36 |
include ( JETPACK__PLUGIN_DIR . 'modules/manage/confirm-admin.php' );
|
modules/markdown/easy-markdown.php
CHANGED
@@ -16,7 +16,7 @@ Author URI: http://automattic.com/
|
|
16 |
* http://www.opensource.org/licenses/gpl-license.php
|
17 |
*
|
18 |
* This is an add-on for WordPress
|
19 |
-
*
|
20 |
*
|
21 |
* **********************************************************************
|
22 |
* This program is free software; you can redistribute it and/or modify
|
@@ -311,7 +311,7 @@ class WPCom_Markdown {
|
|
311 |
* @return boolean
|
312 |
*/
|
313 |
public function is_posting_enabled() {
|
314 |
-
return (bool)
|
315 |
}
|
316 |
|
317 |
/**
|
@@ -319,7 +319,7 @@ class WPCom_Markdown {
|
|
319 |
* @return boolean
|
320 |
*/
|
321 |
public function is_commenting_enabled() {
|
322 |
-
return (bool)
|
323 |
}
|
324 |
|
325 |
/**
|
16 |
* http://www.opensource.org/licenses/gpl-license.php
|
17 |
*
|
18 |
* This is an add-on for WordPress
|
19 |
+
* https://wordpress.org/
|
20 |
*
|
21 |
* **********************************************************************
|
22 |
* This program is free software; you can redistribute it and/or modify
|
311 |
* @return boolean
|
312 |
*/
|
313 |
public function is_posting_enabled() {
|
314 |
+
return (bool) Jetpack_Options::get_option_and_ensure_autoload( self::POST_OPTION, '' );
|
315 |
}
|
316 |
|
317 |
/**
|
319 |
* @return boolean
|
320 |
*/
|
321 |
public function is_commenting_enabled() {
|
322 |
+
return (bool) Jetpack_Options::get_option_and_ensure_autoload( self::COMMENT_OPTION, '' );
|
323 |
}
|
324 |
|
325 |
/**
|
modules/minileven.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
function jetpack_load_minileven() {
|
17 |
include dirname( __FILE__ ) . "/minileven/minileven.php";
|
18 |
|
19 |
-
if (
|
20 |
remove_action( 'wp_mobile_theme_footer', 'jetpack_mobile_app_promo' );
|
21 |
}
|
22 |
|
16 |
function jetpack_load_minileven() {
|
17 |
include dirname( __FILE__ ) . "/minileven/minileven.php";
|
18 |
|
19 |
+
if ( Jetpack_Options::get_option_and_ensure_autoload( 'wp_mobile_app_promos', '0' ) != '1' )
|
20 |
remove_action( 'wp_mobile_theme_footer', 'jetpack_mobile_app_promo' );
|
21 |
}
|
22 |
|
modules/minileven/minileven.php
CHANGED
@@ -34,7 +34,7 @@ function jetpack_check_mobile() {
|
|
34 |
return false;
|
35 |
if ( jetpack_mobile_exclude() )
|
36 |
return false;
|
37 |
-
if ( 1 ==
|
38 |
return false;
|
39 |
if ( isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'true' )
|
40 |
return true;
|
34 |
return false;
|
35 |
if ( jetpack_mobile_exclude() )
|
36 |
return false;
|
37 |
+
if ( 1 == Jetpack_Options::get_option_and_ensure_autoload( 'wp_mobile_disable', '0' ) )
|
38 |
return false;
|
39 |
if ( isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'true' )
|
40 |
return true;
|
modules/minileven/theme/pub/minileven/footer.php
CHANGED
@@ -56,7 +56,7 @@
|
|
56 |
do_action( 'minileven_credits' );
|
57 |
?>
|
58 |
|
59 |
-
<a href="<?php echo esc_url( __( '
|
60 |
</div>
|
61 |
</footer><!-- #colophon -->
|
62 |
|
56 |
do_action( 'minileven_credits' );
|
57 |
?>
|
58 |
|
59 |
+
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'jetpack' ) ); ?>" target="_blank" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'jetpack' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'jetpack' ), 'WordPress' ); ?></a>
|
60 |
</div>
|
61 |
</footer><!-- #colophon -->
|
62 |
|
modules/monitor.php
CHANGED
@@ -12,9 +12,6 @@
|
|
12 |
* Additional Search Queries: monitor, uptime, downtime, monitoring
|
13 |
*/
|
14 |
|
15 |
-
add_action( 'jetpack_activate_module_monitor', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
16 |
-
add_action( 'jetpack_deactivate_module_monitor', array( Jetpack::init(), 'toggle_module_on_wpcom' ) );
|
17 |
-
|
18 |
class Jetpack_Monitor {
|
19 |
|
20 |
public $module = 'monitor';
|
12 |
* Additional Search Queries: monitor, uptime, downtime, monitoring
|
13 |
*/
|
14 |
|
|
|
|
|
|
|
15 |
class Jetpack_Monitor {
|
16 |
|
17 |
public $module = 'monitor';
|
modules/notes.php
CHANGED
@@ -12,19 +12,6 @@
|
|
12 |
|
13 |
if ( !defined( 'JETPACK_NOTES__CACHE_BUSTER' ) ) define( 'JETPACK_NOTES__CACHE_BUSTER', JETPACK__VERSION . '-' . gmdate( 'oW' ) );
|
14 |
|
15 |
-
Jetpack_Sync::sync_options( __FILE__,
|
16 |
-
'home',
|
17 |
-
'blogname',
|
18 |
-
'siteurl',
|
19 |
-
'permalink_structure',
|
20 |
-
'category_base',
|
21 |
-
'tag_base',
|
22 |
-
'comment_moderation',
|
23 |
-
'default_comment_status',
|
24 |
-
'thread_comments',
|
25 |
-
'thread_comments_depth'
|
26 |
-
);
|
27 |
-
|
28 |
class Jetpack_Notifications {
|
29 |
public $jetpack = false;
|
30 |
|
@@ -101,16 +88,6 @@ class Jetpack_Notifications {
|
|
101 |
}
|
102 |
}
|
103 |
|
104 |
-
Jetpack_Sync::sync_posts( __FILE__, array(
|
105 |
-
'post_types' => $filt_post_types,
|
106 |
-
'post_stati' => array( 'publish' ),
|
107 |
-
) );
|
108 |
-
Jetpack_Sync::sync_comments( __FILE__, array(
|
109 |
-
'post_types' => $filt_post_types,
|
110 |
-
'post_stati' => array( 'publish' ),
|
111 |
-
'comment_stati' => array( 'approve', 'approved', '1', 'hold', 'unapproved', 'unapprove', '0', 'spam', 'trash' ),
|
112 |
-
) );
|
113 |
-
|
114 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
|
115 |
return;
|
116 |
|
12 |
|
13 |
if ( !defined( 'JETPACK_NOTES__CACHE_BUSTER' ) ) define( 'JETPACK_NOTES__CACHE_BUSTER', JETPACK__VERSION . '-' . gmdate( 'oW' ) );
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
class Jetpack_Notifications {
|
16 |
public $jetpack = false;
|
17 |
|
88 |
}
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
|
92 |
return;
|
93 |
|
modules/post-by-email.php
CHANGED
@@ -12,8 +12,6 @@
|
|
12 |
*/
|
13 |
|
14 |
add_action( 'jetpack_modules_loaded', array( 'Jetpack_Post_By_Email', 'init' ) );
|
15 |
-
add_action( 'jetpack_activate_module_post-by-email', array( 'Jetpack_Post_By_Email', 'module_toggle' ) );
|
16 |
-
add_action( 'jetpack_deactivate_module_post-by-email', array( 'Jetpack_Post_By_Email', 'module_toggle' ) );
|
17 |
|
18 |
Jetpack::enable_module_configurable( __FILE__ );
|
19 |
Jetpack::module_configuration_load( __FILE__, array( 'Jetpack_Post_By_Email', 'configuration_redirect' ) );
|
@@ -33,11 +31,6 @@ class Jetpack_Post_By_Email {
|
|
33 |
add_action( 'init', array( &$this, 'action_init' ) );
|
34 |
}
|
35 |
|
36 |
-
static function module_toggle() {
|
37 |
-
$jetpack = Jetpack::init();
|
38 |
-
$jetpack->sync->register( 'noop' );
|
39 |
-
}
|
40 |
-
|
41 |
static function configuration_redirect() {
|
42 |
wp_safe_redirect( get_edit_profile_url( get_current_user_id() ) . '#post-by-email' );
|
43 |
exit;
|
12 |
*/
|
13 |
|
14 |
add_action( 'jetpack_modules_loaded', array( 'Jetpack_Post_By_Email', 'init' ) );
|
|
|
|
|
15 |
|
16 |
Jetpack::enable_module_configurable( __FILE__ );
|
17 |
Jetpack::module_configuration_load( __FILE__, array( 'Jetpack_Post_By_Email', 'configuration_redirect' ) );
|
31 |
add_action( 'init', array( &$this, 'action_init' ) );
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
static function configuration_redirect() {
|
35 |
wp_safe_redirect( get_edit_profile_url( get_current_user_id() ) . '#post-by-email' );
|
36 |
exit;
|
modules/protect.php
CHANGED
@@ -49,9 +49,8 @@ class Jetpack_Protect_Module {
|
|
49 |
private function __construct() {
|
50 |
add_action( 'jetpack_activate_module_protect', array ( $this, 'on_activation' ) );
|
51 |
add_action( 'jetpack_deactivate_module_protect', array ( $this, 'on_deactivation' ) );
|
52 |
-
add_action( 'init', array ( $this, 'maybe_get_protect_key' ) );
|
53 |
add_action( 'jetpack_modules_loaded', array ( $this, 'modules_loaded' ) );
|
54 |
-
add_action( '
|
55 |
add_filter( 'authenticate', array ( $this, 'check_preauth' ), 10, 3 );
|
56 |
add_action( 'wp_login', array ( $this, 'log_successful_login' ), 10, 2 );
|
57 |
add_action( 'wp_login_failed', array ( $this, 'log_failed_attempt' ) );
|
@@ -91,9 +90,12 @@ class Jetpack_Protect_Module {
|
|
91 |
|
92 |
public function maybe_get_protect_key() {
|
93 |
if ( get_site_option( 'jetpack_protect_activating', false ) && ! get_site_option( 'jetpack_protect_key', false ) ) {
|
94 |
-
$this->get_protect_key();
|
95 |
delete_site_option( 'jetpack_protect_activating' );
|
|
|
96 |
}
|
|
|
|
|
97 |
}
|
98 |
|
99 |
/**
|
@@ -649,7 +651,7 @@ class Jetpack_Protect_Module {
|
|
649 |
function protect_call( $action = 'check_ip', $request = array () ) {
|
650 |
global $wp_version, $wpdb, $current_user;
|
651 |
|
652 |
-
$api_key =
|
653 |
|
654 |
$user_agent = "WordPress/{$wp_version} | Jetpack/" . constant( 'JETPACK__VERSION' );
|
655 |
|
49 |
private function __construct() {
|
50 |
add_action( 'jetpack_activate_module_protect', array ( $this, 'on_activation' ) );
|
51 |
add_action( 'jetpack_deactivate_module_protect', array ( $this, 'on_deactivation' ) );
|
|
|
52 |
add_action( 'jetpack_modules_loaded', array ( $this, 'modules_loaded' ) );
|
53 |
+
add_action( 'login_init', array ( $this, 'check_use_math' ) );
|
54 |
add_filter( 'authenticate', array ( $this, 'check_preauth' ), 10, 3 );
|
55 |
add_action( 'wp_login', array ( $this, 'log_successful_login' ), 10, 2 );
|
56 |
add_action( 'wp_login_failed', array ( $this, 'log_failed_attempt' ) );
|
90 |
|
91 |
public function maybe_get_protect_key() {
|
92 |
if ( get_site_option( 'jetpack_protect_activating', false ) && ! get_site_option( 'jetpack_protect_key', false ) ) {
|
93 |
+
$key = $this->get_protect_key();
|
94 |
delete_site_option( 'jetpack_protect_activating' );
|
95 |
+
return $key;
|
96 |
}
|
97 |
+
|
98 |
+
return get_site_option( 'jetpack_protect_key' );
|
99 |
}
|
100 |
|
101 |
/**
|
651 |
function protect_call( $action = 'check_ip', $request = array () ) {
|
652 |
global $wp_version, $wpdb, $current_user;
|
653 |
|
654 |
+
$api_key = $this->maybe_get_protect_key();
|
655 |
|
656 |
$user_agent = "WordPress/{$wp_version} | Jetpack/" . constant( 'JETPACK__VERSION' );
|
657 |
|
modules/publicize.php
CHANGED
@@ -24,7 +24,6 @@ class Jetpack_Publicize {
|
|
24 |
if ( $this->in_jetpack && method_exists( 'Jetpack', 'module_configuration_load' ) ) {
|
25 |
Jetpack::enable_module_configurable( __FILE__ );
|
26 |
Jetpack::module_configuration_load( __FILE__, array( $this, 'jetpack_configuration_load' ) );
|
27 |
-
add_action( 'init', array( $this, 'sync_posts_init' ), 999 );
|
28 |
}
|
29 |
|
30 |
require_once dirname( __FILE__ ) . '/publicize/publicize.php';
|
@@ -42,9 +41,6 @@ class Jetpack_Publicize {
|
|
42 |
|
43 |
// Jetpack specific checks / hooks
|
44 |
if ( $this->in_jetpack) {
|
45 |
-
add_action( 'jetpack_activate_module_publicize', array( $this, 'module_state_toggle' ) );
|
46 |
-
add_action( 'jetpack_deactivate_module_publicize', array( $this, 'module_state_toggle' ) );
|
47 |
-
add_filter( 'jetpack_sync_post_module_custom_data', array( $this, 'sync_post_module_custom_data' ), 10, 2 );
|
48 |
// if sharedaddy isn't active, the sharing menu hasn't been added yet
|
49 |
$active = Jetpack::get_active_modules();
|
50 |
if ( in_array( 'publicize', $active ) && !in_array( 'sharedaddy', $active ) )
|
@@ -52,35 +48,6 @@ class Jetpack_Publicize {
|
|
52 |
}
|
53 |
}
|
54 |
|
55 |
-
function sync_posts_init() {
|
56 |
-
$post_types = array( 'post', 'page' );
|
57 |
-
$all_post_types = get_post_types();
|
58 |
-
foreach ( $all_post_types as $post_type ) {
|
59 |
-
// sync Custom Post Types that support publicize
|
60 |
-
if ( post_type_supports( $post_type, 'publicize' ) ) {
|
61 |
-
$post_types[] = $post_type;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
Jetpack_Sync::sync_posts( __FILE__, array(
|
65 |
-
'post_types' => $post_types,
|
66 |
-
) );
|
67 |
-
}
|
68 |
-
|
69 |
-
function sync_post_module_custom_data( $custom_data, $post ) {
|
70 |
-
if ( post_type_supports( get_post_type( $post ), 'publicize' ) ) {
|
71 |
-
$custom_data['cpt_publicizeable'] = true;
|
72 |
-
}
|
73 |
-
return $custom_data;
|
74 |
-
}
|
75 |
-
|
76 |
-
function module_state_toggle() {
|
77 |
-
// extra check that we are on the JP blog, just incase
|
78 |
-
if ( class_exists( 'Jetpack' ) && $this->in_jetpack ) {
|
79 |
-
$jetpack = Jetpack::init();
|
80 |
-
$jetpack->sync->register( 'noop' );
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
function jetpack_configuration_load() {
|
85 |
wp_safe_redirect( menu_page_url( 'sharing', false ) );
|
86 |
exit;
|
24 |
if ( $this->in_jetpack && method_exists( 'Jetpack', 'module_configuration_load' ) ) {
|
25 |
Jetpack::enable_module_configurable( __FILE__ );
|
26 |
Jetpack::module_configuration_load( __FILE__, array( $this, 'jetpack_configuration_load' ) );
|
|
|
27 |
}
|
28 |
|
29 |
require_once dirname( __FILE__ ) . '/publicize/publicize.php';
|
41 |
|
42 |
// Jetpack specific checks / hooks
|
43 |
if ( $this->in_jetpack) {
|
|
|
|
|
|
|
44 |
// if sharedaddy isn't active, the sharing menu hasn't been added yet
|
45 |
$active = Jetpack::get_active_modules();
|
46 |
if ( in_array( 'publicize', $active ) && !in_array( 'sharedaddy', $active ) )
|
48 |
}
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
function jetpack_configuration_load() {
|
52 |
wp_safe_redirect( menu_page_url( 'sharing', false ) );
|
53 |
exit;
|
modules/publicize/publicize-jetpack.php
CHANGED
@@ -27,7 +27,7 @@ class Publicize extends Publicize_Base {
|
|
27 |
|
28 |
add_filter( 'publicize_checkbox_default', array( $this, 'publicize_checkbox_default' ), 10, 4 );
|
29 |
|
30 |
-
add_action( '
|
31 |
|
32 |
add_filter( 'jetpack_twitter_cards_site_tag', array( $this, 'enhaced_twitter_cards_site_tag' ) );
|
33 |
|
@@ -359,7 +359,25 @@ class Publicize extends Publicize_Base {
|
|
359 |
}
|
360 |
|
361 |
function flag_post_for_publicize( $new_status, $old_status, $post ) {
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
}
|
364 |
|
365 |
function test_connection( $service_name, $connection ) {
|
@@ -405,9 +423,21 @@ class Publicize extends Publicize_Base {
|
|
405 |
* Save a flag locally to indicate that this post has already been Publicized via the selected
|
406 |
* connections.
|
407 |
*/
|
408 |
-
function save_publicized( $
|
409 |
// Only do this when a post transitions to being published
|
410 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
update_post_meta( $post->ID, $this->POST_DONE . 'all', true );
|
412 |
}
|
413 |
}
|
27 |
|
28 |
add_filter( 'publicize_checkbox_default', array( $this, 'publicize_checkbox_default' ), 10, 4 );
|
29 |
|
30 |
+
add_action( 'wp_insert_post', array( $this, 'save_publicized' ), 11, 3 );
|
31 |
|
32 |
add_filter( 'jetpack_twitter_cards_site_tag', array( $this, 'enhaced_twitter_cards_site_tag' ) );
|
33 |
|
359 |
}
|
360 |
|
361 |
function flag_post_for_publicize( $new_status, $old_status, $post ) {
|
362 |
+
if ( 'publish' == $new_status && 'publish' != $old_status ) {
|
363 |
+
/**
|
364 |
+
* Determines whether a post being published gets publicized.
|
365 |
+
*
|
366 |
+
* Side-note: Possibly our most alliterative filter name.
|
367 |
+
*
|
368 |
+
* @module publicize
|
369 |
+
*
|
370 |
+
* @since 4.1.0
|
371 |
+
*
|
372 |
+
* @param bool $should_publicize Should the post be publicized? Default to true.
|
373 |
+
* @param WP_POST $post Current Post object.
|
374 |
+
*/
|
375 |
+
$should_publicize = apply_filters( 'publicize_should_publicize_published_post', true, $post );
|
376 |
+
|
377 |
+
if ( $should_publicize ) {
|
378 |
+
update_post_meta( $post->ID, $this->PENDING, true );
|
379 |
+
}
|
380 |
+
}
|
381 |
}
|
382 |
|
383 |
function test_connection( $service_name, $connection ) {
|
423 |
* Save a flag locally to indicate that this post has already been Publicized via the selected
|
424 |
* connections.
|
425 |
*/
|
426 |
+
function save_publicized( $post_ID, $post, $update ) {
|
427 |
// Only do this when a post transitions to being published
|
428 |
+
if ( get_post_meta( $post->ID, $this->PENDING ) ) {
|
429 |
+
$connected_services = Jetpack_Options::get_option( 'publicize_connections' );
|
430 |
+
if ( ! empty( $connected_services ) ) {
|
431 |
+
/**
|
432 |
+
* Fires when a post is saved that has is marked as pending publicizing
|
433 |
+
*
|
434 |
+
* @since 4.1.0
|
435 |
+
*
|
436 |
+
* @param int The post ID
|
437 |
+
*/
|
438 |
+
do_action( 'jetpack_publicize_post', $post->ID );
|
439 |
+
}
|
440 |
+
delete_post_meta( $post->ID, $this->PENDING );
|
441 |
update_post_meta( $post->ID, $this->POST_DONE . 'all', true );
|
442 |
}
|
443 |
}
|
modules/publicize/publicize.php
CHANGED
@@ -326,7 +326,11 @@ abstract class Publicize_Base {
|
|
326 |
}
|
327 |
|
328 |
// Did this request happen via wp-admin?
|
329 |
-
$from_web =
|
|
|
|
|
|
|
|
|
330 |
|
331 |
if ( ( $from_web || defined( 'POST_BY_EMAIL' ) ) && isset( $_POST['wpas_title'] ) ) {
|
332 |
if ( empty( $_POST['wpas_title'] ) ) {
|
326 |
}
|
327 |
|
328 |
// Did this request happen via wp-admin?
|
329 |
+
$from_web = isset( $_SERVER['REQUEST_METHOD'] )
|
330 |
+
&&
|
331 |
+
'post' == strtolower( $_SERVER['REQUEST_METHOD'] )
|
332 |
+
&&
|
333 |
+
isset( $_POST[$this->ADMIN_PAGE] );
|
334 |
|
335 |
if ( ( $from_web || defined( 'POST_BY_EMAIL' ) ) && isset( $_POST['wpas_title'] ) ) {
|
336 |
if ( empty( $_POST['wpas_title'] ) ) {
|
modules/related-posts.php
CHANGED
@@ -38,19 +38,6 @@ class Jetpack_RelatedPosts_Module {
|
|
38 |
*/
|
39 |
private function __construct() {
|
40 |
add_action( 'jetpack_module_loaded_related-posts', array( $this, 'action_on_load' ) );
|
41 |
-
add_action( 'jetpack_activate_module_related-posts', array( $this, 'action_on_activate' ) );
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* This action triggers when module is activated.
|
46 |
-
*
|
47 |
-
* @uses Jetpack::init, Jetpack_Sync::reindex_needed, Jetpack_Sync::reindex_trigger
|
48 |
-
* @return null
|
49 |
-
*/
|
50 |
-
public function action_on_activate() {
|
51 |
-
if ( Jetpack::init()->sync->reindex_needed() ) {
|
52 |
-
Jetpack::init()->sync->reindex_trigger();
|
53 |
-
}
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -67,9 +54,6 @@ class Jetpack_RelatedPosts_Module {
|
|
67 |
// Enable "Configure" button on module card
|
68 |
Jetpack::enable_module_configurable( __FILE__ );
|
69 |
Jetpack::module_configuration_load( __FILE__, array( $this, 'module_configuration_load' ) );
|
70 |
-
|
71 |
-
// Sync new posts
|
72 |
-
Jetpack_Sync::sync_posts( __FILE__ );
|
73 |
}
|
74 |
}
|
75 |
|
38 |
*/
|
39 |
private function __construct() {
|
40 |
add_action( 'jetpack_module_loaded_related-posts', array( $this, 'action_on_load' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
54 |
// Enable "Configure" button on module card
|
55 |
Jetpack::enable_module_configurable( __FILE__ );
|
56 |
Jetpack::module_configuration_load( __FILE__, array( $this, 'module_configuration_load' ) );
|
|
|
|
|
|
|
57 |
}
|
58 |
}
|
59 |
|
modules/related-posts/jetpack-related-posts.php
CHANGED
@@ -105,7 +105,7 @@ class Jetpack_RelatedPosts {
|
|
105 |
}
|
106 |
|
107 |
/**
|
108 |
-
* Load related posts assets if it's a elegiable
|
109 |
*
|
110 |
* @global $_GET
|
111 |
* @action wp
|
@@ -231,7 +231,7 @@ EOT;
|
|
231 |
*/
|
232 |
public function get_options() {
|
233 |
if ( null === $this->_options ) {
|
234 |
-
$this->_options = Jetpack_Options::get_option( 'relatedposts' );
|
235 |
if ( ! is_array( $this->_options ) )
|
236 |
$this->_options = array();
|
237 |
if ( ! isset( $this->_options['enabled'] ) )
|
105 |
}
|
106 |
|
107 |
/**
|
108 |
+
* Load related posts assets if it's a elegiable front end page or execute search and return JSON if it's an endpoint request.
|
109 |
*
|
110 |
* @global $_GET
|
111 |
* @action wp
|
231 |
*/
|
232 |
public function get_options() {
|
233 |
if ( null === $this->_options ) {
|
234 |
+
$this->_options = Jetpack_Options::get_option( 'relatedposts', array() );
|
235 |
if ( ! is_array( $this->_options ) )
|
236 |
$this->_options = array();
|
237 |
if ( ! isset( $this->_options['enabled'] ) )
|
modules/sharedaddy/sharedaddy.php
CHANGED
@@ -200,7 +200,7 @@ function sharing_restrict_to_single( $services ) {
|
|
200 |
}
|
201 |
|
202 |
function sharing_init() {
|
203 |
-
if (
|
204 |
add_filter( 'sharing_js', 'sharing_disable_js' );
|
205 |
remove_action( 'wp_head', 'sharing_add_header', 1 );
|
206 |
}
|
200 |
}
|
201 |
|
202 |
function sharing_init() {
|
203 |
+
if ( Jetpack_Options::get_option_and_ensure_autoload( 'sharedaddy_disable_resources', '0' ) ) {
|
204 |
add_filter( 'sharing_js', 'sharing_disable_js' );
|
205 |
remove_action( 'wp_head', 'sharing_add_header', 1 );
|
206 |
}
|
modules/sharedaddy/sharing-sources.php
CHANGED
@@ -329,15 +329,13 @@ abstract class Sharing_Source {
|
|
329 |
$opts = implode( ',', $opts );
|
330 |
?>
|
331 |
<script type="text/javascript">
|
332 |
-
|
333 |
-
jQuery(document).on( '
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
return false;
|
340 |
-
});
|
341 |
});
|
342 |
</script>
|
343 |
<?php
|
@@ -1518,7 +1516,7 @@ class Share_Pinterest extends Sharing_Source {
|
|
1518 |
</script>
|
1519 |
<?php elseif ( 'buttonPin' != $this->get_widget_type() ) : ?>
|
1520 |
<script type="text/javascript">
|
1521 |
-
jQuery(document).
|
1522 |
jQuery('body').on('click', 'a.share-pinterest', function(e){
|
1523 |
e.preventDefault();
|
1524 |
// Load Pinterest Bookmarklet code
|
@@ -1590,7 +1588,7 @@ class Share_Pocket extends Sharing_Source {
|
|
1590 |
function jetpack_sharing_pocket_init() {
|
1591 |
jQuery.getScript( 'https://widgets.getpocket.com/v1/j/btn.js?v=1' );
|
1592 |
}
|
1593 |
-
jQuery( document ).
|
1594 |
jQuery( document.body ).on( 'post-load', jetpack_sharing_pocket_init );
|
1595 |
</script>
|
1596 |
<?php
|
@@ -1641,7 +1639,7 @@ class Jetpack_Share_WhatsApp extends Sharing_Source {
|
|
1641 |
}
|
1642 |
|
1643 |
public function get_display( $post ) {
|
1644 |
-
return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode(
|
1645 |
}
|
1646 |
}
|
1647 |
|
329 |
$opts = implode( ',', $opts );
|
330 |
?>
|
331 |
<script type="text/javascript">
|
332 |
+
var windowOpen;
|
333 |
+
jQuery(document.body).on('click', 'a.share-<?php echo $name; ?>', function() {
|
334 |
+
if ( 'undefined' !== typeof windowOpen ){ // If there's another sharing window open, close it.
|
335 |
+
windowOpen.close();
|
336 |
+
}
|
337 |
+
windowOpen = window.open( jQuery(this).attr( 'href' ), 'wpcom<?php echo $name; ?>', '<?php echo $opts; ?>' );
|
338 |
+
return false;
|
|
|
|
|
339 |
});
|
340 |
</script>
|
341 |
<?php
|
1516 |
</script>
|
1517 |
<?php elseif ( 'buttonPin' != $this->get_widget_type() ) : ?>
|
1518 |
<script type="text/javascript">
|
1519 |
+
jQuery(document).ready( function(){
|
1520 |
jQuery('body').on('click', 'a.share-pinterest', function(e){
|
1521 |
e.preventDefault();
|
1522 |
// Load Pinterest Bookmarklet code
|
1588 |
function jetpack_sharing_pocket_init() {
|
1589 |
jQuery.getScript( 'https://widgets.getpocket.com/v1/j/btn.js?v=1' );
|
1590 |
}
|
1591 |
+
jQuery( document ).ready( jetpack_sharing_pocket_init );
|
1592 |
jQuery( document.body ).on( 'post-load', jetpack_sharing_pocket_init );
|
1593 |
</script>
|
1594 |
<?php
|
1639 |
}
|
1640 |
|
1641 |
public function get_display( $post ) {
|
1642 |
+
return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode( $this->get_share_url( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) );
|
1643 |
}
|
1644 |
}
|
1645 |
|
modules/sharedaddy/sharing.css
CHANGED
@@ -77,7 +77,6 @@ body.highlander-dark h3.sd-title:before {
|
|
77 |
.sd-social-official .sd-content>ul>li .digg_button >a { /* official Digg button no longer works, needs cleaning */
|
78 |
text-decoration: none !important;
|
79 |
display: inline-block;
|
80 |
-
margin: 0 5px 5px 0;
|
81 |
font-size: 12px;
|
82 |
font-family: "Open Sans", sans-serif;
|
83 |
font-weight: normal;
|
@@ -182,7 +181,7 @@ body.highlander-dark h3.sd-title:before {
|
|
182 |
}
|
183 |
|
184 |
.sd-content ul li {
|
185 |
-
margin: 0
|
186 |
padding: 0;
|
187 |
}
|
188 |
|
77 |
.sd-social-official .sd-content>ul>li .digg_button >a { /* official Digg button no longer works, needs cleaning */
|
78 |
text-decoration: none !important;
|
79 |
display: inline-block;
|
|
|
80 |
font-size: 12px;
|
81 |
font-family: "Open Sans", sans-serif;
|
82 |
font-weight: normal;
|
181 |
}
|
182 |
|
183 |
.sd-content ul li {
|
184 |
+
margin: 0 5px 5px 0;
|
185 |
padding: 0;
|
186 |
}
|
187 |
|
modules/sharedaddy/sharing.js
CHANGED
@@ -129,7 +129,7 @@ var updateLinkedInCount = function( data ) {
|
|
129 |
} );
|
130 |
|
131 |
$body = $( document.body ).on( 'post-load', WPCOMSharing_do );
|
132 |
-
$( document ).
|
133 |
$sharing_email = $( '#sharing_email' );
|
134 |
$body.append( $sharing_email );
|
135 |
WPCOMSharing_do();
|
129 |
} );
|
130 |
|
131 |
$body = $( document.body ).on( 'post-load', WPCOMSharing_do );
|
132 |
+
$( document ).ready( function() {
|
133 |
$sharing_email = $( '#sharing_email' );
|
134 |
$body.append( $sharing_email );
|
135 |
WPCOMSharing_do();
|
modules/shortcodes.php
CHANGED
@@ -39,12 +39,12 @@ function shortcode_new_to_old_params( $params, $old_format_support = false ) {
|
|
39 |
}
|
40 |
|
41 |
function jetpack_load_shortcodes() {
|
42 |
-
global $wp_version;
|
43 |
-
|
44 |
$shortcode_includes = array();
|
45 |
|
46 |
foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/shortcodes' ) as $file ) {
|
47 |
-
$
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -53,6 +53,7 @@ function jetpack_load_shortcodes() {
|
|
53 |
* @module shortcodes
|
54 |
*
|
55 |
* @since 2.2.1
|
|
|
56 |
*
|
57 |
* @param array $shortcode_includes An array of which shortcodes to include.
|
58 |
*/
|
39 |
}
|
40 |
|
41 |
function jetpack_load_shortcodes() {
|
|
|
|
|
42 |
$shortcode_includes = array();
|
43 |
|
44 |
foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/shortcodes' ) as $file ) {
|
45 |
+
$filename = substr( basename( $file ), 0, -4 );
|
46 |
+
|
47 |
+
$shortcode_includes[ $filename ] = $file;
|
48 |
}
|
49 |
|
50 |
/**
|
53 |
* @module shortcodes
|
54 |
*
|
55 |
* @since 2.2.1
|
56 |
+
* @since 4.2.0 Added filename without extension as array key.
|
57 |
*
|
58 |
* @param array $shortcode_includes An array of which shortcodes to include.
|
59 |
*/
|
modules/shortcodes/cartodb.php
CHANGED
@@ -2,17 +2,20 @@
|
|
2 |
|
3 |
|
4 |
/*
|
5 |
-
* CartoDB
|
6 |
*
|
7 |
-
* example URL: http://osm2.
|
8 |
*
|
9 |
* possible patterns:
|
10 |
-
* [username].
|
11 |
-
* [username].
|
12 |
-
* [username].
|
13 |
-
* [organization].
|
14 |
-
* [organization].
|
15 |
-
* [organization].
|
|
|
|
|
|
|
16 |
*/
|
17 |
|
18 |
-
wp_oembed_add_provider( '#https?://(?:www\.)?[^/^\.]+\.
|
2 |
|
3 |
|
4 |
/*
|
5 |
+
* Carto (formerly CartoDB)
|
6 |
*
|
7 |
+
* example URL: http://osm2.carto.com/viz/08aef918-94da-11e4-ad83-0e0c41326911/public_map
|
8 |
*
|
9 |
* possible patterns:
|
10 |
+
* [username].carto.com/viz/[map-id]/public_map
|
11 |
+
* [username].carto.com/viz/[map-id]/embed_map
|
12 |
+
* [username].carto.com/viz/[map-id]/map
|
13 |
+
* [organization].carto.com/u/[username]/viz/[map-id]/public_map
|
14 |
+
* [organization].carto.com/u/[username]/viz/[map-id]/embed_map
|
15 |
+
* [organization].carto.com/u/[username]/viz/[map-id]/map
|
16 |
+
*
|
17 |
+
* On July 8th, 2016 CartoDB changed its primary domain from cartodb.com to carto.com
|
18 |
+
* So this shortcode still supports the cartodb.com domain for oembeds.
|
19 |
*/
|
20 |
|
21 |
+
wp_oembed_add_provider( '#https?://(?:www\.)?[^/^\.]+\.carto(db)?\.com/\S+#i', 'https://services.carto.com/oembed', true );
|
modules/shortcodes/dailymotion.php
CHANGED
@@ -75,6 +75,11 @@ add_filter( 'pre_kses', 'dailymotion_embed_to_shortcode' );
|
|
75 |
*
|
76 |
* The new style is now:
|
77 |
* [dailymotion id=x8oma9 title=2 user=3 video=4]
|
|
|
|
|
|
|
|
|
|
|
78 |
* @todo: Update code to sniff for iframe embeds and convert those to shortcodes.
|
79 |
*
|
80 |
* @param array $atts
|
@@ -93,40 +98,115 @@ function dailymotion_shortcode( $atts ) {
|
|
93 |
$params = shortcode_new_to_old_params( $atts );
|
94 |
parse_str( $params, $atts_new );
|
95 |
|
96 |
-
foreach( $atts_new as $k => $v ) {
|
97 |
$atts[ $k ] = $v;
|
98 |
}
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
} else {
|
104 |
return '<!--Dailymotion error: bad or missing ID-->';
|
105 |
}
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
-
$
|
114 |
-
$id = urlencode( $id );
|
115 |
|
116 |
if ( preg_match( '/^[A-Za-z0-9]+$/', $id ) ) {
|
117 |
-
$output
|
118 |
-
$after = '';
|
119 |
|
120 |
if ( array_key_exists( 'video', $atts ) && $video = preg_replace( '/[^-a-z0-9_]/i', '', $atts['video'] ) && array_key_exists( 'title', $atts ) && $title = wp_kses( $atts['title'], array() ) ) {
|
121 |
-
$
|
122 |
}
|
123 |
|
124 |
if ( array_key_exists( 'user', $atts ) && $user = preg_replace( '/[^-a-z0-9_]/i', '', $atts['user'] ) ) {
|
125 |
-
|
|
|
126 |
}
|
127 |
}
|
128 |
|
129 |
-
return $output
|
130 |
}
|
131 |
|
132 |
add_shortcode( 'dailymotion', 'dailymotion_shortcode' );
|
@@ -143,13 +223,13 @@ function dailymotion_channel_shortcode( $atts ) {
|
|
143 |
|
144 |
switch( $atts['type'] ) {
|
145 |
case 'grid':
|
146 |
-
return '<iframe width="300px" height="264px" scrolling="no"
|
147 |
break;
|
148 |
case 'carousel':
|
149 |
-
return '<iframe width="300px" height="360px" scrolling="no"
|
150 |
break;
|
151 |
default:
|
152 |
-
return '<iframe width="300px" height="78px" scrolling="no"
|
153 |
}
|
154 |
}
|
155 |
|
75 |
*
|
76 |
* The new style is now:
|
77 |
* [dailymotion id=x8oma9 title=2 user=3 video=4]
|
78 |
+
*
|
79 |
+
* Supported parameters for player customization: width, height,
|
80 |
+
* autoplay, endscreen-enable, mute, sharing-enabled, start, subtitles-default,
|
81 |
+
* ui-highlight, ui-logo, ui-start-screen-info, ui-theme
|
82 |
+
* see https://developer.dailymotion.com/player#player-parameters
|
83 |
* @todo: Update code to sniff for iframe embeds and convert those to shortcodes.
|
84 |
*
|
85 |
* @param array $atts
|
98 |
$params = shortcode_new_to_old_params( $atts );
|
99 |
parse_str( $params, $atts_new );
|
100 |
|
101 |
+
foreach ( $atts_new as $k => $v ) {
|
102 |
$atts[ $k ] = $v;
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
$atts = shortcode_atts(
|
107 |
+
array(
|
108 |
+
'id' => '', // string
|
109 |
+
'width' => '', // int
|
110 |
+
'height' => '', // int
|
111 |
+
'title' => '', // string
|
112 |
+
'user' => '', // string
|
113 |
+
'video' => '', // string
|
114 |
+
'autoplay' => 0, // int
|
115 |
+
'endscreen-enable' => 1, // int
|
116 |
+
'mute' => 0, // int
|
117 |
+
'sharing-enable' => 1, // int
|
118 |
+
'start' => '', // int
|
119 |
+
'subtitles-default' => '', // string
|
120 |
+
'ui-highlight' => '', // string
|
121 |
+
'ui-logo' => 1, // int
|
122 |
+
'ui-start-screen-info' => 0, // int
|
123 |
+
'ui-theme' => '', // string
|
124 |
+
), $atts, 'dailymotion'
|
125 |
+
);
|
126 |
+
|
127 |
+
if ( isset( $atts['id'] ) && ! empty( $atts['id'] ) ) {
|
128 |
+
$id = urlencode( $atts['id'] );
|
129 |
} else {
|
130 |
return '<!--Dailymotion error: bad or missing ID-->';
|
131 |
}
|
132 |
|
133 |
+
/*set width and height using provided parameters if any */
|
134 |
+
$width = isset( $atts['width'] ) ? intval( $atts['width'] ) : 0 ;
|
135 |
+
$height = isset( $atts['height'] ) ? intval( $atts['height'] ) : 0 ;
|
136 |
+
|
137 |
+
if ( ! $width && ! $height ) {
|
138 |
+
if ( ! empty( $content_width ) ) {
|
139 |
+
$width = absint( $content_width );
|
140 |
+
} else {
|
141 |
+
$width = 425;
|
142 |
+
}
|
143 |
+
$height = $width / 425 * 334;
|
144 |
+
} elseif ( ! $height ) {
|
145 |
+
$height = $width / 425 * 334;
|
146 |
+
} elseif ( ! $width ) {
|
147 |
+
$width = $height / 334 * 425;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Let's add parameters if needed.
|
152 |
+
*
|
153 |
+
* @see https://developer.dailymotion.com/player
|
154 |
+
*/
|
155 |
+
$player_params = array();
|
156 |
+
|
157 |
+
if ( isset( $atts['autoplay'] ) && '1' === $atts['autoplay'] ) {
|
158 |
+
$player_params['autoplay'] = '1';
|
159 |
+
}
|
160 |
+
if ( isset( $atts['endscreen-enable'] ) && '0' === $atts['endscreen-enable'] ) {
|
161 |
+
$player_params['endscreen-enable'] = '0';
|
162 |
+
}
|
163 |
+
if ( isset( $atts['mute'] ) && '1' === $atts['mute'] ) {
|
164 |
+
$player_params['mute'] = '1';
|
165 |
}
|
166 |
+
if ( isset( $atts['sharing-enable'] ) && '0' === $atts['sharing-enable'] ) {
|
167 |
+
$player_params['sharing-enable'] = '0';
|
168 |
+
}
|
169 |
+
if ( isset( $atts['start'] ) && ! empty( $atts['start'] ) ) {
|
170 |
+
$player_params['start'] = abs( intval( $atts['start'] ) );
|
171 |
+
}
|
172 |
+
if ( isset( $atts['subtitles-default'] ) && ! empty( $atts['subtitles-default'] ) ) {
|
173 |
+
$player_params['subtitles-default'] = esc_attr( $atts['subtitles-default'] );
|
174 |
+
}
|
175 |
+
if ( isset( $atts['ui-highlight'] ) && ! empty( $atts['ui-highlight'] ) ) {
|
176 |
+
$player_params['ui-highlight'] = esc_attr( $atts['ui-highlight'] );
|
177 |
+
}
|
178 |
+
if ( isset( $atts['ui-logo'] ) && '0' === $atts['ui-logo'] ) {
|
179 |
+
$player_params['ui-logo'] = '0';
|
180 |
+
}
|
181 |
+
if ( isset( $atts['ui-start-screen-info'] ) && '0' === $atts['ui-start-screen-info'] ) {
|
182 |
+
$player_params['ui-start-screen-info'] = '0';
|
183 |
+
}
|
184 |
+
if ( isset( $atts['ui-theme'] ) && in_array( strtolower( $atts['ui-theme'] ), array( 'dark', 'light' ) ) ) {
|
185 |
+
$player_params['ui-theme'] = esc_attr( $atts['ui-theme'] );
|
186 |
+
}
|
187 |
+
|
188 |
+
// Add those parameters to the Video URL.
|
189 |
+
$video_url = add_query_arg(
|
190 |
+
$player_params,
|
191 |
+
'https://www.dailymotion.com/embed/video/' . $id
|
192 |
+
);
|
193 |
|
194 |
+
$output = '';
|
|
|
195 |
|
196 |
if ( preg_match( '/^[A-Za-z0-9]+$/', $id ) ) {
|
197 |
+
$output .= '<iframe width="' . esc_attr( $width ) . '" height="' . esc_attr( $height ) . '" src="' . esc_url( $video_url ) . '" style="border:0;" allowfullscreen></iframe>';
|
|
|
198 |
|
199 |
if ( array_key_exists( 'video', $atts ) && $video = preg_replace( '/[^-a-z0-9_]/i', '', $atts['video'] ) && array_key_exists( 'title', $atts ) && $title = wp_kses( $atts['title'], array() ) ) {
|
200 |
+
$output .= '<br /><strong><a href="' . esc_url( 'http://www.dailymotion.com/video/' . $video ) . '" target="_blank">' . esc_html( $title ) . '</a></strong>';
|
201 |
}
|
202 |
|
203 |
if ( array_key_exists( 'user', $atts ) && $user = preg_replace( '/[^-a-z0-9_]/i', '', $atts['user'] ) ) {
|
204 |
+
/* translators: %s is a Dailymotion user name */
|
205 |
+
$output .= '<br /><em>' . wp_kses( sprintf( __( 'Uploaded by %s', 'jetpack' ), '<a href="' . esc_url( 'http://www.dailymotion.com/' . $user ) . '" target="_blank">' . esc_html( $user ) . '</a>' ), array( 'a' => array( 'href' => true, 'target' => true ) ) ) . '</em>';
|
206 |
}
|
207 |
}
|
208 |
|
209 |
+
return $output;
|
210 |
}
|
211 |
|
212 |
add_shortcode( 'dailymotion', 'dailymotion_shortcode' );
|
223 |
|
224 |
switch( $atts['type'] ) {
|
225 |
case 'grid':
|
226 |
+
return '<iframe width="300px" height="264px" scrolling="no" style="border:0;" src="' . esc_url( '//www.dailymotion.com/badge/user/' . $username . '?type=grid' ) . '"></iframe>';
|
227 |
break;
|
228 |
case 'carousel':
|
229 |
+
return '<iframe width="300px" height="360px" scrolling="no" style="border:0;" src="' . esc_url( '//www.dailymotion.com/badge/user/' . $username . '?type=carousel' ) . '"></iframe>';
|
230 |
break;
|
231 |
default:
|
232 |
+
return '<iframe width="300px" height="78px" scrolling="no" style="border:0;" src="' . esc_url( '//www.dailymotion.com/badge/user/' . $username ) . '"></iframe>';
|
233 |
}
|
234 |
}
|
235 |
|
modules/shortcodes/slideshow.php
CHANGED
@@ -122,7 +122,7 @@ class Jetpack_Slideshow_Shortcode {
|
|
122 |
'trans' => 'fade',
|
123 |
'order' => 'ASC',
|
124 |
'orderby' => 'menu_order ID',
|
125 |
-
'id' => $post->ID,
|
126 |
'include' => '',
|
127 |
'exclude' => '',
|
128 |
'autostart' => true,
|
122 |
'trans' => 'fade',
|
123 |
'order' => 'ASC',
|
124 |
'orderby' => 'menu_order ID',
|
125 |
+
'id' => isset( $post->ID ) ? $post->ID : null,
|
126 |
'include' => '',
|
127 |
'exclude' => '',
|
128 |
'autostart' => true,
|
modules/shortcodes/soundcloud.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: SoundCloud Shortcode
|
4 |
-
Plugin URI:
|
5 |
Description: Converts SoundCloud WordPress shortcodes to a SoundCloud widget. Example: [soundcloud]http://soundcloud.com/forss/flickermood[/soundcloud]
|
6 |
Version: 2.3
|
7 |
Author: SoundCloud Inc., simplified for Jetpack by Automattic, Inc.
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: SoundCloud Shortcode
|
4 |
+
Plugin URI: https://wordpress.org/extend/plugins/soundcloud-shortcode/
|
5 |
Description: Converts SoundCloud WordPress shortcodes to a SoundCloud widget. Example: [soundcloud]http://soundcloud.com/forss/flickermood[/soundcloud]
|
6 |
Version: 2.3
|
7 |
Author: SoundCloud Inc., simplified for Jetpack by Automattic, Inc.
|
modules/shortcodes/vimeo.php
CHANGED
@@ -293,10 +293,8 @@ function vimeo_link_callback( $matches ) {
|
|
293 |
}
|
294 |
|
295 |
/** This filter is documented in modules/shortcodes/youtube.php */
|
296 |
-
if ( apply_filters( 'jetpack_comments_allow_oembed',
|
297 |
// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
|
298 |
-
|
299 |
-
|
300 |
-
add_filter( 'comment_text', 'vimeo_link', 1 );
|
301 |
-
}
|
302 |
}
|
293 |
}
|
294 |
|
295 |
/** This filter is documented in modules/shortcodes/youtube.php */
|
296 |
+
if ( ! is_admin() && apply_filters( 'jetpack_comments_allow_oembed', true ) ) {
|
297 |
// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
|
298 |
+
// Higher priority because we need it before auto-link and autop get to it
|
299 |
+
add_filter( 'comment_text', 'vimeo_link', 1 );
|
|
|
|
|
300 |
}
|
modules/shortcodes/wufoo.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Wufoo Shortcode Plugin
|
|
4 |
Description: Enables shortcode to embed Wufoo forms. Usage: [wufoo username="chriscoyier" formhash="x7w3w3" autoresize="true" height="458" header="show" ssl="true"]
|
5 |
Author: Chris Coyier / Wufoo, evansolomon
|
6 |
|
7 |
-
Based on
|
8 |
http://wufoo.com/docs/code-manager/wordpress-shortcode-plugin/
|
9 |
*/
|
10 |
|
4 |
Description: Enables shortcode to embed Wufoo forms. Usage: [wufoo username="chriscoyier" formhash="x7w3w3" autoresize="true" height="458" header="show" ssl="true"]
|
5 |
Author: Chris Coyier / Wufoo, evansolomon
|
6 |
|
7 |
+
Based on https://wordpress.org/extend/plugins/wufoo-shortcode/
|
8 |
http://wufoo.com/docs/code-manager/wordpress-shortcode-plugin/
|
9 |
*/
|
10 |
|
modules/shortcodes/youtube.php
CHANGED
@@ -177,14 +177,17 @@ function youtube_id( $url ) {
|
|
177 |
$input_w = ( isset( $qargs['w'] ) && intval( $qargs['w'] ) ) ? intval( $qargs['w'] ) : 0;
|
178 |
$input_h = ( isset( $qargs['h'] ) && intval( $qargs['h'] ) ) ? intval( $qargs['h'] ) : 0;
|
179 |
|
180 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
|
|
182 |
if ( empty( $default_width ) ) {
|
183 |
-
|
184 |
-
$default_width = $content_width;
|
185 |
-
} else {
|
186 |
-
$default_width = 640;
|
187 |
-
}
|
188 |
}
|
189 |
|
190 |
if ( $input_w > 0 && $input_h > 0 ) {
|
@@ -363,12 +366,10 @@ add_action( 'init', 'wpcom_youtube_embed_crazy_url_init' );
|
|
363 |
*
|
364 |
* @param int get_option('embed_autourls') Option to automatically embed all plain text URLs.
|
365 |
*/
|
366 |
-
if ( apply_filters( 'jetpack_comments_allow_oembed',
|
367 |
// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
|
368 |
-
|
369 |
-
|
370 |
-
add_filter( 'comment_text', 'youtube_link', 1 );
|
371 |
-
}
|
372 |
}
|
373 |
|
374 |
/**
|
177 |
$input_w = ( isset( $qargs['w'] ) && intval( $qargs['w'] ) ) ? intval( $qargs['w'] ) : 0;
|
178 |
$input_h = ( isset( $qargs['h'] ) && intval( $qargs['h'] ) ) ? intval( $qargs['h'] ) : 0;
|
179 |
|
180 |
+
// If we have $content_width, use it.
|
181 |
+
if ( ! empty( $content_width ) ) {
|
182 |
+
$default_width = $content_width;
|
183 |
+
} else {
|
184 |
+
// Otherwise get default width from the old, now deprecated embed_size_w option.
|
185 |
+
$default_width = get_option('embed_size_w');
|
186 |
+
}
|
187 |
|
188 |
+
// If we don't know those 2 values use a hardcoded width.h
|
189 |
if ( empty( $default_width ) ) {
|
190 |
+
$default_width = 640;
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
|
193 |
if ( $input_w > 0 && $input_h > 0 ) {
|
366 |
*
|
367 |
* @param int get_option('embed_autourls') Option to automatically embed all plain text URLs.
|
368 |
*/
|
369 |
+
if ( ! is_admin() && apply_filters( 'jetpack_comments_allow_oembed', true ) ) {
|
370 |
// We attach wp_kses_post to comment_text in default-filters.php with priority of 10 anyway, so the iframe gets filtered out.
|
371 |
+
// Higher priority because we need it before auto-link and autop get to it
|
372 |
+
add_filter( 'comment_text', 'youtube_link', 1 );
|
|
|
|
|
373 |
}
|
374 |
|
375 |
/**
|
modules/site-icon.php
CHANGED
@@ -13,5 +13,3 @@
|
|
13 |
|
14 |
include dirname( __FILE__ ) . '/site-icon/jetpack-site-icon.php';
|
15 |
include dirname( __FILE__ ) . '/site-icon/site-icon-functions.php';
|
16 |
-
|
17 |
-
Jetpack_Sync::sync_options( __FILE__, 'jetpack_site_icon_url' );
|
13 |
|
14 |
include dirname( __FILE__ ) . '/site-icon/jetpack-site-icon.php';
|
15 |
include dirname( __FILE__ ) . '/site-icon/site-icon-functions.php';
|
|
|
|
modules/site-icon/jetpack-site-icon.php
CHANGED
@@ -71,7 +71,7 @@ class Jetpack_Site_Icon {
|
|
71 |
|
72 |
add_action( 'admin_print_styles-options-general.php', array( $this, 'add_general_options_styles' ) );
|
73 |
|
74 |
-
// Add the favicon to the front end and
|
75 |
/**
|
76 |
* As of WP 4.3 and JP 3.6, both are outputting the same icons so no need to fire these.
|
77 |
* This is a temporary solution until Jetpack's module primary function is deprecated.
|
71 |
|
72 |
add_action( 'admin_print_styles-options-general.php', array( $this, 'add_general_options_styles' ) );
|
73 |
|
74 |
+
// Add the favicon to the front end and back end if Core's site icon not used.
|
75 |
/**
|
76 |
* As of WP 4.3 and JP 3.6, both are outputting the same icons so no need to fire these.
|
77 |
* This is a temporary solution until Jetpack's module primary function is deprecated.
|
modules/sitemaps/sitemap-xsl.php
CHANGED
@@ -90,8 +90,36 @@ $xsl = '<?xml version="1.0" encoding="UTF-8"?>
|
|
90 |
<body>
|
91 |
<div id="description">
|
92 |
<h1>' . esc_html( ent2ncr( __( 'XML Sitemap', 'jetpack' ) ) ) . '</h1>
|
93 |
-
<p>' . wp_kses(
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
</div>
|
96 |
<div id="content">
|
97 |
<table>
|
90 |
<body>
|
91 |
<div id="description">
|
92 |
<h1>' . esc_html( ent2ncr( __( 'XML Sitemap', 'jetpack' ) ) ) . '</h1>
|
93 |
+
<p>' . wp_kses(
|
94 |
+
ent2ncr(
|
95 |
+
sprintf(
|
96 |
+
__( 'This is an XML Sitemap generated by <a href="%s" target="_blank">Jetpack</a>, meant to be consumed by search engines like <a href="%s" target="_blank">Google</a> or <a href="%s" target="_blank">Bing</a>.', 'jetpack' ),
|
97 |
+
'http://jetpack.com/',
|
98 |
+
'https://www.google.com',
|
99 |
+
'https://www.bing.com/'
|
100 |
+
)
|
101 |
+
),
|
102 |
+
array(
|
103 |
+
'a' => array(
|
104 |
+
'href' => true,
|
105 |
+
'title' => true
|
106 |
+
)
|
107 |
+
)
|
108 |
+
) . '</p>
|
109 |
+
<p>' . wp_kses(
|
110 |
+
ent2ncr(
|
111 |
+
sprintf(
|
112 |
+
__( 'You can find more information on XML sitemaps at <a href="%s" target="_blank">sitemaps.org</a>', 'jetpack' ),
|
113 |
+
'http://sitemaps.org'
|
114 |
+
)
|
115 |
+
),
|
116 |
+
array(
|
117 |
+
'a' => array(
|
118 |
+
'href' => true,
|
119 |
+
'title' => true
|
120 |
+
)
|
121 |
+
)
|
122 |
+
) . '</p>
|
123 |
</div>
|
124 |
<div id="content">
|
125 |
<table>
|
modules/sso.php
CHANGED
@@ -795,7 +795,7 @@ class Jetpack_SSO {
|
|
795 |
JetpackTracking::record_user_event( 'sso_user_logged_in', array(
|
796 |
'user_found_with' => $user_found_with,
|
797 |
'user_connected' => (bool) $is_user_connected,
|
798 |
-
'user_role' => Jetpack::
|
799 |
) );
|
800 |
|
801 |
if ( ! $is_user_connected ) {
|
@@ -1010,7 +1010,7 @@ class Jetpack_SSO {
|
|
1010 |
$error = sprintf(
|
1011 |
wp_kses(
|
1012 |
__(
|
1013 |
-
'Two-Step Authentication is required to access this site. Please visit your <a href="%1$s" target="_blank">Security Settings</a> to configure <a href="%2$
|
1014 |
'jetpack'
|
1015 |
),
|
1016 |
array( 'a' => array( 'href' => array() ) )
|
795 |
JetpackTracking::record_user_event( 'sso_user_logged_in', array(
|
796 |
'user_found_with' => $user_found_with,
|
797 |
'user_connected' => (bool) $is_user_connected,
|
798 |
+
'user_role' => Jetpack::translate_current_user_to_role()
|
799 |
) );
|
800 |
|
801 |
if ( ! $is_user_connected ) {
|
1010 |
$error = sprintf(
|
1011 |
wp_kses(
|
1012 |
__(
|
1013 |
+
'Two-Step Authentication is required to access this site. Please visit your <a href="%1$s" target="_blank">Security Settings</a> to configure <a href="%2$s" target="_blank">Two-step Authentication</a> for your account.',
|
1014 |
'jetpack'
|
1015 |
),
|
1016 |
array( 'a' => array( 'href' => array() ) )
|
modules/sso/jetpack-sso-login-rtl.css
CHANGED
@@ -177,3 +177,9 @@
|
|
177 |
.jetpack-sso-form-display #backtoblog {
|
178 |
margin: 24px 0 0;
|
179 |
}
|
|
|
|
|
|
|
|
|
|
|
|
177 |
.jetpack-sso-form-display #backtoblog {
|
178 |
margin: 24px 0 0;
|
179 |
}
|
180 |
+
|
181 |
+
.jetpack-sso-clear:after {
|
182 |
+
content: "";
|
183 |
+
display: table;
|
184 |
+
clear: both;
|
185 |
+
}
|
modules/sso/jetpack-sso-login-rtl.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#loginform{position:relative!important;padding-bottom:92px}.jetpack-sso .message{margin-top:20px}.jetpack-sso #login .message:first-child,.jetpack-sso #login h1+.message{margin-top:0}.jetpack-sso-repositioned #loginform{padding-bottom:26px}#loginform #jetpack-sso-wrap,#loginform #jetpack-sso-wrap *{box-sizing:border-box}#jetpack-sso-wrap__action,#jetpack-sso-wrap__user{display:none}.jetpack-sso-form-display #jetpack-sso-wrap__action,.jetpack-sso-form-display #jetpack-sso-wrap__user{display:block}#jetpack-sso-wrap{position:absolute;bottom:20px;padding:0 24px;margin-right:-24px;margin-left:-24px;width:100%}.jetpack-sso-repositioned #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:16px;margin-right:0;margin-left:0}.jetpack-sso-form-display #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:0;margin-right:0;margin-left:0}#loginform #jetpack-sso-wrap p{color:#777;margin-bottom:16px}#jetpack-sso-wrap a{display:block;width:100%;text-align:center;text-decoration:none}#jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:none}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:block}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.default,.jetpack-sso-form-display #loginform>div,.jetpack-sso-form-display #loginform>p{display:none}.jetpack-sso-form-display #loginform #jetpack-sso-wrap{display:block}.jetpack-sso-form-display #loginform{padding:26px 24px}.jetpack-sso-or{margin-bottom:16px;position:relative;text-align:center}.jetpack-sso-or:before{background:#E5E5E5;content:'';height:1px;position:absolute;right:0;top:50%;width:100%}.jetpack-sso-or span{background:#fff;color:#777;position:relative;padding:0 8px;text-transform:uppercase}.jetpack-sso.button{height:36px;line-height:34px;float:none;margin-bottom:16px;position:relative;width:100%}.jetpack-sso.button>span{position:relative;padding-right:30px}.jetpack-sso.button .genericon-wordpress{position:absolute;right:0;top:-3px;font-size:24px}@media screen and (max-width:782px){.jetpack-sso.button{line-height:22px}}#jetpack-sso-wrap__user img{border-radius:50%;display:block;margin:0 auto 16px}#jetpack-sso-wrap__user h2{font-size:21px;font-weight:300;margin-bottom:16px;text-align:center}#jetpack-sso-wrap__user h2 span{font-weight:700}.jetpack-sso-wrap__reauth{margin-bottom:16px}.jetpack-sso-form-display #nav{display:none}.jetpack-sso-form-display #backtoblog{margin:24px 0 0}
|
1 |
+
#loginform{position:relative!important;padding-bottom:92px}.jetpack-sso .message{margin-top:20px}.jetpack-sso #login .message:first-child,.jetpack-sso #login h1+.message{margin-top:0}.jetpack-sso-repositioned #loginform{padding-bottom:26px}#loginform #jetpack-sso-wrap,#loginform #jetpack-sso-wrap *{box-sizing:border-box}#jetpack-sso-wrap__action,#jetpack-sso-wrap__user{display:none}.jetpack-sso-form-display #jetpack-sso-wrap__action,.jetpack-sso-form-display #jetpack-sso-wrap__user{display:block}#jetpack-sso-wrap{position:absolute;bottom:20px;padding:0 24px;margin-right:-24px;margin-left:-24px;width:100%}.jetpack-sso-repositioned #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:16px;margin-right:0;margin-left:0}.jetpack-sso-form-display #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:0;margin-right:0;margin-left:0}#loginform #jetpack-sso-wrap p{color:#777;margin-bottom:16px}#jetpack-sso-wrap a{display:block;width:100%;text-align:center;text-decoration:none}#jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:none}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:block}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.default,.jetpack-sso-form-display #loginform>div,.jetpack-sso-form-display #loginform>p{display:none}.jetpack-sso-form-display #loginform #jetpack-sso-wrap{display:block}.jetpack-sso-form-display #loginform{padding:26px 24px}.jetpack-sso-or{margin-bottom:16px;position:relative;text-align:center}.jetpack-sso-or:before{background:#E5E5E5;content:'';height:1px;position:absolute;right:0;top:50%;width:100%}.jetpack-sso-or span{background:#fff;color:#777;position:relative;padding:0 8px;text-transform:uppercase}.jetpack-sso.button{height:36px;line-height:34px;float:none;margin-bottom:16px;position:relative;width:100%}.jetpack-sso.button>span{position:relative;padding-right:30px}.jetpack-sso.button .genericon-wordpress{position:absolute;right:0;top:-3px;font-size:24px}@media screen and (max-width:782px){.jetpack-sso.button{line-height:22px}}#jetpack-sso-wrap__user img{border-radius:50%;display:block;margin:0 auto 16px}#jetpack-sso-wrap__user h2{font-size:21px;font-weight:300;margin-bottom:16px;text-align:center}#jetpack-sso-wrap__user h2 span{font-weight:700}.jetpack-sso-wrap__reauth{margin-bottom:16px}.jetpack-sso-form-display #nav{display:none}.jetpack-sso-form-display #backtoblog{margin:24px 0 0}.jetpack-sso-clear:after{content:"";display:table;clear:both}
|
modules/sso/jetpack-sso-login.css
CHANGED
@@ -177,3 +177,9 @@
|
|
177 |
.jetpack-sso-form-display #backtoblog {
|
178 |
margin: 24px 0 0;
|
179 |
}
|
|
|
|
|
|
|
|
|
|
|
|
177 |
.jetpack-sso-form-display #backtoblog {
|
178 |
margin: 24px 0 0;
|
179 |
}
|
180 |
+
|
181 |
+
.jetpack-sso-clear:after {
|
182 |
+
content: "";
|
183 |
+
display: table;
|
184 |
+
clear: both;
|
185 |
+
}
|
modules/sso/jetpack-sso-login.js
CHANGED
@@ -6,7 +6,7 @@ jQuery( document ).ready( function( $ ) {
|
|
6 |
userLogin = $( '#user_login' ),
|
7 |
ssoWrap = $( '#jetpack-sso-wrap' ),
|
8 |
loginForm = $( '#loginform' ),
|
9 |
-
overflow = $( '<div
|
10 |
|
11 |
// The overflow div is a poor man's clearfloat. We reposition the remember me
|
12 |
// checkbox and the submit button within that to clear the float on the
|
6 |
userLogin = $( '#user_login' ),
|
7 |
ssoWrap = $( '#jetpack-sso-wrap' ),
|
8 |
loginForm = $( '#loginform' ),
|
9 |
+
overflow = $( '<div class="jetpack-sso-clear"></div>' );
|
10 |
|
11 |
// The overflow div is a poor man's clearfloat. We reposition the remember me
|
12 |
// checkbox and the submit button within that to clear the float on the
|
modules/sso/jetpack-sso-login.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#loginform{position:relative!important;padding-bottom:92px}.jetpack-sso .message{margin-top:20px}.jetpack-sso #login .message:first-child,.jetpack-sso #login h1+.message{margin-top:0}.jetpack-sso-repositioned #loginform{padding-bottom:26px}#loginform #jetpack-sso-wrap,#loginform #jetpack-sso-wrap *{box-sizing:border-box}#jetpack-sso-wrap__action,#jetpack-sso-wrap__user{display:none}.jetpack-sso-form-display #jetpack-sso-wrap__action,.jetpack-sso-form-display #jetpack-sso-wrap__user{display:block}#jetpack-sso-wrap{position:absolute;bottom:20px;padding:0 24px;margin-left:-24px;margin-right:-24px;width:100%}.jetpack-sso-repositioned #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:16px;margin-left:0;margin-right:0}.jetpack-sso-form-display #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:0;margin-left:0;margin-right:0}#loginform #jetpack-sso-wrap p{color:#777;margin-bottom:16px}#jetpack-sso-wrap a{display:block;width:100%;text-align:center;text-decoration:none}#jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:none}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:block}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.default,.jetpack-sso-form-display #loginform>div,.jetpack-sso-form-display #loginform>p{display:none}.jetpack-sso-form-display #loginform #jetpack-sso-wrap{display:block}.jetpack-sso-form-display #loginform{padding:26px 24px}.jetpack-sso-or{margin-bottom:16px;position:relative;text-align:center}.jetpack-sso-or:before{background:#E5E5E5;content:'';height:1px;position:absolute;left:0;top:50%;width:100%}.jetpack-sso-or span{background:#fff;color:#777;position:relative;padding:0 8px;text-transform:uppercase}.jetpack-sso.button{height:36px;line-height:34px;float:none;margin-bottom:16px;position:relative;width:100%}.jetpack-sso.button>span{position:relative;padding-left:30px}.jetpack-sso.button .genericon-wordpress{position:absolute;left:0;top:-3px;font-size:24px}@media screen and (max-width:782px){.jetpack-sso.button{line-height:22px}}#jetpack-sso-wrap__user img{border-radius:50%;display:block;margin:0 auto 16px}#jetpack-sso-wrap__user h2{font-size:21px;font-weight:300;margin-bottom:16px;text-align:center}#jetpack-sso-wrap__user h2 span{font-weight:700}.jetpack-sso-wrap__reauth{margin-bottom:16px}.jetpack-sso-form-display #nav{display:none}.jetpack-sso-form-display #backtoblog{margin:24px 0 0}
|
1 |
+
#loginform{position:relative!important;padding-bottom:92px}.jetpack-sso .message{margin-top:20px}.jetpack-sso #login .message:first-child,.jetpack-sso #login h1+.message{margin-top:0}.jetpack-sso-repositioned #loginform{padding-bottom:26px}#loginform #jetpack-sso-wrap,#loginform #jetpack-sso-wrap *{box-sizing:border-box}#jetpack-sso-wrap__action,#jetpack-sso-wrap__user{display:none}.jetpack-sso-form-display #jetpack-sso-wrap__action,.jetpack-sso-form-display #jetpack-sso-wrap__user{display:block}#jetpack-sso-wrap{position:absolute;bottom:20px;padding:0 24px;margin-left:-24px;margin-right:-24px;width:100%}.jetpack-sso-repositioned #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:16px;margin-left:0;margin-right:0}.jetpack-sso-form-display #jetpack-sso-wrap{position:relative;bottom:auto;padding:0;margin-top:0;margin-left:0;margin-right:0}#loginform #jetpack-sso-wrap p{color:#777;margin-bottom:16px}#jetpack-sso-wrap a{display:block;width:100%;text-align:center;text-decoration:none}#jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:none}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.wpcom{display:block}.jetpack-sso-form-display #jetpack-sso-wrap .jetpack-sso-toggle.default,.jetpack-sso-form-display #loginform>div,.jetpack-sso-form-display #loginform>p{display:none}.jetpack-sso-form-display #loginform #jetpack-sso-wrap{display:block}.jetpack-sso-form-display #loginform{padding:26px 24px}.jetpack-sso-or{margin-bottom:16px;position:relative;text-align:center}.jetpack-sso-or:before{background:#E5E5E5;content:'';height:1px;position:absolute;left:0;top:50%;width:100%}.jetpack-sso-or span{background:#fff;color:#777;position:relative;padding:0 8px;text-transform:uppercase}.jetpack-sso.button{height:36px;line-height:34px;float:none;margin-bottom:16px;position:relative;width:100%}.jetpack-sso.button>span{position:relative;padding-left:30px}.jetpack-sso.button .genericon-wordpress{position:absolute;left:0;top:-3px;font-size:24px}@media screen and (max-width:782px){.jetpack-sso.button{line-height:22px}}#jetpack-sso-wrap__user img{border-radius:50%;display:block;margin:0 auto 16px}#jetpack-sso-wrap__user h2{font-size:21px;font-weight:300;margin-bottom:16px;text-align:center}#jetpack-sso-wrap__user h2 span{font-weight:700}.jetpack-sso-wrap__reauth{margin-bottom:16px}.jetpack-sso-form-display #nav{display:none}.jetpack-sso-form-display #backtoblog{margin:24px 0 0}.jetpack-sso-clear:after{content:"";display:table;clear:both}
|
modules/stats.php
CHANGED
@@ -21,21 +21,6 @@ defined( 'STATS_DASHBOARD_SERVER' ) or define( 'STATS_DASHBOARD_SERVER', 'dashbo
|
|
21 |
|
22 |
add_action( 'jetpack_modules_loaded', 'stats_load' );
|
23 |
|
24 |
-
// Tell HQ about changed settings
|
25 |
-
Jetpack_Sync::sync_options( __FILE__,
|
26 |
-
'stats_options',
|
27 |
-
'home',
|
28 |
-
'siteurl',
|
29 |
-
'blogname',
|
30 |
-
'blogdescription',
|
31 |
-
'gmt_offset',
|
32 |
-
'timezone_string',
|
33 |
-
'page_on_front',
|
34 |
-
'permalink_structure',
|
35 |
-
'category_base',
|
36 |
-
'tag_base'
|
37 |
-
);
|
38 |
-
|
39 |
function stats_load() {
|
40 |
global $wp_roles;
|
41 |
|
@@ -44,14 +29,6 @@ function stats_load() {
|
|
44 |
Jetpack::module_configuration_head( __FILE__, 'stats_configuration_head' );
|
45 |
Jetpack::module_configuration_screen( __FILE__, 'stats_configuration_screen' );
|
46 |
|
47 |
-
// Tell HQ about changed posts
|
48 |
-
$post_stati = get_post_stati( array( 'public' => true ) ); // All public post stati
|
49 |
-
$post_stati[] = 'private'; // Content from private stati will be redacted
|
50 |
-
Jetpack_Sync::sync_posts( __FILE__, array(
|
51 |
-
'post_types' => get_post_types( array( 'public' => true ) ), // All public post types
|
52 |
-
'post_stati' => $post_stati,
|
53 |
-
) );
|
54 |
-
|
55 |
// Generate the tracking code after wp() has queried for posts.
|
56 |
add_action( 'template_redirect', 'stats_template_redirect', 1 );
|
57 |
|
21 |
|
22 |
add_action( 'jetpack_modules_loaded', 'stats_load' );
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
function stats_load() {
|
25 |
global $wp_roles;
|
26 |
|
29 |
Jetpack::module_configuration_head( __FILE__, 'stats_configuration_head' );
|
30 |
Jetpack::module_configuration_screen( __FILE__, 'stats_configuration_screen' );
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
// Generate the tracking code after wp() has queried for posts.
|
33 |
add_action( 'template_redirect', 'stats_template_redirect', 1 );
|
34 |
|
modules/subscriptions.php
CHANGED
@@ -15,24 +15,6 @@
|
|
15 |
|
16 |
add_action( 'jetpack_modules_loaded', 'jetpack_subscriptions_load' );
|
17 |
|
18 |
-
Jetpack_Sync::sync_options(
|
19 |
-
__FILE__,
|
20 |
-
'home',
|
21 |
-
'blogname',
|
22 |
-
'siteurl',
|
23 |
-
'page_on_front',
|
24 |
-
'permalink_structure',
|
25 |
-
'category_base',
|
26 |
-
'rss_use_excerpt',
|
27 |
-
'subscription_options',
|
28 |
-
'stb_enabled',
|
29 |
-
'stc_enabled',
|
30 |
-
'tag_base'
|
31 |
-
);
|
32 |
-
|
33 |
-
Jetpack_Sync::sync_posts( __FILE__ );
|
34 |
-
Jetpack_Sync::sync_comments( __FILE__ );
|
35 |
-
|
36 |
function jetpack_subscriptions_load() {
|
37 |
Jetpack::enable_module_configurable( __FILE__ );
|
38 |
Jetpack::module_configuration_load( __FILE__, 'jetpack_subscriptions_configuration_load' );
|
15 |
|
16 |
add_action( 'jetpack_modules_loaded', 'jetpack_subscriptions_load' );
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
function jetpack_subscriptions_load() {
|
19 |
Jetpack::enable_module_configurable( __FILE__ );
|
20 |
Jetpack::module_configuration_load( __FILE__, 'jetpack_subscriptions_configuration_load' );
|
modules/theme-tools/random-redirect.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Random Redirect
|
4 |
-
Plugin URI:
|
5 |
Description: Allows you to create a link to yourblog.example.com/?random which will redirect someone to a random post on your blog, in a StumbleUpon-like fashion.
|
6 |
Version: 1.2-wpcom
|
7 |
Author: Matt Mullenweg
|
@@ -31,6 +31,8 @@ function jetpack_matt_random_redirect() {
|
|
31 |
if ( is_author() ) {
|
32 |
$random_author_name = get_the_author_meta( 'user_login' );
|
33 |
$random_author_query = 'AND user_login = "' . $random_author_name . '"';
|
|
|
|
|
34 |
}
|
35 |
|
36 |
// Acceptable URL formats: /[...]/?random=[post type], /?random, /&random, /&random=1
|
@@ -65,7 +67,7 @@ function jetpack_matt_random_redirect() {
|
|
65 |
} else {
|
66 |
$random_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_password = '' AND post_status = 'publish' %s ORDER BY RAND() LIMIT 1", $post_type, $random_author_query ) );
|
67 |
}
|
68 |
-
|
69 |
$permalink = get_permalink( $random_id );
|
70 |
wp_safe_redirect( $permalink );
|
71 |
exit;
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Random Redirect
|
4 |
+
Plugin URI: https://wordpress.org/extend/plugins/random-redirect/
|
5 |
Description: Allows you to create a link to yourblog.example.com/?random which will redirect someone to a random post on your blog, in a StumbleUpon-like fashion.
|
6 |
Version: 1.2-wpcom
|
7 |
Author: Matt Mullenweg
|
31 |
if ( is_author() ) {
|
32 |
$random_author_name = get_the_author_meta( 'user_login' );
|
33 |
$random_author_query = 'AND user_login = "' . $random_author_name . '"';
|
34 |
+
} else {
|
35 |
+
$random_author_query = '';
|
36 |
}
|
37 |
|
38 |
// Acceptable URL formats: /[...]/?random=[post type], /?random, /&random, /&random=1
|
67 |
} else {
|
68 |
$random_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_password = '' AND post_status = 'publish' %s ORDER BY RAND() LIMIT 1", $post_type, $random_author_query ) );
|
69 |
}
|
70 |
+
|
71 |
$permalink = get_permalink( $random_id );
|
72 |
wp_safe_redirect( $permalink );
|
73 |
exit;
|
modules/theme-tools/site-breadcrumbs.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Site Breadcrumbs
|
4 |
* Plugin URI: http://wordpress.com
|
5 |
-
* Description: Quickly add breadcrumbs to the single view of a hierarchical post type
|
6 |
* Author: Automattic
|
7 |
* Version: 1.0
|
8 |
* Author URI: http://wordpress.com
|
@@ -10,28 +10,70 @@
|
|
10 |
*/
|
11 |
|
12 |
function jetpack_breadcrumbs() {
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
return;
|
15 |
}
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
-
|
|
|
|
|
25 |
|
26 |
-
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
-
$
|
35 |
|
36 |
-
|
37 |
}
|
2 |
/**
|
3 |
* Plugin Name: Site Breadcrumbs
|
4 |
* Plugin URI: http://wordpress.com
|
5 |
+
* Description: Quickly add breadcrumbs to the single view of a hierarchical post type or a hierarchical taxonomy.
|
6 |
* Author: Automattic
|
7 |
* Version: 1.0
|
8 |
* Author URI: http://wordpress.com
|
10 |
*/
|
11 |
|
12 |
function jetpack_breadcrumbs() {
|
13 |
+
$taxonomy = is_category() ? 'category' : get_query_var( 'taxonomy' );
|
14 |
+
$is_taxonomy_hierarchical = is_taxonomy_hierarchical( $taxonomy );
|
15 |
+
|
16 |
+
$post_type = is_page() ? 'page' : get_query_var( 'post_type' );
|
17 |
+
$is_post_type_hierarchical = is_post_type_hierarchical( $post_type );
|
18 |
+
|
19 |
+
if ( ! ( $is_post_type_hierarchical || $is_taxonomy_hierarchical ) || is_front_page() ) {
|
20 |
return;
|
21 |
}
|
22 |
|
23 |
+
$breadcrumb = '';
|
24 |
|
25 |
+
if ( $is_post_type_hierarchical ) {
|
26 |
+
$post_id = get_queried_object_id();
|
27 |
+
$ancestors = array_reverse( get_post_ancestors( $post_id ) );
|
28 |
+
if ( $ancestors ) {
|
29 |
+
foreach ( $ancestors as $ancestor ) {
|
30 |
+
$breadcrumb .= '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( get_permalink( $ancestor ) ) . '" itemprop="item"><span itemprop="name">' . esc_html( get_the_title( $ancestor ) ) . '</span></a></span>';
|
31 |
+
}
|
32 |
+
}
|
33 |
+
$breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">' . esc_html( get_the_title( $post_id ) ) . '</span></span>';
|
34 |
+
} elseif ( $is_taxonomy_hierarchical ) {
|
35 |
+
$current = get_term( get_queried_object_id(), $taxonomy );
|
36 |
|
37 |
+
if ( is_wp_error( $current ) ) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
|
41 |
+
if ( $current->parent ) {
|
42 |
+
$breadcrumb = jetpack_get_term_parents( $current->parent, $taxonomy );
|
43 |
+
}
|
44 |
|
45 |
+
$breadcrumb .= '<span class="current-category" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">' . esc_html( $current->name ) . '</span></span>';
|
46 |
+
}
|
47 |
|
48 |
+
$home = '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( home_url( '/' ) ) . '" class="home-link" itemprop="item" rel="home"><span itemprop="name">' . esc_html__( 'Home', 'jetpack' ) . '</span></a></span>';
|
49 |
+
|
50 |
+
echo '<nav class="entry-breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">' . $home . $breadcrumb . '</nav>';
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Return the parents for a given taxonomy term ID.
|
55 |
+
*
|
56 |
+
* @param int $term Taxonomy term whose parents will be returned.
|
57 |
+
* @param string $taxonomy Taxonomy name that the term belongs to.
|
58 |
+
* @param array $visited Terms already added to prevent duplicates.
|
59 |
+
*
|
60 |
+
* @return string A list of links to the term parents.
|
61 |
+
*/
|
62 |
+
function jetpack_get_term_parents( $term, $taxonomy, $visited = array() ) {
|
63 |
+
$parent = get_term( $term, $taxonomy );
|
64 |
+
|
65 |
+
if ( is_wp_error( $parent ) ) {
|
66 |
+
return $parent;
|
67 |
+
}
|
68 |
+
|
69 |
+
$chain = '';
|
70 |
+
|
71 |
+
if ( $parent->parent && ( $parent->parent != $parent->term_id ) && ! in_array( $parent->parent, $visited ) ) {
|
72 |
+
$visited[] = $parent->parent;
|
73 |
+
$chain .= jetpack_get_term_parents( $parent->parent, $taxonomy, $visited );
|
74 |
}
|
75 |
|
76 |
+
$chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '">' . $parent->name . '</a>';
|
77 |
|
78 |
+
return $chain;
|
79 |
}
|
modules/tiled-gallery/tiled-gallery.php
CHANGED
@@ -20,7 +20,7 @@ class Jetpack_Tiled_Gallery {
|
|
20 |
|
21 |
public function tiles_enabled() {
|
22 |
// Check the setting status
|
23 |
-
return '' !=
|
24 |
}
|
25 |
|
26 |
public function set_atts( $atts ) {
|
20 |
|
21 |
public function tiles_enabled() {
|
22 |
// Check the setting status
|
23 |
+
return '' != Jetpack_Options::get_option_and_ensure_autoload( 'tiled_galleries', '' );
|
24 |
}
|
25 |
|
26 |
public function set_atts( $atts ) {
|
modules/verification-tools/blog-verification-tools.php
CHANGED
@@ -31,7 +31,7 @@ function jetpack_verification_options_init() {
|
|
31 |
add_action( 'admin_init', 'jetpack_verification_options_init' );
|
32 |
|
33 |
function jetpack_verification_print_meta() {
|
34 |
-
$verification_services_codes =
|
35 |
if ( is_array( $verification_services_codes ) ) {
|
36 |
$ver_output = "<!-- Jetpack Site Verification Tags -->\n";
|
37 |
foreach ( jetpack_verification_services() as $name => $service ) {
|
31 |
add_action( 'admin_init', 'jetpack_verification_options_init' );
|
32 |
|
33 |
function jetpack_verification_print_meta() {
|
34 |
+
$verification_services_codes = Jetpack_Options::get_option_and_ensure_autoload( 'verification_services_codes', '0' );
|
35 |
if ( is_array( $verification_services_codes ) ) {
|
36 |
$ver_output = "<!-- Jetpack Site Verification Tags -->\n";
|
37 |
foreach ( jetpack_verification_services() as $name => $service ) {
|
modules/videopress/js/videopress-admin.js
CHANGED
@@ -465,7 +465,7 @@
|
|
465 |
var VideoPressModal = new VideoPressModalView();
|
466 |
|
467 |
// Configuration screen behavior
|
468 |
-
$(document).
|
469 |
var $form = $( '#videopress-settings' );
|
470 |
|
471 |
// Not on a configuration screen
|
465 |
var VideoPressModal = new VideoPressModalView();
|
466 |
|
467 |
// Configuration screen behavior
|
468 |
+
$(document).ready( function() {
|
469 |
var $form = $( '#videopress-settings' );
|
470 |
|
471 |
// Not on a configuration screen
|
modules/widgets/contact-info.php
CHANGED
@@ -42,26 +42,10 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
42 |
* Enqueue scripts and styles.
|
43 |
*/
|
44 |
public function enqueue_scripts() {
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Set a Google Maps API Key.
|
48 |
-
*
|
49 |
-
* @since 4.1.0
|
50 |
-
*
|
51 |
-
* @param string $key Google Maps API Key
|
52 |
-
*/
|
53 |
-
$key = apply_filters( 'jetpack_google_maps_api_key', null );
|
54 |
-
|
55 |
-
if ( ! empty( $key ) ) {
|
56 |
-
$google_url = add_query_arg( 'key', $key, $google_url );
|
57 |
-
}
|
58 |
-
|
59 |
-
wp_enqueue_script( 'jquery' );
|
60 |
-
wp_enqueue_script( 'google-maps', esc_url( $google_url, null, null ) );
|
61 |
-
wp_enqueue_script( 'contact-info-map-js', plugins_url( 'contact-info/contact-info-map.js', __FILE__ ), array( 'jquery', 'google-maps' ), 20150127 );
|
62 |
-
wp_enqueue_style( 'contact-info-map-css', plugins_url( 'contact-info/contact-info-map.css', __FILE__ ), null, 20150127 );
|
63 |
}
|
64 |
|
|
|
65 |
/**
|
66 |
* Return an associative array of default values
|
67 |
*
|
@@ -75,7 +59,8 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
75 |
'address' => __( "3999 Mission Boulevard,\nSan Diego CA 92109", 'jetpack' ),
|
76 |
'phone' => _x( '1-202-555-1212', 'Example of a phone number', 'jetpack' ),
|
77 |
'hours' => __( "Lunch: 11am - 2pm \nDinner: M-Th 5pm - 11pm, Fri-Sat:5pm - 1am", 'jetpack' ),
|
78 |
-
'showmap' =>
|
|
|
79 |
'lat' => null,
|
80 |
'lon' => null
|
81 |
);
|
@@ -111,12 +96,17 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
111 |
|
112 |
$showmap = $instance['showmap'];
|
113 |
|
|
|
114 |
if ( $showmap && $this->has_good_map( $instance ) ) {
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
|
122 |
$map_link = $this->build_map_link( $instance['address'] );
|
@@ -173,6 +163,7 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
173 |
$instance['address'] = wp_kses( $new_instance['address'], array() );
|
174 |
$instance['phone'] = wp_kses( $new_instance['phone'], array() );
|
175 |
$instance['hours'] = wp_kses( $new_instance['hours'], array() );
|
|
|
176 |
$instance['lat'] = isset( $old_instance['lat'] ) ? floatval( $old_instance['lat'] ) : 0;
|
177 |
$instance['lon'] = isset( $old_instance['lon'] ) ? floatval( $old_instance['lon'] ) : 0;
|
178 |
|
@@ -186,7 +177,7 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
186 |
$address = $this->urlencode_address( $instance['address'] );
|
187 |
$path = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" . $address;
|
188 |
/** This action is documented in modules/widgets/contact-info.php */
|
189 |
-
$key = apply_filters( 'jetpack_google_maps_api_key',
|
190 |
|
191 |
if ( ! empty( $key ) ) {
|
192 |
$path = add_query_arg( 'key', $key, $path );
|
@@ -239,6 +230,8 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
239 |
*/
|
240 |
function form( $instance ) {
|
241 |
$instance = wp_parse_args( $instance, $this->defaults() );
|
|
|
|
|
242 |
?>
|
243 |
<p>
|
244 |
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'jetpack' ); ?></label>
|
@@ -251,7 +244,7 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
251 |
<?php
|
252 |
if ( $this->has_good_map( $instance ) ) {
|
253 |
?>
|
254 |
-
<input class="" id="<?php echo esc_attr( $this->get_field_id( 'showmap' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'showmap' ) ); ?>" value="1" type="checkbox" <?php checked( $instance['showmap'], 1 ); ?> />
|
255 |
<label for="<?php echo esc_attr( $this->get_field_id( 'showmap' ) ); ?>"><?php esc_html_e( 'Show map', 'jetpack' ); ?></label>
|
256 |
<?php
|
257 |
}
|
@@ -263,6 +256,16 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
263 |
}
|
264 |
?>
|
265 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
<p>
|
267 |
<label for="<?php echo esc_attr( $this->get_field_id( 'phone' ) ); ?>"><?php esc_html_e( 'Phone:', 'jetpack' ); ?></label>
|
268 |
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'phone' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'phone' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['phone'] ); ?>" />
|
@@ -298,19 +301,14 @@ if ( ! class_exists( 'Jetpack_Contact_Info_Widget' ) ) {
|
|
298 |
*
|
299 |
* @return string HTML of the map
|
300 |
*/
|
301 |
-
function build_map( $
|
302 |
$this->enqueue_scripts();
|
|
|
|
|
|
|
|
|
303 |
|
304 |
-
|
305 |
-
$lon = esc_attr( $lon );
|
306 |
-
$html = <<<EOT
|
307 |
-
<div class="contact-map">
|
308 |
-
<input type="hidden" class="contact-info-map-lat" value="$lat" />
|
309 |
-
<input type="hidden" class="contact-info-map-lon" value="$lon" />
|
310 |
-
<div class="contact-info-map-canvas"></div></div>
|
311 |
-
EOT;
|
312 |
-
|
313 |
-
return $html;
|
314 |
}
|
315 |
|
316 |
/**
|
42 |
* Enqueue scripts and styles.
|
43 |
*/
|
44 |
public function enqueue_scripts() {
|
45 |
+
wp_enqueue_style( 'contact-info-map-css', plugins_url( 'contact-info/contact-info-map.css', __FILE__ ), null, 20160623 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
+
|
49 |
/**
|
50 |
* Return an associative array of default values
|
51 |
*
|
59 |
'address' => __( "3999 Mission Boulevard,\nSan Diego CA 92109", 'jetpack' ),
|
60 |
'phone' => _x( '1-202-555-1212', 'Example of a phone number', 'jetpack' ),
|
61 |
'hours' => __( "Lunch: 11am - 2pm \nDinner: M-Th 5pm - 11pm, Fri-Sat:5pm - 1am", 'jetpack' ),
|
62 |
+
'showmap' => 0,
|
63 |
+
'apikey' => null,
|
64 |
'lat' => null,
|
65 |
'lon' => null
|
66 |
);
|
96 |
|
97 |
$showmap = $instance['showmap'];
|
98 |
|
99 |
+
/** This action is documented in modules/widgets/contact-info.php */
|
100 |
if ( $showmap && $this->has_good_map( $instance ) ) {
|
101 |
+
/**
|
102 |
+
* Set a Google Maps API Key.
|
103 |
+
*
|
104 |
+
* @since 4.1.0
|
105 |
+
*
|
106 |
+
* @param string $api_key Google Maps API Key
|
107 |
+
*/
|
108 |
+
$api_key = apply_filters( 'jetpack_google_maps_api_key', $instance['apikey'] );
|
109 |
+
echo $this->build_map( $instance['address'], $api_key );
|
110 |
}
|
111 |
|
112 |
$map_link = $this->build_map_link( $instance['address'] );
|
163 |
$instance['address'] = wp_kses( $new_instance['address'], array() );
|
164 |
$instance['phone'] = wp_kses( $new_instance['phone'], array() );
|
165 |
$instance['hours'] = wp_kses( $new_instance['hours'], array() );
|
166 |
+
$instance['apikey'] = wp_kses( isset( $new_instance['apikey'] ) ? $new_instance['apikey'] : $old_instance['apikey'], array() );
|
167 |
$instance['lat'] = isset( $old_instance['lat'] ) ? floatval( $old_instance['lat'] ) : 0;
|
168 |
$instance['lon'] = isset( $old_instance['lon'] ) ? floatval( $old_instance['lon'] ) : 0;
|
169 |
|
177 |
$address = $this->urlencode_address( $instance['address'] );
|
178 |
$path = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" . $address;
|
179 |
/** This action is documented in modules/widgets/contact-info.php */
|
180 |
+
$key = apply_filters( 'jetpack_google_maps_api_key', $instance['apikey'] );
|
181 |
|
182 |
if ( ! empty( $key ) ) {
|
183 |
$path = add_query_arg( 'key', $key, $path );
|
230 |
*/
|
231 |
function form( $instance ) {
|
232 |
$instance = wp_parse_args( $instance, $this->defaults() );
|
233 |
+
wp_enqueue_script( 'contact-info-admin', plugins_url( 'contact-info/contact-info-admin.js', __FILE__ ), array( 'jquery' ), 20160727 );
|
234 |
+
|
235 |
?>
|
236 |
<p>
|
237 |
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'jetpack' ); ?></label>
|
244 |
<?php
|
245 |
if ( $this->has_good_map( $instance ) ) {
|
246 |
?>
|
247 |
+
<input class="jp-contact-info-showmap" id="<?php echo esc_attr( $this->get_field_id( 'showmap' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'showmap' ) ); ?>" value="1" type="checkbox" <?php checked( $instance['showmap'], 1 ); ?> />
|
248 |
<label for="<?php echo esc_attr( $this->get_field_id( 'showmap' ) ); ?>"><?php esc_html_e( 'Show map', 'jetpack' ); ?></label>
|
249 |
<?php
|
250 |
}
|
256 |
}
|
257 |
?>
|
258 |
</p>
|
259 |
+
|
260 |
+
<p class="jp-contact-info-apikey" style="<?php echo $instance['showmap'] ? '' : 'display: none;'; ?>">
|
261 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'apikey' ) ); ?>">
|
262 |
+
<?php _e( 'Google Maps API Key', 'jetpack' ); ?>
|
263 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'apikey' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'apikey' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['apikey'] ); ?>" />
|
264 |
+
<br />
|
265 |
+
<small><?php printf( wp_kses( __( 'Google now requires an API key to use their maps on your site. <a href="%s">See our documentation</a> for instructions on acquiring a key.' ), array( 'a' => array( 'href' => true ) ) ), 'https://jetpack.com/support/extra-sidebar-widgets/contact-info-widget/' ); ?></small>
|
266 |
+
</label>
|
267 |
+
</p>
|
268 |
+
|
269 |
<p>
|
270 |
<label for="<?php echo esc_attr( $this->get_field_id( 'phone' ) ); ?>"><?php esc_html_e( 'Phone:', 'jetpack' ); ?></label>
|
271 |
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'phone' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'phone' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['phone'] ); ?>" />
|
301 |
*
|
302 |
* @return string HTML of the map
|
303 |
*/
|
304 |
+
function build_map( $address, $api_key = null ) {
|
305 |
$this->enqueue_scripts();
|
306 |
+
$src = add_query_arg( 'q', urlencode( $address ), 'https://www.google.com/maps/embed/v1/place' );
|
307 |
+
if ( ! empty( $api_key ) ) {
|
308 |
+
$src = add_query_arg( 'key', $api_key, $src );
|
309 |
+
}
|
310 |
|
311 |
+
return '<iframe width="600" height="216" frameborder="0" src="' . esc_url( $src ) . '" class="contact-map"></iframe>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
313 |
|
314 |
/**
|
modules/widgets/contact-info/contact-info-admin.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function( $ ) {
|
2 |
+
$( document ).on( 'change', '.jp-contact-info-showmap', function() {
|
3 |
+
var $checkbox = $( this ),
|
4 |
+
isChecked = $checkbox.is( ':checked' );
|
5 |
+
|
6 |
+
$checkbox.closest( '.widget' ).find( '.jp-contact-info-apikey' ).toggle( isChecked );
|
7 |
+
});
|
8 |
+
})( window.jQuery );
|
modules/widgets/contact-info/contact-info-map.css
CHANGED
@@ -1,11 +1,4 @@
|
|
1 |
-
.contact-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
overflow: hidden;
|
6 |
-
}
|
7 |
-
|
8 |
-
/* Prevent Google maps controls from being hidden */
|
9 |
-
.gmnoprint img {
|
10 |
-
max-width: none !important;
|
11 |
-
}
|
1 |
+
.contact-map {
|
2 |
+
max-width: 100%;
|
3 |
+
border: 0;
|
4 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules/widgets/contact-info/contact-info-map.js
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
/* global google */
|
2 |
-
/* jshint unused:false */
|
3 |
-
jQuery( function( $ ) {
|
4 |
-
|
5 |
-
function setupContactMaps( rootElement ) {
|
6 |
-
rootElement = $( rootElement || document.body );
|
7 |
-
|
8 |
-
rootElement.find( 'div.contact-map' ).each( function() {
|
9 |
-
|
10 |
-
// get lat and lon from hidden input values
|
11 |
-
var lat = jQuery(this).find('.contact-info-map-lat').val(),
|
12 |
-
lon = jQuery(this).find('.contact-info-map-lon').val(),
|
13 |
-
lat_lon = new google.maps.LatLng( lat, lon ),
|
14 |
-
mapOptions = {
|
15 |
-
zoom: 16,
|
16 |
-
center: lat_lon,
|
17 |
-
mapTypeId: google.maps.MapTypeId.ROADMAP
|
18 |
-
},
|
19 |
-
map = new google.maps.Map(jQuery(this).find('.contact-info-map-canvas')[0], mapOptions),
|
20 |
-
marker = new google.maps.Marker({
|
21 |
-
map: map,
|
22 |
-
position: lat_lon
|
23 |
-
});
|
24 |
-
|
25 |
-
google.maps.event.addListenerOnce(map, 'mouseover', function() {
|
26 |
-
google.maps.event.trigger(map, 'resize');
|
27 |
-
});
|
28 |
-
|
29 |
-
});
|
30 |
-
}
|
31 |
-
|
32 |
-
setupContactMaps();
|
33 |
-
|
34 |
-
if ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ) {
|
35 |
-
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
|
36 |
-
if ( wp.isJetpackWidgetPlaced( placement, 'widget_contact_info' ) ) {
|
37 |
-
setupContactMaps( placement.container );
|
38 |
-
}
|
39 |
-
} );
|
40 |
-
}
|
41 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modules/widgets/gravatar-profile.php
CHANGED
@@ -115,7 +115,7 @@ class Jetpack_Gravatar_Profile_Widget extends WP_Widget {
|
|
115 |
<?php
|
116 |
|
117 |
/**
|
118 |
-
* Fires when an item is displayed on the
|
119 |
*
|
120 |
* Can be used to track stats about the number of displays for a specific item
|
121 |
*
|
115 |
<?php
|
116 |
|
117 |
/**
|
118 |
+
* Fires when an item is displayed on the front end.
|
119 |
*
|
120 |
* Can be used to track stats about the number of displays for a specific item
|
121 |
*
|
modules/widgets/social-media-icons.php
CHANGED
@@ -170,7 +170,7 @@ class WPCOM_social_media_icons_widget extends WP_Widget {
|
|
170 |
echo apply_filters( 'jetpack_social_media_icons_widget_output', $html );
|
171 |
}
|
172 |
|
173 |
-
//
|
174 |
public function form( $instance ) {
|
175 |
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
176 |
?>
|
170 |
echo apply_filters( 'jetpack_social_media_icons_widget_output', $html );
|
171 |
}
|
172 |
|
173 |
+
// back end
|
174 |
public function form( $instance ) {
|
175 |
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
176 |
?>
|
modules/widgets/top-posts.php
CHANGED
@@ -246,7 +246,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget {
|
|
246 |
$get_image_options = array(
|
247 |
'fallback_to_avatars' => true,
|
248 |
/** This filter is documented in modules/stats.php */
|
249 |
-
'gravatar_default' => apply_filters( 'jetpack_static_url', set_url_scheme( '
|
250 |
);
|
251 |
if ( 'grid' == $display ) {
|
252 |
$get_image_options['avatar_size'] = 200;
|
246 |
$get_image_options = array(
|
247 |
'fallback_to_avatars' => true,
|
248 |
/** This filter is documented in modules/stats.php */
|
249 |
+
'gravatar_default' => apply_filters( 'jetpack_static_url', set_url_scheme( 'https://en.wordpress.com/i/logo/white-gray-80.png' ) ),
|
250 |
);
|
251 |
if ( 'grid' == $display ) {
|
252 |
$get_image_options['avatar_size'] = 200;
|
modules/widgets/top-posts/style.css
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
margin: 0 2px 4px 0;
|
29 |
}
|
30 |
|
31 |
-
.widget-grid-view-image:
|
32 |
float: right;
|
33 |
}
|
34 |
|
28 |
margin: 0 2px 4px 0;
|
29 |
}
|
30 |
|
31 |
+
.widget-grid-view-image:nth-child(even) {
|
32 |
float: right;
|
33 |
}
|
34 |
|
modules/widgets/twitter-timeline.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/*
|
4 |
* Based on Evolution Twitter Timeline
|
5 |
-
* (
|
6 |
* For details on Twitter Timelines see:
|
7 |
* - https://twitter.com/settings/widgets
|
8 |
* - https://dev.twitter.com/docs/embedded-timelines
|
2 |
|
3 |
/*
|
4 |
* Based on Evolution Twitter Timeline
|
5 |
+
* (https://wordpress.org/extend/plugins/evolution-twitter-timeline/)
|
6 |
* For details on Twitter Timelines see:
|
7 |
* - https://twitter.com/settings/widgets
|
8 |
* - https://dev.twitter.com/docs/embedded-timelines
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Jetpack by WordPress.com ===
|
2 |
Contributors: automattic, adamkheckler, aduth, akirk, allendav, alternatekev, andy, annezazu, apeatling, azaozz, batmoo, barry, beaulebens, blobaugh, cainm, cena, cfinke, chaselivingston, chellycat, csonnek, danielbachhuber, davoraltman, daniloercoli, designsimply, dllh, drawmyface, dsmart, dzver, ebinnion, eliorivero, enej, eoigal, ethitter, gcorne, georgestephanis, gibrown, goldsounds, hew, hugobaeta, hypertextranch, iammattthomas, iandunn, jacobshere, jblz, jeherve, jenhooks, jenia, jgs, jkudish, jmdodd, Joen, johnjamesjacoby, jshreve, koke, kraftbj, lamdayap, lancewillett, lschuyler, macmanx, martinremy, matt, matveb, mattwiebe, maverick3x6, mcsf, mdawaffe, michael-arestad, migueluy, mikeyarce, mkaz, nancythanki, nickmomrik, obenland, pento, professor44, rachelsquirrel, rdcoll, ryancowles, richardmuscat, richardmtl, roccotripaldi, samhotchkiss, scarstocea, sdquirk, stefmattana, stephdau, tmoorewp, Viper007Bond, westi, yoavf, zinigor
|
3 |
Tags: WordPress.com, jet pack, comments, contact, gallery, performance, sharing, security, shortcodes, stats, subscriptions, widgets
|
4 |
-
Stable tag: 4.
|
5 |
Requires at least: 4.4
|
6 |
-
Tested up to: 4.
|
7 |
|
8 |
Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.
|
9 |
|
@@ -75,6 +75,51 @@ There are opportunities for developers at all levels to contribute. [Learn more
|
|
75 |
|
76 |
== Changelog ==
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
= 4.1.1 =
|
79 |
|
80 |
* Release date: July 7th, 2016
|
@@ -187,7 +232,7 @@ Bug Fixes:
|
|
187 |
* We accidentally removed the ability for Open Graph to select images from slideshows, it’s up and running again.
|
188 |
* There was an issue where Open Graph meta tags weren’t being set when your homepage is a “Static Front Page”, it’s working again.
|
189 |
* In rare cases when developers were customizing Photon they were seeing a PHP notice when arguments were passed as a string rather than an array. This has been fixed.
|
190 |
-
* We’ve fixed an issue where Protect’s backup math form wasn’t showing on custom
|
191 |
* When setting up WooCommerce you might have seen a Related Posts notice which didn’t belong. We’ve eliminated them.
|
192 |
* If you’ve been using our sharing tool with unofficial sharing buttons you might have noticed your sharing numbers were missing. They’re now back.
|
193 |
* In unique situations where special characters were used in sitemap stylesheets an error would occur; that has been remedied.
|
1 |
=== Jetpack by WordPress.com ===
|
2 |
Contributors: automattic, adamkheckler, aduth, akirk, allendav, alternatekev, andy, annezazu, apeatling, azaozz, batmoo, barry, beaulebens, blobaugh, cainm, cena, cfinke, chaselivingston, chellycat, csonnek, danielbachhuber, davoraltman, daniloercoli, designsimply, dllh, drawmyface, dsmart, dzver, ebinnion, eliorivero, enej, eoigal, ethitter, gcorne, georgestephanis, gibrown, goldsounds, hew, hugobaeta, hypertextranch, iammattthomas, iandunn, jacobshere, jblz, jeherve, jenhooks, jenia, jgs, jkudish, jmdodd, Joen, johnjamesjacoby, jshreve, koke, kraftbj, lamdayap, lancewillett, lschuyler, macmanx, martinremy, matt, matveb, mattwiebe, maverick3x6, mcsf, mdawaffe, michael-arestad, migueluy, mikeyarce, mkaz, nancythanki, nickmomrik, obenland, pento, professor44, rachelsquirrel, rdcoll, ryancowles, richardmuscat, richardmtl, roccotripaldi, samhotchkiss, scarstocea, sdquirk, stefmattana, stephdau, tmoorewp, Viper007Bond, westi, yoavf, zinigor
|
3 |
Tags: WordPress.com, jet pack, comments, contact, gallery, performance, sharing, security, shortcodes, stats, subscriptions, widgets
|
4 |
+
Stable tag: 4.2
|
5 |
Requires at least: 4.4
|
6 |
+
Tested up to: 4.6
|
7 |
|
8 |
Increase your traffic, view your stats, speed up your site, and protect yourself from hackers with Jetpack.
|
9 |
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
+
= 4.2 =
|
79 |
+
|
80 |
+
* Release date: August 10th, 2016
|
81 |
+
|
82 |
+
**Performance Enhancements:**
|
83 |
+
|
84 |
+
* We’ve improved Jetpack’s performance by making calls to the database more efficient; essentially, Jetpack is doing less on each page load, making things faster. #4281, #4316
|
85 |
+
* We’ve ensured that every feature uses information that is up to date by completely refactoring the way information was synchronized between your site and WordPress.com.
|
86 |
+
* We've improved the way Jetpack queries for information about features, which results in less overall queries.
|
87 |
+
|
88 |
+
**Exciting Feature and UI Improvements:**
|
89 |
+
|
90 |
+
* We now track your visitor views of Carousel images in stats.
|
91 |
+
* You can now customize advanced typographic settings like ligatures in the Custom CSS editor with new support for the `font-feature-settings` property.
|
92 |
+
* We’ve improved the experience when you don’t actually have enough posts to Infinitely Scroll.
|
93 |
+
* Our Contact Info Widget allows you to enter a Google Maps API Key which is now required by Google if you want to display a map.
|
94 |
+
|
95 |
+
**Security:**
|
96 |
+
|
97 |
+
* We’re continuing our efforts to harden Jetpack security, by implementing the `hash_equals()` function to avoid timing attacks when comparing strings. We also improved security on CSVs exported from your contact form.
|
98 |
+
|
99 |
+
**Slightly Less Exciting Feature Improvements:**
|
100 |
+
|
101 |
+
* The Cartodb shortcode has been changed to match the new product name, Carto.
|
102 |
+
* The YouTube shortcode now uses the content width defined by the theme when available, even if an embed size was defined in an old version of WordPress.
|
103 |
+
* Breadcrumbs now support hierarchical post types and taxonomies.
|
104 |
+
* We’ve added the Portfolio Post Type to the WordPress.com REST API whitelist.
|
105 |
+
* There are a few new parameters for the Dailymotion shortcode.
|
106 |
+
|
107 |
+
**Improved Compatibility:**
|
108 |
+
|
109 |
+
* We now work well with WP Stagecoach staging sites, so you should not see any future impact on production sites.
|
110 |
+
* We had some PHP notices popping up in the WooCommerce plugin wizard screen, these are gone.
|
111 |
+
|
112 |
+
**Bug Fixes:**
|
113 |
+
|
114 |
+
* We stopped loading compatibility stylesheets on the default theme's singular views for Infinite Scroll.
|
115 |
+
* Debug tests forwarded through the contact form in the Jetpack Debug menu are now successfully sent to the support team.
|
116 |
+
* We’ve removed the PHP notices you might have seen when moderating comments.
|
117 |
+
* There are no longer PHP notices cropping up when publishing via Cron.
|
118 |
+
* We’ve fixed the official Sharing buttons so they now line up just right.
|
119 |
+
* The PHP warnings of Sitemaps stylesheets have been eliminated.
|
120 |
+
* We’ve done away with the warnings that appeared when Tonesque processes a file which claims to be one filetype, but is actually another.
|
121 |
+
* We’ve exterminated PHP notices that appeared when using Random Redirect, as well as when the author wasn't set.
|
122 |
+
|
123 |
= 4.1.1 =
|
124 |
|
125 |
* Release date: July 7th, 2016
|
232 |
* We accidentally removed the ability for Open Graph to select images from slideshows, it’s up and running again.
|
233 |
* There was an issue where Open Graph meta tags weren’t being set when your homepage is a “Static Front Page”, it’s working again.
|
234 |
* In rare cases when developers were customizing Photon they were seeing a PHP notice when arguments were passed as a string rather than an array. This has been fixed.
|
235 |
+
* We’ve fixed an issue where Protect’s backup math form wasn’t showing on custom front end login forms.
|
236 |
* When setting up WooCommerce you might have seen a Related Posts notice which didn’t belong. We’ve eliminated them.
|
237 |
* If you’ve been using our sharing tool with unofficial sharing buttons you might have noticed your sharing numbers were missing. They’re now back.
|
238 |
* In unique situations where special characters were used in sitemap stylesheets an error would occur; that has been remedied.
|
sal/class.json-api-links.php
CHANGED
@@ -7,11 +7,11 @@ class WPCOM_JSON_API_Links {
|
|
7 |
private static $instance;
|
8 |
|
9 |
public static function getInstance() {
|
10 |
-
if (null ===
|
11 |
-
|
12 |
}
|
13 |
-
|
14 |
-
return
|
15 |
}
|
16 |
|
17 |
// protect these methods for singleton
|
7 |
private static $instance;
|
8 |
|
9 |
public static function getInstance() {
|
10 |
+
if ( null === self::$instance ) {
|
11 |
+
self::$instance = new self();
|
12 |
}
|
13 |
+
|
14 |
+
return self::$instance;
|
15 |
}
|
16 |
|
17 |
// protect these methods for singleton
|
sal/class.json-api-post-base.php
CHANGED
@@ -289,7 +289,6 @@ abstract class SAL_Post {
|
|
289 |
$result['duration'] = (int) $metadata['duration'];
|
290 |
}
|
291 |
|
292 |
-
/** This filter is documented in class.jetpack-sync.php */
|
293 |
return (object) apply_filters( 'get_attachment', $result );
|
294 |
}
|
295 |
|
289 |
$result['duration'] = (int) $metadata['duration'];
|
290 |
}
|
291 |
|
|
|
292 |
return (object) apply_filters( 'get_attachment', $result );
|
293 |
}
|
294 |
|
sal/class.json-api-site-base.php
CHANGED
@@ -395,7 +395,7 @@ abstract class SAL_Site {
|
|
395 |
}
|
396 |
|
397 |
function get_unmapped_url() {
|
398 |
-
return get_site_url(
|
399 |
}
|
400 |
|
401 |
function get_theme_slug() {
|
395 |
}
|
396 |
|
397 |
function get_unmapped_url() {
|
398 |
+
return get_site_url( get_current_blog_id() );
|
399 |
}
|
400 |
|
401 |
function get_theme_slug() {
|
sal/class.json-api-site-jetpack-base.php
CHANGED
@@ -10,12 +10,24 @@ abstract class Abstract_Jetpack_Site extends SAL_Site {
|
|
10 |
|
11 |
abstract protected function get_theme_support( $feature_name );
|
12 |
|
13 |
-
abstract protected function get_mock_option( $name );
|
14 |
-
|
15 |
abstract protected function get_jetpack_version();
|
16 |
|
17 |
abstract protected function get_updates();
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
function before_render() {
|
20 |
}
|
21 |
|
@@ -35,9 +47,10 @@ abstract class Abstract_Jetpack_Site extends SAL_Site {
|
|
35 |
}
|
36 |
|
37 |
function after_render_options( &$options ) {
|
|
|
38 |
$options['jetpack_version'] = $this->get_jetpack_version();
|
39 |
|
40 |
-
if ( $main_network_site = $this->
|
41 |
$options['main_network_site'] = (string) rtrim( $main_network_site, '/' );
|
42 |
}
|
43 |
|
@@ -45,22 +58,22 @@ abstract class Abstract_Jetpack_Site extends SAL_Site {
|
|
45 |
$options['active_modules'] = (array) array_values( $active_modules );
|
46 |
}
|
47 |
|
48 |
-
$options['software_version'] = (string) $this->
|
49 |
-
$options['max_upload_size'] = $this->
|
50 |
|
51 |
// Sites have to prove that they are not main_network site.
|
52 |
// If the sync happends right then we should be able to see that we are not dealing with a network site
|
53 |
-
$options['is_multi_network'] = (bool) $this->
|
54 |
-
$options['is_multi_site'] = (bool) $this->
|
55 |
|
56 |
$file_mod_disabled_reasons = array_keys( array_filter( array(
|
57 |
'automatic_updater_disabled' => (bool) $this->get_constant( 'AUTOMATIC_UPDATER_DISABLED' ),
|
58 |
// WP AUTO UPDATE CORE defaults to minor, '1' if true and '0' if set to false.
|
59 |
-
'wp_auto_update_core_disabled' => ! ( (bool)
|
60 |
-
'is_version_controlled' => (bool) $this->
|
61 |
// By default we assume that site does have system write access if the value is not set yet.
|
62 |
-
'has_no_file_system_write_access' => ! (bool)
|
63 |
-
'disallow_file_mods' => (bool)
|
64 |
) ) );
|
65 |
|
66 |
$options['file_mod_disabled'] = empty( $file_mod_disabled_reasons ) ? false : $file_mod_disabled_reasons;
|
@@ -79,11 +92,11 @@ abstract class Abstract_Jetpack_Site extends SAL_Site {
|
|
79 |
}
|
80 |
|
81 |
function is_multisite() {
|
82 |
-
return (bool)
|
83 |
}
|
84 |
|
85 |
function is_single_user_site() {
|
86 |
-
return (bool)
|
87 |
}
|
88 |
|
89 |
function featured_images_enabled() {
|
10 |
|
11 |
abstract protected function get_theme_support( $feature_name );
|
12 |
|
|
|
|
|
13 |
abstract protected function get_jetpack_version();
|
14 |
|
15 |
abstract protected function get_updates();
|
16 |
|
17 |
+
abstract protected function main_network_site();
|
18 |
+
|
19 |
+
abstract protected function wp_version();
|
20 |
+
|
21 |
+
abstract protected function max_upload_size();
|
22 |
+
|
23 |
+
abstract protected function is_main_network();
|
24 |
+
|
25 |
+
abstract protected function is_multi_site();
|
26 |
+
|
27 |
+
abstract protected function is_version_controlled();
|
28 |
+
|
29 |
+
abstract protected function file_system_write_access();
|
30 |
+
|
31 |
function before_render() {
|
32 |
}
|
33 |
|
47 |
}
|
48 |
|
49 |
function after_render_options( &$options ) {
|
50 |
+
|
51 |
$options['jetpack_version'] = $this->get_jetpack_version();
|
52 |
|
53 |
+
if ( $main_network_site = $this->main_network_site() ) {
|
54 |
$options['main_network_site'] = (string) rtrim( $main_network_site, '/' );
|
55 |
}
|
56 |
|
58 |
$options['active_modules'] = (array) array_values( $active_modules );
|
59 |
}
|
60 |
|
61 |
+
$options['software_version'] = (string) $this->wp_version();
|
62 |
+
$options['max_upload_size'] = $this->max_upload_size();
|
63 |
|
64 |
// Sites have to prove that they are not main_network site.
|
65 |
// If the sync happends right then we should be able to see that we are not dealing with a network site
|
66 |
+
$options['is_multi_network'] = (bool) $this->is_main_network();
|
67 |
+
$options['is_multi_site'] = (bool) $this->is_multi_site();
|
68 |
|
69 |
$file_mod_disabled_reasons = array_keys( array_filter( array(
|
70 |
'automatic_updater_disabled' => (bool) $this->get_constant( 'AUTOMATIC_UPDATER_DISABLED' ),
|
71 |
// WP AUTO UPDATE CORE defaults to minor, '1' if true and '0' if set to false.
|
72 |
+
'wp_auto_update_core_disabled' => ! ( (bool) $this->get_constant( 'WP_AUTO_UPDATE_CORE' ) ),
|
73 |
+
'is_version_controlled' => (bool) $this->is_version_controlled(),
|
74 |
// By default we assume that site does have system write access if the value is not set yet.
|
75 |
+
'has_no_file_system_write_access' => ! (bool) $this->file_system_write_access(),
|
76 |
+
'disallow_file_mods' => (bool) $this->get_constant( 'DISALLOW_FILE_MODS' ),
|
77 |
) ) );
|
78 |
|
79 |
$options['file_mod_disabled'] = empty( $file_mod_disabled_reasons ) ? false : $file_mod_disabled_reasons;
|
92 |
}
|
93 |
|
94 |
function is_multisite() {
|
95 |
+
return (bool) is_multisite();
|
96 |
}
|
97 |
|
98 |
function is_single_user_site() {
|
99 |
+
return (bool) Jetpack::is_single_user_site();
|
100 |
}
|
101 |
|
102 |
function featured_images_enabled() {
|
sal/class.json-api-site-jetpack.php
CHANGED
@@ -6,10 +6,6 @@ require_once dirname( __FILE__ ) . '/class.json-api-post-jetpack.php';
|
|
6 |
// this code runs on Jetpack (.org) sites
|
7 |
class Jetpack_Site extends Abstract_Jetpack_Site {
|
8 |
|
9 |
-
protected function get_mock_option( $name ) {
|
10 |
-
return get_option( 'jetpack_'.$name );
|
11 |
-
}
|
12 |
-
|
13 |
protected function get_constant( $name ) {
|
14 |
if ( defined( $name) ) {
|
15 |
return constant( $name );
|
@@ -17,6 +13,35 @@ class Jetpack_Site extends Abstract_Jetpack_Site {
|
|
17 |
return null;
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
protected function current_theme_supports( $feature_name ) {
|
21 |
return current_theme_supports( $feature_name );
|
22 |
}
|
6 |
// this code runs on Jetpack (.org) sites
|
7 |
class Jetpack_Site extends Abstract_Jetpack_Site {
|
8 |
|
|
|
|
|
|
|
|
|
9 |
protected function get_constant( $name ) {
|
10 |
if ( defined( $name) ) {
|
11 |
return constant( $name );
|
13 |
return null;
|
14 |
}
|
15 |
|
16 |
+
protected function main_network_site() {
|
17 |
+
return network_site_url();
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function wp_version() {
|
21 |
+
global $wp_version;
|
22 |
+
return $wp_version;
|
23 |
+
}
|
24 |
+
|
25 |
+
protected function max_upload_size() {
|
26 |
+
return wp_max_upload_size();
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function is_main_network() {
|
30 |
+
return Jetpack::is_multi_network();
|
31 |
+
}
|
32 |
+
|
33 |
+
protected function is_multi_site() {
|
34 |
+
return is_multisite();
|
35 |
+
}
|
36 |
+
|
37 |
+
protected function is_version_controlled() {
|
38 |
+
return Jetpack_Sync_Functions::is_version_controlled();
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function file_system_write_access() {
|
42 |
+
return Jetpack_Sync_Functions::file_system_write_access();
|
43 |
+
}
|
44 |
+
|
45 |
protected function current_theme_supports( $feature_name ) {
|
46 |
return current_theme_supports( $feature_name );
|
47 |
}
|
sync/class.jetpack-sync-actions.php
ADDED
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-settings.php';
|
3 |
+
|
4 |
+
/**
|
5 |
+
* The role of this class is to hook the Sync subsystem into WordPress - when to listen for actions,
|
6 |
+
* when to send, when to perform a full sync, etc.
|
7 |
+
*
|
8 |
+
* It also binds the action to send data to WPCOM to Jetpack's XMLRPC client object.
|
9 |
+
*/
|
10 |
+
class Jetpack_Sync_Actions {
|
11 |
+
static $sender = null;
|
12 |
+
static $listener = null;
|
13 |
+
|
14 |
+
static function init() {
|
15 |
+
|
16 |
+
// Add a custom "every minute" cron schedule
|
17 |
+
add_filter( 'cron_schedules', array( __CLASS__, 'minute_cron_schedule' ) );
|
18 |
+
|
19 |
+
// On jetpack authorization, schedule a full sync
|
20 |
+
add_action( 'jetpack_client_authorized', array( __CLASS__, 'schedule_full_sync' ) );
|
21 |
+
|
22 |
+
// When imports are finished, schedule a full sync
|
23 |
+
add_action( 'import_end', array( __CLASS__, 'schedule_full_sync' ) );
|
24 |
+
|
25 |
+
// When importing via cron, do not sync
|
26 |
+
add_action( 'wp_cron_importer_hook', array( __CLASS__, 'set_is_importing_true' ), 1 );
|
27 |
+
|
28 |
+
// Sync connected user role changes to .com
|
29 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-users.php';
|
30 |
+
|
31 |
+
// everything below this point should only happen if we're a valid sync site
|
32 |
+
if ( ! self::sync_allowed() ) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
// cron hooks
|
37 |
+
add_action( 'jetpack_sync_send_db_checksum', array( __CLASS__, 'send_db_checksum' ) );
|
38 |
+
add_action( 'jetpack_sync_full', array( __CLASS__, 'do_full_sync' ), 10, 1 );
|
39 |
+
add_action( 'jetpack_sync_cron', array( __CLASS__, 'do_cron_sync' ) );
|
40 |
+
|
41 |
+
if ( ! wp_next_scheduled( 'jetpack_sync_send_db_checksum' ) ) {
|
42 |
+
// Schedule a job to send DB checksums once an hour
|
43 |
+
wp_schedule_event( time(), 'hourly', 'jetpack_sync_send_db_checksum' );
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( ! wp_next_scheduled( 'jetpack_sync_cron' ) ) {
|
47 |
+
// Schedule a job to send pending queue items once a minute
|
48 |
+
wp_schedule_event( time(), '1min', 'jetpack_sync_cron' );
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Fires on every request before default loading sync listener code.
|
53 |
+
* Return false to not load sync listener code that monitors common
|
54 |
+
* WP actions to be serialized.
|
55 |
+
*
|
56 |
+
* By default this returns true for non-GET-requests, or requests where the
|
57 |
+
* user is logged-in.
|
58 |
+
*
|
59 |
+
* @since 4.2.0
|
60 |
+
*
|
61 |
+
* @param bool should we load sync listener code for this request
|
62 |
+
*/
|
63 |
+
if ( apply_filters( 'jetpack_sync_listener_should_load',
|
64 |
+
(
|
65 |
+
'GET' !== $_SERVER['REQUEST_METHOD']
|
66 |
+
||
|
67 |
+
is_user_logged_in()
|
68 |
+
||
|
69 |
+
defined( 'PHPUNIT_JETPACK_TESTSUITE' )
|
70 |
+
)
|
71 |
+
) ) {
|
72 |
+
self::initialize_listener();
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Fires on every request before default loading sync sender code.
|
77 |
+
* Return false to not load sync sender code that serializes pending
|
78 |
+
* data and sends it to WPCOM for processing.
|
79 |
+
*
|
80 |
+
* By default this returns true for POST requests, admin requests, or requests
|
81 |
+
* by users who can manage_options.
|
82 |
+
*
|
83 |
+
* @since 4.2.0
|
84 |
+
*
|
85 |
+
* @param bool should we load sync sender code for this request
|
86 |
+
*/
|
87 |
+
if ( apply_filters( 'jetpack_sync_sender_should_load',
|
88 |
+
(
|
89 |
+
'POST' === $_SERVER['REQUEST_METHOD']
|
90 |
+
||
|
91 |
+
current_user_can( 'manage_options' )
|
92 |
+
||
|
93 |
+
is_admin()
|
94 |
+
||
|
95 |
+
defined( 'PHPUNIT_JETPACK_TESTSUITE' )
|
96 |
+
)
|
97 |
+
) ) {
|
98 |
+
self::initialize_sender();
|
99 |
+
add_action( 'shutdown', array( self::$sender, 'do_sync' ) );
|
100 |
+
}
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
static function sync_allowed() {
|
105 |
+
return ( Jetpack::is_active() && ! ( Jetpack::is_development_mode() || Jetpack::is_staging_site() ) )
|
106 |
+
|| defined( 'PHPUNIT_JETPACK_TESTSUITE' );
|
107 |
+
}
|
108 |
+
|
109 |
+
static function set_is_importing_true() {
|
110 |
+
Jetpack_Sync_Settings::set_importing( true );
|
111 |
+
}
|
112 |
+
|
113 |
+
static function send_data( $data, $codec_name, $sent_timestamp, $queue_id ) {
|
114 |
+
Jetpack::load_xml_rpc_client();
|
115 |
+
|
116 |
+
$url = add_query_arg( array(
|
117 |
+
'sync' => '1', // add an extra parameter to the URL so we can tell it's a sync action
|
118 |
+
'codec' => $codec_name, // send the name of the codec used to encode the data
|
119 |
+
'timestamp' => $sent_timestamp, // send current server time so we can compensate for clock differences
|
120 |
+
'queue' => $queue_id, // sync or full_sync
|
121 |
+
), Jetpack::xmlrpc_api_url() );
|
122 |
+
|
123 |
+
$rpc = new Jetpack_IXR_Client( array(
|
124 |
+
'url' => $url,
|
125 |
+
'user_id' => JETPACK_MASTER_USER,
|
126 |
+
'timeout' => 30,
|
127 |
+
) );
|
128 |
+
|
129 |
+
$result = $rpc->query( 'jetpack.syncActions', $data );
|
130 |
+
|
131 |
+
if ( ! $result ) {
|
132 |
+
return $rpc->get_jetpack_error();
|
133 |
+
}
|
134 |
+
|
135 |
+
return $rpc->getResponse();
|
136 |
+
}
|
137 |
+
|
138 |
+
static function schedule_initial_sync() {
|
139 |
+
// we need this function call here because we have to run this function
|
140 |
+
// reeeeally early in init, before WP_CRON_LOCK_TIMEOUT is defined.
|
141 |
+
wp_functionality_constants();
|
142 |
+
self::schedule_full_sync( array( 'options' => true, 'network_options' => true, 'functions' => true, 'constants' => true, 'users' => true ) );
|
143 |
+
}
|
144 |
+
|
145 |
+
static function schedule_full_sync( $modules = null ) {
|
146 |
+
if ( $modules ) {
|
147 |
+
wp_schedule_single_event( time() + 1, 'jetpack_sync_full', array( $modules ) );
|
148 |
+
} else {
|
149 |
+
wp_schedule_single_event( time() + 1, 'jetpack_sync_full' );
|
150 |
+
}
|
151 |
+
|
152 |
+
spawn_cron();
|
153 |
+
}
|
154 |
+
|
155 |
+
static function is_scheduled_full_sync( $modules = null ) {
|
156 |
+
if ( is_null( $modules ) ) {
|
157 |
+
$crons = _get_cron_array();
|
158 |
+
|
159 |
+
foreach ( $crons as $timestamp => $cron ) {
|
160 |
+
if ( ! empty( $cron['jetpack_sync_full'] ) ) {
|
161 |
+
return true;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
return false;
|
166 |
+
}
|
167 |
+
|
168 |
+
return wp_next_scheduled( 'jetpack_sync_full', array( $modules ) );
|
169 |
+
}
|
170 |
+
|
171 |
+
static function do_full_sync( $modules = null ) {
|
172 |
+
if ( ! self::sync_allowed() ) {
|
173 |
+
return;
|
174 |
+
}
|
175 |
+
|
176 |
+
self::initialize_listener();
|
177 |
+
Jetpack_Sync_Modules::get_module( 'full-sync' )->start( $modules );
|
178 |
+
self::do_cron_sync(); // immediately run a cron sync, which sends pending data
|
179 |
+
}
|
180 |
+
|
181 |
+
static function minute_cron_schedule( $schedules ) {
|
182 |
+
if( ! isset( $schedules["1min"] ) ) {
|
183 |
+
$schedules["1min"] = array(
|
184 |
+
'interval' => 60,
|
185 |
+
'display' => __( 'Every minute' )
|
186 |
+
);
|
187 |
+
}
|
188 |
+
return $schedules;
|
189 |
+
}
|
190 |
+
|
191 |
+
// try to send actions until we run out of things to send,
|
192 |
+
// or have to wait more than 15s before sending again,
|
193 |
+
// or we hit a lock or some other sending issue
|
194 |
+
static function do_cron_sync() {
|
195 |
+
if ( ! self::sync_allowed() ) {
|
196 |
+
return;
|
197 |
+
}
|
198 |
+
|
199 |
+
self::initialize_sender();
|
200 |
+
|
201 |
+
// remove shutdown hook - no need to sync twice
|
202 |
+
if ( has_action( 'shutdown', array( self::$sender, 'do_sync' ) ) ) {
|
203 |
+
remove_action( 'shutdown', array( self::$sender, 'do_sync' ) );
|
204 |
+
}
|
205 |
+
|
206 |
+
do {
|
207 |
+
$next_sync_time = self::$sender->get_next_sync_time();
|
208 |
+
|
209 |
+
if ( $next_sync_time ) {
|
210 |
+
$delay = $next_sync_time - time() + 1;
|
211 |
+
if ( $delay > 15 ) {
|
212 |
+
break;
|
213 |
+
} elseif ( $delay > 0 ) {
|
214 |
+
sleep( $delay );
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
$result = self::$sender->do_sync();
|
219 |
+
} while ( $result );
|
220 |
+
}
|
221 |
+
|
222 |
+
static function send_db_checksum() {
|
223 |
+
self::initialize_listener();
|
224 |
+
self::initialize_sender();
|
225 |
+
self::$sender->send_checksum();
|
226 |
+
self::$sender->do_sync();
|
227 |
+
}
|
228 |
+
|
229 |
+
static function initialize_listener() {
|
230 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-listener.php';
|
231 |
+
self::$listener = Jetpack_Sync_Listener::get_instance();
|
232 |
+
}
|
233 |
+
|
234 |
+
static function initialize_sender() {
|
235 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-sender.php';
|
236 |
+
self::$sender = Jetpack_Sync_Sender::get_instance();
|
237 |
+
|
238 |
+
// bind the sending process
|
239 |
+
add_filter( 'jetpack_sync_send_data', array( __CLASS__, 'send_data' ), 10, 4 );
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
// Allow other plugins to add filters before we initialize the actions.
|
244 |
+
// Load the listeners if before modules get loaded so that we can capture version changes etc.
|
245 |
+
add_action( 'init', array( 'Jetpack_Sync_Actions', 'init' ), 90 );
|
246 |
+
|
247 |
+
// We need to define this here so that it's hooked before `updating_jetpack_version` is called
|
248 |
+
add_action( 'updating_jetpack_version', array( 'Jetpack_Sync_Actions', 'schedule_initial_sync' ), 10 );
|
sync/class.jetpack-sync-defaults.php
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once( JETPACK__PLUGIN_DIR . 'modules/sso/class.jetpack-sso-helpers.php' );
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Just some defaults that we share with the server
|
6 |
+
*/
|
7 |
+
class Jetpack_Sync_Defaults {
|
8 |
+
static $default_options_whitelist = array(
|
9 |
+
'stylesheet',
|
10 |
+
'blogname',
|
11 |
+
'home',
|
12 |
+
'siteurl',
|
13 |
+
'blogdescription',
|
14 |
+
'blog_charset',
|
15 |
+
'permalink_structure',
|
16 |
+
'category_base',
|
17 |
+
'tag_base',
|
18 |
+
'comment_moderation',
|
19 |
+
'default_comment_status',
|
20 |
+
'jetpack_site_icon_url',
|
21 |
+
'page_on_front',
|
22 |
+
'rss_use_excerpt',
|
23 |
+
'subscription_options',
|
24 |
+
'stb_enabled',
|
25 |
+
'stc_enabled',
|
26 |
+
'comment_registration',
|
27 |
+
'show_avatars',
|
28 |
+
'avatar_default',
|
29 |
+
'avatar_rating',
|
30 |
+
'highlander_comment_form_prompt',
|
31 |
+
'jetpack_comment_form_color_scheme',
|
32 |
+
'stats_options',
|
33 |
+
'gmt_offset',
|
34 |
+
'timezone_string',
|
35 |
+
'jetpack_sync_non_public_post_stati',
|
36 |
+
'jetpack_options',
|
37 |
+
'site_icon', // (int) - ID of core's Site Icon attachment ID
|
38 |
+
'default_post_format',
|
39 |
+
'default_category',
|
40 |
+
'large_size_w',
|
41 |
+
'large_size_h',
|
42 |
+
'thumbnail_size_w',
|
43 |
+
'thumbnail_size_h',
|
44 |
+
'medium_size_w',
|
45 |
+
'medium_size_h',
|
46 |
+
'thumbnail_crop',
|
47 |
+
'image_default_link_type',
|
48 |
+
'site_logo',
|
49 |
+
'sharing-options',
|
50 |
+
'sharing-services',
|
51 |
+
'post_count',
|
52 |
+
'default_ping_status',
|
53 |
+
'sticky_posts',
|
54 |
+
'blog_public',
|
55 |
+
'default_pingback_flag',
|
56 |
+
'require_name_email',
|
57 |
+
'close_comments_for_old_posts',
|
58 |
+
'close_comments_days_old',
|
59 |
+
'thread_comments',
|
60 |
+
'thread_comments_depth',
|
61 |
+
'page_comments',
|
62 |
+
'comments_per_page',
|
63 |
+
'default_comments_page',
|
64 |
+
'comment_order',
|
65 |
+
'comments_notify',
|
66 |
+
'moderation_notify',
|
67 |
+
'social_notifications_like',
|
68 |
+
'social_notifications_reblog',
|
69 |
+
'social_notifications_subscribe',
|
70 |
+
'comment_whitelist',
|
71 |
+
'comment_max_links',
|
72 |
+
'moderation_keys',
|
73 |
+
'blacklist_keys',
|
74 |
+
'lang_id',
|
75 |
+
'wga',
|
76 |
+
'disabled_likes',
|
77 |
+
'disabled_reblogs',
|
78 |
+
'jetpack_comment_likes_enabled',
|
79 |
+
'twitter_via',
|
80 |
+
'jetpack-twitter-cards-site-tag',
|
81 |
+
'wpcom_publish_posts_with_markdown',
|
82 |
+
'wpcom_publish_comments_with_markdown',
|
83 |
+
'jetpack_activated',
|
84 |
+
'jetpack_available_modules',
|
85 |
+
'jetpack_autoupdate_plugins',
|
86 |
+
'jetpack_autoupdate_themes',
|
87 |
+
'jetpack_autoupdate_core',
|
88 |
+
'carousel_background_color',
|
89 |
+
'carousel_display_exif',
|
90 |
+
'jetpack_portfolio',
|
91 |
+
'jetpack_portfolio_posts_per_page',
|
92 |
+
'jetpack_testimonial',
|
93 |
+
'jetpack_testimonial_posts_per_page',
|
94 |
+
'tiled_galleries',
|
95 |
+
'gravatar_disable_hovercards',
|
96 |
+
'infinite_scroll',
|
97 |
+
'infinite_scroll_google_analytics',
|
98 |
+
'wp_mobile_excerpt',
|
99 |
+
'wp_mobile_featured_images',
|
100 |
+
'wp_mobile_app_promos',
|
101 |
+
'monitor_receive_notifications',
|
102 |
+
'post_by_email_address',
|
103 |
+
'jetpack_protect_key',
|
104 |
+
'jetpack_protect_global_whitelist',
|
105 |
+
'sharing_services',
|
106 |
+
'jetpack_sso_require_two_step',
|
107 |
+
'jetpack_relatedposts',
|
108 |
+
'verification_services_codes',
|
109 |
+
'users_can_register',
|
110 |
+
'active_plugins',
|
111 |
+
'uninstall_plugins',
|
112 |
+
);
|
113 |
+
|
114 |
+
static $default_constants_whitelist = array(
|
115 |
+
'EMPTY_TRASH_DAYS',
|
116 |
+
'WP_POST_REVISIONS',
|
117 |
+
'AUTOMATIC_UPDATER_DISABLED',
|
118 |
+
'ABSPATH',
|
119 |
+
'WP_CONTENT_DIR',
|
120 |
+
'FS_METHOD',
|
121 |
+
'DISALLOW_FILE_EDIT',
|
122 |
+
'DISALLOW_FILE_MODS',
|
123 |
+
'WP_AUTO_UPDATE_CORE',
|
124 |
+
'WP_HTTP_BLOCK_EXTERNAL',
|
125 |
+
'WP_ACCESSIBLE_HOSTS',
|
126 |
+
'JETPACK__VERSION',
|
127 |
+
'IS_PRESSABLE',
|
128 |
+
);
|
129 |
+
|
130 |
+
static $default_callable_whitelist = array(
|
131 |
+
'wp_max_upload_size' => 'wp_max_upload_size',
|
132 |
+
'is_main_network' => array( 'Jetpack', 'is_multi_network' ),
|
133 |
+
'is_multi_site' => 'is_multisite',
|
134 |
+
'main_network_site' => array( 'Jetpack_Sync_Functions', 'main_network_site_url' ),
|
135 |
+
'site_url' => array( 'Jetpack_Sync_Functions', 'site_url' ),
|
136 |
+
'home_url' => array( 'Jetpack_Sync_Functions', 'home_url' ),
|
137 |
+
'single_user_site' => array( 'Jetpack', 'is_single_user_site' ),
|
138 |
+
'updates' => array( 'Jetpack', 'get_updates' ),
|
139 |
+
'has_file_system_write_access' => array( 'Jetpack_Sync_Functions', 'file_system_write_access' ),
|
140 |
+
'is_version_controlled' => array( 'Jetpack_Sync_Functions', 'is_version_controlled' ),
|
141 |
+
'taxonomies' => array( 'Jetpack_Sync_Functions', 'get_taxonomies' ),
|
142 |
+
'post_types' => array( 'Jetpack_Sync_Functions', 'get_post_types' ),
|
143 |
+
'post_type_features' => array( 'Jetpack_Sync_Functions', 'get_post_type_features' ),
|
144 |
+
'rest_api_allowed_post_types' => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_post_types' ),
|
145 |
+
'rest_api_allowed_public_metadata' => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_public_metadata' ),
|
146 |
+
'sso_is_two_step_required' => array( 'Jetpack_SSO_Helpers', 'is_two_step_required' ),
|
147 |
+
'sso_should_hide_login_form' => array( 'Jetpack_SSO_Helpers', 'should_hide_login_form' ),
|
148 |
+
'sso_match_by_email' => array( 'Jetpack_SSO_Helpers', 'match_by_email' ),
|
149 |
+
'sso_new_user_override' => array( 'Jetpack_SSO_Helpers', 'new_user_override' ),
|
150 |
+
'sso_bypass_default_login_form' => array( 'Jetpack_SSO_Helpers', 'bypass_login_forward_wpcom' ),
|
151 |
+
'wp_version' => array( 'Jetpack_Sync_Functions', 'wp_version' ),
|
152 |
+
'get_plugins' => array( 'Jetpack_Sync_Functions', 'get_plugins' ),
|
153 |
+
'active_modules' => array( 'Jetpack', 'get_active_modules' ),
|
154 |
+
);
|
155 |
+
|
156 |
+
static $blacklisted_post_types = array(
|
157 |
+
'ai1ec_event',
|
158 |
+
'snitch',
|
159 |
+
);
|
160 |
+
|
161 |
+
static $default_post_checksum_columns = array(
|
162 |
+
'ID',
|
163 |
+
'post_modified',
|
164 |
+
);
|
165 |
+
|
166 |
+
static $default_comment_checksum_columns = array(
|
167 |
+
'comment_ID',
|
168 |
+
'comment_content',
|
169 |
+
);
|
170 |
+
|
171 |
+
static $default_option_checksum_columns = array(
|
172 |
+
'option_name',
|
173 |
+
'option_value',
|
174 |
+
);
|
175 |
+
|
176 |
+
// returns escapted SQL that can be injected into a WHERE clause
|
177 |
+
static function get_blacklisted_post_types_sql() {
|
178 |
+
return 'post_type NOT IN (\'' . join( '\', \'', array_map( 'esc_sql', self::$blacklisted_post_types ) ) . '\')';
|
179 |
+
}
|
180 |
+
|
181 |
+
static $default_multisite_callable_whitelist = array(
|
182 |
+
'network_name' => array( 'Jetpack', 'network_name' ),
|
183 |
+
'network_allow_new_registrations' => array( 'Jetpack', 'network_allow_new_registrations' ),
|
184 |
+
'network_add_new_users' => array( 'Jetpack', 'network_add_new_users' ),
|
185 |
+
'network_site_upload_space' => array( 'Jetpack', 'network_site_upload_space' ),
|
186 |
+
'network_upload_file_types' => array( 'Jetpack', 'network_upload_file_types' ),
|
187 |
+
'network_enable_administration_menus' => array( 'Jetpack', 'network_enable_administration_menus' ),
|
188 |
+
);
|
189 |
+
|
190 |
+
|
191 |
+
static $default_whitelist_meta_keys = array(
|
192 |
+
'_wp_attachment_metadata',
|
193 |
+
'_thumbnail_id',
|
194 |
+
'_wpas_mess',
|
195 |
+
'_wpas_skip_',
|
196 |
+
'_g_feedback_shortcode',
|
197 |
+
'_feedback_extra_fields',
|
198 |
+
'_feedback_akismet_values',
|
199 |
+
'_publicize_facebook_user',
|
200 |
+
'_wp_attachment_image_alt',
|
201 |
+
'_jetpack_post_thumbnail',
|
202 |
+
'_thumbnail_id',
|
203 |
+
'_wp_attachment_metadata',
|
204 |
+
'_wp_page_template',
|
205 |
+
'_publicize_twitter_user',
|
206 |
+
);
|
207 |
+
|
208 |
+
// TODO: move this to server? - these are theme support values
|
209 |
+
// that should be synced as jetpack_current_theme_supports_foo option values
|
210 |
+
static $default_theme_support_whitelist = array(
|
211 |
+
'post-thumbnails',
|
212 |
+
'post-formats',
|
213 |
+
'custom-header',
|
214 |
+
'custom-background',
|
215 |
+
'custom-logo',
|
216 |
+
'menus',
|
217 |
+
'automatic-feed-links',
|
218 |
+
'editor-style',
|
219 |
+
'widgets',
|
220 |
+
'html5',
|
221 |
+
'title-tag',
|
222 |
+
'jetpack-social-menu',
|
223 |
+
'jetpack-responsive-videos',
|
224 |
+
'infinite-scroll',
|
225 |
+
'site-logo',
|
226 |
+
);
|
227 |
+
|
228 |
+
static function is_whitelisted_option( $option ) {
|
229 |
+
foreach ( self::$default_options_whitelist as $whitelisted_option ) {
|
230 |
+
if ( $whitelisted_option[0] === '/' && preg_match( $whitelisted_option, $option ) ) {
|
231 |
+
return true;
|
232 |
+
} elseif ( $whitelisted_option === $option ) {
|
233 |
+
return true;
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
return false;
|
238 |
+
}
|
239 |
+
|
240 |
+
static $default_network_options_whitelist = array(
|
241 |
+
'site_name',
|
242 |
+
'jetpack_protect_key',
|
243 |
+
'jetpack_protect_global_whitelist',
|
244 |
+
'active_sitewide_plugins',
|
245 |
+
);
|
246 |
+
static $default_taxonomy_whitelist = array();
|
247 |
+
static $default_dequeue_max_bytes = 500000; // very conservative value, 1/2 MB
|
248 |
+
static $default_upload_max_bytes = 600000; // a little bigger than the upload limit to account for serialization
|
249 |
+
static $default_upload_max_rows = 500;
|
250 |
+
static $default_sync_wait_time = 10; // seconds, between syncs
|
251 |
+
static $default_sync_wait_threshold = 5; // only wait before next send if the current send took more than X seconds
|
252 |
+
static $default_max_queue_size = 1000;
|
253 |
+
static $default_max_queue_lag = 900; // 15 minutes
|
254 |
+
static $default_sync_callables_wait_time = MINUTE_IN_SECONDS; // seconds before sending callables again
|
255 |
+
static $default_sync_constants_wait_time = HOUR_IN_SECONDS; // seconds before sending constants again
|
256 |
+
}
|
sync/class.jetpack-sync-functions.php
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Utility functions to generate data synced to wpcom
|
5 |
+
*/
|
6 |
+
|
7 |
+
class Jetpack_Sync_Functions {
|
8 |
+
|
9 |
+
public static function get_modules() {
|
10 |
+
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' );
|
11 |
+
|
12 |
+
return Jetpack_Admin::init()->get_modules();
|
13 |
+
}
|
14 |
+
|
15 |
+
public static function get_taxonomies() {
|
16 |
+
global $wp_taxonomies;
|
17 |
+
|
18 |
+
return $wp_taxonomies;
|
19 |
+
}
|
20 |
+
|
21 |
+
public static function get_post_types() {
|
22 |
+
global $wp_post_types;
|
23 |
+
|
24 |
+
return $wp_post_types;
|
25 |
+
}
|
26 |
+
|
27 |
+
public static function get_post_type_features() {
|
28 |
+
global $_wp_post_type_features;
|
29 |
+
|
30 |
+
return $_wp_post_type_features;
|
31 |
+
}
|
32 |
+
|
33 |
+
public static function rest_api_allowed_post_types() {
|
34 |
+
/** This filter is already documented in class.json-api-endpoints.php */
|
35 |
+
return apply_filters( 'rest_api_allowed_post_types', array( 'post', 'page', 'revision' ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
public static function rest_api_allowed_public_metadata() {
|
39 |
+
/** This filter is documented in json-endpoints/class.wpcom-json-api-post-endpoint.php */
|
40 |
+
return apply_filters( 'rest_api_allowed_public_metadata', array() );
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Finds out if a site is using a version control system.
|
45 |
+
* @return bool
|
46 |
+
**/
|
47 |
+
public static function is_version_controlled() {
|
48 |
+
|
49 |
+
if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
|
50 |
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
51 |
+
}
|
52 |
+
$updater = new WP_Automatic_Updater();
|
53 |
+
|
54 |
+
return (bool) strval( $updater->is_vcs_checkout( $context = ABSPATH ) );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns true if the site has file write access false otherwise.
|
59 |
+
* @return bool
|
60 |
+
**/
|
61 |
+
public static function file_system_write_access() {
|
62 |
+
if ( ! function_exists( 'get_filesystem_method' ) ) {
|
63 |
+
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
64 |
+
}
|
65 |
+
|
66 |
+
require_once( ABSPATH . 'wp-admin/includes/template.php' );
|
67 |
+
|
68 |
+
$filesystem_method = get_filesystem_method();
|
69 |
+
if ( 'direct' === $filesystem_method ) {
|
70 |
+
return true;
|
71 |
+
}
|
72 |
+
|
73 |
+
ob_start();
|
74 |
+
$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
|
75 |
+
ob_end_clean();
|
76 |
+
if ( $filesystem_credentials_are_stored ) {
|
77 |
+
return true;
|
78 |
+
}
|
79 |
+
|
80 |
+
return false;
|
81 |
+
}
|
82 |
+
|
83 |
+
public static function home_url() {
|
84 |
+
return self::preserve_scheme( 'home', 'home_url', true );
|
85 |
+
}
|
86 |
+
|
87 |
+
public static function site_url() {
|
88 |
+
return self::preserve_scheme( 'siteurl', 'site_url', true );
|
89 |
+
}
|
90 |
+
|
91 |
+
public static function main_network_site_url() {
|
92 |
+
return self::preserve_scheme( 'siteurl', 'network_site_url', false );
|
93 |
+
}
|
94 |
+
|
95 |
+
public static function preserve_scheme( $option, $url_function, $normalize_www = false ) {
|
96 |
+
$previous_https_value = isset( $_SERVER['HTTPS'] ) ? $_SERVER['HTTPS'] : null;
|
97 |
+
$_SERVER['HTTPS'] = 'off';
|
98 |
+
$url = call_user_func( $url_function );
|
99 |
+
$option_url = get_option( $option );
|
100 |
+
if ( $previous_https_value ) {
|
101 |
+
$_SERVER['HTTPS'] = $previous_https_value;
|
102 |
+
} else {
|
103 |
+
unset( $_SERVER['HTTPS'] );
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( $option_url === $url ) {
|
107 |
+
return $url;
|
108 |
+
}
|
109 |
+
|
110 |
+
// turn them both into parsed format
|
111 |
+
$option_url = parse_url( $option_url );
|
112 |
+
$url = parse_url( $url );
|
113 |
+
|
114 |
+
if ( $normalize_www ) {
|
115 |
+
if ( $url['host'] === "www.{$option_url[ 'host' ]}" ) {
|
116 |
+
// remove www if not present in option URL
|
117 |
+
$url['host'] = $option_url['host'];
|
118 |
+
}
|
119 |
+
if ( $option_url['host'] === "www.{$url[ 'host' ]}" ) {
|
120 |
+
// add www if present in option URL
|
121 |
+
$url['host'] = $option_url['host'];
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( $url['host'] === $option_url['host'] ) {
|
126 |
+
$url['scheme'] = $option_url['scheme'];
|
127 |
+
// return set_url_scheme( $current_url, $option_url['scheme'] );
|
128 |
+
}
|
129 |
+
|
130 |
+
$normalized_url = "{$url['scheme']}://{$url['host']}";
|
131 |
+
|
132 |
+
if ( isset( $url['path'] ) ) {
|
133 |
+
$normalized_url .= "{$url['path']}";
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( isset( $url['query'] ) ) {
|
137 |
+
$normalized_url .= "?{$url['query']}";
|
138 |
+
}
|
139 |
+
|
140 |
+
return $normalized_url;
|
141 |
+
}
|
142 |
+
|
143 |
+
public static function get_plugins() {
|
144 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
145 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
146 |
+
}
|
147 |
+
|
148 |
+
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
|
149 |
+
return apply_filters( 'all_plugins', get_plugins() );
|
150 |
+
}
|
151 |
+
|
152 |
+
public static function wp_version() {
|
153 |
+
global $wp_version;
|
154 |
+
|
155 |
+
return $wp_version;
|
156 |
+
}
|
157 |
+
}
|
sync/class.jetpack-sync-json-deflate-codec.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/interface.jetpack-sync-codec.php';
|
4 |
+
|
5 |
+
/**
|
6 |
+
* An implementation of iJetpack_Sync_Codec that uses gzip's DEFLATE
|
7 |
+
* algorithm to compress objects serialized using json_encode
|
8 |
+
*/
|
9 |
+
class Jetpack_Sync_JSON_Deflate_Codec implements iJetpack_Sync_Codec {
|
10 |
+
const CODEC_NAME = 'deflate-json';
|
11 |
+
|
12 |
+
public function name() {
|
13 |
+
return self::CODEC_NAME;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function encode( $object ) {
|
17 |
+
return base64_encode( gzdeflate( $this->json_serialize( unserialize( serialize( $object ) ) ) ) );
|
18 |
+
}
|
19 |
+
|
20 |
+
public function decode( $input ) {
|
21 |
+
return $this->json_unserialize( gzinflate( base64_decode( $input ) ) );
|
22 |
+
}
|
23 |
+
|
24 |
+
// @see https://gist.github.com/muhqu/820694
|
25 |
+
private function json_serialize( $any ) {
|
26 |
+
return json_encode( $this->json_wrap( $any ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
private function json_unserialize( $str ) {
|
30 |
+
return $this->json_unwrap( json_decode( $str ) );
|
31 |
+
}
|
32 |
+
|
33 |
+
private function json_wrap( $any, $skip_assoc = false ) {
|
34 |
+
if ( ! $skip_assoc && is_array( $any ) && is_string( key( $any ) ) ) {
|
35 |
+
return (object) array( '_PHP_ASSOC' => $this->json_wrap( $any, true ) );
|
36 |
+
}
|
37 |
+
if ( is_array( $any ) || is_object( $any ) ) {
|
38 |
+
foreach ( $any as &$v ) {
|
39 |
+
$v = $this->json_wrap( $v );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
return $any;
|
44 |
+
}
|
45 |
+
|
46 |
+
private function json_unwrap( $any, $skip_assoc = false ) {
|
47 |
+
if ( ! $skip_assoc && is_object( $any ) && isset( $any->_PHP_ASSOC ) && count( (array) $any ) == 1 ) {
|
48 |
+
return (array) $this->json_unwrap( $any->_PHP_ASSOC );
|
49 |
+
}
|
50 |
+
if ( is_array( $any ) || is_object( $any ) ) {
|
51 |
+
foreach ( $any as &$v ) {
|
52 |
+
$v = $this->json_unwrap( $v );
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
return $any;
|
57 |
+
}
|
58 |
+
}
|
sync/class.jetpack-sync-listener.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-settings.php';
|
4 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-queue.php';
|
5 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-modules.php';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* This class monitors actions and logs them to the queue to be sent
|
9 |
+
*/
|
10 |
+
class Jetpack_Sync_Listener {
|
11 |
+
const QUEUE_STATE_CHECK_TRANSIENT = 'jetpack_sync_last_checked_queue_state';
|
12 |
+
const QUEUE_STATE_CHECK_TIMEOUT = 300; // 5 minutes
|
13 |
+
|
14 |
+
private $sync_queue;
|
15 |
+
private $full_sync_queue;
|
16 |
+
private $sync_queue_size_limit;
|
17 |
+
private $sync_queue_lag_limit;
|
18 |
+
|
19 |
+
// singleton functions
|
20 |
+
private static $instance;
|
21 |
+
|
22 |
+
public static function get_instance() {
|
23 |
+
if ( null === self::$instance ) {
|
24 |
+
self::$instance = new self();
|
25 |
+
}
|
26 |
+
|
27 |
+
return self::$instance;
|
28 |
+
}
|
29 |
+
|
30 |
+
// this is necessary because you can't use "new" when you declare instance properties >:(
|
31 |
+
protected function __construct() {
|
32 |
+
$this->set_defaults();
|
33 |
+
$this->init();
|
34 |
+
}
|
35 |
+
|
36 |
+
private function init() {
|
37 |
+
|
38 |
+
$handler = array( $this, 'action_handler' );
|
39 |
+
$full_sync_handler = array( $this, 'full_sync_action_handler' );
|
40 |
+
|
41 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
42 |
+
$module->init_listeners( $handler );
|
43 |
+
$module->init_full_sync_listeners( $full_sync_handler );
|
44 |
+
}
|
45 |
+
|
46 |
+
// Module Activation
|
47 |
+
add_action( 'jetpack_activate_module', $handler );
|
48 |
+
add_action( 'jetpack_deactivate_module', $handler );
|
49 |
+
|
50 |
+
// Send periodic checksum
|
51 |
+
add_action( 'jetpack_sync_checksum', $handler );
|
52 |
+
}
|
53 |
+
|
54 |
+
function get_sync_queue() {
|
55 |
+
return $this->sync_queue;
|
56 |
+
}
|
57 |
+
|
58 |
+
function get_full_sync_queue() {
|
59 |
+
return $this->full_sync_queue;
|
60 |
+
}
|
61 |
+
|
62 |
+
function set_queue_size_limit( $limit ) {
|
63 |
+
$this->sync_queue_size_limit = $limit;
|
64 |
+
}
|
65 |
+
|
66 |
+
function get_queue_size_limit() {
|
67 |
+
return $this->sync_queue_size_limit;
|
68 |
+
}
|
69 |
+
|
70 |
+
function set_queue_lag_limit( $age ) {
|
71 |
+
$this->sync_queue_lag_limit = $age;
|
72 |
+
}
|
73 |
+
|
74 |
+
function get_queue_lag_limit() {
|
75 |
+
return $this->sync_queue_lag_limit;
|
76 |
+
}
|
77 |
+
|
78 |
+
function force_recheck_queue_limit() {
|
79 |
+
delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->sync_queue->id );
|
80 |
+
delete_transient( self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $this->full_sync_queue->id );
|
81 |
+
}
|
82 |
+
|
83 |
+
// prevent adding items to the queue if it hasn't sent an item for 15 mins
|
84 |
+
// AND the queue is over 1000 items long (by default)
|
85 |
+
function can_add_to_queue( $queue ) {
|
86 |
+
$state_transient_name = self::QUEUE_STATE_CHECK_TRANSIENT . '_' . $queue->id;
|
87 |
+
|
88 |
+
$queue_state = get_transient( $state_transient_name );
|
89 |
+
|
90 |
+
if ( false === $queue_state ) {
|
91 |
+
$queue_state = array( $queue->size(), $queue->lag() );
|
92 |
+
set_transient( $state_transient_name, $queue_state, self::QUEUE_STATE_CHECK_TIMEOUT );
|
93 |
+
}
|
94 |
+
|
95 |
+
list( $queue_size, $queue_age ) = $queue_state;
|
96 |
+
|
97 |
+
return ( $queue_age < $this->sync_queue_lag_limit )
|
98 |
+
||
|
99 |
+
( ( $queue_size + 1 ) < $this->sync_queue_size_limit );
|
100 |
+
}
|
101 |
+
|
102 |
+
function full_sync_action_handler() {
|
103 |
+
$args = func_get_args();
|
104 |
+
$this->enqueue_action( current_filter(), $args, $this->full_sync_queue );
|
105 |
+
}
|
106 |
+
|
107 |
+
function action_handler() {
|
108 |
+
$args = func_get_args();
|
109 |
+
$this->enqueue_action( current_filter(), $args, $this->sync_queue );
|
110 |
+
}
|
111 |
+
|
112 |
+
function enqueue_action( $current_filter, $args, $queue ) {
|
113 |
+
/**
|
114 |
+
* Modify or reject the data within an action before it is enqueued locally.
|
115 |
+
*
|
116 |
+
* @since 4.2.0
|
117 |
+
*
|
118 |
+
* @param array The action parameters
|
119 |
+
*/
|
120 |
+
$args = apply_filters( "jetpack_sync_before_enqueue_$current_filter", $args );
|
121 |
+
|
122 |
+
// allow listeners to abort
|
123 |
+
if ( $args === false ) {
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
// periodically check the size of the queue, and disable adding to it if
|
128 |
+
// it exceeds some limit AND the oldest item exceeds the age limit (i.e. sending has stopped)
|
129 |
+
if ( ! $this->can_add_to_queue( $queue ) ) {
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
|
133 |
+
// if we add any items to the queue, we should try to ensure that our script
|
134 |
+
// can't be killed before they are sent
|
135 |
+
if ( function_exists( 'ignore_user_abort' ) ) {
|
136 |
+
ignore_user_abort( true );
|
137 |
+
}
|
138 |
+
|
139 |
+
$queue->add( array(
|
140 |
+
$current_filter,
|
141 |
+
$args,
|
142 |
+
get_current_user_id(),
|
143 |
+
microtime( true ),
|
144 |
+
Jetpack_Sync_Settings::is_importing()
|
145 |
+
) );
|
146 |
+
}
|
147 |
+
|
148 |
+
function set_defaults() {
|
149 |
+
$this->sync_queue = new Jetpack_Sync_Queue( 'sync' );
|
150 |
+
$this->full_sync_queue = new Jetpack_Sync_Queue( 'full_sync' );
|
151 |
+
$this->set_queue_size_limit( Jetpack_Sync_Settings::get_setting( 'max_queue_size' ) );
|
152 |
+
$this->set_queue_lag_limit( Jetpack_Sync_Settings::get_setting( 'max_queue_lag' ) );
|
153 |
+
}
|
154 |
+
}
|
sync/class.jetpack-sync-module-attachments.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Attachments extends Jetpack_Sync_Module {
|
4 |
+
function name() {
|
5 |
+
return 'attachments';
|
6 |
+
}
|
7 |
+
|
8 |
+
public function init_listeners( $callable ) {
|
9 |
+
add_action( 'edit_attachment', array( $this, 'send_attachment_info' ) );
|
10 |
+
// Once we don't have to support 4.3 we can start using add_action( 'attachment_updated', $handler, 10, 3 ); instead
|
11 |
+
add_action( 'add_attachment', array( $this, 'send_attachment_info' ) );
|
12 |
+
add_action( 'jetpack_sync_save_add_attachment', $callable, 10, 2 );
|
13 |
+
}
|
14 |
+
|
15 |
+
function send_attachment_info( $attachment_id ) {
|
16 |
+
$attachment = get_post( $attachment_id );
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Fires when the client needs to sync an attachment for a post
|
20 |
+
*
|
21 |
+
* @since 4.2.0
|
22 |
+
*
|
23 |
+
* @param int The attachment ID
|
24 |
+
* @param object The attachment
|
25 |
+
*/
|
26 |
+
do_action( 'jetpack_sync_save_add_attachment', $attachment_id, $attachment );
|
27 |
+
}
|
28 |
+
}
|
sync/class.jetpack-sync-module-callables.php
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-functions.php';
|
4 |
+
|
5 |
+
class Jetpack_Sync_Module_Callables extends Jetpack_Sync_Module {
|
6 |
+
const CALLABLES_CHECKSUM_OPTION_NAME = 'jetpack_callables_sync_checksum';
|
7 |
+
const CALLABLES_AWAIT_TRANSIENT_NAME = 'jetpack_sync_callables_await';
|
8 |
+
|
9 |
+
private $callable_whitelist;
|
10 |
+
|
11 |
+
public function name() {
|
12 |
+
return 'functions';
|
13 |
+
}
|
14 |
+
|
15 |
+
public function set_defaults() {
|
16 |
+
if ( is_multisite() ) {
|
17 |
+
$this->callable_whitelist = array_merge( Jetpack_Sync_Defaults::$default_callable_whitelist, Jetpack_Sync_Defaults::$default_multisite_callable_whitelist );
|
18 |
+
} else {
|
19 |
+
$this->callable_whitelist = Jetpack_Sync_Defaults::$default_callable_whitelist;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function init_listeners( $callable ) {
|
24 |
+
add_action( 'jetpack_sync_callable', $callable, 10, 2 );
|
25 |
+
|
26 |
+
// always send change to active modules right away
|
27 |
+
add_action( 'update_option_jetpack_active_modules', array( $this, 'unlock_sync_callable' ) );
|
28 |
+
|
29 |
+
// get_plugins and wp_version
|
30 |
+
// gets fired when new code gets installed, updates etc.
|
31 |
+
add_action( 'upgrader_process_complete', array( $this, 'unlock_sync_callable' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
public function init_full_sync_listeners( $callable ) {
|
35 |
+
add_action( 'jetpack_full_sync_callables', $callable );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function init_before_send() {
|
39 |
+
add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_sync_callables' ) );
|
40 |
+
|
41 |
+
// full sync
|
42 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_callables', array( $this, 'expand_callables' ) );
|
43 |
+
}
|
44 |
+
|
45 |
+
public function reset_data() {
|
46 |
+
delete_option( self::CALLABLES_CHECKSUM_OPTION_NAME );
|
47 |
+
delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME );
|
48 |
+
}
|
49 |
+
|
50 |
+
function set_callable_whitelist( $callables ) {
|
51 |
+
$this->callable_whitelist = $callables;
|
52 |
+
}
|
53 |
+
|
54 |
+
function get_callable_whitelist() {
|
55 |
+
return $this->callable_whitelist;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function get_all_callables() {
|
59 |
+
// get_all_callables should run as the master user always.
|
60 |
+
$current_user_id = get_current_user_id();
|
61 |
+
wp_set_current_user( Jetpack_Options::get_option( 'master_user' ) );
|
62 |
+
$callables = array_combine(
|
63 |
+
array_keys( $this->callable_whitelist ),
|
64 |
+
array_map( array( $this, 'get_callable' ), array_values( $this->callable_whitelist ) )
|
65 |
+
);
|
66 |
+
wp_set_current_user( $current_user_id );
|
67 |
+
|
68 |
+
return $callables;
|
69 |
+
}
|
70 |
+
|
71 |
+
private function get_callable( $callable ) {
|
72 |
+
return call_user_func( $callable );
|
73 |
+
}
|
74 |
+
|
75 |
+
public function enqueue_full_sync_actions( $config ) {
|
76 |
+
/**
|
77 |
+
* Tells the client to sync all callables to the server
|
78 |
+
*
|
79 |
+
* @since 4.2.0
|
80 |
+
*
|
81 |
+
* @param boolean Whether to expand callables (should always be true)
|
82 |
+
*/
|
83 |
+
do_action( 'jetpack_full_sync_callables', true );
|
84 |
+
|
85 |
+
return 1; // The number of actions enqueued
|
86 |
+
}
|
87 |
+
|
88 |
+
public function estimate_full_sync_actions( $config ) {
|
89 |
+
return 1;
|
90 |
+
}
|
91 |
+
|
92 |
+
public function get_full_sync_actions() {
|
93 |
+
return array( 'jetpack_full_sync_callables' );
|
94 |
+
}
|
95 |
+
|
96 |
+
public function unlock_sync_callable() {
|
97 |
+
delete_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME );
|
98 |
+
}
|
99 |
+
|
100 |
+
public function maybe_sync_callables() {
|
101 |
+
if ( get_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME ) ) {
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
|
105 |
+
$callables = $this->get_all_callables();
|
106 |
+
|
107 |
+
if ( empty( $callables ) ) {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
|
111 |
+
set_transient( self::CALLABLES_AWAIT_TRANSIENT_NAME, microtime( true ), Jetpack_Sync_Defaults::$default_sync_callables_wait_time );
|
112 |
+
|
113 |
+
$callable_checksums = (array) get_option( self::CALLABLES_CHECKSUM_OPTION_NAME, array() );
|
114 |
+
|
115 |
+
// only send the callables that have changed
|
116 |
+
foreach ( $callables as $name => $value ) {
|
117 |
+
$checksum = $this->get_check_sum( $value );
|
118 |
+
// explicitly not using Identical comparison as get_option returns a string
|
119 |
+
if ( ! $this->still_valid_checksum( $callable_checksums, $name, $checksum ) && ! is_null( $value ) ) {
|
120 |
+
/**
|
121 |
+
* Tells the client to sync a callable (aka function) to the server
|
122 |
+
*
|
123 |
+
* @since 4.2.0
|
124 |
+
*
|
125 |
+
* @param string The name of the callable
|
126 |
+
* @param mixed The value of the callable
|
127 |
+
*/
|
128 |
+
do_action( 'jetpack_sync_callable', $name, $value );
|
129 |
+
$callable_checksums[ $name ] = $checksum;
|
130 |
+
} else {
|
131 |
+
$callable_checksums[ $name ] = $checksum;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
update_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callable_checksums );
|
135 |
+
}
|
136 |
+
|
137 |
+
public function expand_callables( $args ) {
|
138 |
+
if ( $args[0] ) {
|
139 |
+
return $this->get_all_callables();
|
140 |
+
}
|
141 |
+
|
142 |
+
return $args;
|
143 |
+
}
|
144 |
+
}
|
sync/class.jetpack-sync-module-comments.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Comments extends Jetpack_Sync_Module {
|
4 |
+
|
5 |
+
public function name() {
|
6 |
+
return 'comments';
|
7 |
+
}
|
8 |
+
|
9 |
+
public function init_listeners( $callable ) {
|
10 |
+
add_action( 'wp_insert_comment', $callable, 10, 2 );
|
11 |
+
add_action( 'deleted_comment', $callable, 10 );
|
12 |
+
add_action( 'trashed_comment', $callable, 10 );
|
13 |
+
add_action( 'spammed_comment', $callable, 10 );
|
14 |
+
|
15 |
+
// even though it's messy, we implement these hooks because
|
16 |
+
// the edit_comment hook doesn't include the data
|
17 |
+
// so this saves us a DB read for every comment event
|
18 |
+
foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
|
19 |
+
foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
|
20 |
+
$comment_action_name = "comment_{$comment_status}_{$comment_type}";
|
21 |
+
add_action( $comment_action_name, $callable, 10, 2 );
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
public function init_full_sync_listeners( $callable ) {
|
27 |
+
add_action( 'jetpack_full_sync_comments', $callable ); // also send comments meta
|
28 |
+
}
|
29 |
+
|
30 |
+
public function init_before_send() {
|
31 |
+
add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) );
|
32 |
+
|
33 |
+
foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) {
|
34 |
+
foreach ( array( 'unapproved', 'approved' ) as $comment_status ) {
|
35 |
+
$comment_action_name = "comment_{$comment_status}_{$comment_type}";
|
36 |
+
add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array(
|
37 |
+
$this,
|
38 |
+
'expand_wp_insert_comment',
|
39 |
+
) );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
// full sync
|
44 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_comments', array( $this, 'expand_comment_ids' ) );
|
45 |
+
}
|
46 |
+
|
47 |
+
public function enqueue_full_sync_actions( $config ) {
|
48 |
+
global $wpdb;
|
49 |
+
return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_comments', $wpdb->comments, 'comment_ID', $this->get_where_sql( $config ) );
|
50 |
+
}
|
51 |
+
|
52 |
+
public function estimate_full_sync_actions( $config ) {
|
53 |
+
global $wpdb;
|
54 |
+
|
55 |
+
$query = "SELECT count(*) FROM $wpdb->comments";
|
56 |
+
|
57 |
+
if ( $where_sql = $this->get_where_sql( $config ) ) {
|
58 |
+
$query .= ' WHERE ' . $where_sql;
|
59 |
+
}
|
60 |
+
|
61 |
+
$count = $wpdb->get_var( $query );
|
62 |
+
|
63 |
+
return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
|
64 |
+
}
|
65 |
+
|
66 |
+
private function get_where_sql( $config ) {
|
67 |
+
if ( is_array( $config ) ) {
|
68 |
+
return 'comment_ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
|
69 |
+
}
|
70 |
+
|
71 |
+
return null;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function get_full_sync_actions() {
|
75 |
+
return array( 'jetpack_full_sync_comments' );
|
76 |
+
}
|
77 |
+
|
78 |
+
public function count_full_sync_actions( $action_names ) {
|
79 |
+
return $this->count_actions( $action_names, array( 'jetpack_full_sync_comments' ) );
|
80 |
+
}
|
81 |
+
|
82 |
+
function expand_wp_comment_status_change( $args ) {
|
83 |
+
return array( $args[0], $this->filter_comment( $args[1] ) );
|
84 |
+
}
|
85 |
+
|
86 |
+
function expand_wp_insert_comment( $args ) {
|
87 |
+
return array( $args[0], $this->filter_comment( $args[1] ) );
|
88 |
+
}
|
89 |
+
|
90 |
+
function filter_comment( $comment ) {
|
91 |
+
/**
|
92 |
+
* Filters whether to prevent sending comment data to .com
|
93 |
+
*
|
94 |
+
* Passing true to the filter will prevent the comment data from being sent
|
95 |
+
* to the WordPress.com.
|
96 |
+
* Instead we pass data that will still enable us to do a checksum against the
|
97 |
+
* Jetpacks data but will prevent us from displaying the data on in the API as well as
|
98 |
+
* other services.
|
99 |
+
* @since 4.2.0
|
100 |
+
*
|
101 |
+
* @param boolean false prevent post data from bing synced to WordPress.com
|
102 |
+
* @param mixed $comment WP_COMMENT object
|
103 |
+
*/
|
104 |
+
if ( apply_filters( 'jetpack_sync_prevent_sending_comment_data', false, $comment ) ) {
|
105 |
+
$blocked_comment = new stdClass();
|
106 |
+
$blocked_comment->comment_ID = $comment->comment_ID;
|
107 |
+
$blocked_comment->comment_date = $comment->comment_date;
|
108 |
+
$blocked_comment->comment_date_gmt = $comment->comment_date_gmt;
|
109 |
+
$blocked_comment->comment_approved = 'jetpack_sync_blocked';
|
110 |
+
|
111 |
+
return $blocked_comment;
|
112 |
+
}
|
113 |
+
|
114 |
+
return $comment;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function expand_comment_ids( $args ) {
|
118 |
+
$comment_ids = $args[0];
|
119 |
+
$comments = get_comments( array(
|
120 |
+
'include_unapproved' => true,
|
121 |
+
'comment__in' => $comment_ids,
|
122 |
+
) );
|
123 |
+
|
124 |
+
return array(
|
125 |
+
$comments,
|
126 |
+
$this->get_metadata( $comment_ids, 'comment' ),
|
127 |
+
);
|
128 |
+
}
|
129 |
+
}
|
sync/class.jetpack-sync-module-constants.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-defaults.php';
|
4 |
+
|
5 |
+
class Jetpack_Sync_Module_Constants extends Jetpack_Sync_Module {
|
6 |
+
const CONSTANTS_CHECKSUM_OPTION_NAME = 'jetpack_constants_sync_checksum';
|
7 |
+
const CONSTANTS_AWAIT_TRANSIENT_NAME = 'jetpack_sync_constants_await';
|
8 |
+
|
9 |
+
public function name() {
|
10 |
+
return 'constants';
|
11 |
+
}
|
12 |
+
|
13 |
+
private $constants_whitelist;
|
14 |
+
|
15 |
+
public function set_defaults() {
|
16 |
+
$this->constants_whitelist = Jetpack_Sync_Defaults::$default_constants_whitelist;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function init_listeners( $callable ) {
|
20 |
+
add_action( 'jetpack_sync_constant', $callable, 10, 2 );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function init_full_sync_listeners( $callable ) {
|
24 |
+
add_action( 'jetpack_full_sync_constants', $callable );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function init_before_send() {
|
28 |
+
add_action( 'jetpack_sync_before_send_queue_sync', array( $this, 'maybe_sync_constants' ) );
|
29 |
+
|
30 |
+
// full sync
|
31 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_constants', array( $this, 'expand_constants' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
public function reset_data() {
|
35 |
+
delete_option( self::CONSTANTS_CHECKSUM_OPTION_NAME );
|
36 |
+
delete_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME );
|
37 |
+
}
|
38 |
+
|
39 |
+
function set_constants_whitelist( $constants ) {
|
40 |
+
$this->constants_whitelist = $constants;
|
41 |
+
}
|
42 |
+
|
43 |
+
function get_constants_whitelist() {
|
44 |
+
return $this->constants_whitelist;
|
45 |
+
}
|
46 |
+
|
47 |
+
function enqueue_full_sync_actions( $config ) {
|
48 |
+
/**
|
49 |
+
* Tells the client to sync all constants to the server
|
50 |
+
*
|
51 |
+
* @since 4.2.0
|
52 |
+
*
|
53 |
+
* @param boolean Whether to expand constants (should always be true)
|
54 |
+
*/
|
55 |
+
do_action( 'jetpack_full_sync_constants', true );
|
56 |
+
|
57 |
+
return 1;
|
58 |
+
}
|
59 |
+
|
60 |
+
function estimate_full_sync_actions( $config ) {
|
61 |
+
return 1;
|
62 |
+
}
|
63 |
+
|
64 |
+
function get_full_sync_actions() {
|
65 |
+
return array( 'jetpack_full_sync_constants' );
|
66 |
+
}
|
67 |
+
|
68 |
+
function maybe_sync_constants() {
|
69 |
+
if ( get_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME ) ) {
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
|
73 |
+
$constants = $this->get_all_constants();
|
74 |
+
if ( empty( $constants ) ) {
|
75 |
+
return;
|
76 |
+
}
|
77 |
+
|
78 |
+
set_transient( self::CONSTANTS_AWAIT_TRANSIENT_NAME, microtime( true ), Jetpack_Sync_Defaults::$default_sync_constants_wait_time );
|
79 |
+
$constants_checksums = (array) get_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, array() );
|
80 |
+
|
81 |
+
foreach ( $constants as $name => $value ) {
|
82 |
+
$checksum = $this->get_check_sum( $value );
|
83 |
+
// explicitly not using Identical comparison as get_option returns a string
|
84 |
+
if ( ! $this->still_valid_checksum( $constants_checksums, $name, $checksum ) && ! is_null( $value ) ) {
|
85 |
+
/**
|
86 |
+
* Tells the client to sync a constant to the server
|
87 |
+
*
|
88 |
+
* @since 4.2.0
|
89 |
+
*
|
90 |
+
* @param string The name of the constant
|
91 |
+
* @param mixed The value of the constant
|
92 |
+
*/
|
93 |
+
do_action( 'jetpack_sync_constant', $name, $value );
|
94 |
+
$constants_checksums[ $name ] = $checksum;
|
95 |
+
} else {
|
96 |
+
$constants_checksums[ $name ] = $checksum;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums );
|
100 |
+
}
|
101 |
+
|
102 |
+
// public so that we don't have to store an option for each constant
|
103 |
+
function get_all_constants() {
|
104 |
+
return array_combine(
|
105 |
+
$this->constants_whitelist,
|
106 |
+
array_map( array( $this, 'get_constant' ), $this->constants_whitelist )
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
private function get_constant( $constant ) {
|
111 |
+
return ( defined( $constant ) ) ?
|
112 |
+
constant( $constant )
|
113 |
+
: null;
|
114 |
+
}
|
115 |
+
|
116 |
+
public function expand_constants( $args ) {
|
117 |
+
if ( $args[0] ) {
|
118 |
+
return $this->get_all_constants();
|
119 |
+
}
|
120 |
+
|
121 |
+
return $args;
|
122 |
+
}
|
123 |
+
}
|
sync/class.jetpack-sync-module-full-sync.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class does a full resync of the database by
|
5 |
+
* enqueuing an outbound action for every single object
|
6 |
+
* that we care about.
|
7 |
+
*
|
8 |
+
* This class, and its related class Jetpack_Sync_Module, contain a few non-obvious optimisations that should be explained:
|
9 |
+
* - we fire an action called jetpack_full_sync_start so that WPCOM can erase the contents of the cached database
|
10 |
+
* - for each object type, we page through the object IDs and enqueue them by firing some monitored actions
|
11 |
+
* - we load the full objects for those IDs in chunks of Jetpack_Sync_Module::ARRAY_CHUNK_SIZE (to reduce the number of MySQL calls)
|
12 |
+
* - we fire a trigger for the entire array which the Jetpack_Sync_Listener then serializes and queues.
|
13 |
+
*/
|
14 |
+
|
15 |
+
require_once 'class.jetpack-sync-wp-replicastore.php';
|
16 |
+
|
17 |
+
class Jetpack_Sync_Module_Full_Sync extends Jetpack_Sync_Module {
|
18 |
+
const STATUS_OPTION_PREFIX = 'jetpack_sync_full_';
|
19 |
+
const FULL_SYNC_TIMEOUT = 3600;
|
20 |
+
|
21 |
+
public function name() {
|
22 |
+
return 'full-sync';
|
23 |
+
}
|
24 |
+
|
25 |
+
function init_full_sync_listeners( $callable ) {
|
26 |
+
// synthetic actions for full sync
|
27 |
+
add_action( 'jetpack_full_sync_start', $callable );
|
28 |
+
add_action( 'jetpack_full_sync_end', $callable );
|
29 |
+
add_action( 'jetpack_full_sync_cancelled', $callable );
|
30 |
+
}
|
31 |
+
|
32 |
+
function init_before_send() {
|
33 |
+
// this is triggered after actions have been processed on the server
|
34 |
+
add_action( 'jetpack_sync_processed_actions', array( $this, 'update_sent_progress_action' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
function start( $modules = null ) {
|
38 |
+
$was_already_running = $this->is_started() && ! $this->is_finished();
|
39 |
+
|
40 |
+
// remove all evidence of previous full sync items and status
|
41 |
+
$this->reset_data();
|
42 |
+
|
43 |
+
if ( $was_already_running ) {
|
44 |
+
/**
|
45 |
+
* Fires when a full sync is cancelled.
|
46 |
+
*
|
47 |
+
* @since 4.2.0
|
48 |
+
*/
|
49 |
+
do_action( 'jetpack_full_sync_cancelled' );
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Fires when a full sync begins. This action is serialized
|
54 |
+
* and sent to the server so that it knows a full sync is coming.
|
55 |
+
*
|
56 |
+
* @since 4.2.0
|
57 |
+
*/
|
58 |
+
do_action( 'jetpack_full_sync_start', $modules );
|
59 |
+
$this->update_status_option( 'started', time() );
|
60 |
+
|
61 |
+
// configure modules
|
62 |
+
if ( ! is_array( $modules ) ) {
|
63 |
+
$modules = array();
|
64 |
+
}
|
65 |
+
|
66 |
+
// by default, all modules are fully enabled
|
67 |
+
if ( count( $modules ) === 0 ) {
|
68 |
+
$default_module_config = true;
|
69 |
+
} else {
|
70 |
+
$default_module_config = false;
|
71 |
+
}
|
72 |
+
|
73 |
+
// set default configuration, calculate totals, and save configuration if totals > 0
|
74 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
75 |
+
$module_name = $module->name();
|
76 |
+
if ( ! isset( $modules[ $module_name ] ) ) {
|
77 |
+
$modules[ $module_name ] = $default_module_config;
|
78 |
+
}
|
79 |
+
|
80 |
+
// check if this module is enabled
|
81 |
+
if ( ! ( $module_config = $modules[ $module_name ] ) ) {
|
82 |
+
continue;
|
83 |
+
}
|
84 |
+
|
85 |
+
$total_items = $module->estimate_full_sync_actions( $module_config );
|
86 |
+
|
87 |
+
if ( ! is_null( $total_items ) && $total_items > 0 ) {
|
88 |
+
$this->update_status_option( "{$module_name}_total", $total_items );
|
89 |
+
$this->update_status_option( "{$module_name}_config", $module_config );
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
94 |
+
$module_name = $module->name();
|
95 |
+
$module_config = $modules[ $module_name ];
|
96 |
+
|
97 |
+
// check if this module is enabled
|
98 |
+
if ( ! $module_config ) {
|
99 |
+
continue;
|
100 |
+
}
|
101 |
+
|
102 |
+
$items_enqueued = $module->enqueue_full_sync_actions( $module_config );
|
103 |
+
|
104 |
+
if ( ! is_null( $items_enqueued ) && $items_enqueued > 0 ) {
|
105 |
+
$this->update_status_option( "{$module_name}_queued", $items_enqueued );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
$this->update_status_option( 'queue_finished', time() );
|
110 |
+
|
111 |
+
$store = new Jetpack_Sync_WP_Replicastore();
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Fires when a full sync ends. This action is serialized
|
115 |
+
* and sent to the server with checksums so that we can confirm the
|
116 |
+
* sync was successful.
|
117 |
+
*
|
118 |
+
* @since 4.2.0
|
119 |
+
*/
|
120 |
+
do_action( 'jetpack_full_sync_end', $store->checksum_all() );
|
121 |
+
|
122 |
+
return true;
|
123 |
+
}
|
124 |
+
|
125 |
+
function update_sent_progress_action( $actions ) {
|
126 |
+
|
127 |
+
// quick way to map to first items with an array of arrays
|
128 |
+
$actions_with_counts = array_count_values( array_map( 'reset', $actions ) );
|
129 |
+
|
130 |
+
if ( ! $this->is_started() || $this->is_finished() ) {
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( isset( $actions_with_counts['jetpack_full_sync_start'] ) ) {
|
135 |
+
$this->update_status_option( 'sent_started', time() );
|
136 |
+
}
|
137 |
+
|
138 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
139 |
+
$module_actions = $module->get_full_sync_actions();
|
140 |
+
$status_option_name = "{$module->name()}_sent";
|
141 |
+
$items_sent = $this->get_status_option( $status_option_name, 0 );
|
142 |
+
|
143 |
+
foreach ( $module_actions as $module_action ) {
|
144 |
+
if ( isset( $actions_with_counts[ $module_action ] ) ) {
|
145 |
+
$items_sent += $actions_with_counts[ $module_action ];
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
if ( $items_sent > 0 ) {
|
150 |
+
$this->update_status_option( $status_option_name, $items_sent );
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
if ( isset( $actions_with_counts['jetpack_full_sync_end'] ) ) {
|
155 |
+
$this->update_status_option( 'finished', time() );
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
public function is_started() {
|
160 |
+
return !! $this->get_status_option( 'started' );
|
161 |
+
}
|
162 |
+
|
163 |
+
public function is_finished() {
|
164 |
+
return !! $this->get_status_option( 'finished' );
|
165 |
+
}
|
166 |
+
|
167 |
+
public function get_status() {
|
168 |
+
$status = array(
|
169 |
+
'started' => $this->get_status_option( 'started' ),
|
170 |
+
'queue_finished' => $this->get_status_option( 'queue_finished' ),
|
171 |
+
'sent_started' => $this->get_status_option( 'sent_started' ),
|
172 |
+
'finished' => $this->get_status_option( 'finished' ),
|
173 |
+
'sent' => array(),
|
174 |
+
'queue' => array(),
|
175 |
+
'config' => array(),
|
176 |
+
'total' => array(),
|
177 |
+
);
|
178 |
+
|
179 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
180 |
+
$name = $module->name();
|
181 |
+
|
182 |
+
if ( $total = $this->get_status_option( "{$name}_total" ) ) {
|
183 |
+
$status[ 'total' ][ $name ] = $total;
|
184 |
+
}
|
185 |
+
|
186 |
+
if ( $queued = $this->get_status_option( "{$name}_queued" ) ) {
|
187 |
+
$status[ 'queue' ][ $name ] = $queued;
|
188 |
+
}
|
189 |
+
|
190 |
+
if ( $sent = $this->get_status_option( "{$name}_sent" ) ) {
|
191 |
+
$status[ 'sent' ][ $name ] = $sent;
|
192 |
+
}
|
193 |
+
|
194 |
+
if ( $config = $this->get_status_option( "{$name}_config" ) ) {
|
195 |
+
$status[ 'config' ][ $name ] = $config;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
return $status;
|
200 |
+
}
|
201 |
+
|
202 |
+
public function clear_status() {
|
203 |
+
$prefix = self::STATUS_OPTION_PREFIX;
|
204 |
+
delete_option( "{$prefix}_started" );
|
205 |
+
delete_option( "{$prefix}_queue_finished" );
|
206 |
+
delete_option( "{$prefix}_sent_started" );
|
207 |
+
delete_option( "{$prefix}_finished" );
|
208 |
+
|
209 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
210 |
+
delete_option( "{$prefix}_{$module->name()}_total" );
|
211 |
+
delete_option( "{$prefix}_{$module->name()}_queued" );
|
212 |
+
delete_option( "{$prefix}_{$module->name()}_sent" );
|
213 |
+
delete_option( "{$prefix}_{$module->name()}_config" );
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
public function reset_data() {
|
218 |
+
$this->clear_status();
|
219 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-listener.php';
|
220 |
+
$listener = Jetpack_Sync_Listener::get_instance();
|
221 |
+
$listener->get_full_sync_queue()->reset();
|
222 |
+
}
|
223 |
+
|
224 |
+
private function get_status_option( $option, $default = null ) {
|
225 |
+
$prefix = self::STATUS_OPTION_PREFIX;
|
226 |
+
|
227 |
+
$value = get_option( "{$prefix}_{$option}", $default );
|
228 |
+
|
229 |
+
if ( ! $value ) {
|
230 |
+
// don't cast to int if we didn't find a value - we want to preserve null or false as sentinals
|
231 |
+
return $default;
|
232 |
+
}
|
233 |
+
|
234 |
+
return is_numeric( $value ) ? intval( $value ) : $value;
|
235 |
+
}
|
236 |
+
|
237 |
+
private function update_status_option( $name, $value ) {
|
238 |
+
$prefix = self::STATUS_OPTION_PREFIX;
|
239 |
+
update_option( "{$prefix}_{$name}", $value, false );
|
240 |
+
}
|
241 |
+
}
|
sync/class.jetpack-sync-module-meta.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Meta extends Jetpack_Sync_Module {
|
4 |
+
private $meta_types = array( 'post', 'comment' );
|
5 |
+
|
6 |
+
public function name() {
|
7 |
+
return 'meta';
|
8 |
+
}
|
9 |
+
|
10 |
+
public function init_listeners( $callable ) {
|
11 |
+
$whitelist_handler = array( $this, 'filter_meta' );
|
12 |
+
|
13 |
+
foreach ( $this->meta_types as $meta_type ) {
|
14 |
+
add_action( "added_{$meta_type}_meta", $callable, 10, 4 );
|
15 |
+
add_action( "updated_{$meta_type}_meta", $callable, 10, 4 );
|
16 |
+
add_action( "deleted_{$meta_type}_meta", $callable, 10, 4 );
|
17 |
+
|
18 |
+
add_filter( "jetpack_sync_before_enqueue_added_{$meta_type}_meta", $whitelist_handler );
|
19 |
+
add_filter( "jetpack_sync_before_enqueue_updated_{$meta_type}_meta", $whitelist_handler );
|
20 |
+
add_filter( "jetpack_sync_before_enqueue_deleted_{$meta_type}_meta", $whitelist_handler );
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
function filter_meta( $args ) {
|
25 |
+
if ( '_' === $args[2][0] &&
|
26 |
+
! in_array( $args[2], Jetpack_Sync_Defaults::$default_whitelist_meta_keys ) &&
|
27 |
+
! wp_startswith( $args[2], '_wpas_skip_' )
|
28 |
+
) {
|
29 |
+
return false;
|
30 |
+
}
|
31 |
+
|
32 |
+
return $args;
|
33 |
+
}
|
34 |
+
}
|
sync/class.jetpack-sync-module-network-options.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Network_Options extends Jetpack_Sync_Module {
|
4 |
+
private $network_options_whitelist;
|
5 |
+
|
6 |
+
public function name() {
|
7 |
+
return 'network_options';
|
8 |
+
}
|
9 |
+
|
10 |
+
public function init_listeners( $callable ) {
|
11 |
+
if ( ! is_multisite() ) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
// multi site network options
|
16 |
+
add_action( 'add_site_option', $callable, 10, 2 );
|
17 |
+
add_action( 'update_site_option', $callable, 10, 3 );
|
18 |
+
add_action( 'delete_site_option', $callable, 10, 1 );
|
19 |
+
|
20 |
+
$whitelist_network_option_handler = array( $this, 'whitelist_network_options' );
|
21 |
+
add_filter( 'jetpack_sync_before_enqueue_delete_site_option', $whitelist_network_option_handler );
|
22 |
+
add_filter( 'jetpack_sync_before_enqueue_add_site_option', $whitelist_network_option_handler );
|
23 |
+
add_filter( 'jetpack_sync_before_enqueue_update_site_option', $whitelist_network_option_handler );
|
24 |
+
}
|
25 |
+
|
26 |
+
public function init_full_sync_listeners( $callable ) {
|
27 |
+
add_action( 'jetpack_full_sync_network_options', $callable );
|
28 |
+
}
|
29 |
+
|
30 |
+
public function init_before_send() {
|
31 |
+
if ( ! is_multisite() ) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
|
35 |
+
// full sync
|
36 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_network_options', array(
|
37 |
+
$this,
|
38 |
+
'expand_network_options',
|
39 |
+
) );
|
40 |
+
}
|
41 |
+
|
42 |
+
public function set_defaults() {
|
43 |
+
$this->network_options_whitelist = Jetpack_Sync_Defaults::$default_network_options_whitelist;
|
44 |
+
}
|
45 |
+
|
46 |
+
function enqueue_full_sync_actions( $config ) {
|
47 |
+
if ( ! is_multisite() ) {
|
48 |
+
return 0;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Tells the client to sync all options to the server
|
53 |
+
*
|
54 |
+
* @since 4.2.0
|
55 |
+
*
|
56 |
+
* @param boolean Whether to expand options (should always be true)
|
57 |
+
*/
|
58 |
+
do_action( 'jetpack_full_sync_network_options', true );
|
59 |
+
|
60 |
+
return 1; // The number of actions enqueued
|
61 |
+
}
|
62 |
+
|
63 |
+
function estimate_full_sync_actions( $config ) {
|
64 |
+
if ( ! is_multisite() ) {
|
65 |
+
return 0;
|
66 |
+
}
|
67 |
+
|
68 |
+
return 1;
|
69 |
+
}
|
70 |
+
|
71 |
+
function get_full_sync_actions() {
|
72 |
+
return array( 'jetpack_full_sync_network_options' );
|
73 |
+
}
|
74 |
+
|
75 |
+
function get_all_network_options() {
|
76 |
+
$options = array();
|
77 |
+
foreach ( $this->network_options_whitelist as $option ) {
|
78 |
+
$options[ $option ] = get_site_option( $option );
|
79 |
+
}
|
80 |
+
|
81 |
+
return $options;
|
82 |
+
}
|
83 |
+
|
84 |
+
function set_network_options_whitelist( $options ) {
|
85 |
+
$this->network_options_whitelist = $options;
|
86 |
+
}
|
87 |
+
|
88 |
+
function get_network_options_whitelist() {
|
89 |
+
return $this->network_options_whitelist;
|
90 |
+
}
|
91 |
+
|
92 |
+
// reject non-whitelisted network options
|
93 |
+
function whitelist_network_options( $args ) {
|
94 |
+
if ( ! $this->is_whitelisted_network_option( $args[0] ) ) {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
|
98 |
+
return $args;
|
99 |
+
}
|
100 |
+
|
101 |
+
function is_whitelisted_network_option( $option ) {
|
102 |
+
return is_multisite() && in_array( $option, $this->network_options_whitelist );
|
103 |
+
}
|
104 |
+
|
105 |
+
public function expand_network_options( $args ) {
|
106 |
+
if ( $args[0] ) {
|
107 |
+
return $this->get_all_network_options();
|
108 |
+
}
|
109 |
+
|
110 |
+
return $args;
|
111 |
+
}
|
112 |
+
}
|
sync/class.jetpack-sync-module-options.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Options extends Jetpack_Sync_Module {
|
4 |
+
private $options_whitelist;
|
5 |
+
|
6 |
+
public function name() {
|
7 |
+
return 'options';
|
8 |
+
}
|
9 |
+
|
10 |
+
public function init_listeners( $callable ) {
|
11 |
+
// options
|
12 |
+
add_action( 'added_option', $callable, 10, 2 );
|
13 |
+
add_action( 'updated_option', $callable, 10, 3 );
|
14 |
+
add_action( 'deleted_option', $callable, 10, 1 );
|
15 |
+
|
16 |
+
// Sync Core Icon: Detect changes in Core's Site Icon and make it syncable.
|
17 |
+
add_action( 'add_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
18 |
+
add_action( 'update_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
19 |
+
add_action( 'delete_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
20 |
+
|
21 |
+
$whitelist_option_handler = array( $this, 'whitelist_options' );
|
22 |
+
add_filter( 'jetpack_sync_before_enqueue_deleted_option', $whitelist_option_handler );
|
23 |
+
add_filter( 'jetpack_sync_before_enqueue_added_option', $whitelist_option_handler );
|
24 |
+
add_filter( 'jetpack_sync_before_enqueue_updated_option', $whitelist_option_handler );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function init_full_sync_listeners( $callable ) {
|
28 |
+
add_action( 'jetpack_full_sync_options', $callable );
|
29 |
+
}
|
30 |
+
|
31 |
+
public function init_before_send() {
|
32 |
+
// full sync
|
33 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_options', array( $this, 'expand_options' ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function set_defaults() {
|
37 |
+
$this->update_options_whitelist();
|
38 |
+
}
|
39 |
+
|
40 |
+
function enqueue_full_sync_actions( $config ) {
|
41 |
+
/**
|
42 |
+
* Tells the client to sync all options to the server
|
43 |
+
*
|
44 |
+
* @since 4.2.0
|
45 |
+
*
|
46 |
+
* @param boolean Whether to expand options (should always be true)
|
47 |
+
*/
|
48 |
+
do_action( 'jetpack_full_sync_options', true );
|
49 |
+
|
50 |
+
return 1; // The number of actions enqueued
|
51 |
+
}
|
52 |
+
|
53 |
+
public function estimate_full_sync_actions( $config ) {
|
54 |
+
return 1;
|
55 |
+
}
|
56 |
+
|
57 |
+
function get_full_sync_actions() {
|
58 |
+
return array( 'jetpack_full_sync_options' );
|
59 |
+
}
|
60 |
+
|
61 |
+
// Is public so that we don't have to store so much data all the options twice.
|
62 |
+
function get_all_options() {
|
63 |
+
$options = array();
|
64 |
+
foreach ( $this->options_whitelist as $option ) {
|
65 |
+
$options[ $option ] = get_option( $option );
|
66 |
+
}
|
67 |
+
|
68 |
+
// add theme mods
|
69 |
+
$theme_mods_option = 'theme_mods_'.get_option( 'stylesheet' );
|
70 |
+
$theme_mods_value = get_option( $theme_mods_option );
|
71 |
+
$this->filter_theme_mods( $theme_mods_value );
|
72 |
+
$options[ $theme_mods_option ] = $theme_mods_value;
|
73 |
+
|
74 |
+
return $options;
|
75 |
+
}
|
76 |
+
|
77 |
+
function update_options_whitelist() {
|
78 |
+
/** This filter is already documented in json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php */
|
79 |
+
$this->options_whitelist = apply_filters( 'jetpack_options_whitelist', Jetpack_Sync_Defaults::$default_options_whitelist );
|
80 |
+
}
|
81 |
+
|
82 |
+
function set_options_whitelist( $options ) {
|
83 |
+
$this->options_whitelist = $options;
|
84 |
+
}
|
85 |
+
|
86 |
+
function get_options_whitelist() {
|
87 |
+
return $this->options_whitelist;
|
88 |
+
}
|
89 |
+
|
90 |
+
// reject non-whitelisted options
|
91 |
+
function whitelist_options( $args ) {
|
92 |
+
if ( ! $this->is_whitelisted_option( $args[0] ) ) {
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
|
96 |
+
// filter our weird array( false ) value for theme_mods_*
|
97 |
+
if ( 'theme_mods_' === substr( $args[0], 0, 11 ) ) {
|
98 |
+
$this->filter_theme_mods( $args[1] );
|
99 |
+
if ( isset( $args[2] ) ) {
|
100 |
+
$this->filter_theme_mods( $args[2] );
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
return $args;
|
105 |
+
}
|
106 |
+
|
107 |
+
function is_whitelisted_option( $option ) {
|
108 |
+
return in_array( $option, $this->options_whitelist ) || 'theme_mods_' === substr( $option, 0, 11 );
|
109 |
+
}
|
110 |
+
|
111 |
+
private function filter_theme_mods( &$value ) {
|
112 |
+
if ( is_array( $value ) && isset( $value[0] ) ) {
|
113 |
+
unset( $value[0] );
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
function jetpack_sync_core_icon() {
|
118 |
+
if ( function_exists( 'get_site_icon_url' ) ) {
|
119 |
+
$url = get_site_icon_url();
|
120 |
+
} else {
|
121 |
+
return;
|
122 |
+
}
|
123 |
+
|
124 |
+
require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
|
125 |
+
// If there's a core icon, maybe update the option. If not, fall back to Jetpack's.
|
126 |
+
if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
|
127 |
+
// This is the option that is synced with dotcom
|
128 |
+
Jetpack_Options::update_option( 'site_icon_url', $url );
|
129 |
+
} else if ( empty( $url ) ) {
|
130 |
+
Jetpack_Options::delete_option( 'site_icon_url' );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
public function expand_options( $args ) {
|
135 |
+
if ( $args[0] ) {
|
136 |
+
return $this->get_all_options();
|
137 |
+
}
|
138 |
+
|
139 |
+
return $args;
|
140 |
+
}
|
141 |
+
}
|
sync/class.jetpack-sync-module-plugins.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Plugins extends Jetpack_Sync_Module {
|
4 |
+
|
5 |
+
public function name() {
|
6 |
+
return 'plugins';
|
7 |
+
}
|
8 |
+
|
9 |
+
public function init_listeners( $callable ) {
|
10 |
+
add_action( 'deleted_plugin', $callable, 10, 2 );
|
11 |
+
add_action( 'activated_plugin', $callable, 10, 2 );
|
12 |
+
add_action( 'deactivated_plugin', $callable, 10, 2 );
|
13 |
+
}
|
14 |
+
}
|
sync/class.jetpack-sync-module-posts.php
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Posts extends Jetpack_Sync_Module {
|
4 |
+
|
5 |
+
public function name() {
|
6 |
+
return 'posts';
|
7 |
+
}
|
8 |
+
|
9 |
+
public function set_defaults() {
|
10 |
+
}
|
11 |
+
|
12 |
+
public function init_listeners( $callable ) {
|
13 |
+
add_action( 'wp_insert_post', $callable, 10, 3 );
|
14 |
+
add_action( 'deleted_post', $callable, 10 );
|
15 |
+
add_action( 'jetpack_publicize_post', $callable );
|
16 |
+
add_filter( 'jetpack_sync_before_enqueue_wp_insert_post', array( $this, 'filter_blacklisted_post_types' ) );
|
17 |
+
}
|
18 |
+
|
19 |
+
public function init_full_sync_listeners( $callable ) {
|
20 |
+
add_action( 'jetpack_full_sync_posts', $callable ); // also sends post meta
|
21 |
+
}
|
22 |
+
|
23 |
+
public function init_before_send() {
|
24 |
+
add_filter( 'jetpack_sync_before_send_wp_insert_post', array( $this, 'expand_wp_insert_post' ) );
|
25 |
+
|
26 |
+
// full sync
|
27 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_posts', array( $this, 'expand_post_ids' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
public function enqueue_full_sync_actions( $config ) {
|
31 |
+
global $wpdb;
|
32 |
+
|
33 |
+
return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ) );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function estimate_full_sync_actions( $config ) {
|
37 |
+
global $wpdb;
|
38 |
+
|
39 |
+
$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
|
40 |
+
$count = $wpdb->get_var( $query );
|
41 |
+
|
42 |
+
return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
|
43 |
+
}
|
44 |
+
|
45 |
+
private function get_where_sql( $config ) {
|
46 |
+
$where_sql = Jetpack_Sync_Defaults::get_blacklisted_post_types_sql();
|
47 |
+
|
48 |
+
// config is a list of post IDs to sync
|
49 |
+
if ( is_array( $config ) ) {
|
50 |
+
$where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
|
51 |
+
}
|
52 |
+
|
53 |
+
return $where_sql;
|
54 |
+
}
|
55 |
+
|
56 |
+
function get_full_sync_actions() {
|
57 |
+
return array( 'jetpack_full_sync_posts' );
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Process content before send
|
62 |
+
*/
|
63 |
+
|
64 |
+
function expand_wp_insert_post( $args ) {
|
65 |
+
return array( $args[0], $this->filter_post_content_and_add_links( $args[1] ), $args[2] );
|
66 |
+
}
|
67 |
+
|
68 |
+
function filter_blacklisted_post_types( $args ) {
|
69 |
+
$post = $args[1];
|
70 |
+
if ( in_array( $post->post_type, Jetpack_Sync_Defaults::$blacklisted_post_types ) ) {
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $args;
|
75 |
+
}
|
76 |
+
|
77 |
+
// Expands wp_insert_post to include filtered content
|
78 |
+
function filter_post_content_and_add_links( $post_object ) {
|
79 |
+
global $post;
|
80 |
+
$post = $post_object;
|
81 |
+
/**
|
82 |
+
* Filters whether to prevent sending post data to .com
|
83 |
+
*
|
84 |
+
* Passing true to the filter will prevent the post data from being sent
|
85 |
+
* to the WordPress.com.
|
86 |
+
* Instead we pass data that will still enable us to do a checksum against the
|
87 |
+
* Jetpacks data but will prevent us from displaying the data on in the API as well as
|
88 |
+
* other services.
|
89 |
+
* @since 4.2.0
|
90 |
+
*
|
91 |
+
* @param boolean false prevent post data from being synced to WordPress.com
|
92 |
+
* @param mixed $post WP_POST object
|
93 |
+
*/
|
94 |
+
if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
|
95 |
+
// We only send the bare necessary object to be able to create a checksum.
|
96 |
+
$blocked_post = new stdClass();
|
97 |
+
$blocked_post->ID = $post->ID;
|
98 |
+
$blocked_post->post_modified = $post->post_modified;
|
99 |
+
$blocked_post->post_modified_gmt = $post->post_modified_gmt;
|
100 |
+
$blocked_post->post_status = 'jetpack_sync_blocked';
|
101 |
+
|
102 |
+
return $blocked_post;
|
103 |
+
}
|
104 |
+
|
105 |
+
if ( 0 < strlen( $post->post_password ) ) {
|
106 |
+
$post->post_password = 'auto-' . wp_generate_password( 10, false );
|
107 |
+
}
|
108 |
+
/** This filter is already documented in core. wp-includes/post-template.php */
|
109 |
+
$post->post_content_filtered = apply_filters( 'the_content', $post->post_content );
|
110 |
+
$post->post_excerpt_filtered = apply_filters( 'the_content', $post->post_excerpt );
|
111 |
+
$post->permalink = get_permalink( $post->ID );
|
112 |
+
$post->shortlink = wp_get_shortlink( $post->ID );
|
113 |
+
$post->dont_email_post_to_subs = Jetpack::is_module_active( 'subscriptions' ) ?
|
114 |
+
get_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', true ) :
|
115 |
+
true; // Don't email subscription if the subscription module is not active.
|
116 |
+
|
117 |
+
return $post;
|
118 |
+
}
|
119 |
+
|
120 |
+
public function expand_post_ids( $args ) {
|
121 |
+
$post_ids = $args[0];
|
122 |
+
|
123 |
+
$posts = array_filter( array_map( array( 'WP_Post', 'get_instance' ), $post_ids ) );
|
124 |
+
$posts = array_map( array( $this, 'filter_post_content_and_add_links' ), $posts );
|
125 |
+
|
126 |
+
return array(
|
127 |
+
$posts,
|
128 |
+
$this->get_metadata( $post_ids, 'post' ),
|
129 |
+
$this->get_term_relationships( $post_ids ),
|
130 |
+
);
|
131 |
+
}
|
132 |
+
}
|
sync/class.jetpack-sync-module-protect.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* logs bruteprotect failed logins via sync
|
5 |
+
*/
|
6 |
+
class Jetpack_Sync_Module_Protect extends Jetpack_Sync_Module {
|
7 |
+
private $taxonomy_whitelist;
|
8 |
+
|
9 |
+
function name() {
|
10 |
+
return 'protect';
|
11 |
+
}
|
12 |
+
|
13 |
+
function init_listeners( $callback ) {
|
14 |
+
add_action( 'jpp_log_failed_attempt', $callback );
|
15 |
+
}
|
16 |
+
}
|
sync/class.jetpack-sync-module-terms.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Terms extends Jetpack_Sync_Module {
|
4 |
+
private $taxonomy_whitelist;
|
5 |
+
|
6 |
+
function name() {
|
7 |
+
return 'terms';
|
8 |
+
}
|
9 |
+
|
10 |
+
function init_listeners( $callable ) {
|
11 |
+
add_action( 'created_term', array( $this, 'save_term_handler' ), 10, 3 );
|
12 |
+
add_action( 'edited_term', array( $this, 'save_term_handler' ), 10, 3 );
|
13 |
+
add_action( 'jetpack_sync_save_term', $callable, 10, 4 );
|
14 |
+
add_action( 'delete_term', $callable, 10, 4 );
|
15 |
+
add_action( 'set_object_terms', $callable, 10, 6 );
|
16 |
+
add_action( 'deleted_term_relationships', $callable, 10, 2 );
|
17 |
+
}
|
18 |
+
|
19 |
+
public function init_full_sync_listeners( $callable ) {
|
20 |
+
add_action( 'jetpack_full_sync_terms', $callable, 10, 2 );
|
21 |
+
}
|
22 |
+
|
23 |
+
function init_before_send() {
|
24 |
+
// full sync
|
25 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_terms', array( $this, 'expand_term_ids' ) );
|
26 |
+
}
|
27 |
+
|
28 |
+
function enqueue_full_sync_actions( $config ) {
|
29 |
+
global $wpdb;
|
30 |
+
|
31 |
+
$taxonomies = get_taxonomies();
|
32 |
+
$total_chunks_counter = 0;
|
33 |
+
foreach ( $taxonomies as $taxonomy ) {
|
34 |
+
// I hope this is never bigger than RAM...
|
35 |
+
$term_ids = $wpdb->get_col( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = %s", $taxonomy ) ); // Should we set a limit here?
|
36 |
+
// Request posts in groups of N for efficiency
|
37 |
+
$chunked_term_ids = array_chunk( $term_ids, self::ARRAY_CHUNK_SIZE );
|
38 |
+
|
39 |
+
// Send each chunk as an array of objects
|
40 |
+
foreach ( $chunked_term_ids as $chunk ) {
|
41 |
+
do_action( 'jetpack_full_sync_terms', $chunk, $taxonomy );
|
42 |
+
$total_chunks_counter ++;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
return $total_chunks_counter;
|
47 |
+
}
|
48 |
+
|
49 |
+
function estimate_full_sync_actions( $config ) {
|
50 |
+
// TODO - make this (and method above) more efficient for large numbers of terms or taxonomies
|
51 |
+
global $wpdb;
|
52 |
+
|
53 |
+
$taxonomies = get_taxonomies();
|
54 |
+
$total_chunks_counter = 0;
|
55 |
+
foreach ( $taxonomies as $taxonomy ) {
|
56 |
+
$total_ids = $wpdb->get_var( $wpdb->prepare( "SELECT count(term_id) FROM $wpdb->term_taxonomy WHERE taxonomy = %s", $taxonomy ) );
|
57 |
+
$total_chunks_counter += (int) ceil( $total_ids / self::ARRAY_CHUNK_SIZE );
|
58 |
+
}
|
59 |
+
|
60 |
+
return $total_chunks_counter;
|
61 |
+
}
|
62 |
+
|
63 |
+
function get_full_sync_actions() {
|
64 |
+
return array( 'jetpack_full_sync_terms' );
|
65 |
+
}
|
66 |
+
|
67 |
+
function save_term_handler( $term_id, $tt_id, $taxonomy ) {
|
68 |
+
if ( class_exists( 'WP_Term' ) ) {
|
69 |
+
$term_object = WP_Term::get_instance( $term_id, $taxonomy );
|
70 |
+
} else {
|
71 |
+
$term_object = get_term_by( 'id', $term_id, $taxonomy );
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Fires when the client needs to sync a new term
|
76 |
+
*
|
77 |
+
* @since 4.2.0
|
78 |
+
*
|
79 |
+
* @param object the Term object
|
80 |
+
*/
|
81 |
+
do_action( 'jetpack_sync_save_term', $term_object );
|
82 |
+
}
|
83 |
+
|
84 |
+
function set_taxonomy_whitelist( $taxonomies ) {
|
85 |
+
$this->taxonomy_whitelist = $taxonomies;
|
86 |
+
}
|
87 |
+
|
88 |
+
function set_defaults() {
|
89 |
+
$this->taxonomy_whitelist = Jetpack_Sync_Defaults::$default_taxonomy_whitelist;
|
90 |
+
}
|
91 |
+
|
92 |
+
public function expand_term_ids( $args ) {
|
93 |
+
global $wp_version;
|
94 |
+
$term_ids = $args[0];
|
95 |
+
$taxonomy = $args[1];
|
96 |
+
// version 4.5 or higher
|
97 |
+
if ( version_compare( $wp_version, 4.5, '>=' ) ) {
|
98 |
+
$terms = get_terms( array(
|
99 |
+
'taxonomy' => $taxonomy,
|
100 |
+
'hide_empty' => false,
|
101 |
+
'include' => $term_ids,
|
102 |
+
) );
|
103 |
+
} else {
|
104 |
+
$terms = get_terms( $taxonomy, array(
|
105 |
+
'hide_empty' => false,
|
106 |
+
'include' => $term_ids,
|
107 |
+
) );
|
108 |
+
}
|
109 |
+
|
110 |
+
return $terms;
|
111 |
+
}
|
112 |
+
}
|
sync/class.jetpack-sync-module-themes.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Themes extends Jetpack_Sync_Module {
|
4 |
+
function name() {
|
5 |
+
return 'themes';
|
6 |
+
}
|
7 |
+
|
8 |
+
public function init_listeners( $callable ) {
|
9 |
+
add_action( 'switch_theme', array( $this, 'sync_theme_support' ) );
|
10 |
+
add_action( 'jetpack_sync_current_theme_support', $callable );
|
11 |
+
}
|
12 |
+
|
13 |
+
public function init_full_sync_listeners( $callable ) {
|
14 |
+
add_action( 'jetpack_full_sync_theme_data', $callable );
|
15 |
+
}
|
16 |
+
|
17 |
+
public function sync_theme_support() {
|
18 |
+
/**
|
19 |
+
* Fires when the client needs to sync theme support info
|
20 |
+
* Only sends theme support attributes whitelisted in Jetpack_Sync_Defaults::$default_theme_support_whitelist
|
21 |
+
*
|
22 |
+
* @since 4.2.0
|
23 |
+
*
|
24 |
+
* @param object the theme support hash
|
25 |
+
*/
|
26 |
+
do_action( 'jetpack_sync_current_theme_support' , $this->get_theme_support_info() );
|
27 |
+
}
|
28 |
+
|
29 |
+
public function enqueue_full_sync_actions( $config ) {
|
30 |
+
/**
|
31 |
+
* Tells the client to sync all theme data to the server
|
32 |
+
*
|
33 |
+
* @since 4.2.0
|
34 |
+
*
|
35 |
+
* @param boolean Whether to expand theme data (should always be true)
|
36 |
+
*/
|
37 |
+
do_action( 'jetpack_full_sync_theme_data', true );
|
38 |
+
return 1; // The number of actions enqueued
|
39 |
+
}
|
40 |
+
|
41 |
+
public function estimate_full_sync_actions( $config ) {
|
42 |
+
return 1;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function init_before_send() {
|
46 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_theme_data', array( $this, 'expand_theme_data' ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
function get_full_sync_actions() {
|
50 |
+
return array( 'jetpack_full_sync_theme_data' );
|
51 |
+
}
|
52 |
+
|
53 |
+
function expand_theme_data() {
|
54 |
+
return array( $this->get_theme_support_info() );
|
55 |
+
}
|
56 |
+
|
57 |
+
private function get_theme_support_info() {
|
58 |
+
global $_wp_theme_features;
|
59 |
+
|
60 |
+
$theme_support = array();
|
61 |
+
|
62 |
+
foreach ( Jetpack_Sync_Defaults::$default_theme_support_whitelist as $theme_feature ) {
|
63 |
+
$has_support = current_theme_supports( $theme_feature );
|
64 |
+
if ( $has_support ) {
|
65 |
+
$theme_support[ $theme_feature ] = $_wp_theme_features[ $theme_feature ];
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
return $theme_support;
|
70 |
+
}
|
71 |
+
}
|
sync/class.jetpack-sync-module-updates.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Updates extends Jetpack_Sync_Module {
|
4 |
+
function name() {
|
5 |
+
return 'updates';
|
6 |
+
}
|
7 |
+
|
8 |
+
public function init_listeners( $callable ) {
|
9 |
+
add_action( 'set_site_transient_update_plugins', $callable, 10, 1 );
|
10 |
+
add_action( 'set_site_transient_update_themes', $callable, 10, 1 );
|
11 |
+
add_action( 'set_site_transient_update_core', $callable, 10, 1 );
|
12 |
+
|
13 |
+
add_filter( 'jetpack_sync_before_enqueue_set_site_transient_update_plugins', array(
|
14 |
+
$this,
|
15 |
+
'filter_update_keys',
|
16 |
+
), 10, 2 );
|
17 |
+
add_filter( 'jetpack_sync_before_enqueue_upgrader_process_complete', array(
|
18 |
+
$this,
|
19 |
+
'filter_upgrader_process_complete',
|
20 |
+
), 10, 2 );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function init_full_sync_listeners( $callable ) {
|
24 |
+
add_action( 'jetpack_full_sync_updates', $callable );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function init_before_send() {
|
28 |
+
// full sync
|
29 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_updates', array( $this, 'expand_updates' ) );
|
30 |
+
}
|
31 |
+
|
32 |
+
public function enqueue_full_sync_actions( $config ) {
|
33 |
+
/**
|
34 |
+
* Tells the client to sync all updates to the server
|
35 |
+
*
|
36 |
+
* @since 4.2.0
|
37 |
+
*
|
38 |
+
* @param boolean Whether to expand updates (should always be true)
|
39 |
+
*/
|
40 |
+
do_action( 'jetpack_full_sync_updates', true );
|
41 |
+
|
42 |
+
return 1; // The number of actions enqueued
|
43 |
+
}
|
44 |
+
|
45 |
+
public function estimate_full_sync_actions( $config ) {
|
46 |
+
return 1;
|
47 |
+
}
|
48 |
+
|
49 |
+
function get_full_sync_actions() {
|
50 |
+
return array( 'jetpack_full_sync_updates' );
|
51 |
+
}
|
52 |
+
|
53 |
+
public function get_all_updates() {
|
54 |
+
return array(
|
55 |
+
'core' => get_site_transient( 'update_core' ),
|
56 |
+
'plugins' => get_site_transient( 'update_plugins' ),
|
57 |
+
'themes' => get_site_transient( 'update_themes' ),
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
// removes unnecessary keys from synced updates data
|
62 |
+
function filter_update_keys( $args ) {
|
63 |
+
$updates = $args[0];
|
64 |
+
|
65 |
+
if ( isset( $updates->no_update ) ) {
|
66 |
+
unset( $updates->no_update );
|
67 |
+
}
|
68 |
+
|
69 |
+
return $args;
|
70 |
+
}
|
71 |
+
|
72 |
+
function filter_upgrader_process_complete( $args ) {
|
73 |
+
array_shift( $args );
|
74 |
+
|
75 |
+
return $args;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function expand_updates( $args ) {
|
79 |
+
if ( $args[0] ) {
|
80 |
+
return $this->get_all_updates();
|
81 |
+
}
|
82 |
+
|
83 |
+
return $args;
|
84 |
+
}
|
85 |
+
}
|
sync/class.jetpack-sync-module-users.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Jetpack_Sync_Module_Users extends Jetpack_Sync_Module {
|
4 |
+
function name() {
|
5 |
+
return 'users';
|
6 |
+
}
|
7 |
+
|
8 |
+
public function init_listeners( $callable ) {
|
9 |
+
// users
|
10 |
+
add_action( 'user_register', array( $this, 'save_user_handler' ) );
|
11 |
+
add_action( 'profile_update', array( $this, 'save_user_handler' ), 10, 2 );
|
12 |
+
add_action( 'add_user_to_blog', array( $this, 'save_user_handler' ) );
|
13 |
+
add_action( 'jetpack_sync_save_user', $callable, 10, 2 );
|
14 |
+
|
15 |
+
add_action( 'deleted_user', $callable, 10, 2 );
|
16 |
+
add_action( 'remove_user_from_blog', $callable, 10, 2 );
|
17 |
+
|
18 |
+
// user roles
|
19 |
+
add_action( 'add_user_role', array( $this, 'save_user_role_handler' ), 10, 2 );
|
20 |
+
add_action( 'set_user_role', array( $this, 'save_user_role_handler' ), 10, 3 );
|
21 |
+
add_action( 'remove_user_role', array( $this, 'save_user_role_handler' ), 10, 2 );
|
22 |
+
|
23 |
+
// user capabilities
|
24 |
+
add_action( 'added_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 );
|
25 |
+
add_action( 'updated_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 );
|
26 |
+
add_action( 'deleted_user_meta', array( $this, 'save_user_cap_handler' ), 10, 4 );
|
27 |
+
|
28 |
+
// user authentication
|
29 |
+
add_action( 'wp_login', $callable, 10, 2 );
|
30 |
+
add_action( 'wp_login_failed', $callable, 10, 2 );
|
31 |
+
add_action( 'wp_logout', $callable, 10, 0 );
|
32 |
+
}
|
33 |
+
|
34 |
+
public function init_full_sync_listeners( $callable ) {
|
35 |
+
add_action( 'jetpack_full_sync_users', $callable );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function init_before_send() {
|
39 |
+
add_filter( 'jetpack_sync_before_send_jetpack_sync_save_user', array( $this, 'expand_user' ) );
|
40 |
+
add_filter( 'jetpack_sync_before_send_wp_login', array( $this, 'expand_login_username' ), 10, 1 );
|
41 |
+
add_filter( 'jetpack_sync_before_send_wp_logout', array( $this, 'expand_logout_username' ), 10, 2 );
|
42 |
+
|
43 |
+
// full sync
|
44 |
+
add_filter( 'jetpack_sync_before_send_jetpack_full_sync_users', array( $this, 'expand_users' ) );
|
45 |
+
}
|
46 |
+
|
47 |
+
public function sanitize_user_and_expand( $user ) {
|
48 |
+
$user = $this->sanitize_user( $user );
|
49 |
+
|
50 |
+
return $this->add_to_user( $user );
|
51 |
+
}
|
52 |
+
|
53 |
+
public function sanitize_user( $user ) {
|
54 |
+
unset( $user->data->user_pass );
|
55 |
+
|
56 |
+
return $user;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function add_to_user( $user ) {
|
60 |
+
$user->allowed_mime_types = get_allowed_mime_types( $user );
|
61 |
+
|
62 |
+
return $user;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function expand_user( $args ) {
|
66 |
+
list( $user ) = $args;
|
67 |
+
|
68 |
+
if ( $user ) {
|
69 |
+
return array( $this->add_to_user( $user ) );
|
70 |
+
}
|
71 |
+
|
72 |
+
return false;
|
73 |
+
}
|
74 |
+
|
75 |
+
public function expand_login_username( $args ) {
|
76 |
+
list( $login, $user ) = $args;
|
77 |
+
$user = $this->sanitize_user( $user );
|
78 |
+
|
79 |
+
return array( $login, $user );
|
80 |
+
}
|
81 |
+
|
82 |
+
public function expand_logout_username( $args, $user_id ) {
|
83 |
+
$user = get_userdata( $user_id );
|
84 |
+
$user = $this->sanitize_user( $user );
|
85 |
+
$login = $user->data->user_login;
|
86 |
+
|
87 |
+
return array( $login, $user );
|
88 |
+
}
|
89 |
+
|
90 |
+
function save_user_handler( $user_id, $old_user_data = null ) {
|
91 |
+
|
92 |
+
// ensure we only sync users who are members of the current blog
|
93 |
+
if ( ! is_user_member_of_blog( $user_id, get_current_blog_id() ) ) {
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
|
97 |
+
$user = $this->sanitize_user( get_user_by( 'id', $user_id ) );
|
98 |
+
|
99 |
+
// Older versions of WP don't pass the old_user_data in ->data
|
100 |
+
if ( isset( $old_user_data->data ) ) {
|
101 |
+
$old_user = $old_user_data->data;
|
102 |
+
} else {
|
103 |
+
$old_user = $old_user_data;
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( $old_user !== null ) {
|
107 |
+
unset( $old_user->user_pass );
|
108 |
+
if ( serialize( $old_user ) === serialize( $user->data ) ) {
|
109 |
+
return;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
/**
|
113 |
+
* Fires when the client needs to sync an updated user
|
114 |
+
*
|
115 |
+
* @since 4.2.0
|
116 |
+
*
|
117 |
+
* @param object The WP_User object
|
118 |
+
*/
|
119 |
+
do_action( 'jetpack_sync_save_user', $user );
|
120 |
+
}
|
121 |
+
|
122 |
+
function save_user_role_handler( $user_id, $role, $old_roles = null ) {
|
123 |
+
$user = $this->sanitize_user( get_user_by( 'id', $user_id ) );
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Fires when the client needs to sync an updated user
|
127 |
+
*
|
128 |
+
* @since 4.2.0
|
129 |
+
*
|
130 |
+
* @param object The WP_User object
|
131 |
+
*/
|
132 |
+
do_action( 'jetpack_sync_save_user', $user );
|
133 |
+
}
|
134 |
+
|
135 |
+
function save_user_cap_handler( $meta_id, $user_id, $meta_key, $capabilities ) {
|
136 |
+
|
137 |
+
// if a user is currently being removed as a member of this blog, we don't fire the event
|
138 |
+
if ( current_filter() === 'deleted_user_meta'
|
139 |
+
&&
|
140 |
+
preg_match( '/capabilities|user_level/', $meta_key )
|
141 |
+
&&
|
142 |
+
! is_user_member_of_blog( $user_id, get_current_blog_id() )
|
143 |
+
) {
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
|
147 |
+
$user = $this->sanitize_user( get_user_by( 'id', $user_id ) );
|
148 |
+
if ( $meta_key === $user->cap_key ) {
|
149 |
+
/**
|
150 |
+
* Fires when the client needs to sync an updated user
|
151 |
+
*
|
152 |
+
* @since 4.2.0
|
153 |
+
*
|
154 |
+
* @param object The WP_User object
|
155 |
+
*/
|
156 |
+
do_action( 'jetpack_sync_save_user', $user );
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
public function enqueue_full_sync_actions( $config ) {
|
161 |
+
global $wpdb;
|
162 |
+
return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_users', $wpdb->users, 'ID', $this->get_where_sql( $config ) );
|
163 |
+
}
|
164 |
+
|
165 |
+
public function estimate_full_sync_actions( $config ) {
|
166 |
+
global $wpdb;
|
167 |
+
|
168 |
+
$query = "SELECT count(*) FROM $wpdb->users";
|
169 |
+
|
170 |
+
if ( $where_sql = $this->get_where_sql( $config ) ) {
|
171 |
+
$query .= ' WHERE ' . $where_sql;
|
172 |
+
}
|
173 |
+
|
174 |
+
$count = $wpdb->get_var( $query );
|
175 |
+
|
176 |
+
return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
|
177 |
+
}
|
178 |
+
|
179 |
+
private function get_where_sql( $config ) {
|
180 |
+
// config is a list of user IDs to sync
|
181 |
+
if ( is_array( $config ) ) {
|
182 |
+
return 'ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
|
183 |
+
}
|
184 |
+
|
185 |
+
return null;
|
186 |
+
}
|
187 |
+
|
188 |
+
function get_full_sync_actions() {
|
189 |
+
return array( 'jetpack_full_sync_users' );
|
190 |
+
}
|
191 |
+
|
192 |
+
public function expand_users( $args ) {
|
193 |
+
$user_ids = $args[0];
|
194 |
+
|
195 |
+
return array_map( array( $this, 'sanitize_user_and_expand' ), get_users( array( 'include' => $user_ids ) ) );
|
196 |
+
}
|
197 |
+
}
|
sync/class.jetpack-sync-module.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Basic methods implemented by Jetpack Sync extensions
|
5 |
+
*/
|
6 |
+
abstract class Jetpack_Sync_Module {
|
7 |
+
const ARRAY_CHUNK_SIZE = 10;
|
8 |
+
|
9 |
+
abstract public function name();
|
10 |
+
|
11 |
+
// override these to set up listeners and set/reset data/defaults
|
12 |
+
public function init_listeners( $callable ) {
|
13 |
+
}
|
14 |
+
|
15 |
+
public function init_full_sync_listeners( $callable ) {
|
16 |
+
}
|
17 |
+
|
18 |
+
public function init_before_send() {
|
19 |
+
}
|
20 |
+
|
21 |
+
public function set_defaults() {
|
22 |
+
}
|
23 |
+
|
24 |
+
public function reset_data() {
|
25 |
+
}
|
26 |
+
|
27 |
+
public function enqueue_full_sync_actions( $config ) {
|
28 |
+
// in subclasses, return the number of items enqueued
|
29 |
+
return 0;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function estimate_full_sync_actions( $config ) {
|
33 |
+
// in subclasses, return the number of items yet to be enqueued
|
34 |
+
return 0;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function get_full_sync_actions() {
|
38 |
+
return array();
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function count_actions( $action_names, $actions_to_count ) {
|
42 |
+
return count( array_intersect( $action_names, $actions_to_count ) );
|
43 |
+
}
|
44 |
+
|
45 |
+
protected function get_check_sum( $values ) {
|
46 |
+
return crc32( json_encode( $values ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function still_valid_checksum( $sums_to_check, $name, $new_sum ) {
|
50 |
+
if ( isset( $sums_to_check[ $name ] ) && $sums_to_check[ $name ] === $new_sum ) {
|
51 |
+
return true;
|
52 |
+
}
|
53 |
+
|
54 |
+
return false;
|
55 |
+
}
|
56 |
+
|
57 |
+
protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql ) {
|
58 |
+
global $wpdb;
|
59 |
+
|
60 |
+
if ( ! $where_sql ) {
|
61 |
+
$where_sql = '1 = 1';
|
62 |
+
}
|
63 |
+
|
64 |
+
$items_per_page = 1000;
|
65 |
+
$page = 1;
|
66 |
+
$chunk_count = 0;
|
67 |
+
$previous_id = 0;
|
68 |
+
while ( $ids = $wpdb->get_col( "SELECT {$id_field} FROM {$table_name} WHERE {$where_sql} AND {$id_field} > {$previous_id} ORDER BY {$id_field} ASC LIMIT {$items_per_page}" ) ) {
|
69 |
+
// Request posts in groups of N for efficiency
|
70 |
+
$chunked_ids = array_chunk( $ids, self::ARRAY_CHUNK_SIZE );
|
71 |
+
|
72 |
+
// Send each chunk as an array of objects
|
73 |
+
foreach ( $chunked_ids as $chunk ) {
|
74 |
+
/**
|
75 |
+
* Fires with a chunk of object IDs during full sync.
|
76 |
+
* These are expanded to full objects before upload
|
77 |
+
*
|
78 |
+
* @since 4.2.0
|
79 |
+
*/
|
80 |
+
do_action( $action_name, $chunk );
|
81 |
+
$chunk_count ++;
|
82 |
+
}
|
83 |
+
|
84 |
+
$page += 1;
|
85 |
+
$previous_id = end( $ids );
|
86 |
+
}
|
87 |
+
|
88 |
+
return $chunk_count;
|
89 |
+
}
|
90 |
+
|
91 |
+
protected function get_metadata( $ids, $meta_type ) {
|
92 |
+
global $wpdb;
|
93 |
+
$table = _get_meta_table( $meta_type );
|
94 |
+
$id = $meta_type . '_id';
|
95 |
+
if ( ! $table ) {
|
96 |
+
return array();
|
97 |
+
}
|
98 |
+
|
99 |
+
return array_map(
|
100 |
+
array( $this, 'unserialize_meta' ),
|
101 |
+
$wpdb->get_results( "SELECT $id, meta_key, meta_value, meta_id FROM $table WHERE $id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )', OBJECT )
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
+
protected function get_term_relationships( $ids ) {
|
106 |
+
global $wpdb;
|
107 |
+
|
108 |
+
return $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships WHERE object_id IN ( " . implode( ',', wp_parse_id_list( $ids ) ) . ' )', OBJECT );
|
109 |
+
}
|
110 |
+
|
111 |
+
public function unserialize_meta( $meta ) {
|
112 |
+
$meta->meta_value = maybe_unserialize( $meta->meta_value );
|
113 |
+
return $meta;
|
114 |
+
}
|
115 |
+
}
|
sync/class.jetpack-sync-modules.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* simple wrapper that allows enumerating cached static instances
|
5 |
+
* of sync modules
|
6 |
+
*/
|
7 |
+
|
8 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module.php';
|
9 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-posts.php';
|
10 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-comments.php';
|
11 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-constants.php';
|
12 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-callables.php';
|
13 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-options.php';
|
14 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-network-options.php';
|
15 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-updates.php';
|
16 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-users.php';
|
17 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-themes.php';
|
18 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-attachments.php';
|
19 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-meta.php';
|
20 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-terms.php';
|
21 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-plugins.php';
|
22 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-protect.php';
|
23 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-module-full-sync.php';
|
24 |
+
|
25 |
+
class Jetpack_Sync_Modules {
|
26 |
+
|
27 |
+
private static $default_sync_modules = array(
|
28 |
+
'Jetpack_Sync_Module_Constants',
|
29 |
+
'Jetpack_Sync_Module_Callables',
|
30 |
+
'Jetpack_Sync_Module_Options',
|
31 |
+
'Jetpack_Sync_Module_Network_Options',
|
32 |
+
'Jetpack_Sync_Module_Terms',
|
33 |
+
'Jetpack_Sync_Module_Themes',
|
34 |
+
'Jetpack_Sync_Module_Users',
|
35 |
+
'Jetpack_Sync_Module_Posts',
|
36 |
+
'Jetpack_Sync_Module_Comments',
|
37 |
+
'Jetpack_Sync_Module_Updates',
|
38 |
+
'Jetpack_Sync_Module_Attachments',
|
39 |
+
'Jetpack_Sync_Module_Meta',
|
40 |
+
'Jetpack_Sync_Module_Plugins',
|
41 |
+
'Jetpack_Sync_Module_Protect',
|
42 |
+
'Jetpack_Sync_Module_Full_Sync',
|
43 |
+
);
|
44 |
+
|
45 |
+
private static $initialized_modules = null;
|
46 |
+
|
47 |
+
public static function get_modules() {
|
48 |
+
if ( null === self::$initialized_modules ) {
|
49 |
+
self::$initialized_modules = self::initialize_modules();
|
50 |
+
}
|
51 |
+
|
52 |
+
return self::$initialized_modules;
|
53 |
+
}
|
54 |
+
|
55 |
+
public static function set_defaults() {
|
56 |
+
foreach ( self::get_modules() as $module ) {
|
57 |
+
$module->set_defaults();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
public static function get_module( $module_name ) {
|
62 |
+
foreach ( self::get_modules() as $module ) {
|
63 |
+
if ( $module->name() === $module_name ) {
|
64 |
+
return $module;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
return false;
|
69 |
+
}
|
70 |
+
|
71 |
+
static function initialize_modules() {
|
72 |
+
/**
|
73 |
+
* Filters the list of class names of sync modules.
|
74 |
+
* If you add to this list, make sure any classes implement the
|
75 |
+
* Jetpack_Sync_Module interface.
|
76 |
+
*
|
77 |
+
* @since 4.2.0
|
78 |
+
*/
|
79 |
+
$modules = apply_filters( 'jetpack_sync_modules', self::$default_sync_modules );
|
80 |
+
|
81 |
+
return array_map( array( 'Jetpack_Sync_Modules', 'initialize_module' ), $modules );
|
82 |
+
}
|
83 |
+
|
84 |
+
static function initialize_module( $module_name ) {
|
85 |
+
$module = new $module_name;
|
86 |
+
$module->set_defaults();
|
87 |
+
|
88 |
+
return $module;
|
89 |
+
}
|
90 |
+
}
|
sync/class.jetpack-sync-queue.php
ADDED
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* A buffer of items from the queue that can be checked out
|
5 |
+
*/
|
6 |
+
class Jetpack_Sync_Queue_Buffer {
|
7 |
+
public $id;
|
8 |
+
public $items_with_ids;
|
9 |
+
|
10 |
+
public function __construct( $id, $items_with_ids ) {
|
11 |
+
$this->id = $id;
|
12 |
+
$this->items_with_ids = $items_with_ids;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function get_items() {
|
16 |
+
return array_combine( $this->get_item_ids(), $this->get_item_values() );
|
17 |
+
}
|
18 |
+
|
19 |
+
public function get_item_values() {
|
20 |
+
return Jetpack_Sync_Utils::get_item_values( $this->items_with_ids );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function get_item_ids() {
|
24 |
+
return Jetpack_Sync_Utils::get_item_ids( $this->items_with_ids );
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* A persistent queue that can be flushed in increments of N items,
|
30 |
+
* and which blocks reads until checked-out buffers are checked in or
|
31 |
+
* closed. This uses raw SQL for two reasons: speed, and not triggering
|
32 |
+
* tons of added_option callbacks.
|
33 |
+
*/
|
34 |
+
class Jetpack_Sync_Queue {
|
35 |
+
public $id;
|
36 |
+
private $row_iterator;
|
37 |
+
|
38 |
+
function __construct( $id ) {
|
39 |
+
$this->id = str_replace( '-', '_', $id ); // necessary to ensure we don't have ID collisions in the SQL
|
40 |
+
$this->row_iterator = 0;
|
41 |
+
}
|
42 |
+
|
43 |
+
function add( $item ) {
|
44 |
+
global $wpdb;
|
45 |
+
$added = false;
|
46 |
+
// this basically tries to add the option until enough time has elapsed that
|
47 |
+
// it has a unique (microtime-based) option key
|
48 |
+
while ( ! $added ) {
|
49 |
+
$rows_added = $wpdb->query( $wpdb->prepare(
|
50 |
+
"INSERT INTO $wpdb->options (option_name, option_value,autoload) VALUES (%s, %s,%s)",
|
51 |
+
$this->get_next_data_row_option_name(),
|
52 |
+
serialize( $item ),
|
53 |
+
'no'
|
54 |
+
) );
|
55 |
+
$added = ( 0 !== $rows_added );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
// Attempts to insert all the items in a single SQL query. May be subject to query size limits!
|
60 |
+
function add_all( $items ) {
|
61 |
+
global $wpdb;
|
62 |
+
$base_option_name = $this->get_next_data_row_option_name();
|
63 |
+
|
64 |
+
$query = "INSERT INTO $wpdb->options (option_name, option_value,autoload) VALUES ";
|
65 |
+
|
66 |
+
$rows = array();
|
67 |
+
|
68 |
+
for ( $i = 0; $i < count( $items ); $i += 1 ) {
|
69 |
+
$option_name = esc_sql( $base_option_name . '-' . $i );
|
70 |
+
$option_value = esc_sql( serialize( $items[ $i ] ) );
|
71 |
+
$rows[] = "('$option_name', '$option_value', 'no')";
|
72 |
+
}
|
73 |
+
|
74 |
+
$rows_added = $wpdb->query( $query . join( ',', $rows ) );
|
75 |
+
|
76 |
+
if ( count( $items ) === $rows_added ) {
|
77 |
+
return new WP_Error( 'row_count_mismatch', "The number of rows inserted didn't match the size of the input array" );
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
// Peek at the front-most item on the queue without checking it out
|
82 |
+
function peek( $count = 1 ) {
|
83 |
+
$items = $this->fetch_items( $count );
|
84 |
+
if ( $items ) {
|
85 |
+
return Jetpack_Sync_Utils::get_item_values( $items );
|
86 |
+
}
|
87 |
+
|
88 |
+
return array();
|
89 |
+
}
|
90 |
+
|
91 |
+
// lag is the difference in time between the age of the oldest item
|
92 |
+
// (aka first or frontmost item) and the current time
|
93 |
+
function lag() {
|
94 |
+
return self::get_lag( $this->id );
|
95 |
+
}
|
96 |
+
|
97 |
+
static function get_lag( $id ) {
|
98 |
+
global $wpdb;
|
99 |
+
|
100 |
+
$first_item_name = $wpdb->get_var( $wpdb->prepare(
|
101 |
+
"SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT 1",
|
102 |
+
"jpsq_{$id}-%"
|
103 |
+
) );
|
104 |
+
|
105 |
+
if ( ! $first_item_name ) {
|
106 |
+
return 0;
|
107 |
+
}
|
108 |
+
|
109 |
+
// break apart the item name to get the timestamp
|
110 |
+
$matches = null;
|
111 |
+
if ( preg_match( '/^jpsq_' . $id . '-(\d+\.\d+)-/', $first_item_name, $matches ) ) {
|
112 |
+
return microtime( true ) - floatval( $matches[1] );
|
113 |
+
} else {
|
114 |
+
return 0;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
function reset() {
|
119 |
+
global $wpdb;
|
120 |
+
$this->delete_checkout_id();
|
121 |
+
$wpdb->query( $wpdb->prepare(
|
122 |
+
"DELETE FROM $wpdb->options WHERE option_name LIKE %s", "jpsq_{$this->id}-%"
|
123 |
+
) );
|
124 |
+
}
|
125 |
+
|
126 |
+
function size() {
|
127 |
+
global $wpdb;
|
128 |
+
|
129 |
+
return (int) $wpdb->get_var( $wpdb->prepare(
|
130 |
+
"SELECT count(*) FROM $wpdb->options WHERE option_name LIKE %s", "jpsq_{$this->id}-%"
|
131 |
+
) );
|
132 |
+
}
|
133 |
+
|
134 |
+
// we use this peculiar implementation because it's much faster than count(*)
|
135 |
+
function has_any_items() {
|
136 |
+
global $wpdb;
|
137 |
+
$value = $wpdb->get_var( $wpdb->prepare(
|
138 |
+
"SELECT exists( SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s )", "jpsq_{$this->id}-%"
|
139 |
+
) );
|
140 |
+
|
141 |
+
return ( $value === '1' );
|
142 |
+
}
|
143 |
+
|
144 |
+
function checkout( $buffer_size ) {
|
145 |
+
if ( $this->get_checkout_id() ) {
|
146 |
+
return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' );
|
147 |
+
}
|
148 |
+
|
149 |
+
$buffer_id = uniqid();
|
150 |
+
|
151 |
+
$result = $this->set_checkout_id( $buffer_id );
|
152 |
+
|
153 |
+
if ( ! $result || is_wp_error( $result ) ) {
|
154 |
+
return $result;
|
155 |
+
}
|
156 |
+
|
157 |
+
$items = $this->fetch_items( $buffer_size );
|
158 |
+
|
159 |
+
if ( count( $items ) === 0 ) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
+
$buffer = new Jetpack_Sync_Queue_Buffer( $buffer_id, array_slice( $items, 0, $buffer_size ) );
|
164 |
+
|
165 |
+
return $buffer;
|
166 |
+
}
|
167 |
+
|
168 |
+
// this checks out rows until it either empties the queue or hits a certain memory limit
|
169 |
+
// it loads the sizes from the DB first so that it doesn't accidentally
|
170 |
+
// load more data into memory than it needs to.
|
171 |
+
// The only way it will load more items than $max_size is if a single queue item
|
172 |
+
// exceeds the memory limit, but in that case it will send that item by itself.
|
173 |
+
function checkout_with_memory_limit( $max_memory, $max_buffer_size = 500 ) {
|
174 |
+
if ( $this->get_checkout_id() ) {
|
175 |
+
return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' );
|
176 |
+
}
|
177 |
+
|
178 |
+
$buffer_id = uniqid();
|
179 |
+
|
180 |
+
$result = $this->set_checkout_id( $buffer_id );
|
181 |
+
|
182 |
+
if ( ! $result || is_wp_error( $result ) ) {
|
183 |
+
return $result;
|
184 |
+
}
|
185 |
+
|
186 |
+
// get the map of buffer_id -> memory_size
|
187 |
+
global $wpdb;
|
188 |
+
|
189 |
+
$items_with_size = $wpdb->get_results(
|
190 |
+
$wpdb->prepare(
|
191 |
+
"SELECT option_name AS id, LENGTH(option_value) AS value_size FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d",
|
192 |
+
"jpsq_{$this->id}-%",
|
193 |
+
$max_buffer_size
|
194 |
+
),
|
195 |
+
OBJECT
|
196 |
+
);
|
197 |
+
|
198 |
+
$total_memory = 0;
|
199 |
+
$item_ids = array();
|
200 |
+
|
201 |
+
foreach ( $items_with_size as $item_with_size ) {
|
202 |
+
$total_memory += $item_with_size->value_size;
|
203 |
+
|
204 |
+
// if this is the first item and it exceeds memory, allow loop to continue
|
205 |
+
// we will exit on the next iteration instead
|
206 |
+
if ( $total_memory > $max_memory && count( $item_ids ) > 0 ) {
|
207 |
+
break;
|
208 |
+
}
|
209 |
+
$item_ids[] = $item_with_size->id;
|
210 |
+
}
|
211 |
+
|
212 |
+
$items = $this->fetch_items_by_id( $item_ids );
|
213 |
+
|
214 |
+
if ( count( $items ) === 0 ) {
|
215 |
+
$this->delete_checkout_id();
|
216 |
+
|
217 |
+
return false;
|
218 |
+
}
|
219 |
+
|
220 |
+
$buffer = new Jetpack_Sync_Queue_Buffer( $buffer_id, $items );
|
221 |
+
|
222 |
+
return $buffer;
|
223 |
+
}
|
224 |
+
|
225 |
+
function checkin( $buffer ) {
|
226 |
+
$is_valid = $this->validate_checkout( $buffer );
|
227 |
+
|
228 |
+
if ( is_wp_error( $is_valid ) ) {
|
229 |
+
return $is_valid;
|
230 |
+
}
|
231 |
+
|
232 |
+
$this->delete_checkout_id();
|
233 |
+
|
234 |
+
return true;
|
235 |
+
}
|
236 |
+
|
237 |
+
function close( $buffer, $ids_to_remove = null ) {
|
238 |
+
$is_valid = $this->validate_checkout( $buffer );
|
239 |
+
|
240 |
+
if ( is_wp_error( $is_valid ) ) {
|
241 |
+
return $is_valid;
|
242 |
+
}
|
243 |
+
|
244 |
+
$this->delete_checkout_id();
|
245 |
+
|
246 |
+
// by default clear all items in the buffer
|
247 |
+
if ( is_null( $ids_to_remove ) ) {
|
248 |
+
$ids_to_remove = $buffer->get_item_ids();
|
249 |
+
}
|
250 |
+
|
251 |
+
global $wpdb;
|
252 |
+
|
253 |
+
if ( count( $ids_to_remove ) > 0 ) {
|
254 |
+
$sql = "DELETE FROM $wpdb->options WHERE option_name IN (" . implode( ', ', array_fill( 0, count( $ids_to_remove ), '%s' ) ) . ')';
|
255 |
+
$query = call_user_func_array( array( $wpdb, 'prepare' ), array_merge( array( $sql ), $ids_to_remove ) );
|
256 |
+
$wpdb->query( $query );
|
257 |
+
}
|
258 |
+
|
259 |
+
return true;
|
260 |
+
}
|
261 |
+
|
262 |
+
function flush_all() {
|
263 |
+
$items = Jetpack_Sync_Utils::get_item_values( $this->fetch_items() );
|
264 |
+
$this->reset();
|
265 |
+
|
266 |
+
return $items;
|
267 |
+
}
|
268 |
+
|
269 |
+
function get_all() {
|
270 |
+
return $this->fetch_items();
|
271 |
+
}
|
272 |
+
|
273 |
+
// use with caution, this could allow multiple processes to delete
|
274 |
+
// and send from the queue at the same time
|
275 |
+
function force_checkin() {
|
276 |
+
$this->delete_checkout_id();
|
277 |
+
}
|
278 |
+
|
279 |
+
// used to lock checkouts from the queue.
|
280 |
+
// tries to wait up to $timeout seconds for the queue to be empty
|
281 |
+
function lock( $timeout = 30 ) {
|
282 |
+
$tries = 0;
|
283 |
+
|
284 |
+
while ( $this->has_any_items() && $tries < $timeout ) {
|
285 |
+
sleep( 1 );
|
286 |
+
$tries += 1;
|
287 |
+
}
|
288 |
+
|
289 |
+
if ( $tries === 30 ) {
|
290 |
+
return new WP_Error( 'lock_timeout', 'Timeout waiting for sync queue to empty' );
|
291 |
+
}
|
292 |
+
|
293 |
+
if ( $this->get_checkout_id() ) {
|
294 |
+
return new WP_Error( 'unclosed_buffer', 'There is an unclosed buffer' );
|
295 |
+
}
|
296 |
+
|
297 |
+
// hopefully this means we can acquire a checkout?
|
298 |
+
$result = $this->set_checkout_id( 'lock' );
|
299 |
+
|
300 |
+
if ( ! $result || is_wp_error( $result ) ) {
|
301 |
+
return $result;
|
302 |
+
}
|
303 |
+
|
304 |
+
return true;
|
305 |
+
}
|
306 |
+
|
307 |
+
function unlock() {
|
308 |
+
$this->delete_checkout_id();
|
309 |
+
}
|
310 |
+
|
311 |
+
private function get_checkout_id() {
|
312 |
+
return get_transient( $this->get_checkout_transient_name() );
|
313 |
+
}
|
314 |
+
|
315 |
+
private function set_checkout_id( $checkout_id ) {
|
316 |
+
return set_transient( $this->get_checkout_transient_name(), $checkout_id, 5 * 60 ); // 5 minute timeout
|
317 |
+
}
|
318 |
+
|
319 |
+
private function delete_checkout_id() {
|
320 |
+
delete_transient( $this->get_checkout_transient_name() );
|
321 |
+
}
|
322 |
+
|
323 |
+
private function get_checkout_transient_name() {
|
324 |
+
return "jpsq_{$this->id}_checkout";
|
325 |
+
}
|
326 |
+
|
327 |
+
private function get_next_data_row_option_name() {
|
328 |
+
// this option is specifically chosen to, as much as possible, preserve time order
|
329 |
+
// and minimise the possibility of collisions between multiple processes working
|
330 |
+
// at the same time
|
331 |
+
// TODO: confirm we only need to support PHP 5.05+ (otherwise we'll need to emulate microtime as float, and avoid PHP_INT_MAX)
|
332 |
+
// @see: http://php.net/manual/en/function.microtime.php
|
333 |
+
$timestamp = sprintf( '%.6f', microtime( true ) );
|
334 |
+
|
335 |
+
// row iterator is used to avoid collisions where we're writing data waaay fast in a single process
|
336 |
+
if ( $this->row_iterator === PHP_INT_MAX ) {
|
337 |
+
$this->row_iterator = 0;
|
338 |
+
} else {
|
339 |
+
$this->row_iterator += 1;
|
340 |
+
}
|
341 |
+
|
342 |
+
return 'jpsq_' . $this->id . '-' . $timestamp . '-' . getmypid() . '-' . $this->row_iterator;
|
343 |
+
}
|
344 |
+
|
345 |
+
private function fetch_items( $limit = null ) {
|
346 |
+
global $wpdb;
|
347 |
+
|
348 |
+
if ( $limit ) {
|
349 |
+
$query_sql = $wpdb->prepare( "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC LIMIT %d", "jpsq_{$this->id}-%", $limit );
|
350 |
+
} else {
|
351 |
+
$query_sql = $wpdb->prepare( "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name LIKE %s ORDER BY option_name ASC", "jpsq_{$this->id}-%" );
|
352 |
+
}
|
353 |
+
|
354 |
+
$items = $wpdb->get_results( $query_sql, OBJECT );
|
355 |
+
foreach ( $items as $item ) {
|
356 |
+
$item->value = maybe_unserialize( $item->value );
|
357 |
+
}
|
358 |
+
|
359 |
+
return $items;
|
360 |
+
}
|
361 |
+
|
362 |
+
private function fetch_items_by_id( $item_ids ) {
|
363 |
+
global $wpdb;
|
364 |
+
|
365 |
+
if ( count( $item_ids ) > 0 ) {
|
366 |
+
$sql = "SELECT option_name AS id, option_value AS value FROM $wpdb->options WHERE option_name IN (" . implode( ', ', array_fill( 0, count( $item_ids ), '%s' ) ) . ') ORDER BY option_name ASC';
|
367 |
+
$query = call_user_func_array( array( $wpdb, 'prepare' ), array_merge( array( $sql ), $item_ids ) );
|
368 |
+
$items = $wpdb->get_results( $query, OBJECT );
|
369 |
+
foreach ( $items as $item ) {
|
370 |
+
$item->value = maybe_unserialize( $item->value );
|
371 |
+
}
|
372 |
+
|
373 |
+
return $items;
|
374 |
+
} else {
|
375 |
+
return array();
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
private function validate_checkout( $buffer ) {
|
380 |
+
if ( ! $buffer instanceof Jetpack_Sync_Queue_Buffer ) {
|
381 |
+
return new WP_Error( 'not_a_buffer', 'You must checkin an instance of Jetpack_Sync_Queue_Buffer' );
|
382 |
+
}
|
383 |
+
|
384 |
+
$checkout_id = $this->get_checkout_id();
|
385 |
+
|
386 |
+
if ( ! $checkout_id ) {
|
387 |
+
return new WP_Error( 'buffer_not_checked_out', 'There are no checked out buffers' );
|
388 |
+
}
|
389 |
+
|
390 |
+
if ( $checkout_id != $buffer->id ) {
|
391 |
+
return new WP_Error( 'buffer_mismatch', 'The buffer you checked in was not checked out' );
|
392 |
+
}
|
393 |
+
|
394 |
+
return true;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
class Jetpack_Sync_Utils {
|
399 |
+
|
400 |
+
static function get_item_values( $items ) {
|
401 |
+
return array_map( array( __CLASS__, 'get_item_value' ), $items );
|
402 |
+
}
|
403 |
+
|
404 |
+
static function get_item_ids( $items ) {
|
405 |
+
return array_map( array( __CLASS__, 'get_item_id' ), $items );
|
406 |
+
}
|
407 |
+
|
408 |
+
static private function get_item_value( $item ) {
|
409 |
+
return $item->value;
|
410 |
+
}
|
411 |
+
|
412 |
+
static private function get_item_id( $item ) {
|
413 |
+
return $item->id;
|
414 |
+
}
|
415 |
+
}
|
sync/class.jetpack-sync-sender.php
ADDED
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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dirname( __FILE__ ) . '/class.jetpack-sync-json-deflate-codec.php';
|
6 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-modules.php';
|
7 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-settings.php';
|
8 |
+
|
9 |
+
/**
|
10 |
+
* This class grabs pending actions from the queue and sends them
|
11 |
+
*/
|
12 |
+
class Jetpack_Sync_Sender {
|
13 |
+
|
14 |
+
const SYNC_THROTTLE_OPTION_NAME = 'jetpack_sync_min_wait';
|
15 |
+
const NEXT_SYNC_TIME_OPTION_NAME = 'jetpack_next_sync_time';
|
16 |
+
const WPCOM_ERROR_SYNC_DELAY = 60;
|
17 |
+
|
18 |
+
private $dequeue_max_bytes;
|
19 |
+
private $upload_max_bytes;
|
20 |
+
private $upload_max_rows;
|
21 |
+
private $sync_wait_time;
|
22 |
+
private $sync_wait_threshold;
|
23 |
+
private $sync_queue;
|
24 |
+
private $full_sync_queue;
|
25 |
+
private $codec;
|
26 |
+
|
27 |
+
// singleton functions
|
28 |
+
private static $instance;
|
29 |
+
|
30 |
+
public static function get_instance() {
|
31 |
+
if ( null === self::$instance ) {
|
32 |
+
self::$instance = new self();
|
33 |
+
}
|
34 |
+
|
35 |
+
return self::$instance;
|
36 |
+
}
|
37 |
+
|
38 |
+
// this is necessary because you can't use "new" when you declare instance properties >:(
|
39 |
+
protected function __construct() {
|
40 |
+
$this->set_defaults();
|
41 |
+
$this->init();
|
42 |
+
}
|
43 |
+
|
44 |
+
private function init() {
|
45 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
46 |
+
$module->init_before_send();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function get_next_sync_time() {
|
51 |
+
return (double) get_option( self::NEXT_SYNC_TIME_OPTION_NAME, 0 );
|
52 |
+
}
|
53 |
+
|
54 |
+
public function set_next_sync_time( $time ) {
|
55 |
+
return update_option( self::NEXT_SYNC_TIME_OPTION_NAME, $time, true );
|
56 |
+
}
|
57 |
+
|
58 |
+
public function do_sync() {
|
59 |
+
// don't sync if importing
|
60 |
+
if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
// don't sync if we are throttled
|
65 |
+
if ( $this->get_next_sync_time() > microtime( true ) ) {
|
66 |
+
return false;
|
67 |
+
}
|
68 |
+
|
69 |
+
$start_time = microtime( true );
|
70 |
+
|
71 |
+
$full_sync_result = $this->do_sync_for_queue( $this->full_sync_queue );
|
72 |
+
$sync_result = $this->do_sync_for_queue( $this->sync_queue );
|
73 |
+
|
74 |
+
$exceeded_sync_wait_threshold = ( microtime( true ) - $start_time ) > (double) $this->get_sync_wait_threshold();
|
75 |
+
|
76 |
+
if ( is_wp_error( $full_sync_result ) || is_wp_error( $sync_result ) ) {
|
77 |
+
$this->set_next_sync_time( time() + self::WPCOM_ERROR_SYNC_DELAY );
|
78 |
+
$full_sync_result = false;
|
79 |
+
$sync_result = false;
|
80 |
+
} elseif ( $exceeded_sync_wait_threshold ) {
|
81 |
+
// if we actually sent data and it took a while, wait before sending again
|
82 |
+
$this->set_next_sync_time( time() + $this->get_sync_wait_time() );
|
83 |
+
}
|
84 |
+
|
85 |
+
// we use OR here because if either one returns true then the caller should
|
86 |
+
// be allowed to call do_sync again, as there may be more items
|
87 |
+
return $full_sync_result || $sync_result;
|
88 |
+
}
|
89 |
+
|
90 |
+
public function do_sync_for_queue( $queue ) {
|
91 |
+
|
92 |
+
do_action( 'jetpack_sync_before_send_queue_' . $queue->id );
|
93 |
+
|
94 |
+
if ( $queue->size() === 0 ) {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
|
98 |
+
// now that we're sure we are about to sync, try to
|
99 |
+
// ignore user abort so we can avoid getting into a
|
100 |
+
// bad state
|
101 |
+
if ( function_exists( 'ignore_user_abort' ) ) {
|
102 |
+
ignore_user_abort( true );
|
103 |
+
}
|
104 |
+
|
105 |
+
$buffer = $queue->checkout_with_memory_limit( $this->dequeue_max_bytes, $this->upload_max_rows );
|
106 |
+
|
107 |
+
if ( ! $buffer ) {
|
108 |
+
// buffer has no items
|
109 |
+
return false;
|
110 |
+
}
|
111 |
+
|
112 |
+
if ( is_wp_error( $buffer ) ) {
|
113 |
+
// another buffer is currently sending
|
114 |
+
return false;
|
115 |
+
}
|
116 |
+
|
117 |
+
$upload_size = 0;
|
118 |
+
$items_to_send = array();
|
119 |
+
$items = $buffer->get_items();
|
120 |
+
|
121 |
+
// set up current screen to avoid errors rendering content
|
122 |
+
require_once(ABSPATH . 'wp-admin/includes/class-wp-screen.php');
|
123 |
+
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
124 |
+
set_current_screen( 'sync' );
|
125 |
+
|
126 |
+
$skipped_items_ids = array();
|
127 |
+
|
128 |
+
// we estimate the total encoded size as we go by encoding each item individually
|
129 |
+
// this is expensive, but the only way to really know :/
|
130 |
+
foreach ( $items as $key => $item ) {
|
131 |
+
/**
|
132 |
+
* Modify the data within an action before it is serialized and sent to the server
|
133 |
+
* For example, during full sync this expands Post ID's into full Post objects,
|
134 |
+
* so that we don't have to serialize the whole object into the queue.
|
135 |
+
*
|
136 |
+
* @since 4.2.0
|
137 |
+
*
|
138 |
+
* @param array The action parameters
|
139 |
+
* @param int The ID of the user who triggered the action
|
140 |
+
*/
|
141 |
+
$item[1] = apply_filters( 'jetpack_sync_before_send_' . $item[0], $item[1], $item[2] );
|
142 |
+
|
143 |
+
if ( $item[1] === false ) {
|
144 |
+
$skipped_items_ids[] = $key;
|
145 |
+
continue;
|
146 |
+
}
|
147 |
+
|
148 |
+
$encoded_item = $this->codec->encode( $item );
|
149 |
+
|
150 |
+
$upload_size += strlen( $encoded_item );
|
151 |
+
|
152 |
+
if ( $upload_size > $this->upload_max_bytes && count( $items_to_send ) > 0 ) {
|
153 |
+
break;
|
154 |
+
}
|
155 |
+
|
156 |
+
$items_to_send[ $key ] = $encoded_item;
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Fires when data is ready to send to the server.
|
161 |
+
* Return false or WP_Error to abort the sync (e.g. if there's an error)
|
162 |
+
* The items will be automatically re-sent later
|
163 |
+
*
|
164 |
+
* @since 4.2.0
|
165 |
+
*
|
166 |
+
* @param array $data The action buffer
|
167 |
+
* @param string $codec The codec name used to encode the data
|
168 |
+
* @param double $time The current time
|
169 |
+
* @param string $queue The queue used to send ('sync' or 'full_sync')
|
170 |
+
*/
|
171 |
+
$processed_item_ids = apply_filters( 'jetpack_sync_send_data', $items_to_send, $this->codec->name(), microtime( true ), $queue->id );
|
172 |
+
|
173 |
+
if ( ! $processed_item_ids || is_wp_error( $processed_item_ids ) ) {
|
174 |
+
$checked_in_item_ids = $queue->checkin( $buffer );
|
175 |
+
|
176 |
+
if ( is_wp_error( $checked_in_item_ids ) ) {
|
177 |
+
error_log( 'Error checking in buffer: ' . $checked_in_item_ids->get_error_message() );
|
178 |
+
$queue->force_checkin();
|
179 |
+
}
|
180 |
+
|
181 |
+
if ( is_wp_error( $processed_item_ids ) ) {
|
182 |
+
return $processed_item_ids;
|
183 |
+
}
|
184 |
+
|
185 |
+
// returning a WP_Error is a sign to the caller that we should wait a while
|
186 |
+
// before syncing again
|
187 |
+
return new WP_Error( 'server_error' );
|
188 |
+
|
189 |
+
} else {
|
190 |
+
|
191 |
+
// detect if the last item ID was an error
|
192 |
+
$had_wp_error = is_wp_error( end( $processed_item_ids ) );
|
193 |
+
|
194 |
+
if ( $had_wp_error ) {
|
195 |
+
$wp_error = array_pop( $processed_item_ids );
|
196 |
+
}
|
197 |
+
|
198 |
+
// also checkin any items that were skipped
|
199 |
+
if ( count( $skipped_items_ids ) > 0 ) {
|
200 |
+
$processed_item_ids = array_merge( $processed_item_ids, $skipped_items_ids );
|
201 |
+
}
|
202 |
+
|
203 |
+
$processed_items = array_intersect_key( $items, array_flip( $processed_item_ids ) );
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Allows us to keep track of all the actions that have been sent.
|
207 |
+
* Allows us to calculate the progress of specific actions.
|
208 |
+
*
|
209 |
+
* @since 4.2.0
|
210 |
+
*
|
211 |
+
* @param array $processed_actions The actions that we send successfully.
|
212 |
+
*/
|
213 |
+
do_action( 'jetpack_sync_processed_actions', $processed_items );
|
214 |
+
|
215 |
+
$queue->close( $buffer, $processed_item_ids );
|
216 |
+
|
217 |
+
// returning a WP_Error is a sign to the caller that we should wait a while
|
218 |
+
// before syncing again
|
219 |
+
if ( $had_wp_error ) {
|
220 |
+
return $wp_error;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
return true;
|
225 |
+
}
|
226 |
+
|
227 |
+
function get_sync_queue() {
|
228 |
+
return $this->sync_queue;
|
229 |
+
}
|
230 |
+
|
231 |
+
function get_full_sync_queue() {
|
232 |
+
return $this->full_sync_queue;
|
233 |
+
}
|
234 |
+
|
235 |
+
function get_codec() {
|
236 |
+
return $this->codec;
|
237 |
+
}
|
238 |
+
|
239 |
+
function send_checksum() {
|
240 |
+
require_once 'class.jetpack-sync-wp-replicastore.php';
|
241 |
+
$store = new Jetpack_Sync_WP_Replicastore();
|
242 |
+
do_action( 'jetpack_sync_checksum', $store->checksum_all() );
|
243 |
+
}
|
244 |
+
|
245 |
+
function reset_sync_queue() {
|
246 |
+
$this->sync_queue->reset();
|
247 |
+
}
|
248 |
+
|
249 |
+
function set_dequeue_max_bytes( $size ) {
|
250 |
+
$this->dequeue_max_bytes = $size;
|
251 |
+
}
|
252 |
+
|
253 |
+
// in bytes
|
254 |
+
function set_upload_max_bytes( $max_bytes ) {
|
255 |
+
$this->upload_max_bytes = $max_bytes;
|
256 |
+
}
|
257 |
+
|
258 |
+
// in rows
|
259 |
+
function set_upload_max_rows( $max_rows ) {
|
260 |
+
$this->upload_max_rows = $max_rows;
|
261 |
+
}
|
262 |
+
|
263 |
+
// in seconds
|
264 |
+
function set_sync_wait_time( $seconds ) {
|
265 |
+
$this->sync_wait_time = $seconds;
|
266 |
+
}
|
267 |
+
|
268 |
+
function get_sync_wait_time() {
|
269 |
+
return $this->sync_wait_time;
|
270 |
+
}
|
271 |
+
|
272 |
+
// in seconds
|
273 |
+
function set_sync_wait_threshold( $seconds ) {
|
274 |
+
$this->sync_wait_threshold = $seconds;
|
275 |
+
}
|
276 |
+
|
277 |
+
function get_sync_wait_threshold() {
|
278 |
+
return $this->sync_wait_threshold;
|
279 |
+
}
|
280 |
+
|
281 |
+
function set_defaults() {
|
282 |
+
$this->sync_queue = new Jetpack_Sync_Queue( 'sync' );
|
283 |
+
$this->full_sync_queue = new Jetpack_Sync_Queue( 'full_sync' );
|
284 |
+
$this->codec = new Jetpack_Sync_JSON_Deflate_Codec();
|
285 |
+
|
286 |
+
// saved settings
|
287 |
+
Jetpack_Sync_Settings::set_importing( null );
|
288 |
+
$settings = Jetpack_Sync_Settings::get_settings();
|
289 |
+
$this->set_dequeue_max_bytes( $settings['dequeue_max_bytes'] );
|
290 |
+
$this->set_upload_max_bytes( $settings['upload_max_bytes'] );
|
291 |
+
$this->set_upload_max_rows( $settings['upload_max_rows'] );
|
292 |
+
$this->set_sync_wait_time( $settings['sync_wait_time'] );
|
293 |
+
$this->set_sync_wait_threshold( $settings['sync_wait_threshold'] );
|
294 |
+
}
|
295 |
+
|
296 |
+
function reset_data() {
|
297 |
+
$this->reset_sync_queue();
|
298 |
+
|
299 |
+
foreach ( Jetpack_Sync_Modules::get_modules() as $module ) {
|
300 |
+
$module->reset_data();
|
301 |
+
}
|
302 |
+
|
303 |
+
delete_option( self::SYNC_THROTTLE_OPTION_NAME );
|
304 |
+
delete_option( self::NEXT_SYNC_TIME_OPTION_NAME );
|
305 |
+
|
306 |
+
Jetpack_Sync_Settings::reset_data();
|
307 |
+
}
|
308 |
+
|
309 |
+
function uninstall() {
|
310 |
+
// Lets delete all the other fun stuff like transient and option and the sync queue
|
311 |
+
$this->reset_data();
|
312 |
+
|
313 |
+
// delete the full sync status
|
314 |
+
delete_option( 'jetpack_full_sync_status' );
|
315 |
+
|
316 |
+
// clear the sync cron.
|
317 |
+
wp_clear_scheduled_hook( 'jetpack_sync_cron' );
|
318 |
+
|
319 |
+
// clear the checksum cron
|
320 |
+
wp_clear_scheduled_hook( 'jetpack_send_db_checksum' );
|
321 |
+
}
|
322 |
+
}
|
sync/class.jetpack-sync-server.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-json-deflate-codec.php';
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Simple version of a Jetpack Sync Server - just receives arrays of events and
|
7 |
+
* issues them locally with the 'jetpack_sync_remote_action' action.
|
8 |
+
*/
|
9 |
+
class Jetpack_Sync_Server {
|
10 |
+
private $codec;
|
11 |
+
const MAX_TIME_PER_REQUEST_IN_SECONDS = 15;
|
12 |
+
const BLOG_LOCK_TRANSIENT_PREFIX = 'jp_sync_req_lock_';
|
13 |
+
const BLOG_LOCK_TRANSIENT_EXPIRY = 60; // seconds
|
14 |
+
|
15 |
+
// this is necessary because you can't use "new" when you declare instance properties >:(
|
16 |
+
function __construct() {
|
17 |
+
$this->codec = new Jetpack_Sync_JSON_Deflate_Codec();
|
18 |
+
}
|
19 |
+
|
20 |
+
function set_codec( iJetpack_Sync_Codec $codec ) {
|
21 |
+
$this->codec = $codec;
|
22 |
+
}
|
23 |
+
|
24 |
+
function attempt_request_lock( $blog_id, $expiry = self::BLOG_LOCK_TRANSIENT_EXPIRY ) {
|
25 |
+
$transient_name = $this->get_concurrent_request_transient_name( $blog_id );
|
26 |
+
$locked_time = get_site_transient( $transient_name );
|
27 |
+
if ( $locked_time ) {
|
28 |
+
return false;
|
29 |
+
}
|
30 |
+
set_site_transient( $transient_name, microtime( true ), $expiry );
|
31 |
+
|
32 |
+
return true;
|
33 |
+
}
|
34 |
+
|
35 |
+
private function get_concurrent_request_transient_name( $blog_id ) {
|
36 |
+
return self::BLOG_LOCK_TRANSIENT_PREFIX . $blog_id;
|
37 |
+
}
|
38 |
+
|
39 |
+
function remove_request_lock( $blog_id ) {
|
40 |
+
delete_site_transient( $this->get_concurrent_request_transient_name( $blog_id ) );
|
41 |
+
}
|
42 |
+
|
43 |
+
function receive( $data, $token = null, $sent_timestamp = null, $queue_id = null ) {
|
44 |
+
$start_time = microtime( true );
|
45 |
+
if ( ! is_array( $data ) ) {
|
46 |
+
return new WP_Error( 'action_decoder_error', 'Events must be an array' );
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( $token && ! $this->attempt_request_lock( $token->blog_id ) ) {
|
50 |
+
/**
|
51 |
+
* Fires when the server receives two concurrent requests from the same blog
|
52 |
+
*
|
53 |
+
* @since 4.2.0
|
54 |
+
*
|
55 |
+
* @param token The token object of the misbehaving site
|
56 |
+
*/
|
57 |
+
do_action( 'jetpack_sync_multi_request_fail', $token );
|
58 |
+
|
59 |
+
return new WP_Error( 'concurrent_request_error', 'There is another request running for the same blog ID' );
|
60 |
+
}
|
61 |
+
|
62 |
+
$events = wp_unslash( array_map( array( $this->codec, 'decode' ), $data ) );
|
63 |
+
$events_processed = array();
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Fires when an array of actions are received from a remote Jetpack site
|
67 |
+
*
|
68 |
+
* @since 4.2.0
|
69 |
+
*
|
70 |
+
* @param array Array of actions received from the remote site
|
71 |
+
*/
|
72 |
+
do_action( 'jetpack_sync_remote_actions', $events, $token );
|
73 |
+
|
74 |
+
foreach ( $events as $key => $event ) {
|
75 |
+
list( $action_name, $args, $user_id, $timestamp, $silent ) = $event;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Fires when an action is received from a remote Jetpack site
|
79 |
+
*
|
80 |
+
* @since 4.2.0
|
81 |
+
*
|
82 |
+
* @param string $action_name The name of the action executed on the remote site
|
83 |
+
* @param array $args The arguments passed to the action
|
84 |
+
* @param int $user_id The external_user_id who did the action
|
85 |
+
* @param bool $silent Whether the item was created via import
|
86 |
+
* @param double $timestamp Timestamp (in seconds) when the action occurred
|
87 |
+
* @param double $sent_timestamp Timestamp (in seconds) when the action was transmitted
|
88 |
+
* @param string $queue_id ID of the queue from which the event was sent (sync or full_sync)
|
89 |
+
* @param array $token The auth token used to invoke the API
|
90 |
+
*/
|
91 |
+
do_action( 'jetpack_sync_remote_action', $action_name, $args, $user_id, $silent, $timestamp, $sent_timestamp, $queue_id, $token );
|
92 |
+
|
93 |
+
$events_processed[] = $key;
|
94 |
+
|
95 |
+
if ( microtime( true ) - $start_time > self::MAX_TIME_PER_REQUEST_IN_SECONDS ) {
|
96 |
+
break;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
if ( $token ) {
|
101 |
+
$this->remove_request_lock( $token->blog_id );
|
102 |
+
}
|
103 |
+
|
104 |
+
return $events_processed;
|
105 |
+
}
|
106 |
+
}
|
sync/class.jetpack-sync-settings.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-defaults.php';
|
4 |
+
|
5 |
+
class Jetpack_Sync_Settings {
|
6 |
+
const SETTINGS_OPTION_PREFIX = 'jetpack_sync_settings_';
|
7 |
+
|
8 |
+
static $valid_settings = array(
|
9 |
+
'dequeue_max_bytes' => true,
|
10 |
+
'upload_max_bytes' => true,
|
11 |
+
'upload_max_rows' => true,
|
12 |
+
'sync_wait_time' => true,
|
13 |
+
'sync_wait_threshold' => true,
|
14 |
+
'max_queue_size' => true,
|
15 |
+
'max_queue_lag' => true,
|
16 |
+
);
|
17 |
+
|
18 |
+
static $is_importing;
|
19 |
+
|
20 |
+
static function get_settings() {
|
21 |
+
$settings = array();
|
22 |
+
foreach ( array_keys( self::$valid_settings ) as $setting ) {
|
23 |
+
$settings[ $setting ] = self::get_setting( $setting );
|
24 |
+
}
|
25 |
+
|
26 |
+
return $settings;
|
27 |
+
}
|
28 |
+
|
29 |
+
// Fetches the setting. It saves it if the setting doesn't exist, so that it gets
|
30 |
+
// autoloaded on page load rather than re-queried every time.
|
31 |
+
static function get_setting( $setting ) {
|
32 |
+
if ( ! isset( self::$valid_settings[ $setting ] ) ) {
|
33 |
+
return false;
|
34 |
+
}
|
35 |
+
|
36 |
+
$value = get_option( self::SETTINGS_OPTION_PREFIX . $setting );
|
37 |
+
|
38 |
+
if ( false === $value ) {
|
39 |
+
$default_name = "default_$setting"; // e.g. default_dequeue_max_bytes
|
40 |
+
$value = Jetpack_Sync_Defaults::$$default_name;
|
41 |
+
update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true );
|
42 |
+
}
|
43 |
+
|
44 |
+
return (int) $value;
|
45 |
+
}
|
46 |
+
|
47 |
+
static function update_settings( $new_settings ) {
|
48 |
+
$validated_settings = array_intersect_key( $new_settings, self::$valid_settings );
|
49 |
+
foreach ( $validated_settings as $setting => $value ) {
|
50 |
+
update_option( self::SETTINGS_OPTION_PREFIX . $setting, $value, true );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
static function reset_data() {
|
55 |
+
$valid_settings = self::$valid_settings;
|
56 |
+
$settings_prefix = self::SETTINGS_OPTION_PREFIX;
|
57 |
+
foreach ( $valid_settings as $option => $value ) {
|
58 |
+
delete_option( $settings_prefix . $option );
|
59 |
+
}
|
60 |
+
self::set_importing( null );
|
61 |
+
}
|
62 |
+
|
63 |
+
static function set_importing( $is_importing ) {
|
64 |
+
// set to NULL to revert to WP_IMPORTING, the standard behaviour
|
65 |
+
self::$is_importing = $is_importing;
|
66 |
+
}
|
67 |
+
|
68 |
+
static function is_importing() {
|
69 |
+
if ( ! is_null( self::$is_importing ) ) {
|
70 |
+
return self::$is_importing;
|
71 |
+
}
|
72 |
+
|
73 |
+
return defined( 'WP_IMPORTING' ) && WP_IMPORTING;
|
74 |
+
}
|
75 |
+
}
|
sync/class.jetpack-sync-users.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Jetpack_Sync_Users
|
5 |
+
*
|
6 |
+
* Responsible for syncing user data changes.
|
7 |
+
*/
|
8 |
+
class Jetpack_Sync_Users {
|
9 |
+
static $user_roles = array();
|
10 |
+
|
11 |
+
static function init() {
|
12 |
+
if ( Jetpack::is_active() ) {
|
13 |
+
// Kick off synchronization of user role when it changes
|
14 |
+
add_action( 'set_user_role', array( __CLASS__, 'user_role_change' ) );
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Synchronize connected user role changes
|
20 |
+
*/
|
21 |
+
static function user_role_change( $user_id ) {
|
22 |
+
if ( Jetpack::is_user_connected( $user_id ) ) {
|
23 |
+
self::update_role_on_com( $user_id );
|
24 |
+
//try to choose a new master if we're demoting the current one
|
25 |
+
self::maybe_demote_master_user( $user_id );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
static function get_role( $user_id ) {
|
30 |
+
if ( isset( $user_roles[ $user_id ] ) ) {
|
31 |
+
return $user_roles[ $user_id ];
|
32 |
+
}
|
33 |
+
|
34 |
+
$current_user_id = get_current_user_id();
|
35 |
+
wp_set_current_user( $user_id );
|
36 |
+
$role = Jetpack::translate_current_user_to_role();
|
37 |
+
wp_set_current_user( $current_user_id );
|
38 |
+
$user_roles[ $user_id ] = $role;
|
39 |
+
|
40 |
+
return $role;
|
41 |
+
}
|
42 |
+
|
43 |
+
static function get_signed_role( $user_id ) {
|
44 |
+
return Jetpack::sign_role( self::get_role( $user_id ) );
|
45 |
+
}
|
46 |
+
|
47 |
+
static function update_role_on_com( $user_id ) {
|
48 |
+
$signed_role = self::get_signed_role( $user_id );
|
49 |
+
Jetpack::xmlrpc_async_call( 'jetpack.updateRole', $user_id, $signed_role );
|
50 |
+
}
|
51 |
+
|
52 |
+
static function maybe_demote_master_user( $user_id ) {
|
53 |
+
$master_user_id = Jetpack_Options::get_option( 'master_user' );
|
54 |
+
$role = self::get_role( $user_id );
|
55 |
+
if ( $user_id == $master_user_id && 'administrator' != $role ) {
|
56 |
+
$query = new WP_User_Query(
|
57 |
+
array(
|
58 |
+
'fields' => array( 'id' ),
|
59 |
+
'role' => 'administrator',
|
60 |
+
'orderby' => 'id',
|
61 |
+
'exclude' => array( $master_user_id ),
|
62 |
+
)
|
63 |
+
);
|
64 |
+
$new_master = false;
|
65 |
+
foreach ( $query->results as $result ) {
|
66 |
+
$found_user_id = absint( $result->id );
|
67 |
+
if ( $found_user_id && Jetpack::is_user_connected( $found_user_id ) ) {
|
68 |
+
$new_master = $found_user_id;
|
69 |
+
break;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( $new_master ) {
|
74 |
+
Jetpack_Options::update_option( 'master_user', $new_master );
|
75 |
+
}
|
76 |
+
// else disconnect..?
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
Jetpack_Sync_Users::init();
|
sync/class.jetpack-sync-wp-replicastore.php
ADDED
@@ -0,0 +1,694 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once dirname( __FILE__ ) . '/interface.jetpack-sync-replicastore.php';
|
4 |
+
require_once dirname( __FILE__ ) . '/class.jetpack-sync-defaults.php';
|
5 |
+
|
6 |
+
/**
|
7 |
+
* An implementation of iJetpack_Sync_Replicastore which returns data stored in a WordPress.org DB.
|
8 |
+
* This is useful to compare values in the local WP DB to values in the synced replica store
|
9 |
+
*/
|
10 |
+
class Jetpack_Sync_WP_Replicastore implements iJetpack_Sync_Replicastore {
|
11 |
+
|
12 |
+
|
13 |
+
public function reset() {
|
14 |
+
global $wpdb;
|
15 |
+
|
16 |
+
$wpdb->query( "DELETE FROM $wpdb->posts" );
|
17 |
+
$wpdb->query( "DELETE FROM $wpdb->comments" );
|
18 |
+
|
19 |
+
// also need to delete terms from cache
|
20 |
+
$term_ids = $wpdb->get_col( "SELECT term_id FROM $wpdb->terms" );
|
21 |
+
foreach ( $term_ids as $term_id ) {
|
22 |
+
wp_cache_delete( $term_id, 'terms' );
|
23 |
+
}
|
24 |
+
|
25 |
+
$wpdb->query( "DELETE FROM $wpdb->terms" );
|
26 |
+
|
27 |
+
$wpdb->query( "DELETE FROM $wpdb->term_taxonomy" );
|
28 |
+
$wpdb->query( "DELETE FROM $wpdb->term_relationships" );
|
29 |
+
|
30 |
+
// callables and constants
|
31 |
+
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'jetpack_%'" );
|
32 |
+
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key NOT LIKE '\_%'" );
|
33 |
+
}
|
34 |
+
|
35 |
+
function full_sync_start( $config ) {
|
36 |
+
$this->reset();
|
37 |
+
}
|
38 |
+
|
39 |
+
function full_sync_end( $checksum ) {
|
40 |
+
// noop right now
|
41 |
+
}
|
42 |
+
|
43 |
+
public function post_count( $status = null, $min_id = null, $max_id = null ) {
|
44 |
+
global $wpdb;
|
45 |
+
|
46 |
+
$where = '';
|
47 |
+
|
48 |
+
if ( $status ) {
|
49 |
+
$where = "post_status = '" . esc_sql( $status ) . "'";
|
50 |
+
} else {
|
51 |
+
$where = '1=1';
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( null != $min_id ) {
|
55 |
+
$where .= ' AND ID >= ' . intval( $min_id );
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( null != $max_id ) {
|
59 |
+
$where .= ' AND ID <= ' . intval( $max_id );
|
60 |
+
}
|
61 |
+
|
62 |
+
return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE $where" );
|
63 |
+
}
|
64 |
+
|
65 |
+
// TODO: actually use max_id/min_id
|
66 |
+
public function get_posts( $status = null, $min_id = null, $max_id = null ) {
|
67 |
+
$args = array( 'orderby' => 'ID', 'posts_per_page' => -1 );
|
68 |
+
|
69 |
+
if ( $status ) {
|
70 |
+
$args['post_status'] = $status;
|
71 |
+
} else {
|
72 |
+
$args['post_status'] = 'any';
|
73 |
+
}
|
74 |
+
|
75 |
+
return get_posts( $args );
|
76 |
+
}
|
77 |
+
|
78 |
+
public function get_post( $id ) {
|
79 |
+
return get_post( $id );
|
80 |
+
}
|
81 |
+
|
82 |
+
public function upsert_post( $post, $silent = false ) {
|
83 |
+
global $wpdb;
|
84 |
+
|
85 |
+
// reject the post if it's not a WP_Post
|
86 |
+
if ( ! $post instanceof WP_Post ) {
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
|
90 |
+
$post = $post->to_array();
|
91 |
+
|
92 |
+
// reject posts without an ID
|
93 |
+
if ( ! isset( $post['ID'] ) ) {
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
|
97 |
+
$now = current_time( 'mysql' );
|
98 |
+
$now_gmt = get_gmt_from_date( $now );
|
99 |
+
|
100 |
+
$defaults = array(
|
101 |
+
'ID' => 0,
|
102 |
+
'post_author' => '0',
|
103 |
+
'post_content' => '',
|
104 |
+
'post_content_filtered' => '',
|
105 |
+
'post_title' => '',
|
106 |
+
'post_name' => '',
|
107 |
+
'post_excerpt' => '',
|
108 |
+
'post_status' => 'draft',
|
109 |
+
'post_type' => 'post',
|
110 |
+
'comment_status' => 'closed',
|
111 |
+
'comment_count' => '0',
|
112 |
+
'ping_status' => '',
|
113 |
+
'post_password' => '',
|
114 |
+
'to_ping' => '',
|
115 |
+
'pinged' => '',
|
116 |
+
'post_parent' => 0,
|
117 |
+
'menu_order' => 0,
|
118 |
+
'guid' => '',
|
119 |
+
'post_date' => $now,
|
120 |
+
'post_date_gmt' => $now_gmt,
|
121 |
+
'post_modified' => $now,
|
122 |
+
'post_modified_gmt' => $now_gmt,
|
123 |
+
);
|
124 |
+
|
125 |
+
$post = array_intersect_key( $post, $defaults );
|
126 |
+
|
127 |
+
$post = sanitize_post( $post, 'db' );
|
128 |
+
|
129 |
+
unset( $post['filter'] );
|
130 |
+
|
131 |
+
$exists = $wpdb->get_var( $wpdb->prepare( "SELECT EXISTS( SELECT 1 FROM $wpdb->posts WHERE ID = %d )", $post['ID'] ) );
|
132 |
+
|
133 |
+
if ( $exists ) {
|
134 |
+
$wpdb->update( $wpdb->posts, $post, array( 'ID' => $post['ID'] ) );
|
135 |
+
} else {
|
136 |
+
$wpdb->insert( $wpdb->posts, $post );
|
137 |
+
}
|
138 |
+
|
139 |
+
clean_post_cache( $post['ID'] );
|
140 |
+
}
|
141 |
+
|
142 |
+
public function delete_post( $post_id ) {
|
143 |
+
wp_delete_post( $post_id, true );
|
144 |
+
}
|
145 |
+
|
146 |
+
public function posts_checksum( $min_id = null, $max_id = null ) {
|
147 |
+
global $wpdb;
|
148 |
+
return $this->table_checksum( $wpdb->posts, Jetpack_Sync_Defaults::$default_post_checksum_columns , 'ID', Jetpack_Sync_Defaults::get_blacklisted_post_types_sql(), $min_id, $max_id );
|
149 |
+
}
|
150 |
+
|
151 |
+
public function comment_count( $status = null, $min_id = null, $max_id = null ) {
|
152 |
+
global $wpdb;
|
153 |
+
|
154 |
+
$comment_approved = $this->comment_status_to_approval_value( $status );
|
155 |
+
|
156 |
+
if ( $comment_approved !== false ) {
|
157 |
+
$where = "comment_approved = '" . esc_sql( $comment_approved ) . "'";
|
158 |
+
} else {
|
159 |
+
$where = '1=1';
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( $min_id != null ) {
|
163 |
+
$where .= ' AND comment_ID >= ' . intval( $min_id );
|
164 |
+
}
|
165 |
+
|
166 |
+
if ( $max_id != null ) {
|
167 |
+
$where .= ' AND comment_ID <= ' . intval( $max_id );
|
168 |
+
}
|
169 |
+
|
170 |
+
return $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE $where" );
|
171 |
+
}
|
172 |
+
|
173 |
+
private function comment_status_to_approval_value( $status ) {
|
174 |
+
switch ( $status ) {
|
175 |
+
case 'approve':
|
176 |
+
return '1';
|
177 |
+
case 'hold':
|
178 |
+
return '0';
|
179 |
+
case 'spam':
|
180 |
+
return 'spam';
|
181 |
+
case 'trash':
|
182 |
+
return 'trash';
|
183 |
+
case 'any':
|
184 |
+
return false;
|
185 |
+
case 'all':
|
186 |
+
return false;
|
187 |
+
default:
|
188 |
+
return false;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
// TODO: actually use max_id/min_id
|
193 |
+
public function get_comments( $status = null, $min_id = null, $max_id = null ) {
|
194 |
+
$args = array( 'orderby' => 'ID', 'status' => 'all' );
|
195 |
+
|
196 |
+
if ( $status ) {
|
197 |
+
$args['status'] = $status;
|
198 |
+
}
|
199 |
+
|
200 |
+
return get_comments( $args );
|
201 |
+
}
|
202 |
+
|
203 |
+
public function get_comment( $id ) {
|
204 |
+
return WP_Comment::get_instance( $id );
|
205 |
+
}
|
206 |
+
|
207 |
+
public function upsert_comment( $comment ) {
|
208 |
+
global $wpdb, $wp_version;
|
209 |
+
|
210 |
+
if ( version_compare( $wp_version, '4.4', '<' ) ) {
|
211 |
+
$comment = (array) $comment;
|
212 |
+
} else {
|
213 |
+
// WP 4.4 introduced the WP_Comment Class
|
214 |
+
$comment = $comment->to_array();
|
215 |
+
}
|
216 |
+
|
217 |
+
// filter by fields on comment table
|
218 |
+
$comment_fields_whitelist = array(
|
219 |
+
'comment_ID',
|
220 |
+
'comment_post_ID',
|
221 |
+
'comment_author',
|
222 |
+
'comment_author_email',
|
223 |
+
'comment_author_url',
|
224 |
+
'comment_author_IP',
|
225 |
+
'comment_date',
|
226 |
+
'comment_date_gmt',
|
227 |
+
'comment_content',
|
228 |
+
'comment_karma',
|
229 |
+
'comment_approved',
|
230 |
+
'comment_agent',
|
231 |
+
'comment_type',
|
232 |
+
'comment_parent',
|
233 |
+
'user_id',
|
234 |
+
);
|
235 |
+
|
236 |
+
foreach ( $comment as $key => $value ) {
|
237 |
+
if ( ! in_array( $key, $comment_fields_whitelist ) ) {
|
238 |
+
unset( $comment[ $key ] );
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
$exists = $wpdb->get_var(
|
243 |
+
$wpdb->prepare(
|
244 |
+
"SELECT EXISTS( SELECT 1 FROM $wpdb->comments WHERE comment_ID = %d )",
|
245 |
+
$comment['comment_ID']
|
246 |
+
)
|
247 |
+
);
|
248 |
+
|
249 |
+
if ( $exists ) {
|
250 |
+
$wpdb->update( $wpdb->comments, $comment, array( 'comment_ID' => $comment['comment_ID'] ) );
|
251 |
+
} else {
|
252 |
+
$wpdb->insert( $wpdb->comments, $comment );
|
253 |
+
}
|
254 |
+
|
255 |
+
wp_update_comment_count( $comment['comment_post_ID'] );
|
256 |
+
}
|
257 |
+
|
258 |
+
public function trash_comment( $comment_id ) {
|
259 |
+
wp_delete_comment( $comment_id );
|
260 |
+
}
|
261 |
+
|
262 |
+
public function delete_comment( $comment_id ) {
|
263 |
+
wp_delete_comment( $comment_id, true );
|
264 |
+
}
|
265 |
+
|
266 |
+
public function spam_comment( $comment_id ) {
|
267 |
+
wp_spam_comment( $comment_id );
|
268 |
+
}
|
269 |
+
|
270 |
+
public function comments_checksum( $min_id = null, $max_id = null ) {
|
271 |
+
global $wpdb;
|
272 |
+
return $this->table_checksum( $wpdb->comments, Jetpack_Sync_Defaults::$default_comment_checksum_columns, 'comment_ID', "comment_approved <> 'spam'", $min_id, $max_id );
|
273 |
+
}
|
274 |
+
|
275 |
+
public function options_checksum() {
|
276 |
+
global $wpdb;
|
277 |
+
|
278 |
+
$options_whitelist = "'" . implode( "', '", Jetpack_Sync_Defaults::$default_options_whitelist ) . "'";
|
279 |
+
$where_sql = "option_name IN ( $options_whitelist )";
|
280 |
+
|
281 |
+
return $this->table_checksum( $wpdb->options, Jetpack_Sync_Defaults::$default_option_checksum_columns, null, $where_sql, null, null );
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
public function update_option( $option, $value ) {
|
286 |
+
return update_option( $option, $value );
|
287 |
+
}
|
288 |
+
|
289 |
+
public function get_option( $option, $default = false ) {
|
290 |
+
return get_option( $option, $default );
|
291 |
+
}
|
292 |
+
|
293 |
+
public function delete_option( $option ) {
|
294 |
+
return delete_option( $option );
|
295 |
+
}
|
296 |
+
|
297 |
+
public function set_theme_support( $theme_support ) {
|
298 |
+
// noop
|
299 |
+
}
|
300 |
+
|
301 |
+
public function current_theme_supports( $feature ) {
|
302 |
+
return current_theme_supports( $feature );
|
303 |
+
}
|
304 |
+
|
305 |
+
public function get_metadata( $type, $object_id, $meta_key = '', $single = false ) {
|
306 |
+
return get_metadata( $type, $object_id, $meta_key, $single );
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
*
|
311 |
+
* Stores remote meta key/values alongside an ID mapping key
|
312 |
+
*
|
313 |
+
* @param $type
|
314 |
+
* @param $object_id
|
315 |
+
* @param $meta_key
|
316 |
+
* @param $meta_value
|
317 |
+
* @param $meta_id
|
318 |
+
*
|
319 |
+
* @return bool
|
320 |
+
*/
|
321 |
+
public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id ) {
|
322 |
+
|
323 |
+
$table = _get_meta_table( $type );
|
324 |
+
if ( ! $table ) {
|
325 |
+
return false;
|
326 |
+
}
|
327 |
+
|
328 |
+
global $wpdb;
|
329 |
+
|
330 |
+
$exists = $wpdb->get_var( $wpdb->prepare(
|
331 |
+
"SELECT EXISTS( SELECT 1 FROM $table WHERE meta_id = %d )",
|
332 |
+
$meta_id
|
333 |
+
) );
|
334 |
+
|
335 |
+
if ( $exists ) {
|
336 |
+
$wpdb->update( $table, array(
|
337 |
+
'meta_key' => $meta_key,
|
338 |
+
'meta_value' => serialize( $meta_value ),
|
339 |
+
), array( 'meta_id' => $meta_id ) );
|
340 |
+
} else {
|
341 |
+
$object_id_field = $type . '_id';
|
342 |
+
$wpdb->insert( $table, array(
|
343 |
+
'meta_id' => $meta_id,
|
344 |
+
$object_id_field => $object_id,
|
345 |
+
'meta_key' => $meta_key,
|
346 |
+
'meta_value' => serialize( $meta_value ),
|
347 |
+
) );
|
348 |
+
}
|
349 |
+
|
350 |
+
wp_cache_delete( $object_id, $type . '_meta' );
|
351 |
+
|
352 |
+
return true;
|
353 |
+
}
|
354 |
+
|
355 |
+
public function delete_metadata( $type, $object_id, $meta_ids ) {
|
356 |
+
global $wpdb;
|
357 |
+
|
358 |
+
$table = _get_meta_table( $type );
|
359 |
+
if ( ! $table ) {
|
360 |
+
return false;
|
361 |
+
}
|
362 |
+
|
363 |
+
foreach ( $meta_ids as $meta_id ) {
|
364 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM $table WHERE meta_id = %d", $meta_id ) );
|
365 |
+
}
|
366 |
+
|
367 |
+
// if we don't have an object ID what do we do - invalidate ALL meta?
|
368 |
+
if ( $object_id ) {
|
369 |
+
wp_cache_delete( $object_id, $type . '_meta' );
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
// constants
|
374 |
+
public function get_constant( $constant ) {
|
375 |
+
$value = get_option( 'jetpack_constant_' . $constant );
|
376 |
+
|
377 |
+
if ( $value ) {
|
378 |
+
return $value;
|
379 |
+
}
|
380 |
+
|
381 |
+
return null;
|
382 |
+
}
|
383 |
+
|
384 |
+
public function set_constant( $constant, $value ) {
|
385 |
+
update_option( 'jetpack_constant_' . $constant, $value );
|
386 |
+
}
|
387 |
+
|
388 |
+
public function get_updates( $type ) {
|
389 |
+
$all_updates = get_option( 'jetpack_updates', array() );
|
390 |
+
|
391 |
+
if ( isset( $all_updates[ $type ] ) ) {
|
392 |
+
return $all_updates[ $type ];
|
393 |
+
} else {
|
394 |
+
return null;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
public function set_updates( $type, $updates ) {
|
399 |
+
$all_updates = get_option( 'jetpack_updates', array() );
|
400 |
+
$all_updates[ $type ] = $updates;
|
401 |
+
update_option( 'jetpack_updates', $all_updates );
|
402 |
+
}
|
403 |
+
|
404 |
+
// functions
|
405 |
+
public function get_callable( $name ) {
|
406 |
+
$value = get_option( 'jetpack_' . $name );
|
407 |
+
|
408 |
+
if ( $value ) {
|
409 |
+
return $value;
|
410 |
+
}
|
411 |
+
|
412 |
+
return null;
|
413 |
+
}
|
414 |
+
|
415 |
+
public function set_callable( $name, $value ) {
|
416 |
+
update_option( 'jetpack_' . $name, $value );
|
417 |
+
}
|
418 |
+
|
419 |
+
// network options
|
420 |
+
public function get_site_option( $option ) {
|
421 |
+
return get_option( 'jetpack_network_' . $option );
|
422 |
+
}
|
423 |
+
|
424 |
+
public function update_site_option( $option, $value ) {
|
425 |
+
return update_option( 'jetpack_network_' . $option, $value );
|
426 |
+
}
|
427 |
+
|
428 |
+
public function delete_site_option( $option ) {
|
429 |
+
return delete_option( 'jetpack_network_' . $option );
|
430 |
+
}
|
431 |
+
|
432 |
+
// terms
|
433 |
+
// terms
|
434 |
+
public function get_terms( $taxonomy ) {
|
435 |
+
return get_terms( $taxonomy );
|
436 |
+
}
|
437 |
+
|
438 |
+
public function get_term( $taxonomy, $term_id, $is_term_id = true ) {
|
439 |
+
$t = $this->ensure_taxonomy( $taxonomy );
|
440 |
+
if ( ! $t || is_wp_error( $t ) ) {
|
441 |
+
return $t;
|
442 |
+
}
|
443 |
+
|
444 |
+
return get_term( $term_id, $taxonomy );
|
445 |
+
}
|
446 |
+
|
447 |
+
private function ensure_taxonomy( $taxonomy ) {
|
448 |
+
if ( ! taxonomy_exists( $taxonomy ) ) {
|
449 |
+
// try re-registering synced taxonomies
|
450 |
+
$taxonomies = $this->get_callable( 'taxonomies' );
|
451 |
+
if ( ! isset( $taxonomies[ $taxonomy ] ) ) {
|
452 |
+
// doesn't exist, or somehow hasn't been synced
|
453 |
+
return new WP_Error( 'invalid_taxonomy', "The taxonomy '$taxonomy' doesn't exist" );
|
454 |
+
}
|
455 |
+
$t = $taxonomies[ $taxonomy ];
|
456 |
+
|
457 |
+
return register_taxonomy(
|
458 |
+
$taxonomy,
|
459 |
+
$t->object_type,
|
460 |
+
(array) $t
|
461 |
+
);
|
462 |
+
}
|
463 |
+
|
464 |
+
return true;
|
465 |
+
}
|
466 |
+
|
467 |
+
public function get_the_terms( $object_id, $taxonomy ) {
|
468 |
+
return get_the_terms( $object_id, $taxonomy );
|
469 |
+
}
|
470 |
+
|
471 |
+
public function update_term( $term_object ) {
|
472 |
+
$taxonomy = $term_object->taxonomy;
|
473 |
+
global $wpdb;
|
474 |
+
$exists = $wpdb->get_var( $wpdb->prepare(
|
475 |
+
"SELECT EXISTS( SELECT 1 FROM $wpdb->terms WHERE term_id = %d )",
|
476 |
+
$term_object->term_id
|
477 |
+
) );
|
478 |
+
if ( ! $exists ) {
|
479 |
+
$term_object = sanitize_term( clone( $term_object ), $taxonomy, 'db' );
|
480 |
+
$term = array(
|
481 |
+
'term_id' => $term_object->term_id,
|
482 |
+
'name' => $term_object->name,
|
483 |
+
'slug' => $term_object->slug,
|
484 |
+
'term_group' => $term_object->term_group,
|
485 |
+
);
|
486 |
+
$term_taxonomy = array(
|
487 |
+
'term_taxonomy_id' => $term_object->term_taxonomy_id,
|
488 |
+
'term_id' => $term_object->term_id,
|
489 |
+
'taxonomy' => $term_object->taxonomy,
|
490 |
+
'description' => $term_object->description,
|
491 |
+
'parent' => (int) $term_object->parent,
|
492 |
+
'count' => (int) $term_object->count,
|
493 |
+
);
|
494 |
+
$wpdb->insert( $wpdb->terms, $term );
|
495 |
+
$wpdb->insert( $wpdb->term_taxonomy, $term_taxonomy );
|
496 |
+
|
497 |
+
return true;
|
498 |
+
}
|
499 |
+
|
500 |
+
return wp_update_term( $term_object->term_id, $taxonomy, (array) $term_object );
|
501 |
+
}
|
502 |
+
|
503 |
+
public function delete_term( $term_id, $taxonomy ) {
|
504 |
+
return wp_delete_term( $term_id, $taxonomy );
|
505 |
+
}
|
506 |
+
|
507 |
+
public function update_object_terms( $object_id, $taxonomy, $terms, $append ) {
|
508 |
+
wp_set_object_terms( $object_id, $terms, $taxonomy, $append );
|
509 |
+
}
|
510 |
+
|
511 |
+
public function delete_object_terms( $object_id, $tt_ids ) {
|
512 |
+
global $wpdb;
|
513 |
+
|
514 |
+
if ( is_array( $tt_ids ) && ! empty( $tt_ids ) ) {
|
515 |
+
$taxonomies = array();
|
516 |
+
foreach ( $tt_ids as $tt_id ) {
|
517 |
+
$term = get_term_by( 'term_taxonomy_id', $tt_id );
|
518 |
+
$taxonomies[ $term->taxonomy ][] = $tt_id;
|
519 |
+
}
|
520 |
+
$in_tt_ids = "'" . implode( "', '", $tt_ids ) . "'";
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Fires immediately before an object-term relationship is deleted.
|
524 |
+
*
|
525 |
+
* @since 2.9.0
|
526 |
+
*
|
527 |
+
* @param int $object_id Object ID.
|
528 |
+
* @param array $tt_ids An array of term taxonomy IDs.
|
529 |
+
*/
|
530 |
+
do_action( 'delete_term_relationships', $object_id, $tt_ids );
|
531 |
+
$deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) );
|
532 |
+
foreach ( $taxonomies as $taxonomy => $taxonomy_tt_ids ) {
|
533 |
+
wp_cache_delete( $object_id, $taxonomy . '_relationships' );
|
534 |
+
/**
|
535 |
+
* Fires immediately after an object-term relationship is deleted.
|
536 |
+
*
|
537 |
+
* @since 2.9.0
|
538 |
+
*
|
539 |
+
* @param int $object_id Object ID.
|
540 |
+
* @param array $tt_ids An array of term taxonomy IDs.
|
541 |
+
*/
|
542 |
+
do_action( 'deleted_term_relationships', $object_id, $taxonomy_tt_ids );
|
543 |
+
wp_update_term_count( $taxonomy_tt_ids, $taxonomy );
|
544 |
+
}
|
545 |
+
|
546 |
+
return (bool) $deleted;
|
547 |
+
}
|
548 |
+
|
549 |
+
return false;
|
550 |
+
}
|
551 |
+
|
552 |
+
// users
|
553 |
+
public function user_count() {
|
554 |
+
|
555 |
+
}
|
556 |
+
|
557 |
+
public function get_user( $user_id ) {
|
558 |
+
return WP_User::get_instance( $user_id );
|
559 |
+
}
|
560 |
+
|
561 |
+
public function upsert_user( $user ) {
|
562 |
+
$this->invalid_call();
|
563 |
+
}
|
564 |
+
|
565 |
+
public function delete_user( $user_id ) {
|
566 |
+
$this->invalid_call();
|
567 |
+
}
|
568 |
+
|
569 |
+
public function get_allowed_mime_types( $user_id ) {
|
570 |
+
|
571 |
+
}
|
572 |
+
|
573 |
+
public function checksum_all() {
|
574 |
+
return array(
|
575 |
+
'posts' => $this->posts_checksum(),
|
576 |
+
'comments' => $this->comments_checksum()
|
577 |
+
);
|
578 |
+
}
|
579 |
+
|
580 |
+
function checksum_histogram( $object_type, $buckets, $start_id = null, $end_id = null, $columns = null ) {
|
581 |
+
global $wpdb;
|
582 |
+
|
583 |
+
$wpdb->queries = array();
|
584 |
+
|
585 |
+
switch( $object_type ) {
|
586 |
+
case "posts":
|
587 |
+
$object_count = $this->post_count( null, $start_id, $end_id );
|
588 |
+
$object_table = $wpdb->posts;
|
589 |
+
$id_field = 'ID';
|
590 |
+
if ( empty( $columns ) ) {
|
591 |
+
$columns = Jetpack_Sync_Defaults::$default_post_checksum_columns;
|
592 |
+
}
|
593 |
+
break;
|
594 |
+
case "comments":
|
595 |
+
$object_count = $this->comment_count( null, $start_id, $end_id );
|
596 |
+
$object_table = $wpdb->comments;
|
597 |
+
$id_field = 'comment_ID';
|
598 |
+
if ( empty( $columns ) ) {
|
599 |
+
$columns = Jetpack_Sync_Defaults::$default_comment_checksum_columns;
|
600 |
+
}
|
601 |
+
break;
|
602 |
+
default:
|
603 |
+
return false;
|
604 |
+
}
|
605 |
+
|
606 |
+
$bucket_size = intval( ceil( $object_count / $buckets ) );
|
607 |
+
$previous_max_id = 0;
|
608 |
+
$histogram = array();
|
609 |
+
|
610 |
+
$where = '1=1';
|
611 |
+
|
612 |
+
if ( $start_id ) {
|
613 |
+
$where .= " AND $id_field >= " . intval( $start_id );
|
614 |
+
}
|
615 |
+
|
616 |
+
if ( $end_id ) {
|
617 |
+
$where .= " AND $id_field <= " . intval( $end_id );
|
618 |
+
}
|
619 |
+
|
620 |
+
do {
|
621 |
+
list( $first_id, $last_id ) = $wpdb->get_row(
|
622 |
+
"SELECT MIN($id_field) as min_id, MAX($id_field) as max_id FROM ( SELECT $id_field FROM $object_table WHERE $where AND $id_field > $previous_max_id ORDER BY $id_field ASC LIMIT $bucket_size ) as ids",
|
623 |
+
ARRAY_N
|
624 |
+
);
|
625 |
+
|
626 |
+
// get the checksum value
|
627 |
+
$value = $this->table_checksum( $object_table, $columns, $id_field, '1=1', $first_id, $last_id );
|
628 |
+
|
629 |
+
if ( is_wp_error( $value ) ) {
|
630 |
+
return $value;
|
631 |
+
}
|
632 |
+
|
633 |
+
if ( $first_id === null || $last_id === null ) {
|
634 |
+
break;
|
635 |
+
} elseif ( $first_id === $last_id ) {
|
636 |
+
$histogram[ $first_id ] = $value;
|
637 |
+
} else {
|
638 |
+
$histogram[ "{$first_id}-{$last_id}" ] = $value;
|
639 |
+
}
|
640 |
+
|
641 |
+
$previous_max_id = $last_id;
|
642 |
+
} while ( true );
|
643 |
+
|
644 |
+
return $histogram;
|
645 |
+
}
|
646 |
+
|
647 |
+
private function table_checksum( $table, $columns, $id_column, $where_sql = '1=1', $min_id = null, $max_id = null ) {
|
648 |
+
global $wpdb;
|
649 |
+
|
650 |
+
// sanitize to just valid MySQL column names
|
651 |
+
$sanitized_columns = preg_grep ( '/^[0-9,a-z,A-Z$_]+$/i', $columns );
|
652 |
+
$columns_sql = implode( ',', array_map( array( $this, 'strip_non_ascii_sql' ), $sanitized_columns ) );
|
653 |
+
|
654 |
+
if ( $min_id !== null ) {
|
655 |
+
$min_id = intval( $min_id );
|
656 |
+
$where_sql .= " AND $id_column >= $min_id";
|
657 |
+
}
|
658 |
+
|
659 |
+
if ( $max_id !== null ) {
|
660 |
+
$max_id = intval( $max_id );
|
661 |
+
$where_sql .= " AND $id_column <= $max_id";
|
662 |
+
}
|
663 |
+
|
664 |
+
$query = <<<ENDSQL
|
665 |
+
SELECT CONV(BIT_XOR(CRC32(CONCAT({$columns_sql}))), 10, 16)
|
666 |
+
FROM $table
|
667 |
+
WHERE $where_sql
|
668 |
+
ENDSQL;
|
669 |
+
|
670 |
+
$result = $wpdb->get_var( $query );
|
671 |
+
|
672 |
+
if ( $wpdb->last_error ) {
|
673 |
+
return new WP_Error( 'database_error', $wpdb->last_error );
|
674 |
+
}
|
675 |
+
|
676 |
+
return $result;
|
677 |
+
|
678 |
+
}
|
679 |
+
|
680 |
+
/**
|
681 |
+
* Wraps a column name in SQL which strips non-ASCII chars.
|
682 |
+
* This helps normalize data to avoid checksum differences caused by
|
683 |
+
* badly encoded data in the DB
|
684 |
+
*/
|
685 |
+
function strip_non_ascii_sql( $column_name ) {
|
686 |
+
return "REPLACE( CONVERT( $column_name USING ascii ), '?', '' )";
|
687 |
+
}
|
688 |
+
|
689 |
+
private function invalid_call() {
|
690 |
+
$backtrace = debug_backtrace();
|
691 |
+
$caller = $backtrace[1]['function'];
|
692 |
+
throw new Exception( "This function $caller is not supported on the WP Replicastore" );
|
693 |
+
}
|
694 |
+
}
|
sync/interface.jetpack-sync-codec.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Very simple interface for encoding and decoding input
|
5 |
+
* This is used to provide compression and serialization to messages
|
6 |
+
**/
|
7 |
+
interface iJetpack_Sync_Codec {
|
8 |
+
// we send this with the payload so we can select the appropriate decoder at the other end
|
9 |
+
public function name();
|
10 |
+
|
11 |
+
public function encode( $object );
|
12 |
+
|
13 |
+
public function decode( $input );
|
14 |
+
}
|
sync/interface.jetpack-sync-replicastore.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Sync architecture prototype
|
4 |
+
* @author Dan Walmsley
|
5 |
+
* To run tests: phpunit --testsuite sync --filter New_Sync
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* A high-level interface for objects that store synced WordPress data
|
10 |
+
* Useful for ensuring that different storage mechanisms implement the
|
11 |
+
* required semantics for storing all the data that we sync
|
12 |
+
*/
|
13 |
+
interface iJetpack_Sync_Replicastore {
|
14 |
+
// remove all data
|
15 |
+
public function reset();
|
16 |
+
|
17 |
+
// trigger setup for sync start/end
|
18 |
+
public function full_sync_start( $config );
|
19 |
+
|
20 |
+
public function full_sync_end( $checksum );
|
21 |
+
|
22 |
+
// posts
|
23 |
+
public function post_count( $status = null, $min_id = null, $max_id = null );
|
24 |
+
|
25 |
+
public function get_posts( $status = null, $min_id = null, $max_id = null );
|
26 |
+
|
27 |
+
public function get_post( $id );
|
28 |
+
|
29 |
+
public function upsert_post( $post, $silent = false );
|
30 |
+
|
31 |
+
public function delete_post( $post_id );
|
32 |
+
|
33 |
+
public function posts_checksum( $min_id = null, $max_id = null );
|
34 |
+
|
35 |
+
// comments
|
36 |
+
public function comment_count( $status = null, $min_id = null, $max_id = null );
|
37 |
+
|
38 |
+
public function get_comments( $status = null, $min_id = null, $max_id = null );
|
39 |
+
|
40 |
+
public function get_comment( $id );
|
41 |
+
|
42 |
+
public function upsert_comment( $comment );
|
43 |
+
|
44 |
+
public function trash_comment( $comment_id );
|
45 |
+
|
46 |
+
public function spam_comment( $comment_id );
|
47 |
+
|
48 |
+
public function delete_comment( $comment_id );
|
49 |
+
|
50 |
+
public function comments_checksum( $min_id = null, $max_id = null );
|
51 |
+
|
52 |
+
// options
|
53 |
+
public function update_option( $option, $value );
|
54 |
+
|
55 |
+
public function get_option( $option, $default = false );
|
56 |
+
|
57 |
+
public function delete_option( $option );
|
58 |
+
|
59 |
+
// themes
|
60 |
+
public function set_theme_support( $theme_support );
|
61 |
+
|
62 |
+
public function current_theme_supports( $feature );
|
63 |
+
|
64 |
+
// meta
|
65 |
+
public function get_metadata( $type, $object_id, $meta_key = '', $single = false );
|
66 |
+
|
67 |
+
public function upsert_metadata( $type, $object_id, $meta_key, $meta_value, $meta_id );
|
68 |
+
|
69 |
+
public function delete_metadata( $type, $object_id, $meta_ids );
|
70 |
+
|
71 |
+
// constants
|
72 |
+
public function get_constant( $constant );
|
73 |
+
|
74 |
+
public function set_constant( $constant, $value );
|
75 |
+
|
76 |
+
// updates
|
77 |
+
public function get_updates( $type );
|
78 |
+
|
79 |
+
public function set_updates( $type, $updates );
|
80 |
+
|
81 |
+
// functions
|
82 |
+
public function get_callable( $callable );
|
83 |
+
|
84 |
+
public function set_callable( $callable, $value );
|
85 |
+
|
86 |
+
// network options
|
87 |
+
public function get_site_option( $option );
|
88 |
+
|
89 |
+
public function update_site_option( $option, $value );
|
90 |
+
|
91 |
+
public function delete_site_option( $option );
|
92 |
+
|
93 |
+
// terms
|
94 |
+
public function get_terms( $taxonomy );
|
95 |
+
|
96 |
+
public function get_term( $taxonomy, $term_id, $is_term_id = true );
|
97 |
+
|
98 |
+
public function update_term( $term_object );
|
99 |
+
|
100 |
+
public function delete_term( $term_id, $taxonomy );
|
101 |
+
|
102 |
+
public function get_the_terms( $object_id, $taxonomy );
|
103 |
+
|
104 |
+
public function update_object_terms( $object_id, $taxonomy, $terms, $append );
|
105 |
+
|
106 |
+
public function delete_object_terms( $object_id, $tt_ids );
|
107 |
+
|
108 |
+
// users
|
109 |
+
public function user_count();
|
110 |
+
|
111 |
+
public function get_user( $user_id );
|
112 |
+
|
113 |
+
public function upsert_user( $user );
|
114 |
+
|
115 |
+
public function delete_user( $user_id );
|
116 |
+
|
117 |
+
public function get_allowed_mime_types( $user_id );
|
118 |
+
|
119 |
+
|
120 |
+
// full checksum
|
121 |
+
public function checksum_all();
|
122 |
+
|
123 |
+
// histogram
|
124 |
+
public function checksum_histogram( $object_type, $buckets, $start_id = null, $end_id = null );
|
125 |
+
}
|
uninstall.php
CHANGED
@@ -2,15 +2,17 @@
|
|
2 |
|
3 |
if (
|
4 |
!defined( 'WP_UNINSTALL_PLUGIN' )
|
5 |
-
||
|
6 |
!WP_UNINSTALL_PLUGIN
|
7 |
-
||
|
8 |
dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) )
|
9 |
) {
|
10 |
status_header( 404 );
|
11 |
exit;
|
12 |
}
|
13 |
|
|
|
|
|
14 |
// Delete all compact options
|
15 |
delete_option( 'jetpack_options' );
|
16 |
|
@@ -24,3 +26,7 @@ delete_option( 'jetpack_do_activate' );
|
|
24 |
delete_option( 'jetpack_was_activated' );
|
25 |
delete_option( 'jetpack_auto_installed' );
|
26 |
delete_transient( 'jetpack_register' );
|
|
|
|
|
|
|
|
2 |
|
3 |
if (
|
4 |
!defined( 'WP_UNINSTALL_PLUGIN' )
|
5 |
+
||
|
6 |
!WP_UNINSTALL_PLUGIN
|
7 |
+
||
|
8 |
dirname( WP_UNINSTALL_PLUGIN ) != dirname( plugin_basename( __FILE__ ) )
|
9 |
) {
|
10 |
status_header( 404 );
|
11 |
exit;
|
12 |
}
|
13 |
|
14 |
+
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
15 |
+
|
16 |
// Delete all compact options
|
17 |
delete_option( 'jetpack_options' );
|
18 |
|
26 |
delete_option( 'jetpack_was_activated' );
|
27 |
delete_option( 'jetpack_auto_installed' );
|
28 |
delete_transient( 'jetpack_register' );
|
29 |
+
|
30 |
+
// Jetpack Sync
|
31 |
+
require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-sender.php';
|
32 |
+
Jetpack_Sync_Sender::get_instance()->uninstall();
|
views/admin/my-jetpack-page.php
CHANGED
@@ -106,6 +106,7 @@
|
|
106 |
<?php
|
107 |
$all_users = get_users();
|
108 |
|
|
|
109 |
foreach ( $all_users as $user ) {
|
110 |
if ( Jetpack::is_user_connected( $user->ID ) && $user->caps['administrator'] ) {
|
111 |
if ( $user->ID == Jetpack_Options::get_option( 'master_user' ) ) {
|
106 |
<?php
|
107 |
$all_users = get_users();
|
108 |
|
109 |
+
$user_options = '';
|
110 |
foreach ( $all_users as $user ) {
|
111 |
if ( Jetpack::is_user_connected( $user->ID ) && $user->caps['administrator'] ) {
|
112 |
if ( $user->ID == Jetpack_Options::get_option( 'master_user' ) ) {
|