Version Description
Release Date: May 26, 2016
- Important security update. Please upgrade immediately.
Download this release
Release Info
Developer | samhotchkiss |
Plugin | Jetpack by WordPress.com |
Version | 2.1.5 |
Comparing to | |
See all releases |
Code changes from version 3.9.7 to 2.1.5
- .svnignore +0 -8
- 3rd-party/3rd-party.php +0 -11
- 3rd-party/bbpress.php +0 -28
- 3rd-party/bitly.php +0 -29
- 3rd-party/buddypress.php +0 -9
- 3rd-party/wpml.php +0 -35
- _inc/facebook-embed.js +0 -57
- _inc/fonts/automatticons/automatticons.eot +0 -0
- _inc/fonts/automatticons/automatticons.svg +0 -44
- _inc/fonts/automatticons/automatticons.ttf +0 -0
- _inc/fonts/automatticons/automatticons.woff +0 -0
- _inc/fonts/jetpack/jetpack.eot +0 -0
- _inc/fonts/jetpack/jetpack.svg +0 -32
- _inc/fonts/jetpack/jetpack.ttf +0 -0
- _inc/fonts/jetpack/jetpack.woff +0 -0
- _inc/footer.php +0 -44
- _inc/gallery-settings.js +2 -16
- _inc/genericons.php +0 -13
- _inc/genericons/COPYING.txt +0 -9
- _inc/genericons/LICENSE.txt +0 -339
- _inc/genericons/README.md +0 -218
- _inc/genericons/genericons.css +0 -11
- _inc/genericons/genericons/Genericons.eot +0 -0
- _inc/genericons/genericons/Genericons.svg +0 -537
- _inc/genericons/genericons/Genericons.ttf +0 -0
- _inc/genericons/genericons/Genericons.woff +0 -0
- _inc/genericons/genericons/genericons.css +0 -263
- _inc/genericons/genericons/rtl/genericons-rtl.css +0 -265
- _inc/header.php +0 -27
- _inc/images/a8c.png +0 -0
- _inc/images/alertbox-closeicon-2x.png +0 -0
- _inc/images/alertbox-closeicon.png +0 -0
- _inc/images/alertbox-clouds-2x.png +0 -0
- _inc/images/alertbox-clouds.png +0 -0
- _inc/images/align-center-2x.png +0 -0
- _inc/images/align-left-2x.png +0 -0
- _inc/images/align-none-2x.png +0 -0
- _inc/images/align-right-2x.png +0 -0
- _inc/images/archive-2x.png +0 -0
- _inc/images/arrow-2x.png +0 -0
- _inc/images/arrow-pointer-blue-2x.png +0 -0
- _inc/images/arrow.png +0 -0
- _inc/images/arrows-2x.png +0 -0
- _inc/images/arrows-dark-2x.png +0 -0
- _inc/images/arrows-dark-vs-2x.png +0 -0
- _inc/images/arrows-vs-2x.png +0 -0
- _inc/images/atdbuttontr-2x.png +0 -0
- _inc/images/audio-2x.png +0 -0
- _inc/images/automattic-2x.png +0 -0
- _inc/images/automattic.png +0 -0
- _inc/images/bubble_bg-2x.png +0 -0
- _inc/images/buttons-2x.gif +0 -0
- _inc/images/code-2x.png +0 -0
- _inc/images/comment-grey-bubble-2x.png +0 -0
- _inc/images/date-button-2x.gif +0 -0
- _inc/images/default-2x.png +0 -0
- _inc/images/delete-2x.png +0 -0
- _inc/images/document-2x.png +0 -0
- _inc/images/down_arrow-2x.gif +0 -0
- _inc/images/footer-clouds-2x.png +0 -0
- _inc/images/footer-clouds.png +0 -0
- _inc/images/generic-2x.png +0 -0
- _inc/images/header-clouds-2x.png +0 -0
- _inc/images/header-clouds-small-2x.png +0 -0
- _inc/images/header-clouds-small.png +0 -0
- _inc/images/header-clouds.png +0 -0
- _inc/images/icon-comingsoon-2x.png +0 -0
- _inc/images/icon-comingsoon.png +0 -0
- _inc/images/icon-pointer-flag-2x.png +0 -0
- _inc/images/image-2x.png +0 -0
- _inc/images/imgedit-icons-2x.png +0 -0
- _inc/images/interactive-2x.png +0 -0
- _inc/images/jetpack-closebox-icon.png +0 -0
- _inc/images/list-2x.png +0 -0
- _inc/images/logo-2x.png +0 -0
- _inc/images/logo-small-2x.png +0 -0
- _inc/images/logo-small.png +0 -0
- _inc/images/logo.png +0 -0
- _inc/images/marker-2x.png +0 -0
- _inc/images/mask-2x.png +0 -0
- _inc/images/media-button-2x.png +0 -0
- _inc/images/menuicon-sprite-2x.png +0 -0
- _inc/images/menuicon-sprite.png +0 -0
- _inc/images/module-clouds-2x.png +0 -0
- _inc/images/module-clouds.png +0 -0
- _inc/images/module-icons-sprite-2x.png +0 -0
- _inc/images/module-icons-sprite.png +0 -0
- _inc/images/press-this-2x.png +0 -0
- _inc/images/publicize.png +0 -0
- _inc/images/resize-2x.gif +0 -0
- _inc/images/rss/blue-large.png +0 -0
- _inc/images/rss/blue-medium.png +0 -0
- _inc/images/rss/blue-small.png +0 -0
- _inc/images/rss/green-large.png +0 -0
- _inc/images/rss/green-medium.png +0 -0
- _inc/images/rss/green-small.png +0 -0
- _inc/images/rss/orange-large.png +0 -0
- _inc/images/rss/orange-medium.png +0 -0
- _inc/images/rss/orange-small.png +0 -0
- _inc/images/rss/pink-large.png +0 -0
- _inc/images/rss/pink-medium.png +0 -0
- _inc/images/rss/pink-small.png +0 -0
- _inc/images/rss/purple-large.png +0 -0
- _inc/images/rss/purple-medium.png +0 -0
- _inc/images/rss/purple-small.png +0 -0
- _inc/images/rss/red-large.png +0 -0
- _inc/images/rss/red-medium.png +0 -0
- _inc/images/rss/red-small.png +0 -0
- _inc/images/rss/silver-large.png +0 -0
- _inc/images/rss/silver-medium.png +0 -0
- _inc/images/rss/silver-small.png +0 -0
- _inc/images/screen-icon.png +0 -0
- _inc/images/screenshots/beautifulmath.png +0 -0
- _inc/images/screenshots/carousel.png +0 -0
- _inc/images/screenshots/comments.png +0 -0
- _inc/images/screenshots/contactform.png +0 -0
- _inc/images/screenshots/custom-css.png +0 -0
- _inc/images/screenshots/hovercards.png +0 -0
- _inc/images/screenshots/mobile-push-notifications.jpg +0 -0
- _inc/images/screenshots/mobile-theme.png +0 -0
- _inc/images/screenshots/notes.png +0 -0
- _inc/images/screenshots/post-by-email.png +0 -0
- _inc/images/screenshots/publicize.png +0 -0
- _inc/images/screenshots/sharing.png +0 -0
- _inc/images/screenshots/shortcodes.png +0 -0
- _inc/images/screenshots/shortlinks.png +0 -0
- _inc/images/screenshots/spelling.png +0 -0
- _inc/images/screenshots/stats.png +0 -0
- _inc/images/screenshots/subscriptions.png +0 -0
- _inc/images/screenshots/tiled-gallery.png +0 -0
- _inc/images/screenshots/vaultpress.png +0 -0
- _inc/images/screenshots/widgets.png +0 -0
- _inc/images/sort-2x.gif +0 -0
- _inc/images/spreadsheet-2x.png +0 -0
- _inc/images/stars-2x.png +0 -0
- {images → _inc/images}/stats-smiley.gif +0 -0
- _inc/images/status-light-2x.png +0 -0
- _inc/images/status-light.png +0 -0
- _inc/images/tb-close-2x.png +0 -0
- _inc/images/text-2x.png +0 -0
- _inc/images/video-2x.png +0 -0
- _inc/images/wheel-2x.png +0 -0
- _inc/images/wpicons-2x.png +0 -0
- _inc/images/wpspin_light-2x.gif +0 -0
- _inc/images/xit-2x.gif +0 -0
- _inc/jetpack-admin.js +0 -54
- _inc/jetpack-jitm.js +0 -135
- _inc/jetpack-modules.js +0 -150
- _inc/jetpack-modules.models.js +0 -72
- _inc/jetpack-modules.views.js +0 -62
- _inc/jetpack-retina.css +470 -0
- _inc/jetpack-rtl.css +128 -0
- _inc/jetpack.css +1066 -0
- _inc/jetpack.js +29 -37
- _inc/jp-my-jetpack.js +0 -86
- _inc/jp.js +0 -433
- _inc/jquery.inview.js +0 -143
- _inc/jquery.jetpack-resize.js +0 -285
- _inc/jquery.jetpack-sync.js +0 -68
- _inc/jquery.spin.js +81 -99
- _inc/lib/admin-pages/class.jetpack-admin-page.php +0 -109
- _inc/lib/admin-pages/class.jetpack-landing-page.php +0 -299
- _inc/lib/admin-pages/class.jetpack-my-jetpack-page.php +0 -187
- _inc/lib/admin-pages/class.jetpack-settings-page.php +0 -87
- _inc/lib/class.color.php +0 -755
- _inc/lib/markdown/0-load.php +0 -6
- _inc/lib/markdown/README.md +0 -19
- _inc/lib/markdown/extra.php +0 -3194
- _inc/lib/markdown/gfm.php +0 -389
- _inc/lib/tonesque.php +0 -215
- _inc/lib/tracks/class.tracks-client.php +0 -168
- _inc/lib/tracks/class.tracks-event.php +0 -149
- _inc/lib/tracks/client.php +0 -124
- _inc/lib/tracks/tracks-ajax.js +0 -49
- _inc/postmessage.js +0 -438
- _inc/spin.js +297 -345
- _inc/twitter-timeline.js +0 -39
- changelog.txt +0 -1639
- class.jetpack-admin.php +0 -259
- class.jetpack-autoupdate.php +0 -246
- class.jetpack-bbpress-json-api-compat.php +0 -108
- class.jetpack-cli.php +0 -599
- class.jetpack-client-server.php +0 -266
- class.jetpack-client.php +0 -287
- class.jetpack-data.php +0 -125
- class.jetpack-debugger.php +0 -434
- class.jetpack-error.php +0 -3
- class.jetpack-heartbeat.php +0 -160
- class.jetpack-ixr-client.php +10 -8
- class.jetpack-jitm.php +0 -473
- class.jetpack-modules-list-table.php +0 -357
- class.jetpack-network-sites-list-table.php +0 -138
- class.jetpack-network.php +0 -806
- class.jetpack-options.php +0 -244
- class.jetpack-post-images.php +85 -212
- class.jetpack-signature.php +6 -11
- class.jetpack-sync.php +0 -1104
- class.jetpack-tracks.php +0 -83
- class.jetpack-twitter-cards.php +0 -213
- class.jetpack-user-agent.php +123 -207
- class.jetpack-xmlrpc-server.php +16 -79
- class.jetpack.php +0 -3747
.svnignore
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
.git/
|
2 |
-
.gitignore
|
3 |
-
.travis.yml
|
4 |
-
readme.md
|
5 |
-
tests/
|
6 |
-
_inc/lib/icalendar-reader.php
|
7 |
-
modules/shortcodes/upcoming-events.php
|
8 |
-
modules/widgets/upcoming-events.php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3rd-party/3rd-party.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* Placeholder to load 3rd party plugin tweaks until a legit system
|
5 |
-
* is architected
|
6 |
-
*/
|
7 |
-
|
8 |
-
require_once( JETPACK__PLUGIN_DIR . '3rd-party/buddypress.php' );
|
9 |
-
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' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3rd-party/bbpress.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ensure sharing_display is loaded.
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Adds Jetpack + bbPress Compatibility filters.
|
6 |
-
*
|
7 |
-
* @author Brandon Kraft
|
8 |
-
* @since 3.7.1
|
9 |
-
*/
|
10 |
-
function jetpack_bbpress_compat() {
|
11 |
-
if ( function_exists( 'sharing_display' ) ) {
|
12 |
-
add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
|
13 |
-
add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
|
14 |
-
add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
|
20 |
-
*
|
21 |
-
* Determination if the sharing buttons should display on the post type is handled within sharing_display().
|
22 |
-
*
|
23 |
-
* @author David Decker
|
24 |
-
* @since 3.7.0
|
25 |
-
*/
|
26 |
-
function jetpack_sharing_bbpress() {
|
27 |
-
sharing_display( null, true );
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3rd-party/bitly.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* Fixes issues with the Official Bitly for WordPress
|
5 |
-
* http://wordpress.org/plugins/bitly/
|
6 |
-
*/
|
7 |
-
if( class_exists( 'Bitly' ) ) {
|
8 |
-
|
9 |
-
if( isset( $GLOBALS['bitly'] ) ) {
|
10 |
-
remove_action( 'wp_head', array( $GLOBALS['bitly'], 'og_tags' ) );
|
11 |
-
add_action( 'wp_head', 'jetpack_bitly_og_tag', 100 );
|
12 |
-
}
|
13 |
-
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* jetpack_bitly_og_tag
|
18 |
-
*
|
19 |
-
* @return null
|
20 |
-
*/
|
21 |
-
function jetpack_bitly_og_tag() {
|
22 |
-
if( has_filter( 'wp_head', 'jetpack_og_tags') === false ) {
|
23 |
-
// Add the bitly part again back if we don't have any jetpack_og_tags added
|
24 |
-
$GLOBALS['bitly']->og_tags();
|
25 |
-
} elseif ( isset( $GLOBALS['posts'] ) && $GLOBALS['posts'][0]->ID > 0 ) {
|
26 |
-
printf( "<meta property=\"bitly:url\" content=\"%s\" /> \n", esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3rd-party/buddypress.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
add_filter( 'bp_core_pre_avatar_handle_upload', 'blobphoto' );
|
4 |
-
function blobphoto( $bool ) {
|
5 |
-
|
6 |
-
add_filter( 'jetpack_photon_skip_image', '__return_true' );
|
7 |
-
|
8 |
-
return $bool;
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3rd-party/wpml.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Only load these if WPML is active.
|
4 |
-
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) :
|
5 |
-
|
6 |
-
add_action( 'jetpack_widget_get_top_posts', 'wpml_jetpack_widget_get_top_posts', 10, 3 );
|
7 |
-
function wpml_jetpack_widget_get_top_posts( $posts, $post_ids, $count ) {
|
8 |
-
global $sitepress;
|
9 |
-
|
10 |
-
foreach ( $posts as $k => $post ) {
|
11 |
-
$lang_information = wpml_get_language_information( $post['post_id'] );
|
12 |
-
$post_language = substr( $lang_information['locale'], 0, 2 );
|
13 |
-
if ( $post_language !== $sitepress->get_current_language() ) {
|
14 |
-
unset( $posts[ $k ] );
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
return $posts;
|
19 |
-
}
|
20 |
-
|
21 |
-
add_filter( 'grunion_contact_form_field_html', 'grunion_contact_form_field_html_filter', 10, 3 );
|
22 |
-
function grunion_contact_form_field_html_filter( $r, $field_label, $id ){
|
23 |
-
global $sitepress;
|
24 |
-
|
25 |
-
if ( function_exists( 'icl_translate' ) ) {
|
26 |
-
if ( $sitepress->get_current_language() !== $sitepress->get_default_language() ) {
|
27 |
-
$label_translation = icl_translate( 'jetpack ', $field_label . '_label', $field_label );
|
28 |
-
$r = str_replace( $field_label, $label_translation, $r );
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
return $r;
|
33 |
-
}
|
34 |
-
|
35 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/facebook-embed.js
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
/* global FB, jpfbembed */
|
2 |
-
(function( window ) {
|
3 |
-
var facebookEmbed = function() {
|
4 |
-
var fbroot, src;
|
5 |
-
|
6 |
-
if ( 'undefined' !== typeof FB && FB.XFBML ) {
|
7 |
-
FB.XFBML.parse();
|
8 |
-
} else {
|
9 |
-
fbroot = document.createElement( 'div' );
|
10 |
-
fbroot.id = 'fb-root';
|
11 |
-
document.getElementsByTagName( 'body' )[0].appendChild( fbroot );
|
12 |
-
|
13 |
-
src = '//connect.facebook.net/' + jpfbembed.locale + '/sdk.js#xfbml=1';
|
14 |
-
if ( jpfbembed.appid ) {
|
15 |
-
src += '&appId=' + jpfbembed.appid;
|
16 |
-
}
|
17 |
-
src += '&version=v2.3';
|
18 |
-
jQuery.getScript( src );
|
19 |
-
}
|
20 |
-
};
|
21 |
-
|
22 |
-
window.fbAsyncInit = function() {
|
23 |
-
FB.init( {
|
24 |
-
appId : jpfbembed.appid,
|
25 |
-
version: 'v2.3'
|
26 |
-
} );
|
27 |
-
|
28 |
-
FB.XFBML.parse();
|
29 |
-
};
|
30 |
-
|
31 |
-
if ( 'undefined' !== typeof infiniteScroll ) {
|
32 |
-
jQuery( document.body ).on( 'post-load', facebookEmbed );
|
33 |
-
}
|
34 |
-
|
35 |
-
// Re-render Facebook XFBML when partials are re-rendered in the Customizer.
|
36 |
-
jQuery( function() {
|
37 |
-
var hasSelectiveRefresh = (
|
38 |
-
'undefined' !== typeof wp &&
|
39 |
-
wp.customize &&
|
40 |
-
wp.customize.selectiveRefresh &&
|
41 |
-
wp.customize.widgetsPreview &&
|
42 |
-
wp.customize.widgetsPreview.WidgetPartial
|
43 |
-
);
|
44 |
-
if ( ! hasSelectiveRefresh ) {
|
45 |
-
return;
|
46 |
-
}
|
47 |
-
|
48 |
-
// Render Facebook widget in rendered partial.
|
49 |
-
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
|
50 |
-
if ( placement.container ) {
|
51 |
-
FB.XFBML.parse( placement.container[0] );
|
52 |
-
}
|
53 |
-
} );
|
54 |
-
} );
|
55 |
-
|
56 |
-
facebookEmbed();
|
57 |
-
})( this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/fonts/automatticons/automatticons.eot
DELETED
Binary file
|
_inc/fonts/automatticons/automatticons.svg
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata></metadata>
|
5 |
-
<defs>
|
6 |
-
<font id="automatticonsregular" horiz-adv-x="2048" >
|
7 |
-
<font-face units-per-em="2048" ascent="1638" descent="-410" />
|
8 |
-
<missing-glyph horiz-adv-x="1200" />
|
9 |
-
<glyph />
|
10 |
-
<glyph />
|
11 |
-
<glyph unicode="
" />
|
12 |
-
<glyph unicode=" " horiz-adv-x="1200" />
|
13 |
-
<glyph unicode="	" horiz-adv-x="1200" />
|
14 |
-
<glyph unicode=" " horiz-adv-x="1200" />
|
15 |
-
<glyph unicode="." d="M24 1100l1000 -1000l1000 1000h-2000z" />
|
16 |
-
<glyph unicode="@" d="M24 -8q48 -6 100 -6q281 0 508 176q-133 1 -238.5 81t-145.5 203q39 -6 78 -6q60 0 108 14q-142 29 -236 142t-94 260v6q86 -49 186 -52q-84 57 -133 146.5t-49 195.5q0 110 56 206q154 -189 374 -303t472 -127q-12 45 -12 94q0 111 55 205.5t149.5 149.5t205.5 55 q87 0 165 -34t135 -94q142 27 260 100q-46 -149 -182 -228q123 14 238 64q-82 -124 -206 -212q2 -18 2 -54q0 -117 -24.5 -235.5t-75 -233t-122 -218t-170 -191t-214 -152t-260 -100.5t-302.5 -36q-344 0 -628 184z" />
|
17 |
-
<glyph unicode="A" horiz-adv-x="12288" d="M128 356h176l110 220h492l92 -220h176l-458 852h-118zM460 692l186 342l198 -342h-384zM1458 716q0 -174 112.5 -279t337.5 -105q116 0 204 30t140.5 83.5t78 121.5t25.5 149v492h-162v-492q0 -129 -63.5 -197.5t-208.5 -68.5q-147 0 -230.5 71.5t-83.5 194.5v492h-150 v-492zM2710 1056h364v-700h150v700h378v152h-892v-152zM3904 772q0 -82 35 -161t96.5 -141t153 -100t195.5 -38q107 0 199.5 38t153 100.5t95 141t34.5 160.5v24q0 85 -34.5 165t-95 142.5t-152.5 100.5t-200 38q-105 0 -196 -38t-152.5 -100.5t-96.5 -142.5t-35 -165v-24z M4048 784v12q0 125 90.5 216.5t245.5 91.5q82 0 147.5 -26t104.5 -70t59.5 -98t20.5 -114v-12q0 -147 -84.5 -240.5t-247.5 -93.5q-158 0 -247 95t-89 239zM4251 671q0 -15 10 -34q11 -21 33 -37q7 -12 28 -1t30 35l150 224q15 19 10 42t-24 42q-24 10 -46 4.5t-22 -28.5 l-164 -214q-5 -18 -5 -33zM5278 356h152v666l46 -70l330 -596h92l342 596l46 70v-666h164v852h-222l-318 -588l-46 -66l-46 66l-320 588h-220v-852zM6756 356h186l92 220h504l104 -220h160l-448 852h-140zM7092 692l180 342l186 -342h-366zM7928 1056h366v-700h152v700h376 v152h-894v-152zM9076 1056h364v-700h164v700h386v152h-914v-152zM10370 356h160v852h-80q0 -43 -19 -62.5t-61 -19.5v-770zM10908 772q0 -88 37 -167t104 -140t170.5 -97t228.5 -36q237 0 440 164l-104 90q-55 -39 -94.5 -62.5t-108.5 -48.5t-133 -25q-179 0 -277.5 92.5 t-98.5 229.5v12q0 134 98.5 227t277.5 93q170 0 326 -152l114 104q-206 186 -440 186q-116 0 -218.5 -38t-172 -100.5t-109.5 -142.5t-40 -165v-24z" />
|
18 |
-
<glyph unicode="C" d="M0 402v286q0 8 2.5 17.5t5.5 14.5l2 6l16 28q6 13 0 26l-16 28q-10 18 -10 38v284q0 28 16.5 52t41.5 30l914 378q27 10 54 10q29 0 52 -10l912 -374q26 -9 42 -33.5t16 -52.5v-284q0 -9 -2.5 -18.5t-5.5 -14.5l-2 -5l-16 -28q-6 -13 0 -26l16 -28q10 -20 10 -38v-286 q0 -27 -16 -51t-42 -33l-912 -374q-23 -10 -52 -10q-27 0 -54 10l-914 374q-25 9 -41.5 33.5t-16.5 50.5zM236 574q0 -42 24 -70t56 -28q36 0 59 27.5t23 70.5v90q0 7 -6 13.5t-14 6.5h-24v-120q0 -15 -9.5 -25.5t-24.5 -10.5t-24.5 10.5t-9.5 25.5v406q0 15 9.5 25.5 t24.5 10.5t24.5 -10.5t9.5 -25.5v-116h24q20 0 20 20v84q0 43 -23 70.5t-59 27.5q-32 0 -56 -28t-24 -70v-384zM256 568v398q0 30 18 50t46 20t45 -19.5t17 -50.5v-88q0 -8 -8 -8h-6v96q0 24 -13.5 41t-34.5 17q-22 0 -36 -17t-14 -41v-398q0 -25 13.5 -40.5t36.5 -15.5 q21 0 34.5 15.5t13.5 40.5v96h10h4v-4v-4v-88q0 -31 -17 -51.5t-45 -20.5t-46 21t-18 51zM432 574q0 -43 25.5 -70.5t60.5 -27.5q37 0 61.5 27.5t24.5 70.5v384q0 43 -24.5 70.5t-61.5 27.5q-35 0 -60.5 -27.5t-25.5 -70.5v-384zM452 568v398q0 30 19 50t47 20 q27 0 45.5 -20t18.5 -50v-398q0 -30 -18.5 -51t-45.5 -21q-28 0 -47 21t-19 51zM468 568q0 -25 13.5 -40.5t36.5 -15.5t36.5 15.5t13.5 40.5v398q0 24 -14 41t-36 17t-36 -17t-14 -41v-398zM480 294h4l4 -4h288l34 -24v6q0 4 -2 7t-4 4l-2 1l-16 12l16 14q8 4 8 12v8 l-34 -28h-296v-8zM484 564v406q0 15 9.5 25.5t24.5 10.5t24.5 -10.5t9.5 -25.5v-406q0 -15 -9.5 -25.5t-24.5 -10.5t-24.5 10.5t-9.5 25.5zM592 1220h256v-28q0 -11 8 -16l58 -34h12h8l58 34q12 6 12 16v28h42v-28q0 -4 12 -16l60 -34h6h12l58 34q8 5 8 16v28h256v10l-4 4 h-252v28q0 11 -8 16l-58 34q-12 6 -18 0l-26 -18l-22 30l24 12q8 8 8 16v68q0 10 -8 18l-60 34q-3 3 -9 3t-9 -3l-60 -34q-6 -6 -6 -18v-68q0 -10 6 -16l24 -12l-22 -30l-24 18q-7 7 -20 0l-58 -34q-8 -5 -8 -16v-28h-252l-4 -4v-10zM636 504q0 -8 7 -14t17 -6h60 q43 0 62.5 27t19.5 83v344q0 58 -19.5 85t-62.5 27h-60q-10 0 -17 -6t-7 -14v-526zM658 508v4v514l2 4h60q34 0 48 -21t14 -67v-352q0 -47 -14 -66.5t-48 -19.5h-60v4h-2zM670 516h50q27 0 37.5 17t10.5 57v352q0 41 -10.5 57.5t-37.5 16.5h-50v-500zM690 534v464h30 q18 0 25 -11t7 -39v-362q0 -29 -7 -40.5t-25 -11.5h-30zM836 504q0 -8 7.5 -14t16.5 -6h96q8 0 14 6t6 14v28h-84v220h38q22 0 22 20v28h-60v202h84v28q0 8 -6 14t-14 6h-96q-9 0 -16.5 -6t-7.5 -14v-526zM850 268h38v8h-28v20h24v6h-24v20h28v4h-38v-58zM856 504v4v518 q0 4 4 4l4 4h86l2 -4l4 -4v-6h-84v-238h58v-6q0 -8 -4 -8h-54v-254h84v-6l-4 -4l-2 -4h-90v4h-4zM860 1192v70q0 4 4 4l58 32l4 4q4 0 4 -4l22 -14l-22 -34h-4q-24 0 -24 -24q0 -22 24 -22q18 0 24 16h38v-28q0 -4 -2 -4l-56 -32q-8 -8 -8 0l-58 32zM902 280q0 -12 8 -12h20 q8 0 8 12v10q0 10 -8 10q-8 2 -16 2q-6 6 -6 8v8q2 4 6 4h12l4 -4v-8h8v8q0 8 -8 8h-20q-8 0 -8 -8v-12q0 -5 8 -10q8 0 16 -2l4 -4v-10q0 -4 -4 -4h-16l-2 4v6h-6v-6zM942 1244l24 34l20 -12q2 0 2 -4v-28h-38q-2 2 -4 5t-4 5zM950 322h16v-54h10v54h16v4h-42v-4zM962 1348 v76l62 32q0 4 2 4v-4l62 -32l4 -4v-68l-4 -4l-24 -12l-20 34q0 2 3 7t3 9q0 10 -7.5 17t-16.5 7q-11 0 -18.5 -7t-7.5 -17q0 -4 8 -16l-22 -34zM972 1288l16 32l28 -18h10h8l28 18l16 -32l-20 -10q-12 -12 -12 -16v-28h-42v28q0 10 -12 16zM986 268h10v12h-10v-12zM996 1328 l24 34h6h8l20 -34l-28 -12q0 -3 -1 -3t-1 3zM1030 268h34v8h-24v10q0 4 4 4q4 2 8.5 4t5.5 2q6 4 6 10v12q0 8 -6 8h-18q-2 0 -6 -2.5t-4 -5.5v-4l10 -4v8q0 4 4 4h10q4 0 4 -4v-12q0 -4 -4 -4q-8 -2 -14 -6q-10 0 -10 -6v-22zM1062 1192v28h40q1 -7 8 -11.5t14 -4.5 q24 0 24 22q0 24 -24 24h-6l-20 34l24 14l2 4q4 0 4 -4l58 -32q4 0 4 -4v-70q0 -4 -4 -4l-58 -32q0 -3 -2 -3t-4 3l-58 32zM1062 1234v28l2 4l20 12l24 -34q-2 -2 -6 -10h-40zM1082 280q0 -12 10 -12h12q12 0 12 12v38q0 8 -12 8h-12q-10 0 -10 -8v-38zM1088 280v38l4 4h12 q4 0 4 -4v-38l-4 -4h-12q-4 0 -4 4zM1094 504q0 -8 6.5 -14t15.5 -6h30v242h34q30 0 52 22t22 72v142q0 88 -74 88h-64q-9 0 -15.5 -6t-6.5 -14v-526zM1112 508v516l4 2l2 4h62q54 0 54 -68v-146q0 -68 -54 -68h-56v-248h-6q-6 0 -6 8zM1124 314l16 8v-54h8v58h-8l-16 -4v-8 zM1124 762h56q44 0 44 54v146q0 54 -44 54h-56v-254zM1146 780v218h34q22 0 22 -32v-158q0 -28 -22 -28h-34zM1166 268h34v8h-28v10l4 4q4 2 18 6q6 6 6 10v12q0 8 -10 8h-18q-6 0 -6 -8v-4l6 -4v8l4 4h10q4 0 4 -4v-12q0 -4 -4 -4l-14 -6q-6 0 -6 -6v-22zM1240 266l38 24 h286l2 4h4v2v6h-292l-38 28v-8q0 -4 2 -7t4 -4l2 -1l20 -14l-20 -12q-8 -4 -8 -12v-6zM1292 574q0 -42 24 -70t56 -28q37 0 61.5 27.5t24.5 70.5v384q0 43 -24.5 70.5t-61.5 27.5q-32 0 -56 -28t-24 -70v-384zM1308 568v398q0 30 19 50t45 20q30 0 50 -20t20 -50v-398 q0 -31 -19.5 -51.5t-50.5 -20.5q-28 0 -46 21t-18 51zM1322 568q0 -25 15 -40.5t35 -15.5q24 0 40 15.5t16 40.5v398q0 24 -16 41t-40 17q-20 0 -35 -17t-15 -41v-398zM1342 564v406q0 15 8.5 25.5t21.5 10.5q15 0 25.5 -10.5t10.5 -25.5v-406q0 -15 -10.5 -25.5 t-25.5 -10.5q-13 0 -21.5 10.5t-8.5 25.5zM1496 504q0 -8 6 -14t14 -6h94q20 0 20 20v28h-84v220h40q20 0 20 20v28h-60v202h84v28q0 20 -20 20h-94q-8 0 -14 -6t-6 -14v-526zM1512 508v518l4 4l4 4h84l2 -4l4 -4v-6h-84v-238h60v-6q0 -8 -6 -8h-54v-254h84v-6q0 -4 -4 -4 l-2 -4h-84l-4 4zM1658 1002h54v-498q0 -8 6.5 -14t15.5 -6h30v518h52v28q0 7 -7 13.5t-15 6.5h-114q-22 0 -22 -20v-28zM1680 1020v6q0 4 2 4q0 4 2 4h104q0 -4 4 -4v-10h-50v-520h-4q-8 0 -8 8v512h-50z" />
|
19 |
-
<glyph unicode="F" d="M24 -286q0 -46 34 -80t80 -34h1772q46 0 80 34t34 80v1772q0 46 -34 80t-80 34h-1772q-46 0 -80 -34t-34 -80v-1772zM972 478v264h194v228q0 68 23 128t67.5 108t119 76t170.5 28q48 0 94.5 -2.5t69.5 -5.5l22 -2l-4 -248q-82 2 -170 2q-67 0 -89.5 -28.5t-22.5 -89.5 v-194h288l-12 -264h-276v-736h-280v736h-194z" />
|
20 |
-
<glyph unicode="G" d="M134 708q0 183 68 345.5t190 284.5q54 52 129 52t127 -52q50 -52 50 -125t-50 -127q-74 -73 -116 -171.5t-42 -206.5q0 -109 42 -208t113.5 -170.5t170.5 -113.5t208 -42q147 0 270.5 71t195.5 194t72 269q0 173 -99 311.5t-257 194.5v-416q0 -75 -53.5 -126.5 t-128.5 -51.5q-74 0 -126 51.5t-52 126.5v624q0 74 52 126t126 52q182 0 347.5 -70.5t284.5 -190.5t189.5 -285t70.5 -346q0 -182 -70.5 -347.5t-189.5 -285t-284.5 -190.5t-347.5 -71q-181 0 -345.5 71t-284 190.5t-190 285t-70.5 347.5z" />
|
21 |
-
<glyph unicode="I" d="M0 26v934q146 30 216.5 53.5t103.5 56.5q16 20 32 54t24 58l8 24q3 -3 6.5 -9t14 -24.5t15 -35.5t8.5 -42.5t-6 -44.5q-6 -12 -11 -20.5t-8.5 -15.5t-9.5 -14t-8 -11t-9.5 -9.5t-10 -8t-12.5 -9t-13.5 -8.5t-17.5 -10.5t-20 -11.5q-48 -40 -48 -91v-7q4 -55 48 -86 q17 -11 33 -11q21 1 41 19q36 34 82 122q17 34 26.5 79.5t13.5 78t25.5 72t62.5 70.5q31 24 70 30q29 4 56 5q10 0 20 -1q11 -1 22 -1q28 0 58 4q42 5 92.5 38.5t101.5 100.5q38 47 81 74t83 33q24 4 47 3q16 0 31 -1q39 -4 70.5 -16.5t56 -25.5t37.5 -23l14 -10 q-6 2 -15.5 6t-38.5 12q-30 8 -58 12q-15 2 -33 1q-15 0 -32 -1q-37 -3 -68.5 -16.5t-61.5 -44t-49 -77.5q-19 -43 -35.5 -75t-29.5 -54t-29 -38t-27 -25t-30 -16t-31.5 -10t-38 -9t-43.5 -11q-60 -16 -77 -69q-5 -16 -5 -30q0 -29 21 -52q22 -24 55 -24q28 0 65 18 q10 5 21 11q59 37 93.5 77.5t46 69t39.5 61t77 56.5q69 32 131 43.5t126 14t99 8.5q304 41 384 174q34 52 53 102t21 74l2 24q2 -6 4 -17.5t7 -45.5q4 -30 4 -60q-1 -4 -1 -7q0 -33 -10.5 -78.5t-30.5 -84.5t-59.5 -79t-95.5 -68q-94 -49 -166 -76t-106 -32t-74 -15t-78 -31 q-107 -58 -107 -146q0 -43 25 -92q36 -62 97 -68q6 -1 12 -1q55 0 111 49q33 29 51.5 72.5t20.5 72.5l2 29q3 -7 7 -19.5t11 -48.5q8 -38 8 -71t-13 -72q-13 -41 -41 -71q-56 -60 -94 -84t-92 -25h-4q-54 0 -138 27q-78 22 -135 26q-20 1 -36 1q-31 -1 -49 -5 q-28 -6 -54 -22q-46 -22 -70 -64q-13 -23 -13 -43q0 -17 9 -31q14 -25 31.5 -35.5t48.5 -5.5t74 31q60 33 102 44.5t100 11.5q122 0 218 -56q25 -16 53 -39t43 -38l16 -15q-9 5 -24.5 13t-61.5 21q-44 14 -86 16q-5 0 -11 1q-38 0 -83 -16q-52 -18 -90 -61 q-74 -82 -122 -114q-46 -31 -79 -31q-1 1 -3 1q-34 2 -90 26q-84 34 -126 46q-12 -18 -12 -56q0 -16 5 -30t10 -20l5 -6q36 0 54 -8q92 0 128 -64q12 -25 17 -50t4 -38l-1 -12q-4 3 -11.5 8.5t-31 17t-47 18t-57 6t-63.5 -13.5q-50 -20 -86 -65.5t-42 -98.5h-424 q-87 0 -152.5 65t-65.5 153z" />
|
22 |
-
<glyph unicode="J" d="M305 433q0 152 21 325.5t62 315.5q54 193 138 398q2 4 4 4q9 17 55 27.5t107 10.5q60 0 107 -11t57 -27l2 -4q76 -179 138 -398q1 -2 2 -7t2 -7l28 6l-6 16q-46 160 -86 262q48 138 80 216q4 4 4 6q12 14 56.5 24t99.5 10q57 0 102 -10.5t54 -25.5l4 -4q69 -169 112 -312 l8 -8q5 -4 13 -11.5t30 -32.5t40.5 -53.5t37.5 -73.5t27 -93q5 -27 5 -55q0 -11 -1 -23q-1 -15 -1 -33q0 -32 3 -75q5 -68 22 -126q14 -45 18 -54l-68 -26l-42 -14l-54 -22q-16 31 -30 72q-10 37 -10 102q0 26 2 56q1 29 1 56q0 75 -11 136q-11 57 -41.5 115.5t-52 86 t-36.5 42.5l-12 -2q36 -106 64 -242q19 -87 22.5 -208.5t7.5 -159.5q6 -73 34 -193t32 -171v-8q8 -67 72 -88q5 -3 34 -8q40 64 40 132q0 14 -2 28q0 2 -1 6t-1 6l40 18l128 60q11 -32 14 -80q-1 -57 -11.5 -98.5t-20.5 -54.5l-10 -13l-220 -60l2 4l-10 -4q-26 -8 -53 -8 q-32 0 -65 12q-87 -21 -194 -24q-20 -4 -44 0q-22 0 -34 2q2 22 2 92l156 38q16 3 26 22l-230 -46l-132 -28q0 -10 7.5 -17t18.5 -7l106 26q-8 -104 -8 -114q-3 -20 -22 -34q-41 -20 -94 -36q24 48 24 122h-8q-16 -83 -66 -136q-8 -10 -28 -30q-40 -26 -76 -32q29 34 40 48 q44 59 64 136l6 28q6 24 6 52q4 39 13.5 100t12.5 92q1 13 1 34q0 26 -2 61q-3 65 -17 153q-30 185 -32 356q-1 15 -1 29q0 147 25 185h-10q-21 -19 -39 -51t-25.5 -52t-21.5 -63q-17 -51 -22 -106q-1 -18 -1 -36q0 -38 7 -80q9 -60 19 -102.5t29 -109.5q12 -57 12 -107 q0 -29 -4 -55q0 -1 -46.5 9.5t-93.5 21.5l-46 11v21q0 63 -16 111q-38 80 -45 196q-2 27 -2 51q0 83 19 143q21 96 60 146q-57 -53 -82 -152q-12 -57 -15 -121q-1 -14 -1 -29q0 -51 8 -106q11 -72 36 -124q21 -58 21 -110q0 -10 -1 -20l-10 4q-52 -27 -85.5 -78.5 t-40.5 -89.5l-8 -38l12 -22l12 -6q0 -8 -8 -12q-60 -85 -60 -167q0 -45 18 -89q-78 18 -142 50q-20 12 -20 34q-7 63 -11 159t-4 248zM423 -169q0 6 5 11l54 54q39 -11 74 -16q14 -8 46 -20q70 -23 163 -23q83 0 185 19l10 -14q9 -6 7 -15.5t-11 -14.5q-95 -35 -234 -38 q-14 -2 -27 -2l-27 2q-139 3 -234 38q-11 6 -11 19zM488 19q0 89 64 179h2l178 -86q-46 -78 -46 -154v-14q0 -18 2 -26q1 -8 4 -19.5t4 -14.5q0 -6 4 -10v-4l-22 6q-10 4 -30 8q-61 15 -122 26h-8l-2 2l-14 24q-14 41 -14 83zM548 1472q0 -14 42.5 -24t101.5 -10t101.5 10 t42.5 24q0 15 -41.5 24.5t-102.5 9.5t-102.5 -9.5t-41.5 -24.5zM646 284q19 38 28 42q4 -1 17.5 -6t29 -10.5t27.5 -9.5l-14 -46l-86 30h-2zM942 964q0 -11 8 -18t18 -6l60 10q51 -246 51 -588q0 -52 -1 -106l46 8q-8 403 -70 692l192 36q19 4 26 22zM1038 1560 q0 -13 40.5 -22.5t97.5 -9.5t97.5 9.5t40.5 22.5t-40.5 22.5t-97.5 9.5t-97.5 -9.5t-40.5 -22.5zM1046 -74q16 8 44 24q31 17 28 48q0 6 2 8q20 0 64 -4q14 -2 60 -2q68 0 164 12l28 -28q7 -8 5 -17.5t-11 -12.5q-92 -33 -224 -36q-14 -2 -27 -2l-27 2q-63 0 -106 8z M1610 488l68 26q16 -24 16 -40q-6 -3 -21.5 -9t-28 -10.5t-20.5 -8.5l-8 16z" />
|
23 |
-
<glyph unicode="K" d="M126 -198v1798h1798v-1798h-1798zM446 688q0 -20 13 -33t37 -13q25 0 39.5 15t14.5 41q0 19 -12.5 31.5t-35.5 12.5q-26 0 -41 -15t-15 -39zM526 306q0 -18 20 -18h268q8 0 14 5.5t6 12.5q0 20 -20 20q-94 0 -94 48q0 20 14 40l58 138q8 17 20 27.5t30 14.5t29 5t31 1 h252q12 0 12 -10l66 -176q10 -22 10 -46q0 -42 -64 -42q-18 0 -18 -20q0 -18 18 -18h302q16 0 16 18q0 20 -14 20q-49 3 -77.5 23t-44.5 65l-278 722q-6 30 -32 30q-22 0 -42.5 -16.5t-31.5 -39.5l-320 -696q-18 -46 -41.5 -67t-68.5 -21q-9 0 -14.5 -6t-5.5 -14zM840 658v6 l124 272q31 59 38 98q0 6 4 6q2 0 2 -6q6 -51 52 -152l70 -194q4 -6 4 -20t-26 -14h-258q-10 0 -10 4zM1480 688q0 -46 44 -46q27 0 41.5 15t14.5 41q0 19 -12 31.5t-36 12.5q-52 0 -52 -54z" />
|
24 |
-
<glyph unicode="P" d="M34 606q0 200 79 384t212 317.5t317 213t386 79.5q201 0 384 -79.5t315.5 -213t210.5 -317t78 -384.5q0 -162 -50 -313.5t-141 -272.5t-212.5 -212t-272.5 -140.5t-312 -49.5q-202 0 -386 77.5t-317 209.5t-212 315.5t-79 385.5zM128 606q0 -182 70.5 -348.5t190.5 -288 t287 -193.5t352 -72q262 0 476 137t326 363q68 139 68 294q0 129 -48.5 245t-131.5 202t-193.5 144t-234.5 77q127 -51 224 -158.5t138 -241.5q36 -100 36 -207q0 -71 -16 -145q-40 -186 -166 -318q-122 -134 -303 -196q-125 -43 -252 -43q-57 0 -115 9q-187 26 -340 151 t-230 303q-77 159 -77 341q0 15 1 31q7 200 104 368q94 173 261.5 289t366.5 149q3 0 12.5 3.5t15.5 4.5q-172 -15 -324.5 -91.5t-261.5 -195.5t-172.5 -278.5t-63.5 -334.5zM282 645q1 -35 4 -71q24 -162 115 -302.5t225 -221.5q138 -80 298 -88q17 -1 33 -1q141 0 265 59 q-84 -24 -170 -24q-122 0 -234 48t-193 129t-129 194.5t-48 238.5q0 231 162 406v8l16 16q110 125 264 198.5t324 73.5q176 0 335.5 -80t264.5 -216q-30 50 -78 110q-116 140 -275.5 221t-332.5 87q-27 2 -54 2q-149 0 -289 -56q-165 -66 -281 -194q-120 -114 -176 -276 q-45 -128 -46 -261zM572 650q0 -22 2 -44q6 -127 92 -235.5t208 -144.5q52 -14 103 -14q69 0 141 26q124 44 186 142q59 90 59 193q1 17 -1 35q-12 122 -96 206q-80 85 -201 97q-19 2 -37 2q-98 0 -170 -55q-88 -63 -114 -178q-7 -28 -7 -58q0 -67 35 -140q61 -94 162 -118 q34 -8 66 -8q65 0 120 32q99 74 110 154q5 25 5 49q0 69 -45 129q-23 33 -64 56.5t-82 29.5q-84 0 -162 -62q-48 -48 -48 -117q0 -20 2 -37q7 -69 86 -132q28 -14 98 -14q-51 0 -89 29.5t-57 76.5v8q-15 30 -15 60q0 43 31 86q47 70 146 70q96 -15 138 -94q25 -34 28 -80 v-11q0 -40 -20 -77q-36 -90 -146 -116q-21 -6 -43 -6l-143 62q-36 36 -56 85q-15 38 -15 76q0 11 1 23q0 71 46.5 130.5t120.5 85.5q39 14 80 14h5q32 0 64 -8q76 -18 131 -78q55 -58 71 -136q6 -31 6 -64q0 -48 -14 -98q-26 -76 -95 -130.5t-153 -68.5q-27 -5 -54 -5 q-57 0 -114 20q-117 41 -186 176q-28 57 -34 128q-2 18 -2 35q0 52 14 99q42 134 172 212q94 56 191 56q37 0 75 -8q144 -15 247 -134.5t109 -271.5q0 -77 -24 -153.5t-68 -132.5q-98 -132 -248 -176q-67 -19 -142 -19q-57 0 -120 11q107 -40 194 -40q143 0 263.5 71.5 t189.5 192.5t69 262q-10 119 -69.5 224.5t-152.5 173.5q-109 88 -256 100q-13 1 -27 1h-13q-123 0 -228 -61q-124 -59 -202 -186q-54 -93 -54 -208z" />
|
25 |
-
<glyph unicode="V" d="M155 1198q1 38 21 73q28 49 80 67l718 254q21 8 50 8t50 -8l718 -254q52 -18 80 -67q21 -35 21 -73q0 -15 -3 -30q-6 -30 -14.5 -65.5t-40 -144t-69 -209.5t-102.5 -244t-138.5 -267t-179.5 -258.5t-224 -237.5q-41 -38 -98 -38t-98 38q-118 103 -224 237.5t-179.5 258.5 t-138.5 267t-102.5 244t-69 209.5t-40 144t-14.5 65.5q-3 15 -3 30zM224 1199q0 -8 2 -17q3 -17 13.5 -62.5t39.5 -142.5t66.5 -203t99.5 -240.5t134 -258.5t174.5 -253.5t216.5 -229.5q23 -20 54 -20t54 20q114 101 216.5 230.5t175 253.5t134.5 258.5t99.5 240t66 202.5 t39 142t13.5 63q2 9 2 17q0 21 -11 39q-15 26 -43 36l-718 254q-14 4 -28 4l-28 -4l-718 -254q-28 -10 -43 -36q-11 -19 -11 -39zM306 1198l718 252l718 -252q-4 -18 -11 -50.5t-36 -131.5t-63.5 -197.5t-95.5 -234t-130.5 -256t-170 -248.5t-211.5 -226q-111 98 -211 224.5 t-170.5 251.5t-130 253t-96.5 237t-63 194.5t-37 134.5zM508 1112l96 -242h22q12 0 22 -8.5t14 -17.5l4 -8l254 -626h208l250 618l4 8q14 34 40 34h22l96 242h-284l-232 -586l-232 586h-284z" />
|
26 |
-
<glyph unicode="W" d="M24 606q0 203 79.5 388.5t213.5 319t319 213t388 79.5q163 0 315.5 -50.5t275.5 -143t215.5 -215.5t143 -275.5t50.5 -315.5t-50.5 -315.5t-143 -275.5t-215.5 -215.5t-275.5 -143t-315.5 -50.5q-203 0 -388 79.5t-319 213t-213.5 319t-79.5 388.5zM150 606 q0 -252 132 -461.5t352 -320.5l-412 1130q-72 -162 -72 -348zM304 1100h26q68 0 124.5 2.5t79.5 5.5l22 2q28 1 46 -16t19.5 -39.5t-13 -42.5t-42.5 -24t-70 -6l288 -858l194 578l-102 276l-88 10q-22 1 -36.5 14.5t-16.5 31.5t2.5 36t21 29.5t39.5 10.5q52 -10 194 -10 q69 0 125.5 2.5t78.5 5.5l22 2q28 1 46 -16t19.5 -39.5t-13 -42.5t-42.5 -24q-26 -4 -68 -6l286 -850l88 292q68 179 68 288q0 50 -14 102q-21 54 -38 82q-33 51 -45.5 72.5t-27.5 60.5t-15 73q0 62 41 108.5t103 47.5q-117 107 -267 165.5t-315 58.5q-220 0 -410.5 -103 t-309.5 -279zM778 -232q123 -38 246 -38q152 0 290 52q0 2 -2 2l-272 746zM1476 -144q194 118 309 317t115 433q0 208 -96 400q4 -44 4 -66q0 -149 -70 -316z" />
|
27 |
-
<glyph unicode="s" horiz-adv-x="1200" d="M604 186q154 133 278.5 378.5t179.5 497.5l-458 168v-24q18 -7 61 -22t65 -24l256 -90q4 -2 17 -7t23 -9t10 -6q0 -6 -4 -18l-428 154v-28q102 -35 178 -64q244 -85 244 -90q0 -4 -6 -16l-416 150v-30l292 -104h30q-1 -2 -2 -5t-2 -5l92 -34q-1 -2 -3 -8t-5 -8l-92 32 l-8 -26q20 -5 57 -18t37 -16l-6 -18l-94 34l-12 -24l98 -34q-3 -13 -8 -20l-96 36q-5 -9 -8 -26l98 -34q-2 -4 -4 -10.5t-4 -9.5l-120 42q-3 0 -9.5 -8t-6.5 -12l128 -46q-1 -2 -4 -9t-6 -9l-126 44q-5 -14 -10 -22l128 -48q-1 -2 -2.5 -6t-3 -6.5t-4.5 -3.5l-124 44 q-2 -4 -10 -24l128 -48l-10 -16l-126 44q-1 -4 -4 -12t-4 -12l124 -46q-1 -2 -4.5 -8t-5.5 -8l-122 44q-2 -4 -5 -12t-5 -12l122 -46l-8 -16l-122 44q-1 -3 -4 -11.5t-4 -14.5l118 -42l-10 -18l-118 42l-8 -24l114 -42q-8 -12 -10 -18l-112 40q-2 -3 -5 -12t-5 -12l106 -36 l2 -4q-8 -12 -12 -16l-104 38l-8 -26l100 -36q-8 -12 -12 -16l-96 34q-8 -16 -10 -24l92 -34q-4 -4 -12 -16l-84 32h-66v-6l134 -48q-8 -12 -14 -16l-120 44v-28l104 -40l-14 -14l-90 32v-28l72 -26q-4 -6 -14 -16l-58 22v-30q28 -8 38 -14l-14 -16q-4 2 -12 5t-12 5v-64z M604 616q10 15 10 24q0 2 -10 2v-26zM604 664l18 -6q1 2 4 10.5t4 15.5l-26 8v-28zM604 714l36 -12q1 4 4 12t4 12l-44 16v-28zM604 764l52 -20q4 10 8 26l-60 20v-26zM604 812l66 -24q9 12 12 24l-78 28v-28zM604 862l86 -32q1 4 2.5 8t3 9t2.5 7l-94 34v-26zM604 910 l102 -36q1 3 4 10.5t4 13.5l-110 40v-28zM604 960l120 -42q1 2 2.5 7t3 9t2.5 8l-128 46v-28zM604 1008l136 -48q3 6 8 26l-144 50v-28zM604 1058l156 -56h74l-230 84v-28z" />
|
28 |
-
<glyph unicode="v" horiz-adv-x="1372" d="M155 1059q0 21 10 39q13 24 39 36l460 164q12 4 25 4l25 -4l460 -164q26 -12 39 -36q10 -19 10 -39q0 -6 -1 -13q0 -1 -1 -6q-8 -36 -18 -72.5t-36 -123.5t-63.5 -172t-88 -183.5t-123 -193.5t-154.5 -169q-20 -20 -50 -20q-28 0 -48 20q-102 91 -189 219t-138 238 t-89.5 223.5t-51 165.5t-16.5 74q-1 7 -1 13zM199 1049q0 -5 1 -9q2 -13 8.5 -39.5t24.5 -89t40.5 -128t61 -151t83 -163.5t107.5 -160t133 -145q14 -10 31 -10t29 10q97 87 179.5 209t130 225.5t84.5 214t48.5 156.5t15.5 71q1 6 1 13q0 9 -5 19q-8 16 -24 22l-444 160 q-3 0 -8 1t-8 1l-14 -2l-444 -160q-16 -6 -24 -22q-6 -11 -7 -23zM368 1000h168l152 -390l154 390h168q-6 -15 -16 -43.5t-19 -51.5t-19 -43q-2 -4 -6.5 -6t-10.5 -3.5t-9 -2.5q-5 -3 -8.5 -6.5t-6 -9t-4 -8.5t-4 -10.5t-3.5 -9.5l-24 -60q-108 -273 -128 -324h-126l-54 132 q-8 24 -28 72q-8 24 -28 72l-30 74q-4 9 -9 24t-10.5 27t-14.5 23q-4 4 -9 5.5t-11 1.5t-8 1q-25 61 -56 146z" />
|
29 |
-
<glyph unicode=" " horiz-adv-x="803" />
|
30 |
-
<glyph unicode=" " horiz-adv-x="1606" />
|
31 |
-
<glyph unicode=" " horiz-adv-x="803" />
|
32 |
-
<glyph unicode=" " horiz-adv-x="1606" />
|
33 |
-
<glyph unicode=" " horiz-adv-x="535" />
|
34 |
-
<glyph unicode=" " horiz-adv-x="401" />
|
35 |
-
<glyph unicode=" " horiz-adv-x="267" />
|
36 |
-
<glyph unicode=" " horiz-adv-x="267" />
|
37 |
-
<glyph unicode=" " horiz-adv-x="200" />
|
38 |
-
<glyph unicode=" " horiz-adv-x="321" />
|
39 |
-
<glyph unicode=" " horiz-adv-x="89" />
|
40 |
-
<glyph unicode=" " horiz-adv-x="321" />
|
41 |
-
<glyph unicode=" " horiz-adv-x="401" />
|
42 |
-
<glyph unicode="" horiz-adv-x="500" d="M0 0z" />
|
43 |
-
</font>
|
44 |
-
</defs></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/fonts/automatticons/automatticons.ttf
DELETED
Binary file
|
_inc/fonts/automatticons/automatticons.woff
DELETED
Binary file
|
_inc/fonts/jetpack/jetpack.eot
DELETED
Binary file
|
_inc/fonts/jetpack/jetpack.svg
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<!--
|
4 |
-
2014-6-30: Created.
|
5 |
-
-->
|
6 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
7 |
-
<metadata>
|
8 |
-
Created by FontForge 20120731 at Mon Jun 30 11:24:39 2014
|
9 |
-
By Michael Arestad
|
10 |
-
Created by Michael Arestad with FontForge 2.0 (http://fontforge.sf.net)
|
11 |
-
</metadata>
|
12 |
-
<defs>
|
13 |
-
<font id="jetpack" horiz-adv-x="512" >
|
14 |
-
<font-face
|
15 |
-
font-family="jetpack"
|
16 |
-
font-weight="500"
|
17 |
-
font-stretch="normal"
|
18 |
-
units-per-em="512"
|
19 |
-
panose-1="2 0 6 9 0 0 0 0 0 0"
|
20 |
-
ascent="448"
|
21 |
-
descent="-64"
|
22 |
-
bbox="51.2002 -12.7998 460.8 396.8"
|
23 |
-
underline-thickness="25.6"
|
24 |
-
underline-position="-51.2"
|
25 |
-
unicode-range="U+F102-F102"
|
26 |
-
/>
|
27 |
-
<missing-glyph />
|
28 |
-
<glyph glyph-name="uniF102" unicode=""
|
29 |
-
d="M256 396.8c113.101 0 204.8 -91.6992 204.8 -204.8s-91.6992 -204.8 -204.8 -204.8s-204.8 91.6992 -204.8 204.8s91.6992 204.8 204.8 204.8zM230.4 140.8v179.2l-80.0771 -125.491c-8.42285 -14.5918 -0.563477 -33.1777 15.7441 -37.3252zM361.677 189.491
|
30 |
-
c8.39648 14.5918 0.563477 33.1777 -15.7441 37.3252l-64.333 16.3838v-179.2z" />
|
31 |
-
</font>
|
32 |
-
</defs></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/fonts/jetpack/jetpack.ttf
DELETED
Binary file
|
_inc/fonts/jetpack/jetpack.woff
DELETED
Binary file
|
_inc/footer.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
</div><!-- .wrapper -->
|
2 |
-
<div class="footer">
|
3 |
-
|
4 |
-
<nav class="primary nav-horizontal">
|
5 |
-
<div class="a8c-attribution">
|
6 |
-
<span>
|
7 |
-
<?php echo sprintf( __( 'An %s Airline', 'jetpack' ),
|
8 |
-
'<a href="http://automattic.com/" class="a8c-logo">Automattic</a>'
|
9 |
-
); ?>
|
10 |
-
</span>
|
11 |
-
</div>
|
12 |
-
</nav><!-- .primary -->
|
13 |
-
|
14 |
-
<nav class="secondary nav-horizontal">
|
15 |
-
<div class="secondary-footer">
|
16 |
-
<a href="http://jetpack.com">Jetpack <?php echo JETPACK__VERSION; ?></a>
|
17 |
-
<a href="http://wordpress.com/tos/"><?php esc_html_e( 'Terms', 'jetpack' ); ?></a>
|
18 |
-
<a href="http://automattic.com/privacy/"><?php esc_html_e( 'Privacy', 'jetpack' ); ?></a>
|
19 |
-
<?php if ( current_user_can( 'jetpack_manage_modules' ) ) : ?><a href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack-debugger' ) ); ?>" title="<?php esc_attr_e( 'Test your site’s compatibility with Jetpack.', 'jetpack' ); ?>"><?php _e( 'Debug', 'jetpack' ); ?><?php endif; ?></a>
|
20 |
-
<a href="http://jetpack.com/contact-support/" title="<?php esc_attr_e( 'Contact the Jetpack Happiness Squad.', 'jetpack' ); ?>"><?php _e( 'Support', 'jetpack' ); ?></a>
|
21 |
-
<a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" title="<?php esc_attr_e( 'Take a survey. Tell us how we’re doing.', 'jetpack' ); ?>"><?php _e( 'Give Us Feedback', 'jetpack' ); ?></a>
|
22 |
-
<?php if ( Jetpack::is_active() && current_user_can( 'jetpack_disconnect' ) ) : ?>
|
23 |
-
<a href="<?php echo esc_url( Jetpack::admin_url( 'page=my_jetpack#disconnect' ) ); ?>"><?php esc_html_e( 'Disconnect Jetpack', 'jetpack' ); ?></a>
|
24 |
-
<?php endif; ?>
|
25 |
-
</div>
|
26 |
-
</nav><!-- .secondary -->
|
27 |
-
</div><!-- .footer -->
|
28 |
-
|
29 |
-
<div class="modal" aria-labelledby="modal-label">
|
30 |
-
<header>
|
31 |
-
<a href="#" class="close">×</a>
|
32 |
-
<ul>
|
33 |
-
<li class="learn-more"><a href="javascript:;" data-tab="learn-more"><?php esc_html_e( 'Learn More', 'jetpack' ); ?></a></li>
|
34 |
-
<li class="config"><a href="javascript:;" data-tab="config"><?php esc_html_e( 'Config', 'jetpack' ); ?></a></li>
|
35 |
-
</ul>
|
36 |
-
</header>
|
37 |
-
<div class="content-container"><div class="content"></div></div>
|
38 |
-
</div>
|
39 |
-
<div class="shade"></div>
|
40 |
-
|
41 |
-
</div><!-- .jp-frame -->
|
42 |
-
</div><!-- .jp-content -->
|
43 |
-
|
44 |
-
<?php if ( 'jetpack_modules' == $_GET['page'] ) return; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/gallery-settings.js
CHANGED
@@ -7,27 +7,13 @@
|
|
7 |
// Wrap the render() function to append controls.
|
8 |
media.view.Settings.Gallery = media.view.Settings.Gallery.extend({
|
9 |
render: function() {
|
10 |
-
var $el = this.$el;
|
11 |
-
|
12 |
media.view.Settings.prototype.render.apply( this, arguments );
|
13 |
|
14 |
// Append the type template and update the settings.
|
15 |
-
|
16 |
media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute.
|
17 |
this.update.apply( this, ['type'] );
|
18 |
-
|
19 |
-
// Hide the Columns setting for all types except Default
|
20 |
-
$el.find( 'select[name=type]' ).on( 'change', function () {
|
21 |
-
var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' );
|
22 |
-
|
23 |
-
if ( 'default' === $( this ).val() || 'thumbnails' === $( this ).val() ) {
|
24 |
-
columnSetting.show();
|
25 |
-
} else {
|
26 |
-
columnSetting.hide();
|
27 |
-
}
|
28 |
-
} ).change();
|
29 |
-
|
30 |
return this;
|
31 |
}
|
32 |
});
|
33 |
-
})(jQuery);
|
7 |
// Wrap the render() function to append controls.
|
8 |
media.view.Settings.Gallery = media.view.Settings.Gallery.extend({
|
9 |
render: function() {
|
|
|
|
|
10 |
media.view.Settings.prototype.render.apply( this, arguments );
|
11 |
|
12 |
// Append the type template and update the settings.
|
13 |
+
this.$el.append( media.template( 'jetpack-gallery-settings' ) );
|
14 |
media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute.
|
15 |
this.update.apply( this, ['type'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
return this;
|
17 |
}
|
18 |
});
|
19 |
+
})(jQuery);
|
_inc/genericons.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Globally registers the 'genericons' style and font.
|
5 |
-
*
|
6 |
-
* This ensures any theme or plugin using it is on the latest version of Genericons, and helps to avoid conflicts.
|
7 |
-
*/
|
8 |
-
add_action( 'init', 'jetpack_register_genericons', 1 );
|
9 |
-
function jetpack_register_genericons() {
|
10 |
-
if ( ! wp_style_is( 'genericons', 'registered' ) ) {
|
11 |
-
wp_register_style( 'genericons', plugins_url( 'genericons/genericons/genericons.css', __FILE__ ), false, '3.1' );
|
12 |
-
}
|
13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/COPYING.txt
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
Genericons is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
2 |
-
|
3 |
-
The fonts are distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
4 |
-
|
5 |
-
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
6 |
-
|
7 |
-
As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
|
8 |
-
|
9 |
-
This license does not convey any intellectual property rights to third party trademarks that may be included in the icon font; such marks remain subject to all rights and guidelines of use of their owner.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/LICENSE.txt
DELETED
@@ -1,339 +0,0 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
-
Everyone is permitted to copy and distribute verbatim copies
|
7 |
-
of this license document, but changing it is not allowed.
|
8 |
-
|
9 |
-
Preamble
|
10 |
-
|
11 |
-
The licenses for most software are designed to take away your
|
12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
13 |
-
License is intended to guarantee your freedom to share and change free
|
14 |
-
software--to make sure the software is free for all its users. This
|
15 |
-
General Public License applies to most of the Free Software
|
16 |
-
Foundation's software and to any other program whose authors commit to
|
17 |
-
using it. (Some other Free Software Foundation software is covered by
|
18 |
-
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
-
your programs, too.
|
20 |
-
|
21 |
-
When we speak of free software, we are referring to freedom, not
|
22 |
-
price. Our General Public Licenses are designed to make sure that you
|
23 |
-
have the freedom to distribute copies of free software (and charge for
|
24 |
-
this service if you wish), that you receive source code or can get it
|
25 |
-
if you want it, that you can change the software or use pieces of it
|
26 |
-
in new free programs; and that you know you can do these things.
|
27 |
-
|
28 |
-
To protect your rights, we need to make restrictions that forbid
|
29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
-
These restrictions translate to certain responsibilities for you if you
|
31 |
-
distribute copies of the software, or if you modify it.
|
32 |
-
|
33 |
-
For example, if you distribute copies of such a program, whether
|
34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
35 |
-
you have. You must make sure that they, too, receive or can get the
|
36 |
-
source code. And you must show them these terms so they know their
|
37 |
-
rights.
|
38 |
-
|
39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
40 |
-
(2) offer you this license which gives you legal permission to copy,
|
41 |
-
distribute and/or modify the software.
|
42 |
-
|
43 |
-
Also, for each author's protection and ours, we want to make certain
|
44 |
-
that everyone understands that there is no warranty for this free
|
45 |
-
software. If the software is modified by someone else and passed on, we
|
46 |
-
want its recipients to know that what they have is not the original, so
|
47 |
-
that any problems introduced by others will not reflect on the original
|
48 |
-
authors' reputations.
|
49 |
-
|
50 |
-
Finally, any free program is threatened constantly by software
|
51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
52 |
-
program will individually obtain patent licenses, in effect making the
|
53 |
-
program proprietary. To prevent this, we have made it clear that any
|
54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
-
|
56 |
-
The precise terms and conditions for copying, distribution and
|
57 |
-
modification follow.
|
58 |
-
|
59 |
-
GNU GENERAL PUBLIC LICENSE
|
60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
-
|
62 |
-
0. This License applies to any program or other work which contains
|
63 |
-
a notice placed by the copyright holder saying it may be distributed
|
64 |
-
under the terms of this General Public License. The "Program", below,
|
65 |
-
refers to any such program or work, and a "work based on the Program"
|
66 |
-
means either the Program or any derivative work under copyright law:
|
67 |
-
that is to say, a work containing the Program or a portion of it,
|
68 |
-
either verbatim or with modifications and/or translated into another
|
69 |
-
language. (Hereinafter, translation is included without limitation in
|
70 |
-
the term "modification".) Each licensee is addressed as "you".
|
71 |
-
|
72 |
-
Activities other than copying, distribution and modification are not
|
73 |
-
covered by this License; they are outside its scope. The act of
|
74 |
-
running the Program is not restricted, and the output from the Program
|
75 |
-
is covered only if its contents constitute a work based on the
|
76 |
-
Program (independent of having been made by running the Program).
|
77 |
-
Whether that is true depends on what the Program does.
|
78 |
-
|
79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
80 |
-
source code as you receive it, in any medium, provided that you
|
81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
-
notices that refer to this License and to the absence of any warranty;
|
84 |
-
and give any other recipients of the Program a copy of this License
|
85 |
-
along with the Program.
|
86 |
-
|
87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
89 |
-
|
90 |
-
2. You may modify your copy or copies of the Program or any portion
|
91 |
-
of it, thus forming a work based on the Program, and copy and
|
92 |
-
distribute such modifications or work under the terms of Section 1
|
93 |
-
above, provided that you also meet all of these conditions:
|
94 |
-
|
95 |
-
a) You must cause the modified files to carry prominent notices
|
96 |
-
stating that you changed the files and the date of any change.
|
97 |
-
|
98 |
-
b) You must cause any work that you distribute or publish, that in
|
99 |
-
whole or in part contains or is derived from the Program or any
|
100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
101 |
-
parties under the terms of this License.
|
102 |
-
|
103 |
-
c) If the modified program normally reads commands interactively
|
104 |
-
when run, you must cause it, when started running for such
|
105 |
-
interactive use in the most ordinary way, to print or display an
|
106 |
-
announcement including an appropriate copyright notice and a
|
107 |
-
notice that there is no warranty (or else, saying that you provide
|
108 |
-
a warranty) and that users may redistribute the program under
|
109 |
-
these conditions, and telling the user how to view a copy of this
|
110 |
-
License. (Exception: if the Program itself is interactive but
|
111 |
-
does not normally print such an announcement, your work based on
|
112 |
-
the Program is not required to print an announcement.)
|
113 |
-
|
114 |
-
These requirements apply to the modified work as a whole. If
|
115 |
-
identifiable sections of that work are not derived from the Program,
|
116 |
-
and can be reasonably considered independent and separate works in
|
117 |
-
themselves, then this License, and its terms, do not apply to those
|
118 |
-
sections when you distribute them as separate works. But when you
|
119 |
-
distribute the same sections as part of a whole which is a work based
|
120 |
-
on the Program, the distribution of the whole must be on the terms of
|
121 |
-
this License, whose permissions for other licensees extend to the
|
122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
-
|
124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
125 |
-
your rights to work written entirely by you; rather, the intent is to
|
126 |
-
exercise the right to control the distribution of derivative or
|
127 |
-
collective works based on the Program.
|
128 |
-
|
129 |
-
In addition, mere aggregation of another work not based on the Program
|
130 |
-
with the Program (or with a work based on the Program) on a volume of
|
131 |
-
a storage or distribution medium does not bring the other work under
|
132 |
-
the scope of this License.
|
133 |
-
|
134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
135 |
-
under Section 2) in object code or executable form under the terms of
|
136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
-
|
138 |
-
a) Accompany it with the complete corresponding machine-readable
|
139 |
-
source code, which must be distributed under the terms of Sections
|
140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
-
|
142 |
-
b) Accompany it with a written offer, valid for at least three
|
143 |
-
years, to give any third party, for a charge no more than your
|
144 |
-
cost of physically performing source distribution, a complete
|
145 |
-
machine-readable copy of the corresponding source code, to be
|
146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
-
customarily used for software interchange; or,
|
148 |
-
|
149 |
-
c) Accompany it with the information you received as to the offer
|
150 |
-
to distribute corresponding source code. (This alternative is
|
151 |
-
allowed only for noncommercial distribution and only if you
|
152 |
-
received the program in object code or executable form with such
|
153 |
-
an offer, in accord with Subsection b above.)
|
154 |
-
|
155 |
-
The source code for a work means the preferred form of the work for
|
156 |
-
making modifications to it. For an executable work, complete source
|
157 |
-
code means all the source code for all modules it contains, plus any
|
158 |
-
associated interface definition files, plus the scripts used to
|
159 |
-
control compilation and installation of the executable. However, as a
|
160 |
-
special exception, the source code distributed need not include
|
161 |
-
anything that is normally distributed (in either source or binary
|
162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
163 |
-
operating system on which the executable runs, unless that component
|
164 |
-
itself accompanies the executable.
|
165 |
-
|
166 |
-
If distribution of executable or object code is made by offering
|
167 |
-
access to copy from a designated place, then offering equivalent
|
168 |
-
access to copy the source code from the same place counts as
|
169 |
-
distribution of the source code, even though third parties are not
|
170 |
-
compelled to copy the source along with the object code.
|
171 |
-
|
172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
-
except as expressly provided under this License. Any attempt
|
174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
-
void, and will automatically terminate your rights under this License.
|
176 |
-
However, parties who have received copies, or rights, from you under
|
177 |
-
this License will not have their licenses terminated so long as such
|
178 |
-
parties remain in full compliance.
|
179 |
-
|
180 |
-
5. You are not required to accept this License, since you have not
|
181 |
-
signed it. However, nothing else grants you permission to modify or
|
182 |
-
distribute the Program or its derivative works. These actions are
|
183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
184 |
-
modifying or distributing the Program (or any work based on the
|
185 |
-
Program), you indicate your acceptance of this License to do so, and
|
186 |
-
all its terms and conditions for copying, distributing or modifying
|
187 |
-
the Program or works based on it.
|
188 |
-
|
189 |
-
6. Each time you redistribute the Program (or any work based on the
|
190 |
-
Program), the recipient automatically receives a license from the
|
191 |
-
original licensor to copy, distribute or modify the Program subject to
|
192 |
-
these terms and conditions. You may not impose any further
|
193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
-
You are not responsible for enforcing compliance by third parties to
|
195 |
-
this License.
|
196 |
-
|
197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
-
infringement or for any other reason (not limited to patent issues),
|
199 |
-
conditions are imposed on you (whether by court order, agreement or
|
200 |
-
otherwise) that contradict the conditions of this License, they do not
|
201 |
-
excuse you from the conditions of this License. If you cannot
|
202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
203 |
-
License and any other pertinent obligations, then as a consequence you
|
204 |
-
may not distribute the Program at all. For example, if a patent
|
205 |
-
license would not permit royalty-free redistribution of the Program by
|
206 |
-
all those who receive copies directly or indirectly through you, then
|
207 |
-
the only way you could satisfy both it and this License would be to
|
208 |
-
refrain entirely from distribution of the Program.
|
209 |
-
|
210 |
-
If any portion of this section is held invalid or unenforceable under
|
211 |
-
any particular circumstance, the balance of the section is intended to
|
212 |
-
apply and the section as a whole is intended to apply in other
|
213 |
-
circumstances.
|
214 |
-
|
215 |
-
It is not the purpose of this section to induce you to infringe any
|
216 |
-
patents or other property right claims or to contest validity of any
|
217 |
-
such claims; this section has the sole purpose of protecting the
|
218 |
-
integrity of the free software distribution system, which is
|
219 |
-
implemented by public license practices. Many people have made
|
220 |
-
generous contributions to the wide range of software distributed
|
221 |
-
through that system in reliance on consistent application of that
|
222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
223 |
-
to distribute software through any other system and a licensee cannot
|
224 |
-
impose that choice.
|
225 |
-
|
226 |
-
This section is intended to make thoroughly clear what is believed to
|
227 |
-
be a consequence of the rest of this License.
|
228 |
-
|
229 |
-
8. If the distribution and/or use of the Program is restricted in
|
230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
231 |
-
original copyright holder who places the Program under this License
|
232 |
-
may add an explicit geographical distribution limitation excluding
|
233 |
-
those countries, so that distribution is permitted only in or among
|
234 |
-
countries not thus excluded. In such case, this License incorporates
|
235 |
-
the limitation as if written in the body of this License.
|
236 |
-
|
237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
-
of the General Public License from time to time. Such new versions will
|
239 |
-
be similar in spirit to the present version, but may differ in detail to
|
240 |
-
address new problems or concerns.
|
241 |
-
|
242 |
-
Each version is given a distinguishing version number. If the Program
|
243 |
-
specifies a version number of this License which applies to it and "any
|
244 |
-
later version", you have the option of following the terms and conditions
|
245 |
-
either of that version or of any later version published by the Free
|
246 |
-
Software Foundation. If the Program does not specify a version number of
|
247 |
-
this License, you may choose any version ever published by the Free Software
|
248 |
-
Foundation.
|
249 |
-
|
250 |
-
10. If you wish to incorporate parts of the Program into other free
|
251 |
-
programs whose distribution conditions are different, write to the author
|
252 |
-
to ask for permission. For software which is copyrighted by the Free
|
253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
255 |
-
of preserving the free status of all derivatives of our free software and
|
256 |
-
of promoting the sharing and reuse of software generally.
|
257 |
-
|
258 |
-
NO WARRANTY
|
259 |
-
|
260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
-
REPAIR OR CORRECTION.
|
269 |
-
|
270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
279 |
-
|
280 |
-
END OF TERMS AND CONDITIONS
|
281 |
-
|
282 |
-
How to Apply These Terms to Your New Programs
|
283 |
-
|
284 |
-
If you develop a new program, and you want it to be of the greatest
|
285 |
-
possible use to the public, the best way to achieve this is to make it
|
286 |
-
free software which everyone can redistribute and change under these terms.
|
287 |
-
|
288 |
-
To do so, attach the following notices to the program. It is safest
|
289 |
-
to attach them to the start of each source file to most effectively
|
290 |
-
convey the exclusion of warranty; and each file should have at least
|
291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
292 |
-
|
293 |
-
<one line to give the program's name and a brief idea of what it does.>
|
294 |
-
Copyright (C) <year> <name of author>
|
295 |
-
|
296 |
-
This program is free software; you can redistribute it and/or modify
|
297 |
-
it under the terms of the GNU General Public License as published by
|
298 |
-
the Free Software Foundation; either version 2 of the License, or
|
299 |
-
(at your option) any later version.
|
300 |
-
|
301 |
-
This program is distributed in the hope that it will be useful,
|
302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
-
GNU General Public License for more details.
|
305 |
-
|
306 |
-
You should have received a copy of the GNU General Public License along
|
307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
-
|
310 |
-
Also add information on how to contact you by electronic and paper mail.
|
311 |
-
|
312 |
-
If the program is interactive, make it output a short notice like this
|
313 |
-
when it starts in an interactive mode:
|
314 |
-
|
315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
-
This is free software, and you are welcome to redistribute it
|
318 |
-
under certain conditions; type `show c' for details.
|
319 |
-
|
320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
-
parts of the General Public License. Of course, the commands you use may
|
322 |
-
be called something other than `show w' and `show c'; they could even be
|
323 |
-
mouse-clicks or menu items--whatever suits your program.
|
324 |
-
|
325 |
-
You should also get your employer (if you work as a programmer) or your
|
326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
-
necessary. Here is a sample; alter the names:
|
328 |
-
|
329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
-
|
332 |
-
<signature of Ty Coon>, 1 April 1989
|
333 |
-
Ty Coon, President of Vice
|
334 |
-
|
335 |
-
This General Public License does not permit incorporating your program into
|
336 |
-
proprietary programs. If your program is a subroutine library, you may
|
337 |
-
consider it more useful to permit linking proprietary applications with the
|
338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
339 |
-
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/README.md
DELETED
@@ -1,218 +0,0 @@
|
|
1 |
-
# Genericons
|
2 |
-
|
3 |
-
Genericons are vector icons embedded in a webfont designed to be clean and simple keeping with a generic aesthetic.
|
4 |
-
|
5 |
-
Use genericons for instant HiDPI, to change icon colors on the fly, or even with CSS effects such as drop-shadows or gradients!
|
6 |
-
|
7 |
-
|
8 |
-
## Usage
|
9 |
-
|
10 |
-
To use it, place the `genericons` folder in your stylesheet directory and enqueue the genericons.css file. Now you can create an icon like this:
|
11 |
-
|
12 |
-
```
|
13 |
-
.my-icon:before {
|
14 |
-
content: '\f101';
|
15 |
-
font: normal 16px/1 'Genericons';
|
16 |
-
display: inline-block;
|
17 |
-
-webkit-font-smoothing: antialiased;
|
18 |
-
-moz-osx-font-smoothing: grayscale;
|
19 |
-
}
|
20 |
-
```
|
21 |
-
|
22 |
-
This will output a comment icon before every element with the class "my-icon". The `content: '\f101';` part of this CSS is easily copied from the helper tool at http://genericons.com/, or `example.html` in the `font` directory.
|
23 |
-
|
24 |
-
You can also use the bundled example.css if you'd rather insert the icons using HTML tags.
|
25 |
-
|
26 |
-
|
27 |
-
## Building your own Genericons
|
28 |
-
|
29 |
-
In the `source` directory, you'll find all Genericons source icons in SVG format. This will allow you to bake your own flavor of Genericons using a tool such as FontCustom (http://fontcustom.com) or Fontello (http://fontello.com). Perhaps you need more logos than are available in the base Genericons package? Just add those logos and bake your own expanded set. Maybe you need just a few of the icons Genericons provides, but would like to trim the fat? Remove the ones you won't need!
|
30 |
-
|
31 |
-
|
32 |
-
### FontCustom instructions
|
33 |
-
|
34 |
-
FontCustom is a powerful commandline tool which which bakes icon fonts from the SVG source files. It's the tool Genericons is built on, and it provides highly accurate and perfectly crisp icons, *provided all SVGs have the same pixel height*.
|
35 |
-
|
36 |
-
It's not that hard to use, and once it's installed you'll never think of icon-fonts the same way again. Seriously, you should try it. Icon fonts for everyone!
|
37 |
-
|
38 |
-
1. Install FontCustom. Follow the instructions on the website: http://fontcustom.com/
|
39 |
-
2. In the `source` directory from the Genericons download, open the file called `fontcustom.yml` in a text editor. Customize the `font_name` and `css_selector`.
|
40 |
-
3. Open a terminal. Browse to the `source` directory. Type `fontcustom compile`.
|
41 |
-
|
42 |
-
You'll now receive a brand new subdirectory called `fontcustom-webfont`. Inside here you'll find your very own flavor of Genericons, with only the icons you want, including a handy example page that'll help you copy/paste the necessary glyphs or CSS values.
|
43 |
-
|
44 |
-
*Please note*: In the source directory, there's a hidden file called `.fontcustom-manifest.json`. This file is auto-generated by the FontCustom tool, and holds codepoints (unicode addresses) for every glyph, so its address doesn't change when you add or remove icons. If you feel the need to "start fresh" with the unicode addresses, you should delete this file.
|
45 |
-
|
46 |
-
|
47 |
-
### Fontello instructions
|
48 |
-
|
49 |
-
Fontello is very easy to use. Just drop the SVG files of the icons you want onto their website and download the font. The downside is that Fontello seems to ignore the 16px pixelgrid, so you'll end up with fuzzy icons. Buyer beware.
|
50 |
-
|
51 |
-
|
52 |
-
## Notes
|
53 |
-
|
54 |
-
**Photoshop mockups**
|
55 |
-
|
56 |
-
The `Genericons.ttf` file can be placed in your system fonts folder and used Photoshop or other graphics apps if you like.
|
57 |
-
|
58 |
-
If you're using Genericons in your Photoshop mockups, please remember to delete the old version of the font from Font Book, and grab the new one from the zip file. This also affects using it in your webdesigns: if you have an old version of the font installed locally, that's the font that'll be used in your website as well, so if you're missing icons, check for old versions of the font on your system.
|
59 |
-
|
60 |
-
**Pixel grid**
|
61 |
-
|
62 |
-
Genericons has been designed for a 16x16px grid. That means it'll look sharp at font-size: 16px exactly. It'll also be crisp at multiples thereof, such as 32px or 64px. It'll look reasonably crisp at in-between font sizes such as 24px or 48px, but not quite as crisp as 16 or 32. Please don't set the font-size to 17px, though, that'll just look terrible blurry.
|
63 |
-
|
64 |
-
**Antialiasing**
|
65 |
-
|
66 |
-
If you keep intact the `-webkit-font-smoothing: antialiased;` and `-moz-osx-font-smoothing: grayscale;` CSS properties. That'll make the icons look their best possible, in Firefox and WebKit based browsers.
|
67 |
-
|
68 |
-
**optimizeLegibility**
|
69 |
-
|
70 |
-
Note: On Android browsers with version 4.2, 4.3, and probably later, Genericons will simply not show up if you're using the CSS property "text-rendering" set to "optimizeLegibility.
|
71 |
-
|
72 |
-
**Updates**
|
73 |
-
|
74 |
-
We don't often update icons, but do very carefully when we get good feedback suggesting improvements. Please be mindful if you upgrade, and check that the updated icons behave as you intended.
|
75 |
-
|
76 |
-
**Base64 encoding**
|
77 |
-
|
78 |
-
By default, Genericons ships with a stylesheet that includes a base64 encoded version of the font. This is to sidestep issues with cross-origin requests for fonts, that happen when a stylesheet loads a font that's stored on a different domain or subdomain. This is very common when using caching plugins.
|
79 |
-
|
80 |
-
Base64 encoding comes with a 25% filesize overhead compared to just loading the WOFF file directly. If you know that you won't be loading fonts across domains, or have the ability to edit your server config files to allow it, you can get slightly faster performance by loading Genericons without the base64 encoding. Simply edit `genericons.css` and edit the `@font-face` declaration to match this:
|
81 |
-
|
82 |
-
```
|
83 |
-
@font-face {
|
84 |
-
font-family: 'Genericons';
|
85 |
-
src: url('Genericons.woff') format('woff'),
|
86 |
-
url('Genericons.ttf') format('truetype'),
|
87 |
-
url('Genericons.svg#genericonsregular') format('svg');
|
88 |
-
font-weight: normal;
|
89 |
-
font-style: normal;
|
90 |
-
}
|
91 |
-
```
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
## Changelog
|
96 |
-
|
97 |
-
**3.4.1**
|
98 |
-
|
99 |
-
* IE8 support restored.
|
100 |
-
|
101 |
-
**3.4**
|
102 |
-
|
103 |
-
* Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists!
|
104 |
-
* New: Added helper rotation classes to the base CSS, thanks to geminorum. Apply `genericon-rotate-90` to rotate 90 degrees, -180, -270. Or `genericon-flip-horizontal` or -vertical.
|
105 |
-
|
106 |
-
*Again, it is important if you choose to update to this version, make sure you're not using `genericon-googleplus-alt` or unicode character `f218`, as that has been retired! Use `genericon-googleplus` and glyph `f206` instead!*
|
107 |
-
|
108 |
-
**3.3.1**
|
109 |
-
|
110 |
-
Security Hardening: Remove Genericons example.html file. Please visit genericons.com instead.
|
111 |
-
|
112 |
-
**3.3**
|
113 |
-
|
114 |
-
The Open Source release.
|
115 |
-
|
116 |
-
You can now build your own flavors of Genericons with all the SVGs provided.
|
117 |
-
|
118 |
-
|
119 |
-
**3.2**
|
120 |
-
|
121 |
-
A number of new icons and a couple of quick updates.
|
122 |
-
|
123 |
-
* New: Activity
|
124 |
-
* New: HTML anchor
|
125 |
-
* New: Bug
|
126 |
-
* New: Download
|
127 |
-
* New: Handset
|
128 |
-
* New: Microphone
|
129 |
-
* New: Minus
|
130 |
-
* New: Plus
|
131 |
-
* New: Move
|
132 |
-
* New: Rating stars, empty, half, full
|
133 |
-
* New: Shuffle
|
134 |
-
* New: video camera
|
135 |
-
* New: Spotify
|
136 |
-
* New: Twitch
|
137 |
-
* Update: Fixed geometry in Edit icon
|
138 |
-
* Update: Updated Foursquare icon
|
139 |
-
* IE8 bugfix, slipstreamed into this.
|
140 |
-
|
141 |
-
Twitch and Spotify mark the last social icons that will be added to Genericons.
|
142 |
-
Future social icons will have to happen in a separate font.
|
143 |
-
|
144 |
-
**3.1**
|
145 |
-
|
146 |
-
Genericons is now generated using a commandline tool called FontCustom. This makes it far easier to add new icons to the font, but the switch means the download zip now has a different layout, fonts have different filenames, there's now no .otf font included (but the .ttf should suffice), and the font now has slightly different metrics. I've taken great care to ensure this new version should work as a drop-in replacement, but please be mindful and test carefully if you choose to upgrade.
|
147 |
-
|
148 |
-
* Per feedback, the baked-in 16px width and height has been removed from the helper CSS. It wasn't really necessary (the glyph itself has these dimensions naturally), and it caused some headaches.
|
149 |
-
* Base64 encoding is now included by default in the helper CSS. This makes it drop-in easy to get Genericons working in Firefox even when using a CDN.
|
150 |
-
* Title attribute on website tool.
|
151 |
-
* New: Website.
|
152 |
-
* New: Ellipsis.
|
153 |
-
* New: Foursquare.
|
154 |
-
* New: X-post.
|
155 |
-
* New: Sitemap.
|
156 |
-
* New: Hierarchy.
|
157 |
-
* New: Paintbrush.
|
158 |
-
* Updated: Show and Hide icons were updated for clarity.
|
159 |
-
|
160 |
-
**3.0.3**
|
161 |
-
|
162 |
-
Bunch of updates mostly.
|
163 |
-
|
164 |
-
* Two new icons, Dropbox and Fullscreen.
|
165 |
-
* Updates to all icons containing an exclamation mark.
|
166 |
-
* Updates to Image and Quote.
|
167 |
-
* Nicer "Share" icon.
|
168 |
-
* Bigger default Linkedin icon.
|
169 |
-
|
170 |
-
**3.0.2**
|
171 |
-
|
172 |
-
A slew of new stuff and updates.
|
173 |
-
|
174 |
-
* Social icons: Skype, Digg, Reddit, Stumbleupon, Pocket.
|
175 |
-
* New generic icons: heart, lock and print.
|
176 |
-
* New editing icons: code, bold, italic, image
|
177 |
-
* New interaction icons: subscribe, unsubscribe, subscribed, reply all, reply, flag.
|
178 |
-
* The hyperlink icon has been updated to be clearer, chunkier.
|
179 |
-
* The "home" icon has been updated for style, size and clarity.
|
180 |
-
* The email icon has been updated for style and clarity, and to fit with the new subscribe icons.
|
181 |
-
* The document icon has been updated for style.
|
182 |
-
* The "pin" icon has been updated for style and clarity.
|
183 |
-
* The Twitter icon has been scaled down to fit with the other social icons.
|
184 |
-
|
185 |
-
**3.0.1**
|
186 |
-
|
187 |
-
Mostly maintenance.
|
188 |
-
|
189 |
-
* Fixed an issue with the example page that showed an old "top" icon instead of the actual NEW "refresh" icon.
|
190 |
-
* Added inverse Google+ and Path.
|
191 |
-
* Replaced tabs with spaces in the helper CSS.
|
192 |
-
* Changed the Genericons.com copy/paste tool to serve span's instead of div's for casual icon insertion. It's being converted to "inline-block" anyway.
|
193 |
-
|
194 |
-
**3.0**
|
195 |
-
|
196 |
-
Mainly maintenance and a few new icons.
|
197 |
-
|
198 |
-
* Fast forward, rewind, PollDaddy, Notice, Info, Help, Portfolio
|
199 |
-
* Updated the feed icon. It's a bit smaller now for consistency, the previous one was rather big.
|
200 |
-
* So, the previous version numbering, 2.09, wasn't very PHP version compare friendly. So from now on it'll be 3.0, 3.1 etc. Props Ipstenu.
|
201 |
-
* Genericons.com now has a mini release blog.
|
202 |
-
* The CSS has prettier formatting, props Konstantin Obenland.
|
203 |
-
|
204 |
-
**2.09**
|
205 |
-
|
206 |
-
Updated Facebook icon to new version. Updated Instagram logo to use new one-color version. Updated Google+ icon to use same radius as Instagram and Facebook. Added a bunch of new icons, cog, unapprove, cart, media player buttons, tablet, send to tablet.
|
207 |
-
|
208 |
-
**2.06**
|
209 |
-
|
210 |
-
Included Base64 encoded version. This is necessary for Genericons to work with CDNs in Firefox. Firefox blocks fonts linked from a different domain. A CDN (typically s.example.com) usually puts the font on a subdomain, and is hence blocked in Firefox.
|
211 |
-
|
212 |
-
**2.05**
|
213 |
-
|
214 |
-
Added a bunch of new icons, including upload to cloud, download to cloud, many more.
|
215 |
-
|
216 |
-
**2.0**
|
217 |
-
|
218 |
-
Initial public release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/genericons.css
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
@import url('genericons/genericons.css');
|
2 |
-
|
3 |
-
/*
|
4 |
-
|
5 |
-
|
6 |
-
This file location is deprecated
|
7 |
-
|
8 |
-
Please link to the genericons.css file in the font folder instead
|
9 |
-
|
10 |
-
|
11 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/genericons/Genericons.eot
DELETED
Binary file
|
_inc/genericons/genericons/Genericons.svg
DELETED
@@ -1,537 +0,0 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<!--
|
4 |
-
2015-9-18: Created with FontForge (http://fontforge.org)
|
5 |
-
-->
|
6 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
|
7 |
-
<metadata>
|
8 |
-
Created by FontForge 20150618 at Fri Sep 18 10:24:13 2015
|
9 |
-
By Joen Asmussen
|
10 |
-
Copyright (c) 2015, Joen Asmussen
|
11 |
-
</metadata>
|
12 |
-
<defs>
|
13 |
-
<font id="Genericons" horiz-adv-x="2048" >
|
14 |
-
<font-face
|
15 |
-
font-family="Genericons"
|
16 |
-
font-weight="400"
|
17 |
-
font-stretch="normal"
|
18 |
-
units-per-em="2048"
|
19 |
-
panose-1="2 0 5 3 0 0 0 0 0 0"
|
20 |
-
ascent="2048"
|
21 |
-
descent="0"
|
22 |
-
bbox="-0.0140489 0 2048.01 2048"
|
23 |
-
underline-thickness="102.4"
|
24 |
-
underline-position="-204.8"
|
25 |
-
unicode-range="U+0020-F517"
|
26 |
-
/>
|
27 |
-
<missing-glyph />
|
28 |
-
<glyph glyph-name="space" unicode=" " horiz-adv-x="200"
|
29 |
-
/>
|
30 |
-
<glyph glyph-name="uniF413" unicode=""
|
31 |
-
d="M256 1280c565.504 0 1024 -458.496 1024 -1024h-256c0 423.552 -344.448 768 -768 768v256zM256 1792c848.256 0 1536 -687.744 1536 -1536h-256c0 705.792 -574.208 1280 -1280 1280v256zM448 640c106.112 0 192 -86.0156 192 -192s-85.8877 -192 -192 -192
|
32 |
-
s-192 86.0156 -192 192s85.8877 192 192 192z" />
|
33 |
-
<glyph glyph-name="uniF462" unicode=""
|
34 |
-
d="M618.502 1337l-213.004 142.004l-303.335 -455.002l303.335 -455.002l213.004 142.004l-208.665 312.998zM1642.5 1479l-213.004 -142.004l208.665 -312.998l-208.665 -312.998l213.004 -142.004l303.335 455.002zM771.821 543.045l248.357 -62.0898l256 1024
|
35 |
-
l-248.357 62.0898z" />
|
36 |
-
<glyph glyph-name="uniF457" unicode=""
|
37 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 512c70.6562 0 128 57.4717 128 128s-57.3438 128 -128 128c-70.7842 0 -128 -57.4717 -128 -128s57.2158 -128 128 -128z
|
38 |
-
M1342.72 1155.84c24.832 38.9121 37.248 85.1201 37.1201 138.752c0 74.4961 -27.6475 133.504 -83.7119 176.641c-55.9355 43.2637 -133.632 64.7676 -231.936 64.7676c-119.809 0 -234.496 -31.2324 -344.32 -93.9521l91.9043 -180.096
|
39 |
-
c89.2158 47.2314 167.168 70.9121 233.983 70.9121c26.752 0 48.5127 -5.37598 65.2803 -16.2559c17.2803 -10.752 25.4717 -25.4727 25.4717 -44.0322c0 -23.2959 -8.06348 -44.0322 -23.5518 -62.208c-16 -18.0479 -41.4717 -38.4004 -77.1836 -60.9277
|
40 |
-
c-45.1846 -28.1602 -76.416 -57.0889 -94.3359 -87.04c-17.5361 -29.6963 -26.3682 -66.4326 -26.3682 -109.44v-56.96h203.647v34.0479c0 18.6885 5.50391 35.2002 17.2803 48.8965c12.0322 14.0801 40.96 36.0957 86.9121 66.0479
|
41 |
-
c55.04 34.8154 94.5918 71.6797 119.808 110.848z" />
|
42 |
-
<glyph glyph-name="uniF403" unicode=""
|
43 |
-
d="M1541.38 1530.62l506.624 -506.624l-506.624 -506.624c-131.456 -134.272 -314.752 -217.728 -517.376 -217.728c-202.752 0 -386.048 83.4551 -517.504 217.983l-506.496 506.368v0l506.496 506.496c131.456 134.4 314.624 217.984 517.504 217.984
|
44 |
-
c202.752 0 385.92 -83.584 517.376 -217.856zM1404.42 651.776l372.096 372.224l-370.943 370.944c-102.528 104.704 -237.568 161.536 -381.568 161.536c-144.128 0 -279.168 -56.9609 -380.288 -160.385l-372.096 -372.096l370.688 -370.56
|
45 |
-
c102.528 -104.96 237.696 -161.792 381.824 -161.792c144 0 279.168 56.832 380.288 160.128zM1408 1024zM640 1024c0 212.096 172.032 384 384 384s384 -171.904 384 -384c0 -211.968 -172.032 -384 -384 -384s-384 172.032 -384 384zM768 1152
|
46 |
-
c0 -70.6562 57.2158 -128 128 -128c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128c-70.7842 0 -128 -57.3438 -128 -128z" />
|
47 |
-
<glyph glyph-name="uniF505" unicode=""
|
48 |
-
d="M256 1408v256h256v-256h-256zM768 1664h1024v-256h-1024v256zM256 896v256h256v-256h-256zM1408 1152v-256h-640v256h640zM256 384v256h256v-256h-256zM768 384v256h896v-256h-896z" />
|
49 |
-
<glyph glyph-name="uniF50F" unicode=""
|
50 |
-
d="M1920 1024l-384 -384v256h-384v-384h256l-384 -384l-384 384h256v384h-384v-256l-384 384l384 384v-256h384v384h-256l384 384l384 -384h-256v-384h384v256z" />
|
51 |
-
<glyph glyph-name="uniF307" unicode=""
|
52 |
-
d="M768 640v128h128v-128h-128zM768 896v128h128v-128h-128zM768 1152v128h128v-128h-128zM512 640v128h128v-128h-128zM512 896v128h128v-128h-128zM1280 896v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1280 1152v128h128v-128h-128zM1408 1664h256v-1280h-1408
|
53 |
-
v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128zM1024 896v128h128v-128h-128zM1024 640v128h128v-128h-128z
|
54 |
-
" />
|
55 |
-
<glyph glyph-name="uniF460" unicode=""
|
56 |
-
d="M1664 1280h128l-256 -768h-768l256 768h128l86.2725 256h339.455zM1300.86 1280h214.271l-43.1357 128h-128zM809.728 1536l86.2725 -256l-256 -768h-128l-256 768h128l86.2725 256h339.455zM532.864 1280h214.271l-43.1357 128h-128z" />
|
57 |
-
<glyph glyph-name="uniF430" unicode=""
|
58 |
-
d="M1024 1453.31l86.6562 -86.6553l-342.656 -342.656h896v-128h-896l342.656 -342.656l-86.6562 -86.6553l-493.312 493.312z" />
|
59 |
-
<glyph glyph-name="uniF515" unicode=""
|
60 |
-
d="M1024 1920c499.2 0 896 -396.8 896 -896s-396.8 -896 -896 -896s-896 396.8 -896 896s396.8 896 896 896zM1382.4 601.6c38.3994 0 64 25.6006 64 51.2002c0 38.4004 -12.8008 51.2002 -38.4004 64c-153.6 89.6006 -332.8 140.8 -524.8 140.8
|
61 |
-
c-115.2 0 -217.601 -25.5996 -320 -51.1992c-25.6006 -12.8008 -51.2002 -25.6006 -51.2002 -64c0 -25.6006 12.7998 -51.2002 51.2002 -51.2002c0 0 25.5996 12.7998 38.3994 12.7998c89.6006 12.7998 192 25.5996 281.601 25.5996
|
62 |
-
c166.399 0 332.8 -38.3994 460.8 -115.199c12.7998 -12.8008 25.5996 -12.8008 38.4004 -12.8008zM1484.8 832c38.4004 0 64 38.4004 64 76.7998c0 38.4004 -12.7998 64 -38.3994 76.7998c-179.2 102.4 -409.601 166.4 -640 166.4c-153.601 0 -256 -25.5996 -358.4 -51.2002
|
63 |
-
c-38.4004 -12.7998 -51.2002 -38.3994 -51.2002 -76.7998s38.4004 -76.7998 76.7998 -89.5996c12.8008 0 25.6006 12.7998 38.4004 12.7998c76.7998 25.5996 179.2 38.3994 294.4 38.3994c217.6 0 422.399 -51.1992 563.199 -140.8
|
64 |
-
c25.6006 0 25.6006 -12.7998 51.2002 -12.7998zM1600 1113.6c38.4004 0 76.7998 38.4004 76.7998 89.6006c0 38.3994 -25.5996 64 -51.2002 76.7998c-204.8 128 -473.6 179.2 -742.399 179.2c-153.601 0 -294.4 -12.7998 -422.4 -51.2002
|
65 |
-
c-38.3994 -12.7998 -64 -38.4004 -64 -89.5996c0 -51.2002 38.4004 -89.6006 89.6006 -89.6006c25.5996 0 38.3994 12.7998 51.1992 12.7998c115.2 25.6006 230.4 38.4004 358.4 38.4004c243.2 0 486.4 -51.2002 652.8 -153.6
|
66 |
-
c25.6006 -12.8008 38.4004 -12.8008 51.2002 -12.8008z" />
|
67 |
-
<glyph glyph-name="uniF448" unicode=""
|
68 |
-
d="M512 384v1280h384v-1280h-384zM1152 1664h384v-1280h-384v1280z" />
|
69 |
-
<glyph glyph-name="uniF453" unicode=""
|
70 |
-
d="M1536 2048c141.312 0 256 -114.688 256 -256v-1536c0 -141.312 -114.688 -256 -256 -256h-1024c-141.312 0 -256 114.688 -256 256v1536c0 141.312 114.688 256 256 256h1024zM1024 128c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
71 |
-
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1536 512v1280h-1024v-1280h1024z" />
|
72 |
-
<glyph glyph-name="uniF419" unicode=""
|
73 |
-
d="M0 256v256h2048v-256h-2048zM0 1792h2048v-256h-2048v256zM0 896v256h2048v-256h-2048z" />
|
74 |
-
<glyph glyph-name="uniF423" unicode=""
|
75 |
-
d="M567.936 1440.9l-267.136 -480.896h403.2v-384h-128v256h-492.8l372.864 671.104zM1644.8 960h403.2v-384h-128v256h-492.8l372.864 671.104l112 -62.207zM1088 1344c176.768 0 320 -143.232 320 -320s-143.232 -320 -320 -320s-320 143.232 -320 320
|
76 |
-
s143.232 320 320 320zM1088 832c105.856 0 192 86.1436 192 192s-86.1436 192 -192 192s-192 -86.1436 -192 -192s86.1436 -192 192 -192z" />
|
77 |
-
<glyph glyph-name="uniF512" unicode=""
|
78 |
-
d="M1920 1280l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496l212.991 636.032l-555.264 387.968h685.312l210.688 640l210.688 -640h685.312z" />
|
79 |
-
<glyph glyph-name="uniF417" unicode=""
|
80 |
-
d="M960 1792c318.08 0 576 -257.92 576 -576c0 -159.232 -64.6396 -303.36 -169.088 -407.68l-406.912 -407.04l-406.912 407.04c-104.448 104.319 -169.088 248.447 -169.088 407.68c0 318.08 257.92 576 576 576zM960 896c176.64 0 320 143.36 320 320
|
81 |
-
s-143.36 320 -320 320c-176.768 0 -320 -143.36 -320 -320s143.232 -320 320 -320z" />
|
82 |
-
<glyph glyph-name="uniF410" unicode=""
|
83 |
-
d="M256 1536h1536v-128l-768 -384l-768 384v128zM256 1216l768 -384l768 384v-704h-1536v704z" />
|
84 |
-
<glyph glyph-name="uniF449" unicode=""
|
85 |
-
d="M512 512v1024h1024v-1024h-1024z" />
|
86 |
-
<glyph glyph-name="uniF467" unicode=""
|
87 |
-
d="M1280 1280c282.752 0 512 -229.248 512 -512v-299.904l-150.016 149.889c-99.9688 99.9678 -231.04 150.016 -361.984 150.016h-256v-384l-640 640l640 640v-384h256z" />
|
88 |
-
<glyph glyph-name="uniF224" unicode=""
|
89 |
-
d="M1536 1792c141.312 0 256 -114.688 256 -256v-384c0 -424.064 -343.936 -768 -768 -768s-768 343.936 -768 768v384c0 141.312 114.688 256 256 256h1024zM1498.5 1189.5c50.0479 50.0479 50.0479 131.072 0 180.992c-50.0479 50.0479 -130.944 50.0479 -180.992 0
|
90 |
-
l-293.504 -293.504l-293.504 293.504c-50.0479 50.0479 -131.072 50.0479 -180.992 0c-50.0479 -49.9199 -50.0479 -130.944 0 -180.992l361.984 -361.984l4.22363 4.22461c22.4004 -37.376 61.5684 -63.7441 108.288 -63.7441s85.8877 26.3682 108.288 63.7441
|
91 |
-
l4.22363 -4.22461z" />
|
92 |
-
<glyph glyph-name="uniF203" unicode=""
|
93 |
-
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-281.856v711.168h269.44l12.416 259.456h-281.984v192.384v0.255859v12.0322c0 71.2959 15.2324 114.432 108.544 114.432c86.6562 0 166.017 -0.639648 166.017 -0.639648
|
94 |
-
l5.8877 242.304s-77.6963 9.98438 -182.528 9.98438c-259.584 0 -372.096 -159.872 -372.096 -333.952v-236.8h-254.336v-259.328h254.336v-711.296h-723.84c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280z" />
|
95 |
-
<glyph glyph-name="uniF502" unicode=""
|
96 |
-
d="M128 2048h1920l-960 -960z" />
|
97 |
-
<glyph glyph-name="uniF412" unicode=""
|
98 |
-
d="M1920 832l-640 -640v448h-1024v704l384 384v-704h640v448z" />
|
99 |
-
<glyph glyph-name="uniF440" unicode=""
|
100 |
-
d="M1152 640v-256h256l-384 -384l-384 384h256v256h256zM1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-384v256h-512v-256h-384c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.40039c-4.09668 20.7363 -6.40039 42.1123 -6.40039 64
|
101 |
-
c0 176.768 143.232 320 320 320c89.3438 0 169.984 -36.7363 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
102 |
-
<glyph glyph-name="uniF305" unicode=""
|
103 |
-
d="M1408 1664h256v-1280h-1408v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128zM960 1280
|
104 |
-
c35.3281 0 64 -28.6719 64 -64v-512c0 -35.3281 -28.6719 -64 -64 -64s-64 28.6719 -64 64v448h-64c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h128z" />
|
105 |
-
<glyph glyph-name="uniF443" unicode=""
|
106 |
-
d="M1152 1664l384 -384v-121.472v-6.52832v-768h-1024v1280h512h128zM1408 512v640h-256h-128v128v256h-384v-1024h768z" />
|
107 |
-
<glyph glyph-name="uniF411" unicode=""
|
108 |
-
d="M1280 1728l448 -448l-896 -896h-448v448zM1280 1536l-594.688 -594.688l96 -96l594.688 594.688zM768 512l128 128l-96 96v0l-64 64v0l-96 96l-128 -128zM845.312 781.312l96 -96l594.688 594.688l-96 96z" />
|
109 |
-
<glyph glyph-name="uniF402" unicode=""
|
110 |
-
d="M896 1536v-256h256v-128h-256v-256h-128v256h-256v128h256v256h128zM1297.15 878.848l494.848 -494.848l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576
|
111 |
-
c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM832 768c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448s200.576 -448 448 -448z" />
|
112 |
-
<glyph glyph-name="uniF420" unicode=""
|
113 |
-
d="M483.2 1564.8l-227.2 227.2h640v-640l-232.32 232.32c-93.0557 -92.1602 -151.68 -218.88 -151.68 -360.32c0 -238.208 163.584 -436.736 384 -493.824v-262.656c-363.008 61.0566 -640 376.064 -640 756.48c0 212.096 88.0645 402.048 227.2 540.8zM1792 1024
|
114 |
-
c0 -212.096 -88.0645 -401.92 -227.2 -540.8l227.2 -227.2h-640v640l18.5596 -18.5596l213.761 -213.761c93.0557 92.1602 151.68 218.88 151.68 360.32c0 238.208 -163.584 436.736 -384 493.824v262.656c363.008 -61.0566 640 -376.064 640 -756.48z" />
|
115 |
-
<glyph glyph-name="uniF425" unicode=""
|
116 |
-
d="M704 1024c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64s-64 28.6719 -64 64s28.6719 64 64 64zM704 1280c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64s-64 28.6719 -64 64s28.6719 64 64 64zM704 768c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64
|
117 |
-
s-64 28.6719 -64 64s28.6719 64 64 64zM896 896v128h384v-128h-384zM896 640v128h384v-128h-384zM1280 1664h256v-1280h-1152v1280h256c0 70.7842 57.3438 128 128 128h384c70.7842 0 128 -57.2158 128 -128zM832 1664c-35.3281 0 -64 -28.6719 -64 -64s28.6719 -64 64 -64
|
118 |
-
h256c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64h-256zM1408 512v1024h-128v-128h-640v128h-128v-1024h896zM896 1152v128h384v-128h-384z" />
|
119 |
-
<glyph glyph-name="uniF508" unicode=""
|
120 |
-
d="M1450.5 1395.2c45.6963 -69.376 124.288 -115.2 213.504 -115.2c5.50391 0 10.4961 1.28027 15.8721 1.66406l-399.872 -799.872l-256 512l-256 -512l-128 256l-256 -512l-299.776 599.424l228.992 114.561l70.7842 -141.568l256 512l128 -256l256 512l256 -512z
|
121 |
-
M1664 1728c106.112 0 192 -86.0156 192 -192s-85.8877 -192 -192 -192s-192 86.0156 -192 192s85.8877 192 192 192z" />
|
122 |
-
<glyph glyph-name="uniF507" unicode=""
|
123 |
-
d="M1792 604.544c76.2881 -44.416 128 -126.08 128 -220.544c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256c0 94.5918 51.7119 176.128 128 220.544v163.456c0 70.7842 -57.2158 128 -128 128h-256v-291.456c76.2881 -44.416 128 -126.08 128 -220.544
|
124 |
-
c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256c0 94.4639 51.8398 176.128 128 220.544v291.456h-256c-70.6562 0 -128 -57.2158 -128 -128v-163.456c76.1602 -44.416 128 -126.08 128 -220.544c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256
|
125 |
-
c0 94.4639 51.8398 176.128 128 220.544v163.456c0 212.096 171.904 384 384 384h256v291.456c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256c0 -94.4639 -51.7119 -176.128 -128 -220.544v-291.456h256
|
126 |
-
c211.968 0 384 -171.904 384 -384v-163.456zM1024 1792c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM384 256c70.6562 0 128 57.2158 128 128s-57.3438 128 -128 128s-128 -57.2158 -128 -128
|
127 |
-
s57.3438 -128 128 -128zM1024 256c70.6562 0 128 57.2158 128 128s-57.3438 128 -128 128s-128 -57.2158 -128 -128s57.3438 -128 128 -128zM1664 256c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128s-128 -57.2158 -128 -128s57.2158 -128 128 -128z" />
|
128 |
-
<glyph glyph-name="uniF306" unicode=""
|
129 |
-
d="M1151.87 1219.46c0.12793 -0.511719 0.12793 -0.896484 0.12793 -1.4082v-1.79199v-0.255859c0 -5.12012 -0.639648 -10.3682 -1.91992 -15.4883l-128 -512c-8.57617 -34.1758 -43.2637 -55.04 -77.5684 -46.5918c-34.3037 8.57617 -55.168 43.2637 -46.5918 77.5684
|
130 |
-
l108.16 432.512h-174.08c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h256h1.53613h1.28027c1.02344 -0.12793 1.91992 -0.12793 2.81543 -0.255859h0.255859c30.3359 -2.68848 54.5283 -26.624 57.8564 -56.96v0c0 -0.768555 0.12793 -1.4082 0.12793 -2.04785
|
131 |
-
v-1.28027zM1408 1664h256v-1280h-1408v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128z" />
|
132 |
-
<glyph glyph-name="uniF406" unicode=""
|
133 |
-
d="M2048 1920l-832 -832l832 -832l-128 -128l-832 832l-832 -832l-128 128l832 832l-832 832l128 128l832 -832l832 832z" />
|
134 |
-
<glyph glyph-name="uniF215" unicode=""
|
135 |
-
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280zM1024 1408c-212.096 0 -384 -171.904 -384 -384c0 -211.968 171.904 -384 384 -384
|
136 |
-
c211.968 0 384 172.032 384 384c0 212.096 -172.032 384 -384 384zM1792 384v768h-274.176c10.624 -41.0879 18.1758 -83.4561 18.1758 -128c0 -282.752 -229.248 -512 -512 -512s-512 229.248 -512 512c0 44.5439 7.42383 86.9121 18.1758 128h-274.176v-768
|
137 |
-
c0 -70.7842 57.3438 -128 128 -128h1280c70.7842 0 128 57.2158 128 128zM1792 1536v128c0 70.6562 -57.2158 128 -128 128h-128c-70.7842 0 -128 -57.3438 -128 -128v-128c0 -70.6562 57.2158 -128 128 -128h128c70.7842 0 128 57.3438 128 128z" />
|
138 |
-
<glyph glyph-name="uniF202" unicode=""
|
139 |
-
d="M1920 1583.74c-49.2803 -73.7285 -111.744 -138.368 -183.552 -190.208c0.767578 -15.7441 1.2793 -31.6162 1.2793 -47.4883c0 -485.76 -369.92 -1046.02 -1046.27 -1046.02c-207.616 0 -400.768 60.7998 -563.456 165.248
|
140 |
-
c28.7998 -3.45605 58.1123 -5.24805 87.8076 -5.24805c172.032 0 330.752 58.752 456.448 157.439c-160.768 2.81641 -296.576 108.929 -343.424 255.104c22.5283 -3.96777 45.4404 -6.52832 69.248 -6.52832c33.5361 0 65.9199 4.48047 96.7676 12.7998
|
141 |
-
c-168.319 33.792 -294.912 182.272 -294.912 360.448v4.73633c49.6641 -27.5205 106.368 -44.0322 166.528 -45.9521c-98.6875 65.9199 -163.456 178.432 -163.456 305.92c0 67.3281 18.1758 130.688 49.792 184.96c181.376 -222.464 452.353 -368.768 757.889 -384.128
|
142 |
-
c-6.27246 26.8799 -9.60059 54.9121 -9.60059 83.7119c0 203.008 164.608 367.616 367.616 367.616c105.855 0 201.472 -44.6719 268.544 -116.096c83.584 16.5117 162.304 47.1035 233.216 89.2158c-27.3916 -85.8887 -85.7598 -157.952 -161.536 -203.393
|
143 |
-
c74.3682 8.83203 145.152 28.5439 211.072 57.8564z" />
|
144 |
-
<glyph glyph-name="uniF222" unicode=""
|
145 |
-
d="M1223.94 775.936c20.0967 20.0967 52.0967 19.9688 72.0645 0c19.9678 -19.9678 19.9678 -52.9912 0 -72.96c-56.96 -56.96 -145.92 -86.0156 -270.976 -86.0156c-126.977 0 -216.064 29.0557 -273.024 86.0156c-19.9678 19.9688 -19.9678 52.9922 0 72.96
|
146 |
-
c19.9678 19.9688 51.9678 19.9688 71.9355 0c38.0166 -38.0156 103.04 -56.0635 199.04 -56.0635c97.9209 0 162.944 18.0479 200.96 56.0635zM894.976 982.016c0 -61.0557 -49.9199 -112 -112 -112c-60.9277 0 -110.976 50.9443 -110.976 112
|
147 |
-
c0 61.9521 49.9199 112 110.976 112c61.9521 0 112 -50.0479 112 -112zM1265.02 1094.02c61.9512 0 112 -50.0479 112 -112c0 -61.0557 -50.0488 -112 -112 -112c-61.9521 0 -112 50.9443 -112 112c0 61.9521 50.0479 112 112 112zM1698.05 1089.02
|
148 |
-
c24.96 17.9199 43.0078 45.9512 43.1357 78.9756c0 54.0156 -44.0312 98.0479 -98.0479 98.0479c-32 0 -57.9834 -16 -76.0322 -39.04c53.8887 -39.9355 98.9443 -87.04 130.944 -137.983zM1021.06 500.992c347.904 0 631.937 177.023 632.064 393.983
|
149 |
-
c0 219.009 -284.032 396.032 -632.064 396.032c-349.056 0 -632.96 -177.023 -632.96 -395.008s283.904 -395.008 632.96 -395.008zM306.944 1168c0 -30.9756 16 -57.9844 39.9355 -74.8799c32 50.9443 76.9277 97.0234 131.968 136.96
|
150 |
-
c-17.9199 22.0156 -43.0078 35.9678 -72.96 35.9678c-54.9121 0 -98.9434 -44.0322 -98.9434 -98.0479zM1600 1805.06c-41.9844 0 -77.0557 -35.0713 -77.0557 -77.0557s35.0713 -77.0557 77.0557 -77.0557s77.0557 34.9434 77.0557 77.0557
|
151 |
-
s-35.0713 77.0557 -77.0557 77.0557zM1842.94 1168c0 -75.0078 -41.9844 -137.984 -101.889 -173.056c8.95996 -32 13.9521 -64.8965 13.9521 -98.9443c0 -274.944 -329.088 -498.048 -734.08 -498.048s-734.976 222.976 -734.976 497.023
|
152 |
-
c0 35.9688 6.01562 70.0166 16.1279 104.064c-57.9844 34.9443 -97.0244 97.0244 -97.0244 168.96c0 110.976 89.9844 200.96 200.96 200.96c66.0488 0 124.032 -32.8955 160 -82.9443c114.944 60.9287 257.024 99.9688 411.904 105.984l92.0322 456.96
|
153 |
-
c3.07227 14.0801 11.0078 25.9844 23.04 33.0244c12.0322 8.06348 25.9834 9.9834 39.04 7.04004l312.96 -72.0645c30.9756 52.9922 88.96 89.9844 155.008 89.9844c98.9443 0 179.072 -80 179.072 -178.944s-80 -178.944 -178.944 -178.944
|
154 |
-
c-95.1035 0 -172.032 73.9844 -178.048 167.937l-262.016 60.0322l-77.0566 -386.049c148.992 -7.93555 285.952 -46.9756 397.057 -108.031c35.9678 51.9678 94.9756 86.0156 162.943 86.0156c109.952 0 199.937 -89.9844 199.937 -200.96z" />
|
155 |
-
<glyph glyph-name="uniF214" unicode=""
|
156 |
-
d="M1091.2 1920v-452.992h425.216v-281.216h-425.216v-459.52c0 -103.937 5.50391 -170.624 16.6396 -200.192c10.8799 -29.3125 31.4883 -52.8643 61.3125 -70.5283c39.6797 -23.8076 84.8633 -35.7119 135.936 -35.7119c90.624 0 180.864 29.4404 270.72 88.4482v-282.624
|
157 |
-
c-76.6719 -35.9678 -146.048 -61.3125 -208 -75.9043c-61.9512 -14.4639 -129.023 -21.7598 -201.216 -21.7598c-81.9199 0 -154.368 10.3682 -217.344 30.9756c-62.9756 20.6084 -116.608 50.3047 -161.024 88.4482c-44.5439 38.2725 -75.2637 78.9766 -92.416 122.112
|
158 |
-
c-17.1514 43.1357 -25.7275 105.6 -25.7275 187.52v628.736h-198.016v253.568c70.3994 22.9121 130.688 55.6797 180.863 98.4316c50.3047 42.624 90.4961 93.8242 120.832 153.856c30.3359 59.7754 51.2002 135.808 62.7207 228.352h254.72z" />
|
159 |
-
<glyph glyph-name="uniF104" unicode=""
|
160 |
-
d="M512 1664l1152 -640l-1152 -640v1280z" />
|
161 |
-
<glyph glyph-name="uniF50B" unicode=""
|
162 |
-
d="M1408 1152l-384 -384l-384 384h256v512h256v-512h256zM384 640h1280v-256h-1280v256z" />
|
163 |
-
<glyph glyph-name="uniF409" unicode=""
|
164 |
-
d="M1024 1664l640 -512l-128 -128v-512h-1024v512l-128 128zM1152 576v448h-256v-448h256z" />
|
165 |
-
<glyph glyph-name="uniF458" unicode=""
|
166 |
-
d="M1920 1024l-1024 -640v480l-768 -480v1280l768 -480v480z" />
|
167 |
-
<glyph glyph-name="uniF218" unicode=""
|
168 |
-
d="M729.6 1152h550.4s12.7998 -38.4004 12.7998 -89.5996c0 -332.801 -230.399 -563.2 -563.2 -563.2c-320 0 -588.8 268.8 -588.8 588.8s281.601 588.8 588.8 588.8c153.601 0 294.4 -51.2002 384 -153.6l-153.6 -153.601c-38.4004 25.6006 -102.4 76.8008 -230.4 76.8008
|
169 |
-
c-204.8 0 -371.199 -166.4 -371.199 -371.2s166.399 -371.2 371.199 -371.2c230.4 0 320 166.4 332.801 243.2h-332.801v204.8zM1664 1152h128v-128h-128v-128h-128v128h-128v128h128v128h128v-128z" />
|
170 |
-
<glyph glyph-name="uniF513" unicode=""
|
171 |
-
d="M1920 1280l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496l212.991 636.032l-555.264 387.968h685.312l210.688 640l210.688 -640h685.312zM1024 807.68l307.584 -219.136l-118.4 353.536l300.288 209.92h-371.456l-118.016 358.528v-702.849z
|
172 |
-
" />
|
173 |
-
<glyph glyph-name="uniF301" unicode=""
|
174 |
-
d="M704 1152h960l-256 -640h-1024v1024h384l64 -128h448v-128h-640l-128 -256h128z" />
|
175 |
-
<glyph glyph-name="uniF474" unicode=""
|
176 |
-
d="M128 1408v384h384zM640 768v512h768v-512h-768zM1536 1792h384v-384zM128 640l384 -384h-384v384zM1536 256l384 384v-384h-384zM1536 1408l256 384l128 -128zM1536 640l384 -256l-128 -128zM128 384l384 256l-256 -384zM128 1664l128 128l256 -384z" />
|
177 |
-
<glyph glyph-name="uniF438" unicode=""
|
178 |
-
d="M1280 1792c141.312 0 256 -114.688 256 -256v-1024c0 -141.312 -114.688 -256 -256 -256h-512c-141.312 0 -256 114.688 -256 256v384h128v-128h768v768h-768v-128h-128v128c0 141.312 114.688 256 256 256h512zM1024 384c70.7842 0 128 57.2158 128 128
|
179 |
-
s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM768 896v128h-512v256h512v128l384 -256z" />
|
180 |
-
<glyph glyph-name="uniF451" unicode=""
|
181 |
-
d="M256 384v1280l1024 -640zM1408 1664h384v-1280h-384v1280z" />
|
182 |
-
<glyph glyph-name="uniF404" unicode=""
|
183 |
-
d="M1024 640c-19.8398 0 -39.04 2.43164 -57.8564 5.63184l436.225 436.225c3.2002 -18.8164 5.63184 -38.0166 5.63184 -57.8564c0 -211.968 -172.032 -384 -384 -384zM1696.26 1375.74l351.744 -351.744l-506.624 -506.624
|
184 |
-
c-131.456 -134.272 -314.752 -217.728 -517.376 -217.728c-117.248 0 -226.944 29.3115 -324.864 79.1035l147.072 146.944c56.7041 -20.6084 115.968 -34.0479 177.92 -34.0479c144 0 279.168 56.832 380.288 160.128l372.096 372.224l-216.063 215.936zM1606.02 1722.11
|
185 |
-
l128.641 -129.024l-1279.87 -1279.87l-128.896 128.769l128 128.128l-453.888 453.888v0l506.496 506.496c131.456 134.4 314.624 217.984 517.504 217.984c170.368 0 324.48 -61.8242 448 -160.385zM896 1024c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128
|
186 |
-
c-70.7842 0 -128 -57.3438 -128 -128s57.2158 -128 128 -128zM1229.18 1345.28l105.729 105.728c-90.752 66.8164 -197.12 105.473 -310.912 105.473c-144.128 0 -279.168 -56.9609 -380.288 -160.385l-372.096 -372.096l318.208 -318.336l113.023 113.024
|
187 |
-
c-38.6553 59.5195 -62.8477 129.023 -62.8477 205.312c0 212.096 172.032 384 384 384c76.2881 0 145.792 -24.1924 205.184 -62.7197z" />
|
188 |
-
<glyph glyph-name="uniF209" unicode=""
|
189 |
-
d="M1073.15 2048c481.664 0 798.976 -348.672 798.976 -722.944c0 -495.104 -275.328 -865.151 -680.96 -865.151c-136.32 0 -264.448 73.7275 -308.352 157.439c0 0 -73.2168 -290.943 -88.832 -347.136c-26.8809 -97.2803 -79.2324 -194.56 -127.104 -270.208
|
190 |
-
l-148.992 54.0156c-3.58398 88.3203 -0.639648 194.049 22.0166 289.92c24.1914 102.4 162.304 687.744 162.304 687.744s-40.3203 80.6406 -40.3203 199.809c0 187.008 108.544 326.784 243.456 326.784c114.816 0 170.24 -86.1445 170.24 -189.44
|
191 |
-
c0 -115.328 -73.7275 -288 -111.488 -448c-31.6152 -133.632 67.2002 -242.816 199.168 -242.816c239.232 0 400.128 307.072 400.128 670.977c0 276.607 -186.367 483.712 -525.184 483.712c-382.72 0 -621.312 -285.568 -621.312 -604.544
|
192 |
-
c0 -110.08 32.5117 -187.521 83.1992 -247.424c23.5527 -27.7764 26.624 -38.9121 18.3047 -70.6562c-6.0166 -23.04 -19.9688 -78.9766 -25.7285 -101.248c-8.44824 -32 -34.3037 -43.2637 -63.2314 -31.3604c-176.257 71.6807 -258.433 264.96 -258.433 482.048
|
193 |
-
c0 358.656 302.336 788.48 902.145 788.48z" />
|
194 |
-
<glyph glyph-name="uniF217" unicode=""
|
195 |
-
d="M1024 1920c494.08 0 896 -402.048 896 -896c0 -494.08 -401.92 -896 -896 -896c-493.952 0 -896 401.92 -896 896c0 493.952 402.048 896 896 896zM1112.83 1769.47c-211.2 10.4961 -420.864 -73.4717 -564.608 -220.16
|
196 |
-
c-146.432 -144.256 -216.063 -354.176 -189.695 -551.68c23.4238 -197.248 142.592 -378.496 307.584 -476.032c160.768 -96 365.312 -104.191 530.943 -29.0557c-47.1035 -13.0557 -96.6396 -20.3516 -147.712 -20.3516c-303.487 0 -550.399 246.911 -550.399 550.399
|
197 |
-
c0 143.872 55.6797 274.944 146.304 373.12c1.02441 1.02441 1.91992 1.91992 2.81641 2.94434c4.60742 4.73535 9.08789 9.47168 13.6953 14.208c0.512695 0.383789 0.896484 1.02344 1.4082 1.2793c128 148.353 317.056 242.177 528.256 242.177
|
198 |
-
c221.057 0 418.176 -102.912 546.048 -263.424c-20.8633 33.5352 -44.0312 65.6631 -69.376 95.6152c-137.983 168.832 -343.68 273.408 -555.264 280.96zM1415.04 1006.21c4.35156 -90.3682 -25.3438 -182.912 -80.7676 -257.152
|
199 |
-
c-55.5527 -73.8555 -135.169 -129.664 -225.28 -156.928c-74.8799 -22.7842 -156.544 -25.5996 -234.112 -7.04004c54.0166 -21.6318 112.896 -33.6641 174.464 -33.6641c259.968 0 471.296 211.456 471.296 471.296c0 0.768555 -0.12793 1.66406 -0.12793 2.68848
|
200 |
-
c-13.6953 142.336 -88.1914 276.352 -200.319 359.168c-137.345 104.576 -332.288 116.864 -479.232 38.0156c-73.2158 -38.5273 -136.832 -97.1514 -176.896 -166.912c-40.5762 -69.8877 -58.4961 -151.68 -52.2246 -230.912
|
201 |
-
c10.624 -158.976 124.8 -305.023 271.616 -345.216c146.432 -44.0322 313.344 19.584 391.936 142.849c82.5605 120.447 62.7207 293.119 -36.3516 391.68c-94.0801 104.192 -260.992 115.968 -367.872 36.8643c-54.0156 -38.6562 -92.5439 -94.3359 -105.344 -157.057
|
202 |
-
c-13.3125 -62.0801 -1.66406 -128.64 30.4639 -181.76c32.1279 -53.7598 83.7119 -93.5684 141.952 -108.032c58.2402 -15.1035 121.6 -4.86328 171.52 25.6006c50.5605 30.4639 87.5518 80.1279 97.9199 135.68c11.3926 55.2959 -1.66406 114.432 -34.3037 158.848
|
203 |
-
c-32.1279 45.5684 -82.8164 73.3447 -135.936 76.9287c-52.9922 4.0957 -105.856 -17.2803 -141.568 -54.2725c-36.6084 -35.9678 -52.0957 -89.0879 -44.6719 -137.855c7.55176 -48.6406 38.2715 -93.6963 80 -115.584c26.4961 -14.7207 57.4717 -19.8408 86.9121 -16.3848
|
204 |
-
c-62.0801 1.53613 -114.177 43.2646 -131.456 100.097c-0.512695 0.767578 -1.02441 1.66406 -1.4082 2.6875c-17.9199 41.4717 -13.0557 94.3359 16.1279 133.376c28.416 38.7842 77.5684 63.3604 128.768 60.7998c51.0723 -1.66406 101.376 -33.0234 128 -78.9756
|
205 |
-
c27.3926 -45.8242 32 -106.752 7.80859 -158.336c-24.0645 -51.7119 -73.7285 -90.2402 -131.584 -101.632c-57.4717 -12.416 -122.752 4.73535 -167.68 47.3594c-44.8008 40.96 -72.0645 104.192 -67.4561 168.32c3.83984 133.12 150.911 237.44 287.104 200.96
|
206 |
-
c138.368 -31.6162 226.944 -196.736 173.824 -338.304c-48.6406 -142.72 -224.769 -225.536 -373.888 -166.912c-74.1123 27.5195 -134.784 85.8877 -169.729 157.568c-34.9443 72.1914 -42.2402 158.592 -17.9199 237.695c47.8721 161.664 226.176 269.185 398.848 238.464
|
207 |
-
c175.36 -25.5996 313.217 -192.64 317.568 -374.016zM1024 207.488c319.232 0 595.968 184.319 730.112 451.712c37.248 84.7354 58.8799 175.744 58.8799 265.728c0 318.977 -247.04 554.368 -553.216 607.616c154.496 -64 279.296 -200.32 331.52 -362.496
|
208 |
-
c70.1445 -203.136 20.8643 -447.872 -133.12 -608.896c-148.224 -162.944 -384.384 -245.633 -608.128 -206.208c-226.048 35.584 -422.912 198.271 -517.504 407.936c-97.792 209.408 -90.3682 468.224 26.8799 674.432c116.736 206.337 329.344 354.433 566.272 395.009
|
209 |
-
c11.7754 2.17578 23.6797 3.96777 35.584 5.37598c-420.992 -32.1279 -753.664 -384.641 -753.664 -813.696c0 -450.304 366.208 -816.512 816.384 -816.512z" />
|
210 |
-
<glyph glyph-name="uniF469" unicode=""
|
211 |
-
d="M256 1280h1536v-768h-256v384h-1024v-384h-256v768zM1408 1664v-256h-768v256h768zM1408 640c0 -98.3037 37.5039 -196.48 112.512 -271.488l112.513 -112.512h-768l-112.513 112.512c-75.0078 75.0078 -112.512 173.185 -112.512 271.488v128h768v-128z" />
|
212 |
-
<glyph glyph-name="uniF476" unicode=""
|
213 |
-
d="M384 1248c123.776 0 224 -100.224 224 -224c0 -123.648 -100.224 -224 -224 -224s-224 100.352 -224 224c0 123.776 100.224 224 224 224zM1024 1248c123.648 0 224 -100.224 224 -224c0 -123.648 -100.352 -224 -224 -224c-123.776 0 -224 100.352 -224 224
|
214 |
-
c0 123.776 100.224 224 224 224zM1664 1248c123.648 0 224 -100.224 224 -224c0 -123.648 -100.352 -224 -224 -224s-224 100.352 -224 224c0 123.776 100.352 224 224 224z" />
|
215 |
-
<glyph glyph-name="uniF211" unicode=""
|
216 |
-
d="M1472 1440c229.888 0 416 -186.24 416 -416s-186.112 -416 -416 -416s-416 186.24 -416 416s186.112 416 416 416zM576 1440c229.76 0 416 -186.24 416 -416s-186.24 -416 -416 -416s-416 186.24 -416 416s186.24 416 416 416z" />
|
217 |
-
<glyph glyph-name="uniF456" unicode=""
|
218 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896
|
219 |
-
l51.584 640h-281.6l51.2002 -640h178.815z" />
|
220 |
-
<glyph glyph-name="uniF471" unicode=""
|
221 |
-
d="M512 1664h358.656c163.328 0 281.855 -23.2959 355.712 -69.7598c73.7275 -46.4639 110.592 -120.448 110.592 -221.824c0 -68.8643 -16.1279 -125.312 -48.3838 -169.344c-32.3838 -44.1602 -75.2646 -70.6562 -128.769 -79.6162v-7.93652
|
222 |
-
c72.96 -16.2559 125.568 -46.7197 157.952 -91.3916c32.2559 -44.6719 48.5127 -104.063 48.5127 -178.048c0 -105.088 -38.0166 -187.008 -113.921 -245.888c-76.0312 -58.8809 -178.943 -88.1924 -309.248 -88.1924h-431.104v1152zM768 1207.81h130.176
|
223 |
-
c66.3047 0 114.176 10.2402 143.872 30.7207c29.5684 20.4795 44.5439 54.3994 44.5439 101.632c0 44.1602 -16.1279 75.7754 -48.5117 94.9756c-32.3838 19.0723 -83.4561 28.7998 -153.344 28.7998h-116.736v-256.128zM768 1013.89v-300.16h147.456
|
224 |
-
c67.2002 0 116.864 12.9287 148.864 38.6562c32.1279 25.7285 48.1279 65.1523 48.1279 118.145c0 95.6152 -68.3525 143.487 -204.929 143.487h-139.52v-0.12793z" />
|
225 |
-
<glyph glyph-name="uniF433" unicode=""
|
226 |
-
d="M0 896l896 -896h-896v896z" />
|
227 |
-
<glyph glyph-name="uniF447" unicode=""
|
228 |
-
d="M1408 512c70.7842 0 128 -57.2158 128 -128s-57.2158 -128 -128 -128s-128 57.2158 -128 128s57.2158 128 128 128zM640 512c70.6562 0 128 -57.2158 128 -128s-57.3438 -128 -128 -128s-128 57.2158 -128 128s57.3438 128 128 128zM1536 896h-896v-128h896v-128h-1024
|
229 |
-
v1024h-256v128h384v-256h1152z" />
|
230 |
-
<glyph glyph-name="uniF511" unicode=""
|
231 |
-
d="M1024 1510.53l-118.016 -358.528h-371.328l300.288 -209.92l-118.272 -353.28l307.328 218.88l307.584 -219.136l-118.4 353.536l300.288 209.92h-371.456zM1024 1920v0l210.688 -640h685.312l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496
|
232 |
-
l212.991 636.032l-555.264 387.968h685.312z" />
|
233 |
-
<glyph glyph-name="uniF427" unicode=""
|
234 |
-
d="M1717.72 1436.21c99.7246 -99.7246 99.7246 -261.281 0 -361.006l-232.861 -232.989c-98.5723 -98.5723 -257.44 -99.3398 -357.421 -2.81543l-455.353 -455.354h-288.036v287.908l455.097 454.969l-0.767578 0.768555c-99.5967 99.5957 -99.5967 261.408 0 361.005
|
235 |
-
l232.989 232.989c99.5957 99.7246 261.408 99.7246 361.005 0zM1344.04 1104.01l160.02 160.021l-256.031 256.031l-160.021 -160.02z" />
|
236 |
-
<glyph glyph-name="uniF219" unicode=""
|
237 |
-
d="M1438.08 1832.7c0 0 563.456 -229.376 370.176 -838.4c-267.264 -554.496 -784.64 -349.056 -784.64 -349.056v-277.504s-19.7119 -153.344 -202.88 -220.288c-183.296 -66.6885 -351.616 59.5195 -351.616 59.5195v279.809
|
238 |
-
c83.584 -85.5039 195.712 -134.272 240.128 -9.98438v945.92h311.68v-537.472s460.416 -138.496 522.368 289.792c9.85645 475.392 -546.944 472.832 -546.944 472.832s-349.184 22.2715 -522.495 -257.536c-131.2 -222.848 37.1191 -423.424 37.1191 -423.424
|
239 |
-
l-225.279 -200.448s-339.2 418.433 -7.42383 871.552c430.848 487.681 1159.81 194.688 1159.81 194.688z" />
|
240 |
-
<glyph glyph-name="uniF100" unicode=""
|
241 |
-
d="M512 1408h1024v-128h-1024v128zM1152 1152v-128h-640v128h640zM1280 1024v128h256v-128h-256zM896 768v128h640v-128h-640zM768 896v-128h-256v128h256zM512 512v128h768v-128h-768z" />
|
242 |
-
<glyph glyph-name="uniF400" unicode=""
|
243 |
-
d="M1792 384l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM384 1216c0 -247.424 200.576 -448 448 -448
|
244 |
-
c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448z" />
|
245 |
-
<glyph glyph-name="uniF439" unicode=""
|
246 |
-
d="M896 1664v-384h-256v384c0 70.7842 57.3438 128 128 128s128 -57.2158 128 -128zM1408 1664v-384h-256v384c0 70.7842 57.2158 128 128 128s128 -57.2158 128 -128zM384 1152h1280c0 -309.632 -219.904 -567.68 -512 -627.072v-268.928h-256v268.928
|
247 |
-
c-292.096 59.2646 -512 317.44 -512 627.072z" />
|
248 |
-
<glyph glyph-name="uniF509" unicode=""
|
249 |
-
d="M1534.21 717.824l147.712 -88.5762c-134.4 -223.36 -378.24 -373.248 -657.92 -373.248c-279.552 0 -523.52 149.888 -657.92 373.248l147.712 88.7041c92.1602 -98.1758 226.816 -168.96 382.208 -194.688v500.736h-128v128h128v163.456
|
250 |
-
c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256c0 -94.4639 -51.7119 -176.128 -128 -220.544v-163.456h128v-128h-128v-500.864c155.52 25.7285 289.92 96.3838 382.208 194.688zM1024 1664
|
251 |
-
c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128c70.7842 0 128 57.3438 128 128s-57.2158 128 -128 128z" />
|
252 |
-
<glyph glyph-name="uniF510" unicode=""
|
253 |
-
d="M1664 1152v-256h-512v-512h-256v512h-512v256h512v512h256v-512h512z" />
|
254 |
-
<glyph glyph-name="uniF445" unicode=""
|
255 |
-
d="M1888 748.032l-57.5996 -139.648l-305.408 21.8887c-31.3604 -39.9365 -66.9443 -75.6484 -106.88 -107.009l21.7598 -305.536l-139.264 -57.5996l-200.704 231.552c-25.2158 -3.07129 -49.9199 -7.67969 -75.9043 -7.67969c-25.7275 0 -50.1758 4.6084 -75.1357 7.67969
|
256 |
-
l-200.96 -231.808l-139.393 57.7275l21.7607 305.408c-39.9365 31.3604 -75.5205 66.9443 -107.009 106.88l-305.536 -21.7598l-57.7275 139.264l231.68 200.832c-3.07129 25.0879 -7.67969 49.792 -7.67969 75.7764c0 25.7275 4.6084 50.1758 7.55176 75.1357
|
257 |
-
l-231.552 200.96l57.7275 139.393l305.28 -21.7607c31.4883 39.9365 67.2002 75.7764 107.265 107.265l-21.7607 305.408l139.137 57.5996l200.96 -231.68c24.96 2.94336 49.5352 7.67969 75.3916 7.67969s50.4316 -4.73633 75.3916 -7.67969l200.96 231.68
|
258 |
-
l139.265 -57.5996l-21.8887 -305.408c39.9365 -31.3604 75.6484 -67.0723 107.137 -107.008l305.408 21.6318l57.5996 -139.136l-231.552 -200.832c3.07129 -25.0889 7.67969 -49.6641 7.67969 -75.6484c0 -25.7275 -4.6084 -50.3037 -7.67969 -75.2637zM1280 1024
|
259 |
-
c0 141.312 -114.688 256 -256 256s-256 -114.688 -256 -256s114.688 -256 256 -256s256 114.688 256 256z" />
|
260 |
-
<glyph glyph-name="uniF516" unicode=""
|
261 |
-
d="M1024 1452.42v-467.328h-155.776v467.328h155.776zM1408 1452.42v-467.328h-155.776v467.328h155.776zM323.2 1920h1596.8v-1090.82l-467.456 -445.184h-350.464l-233.6 -256h-228.48v256h-512v1224.32zM1764.22 907.136v857.088h-1285.5v-1129.73h350.977v-211.328
|
262 |
-
l233.472 211.328h428.16z" />
|
263 |
-
<glyph glyph-name="uniF435" unicode=""
|
264 |
-
d="M384 512l640 640l640 -640h-1280zM384 1408h1280v-128h-1280v128z" />
|
265 |
-
<glyph glyph-name="uniF300" unicode=""
|
266 |
-
d="M1536 1536c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-448l-448 -448v448h-128c-141.312 0 -256 114.688 -256 256v384c0 141.312 114.688 256 256 256h1024z" />
|
267 |
-
<glyph glyph-name="uniF514" unicode=""
|
268 |
-
d="M1664 768v128l256 -256l-256 -256v128h-256c-282.752 0 -512 229.248 -512 512c0 141.312 -114.688 256 -256 256h-384v256h384c282.752 0 512 -229.248 512 -512c0 -141.312 114.688 -256 256 -256h256zM1408 1280c-61.8242 0 -117.888 -22.9121 -162.176 -59.3916
|
269 |
-
c-27.3926 83.9678 -70.7842 160 -128 224.768c82.5596 56.96 182.271 90.624 290.176 90.624h256v128l256 -256l-256 -256v128h-256zM640 768c61.8242 0 117.888 22.9121 162.176 59.3916c27.3926 -83.9678 70.7842 -160 128 -224.768
|
270 |
-
c-82.5596 -56.832 -182.271 -90.624 -290.176 -90.624h-384v256h384z" />
|
271 |
-
<glyph glyph-name="uniF102" unicode=""
|
272 |
-
d="M1408 1408l512 -128v-896h-1792v896l512 128l128 256h512zM1024 512.256c247.552 0 448 200.448 448 448c0 247.424 -200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448c0 -247.552 200.576 -448 448 -448zM512 1600v-96.1279l-256 -64v160.128h256z
|
273 |
-
M1024 1280.13c176.768 0 320 -143.231 320 -320c0 -176.768 -143.232 -320 -320 -320s-320 143.232 -320 320c0 176.769 143.232 320 320 320z" />
|
274 |
-
<glyph glyph-name="uniF466" unicode=""
|
275 |
-
d="M640 1344l-320 -320l320 -320v-320l-640 640l640 640v-320zM1408 1280c282.752 0 512 -229.248 512 -512v-299.904l-150.016 149.889c-99.9688 99.9678 -231.04 150.016 -361.984 150.016h-256v-384l-640 640l640 640v-384h256z" />
|
276 |
-
<glyph glyph-name="uniF463" unicode=""
|
277 |
-
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
278 |
-
M1920 640v128h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" />
|
279 |
-
<glyph glyph-name="uniF422" unicode=""
|
280 |
-
d="M384 1536h1152v-1024h-1152v1024zM1408 640v640h-896v-640h896z" />
|
281 |
-
<glyph glyph-name="uniF201" unicode=""
|
282 |
-
d="M1024 128c128 0 256 32 368 80c-16 144 -64 368 -208 688c-288 -96 -560 -304 -704 -576c144 -128 336 -192 544 -192zM1536 288c208 144 352 384 384 640c-192 32 -368 32 -576 0c16 -32 128 -304 192 -640zM128 1088v-64c0 -224 80 -432 224 -592
|
283 |
-
c176 288 496 496 784 592c-16 48 -48 112 -80 176c-368 -112 -592 -144 -928 -112zM1760 1536c-160 -128 -368 -192 -560 -288c48 -64 64 -112 96 -176c208 48 480 32 624 0c-16 176 -64 336 -160 464zM672 1856c-256 -112 -448 -336 -512 -624c288 -32 688 48 832 96
|
284 |
-
c-96 192 -192 352 -320 528zM1024 1920c-64 0 -128 -16 -192 -16c128 -208 192 -320 304 -512c128 48 384 128 528 256c-160 160 -384 272 -640 272zM1024 2048c560 0 1024 -464 1024 -1024s-464 -1024 -1024 -1024s-1024 464 -1024 1024s464 1024 1024 1024z" />
|
285 |
-
<glyph glyph-name="uniF426" unicode=""
|
286 |
-
d="M1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.52832c-4.35254 20.8643 -6.52832 41.9844 -6.52832 64c0 176.768 143.232 320 320 320
|
287 |
-
c89.3438 0 169.984 -36.8643 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
288 |
-
<glyph glyph-name="uniF446" unicode=""
|
289 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM1536 1024c0 282.752 -229.248 512 -512 512c-94.8477 0 -182.528 -27.5195 -258.688 -72.4482l698.368 -698.24
|
290 |
-
c44.8008 76.1602 72.3203 163.969 72.3203 258.688zM512 1024c0 -282.752 229.248 -512 512 -512c94.7197 0 182.4 27.5195 258.56 72.3203l-698.239 698.239c-44.8008 -76.1592 -72.3203 -163.84 -72.3203 -258.56z" />
|
291 |
-
<glyph glyph-name="uniF504" unicode=""
|
292 |
-
d="M1664 1536c0 -94.4639 -51.7119 -176.128 -128 -220.544v-163.456c0 -282.752 -229.248 -512 -512 -512c-141.312 0 -256 -114.688 -256 -256v-128h-256v1059.46c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256
|
293 |
-
c0 -94.4639 -51.8398 -176.128 -128 -220.544v-490.496c75.5195 44.0322 162.304 71.04 256 71.04c141.312 0 256 114.688 256 256v163.456c-76.2881 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256zM640 1664
|
294 |
-
c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM1408 1408c70.7842 0 128 57.3438 128 128s-57.2158 128 -128 128s-128 -57.3438 -128 -128s57.2158 -128 128 -128z" />
|
295 |
-
<glyph glyph-name="uniF465" unicode=""
|
296 |
-
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
297 |
-
M1531.52 384l452.48 452.48l-90.4961 90.4951l-361.984 -361.983l-180.991 180.992l-90.4961 -90.4961z" />
|
298 |
-
<glyph glyph-name="uniF424" unicode=""
|
299 |
-
d="M1408 1792l384 -384v-768l-384 -384h-768l-384 384v768l384 384h768zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896l51.584 640h-281.6l51.2002 -640h178.815z" />
|
300 |
-
<glyph glyph-name="uniF418" unicode=""
|
301 |
-
d="M1408 1504l128 -96l-512 -768h-128l-288 416l128 128l224 -192z" />
|
302 |
-
<glyph glyph-name="uniF429" unicode=""
|
303 |
-
d="M1024 1453.31l493.312 -493.312l-493.312 -493.312l-86.6562 86.6553l342.656 342.656h-896v128h896l-342.656 342.656z" />
|
304 |
-
<glyph glyph-name="uniF308" unicode=""
|
305 |
-
d="M477.696 568.192l543.104 543.104l90.3682 -90.624l-542.976 -542.976c-100.225 -100.353 -152.32 -115.84 -226.305 -135.809c20.0967 74.1123 35.584 126.08 135.809 226.305zM1189.5 1732.61l180.992 180.991l542.976 -543.104l-180.991 -180.992
|
306 |
-
c-50.0488 50.0479 -130.944 50.0479 -180.992 0l-180.992 -180.992c-50.0479 -50.0479 -50.0479 -130.943 0 -180.992l-180.992 -180.991l-543.104 542.976l180.991 180.992c50.0488 -50.0479 131.072 -50.0479 181.12 0l180.992 181.12
|
307 |
-
c50.0479 50.0479 50.0479 130.943 0 180.992z" />
|
308 |
-
<glyph glyph-name="uniF226" unicode=""
|
309 |
-
d="M1477.76 1792c120.32 0 152.576 -68.6084 126.464 -195.584l-51.8398 -258.688c-40.96 -206.848 -88.0635 -445.695 -94.0801 -470.144c-11.0078 -44.1602 -27.9033 -119.168 -132.992 -119.168h-250.367c-9.98438 0 -9.98438 0 -20.0967 -10.1123
|
310 |
-
c-6.65527 -6.65527 -393.344 -455.424 -393.344 -455.424c-30.208 -34.6875 -80.3838 -28.5439 -98.6875 -21.1201c-18.3047 7.2959 -50.6885 29.6963 -50.6885 89.9844v1301.63s33.2803 138.624 146.304 138.624h819.328zM1394.94 1391.1l34.3037 179.2
|
311 |
-
c6.27148 29.6963 -16.3838 52.4805 -40.5762 52.4805h-657.536c-29.8242 0 -49.792 -26.8799 -49.792 -49.792v-1015.68c0 -3.19922 2.43262 -3.83984 4.86426 -1.15137c0 0 242.304 290.815 269.184 324.352c26.8809 33.4082 39.168 38.6562 79.3604 38.6562h221.184
|
312 |
-
c30.208 0 47.2324 25.3438 50.3047 40.1924c3.2002 14.8477 28.9277 149.12 34.4316 176.256s-19.3281 54.9121 -44.7998 54.9121h-270.976c-35.9688 0 -61.8242 25.4717 -61.8242 61.3115v39.04c0 35.9678 25.7275 60.416 61.5674 60.416h319.232
|
313 |
-
s46.9756 20.4805 51.0723 39.8076z" />
|
314 |
-
<glyph glyph-name="uniF205" unicode=""
|
315 |
-
d="M1024 1920c493.952 0 896 -401.92 896 -896c0 -493.952 -402.048 -896 -896 -896c-494.08 0 -896 402.048 -896 896c0 494.08 401.92 896 896 896zM218.496 1024c0 -318.848 185.216 -594.432 454.016 -724.992l-384.256 1052.93
|
316 |
-
c-44.6719 -100.224 -69.7598 -211.071 -69.7598 -327.936zM1024 218.496c93.8242 0 183.808 16.1279 267.648 45.5684c-2.17676 3.45508 -4.09668 7.16797 -5.76074 11.2637l-247.552 678.271l-241.92 -702.336c72.1924 -21.248 148.48 -32.7676 227.584 -32.7676z
|
317 |
-
M1134.98 1401.73l291.072 -866.176l80.3838 268.544c34.9443 111.488 61.3125 191.488 61.3125 260.48c0 99.584 -35.8398 168.576 -66.4326 222.08c-40.7031 66.4316 -78.9756 122.624 -78.9756 189.056c0 74.1123 56.1924 142.977 135.168 142.977
|
318 |
-
c3.58398 0 7.04004 -0.384766 10.4961 -0.640625c-143.36 131.328 -334.208 211.456 -544 211.456c-281.472 0 -529.024 -144.256 -673.024 -363.008c18.9443 -0.639648 36.7363 -0.896484 51.8408 -0.896484c84.2236 0 214.655 10.2402 214.655 10.2402
|
319 |
-
c43.3926 2.56055 48.5127 -61.3115 5.24805 -66.4316c0 0 -43.7754 -5.12012 -92.1602 -7.68066l293.12 -872.575l176.256 528.64l-125.439 343.936c-43.3926 2.56055 -84.4805 7.68066 -84.4805 7.68066c-43.2637 2.55957 -38.2715 68.9922 5.12012 66.4316
|
320 |
-
c0 0 132.992 -10.2402 212.225 -10.2402c84.2236 0 214.783 10.2402 214.783 10.2402c43.3926 2.56055 48.5127 -61.3115 5.12012 -66.4316c0 0 -43.6475 -5.12012 -92.2881 -7.68066zM1730.82 1410.56c3.58398 -25.7275 5.50391 -53.248 5.63184 -82.8154
|
321 |
-
c0 -81.792 -15.4883 -173.696 -61.3125 -288.512l-246.144 -711.425c239.488 139.521 400.512 399.104 400.512 696.192c0 140.16 -35.8398 271.872 -98.6875 386.56z" />
|
322 |
-
<glyph glyph-name="uniF472" unicode=""
|
323 |
-
d="M1368.06 1408h-128l-240.129 -768h128l-39.9355 -128h-448l39.9355 128h128l240.129 768h-128l39.9355 128h448z" />
|
324 |
-
<glyph glyph-name="uniF216" unicode=""
|
325 |
-
d="M1791.62 1265.92c0.383789 -2.94434 0.639648 -5.75977 0.639648 -8.7041v-466.943c0 -2.94434 -0.255859 -5.76074 -0.511719 -8.96094c-0.12793 -0.767578 -0.383789 -1.79199 -0.511719 -2.81543c-0.384766 -1.79199 -0.640625 -3.58398 -1.15234 -5.50391
|
326 |
-
c-0.255859 -1.02441 -0.768555 -2.04785 -1.02441 -3.07227c-0.639648 -1.66406 -1.15137 -3.2002 -1.79199 -4.86426c-0.511719 -1.02344 -1.02344 -2.04785 -1.53613 -3.07129c-0.639648 -1.53613 -1.40723 -2.94434 -2.30371 -4.48047
|
327 |
-
c-0.511719 -0.895508 -1.28027 -1.91992 -1.91992 -2.94434c-0.767578 -1.2793 -1.66406 -2.55957 -2.6875 -3.96777c-0.768555 -0.895508 -1.53613 -1.79199 -2.30469 -2.81543c-1.02344 -1.02441 -2.04785 -2.30469 -3.32812 -3.45605
|
328 |
-
c-0.767578 -0.896484 -1.66406 -1.79199 -2.6875 -2.68848c-1.02441 -0.895508 -2.30371 -2.04785 -3.71191 -3.07227c-0.768555 -0.767578 -1.79199 -1.53516 -2.81641 -2.30371l-1.15137 -0.767578l-702.208 -467.072
|
329 |
-
c-11.1367 -7.42383 -23.8086 -11.0078 -36.6084 -11.0078s-25.4717 3.58398 -36.7363 11.2637l-702.208 467.072c-0.255859 0.255859 -0.639648 0.511719 -1.02344 0.767578l-2.94434 2.30469c-1.28027 0.895508 -2.55957 2.04785 -3.71191 3.07129
|
330 |
-
c-0.895508 0.896484 -1.79199 1.79199 -2.6875 2.68848c-1.02441 1.02344 -2.17676 2.30371 -3.2002 3.45605c-0.768555 0.895508 -1.53613 1.79199 -2.30469 2.81543c-0.895508 1.28027 -1.79199 2.56055 -2.6875 3.96875
|
331 |
-
c-0.768555 0.895508 -1.4082 1.91992 -1.91992 2.94336c-0.896484 1.53613 -1.66406 2.94434 -2.30371 4.48047c-0.512695 0.895508 -1.02441 1.91992 -1.53613 3.07129c-0.640625 1.66406 -1.15234 3.2002 -1.66406 4.86426
|
332 |
-
c-0.383789 0.896484 -0.768555 1.91992 -1.02441 3.07227c-0.511719 1.91992 -0.767578 3.71191 -1.15137 5.50391c-0.128906 1.02441 -0.384766 2.04785 -0.512695 2.94434c-0.383789 2.81543 -0.639648 5.75977 -0.639648 8.57617v466.943
|
333 |
-
c0 2.94434 0.255859 5.75977 0.639648 8.7041c0.12793 0.896484 0.383789 1.79199 0.512695 2.81641c0.383789 1.91992 0.639648 3.71191 1.15137 5.50391c0.255859 1.15137 0.640625 2.17578 1.02441 3.2002c0.511719 1.53516 1.02344 3.19922 1.66406 4.86328
|
334 |
-
c0.511719 1.02441 1.02344 2.04785 1.53613 3.2002c0.639648 1.53613 1.40723 2.81641 2.30371 4.48047c0.639648 0.895508 1.28027 1.91992 1.91992 2.94336c0.767578 1.28027 1.79199 2.68848 2.6875 3.96875c0.640625 1.02344 1.4082 1.79199 2.30469 2.81543
|
335 |
-
c1.02344 1.28027 2.04785 2.43164 3.2002 3.58398c0.895508 0.768555 1.79199 1.66406 2.6875 2.68848c1.15234 1.02344 2.43164 2.04785 3.71191 3.07129l2.94434 2.17676c0.383789 0.255859 0.767578 0.639648 1.15137 0.895508l702.208 466.944
|
336 |
-
c22.1445 14.7197 51.0723 14.7197 73.2168 0l702.08 -467.2c0.383789 -0.255859 0.767578 -0.639648 1.15137 -0.896484c0.896484 -0.767578 1.91992 -1.53516 2.81641 -2.30371c1.2793 -0.895508 2.55957 -1.91992 3.71191 -3.07227
|
337 |
-
c1.02344 -0.895508 1.91992 -1.79199 2.6875 -2.6875c1.15234 -1.02441 2.17676 -2.17578 3.32812 -3.45605c0.768555 -0.896484 1.53613 -1.79199 2.30469 -2.81641c0.895508 -1.2793 1.79199 -2.55957 2.6875 -3.96777
|
338 |
-
c0.639648 -0.895508 1.4082 -1.91992 1.91992 -2.94434c0.896484 -1.53516 1.66406 -2.81543 2.30371 -4.35156c0.512695 -1.02441 1.02441 -2.04785 1.53613 -3.2002c0.640625 -1.66406 1.15234 -3.2002 1.79199 -4.73535
|
339 |
-
c0.255859 -1.02441 0.768555 -2.04883 1.02441 -3.2002c0.511719 -1.79199 0.767578 -3.58398 1.15137 -5.50391c0.128906 -0.896484 0.384766 -1.79199 0.512695 -2.81641zM1090.05 1601.28v-307.328l286.208 -190.977l231.168 154.24zM957.952 1601.28l-517.248 -344.064
|
340 |
-
l231.04 -154.24l286.208 191.104v307.2zM387.84 1133.95v-220.416l165.12 110.208zM957.952 446.208v307.328l-286.208 190.976l-231.04 -154.111zM1024 867.84l233.472 155.904l-233.472 155.904l-233.472 -155.904zM1090.05 446.208l517.376 344.064l-231.168 154.111
|
341 |
-
l-286.208 -190.976v-307.2zM1660.29 913.536v220.416l-165.248 -110.208z" />
|
342 |
-
<glyph glyph-name="uniF475" unicode=""
|
343 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM476.16 1340.54l-2.81641 3.96777c-4.60742 -7.93555 -8.83203 -16.1279 -13.1836 -24.3193l4.47949 1.02344l17.5361 6.27246l30.208 2.6875zM1024 384
|
344 |
-
c265.088 0 493.056 162.176 590.208 392.576l-6.52832 10.4961l14.9766 50.8154l-34.6885 25.2158l-25.3438 7.55273l-23.5518 19.8398l-55.8086 -21.1201l-52.7354 -3.07227l-39.9365 29.0566l-39.04 53.5039l-0.767578 32.5117l0.895508 54.2725l5.63184 7.55176
|
345 |
-
l4.86426 18.1758l22.7842 35.0723l13.3125 13.0557l18.6875 20.7363l13.0557 25.5996l36.8643 34.9443l37.7598 -0.383789l27.6484 9.59961l66.4316 7.16797l25.9844 -36.8643l24.1924 -10.4961c-8.44824 39.4248 -20.2246 77.6963 -35.585 114.049l-5.50391 5.11914
|
346 |
-
l-13.4395 -6.65527l-28.9277 -2.68848l-23.8086 -21.248l-25.9834 -35.0723l-50.6885 -11.6475l-23.5518 9.21582l2.6875 40.5762l13.3125 25.2158l46.4639 -2.6875l8.57617 21.8877l-24.0645 26.624l20.6084 8.32031l40.4482 22.0156l14.4639 11.6484
|
347 |
-
c-49.1523 77.6953 -113.664 144.256 -190.721 194.688l-4.35156 -1.79199l20.3516 -17.792l-32.8955 5.24805l-4.6084 -9.34375l21.248 -2.56055l-7.93555 -8.95996l-59.9043 -10.3682l-77.3115 -34.3037l-59.9043 -28.9277l-6.27246 59.6475l16.8965 32.6406
|
348 |
-
l-12.416 21.7598l-45.9521 19.4561l-22.1436 17.1523l32.1279 7.67969l69.1201 16.8955l29.8232 1.66406c-64.7676 22.1445 -132.991 36.7363 -205.056 36.7363c-146.56 0 -280.064 -51.4561 -388.096 -134.656l38.2715 1.15234l47.7441 -12.2881l32 -8.19238
|
349 |
-
l34.8164 7.80859l47.6152 -6.0166l29.9521 7.2959l5.63184 18.0488l28.1602 -2.94434l11.0078 -22.7842l47.6162 4.35254l-74.752 -24.7041l-36.0957 -20.8643l-55.168 -42.2402l13.6963 -14.9756l38.3994 -18.0479l27.3926 -28.0322l33.6641 34.4316l19.4551 37.8887
|
350 |
-
l33.0244 22.6553l33.0244 -16.7676l9.08789 -18.4316l28.9277 10.2393l10.2402 -55.168l20.4795 -20.0957l-74.752 -19.0723l-54.7842 -21.5039l42.752 11.7764l-5.24707 -17.1523l13.5674 -15.3604l11.2646 -7.16797l-45.9521 -18.6875l16.1279 18.8154l-25.9844 -5.63184
|
351 |
-
l-31.2314 -14.8477l-14.208 -16.5117l-34.9443 -19.3281l-25.6006 -20.2246l-9.72754 -23.4238l-32.7676 -26.752l-25.8564 -59.3916l-8.06348 -25.7285l-23.6807 47.4883l-46.208 -0.12793l-38.3994 0.255859l-49.2803 -39.6797l-6.52832 -43.5205l29.6963 -32.3838
|
352 |
-
l57.2158 30.7197l-14.8477 -43.5195l-40.4482 -26.1123l-39.2959 9.47266l-43.5205 18.1758l-49.9199 79.1035l-22.1436 47.2324l-5.24805 16.2559l7.42383 -66.0479l-0.639648 -17.1523l-8.19238 10.2402l-4.99219 16.6396l-9.9834 12.416l-5.12012 22.9121
|
353 |
-
l-0.255859 35.9678l-26.752 46.3359c-17.4082 -58.1113 -29.5684 -118.399 -29.5684 -182.144c0 -295.936 202.88 -543.232 476.16 -616.192l-4.0957 12.6729l-9.60059 137.6l-11.1357 62.8477l-67.3281 65.792l-31.7441 56.3203l-10.624 27.9043l7.67969 16.5117
|
354 |
-
l14.0801 52.9922l7.55273 61.6953l-8.32031 4.73633l-14.9756 -10.8799l-19.9688 9.34375l13.4404 6.27246l59.9043 13.8242l39.4238 17.6631l-2.43262 -26.752l14.5928 24.1924l19.7119 -6.91211l67.7119 -21.6318l48.5117 -33.6641l34.9443 -19.3281l8.31934 -5.50391
|
355 |
-
l-8.19141 -48.7676l33.4082 9.47168l-8.32031 -16.6396l47.3604 -10.1123l48 -3.96777l31.3594 -19.7119l1.28027 -57.3447l-22.7842 -65.4072l-27.6475 -68.0967l-50.1768 -30.8477l-39.9355 -90.8799l-36.0957 5.12012l17.1514 -23.4238l-1.91992 -16.5127
|
356 |
-
l-33.2803 -26.4961c19.4561 -1.79199 38.1445 -5.8877 57.9844 -5.8877z" />
|
357 |
-
<glyph glyph-name="uniF432" unicode=""
|
358 |
-
d="M1408 640l-448 448l-448 -448l-128 128l576 576l576 -576z" />
|
359 |
-
<glyph glyph-name="uniF210" unicode=""
|
360 |
-
d="M1024 2048c565.632 0 1024 -458.496 1024 -1024c0 -565.632 -458.368 -1024 -1024 -1024c-100.864 0 -198.016 14.7197 -290.176 42.1123c38.7842 61.4395 81.2793 140.288 103.04 219.264c12.6719 45.5684 72.0635 281.6 72.0635 281.6
|
361 |
-
c35.7119 -67.9678 139.648 -127.743 250.24 -127.743c329.088 0 552.448 300.159 552.448 701.823c0 303.744 -257.28 586.624 -648.192 586.624c-486.527 0 -731.904 -348.8 -731.904 -639.744c0 -176.128 66.5605 -332.928 209.664 -391.168
|
362 |
-
c23.4248 -9.59961 44.416 -0.511719 51.2002 25.4727c4.73633 18.0479 16 63.4873 20.9922 82.1758c6.78418 25.7275 4.0957 34.6875 -14.8477 57.2158c-41.0879 48.6406 -67.4561 111.488 -67.4561 200.704c0 258.816 193.536 490.496 504.063 490.496
|
363 |
-
c274.944 0 426.112 -168.064 426.112 -392.448c0 -295.296 -130.432 -544.384 -324.608 -544.384c-107.136 0 -187.264 88.5762 -161.664 197.12c30.7207 129.664 90.4961 269.824 90.4961 363.392c0 83.8398 -44.9277 153.729 -138.111 153.729
|
364 |
-
c-109.44 0 -197.504 -113.28 -197.504 -265.088c0 -96.6406 32.7676 -162.049 32.7676 -162.049s-112.128 -474.88 -131.712 -557.951c-18.4316 -77.8242 -20.7363 -163.456 -17.9199 -235.137c-360.832 158.336 -612.992 518.784 -612.992 937.984
|
365 |
-
c0 565.504 458.496 1024 1024 1024z" />
|
366 |
-
<glyph glyph-name="uniF437" unicode=""
|
367 |
-
d="M1280 1792c141.312 0 256 -114.688 256 -256v-1024c0 -141.312 -114.688 -256 -256 -256h-512c-141.312 0 -256 114.688 -256 256v1024c0 141.312 114.688 256 256 256h512zM1024 384c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
368 |
-
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1408 768v768h-768v-768h768z" />
|
369 |
-
<glyph glyph-name="uniF468" unicode=""
|
370 |
-
d="M256 256v1536h256v-1536h-256zM1536 1664h256v-768h-256c-256 0 -256 128 -512 128s-256 -128 -384 -128v768c128 0 128 128 384 128s256 -128 512 -128z" />
|
371 |
-
<glyph glyph-name="uniF107" unicode=""
|
372 |
-
d="M1088 1792c176.768 0 320 -143.232 320 -320v-384c0 -131.2 -78.9756 -243.584 -192 -292.992v150.912c39.04 35.2002 64 85.6318 64 142.08v384c0 105.856 -86.1436 192 -192 192s-192 -86.1436 -192 -192v-384c0 -56.4482 24.96 -106.88 64 -142.08v-150.912
|
373 |
-
c-112.896 49.4082 -192 161.792 -192 292.992v384c0 176.768 143.232 320 320 320zM960 1380.99c112.896 -49.4082 192 -161.792 192 -292.992v-384c0 -176.768 -143.232 -320 -320 -320s-320 143.232 -320 320v384c0 131.2 79.1035 243.584 192 292.992v-150.912
|
374 |
-
c-39.04 -35.2002 -64 -85.6318 -64 -142.08v-384c0 -105.856 86.1436 -192 192 -192s192 86.1436 192 192v384c0 56.4482 -24.96 106.88 -64 142.08v150.912z" />
|
375 |
-
<glyph glyph-name="uniF442" unicode=""
|
376 |
-
d="M1280 640v256l128 128v-512h-896v896h512l-128 -128h-256v-640h640zM1024 1664h640v-640h-128v421.504l-549.504 -549.504l-90.4961 90.4961l549.504 549.504h-421.504v128z" />
|
377 |
-
<glyph glyph-name="uniF221" unicode=""
|
378 |
-
d="M1664 1024c0 -55.9355 -35.9678 -102.912 -85.8877 -120.32c13.8232 -20.6074 21.8877 -45.0557 21.8877 -71.6797c0 -55.8076 -35.9678 -102.784 -85.8877 -120.32c13.8232 -20.6074 21.8877 -45.0557 21.8877 -71.6797c0 -70.6562 -57.3438 -128 -128 -128h-64
|
379 |
-
c70.6562 0 128 -57.3438 128 -128s-57.3438 -128 -128 -128h-448c-192 0 -256 128 -384 128h-128v640h192c128 0 320 256 320 640c0 0 0 128 64 128s192 -144 192 -320c0 -192 -32 -320 -32 -320h416c70.6562 0 128 -57.3438 128 -128z" />
|
380 |
-
<glyph glyph-name="uniF50A" unicode=""
|
381 |
-
d="M1856 1024c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64h-204.928c-9.85645 -48.7676 -26.624 -94.5918 -46.8486 -138.624c116.608 -134.528 187.776 -309.376 187.776 -501.376v-64c0 -35.2002 -28.6719 -64 -64 -64s-64 28.7998 -64 64v64
|
382 |
-
c0 144.896 -48.7676 277.888 -130.048 385.152c-116.736 -155.265 -300.672 -257.152 -509.952 -257.152c-208.768 0 -392.448 101.504 -509.312 256.128c-81.2803 -106.88 -130.688 -239.231 -130.688 -384.128v-64c0 -35.2002 -28.6719 -64 -64 -64s-64 28.7998 -64 64v64
|
383 |
-
c0 192 71.2959 366.72 187.904 501.376c-20.3525 44.0322 -36.9922 89.8564 -46.9766 138.624h-204.928c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h192c0 61.6963 12.1602 119.936 29.0557 176c-98.1758 129.024 -157.056 289.408 -157.056 464v64
|
384 |
-
c0 35.3281 28.6719 64 64 64s64 -28.6719 64 -64v-64c0 -353.408 286.592 -640 640 -640c353.536 0 640 286.592 640 640v64c0 35.3281 28.6719 64 64 64s64 -28.6719 64 -64v-64c0 -173.952 -58.4961 -333.824 -156.032 -462.592
|
385 |
-
c17.2803 -56.3203 28.0322 -115.328 28.0322 -177.408h192zM1024 1152c-208.896 0 -388.352 126.08 -467.84 305.92c116.864 126.08 282.496 206.08 467.84 206.08c185.472 0 350.976 -80 467.84 -206.08c-79.4883 -179.84 -258.815 -305.92 -467.84 -305.92z" />
|
386 |
-
<glyph glyph-name="uniF455" unicode=""
|
387 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 1536c-70.7842 0 -128 -57.3438 -128 -128s57.2158 -128 128 -128c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128zM1280 512
|
388 |
-
v128h-160v512h-320.128v-128h128.128v-384h-160v-128h512z" />
|
389 |
-
<glyph glyph-name="uniF223" unicode=""
|
390 |
-
d="M1105.28 1232.51v92.9287c0 44.1592 -36.4805 79.8711 -81.2803 79.8711s-81.2803 -35.7119 -81.2803 -79.8711l-0.383789 -481.024c-2.55957 -184.192 -155.008 -332.416 -342.912 -332.416c-189.696 0 -343.424 150.912 -343.424 337.28v209.151h262.784v-206.592
|
391 |
-
c0 -43.9043 36.3516 -79.7441 81.2803 -79.7441c44.9277 0 81.2793 35.7119 81.2793 79.7441v487.168c6.65625 180.48 157.185 324.992 342.656 324.992c186.112 0 337.152 -145.536 342.656 -327.04v-106.624l-156.416 -45.8242zM1529.22 1058.43h262.784v-209.151
|
392 |
-
c0 -186.368 -153.728 -337.28 -343.424 -337.28c-188.544 0 -341.632 149.376 -343.296 334.08v210.304l104.96 -48l156.288 45.8242v-211.84c0 -44.2881 36.3516 -80 81.4072 -80c44.9287 0 81.2803 35.7119 81.2803 80v216.063z" />
|
393 |
-
<glyph glyph-name="uniF212" unicode=""
|
394 |
-
d="M1658.75 1791.87c184.192 -5.37598 270.976 -123.776 260.352 -355.072c-7.93555 -172.928 -129.792 -409.472 -365.439 -710.016c-243.584 -313.729 -449.792 -470.784 -618.368 -470.784c-104.448 0 -192.896 95.6162 -264.96 286.72
|
395 |
-
c-48.2559 175.232 -96.5117 350.336 -144.64 525.568c-53.6318 190.976 -111.232 286.592 -172.672 286.592c-13.4404 0 -60.416 -27.7764 -140.673 -83.584l-84.3516 107.648c88.4482 77.0557 175.616 154.111 261.504 231.168
|
396 |
-
c117.888 100.991 206.464 154.111 265.472 159.487c139.521 13.3125 225.28 -81.2793 257.536 -283.392c34.8164 -218.24 58.8799 -353.92 72.4482 -407.04c40.1924 -180.992 84.4805 -271.36 132.736 -271.36c37.5039 0 93.8232 58.752 169.088 176.128
|
397 |
-
c75.0078 117.376 115.2 206.849 120.576 268.16c10.624 101.376 -29.4404 152.192 -120.576 152.192c-43.0078 0 -87.2959 -9.98438 -132.736 -29.1846c88.0645 285.952 256.512 424.704 504.704 416.769z" />
|
398 |
-
<glyph glyph-name="uniF206" unicode=""
|
399 |
-
d="M729.6 1152h550.4s12.7998 -38.4004 12.7998 -89.5996c0 -332.801 -230.399 -563.2 -563.2 -563.2c-320 0 -588.8 268.8 -588.8 588.8s281.601 588.8 588.8 588.8c153.601 0 294.4 -51.2002 384 -153.6l-153.6 -153.601c-38.4004 25.6006 -102.4 76.8008 -230.4 76.8008
|
400 |
-
c-204.8 0 -371.199 -166.4 -371.199 -371.2s166.399 -371.2 371.199 -371.2c230.4 0 320 166.4 332.801 243.2h-332.801v204.8zM1664 1152h128v-128h-128v-128h-128v128h-128v128h128v128h128v-128z" />
|
401 |
-
<glyph glyph-name="uniF407" unicode=""
|
402 |
-
d="M1280 1536l256 -128v-128h-128h-128h-128h-128h-128h-128h-128h-128h-128v128l256 128c0 70.7842 57.3438 128 128 128h384c70.7842 0 128 -57.2158 128 -128zM1088 1408c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64h-256c-35.3281 0 -64 -28.6719 -64 -64
|
403 |
-
s28.6719 -64 64 -64h256zM1280 1216h128v-704c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.6562 0 -128 57.2158 -128 128v704h128v-704h128v704h128v-704h128v704h128v-704h128v704z" />
|
404 |
-
<glyph glyph-name="uniF414" unicode=""
|
405 |
-
d="M1996.03 601.984c116.992 -190.208 29.6953 -345.984 -193.536 -345.984h-1556.99c-223.231 0 -310.528 155.776 -193.536 345.984l759.552 1236.99c116.864 190.336 308.097 190.336 424.961 0zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
406 |
-
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896l51.584 640h-281.6l51.2002 -640h178.815z" />
|
407 |
-
<glyph glyph-name="uniF50E" unicode=""
|
408 |
-
d="M384 896v256h1280v-256h-1280z" />
|
409 |
-
<glyph glyph-name="uniF461" unicode=""
|
410 |
-
d="M1024 384l-647.552 612.992c-149.376 141.312 -161.408 383.231 -27.1367 540.288c134.4 157.184 364.416 169.855 513.792 28.5439l160.896 -152.32l160.768 152.32c149.248 141.184 379.393 128.64 513.792 -28.5439
|
411 |
-
c134.656 -157.057 122.368 -398.977 -27.0078 -540.416z" />
|
412 |
-
<glyph glyph-name="uniF470" unicode=""
|
413 |
-
d="M1536 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-1024c-70.6562 0 -128 57.2158 -128 128v640c0 70.6562 57.3438 128 128 128v128c0 282.752 229.248 512 512 512s512 -229.248 512 -512v-128zM768 1152h512v128
|
414 |
-
c0 141.312 -114.688 256 -256 256s-256 -114.688 -256 -256v-128z" />
|
415 |
-
<glyph glyph-name="uniF50C" unicode=""
|
416 |
-
d="M1479.55 819.2c98.5605 -32 203.137 -51.2002 312.448 -51.2002v-512c-848.256 0 -1536 687.744 -1536 1536h512c0 -162.048 38.5283 -314.752 105.856 -450.816l-189.185 -189.184c136.192 -235.008 344.96 -422.4 595.328 -532.224z" />
|
417 |
-
<glyph glyph-name="uniF220" unicode=""
|
418 |
-
d="M1856.77 834.048c32.3848 -65.6641 50.6885 -138.88 50.3047 -217.344c0 -269.696 -218.88 -488.704 -488.576 -488.704c-83.584 0 -161.92 21.376 -230.656 58.1123c-50.4316 -8.83203 -102.016 -13.8242 -154.496 -13.8242
|
419 |
-
c-465.279 0 -842.624 377.216 -842.624 842.496c0 58.2402 6.14453 114.688 17.2803 169.6c-42.4961 72.1924 -67.0723 156.8 -67.0723 246.912c0 269.824 218.88 488.704 488.704 488.704c95.7441 0 184.704 -27.3916 260.225 -75.0078
|
420 |
-
c46.4639 7.80762 94.5918 12.416 143.871 12.416c465.408 0 842.624 -377.344 842.624 -842.624c0 -62.0801 -6.65527 -122.752 -19.584 -180.736zM1466.11 612.096c38.9121 55.5527 58.624 118.656 58.752 188.16c0 58.2402 -11.2646 107.904 -34.1758 148.353
|
421 |
-
c-22.9121 40.3193 -54.7842 73.8555 -95.2324 100.224c-39.168 25.7275 -87.8076 48.1279 -143.744 66.0479c-55.4238 17.9199 -118.271 34.1758 -186.496 48.6396c-53.7598 12.416 -93.0557 21.8887 -116.479 28.6729c-23.04 6.14355 -45.4404 15.2314 -67.8398 26.3672
|
422 |
-
c-21.8887 10.624 -38.5283 23.5527 -50.4326 38.0166c-11.1357 13.9521 -16.7676 30.3359 -16.7676 49.2803c0 31.2314 16.8955 57.4717 52.2236 80.5117c36.3525 23.5518 85.6318 35.9678 146.048 35.9678c64.8965 0 112.384 -11.2637 140.544 -32.6396
|
423 |
-
c29.1846 -21.6318 54.2725 -53.6318 75.5205 -93.3125c18.5596 -31.3594 34.9434 -53.248 50.6875 -67.2002c16.3838 -14.5918 40.5762 -22.3994 71.9365 -22.3994c34.9434 0 63.8721 12.416 86.9121 36.4795c23.04 23.4248 34.6875 50.8164 34.6875 81.1523
|
424 |
-
c0 31.3604 -9.08789 63.3604 -25.2158 95.7441c-17.2803 32.3838 -44.7998 63.1035 -81.9199 92.2881c-36.8643 28.5439 -83.8398 52.0957 -139.008 69.5039c-55.8086 16.7676 -121.729 25.5996 -196.736 25.5996c-94.7197 0 -177.536 -13.1836 -247.424 -39.04
|
425 |
-
c-70.5283 -26.3682 -125.952 -64.3838 -163.584 -113.664c-38.0166 -49.2793 -56.96 -106.496 -56.96 -170.239c0 -67.2002 17.792 -123.776 54.2715 -169.217c35.0723 -44.1592 83.9688 -79.8721 144.385 -105.728c58.752 -25.2158 133.247 -47.3604 220.672 -66.0479
|
426 |
-
c64.2559 -13.3125 115.712 -26.2402 154.239 -38.0166c36.8643 -11.2637 67.3281 -27.9033 89.9844 -49.2793c22.1436 -20.7363 32.6396 -46.9766 32.6396 -80.1279c0 -42.3682 -20.2236 -76.8008 -62.0801 -105.345c-43.1357 -29.0557 -100.352 -43.9033 -169.728 -43.9033
|
427 |
-
c-50.9443 0 -92.416 7.16797 -122.624 21.6318c-30.3359 13.9521 -54.2715 32.5117 -70.5283 54.2715c-17.2793 22.6562 -33.4072 51.4561 -48.6396 85.7607c-13.4404 31.3594 -29.5684 55.8076 -49.2803 72.0635c-20.7354 17.2803 -45.3115 25.7285 -74.4961 25.7285
|
428 |
-
c-35.0713 0 -64.7676 -10.3682 -87.8076 -32.3848c-23.5518 -21.8877 -35.3281 -48.6396 -35.3281 -79.6152c0 -48.8965 17.9199 -100.608 53.8877 -152.192c35.0723 -50.9443 82.3047 -92.416 138.752 -123.136c79.3604 -41.8564 180.864 -63.1045 301.696 -63.1045
|
429 |
-
c100.736 0 189.44 15.4883 263.04 46.208c75.3926 30.9766 132.225 74.4961 171.648 129.92z" />
|
430 |
-
<glyph glyph-name="uniF415" unicode=""
|
431 |
-
d="M1408 1024h512v-256h-310.016c-98.8164 -225.92 -323.584 -384 -585.984 -384c-176.768 0 -335.488 72.832 -451.072 188.928l0.640625 0.640625c-50.0488 50.0479 -50.0488 130.943 0 180.991c50.0479 50.0488 130.943 50.1768 180.991 0
|
432 |
-
c69.376 -69.6318 163.456 -114.56 269.44 -114.56c212.096 0 384 171.904 384 384zM1024 1408c-212.096 0 -384 -171.904 -384 -384h-512v256h310.016c98.8164 225.92 323.712 384 585.984 384c176.896 0 335.488 -72.96 451.072 -188.928
|
433 |
-
c50.0479 -50.0479 50.0479 -130.944 0 -180.992s-130.944 -50.0479 -180.992 0l-0.639648 -0.639648c-69.376 69.6318 -163.328 114.56 -269.44 114.56zM832 1024c0 106.112 86.0156 192 192 192c106.112 0 192 -85.8877 192 -192s-85.8877 -192 -192 -192
|
434 |
-
c-105.984 0 -192 85.8877 -192 192z" />
|
435 |
-
<glyph glyph-name="uniF207" unicode=""
|
436 |
-
d="M604.672 256h-329.216v990.72h329.216v-990.72zM440.064 1381.89h-2.04883c-110.464 0 -182.016 76.1602 -182.016 171.137c0 97.1514 73.5996 171.136 186.368 171.136c112.512 0 181.888 -74.1123 184.063 -171.136c0 -94.9766 -71.5518 -171.137 -186.367 -171.137z
|
437 |
-
M1792 256h-329.216v530.048c0 133.12 -47.3604 224 -166.656 224c-91.1357 0 -145.28 -61.1836 -169.088 -120.32c-8.57617 -21.2471 -10.752 -50.9434 -10.752 -80.5117v-553.216h-329.344s4.35156 897.792 0 990.72h329.344v-140.416
|
438 |
-
c43.7764 67.4561 121.984 163.584 296.448 163.584c216.704 0 379.264 -141.567 379.264 -445.823v-568.064z" />
|
439 |
-
<glyph glyph-name="uniF500" unicode=""
|
440 |
-
d="M2048 0h-1920l960 959.872z" />
|
441 |
-
<glyph glyph-name="uniF302" unicode=""
|
442 |
-
d="M1024 1536h512v-512l-768 -768l-512 512zM1280 1152c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128s-128 -57.2158 -128 -128s57.2158 -128 128 -128z" />
|
443 |
-
<glyph glyph-name="uniF108" unicode=""
|
444 |
-
d="M1664 1536c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-128v-448l-448 448h-331.008l128 128h395.008c211.712 0 384 172.288 384 384v384zM1280 1792c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-448
|
445 |
-
l-448 -448v448h-128c-141.312 0 -256 114.688 -256 256v384c0 141.312 114.688 256 256 256h1024z" />
|
446 |
-
<glyph glyph-name="uniF405" unicode=""
|
447 |
-
d="M1536 1408l-320 -320l320 -320l-128 -128l-320 320l-320 -320l-128 128l320 320l-320 320l128 128l320 -320l320 320z" />
|
448 |
-
<glyph glyph-name="uniF501" unicode=""
|
449 |
-
d="M0 128v1920l960 -960z" />
|
450 |
-
<glyph glyph-name="uniF50D" unicode=""
|
451 |
-
d="M1024.13 896c-105.984 0 -192.128 86.0156 -192.128 192v512c0 105.856 86.1436 192 192.128 192c106.112 0 191.872 -86.1436 191.872 -192v-512c0 -105.984 -85.7598 -192 -191.872 -192zM1401.47 1024h192c-27.3916 -244.48 -206.464 -441.984 -441.472 -496v-272
|
452 |
-
h-256v272c-234.88 54.0156 -414.08 251.52 -441.472 496h192c30.5918 -181.504 187.52 -320 377.472 -320c190.208 0 347.008 138.496 377.472 320z" />
|
453 |
-
<glyph glyph-name="uniF503" unicode=""
|
454 |
-
d="M2048 2048v-1920l-960 960z" />
|
455 |
-
<glyph glyph-name="uniF101" unicode=""
|
456 |
-
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM1024 768c141.312 0 256 114.688 256 256s-114.688 256 -256 256s-256 -114.688 -256 -256s114.688 -256 256 -256z" />
|
457 |
-
<glyph glyph-name="uniF204" unicode=""
|
458 |
-
d="M1182.21 1271.81h328.704l-14.4639 -302.72h-314.24v-841.088h-320.128v841.088h-222.08v302.72h222.08v258.561c0 203.008 131.456 389.632 434.176 389.632c122.496 0 212.992 -11.6484 212.992 -11.6484l-7.04004 -282.624s-92.5439 0.640625 -193.536 0.640625
|
459 |
-
c-108.928 0 -126.464 -50.3037 -126.464 -133.504c0 -12.416 0 -15.3604 0 -13.9521v-207.104z" />
|
460 |
-
<glyph glyph-name="uniF444" unicode=""
|
461 |
-
d="M1600 640c-70.7842 0 -128 -57.2158 -128 -128s57.2158 -128 128 -128h64v-128h-1024c-141.312 0 -256 114.688 -256 256v1024c0 141.312 114.688 256 256 256h1024v-1152h-64zM640 384h817.92c-30.7197 34.0479 -49.9199 78.5918 -49.9199 128
|
462 |
-
s19.2002 93.9521 49.9199 128h-817.92c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128z" />
|
463 |
-
<glyph glyph-name="uniF416" unicode=""
|
464 |
-
d="M1088 1792c176.768 0 320 -143.232 320 -320v-640c0 -247.424 -200.576 -448 -448 -448s-448 200.576 -448 448v320h128v-320c0 -176.768 143.232 -320 320 -320c176.64 0 320 143.232 320 320v640c0 105.984 -86.0156 192 -192 192c-106.112 0 -192 -86.0156 -192 -192
|
465 |
-
v-512c0 -35.3281 28.6719 -64 64 -64s64 28.6719 64 64v451.968h128v-451.968c0 -105.984 -86.0156 -192 -192 -192c-106.112 0 -192 86.0156 -192 192v512c0 176.768 143.232 320 320 320z" />
|
466 |
-
<glyph glyph-name="uniF459" unicode=""
|
467 |
-
d="M1920 1664v-1280l-768 480v-480l-1024 640l1024 640v-480z" />
|
468 |
-
<glyph glyph-name="uniF441" unicode=""
|
469 |
-
d="M1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-512v256h256l-384 384l-384 -384h256v-256h-512c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.40039c-4.09668 20.7363 -6.40039 42.1123 -6.40039 64c0 176.768 143.232 320 320 320
|
470 |
-
c89.3438 0 169.984 -36.7363 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
471 |
-
<glyph glyph-name="uniF506" unicode=""
|
472 |
-
d="M768 1920l489.344 -489.472l-640 -640l-268.928 269.056c-49.792 49.792 -49.792 131.2 0 180.992l292.864 292.735l-1.28027 2.68848s128 128 128 384zM1738.24 565.76c33.1514 -32.7676 53.7598 -78.208 53.7598 -128.64c0 -99.9678 -81.1523 -181.12 -181.12 -181.12
|
473 |
-
c-50.4316 0 -95.7441 20.6084 -128.64 53.7598l-330.24 330.24v128l-64 64c-35.2002 35.2002 -104.704 23.2959 -154.496 -26.4961l-75.0078 -75.0078c-49.792 -49.792 -131.2 -49.792 -180.992 0l-14.8477 14.8477l640 640l14.8477 -14.8477
|
474 |
-
c49.792 -49.792 49.792 -131.2 0 -180.992l-75.0078 -75.0078c-49.792 -49.792 -61.6963 -119.296 -26.4961 -154.496l64 -64h128zM1610.88 373.12c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64s-64 -28.6719 -64 -64s28.6719 -64 64 -64z" />
|
475 |
-
<glyph glyph-name="uniF105" unicode=""
|
476 |
-
d="M1408 1408c0 -167.04 -107.264 -307.584 -256 -360.448v-535.552l-256 -128v663.552c-148.864 52.8643 -256 193.408 -256 360.448c0 212.096 171.904 384 384 384c211.968 0 384 -171.904 384 -384z" />
|
477 |
-
<glyph glyph-name="uniF473" unicode=""
|
478 |
-
d="M384 1664h1280v-1280h-1280v1280zM768 1408c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM1536 512v576l-128 192l-448 -672l-192 288l-256 -384h1024z" />
|
479 |
-
<glyph glyph-name="uniF452" unicode=""
|
480 |
-
d="M512 1664l1024 -640l-1024 -640v1280z" />
|
481 |
-
<glyph glyph-name="uniF408" unicode=""
|
482 |
-
d="M1792 1150.72l-475.904 -329.983l182.528 -535.04l-474.624 331.903l-474.624 -331.903l182.528 535.04l-475.904 329.983l587.52 -1.02344l180.48 535.68l180.48 -535.68z" />
|
483 |
-
<glyph glyph-name="uniF450" unicode=""
|
484 |
-
d="M768 1024l1024 640v-1280zM256 384v1280h384v-1280h-384z" />
|
485 |
-
<glyph glyph-name="uniF517" unicode=""
|
486 |
-
d="M1408 1152l384 384v-1024l-384 384v-256c0 -70.7842 -57.2158 -128 -128 -128h-896c-70.6562 0 -128 57.2158 -128 128v768c0 70.6562 57.3438 128 128 128h896c70.7842 0 128 -57.3438 128 -128v-256z" />
|
487 |
-
<glyph glyph-name="uniF106" unicode=""
|
488 |
-
d="M256 896v640h640v-640c0 -282.752 -229.248 -512 -512 -512v256c141.312 0 256 114.688 256 256h-384zM1152 1536h640v-640c0 -282.752 -229.248 -512 -512 -512v256c141.312 0 256 114.688 256 256h-384v640z" />
|
489 |
-
<glyph glyph-name="uniF208" unicode=""
|
490 |
-
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280zM663.168 384v792.96h-263.552v-792.96h263.552zM531.328 1285.25
|
491 |
-
c91.9043 0 149.12 60.9277 149.12 136.96c-1.66406 77.6963 -57.2158 136.96 -147.328 136.96c-90.2402 0 -149.12 -59.2637 -149.12 -136.96c0 -76.0322 57.2158 -136.96 145.664 -136.96h1.66406zM1613.44 384v454.656c0 243.456 -130.049 356.863 -303.488 356.863
|
492 |
-
c-139.776 0 -202.496 -76.9277 -237.44 -130.943v112.384h-263.552c3.45605 -74.3682 0 -792.96 0 -792.96h263.552v442.88c0 23.6797 1.79199 47.3604 8.57617 64.1279c19.0723 47.3604 62.4639 96.3838 135.296 96.3838c95.4883 0 133.504 -72.7031 133.504 -179.199
|
493 |
-
v-424.192h263.553z" />
|
494 |
-
<glyph glyph-name="uniF304" unicode=""
|
495 |
-
d="M1024 1152c-141.312 0 -256 114.688 -256 256s114.688 256 256 256s256 -114.688 256 -256s-114.688 -256 -256 -256zM1152 1024c211.968 0 384 -171.904 384 -384v-256h-1024v256c0 212.096 172.032 384 384 384h256z" />
|
496 |
-
<glyph glyph-name="uniF225" unicode=""
|
497 |
-
d="M655.104 1857.54l368.896 -307.968l-531.456 -328.192l-364.544 291.84zM128 929.536l364.544 291.84l531.456 -328.064l-368.896 -308.096zM1024 893.312l531.456 328.064l364.544 -291.84l-527.232 -344.32zM1920 1513.22l-364.544 -291.84l-531.456 328.192
|
498 |
-
l368.768 307.968zM1025.02 826.88l369.92 -306.944l158.464 103.297v-115.713l-528.384 -317.056l-528.257 317.056v115.713l158.336 -103.297z" />
|
499 |
-
<glyph glyph-name="uniF103" unicode=""
|
500 |
-
d="M1152 1408h896v-896h-896v896zM128 1024v384h896v-384h-896zM640 512v384h384v-384h-384zM128 512v384h384v-384h-384z" />
|
501 |
-
<glyph glyph-name="uniF431" unicode=""
|
502 |
-
d="M1408 1280l128 -128l-576 -576l-576 576l128 128l448 -448z" />
|
503 |
-
<glyph glyph-name="uniF200" unicode=""
|
504 |
-
d="M1024 2048c565.504 0 1024 -458.496 1024 -1024c0 -452.224 -293.12 -835.712 -699.776 -971.392c-51.9678 -9.98438 -70.3994 21.7598 -70.3994 49.2793c0 33.4082 1.2793 144 1.2793 280.704c0 95.7441 -32.7676 158.208 -69.5039 189.696
|
505 |
-
c228.097 25.3438 467.456 112 467.456 505.344c0 111.744 -39.5518 203.136 -105.088 274.688c10.4961 25.8555 45.6963 130.048 -10.2402 270.976c0 0 -85.8877 27.5205 -281.344 -104.96c-81.792 22.7842 -169.344 34.0479 -256.384 34.4316
|
506 |
-
c-87.04 -0.383789 -174.592 -11.6475 -256.384 -34.4316c-195.584 132.48 -281.601 104.96 -281.601 104.96c-55.6797 -140.928 -20.4795 -244.992 -9.85547 -270.976c-65.5361 -71.5527 -105.472 -162.944 -105.472 -274.688c0 -392.32 239.104 -480.384 466.432 -506.112
|
507 |
-
c-29.3125 -25.7275 -55.6797 -70.6553 -65.0244 -136.96c-58.2393 -26.2393 -206.72 -71.2959 -297.983 85.248c0 0 -54.1445 98.1768 -156.929 105.473c0 0 -100.096 1.2793 -7.04004 -62.208c0 0 67.0723 -31.4883 113.664 -150.017c0 0 60.0322 -198.912 344.96 -137.216
|
508 |
-
c0.512695 -85.248 1.4082 -149.76 1.4082 -173.952c0 -27.2637 -18.6875 -58.752 -69.8877 -49.5361c-406.912 135.425 -700.288 519.168 -700.288 971.648c0 565.504 458.496 1024 1024 1024z" />
|
509 |
-
<glyph glyph-name="uniF421" unicode=""
|
510 |
-
d="M384 896v256h1152v-256h-1152z" />
|
511 |
-
<glyph glyph-name="uniF454" unicode=""
|
512 |
-
d="M640 896v128h-512v256h512v128l384 -256zM1536 2048c141.312 0 256 -114.688 256 -256v-1536c0 -141.312 -114.688 -256 -256 -256h-1024c-141.312 0 -256 114.688 -256 256v640h256v-384h1024v1280h-1024v-384h-256v384c0 141.312 114.688 256 256 256h1024zM1024 128
|
513 |
-
c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128z" />
|
514 |
-
<glyph glyph-name="uniF213" unicode=""
|
515 |
-
d="M1536 1664c211.968 0 384 -171.904 384 -384v-512c0 -212.096 -172.032 -384 -384 -384h-1024c-212.096 0 -384 171.904 -384 384v512c0 212.096 171.904 384 384 384h1024zM768 640l640 384l-640 384v-768z" />
|
516 |
-
<glyph glyph-name="uniF401" unicode=""
|
517 |
-
d="M1297.15 878.848l494.848 -494.848l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM832 768
|
518 |
-
c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448s200.576 -448 448 -448zM512 1152v128h640v-128h-640z" />
|
519 |
-
<glyph glyph-name="uniF436" unicode=""
|
520 |
-
d="M512 1408v128h128v-128h-128zM768 1408v128h128v-128h-128zM1024 1408v128h128v-128h-128zM1280 1536h128v-128h-128v128zM512 1152v128h128v-128h-128zM768 1152v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1280 1152v128h128v-128h-128zM512 896v128h128v-128
|
521 |
-
h-128zM768 896v128h128v-128h-128zM1024 896v128h128v-128h-128zM1280 896v128h128v-128h-128zM512 640v128h128v-128h-128zM768 640v128h128v-128h-128zM1024 640v128h128v-128h-128zM1280 640v128h128v-128h-128z" />
|
522 |
-
<glyph glyph-name="uniF434" unicode=""
|
523 |
-
d="M1152 0l896 896v-896h-896z" />
|
524 |
-
<glyph glyph-name="uniF303" unicode=""
|
525 |
-
d="M960 1792c388.736 0 704 -315.136 704 -704c0 -388.736 -315.264 -704 -704 -704c-388.864 0 -704 315.264 -704 704c0 388.864 315.136 704 704 704zM960 512c317.952 0 576 257.92 576 576s-258.048 576 -576 576c-318.08 0 -576 -257.92 -576 -576
|
526 |
-
s257.92 -576 576 -576zM1024 1536v-421.504l297.984 -297.984l-90.4961 -90.4961l-335.488 335.488v474.496h128z" />
|
527 |
-
<glyph glyph-name="uniF464" unicode=""
|
528 |
-
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
529 |
-
M1920 640v128h-640v-128h640z" />
|
530 |
-
<glyph glyph-name="uniF109" unicode=""
|
531 |
-
d="M256 1280h384l384 384v-1280l-384 384h-384v512zM1295.49 1295.62c69.5039 -69.5039 112.512 -165.504 112.512 -271.616s-43.0078 -202.112 -112.512 -271.488l-90.4961 90.4961c46.3359 46.208 75.0078 110.208 75.0078 180.992
|
532 |
-
c0 70.6562 -28.6719 134.656 -75.0078 181.12zM1476.61 1476.61c115.712 -115.841 187.392 -275.841 187.392 -452.608c0 -176.896 -71.6797 -336.896 -187.392 -452.608l-90.4961 90.4961c92.6719 92.6719 149.888 220.672 149.888 362.112
|
533 |
-
c0 141.312 -57.2158 269.44 -149.888 361.984z" />
|
534 |
-
<glyph glyph-name="uniF428" unicode=""
|
535 |
-
d="M1024 1280c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256s-256 114.688 -256 256s114.688 256 256 256z" />
|
536 |
-
</font>
|
537 |
-
</defs></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
Binary file
|
_inc/genericons/genericons/Genericons.woff
DELETED
Binary file
|
_inc/genericons/genericons/genericons.css
DELETED
@@ -1,263 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
|
3 |
-
Genericons
|
4 |
-
|
5 |
-
*/
|
6 |
-
|
7 |
-
|
8 |
-
/* IE8 and below use EOT and allow cross-site embedding.
|
9 |
-
IE9 uses WOFF which is base64 encoded to allow cross-site embedding.
|
10 |
-
So unfortunately, IE9 will throw a console error, but it'll still work.
|
11 |
-
When the font is base64 encoded, cross-site embedding works in Firefox */
|
12 |
-
@font-face {
|
13 |
-
font-family: "Genericons";
|
14 |
-
src: url("./Genericons.eot");
|
15 |
-
src: url("./Genericons.eot?") format("embedded-opentype");
|
16 |
-
font-weight: normal;
|
17 |
-
font-style: normal;
|
18 |
-
}
|
19 |
-
|
20 |
-
@font-face {
|
21 |
-
font-family: "Genericons";
|
22 |
-
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADakAA0AAAAAVqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAA2iAAAABoAAAAcdeu6KE9TLzIAAAGgAAAARQAAAGBkLHXFY21hcAAAAogAAACWAAABsqlys6FjdnQgAAADIAAAAAQAAAAEAEQFEWdhc3AAADaAAAAACAAAAAj//wADZ2x5ZgAABFQAAC7AAABIkKrsSc5oZWFkAAABMAAAAC8AAAA2C2BCV2hoZWEAAAFgAAAAHQAAACQQuAgGaG10eAAAAegAAACfAAABOFjwU3Jsb2NhAAADJAAAATAAAAEwy4vdrm1heHAAAAGAAAAAIAAAACAA6QEZbmFtZQAAMxQAAAE5AAACN1KGf59wb3N0AAA0UAAAAjAAAAXo9iKXv3jaY2BkYGAAYqUtWvLx/DZfGbg5GEDgkmLVWhj9/ycDAwcbWJyDgQlEAQABJgkgAHjaY2BkYOBgAIIdHAz/fwLZbAyMDKiAFQBE7gLWAAAAAAEAAACXAOgAEAAAAAAAAgAAAAEAAQAAAEAALgAAAAB42mNgYf/M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1a8/9wu7FFQ2Vtf4mwE0IbW2fYyMqUWnEholAIwf/u+QXtVlqxAAAAeNpt0meTFVUUheH7DhkJEgQJgpIFhdvn7NM9gxKGCZKzKGZyUHJGySAgSq7i5wrFfYdPdFXX+tRP9V61Wl2tt8//rdbh1vueV29eWl2tYXQxjOGMYCSjGM0YxvIB4xjPBCbyIZOYzBSm8hHTmM7HzGAms5jNJ8xhLp/yGfOYzwIWsojFLOFzlrKML/iS5aygTUUiExRqGrrpYSVf8TWrWM0a1tLLOvroZ4BBvmE9G9jIJjazha1sYzs72MkudvMte/iO79nLD/zIT/zML/zKb+xjPwc4yCEOc4SjHOM4v/MHJzjJKU5zhrOc4zwXuMglLnOFq/zJX1zjOje4yS1uc4e73ONv7vOAh/zDI/7lPx7zhKc84zkveDnqwsljg1W7bVZmMrMZZjFrszG7zZ63mfSSXtJLekkv6SW9pJf00pBX6VV6lV6lV+lVepVepVfpVXpJL+klvaSX9JJe6njZu7J3Ze/K3pW9K3tXbg9915id/wid0Amd0Amd0Amd0Il3TueesJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn0h6SS/pZb2sl/WyXtbLelkv62W9rBd6oRd6oRd6oRd6oRd6oVf0il7RK3pFr+gVvaJX9IperVfr1Xq1Xq1X69V6tV6tV+s1eo1eo9foNXqNXtPxijsr7qy4s+LOijsr7qy0h75rzG6zx+w115l9Zr85YA520l0Wd1ncZXGXxV0Wd1ncZama1x+EcTsAAAAB//8AAnjaY2BgYGQAgosrjpwF0ZcUq9bCaABTzgdAAAA=") format("woff"),
|
23 |
-
url("./Genericons.ttf") format("truetype"),
|
24 |
-
url("./Genericons.svg#Genericons") format("svg");
|
25 |
-
font-weight: normal;
|
26 |
-
font-style: normal;
|
27 |
-
}
|
28 |
-
|
29 |
-
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
30 |
-
@font-face {
|
31 |
-
font-family: "Genericons";
|
32 |
-
src: url("./Genericons.svg#Genericons") format("svg");
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* All Genericons
|
39 |
-
*/
|
40 |
-
|
41 |
-
.genericon {
|
42 |
-
font-size: 16px;
|
43 |
-
vertical-align: top;
|
44 |
-
text-align: center;
|
45 |
-
-moz-transition: color .1s ease-in 0;
|
46 |
-
-webkit-transition: color .1s ease-in 0;
|
47 |
-
display: inline-block;
|
48 |
-
font-family: "Genericons";
|
49 |
-
font-style: normal;
|
50 |
-
font-weight: normal;
|
51 |
-
font-variant: normal;
|
52 |
-
line-height: 1;
|
53 |
-
text-decoration: inherit;
|
54 |
-
text-transform: none;
|
55 |
-
-moz-osx-font-smoothing: grayscale;
|
56 |
-
-webkit-font-smoothing: antialiased;
|
57 |
-
speak: none;
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Helper classes
|
63 |
-
*/
|
64 |
-
|
65 |
-
.genericon-rotate-90 {
|
66 |
-
-webkit-transform: rotate(90deg);
|
67 |
-
-moz-transform: rotate(90deg);
|
68 |
-
-ms-transform: rotate(90deg);
|
69 |
-
-o-transform: rotate(90deg);
|
70 |
-
transform: rotate(90deg);
|
71 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
72 |
-
}
|
73 |
-
|
74 |
-
.genericon-rotate-180 {
|
75 |
-
-webkit-transform: rotate(180deg);
|
76 |
-
-moz-transform: rotate(180deg);
|
77 |
-
-ms-transform: rotate(180deg);
|
78 |
-
-o-transform: rotate(180deg);
|
79 |
-
transform: rotate(180deg);
|
80 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
|
81 |
-
}
|
82 |
-
|
83 |
-
.genericon-rotate-270 {
|
84 |
-
-webkit-transform: rotate(270deg);
|
85 |
-
-moz-transform: rotate(270deg);
|
86 |
-
-ms-transform: rotate(270deg);
|
87 |
-
-o-transform: rotate(270deg);
|
88 |
-
transform: rotate(270deg);
|
89 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
90 |
-
}
|
91 |
-
|
92 |
-
.genericon-flip-horizontal {
|
93 |
-
-webkit-transform: scale(-1, 1);
|
94 |
-
-moz-transform: scale(-1, 1);
|
95 |
-
-ms-transform: scale(-1, 1);
|
96 |
-
-o-transform: scale(-1, 1);
|
97 |
-
transform: scale(-1, 1);
|
98 |
-
}
|
99 |
-
|
100 |
-
.genericon-flip-vertical {
|
101 |
-
-webkit-transform: scale(1, -1);
|
102 |
-
-moz-transform: scale(1, -1);
|
103 |
-
-ms-transform: scale(1, -1);
|
104 |
-
-o-transform: scale(1, -1);
|
105 |
-
transform: scale(1, -1);
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Individual icons
|
111 |
-
*/
|
112 |
-
|
113 |
-
.genericon-404:before { content: "\f423"; }
|
114 |
-
.genericon-activity:before { content: "\f508"; }
|
115 |
-
.genericon-anchor:before { content: "\f509"; }
|
116 |
-
.genericon-aside:before { content: "\f101"; }
|
117 |
-
.genericon-attachment:before { content: "\f416"; }
|
118 |
-
.genericon-audio:before { content: "\f109"; }
|
119 |
-
.genericon-bold:before { content: "\f471"; }
|
120 |
-
.genericon-book:before { content: "\f444"; }
|
121 |
-
.genericon-bug:before { content: "\f50a"; }
|
122 |
-
.genericon-cart:before { content: "\f447"; }
|
123 |
-
.genericon-category:before { content: "\f301"; }
|
124 |
-
.genericon-chat:before { content: "\f108"; }
|
125 |
-
.genericon-checkmark:before { content: "\f418"; }
|
126 |
-
.genericon-close:before { content: "\f405"; }
|
127 |
-
.genericon-close-alt:before { content: "\f406"; }
|
128 |
-
.genericon-cloud:before { content: "\f426"; }
|
129 |
-
.genericon-cloud-download:before { content: "\f440"; }
|
130 |
-
.genericon-cloud-upload:before { content: "\f441"; }
|
131 |
-
.genericon-code:before { content: "\f462"; }
|
132 |
-
.genericon-codepen:before { content: "\f216"; }
|
133 |
-
.genericon-cog:before { content: "\f445"; }
|
134 |
-
.genericon-collapse:before { content: "\f432"; }
|
135 |
-
.genericon-comment:before { content: "\f300"; }
|
136 |
-
.genericon-day:before { content: "\f305"; }
|
137 |
-
.genericon-digg:before { content: "\f221"; }
|
138 |
-
.genericon-document:before { content: "\f443"; }
|
139 |
-
.genericon-dot:before { content: "\f428"; }
|
140 |
-
.genericon-downarrow:before { content: "\f502"; }
|
141 |
-
.genericon-download:before { content: "\f50b"; }
|
142 |
-
.genericon-draggable:before { content: "\f436"; }
|
143 |
-
.genericon-dribbble:before { content: "\f201"; }
|
144 |
-
.genericon-dropbox:before { content: "\f225"; }
|
145 |
-
.genericon-dropdown:before { content: "\f433"; }
|
146 |
-
.genericon-dropdown-left:before { content: "\f434"; }
|
147 |
-
.genericon-edit:before { content: "\f411"; }
|
148 |
-
.genericon-ellipsis:before { content: "\f476"; }
|
149 |
-
.genericon-expand:before { content: "\f431"; }
|
150 |
-
.genericon-external:before { content: "\f442"; }
|
151 |
-
.genericon-facebook:before { content: "\f203"; }
|
152 |
-
.genericon-facebook-alt:before { content: "\f204"; }
|
153 |
-
.genericon-fastforward:before { content: "\f458"; }
|
154 |
-
.genericon-feed:before { content: "\f413"; }
|
155 |
-
.genericon-flag:before { content: "\f468"; }
|
156 |
-
.genericon-flickr:before { content: "\f211"; }
|
157 |
-
.genericon-foursquare:before { content: "\f226"; }
|
158 |
-
.genericon-fullscreen:before { content: "\f474"; }
|
159 |
-
.genericon-gallery:before { content: "\f103"; }
|
160 |
-
.genericon-github:before { content: "\f200"; }
|
161 |
-
.genericon-googleplus:before { content: "\f206"; }
|
162 |
-
.genericon-googleplus-alt:before { content: "\f218"; }
|
163 |
-
.genericon-handset:before { content: "\f50c"; }
|
164 |
-
.genericon-heart:before { content: "\f461"; }
|
165 |
-
.genericon-help:before { content: "\f457"; }
|
166 |
-
.genericon-hide:before { content: "\f404"; }
|
167 |
-
.genericon-hierarchy:before { content: "\f505"; }
|
168 |
-
.genericon-home:before { content: "\f409"; }
|
169 |
-
.genericon-image:before { content: "\f102"; }
|
170 |
-
.genericon-info:before { content: "\f455"; }
|
171 |
-
.genericon-instagram:before { content: "\f215"; }
|
172 |
-
.genericon-italic:before { content: "\f472"; }
|
173 |
-
.genericon-key:before { content: "\f427"; }
|
174 |
-
.genericon-leftarrow:before { content: "\f503"; }
|
175 |
-
.genericon-link:before { content: "\f107"; }
|
176 |
-
.genericon-linkedin:before { content: "\f207"; }
|
177 |
-
.genericon-linkedin-alt:before { content: "\f208"; }
|
178 |
-
.genericon-location:before { content: "\f417"; }
|
179 |
-
.genericon-lock:before { content: "\f470"; }
|
180 |
-
.genericon-mail:before { content: "\f410"; }
|
181 |
-
.genericon-maximize:before { content: "\f422"; }
|
182 |
-
.genericon-menu:before { content: "\f419"; }
|
183 |
-
.genericon-microphone:before { content: "\f50d"; }
|
184 |
-
.genericon-minimize:before { content: "\f421"; }
|
185 |
-
.genericon-minus:before { content: "\f50e"; }
|
186 |
-
.genericon-month:before { content: "\f307"; }
|
187 |
-
.genericon-move:before { content: "\f50f"; }
|
188 |
-
.genericon-next:before { content: "\f429"; }
|
189 |
-
.genericon-notice:before { content: "\f456"; }
|
190 |
-
.genericon-paintbrush:before { content: "\f506"; }
|
191 |
-
.genericon-path:before { content: "\f219"; }
|
192 |
-
.genericon-pause:before { content: "\f448"; }
|
193 |
-
.genericon-phone:before { content: "\f437"; }
|
194 |
-
.genericon-picture:before { content: "\f473"; }
|
195 |
-
.genericon-pinned:before { content: "\f308"; }
|
196 |
-
.genericon-pinterest:before { content: "\f209"; }
|
197 |
-
.genericon-pinterest-alt:before { content: "\f210"; }
|
198 |
-
.genericon-play:before { content: "\f452"; }
|
199 |
-
.genericon-plugin:before { content: "\f439"; }
|
200 |
-
.genericon-plus:before { content: "\f510"; }
|
201 |
-
.genericon-pocket:before { content: "\f224"; }
|
202 |
-
.genericon-polldaddy:before { content: "\f217"; }
|
203 |
-
.genericon-portfolio:before { content: "\f460"; }
|
204 |
-
.genericon-previous:before { content: "\f430"; }
|
205 |
-
.genericon-print:before { content: "\f469"; }
|
206 |
-
.genericon-quote:before { content: "\f106"; }
|
207 |
-
.genericon-rating-empty:before { content: "\f511"; }
|
208 |
-
.genericon-rating-full:before { content: "\f512"; }
|
209 |
-
.genericon-rating-half:before { content: "\f513"; }
|
210 |
-
.genericon-reddit:before { content: "\f222"; }
|
211 |
-
.genericon-refresh:before { content: "\f420"; }
|
212 |
-
.genericon-reply:before { content: "\f412"; }
|
213 |
-
.genericon-reply-alt:before { content: "\f466"; }
|
214 |
-
.genericon-reply-single:before { content: "\f467"; }
|
215 |
-
.genericon-rewind:before { content: "\f459"; }
|
216 |
-
.genericon-rightarrow:before { content: "\f501"; }
|
217 |
-
.genericon-search:before { content: "\f400"; }
|
218 |
-
.genericon-send-to-phone:before { content: "\f438"; }
|
219 |
-
.genericon-send-to-tablet:before { content: "\f454"; }
|
220 |
-
.genericon-share:before { content: "\f415"; }
|
221 |
-
.genericon-show:before { content: "\f403"; }
|
222 |
-
.genericon-shuffle:before { content: "\f514"; }
|
223 |
-
.genericon-sitemap:before { content: "\f507"; }
|
224 |
-
.genericon-skip-ahead:before { content: "\f451"; }
|
225 |
-
.genericon-skip-back:before { content: "\f450"; }
|
226 |
-
.genericon-skype:before { content: "\f220"; }
|
227 |
-
.genericon-spam:before { content: "\f424"; }
|
228 |
-
.genericon-spotify:before { content: "\f515"; }
|
229 |
-
.genericon-standard:before { content: "\f100"; }
|
230 |
-
.genericon-star:before { content: "\f408"; }
|
231 |
-
.genericon-status:before { content: "\f105"; }
|
232 |
-
.genericon-stop:before { content: "\f449"; }
|
233 |
-
.genericon-stumbleupon:before { content: "\f223"; }
|
234 |
-
.genericon-subscribe:before { content: "\f463"; }
|
235 |
-
.genericon-subscribed:before { content: "\f465"; }
|
236 |
-
.genericon-summary:before { content: "\f425"; }
|
237 |
-
.genericon-tablet:before { content: "\f453"; }
|
238 |
-
.genericon-tag:before { content: "\f302"; }
|
239 |
-
.genericon-time:before { content: "\f303"; }
|
240 |
-
.genericon-top:before { content: "\f435"; }
|
241 |
-
.genericon-trash:before { content: "\f407"; }
|
242 |
-
.genericon-tumblr:before { content: "\f214"; }
|
243 |
-
.genericon-twitch:before { content: "\f516"; }
|
244 |
-
.genericon-twitter:before { content: "\f202"; }
|
245 |
-
.genericon-unapprove:before { content: "\f446"; }
|
246 |
-
.genericon-unsubscribe:before { content: "\f464"; }
|
247 |
-
.genericon-unzoom:before { content: "\f401"; }
|
248 |
-
.genericon-uparrow:before { content: "\f500"; }
|
249 |
-
.genericon-user:before { content: "\f304"; }
|
250 |
-
.genericon-video:before { content: "\f104"; }
|
251 |
-
.genericon-videocamera:before { content: "\f517"; }
|
252 |
-
.genericon-vimeo:before { content: "\f212"; }
|
253 |
-
.genericon-warning:before { content: "\f414"; }
|
254 |
-
.genericon-website:before { content: "\f475"; }
|
255 |
-
.genericon-week:before { content: "\f306"; }
|
256 |
-
.genericon-wordpress:before { content: "\f205"; }
|
257 |
-
.genericon-xpost:before { content: "\f504"; }
|
258 |
-
.genericon-youtube:before { content: "\f213"; }
|
259 |
-
.genericon-zoom:before { content: "\f402"; }
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/genericons/genericons/rtl/genericons-rtl.css
DELETED
@@ -1,265 +0,0 @@
|
|
1 |
-
/* This file was automatically generated on Sep 30 2015 12:24:15 */
|
2 |
-
|
3 |
-
/**
|
4 |
-
|
5 |
-
Genericons
|
6 |
-
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
/* IE8 and below use EOT and allow cross-site embedding.
|
11 |
-
IE9 uses WOFF which is base64 encoded to allow cross-site embedding.
|
12 |
-
So unfortunately, IE9 will throw a console error, but it'll still work.
|
13 |
-
When the font is base64 encoded, cross-site embedding works in Firefox */
|
14 |
-
@font-face {
|
15 |
-
font-family: "Genericons";
|
16 |
-
src: url(".././Genericons.eot");
|
17 |
-
src: url(".././Genericons.eot?") format("embedded-opentype");
|
18 |
-
font-weight: normal;
|
19 |
-
font-style: normal;
|
20 |
-
}
|
21 |
-
|
22 |
-
@font-face {
|
23 |
-
font-family: "Genericons";
|
24 |
-
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAADakAA0AAAAAVqwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAA2iAAAABoAAAAcdeu6KE9TLzIAAAGgAAAARQAAAGBkLHXFY21hcAAAAogAAACWAAABsqlys6FjdnQgAAADIAAAAAQAAAAEAEQFEWdhc3AAADaAAAAACAAAAAj//wADZ2x5ZgAABFQAAC7AAABIkKrsSc5oZWFkAAABMAAAAC8AAAA2C2BCV2hoZWEAAAFgAAAAHQAAACQQuAgGaG10eAAAAegAAACfAAABOFjwU3Jsb2NhAAADJAAAATAAAAEwy4vdrm1heHAAAAGAAAAAIAAAACAA6QEZbmFtZQAAMxQAAAE5AAACN1KGf59wb3N0AAA0UAAAAjAAAAXo9iKXv3jaY2BkYGAAYqUtWvLx/DZfGbg5GEDgkmLVWhj9/ycDAwcbWJyDgQlEAQABJgkgAHjaY2BkYOBgAIIdHAz/fwLZbAyMDKiAFQBE7gLWAAAAAAEAAACXAOgAEAAAAAAAAgAAAAEAAQAAAEAALgAAAAB42mNgYf/MOIGBlYGB1Zh1JgMDoxyEZr7OkMYkxMDAxMDKzAADjAIMCBCQ5prC0MCg8FWcA8TdwQFVg6REgYERAPvTCMQAAAB42i1PsRXCUAg8SAprl7FN4QZqb2WZGRjAIVLrHj4be4ews7OJHAd54cMBd+Af7JHmt3RPYAOHAYFweFhmYE4jlj+uVb8nshCzd/qVeNUCLysG8lgwrojfSW/pcTK6o7rWX82En6HJwIEv+wbi28IwpndxRu/JaJGStHRDq5EB+OKCNumZLlSVl2TnOFVtl9nR5t7woR0QzVT+D7cKLeIAeNpjYGBgZoBgGQZGBhBYA+QxgvksDBOAtAIQsoDoj5yfOD9JflL7zPGF84vkF80vll88v0R+yfxS9lX8/3+wCoZPDJ8EPil8ZvjC8EXgi8IXgy8OXwK+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lPx7zhKc84zkveDnqwsljg1W7bVZmMrMZZjFrszG7zZ63mfSSXtJLekkv6SW9pJf00pBX6VV6lV6lV+lVepVepVfpVXpJL+klvaSX9JJe6njZu7J3Ze/K3pW9K3tXbg9915id/wid0Amd0Amd0Amd0Il3TueesJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn7CfsJ+wn0h6SS/pZb2sl/WyXtbLelkv62W9rBd6oRd6oRd6oRd6oRd6oVf0il7RK3pFr+gVvaJX9IperVfr1Xq1Xq1X69V6tV6tV+s1eo1eo9foNXqNXtPxijsr7qy4s+LOijsr7qy0h75rzG6zx+w115l9Zr85YA520l0Wd1ncZXGXxV0Wd1ncZama1x+EcTsAAAAB//8AAnjaY2BgYGQAgosrjpwF0ZcUq9bCaABTzgdAAAA=") format("woff"),
|
25 |
-
url(".././Genericons.ttf") format("truetype"),
|
26 |
-
url(".././Genericons.svg#Genericons") format("svg");
|
27 |
-
font-weight: normal;
|
28 |
-
font-style: normal;
|
29 |
-
}
|
30 |
-
|
31 |
-
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
32 |
-
@font-face {
|
33 |
-
font-family: "Genericons";
|
34 |
-
src: url(".././Genericons.svg#Genericons") format("svg");
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* All Genericons
|
41 |
-
*/
|
42 |
-
|
43 |
-
.genericon {
|
44 |
-
font-size: 16px;
|
45 |
-
vertical-align: top;
|
46 |
-
text-align: center;
|
47 |
-
-moz-transition: color .1s ease-in 0;
|
48 |
-
-webkit-transition: color .1s ease-in 0;
|
49 |
-
display: inline-block;
|
50 |
-
font-family: "Genericons";
|
51 |
-
font-style: normal;
|
52 |
-
font-weight: normal;
|
53 |
-
font-variant: normal;
|
54 |
-
line-height: 1;
|
55 |
-
text-decoration: inherit;
|
56 |
-
text-transform: none;
|
57 |
-
-moz-osx-font-smoothing: grayscale;
|
58 |
-
-webkit-font-smoothing: antialiased;
|
59 |
-
speak: none;
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Helper classes
|
65 |
-
*/
|
66 |
-
|
67 |
-
.genericon-rotate-90 {
|
68 |
-
-webkit-transform: rotate(90deg);
|
69 |
-
-moz-transform: rotate(90deg);
|
70 |
-
-ms-transform: rotate(90deg);
|
71 |
-
-o-transform: rotate(90deg);
|
72 |
-
transform: rotate(90deg);
|
73 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
74 |
-
}
|
75 |
-
|
76 |
-
.genericon-rotate-180 {
|
77 |
-
-webkit-transform: rotate(180deg);
|
78 |
-
-moz-transform: rotate(180deg);
|
79 |
-
-ms-transform: rotate(180deg);
|
80 |
-
-o-transform: rotate(180deg);
|
81 |
-
transform: rotate(180deg);
|
82 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
|
83 |
-
}
|
84 |
-
|
85 |
-
.genericon-rotate-270 {
|
86 |
-
-webkit-transform: rotate(270deg);
|
87 |
-
-moz-transform: rotate(270deg);
|
88 |
-
-ms-transform: rotate(270deg);
|
89 |
-
-o-transform: rotate(270deg);
|
90 |
-
transform: rotate(270deg);
|
91 |
-
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
92 |
-
}
|
93 |
-
|
94 |
-
.genericon-flip-horizontal {
|
95 |
-
-webkit-transform: scale(-1, 1);
|
96 |
-
-moz-transform: scale(-1, 1);
|
97 |
-
-ms-transform: scale(-1, 1);
|
98 |
-
-o-transform: scale(-1, 1);
|
99 |
-
transform: scale(-1, 1);
|
100 |
-
}
|
101 |
-
|
102 |
-
.genericon-flip-vertical {
|
103 |
-
-webkit-transform: scale(1, -1);
|
104 |
-
-moz-transform: scale(1, -1);
|
105 |
-
-ms-transform: scale(1, -1);
|
106 |
-
-o-transform: scale(1, -1);
|
107 |
-
transform: scale(1, -1);
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Individual icons
|
113 |
-
*/
|
114 |
-
|
115 |
-
.genericon-404:before { content: "\f423"; }
|
116 |
-
.genericon-activity:before { content: "\f508"; }
|
117 |
-
.genericon-anchor:before { content: "\f509"; }
|
118 |
-
.genericon-aside:before { content: "\f101"; }
|
119 |
-
.genericon-attachment:before { content: "\f416"; }
|
120 |
-
.genericon-audio:before { content: "\f109"; }
|
121 |
-
.genericon-bold:before { content: "\f471"; }
|
122 |
-
.genericon-book:before { content: "\f444"; }
|
123 |
-
.genericon-bug:before { content: "\f50a"; }
|
124 |
-
.genericon-cart:before { content: "\f447"; }
|
125 |
-
.genericon-category:before { content: "\f301"; }
|
126 |
-
.genericon-chat:before { content: "\f108"; }
|
127 |
-
.genericon-checkmark:before { content: "\f418"; }
|
128 |
-
.genericon-close:before { content: "\f405"; }
|
129 |
-
.genericon-close-alt:before { content: "\f406"; }
|
130 |
-
.genericon-cloud:before { content: "\f426"; }
|
131 |
-
.genericon-cloud-download:before { content: "\f440"; }
|
132 |
-
.genericon-cloud-upload:before { content: "\f441"; }
|
133 |
-
.genericon-code:before { content: "\f462"; }
|
134 |
-
.genericon-codepen:before { content: "\f216"; }
|
135 |
-
.genericon-cog:before { content: "\f445"; }
|
136 |
-
.genericon-collapse:before { content: "\f432"; }
|
137 |
-
.genericon-comment:before { content: "\f300"; }
|
138 |
-
.genericon-day:before { content: "\f305"; }
|
139 |
-
.genericon-digg:before { content: "\f221"; }
|
140 |
-
.genericon-document:before { content: "\f443"; }
|
141 |
-
.genericon-dot:before { content: "\f428"; }
|
142 |
-
.genericon-downarrow:before { content: "\f502"; }
|
143 |
-
.genericon-download:before { content: "\f50b"; }
|
144 |
-
.genericon-draggable:before { content: "\f436"; }
|
145 |
-
.genericon-dribbble:before { content: "\f201"; }
|
146 |
-
.genericon-dropbox:before { content: "\f225"; }
|
147 |
-
.genericon-dropdown:before { content: "\f433"; }
|
148 |
-
.genericon-dropdown-left:before { content: "\f434"; }
|
149 |
-
.genericon-edit:before { content: "\f411"; }
|
150 |
-
.genericon-ellipsis:before { content: "\f476"; }
|
151 |
-
.genericon-expand:before { content: "\f431"; }
|
152 |
-
.genericon-external:before { content: "\f442"; }
|
153 |
-
.genericon-facebook:before { content: "\f203"; }
|
154 |
-
.genericon-facebook-alt:before { content: "\f204"; }
|
155 |
-
.genericon-fastforward:before { content: "\f458"; }
|
156 |
-
.genericon-feed:before { content: "\f413"; }
|
157 |
-
.genericon-flag:before { content: "\f468"; }
|
158 |
-
.genericon-flickr:before { content: "\f211"; }
|
159 |
-
.genericon-foursquare:before { content: "\f226"; }
|
160 |
-
.genericon-fullscreen:before { content: "\f474"; }
|
161 |
-
.genericon-gallery:before { content: "\f103"; }
|
162 |
-
.genericon-github:before { content: "\f200"; }
|
163 |
-
.genericon-googleplus:before { content: "\f206"; }
|
164 |
-
.genericon-googleplus-alt:before { content: "\f218"; }
|
165 |
-
.genericon-handset:before { content: "\f50c"; }
|
166 |
-
.genericon-heart:before { content: "\f461"; }
|
167 |
-
.genericon-help:before { content: "\f457"; }
|
168 |
-
.genericon-hide:before { content: "\f404"; }
|
169 |
-
.genericon-hierarchy:before { content: "\f505"; }
|
170 |
-
.genericon-home:before { content: "\f409"; }
|
171 |
-
.genericon-image:before { content: "\f102"; }
|
172 |
-
.genericon-info:before { content: "\f455"; }
|
173 |
-
.genericon-instagram:before { content: "\f215"; }
|
174 |
-
.genericon-italic:before { content: "\f472"; }
|
175 |
-
.genericon-key:before { content: "\f427"; }
|
176 |
-
.genericon-leftarrow:before { content: "\f503"; }
|
177 |
-
.genericon-link:before { content: "\f107"; }
|
178 |
-
.genericon-linkedin:before { content: "\f207"; }
|
179 |
-
.genericon-linkedin-alt:before { content: "\f208"; }
|
180 |
-
.genericon-location:before { content: "\f417"; }
|
181 |
-
.genericon-lock:before { content: "\f470"; }
|
182 |
-
.genericon-mail:before { content: "\f410"; }
|
183 |
-
.genericon-maximize:before { content: "\f422"; }
|
184 |
-
.genericon-menu:before { content: "\f419"; }
|
185 |
-
.genericon-microphone:before { content: "\f50d"; }
|
186 |
-
.genericon-minimize:before { content: "\f421"; }
|
187 |
-
.genericon-minus:before { content: "\f50e"; }
|
188 |
-
.genericon-month:before { content: "\f307"; }
|
189 |
-
.genericon-move:before { content: "\f50f"; }
|
190 |
-
.genericon-next:before { content: "\f429"; }
|
191 |
-
.genericon-notice:before { content: "\f456"; }
|
192 |
-
.genericon-paintbrush:before { content: "\f506"; }
|
193 |
-
.genericon-path:before { content: "\f219"; }
|
194 |
-
.genericon-pause:before { content: "\f448"; }
|
195 |
-
.genericon-phone:before { content: "\f437"; }
|
196 |
-
.genericon-picture:before { content: "\f473"; }
|
197 |
-
.genericon-pinned:before { content: "\f308"; }
|
198 |
-
.genericon-pinterest:before { content: "\f209"; }
|
199 |
-
.genericon-pinterest-alt:before { content: "\f210"; }
|
200 |
-
.genericon-play:before { content: "\f452"; }
|
201 |
-
.genericon-plugin:before { content: "\f439"; }
|
202 |
-
.genericon-plus:before { content: "\f510"; }
|
203 |
-
.genericon-pocket:before { content: "\f224"; }
|
204 |
-
.genericon-polldaddy:before { content: "\f217"; }
|
205 |
-
.genericon-portfolio:before { content: "\f460"; }
|
206 |
-
.genericon-previous:before { content: "\f430"; }
|
207 |
-
.genericon-print:before { content: "\f469"; }
|
208 |
-
.genericon-quote:before { content: "\f106"; }
|
209 |
-
.genericon-rating-empty:before { content: "\f511"; }
|
210 |
-
.genericon-rating-full:before { content: "\f512"; }
|
211 |
-
.genericon-rating-half:before { content: "\f513"; }
|
212 |
-
.genericon-reddit:before { content: "\f222"; }
|
213 |
-
.genericon-refresh:before { content: "\f420"; }
|
214 |
-
.genericon-reply:before { content: "\f412"; }
|
215 |
-
.genericon-reply-alt:before { content: "\f466"; }
|
216 |
-
.genericon-reply-single:before { content: "\f467"; }
|
217 |
-
.genericon-rewind:before { content: "\f459"; }
|
218 |
-
.genericon-rightarrow:before { content: "\f501"; }
|
219 |
-
.genericon-search:before { content: "\f400"; }
|
220 |
-
.genericon-send-to-phone:before { content: "\f438"; }
|
221 |
-
.genericon-send-to-tablet:before { content: "\f454"; }
|
222 |
-
.genericon-share:before { content: "\f415"; }
|
223 |
-
.genericon-show:before { content: "\f403"; }
|
224 |
-
.genericon-shuffle:before { content: "\f514"; }
|
225 |
-
.genericon-sitemap:before { content: "\f507"; }
|
226 |
-
.genericon-skip-ahead:before { content: "\f451"; }
|
227 |
-
.genericon-skip-back:before { content: "\f450"; }
|
228 |
-
.genericon-skype:before { content: "\f220"; }
|
229 |
-
.genericon-spam:before { content: "\f424"; }
|
230 |
-
.genericon-spotify:before { content: "\f515"; }
|
231 |
-
.genericon-standard:before { content: "\f100"; }
|
232 |
-
.genericon-star:before { content: "\f408"; }
|
233 |
-
.genericon-status:before { content: "\f105"; }
|
234 |
-
.genericon-stop:before { content: "\f449"; }
|
235 |
-
.genericon-stumbleupon:before { content: "\f223"; }
|
236 |
-
.genericon-subscribe:before { content: "\f463"; }
|
237 |
-
.genericon-subscribed:before { content: "\f465"; }
|
238 |
-
.genericon-summary:before { content: "\f425"; }
|
239 |
-
.genericon-tablet:before { content: "\f453"; }
|
240 |
-
.genericon-tag:before { content: "\f302"; }
|
241 |
-
.genericon-time:before { content: "\f303"; }
|
242 |
-
.genericon-top:before { content: "\f435"; }
|
243 |
-
.genericon-trash:before { content: "\f407"; }
|
244 |
-
.genericon-tumblr:before { content: "\f214"; }
|
245 |
-
.genericon-twitch:before { content: "\f516"; }
|
246 |
-
.genericon-twitter:before { content: "\f202"; }
|
247 |
-
.genericon-unapprove:before { content: "\f446"; }
|
248 |
-
.genericon-unsubscribe:before { content: "\f464"; }
|
249 |
-
.genericon-unzoom:before { content: "\f401"; }
|
250 |
-
.genericon-uparrow:before { content: "\f500"; }
|
251 |
-
.genericon-user:before { content: "\f304"; }
|
252 |
-
.genericon-video:before { content: "\f104"; }
|
253 |
-
.genericon-videocamera:before { content: "\f517"; }
|
254 |
-
.genericon-vimeo:before { content: "\f212"; }
|
255 |
-
.genericon-warning:before { content: "\f414"; }
|
256 |
-
.genericon-website:before { content: "\f475"; }
|
257 |
-
.genericon-week:before { content: "\f306"; }
|
258 |
-
.genericon-wordpress:before { content: "\f205"; }
|
259 |
-
.genericon-xpost:before { content: "\f504"; }
|
260 |
-
.genericon-youtube:before { content: "\f213"; }
|
261 |
-
.genericon-zoom:before { content: "\f402"; }
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/header.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php $current = $_GET['page']; ?>
|
2 |
-
<div class="jp-content">
|
3 |
-
<div class="jp-frame">
|
4 |
-
<div class="header">
|
5 |
-
<nav role="navigation" class="header-nav drawer-nav nav-horizontal">
|
6 |
-
|
7 |
-
<ul class="main-nav">
|
8 |
-
<li class="jetpack-logo"><a href="<?php echo Jetpack::admin_url(); ?>" title="<?php esc_attr_e( 'Jetpack', 'jetpack' ); ?>" <?php if ( 'jetpack' == $current ) { echo 'class="current"'; } ?>><span><?php esc_html_e( 'Jetpack', 'jetpack' ); ?></span></a></li>
|
9 |
-
<?php if ( ( Jetpack::is_active() || Jetpack::is_development_mode() ) && current_user_can( 'jetpack_manage_modules' ) ) : ?>
|
10 |
-
<li class="jetpack-modules">
|
11 |
-
<a href="<?php echo Jetpack::admin_url( 'page=jetpack_modules' ); ?>" class="jp-button--settings <?php if ( 'jetpack_modules' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'Settings', 'jetpack' ); ?></a>
|
12 |
-
</li>
|
13 |
-
<li class="jetpack-modules">
|
14 |
-
<a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" class="jp-button--settings"><?php esc_html_e( 'Feedback', 'jetpack' ); ?></a>
|
15 |
-
</li>
|
16 |
-
<?php endif; // End if connected or dev mode and is admin ?>
|
17 |
-
|
18 |
-
<?php if ( Jetpack::is_active() && ! Jetpack::is_development_mode() ) : ?>
|
19 |
-
<li class="jetpack-modules">
|
20 |
-
<a href="<?php echo Jetpack::admin_url( 'page=my_jetpack' ); ?>" class="jp-button--settings <?php if ( 'my_jetpack' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'My Jetpack', 'jetpack' ); ?></a>
|
21 |
-
</li>
|
22 |
-
<?php endif; ?>
|
23 |
-
</ul>
|
24 |
-
|
25 |
-
</nav>
|
26 |
-
</div><!-- .header -->
|
27 |
-
<div class="wrapper">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/images/a8c.png
ADDED
Binary file
|
_inc/images/alertbox-closeicon-2x.png
ADDED
Binary file
|
_inc/images/alertbox-closeicon.png
ADDED
Binary file
|
_inc/images/alertbox-clouds-2x.png
ADDED
Binary file
|
_inc/images/alertbox-clouds.png
ADDED
Binary file
|
_inc/images/align-center-2x.png
ADDED
Binary file
|
_inc/images/align-left-2x.png
ADDED
Binary file
|
_inc/images/align-none-2x.png
ADDED
Binary file
|
_inc/images/align-right-2x.png
ADDED
Binary file
|
_inc/images/archive-2x.png
ADDED
Binary file
|
_inc/images/arrow-2x.png
ADDED
Binary file
|
_inc/images/arrow-pointer-blue-2x.png
ADDED
Binary file
|
_inc/images/arrow.png
ADDED
Binary file
|
_inc/images/arrows-2x.png
ADDED
Binary file
|
_inc/images/arrows-dark-2x.png
ADDED
Binary file
|
_inc/images/arrows-dark-vs-2x.png
ADDED
Binary file
|
_inc/images/arrows-vs-2x.png
ADDED
Binary file
|
_inc/images/atdbuttontr-2x.png
ADDED
Binary file
|
_inc/images/audio-2x.png
ADDED
Binary file
|
_inc/images/automattic-2x.png
ADDED
Binary file
|
_inc/images/automattic.png
ADDED
Binary file
|
_inc/images/bubble_bg-2x.png
ADDED
Binary file
|
_inc/images/buttons-2x.gif
ADDED
Binary file
|
_inc/images/code-2x.png
ADDED
Binary file
|
_inc/images/comment-grey-bubble-2x.png
ADDED
Binary file
|
_inc/images/date-button-2x.gif
ADDED
Binary file
|
_inc/images/default-2x.png
ADDED
Binary file
|
_inc/images/delete-2x.png
ADDED
Binary file
|
_inc/images/document-2x.png
ADDED
Binary file
|
_inc/images/down_arrow-2x.gif
ADDED
Binary file
|
_inc/images/footer-clouds-2x.png
ADDED
Binary file
|
_inc/images/footer-clouds.png
ADDED
Binary file
|
_inc/images/generic-2x.png
ADDED
Binary file
|
_inc/images/header-clouds-2x.png
ADDED
Binary file
|
_inc/images/header-clouds-small-2x.png
ADDED
Binary file
|
_inc/images/header-clouds-small.png
ADDED
Binary file
|
_inc/images/header-clouds.png
ADDED
Binary file
|
_inc/images/icon-comingsoon-2x.png
ADDED
Binary file
|
_inc/images/icon-comingsoon.png
ADDED
Binary file
|
_inc/images/icon-pointer-flag-2x.png
ADDED
Binary file
|
_inc/images/image-2x.png
ADDED
Binary file
|
_inc/images/imgedit-icons-2x.png
ADDED
Binary file
|
_inc/images/interactive-2x.png
ADDED
Binary file
|
_inc/images/jetpack-closebox-icon.png
ADDED
Binary file
|
_inc/images/list-2x.png
ADDED
Binary file
|
_inc/images/logo-2x.png
ADDED
Binary file
|
_inc/images/logo-small-2x.png
ADDED
Binary file
|
_inc/images/logo-small.png
ADDED
Binary file
|
_inc/images/logo.png
ADDED
Binary file
|
_inc/images/marker-2x.png
ADDED
Binary file
|
_inc/images/mask-2x.png
ADDED
Binary file
|
_inc/images/media-button-2x.png
ADDED
Binary file
|
_inc/images/menuicon-sprite-2x.png
ADDED
Binary file
|
_inc/images/menuicon-sprite.png
ADDED
Binary file
|
_inc/images/module-clouds-2x.png
ADDED
Binary file
|
_inc/images/module-clouds.png
ADDED
Binary file
|
_inc/images/module-icons-sprite-2x.png
ADDED
Binary file
|
_inc/images/module-icons-sprite.png
ADDED
Binary file
|
_inc/images/press-this-2x.png
ADDED
Binary file
|
_inc/images/publicize.png
ADDED
Binary file
|
_inc/images/resize-2x.gif
ADDED
Binary file
|
_inc/images/rss/blue-large.png
ADDED
Binary file
|
_inc/images/rss/blue-medium.png
ADDED
Binary file
|
_inc/images/rss/blue-small.png
ADDED
Binary file
|
_inc/images/rss/green-large.png
ADDED
Binary file
|
_inc/images/rss/green-medium.png
ADDED
Binary file
|
_inc/images/rss/green-small.png
ADDED
Binary file
|
_inc/images/rss/orange-large.png
ADDED
Binary file
|
_inc/images/rss/orange-medium.png
ADDED
Binary file
|
_inc/images/rss/orange-small.png
ADDED
Binary file
|
_inc/images/rss/pink-large.png
ADDED
Binary file
|
_inc/images/rss/pink-medium.png
ADDED
Binary file
|
_inc/images/rss/pink-small.png
ADDED
Binary file
|
_inc/images/rss/purple-large.png
ADDED
Binary file
|
_inc/images/rss/purple-medium.png
ADDED
Binary file
|
_inc/images/rss/purple-small.png
ADDED
Binary file
|
_inc/images/rss/red-large.png
ADDED
Binary file
|
_inc/images/rss/red-medium.png
ADDED
Binary file
|
_inc/images/rss/red-small.png
ADDED
Binary file
|
_inc/images/rss/silver-large.png
ADDED
Binary file
|
_inc/images/rss/silver-medium.png
ADDED
Binary file
|
_inc/images/rss/silver-small.png
ADDED
Binary file
|
_inc/images/screen-icon.png
ADDED
Binary file
|
_inc/images/screenshots/beautifulmath.png
ADDED
Binary file
|
_inc/images/screenshots/carousel.png
ADDED
Binary file
|
_inc/images/screenshots/comments.png
ADDED
Binary file
|
_inc/images/screenshots/contactform.png
ADDED
Binary file
|
_inc/images/screenshots/custom-css.png
ADDED
Binary file
|
_inc/images/screenshots/hovercards.png
ADDED
Binary file
|
_inc/images/screenshots/mobile-push-notifications.jpg
ADDED
Binary file
|
_inc/images/screenshots/mobile-theme.png
ADDED
Binary file
|
_inc/images/screenshots/notes.png
ADDED
Binary file
|
_inc/images/screenshots/post-by-email.png
ADDED
Binary file
|
_inc/images/screenshots/publicize.png
ADDED
Binary file
|
_inc/images/screenshots/sharing.png
ADDED
Binary file
|
_inc/images/screenshots/shortcodes.png
ADDED
Binary file
|
_inc/images/screenshots/shortlinks.png
ADDED
Binary file
|
_inc/images/screenshots/spelling.png
ADDED
Binary file
|
_inc/images/screenshots/stats.png
ADDED
Binary file
|
_inc/images/screenshots/subscriptions.png
ADDED
Binary file
|
_inc/images/screenshots/tiled-gallery.png
ADDED
Binary file
|
_inc/images/screenshots/vaultpress.png
ADDED
Binary file
|
_inc/images/screenshots/widgets.png
ADDED
Binary file
|
_inc/images/sort-2x.gif
ADDED
Binary file
|
_inc/images/spreadsheet-2x.png
ADDED
Binary file
|
_inc/images/stars-2x.png
ADDED
Binary file
|
{images → _inc/images}/stats-smiley.gif
RENAMED
File without changes
|
_inc/images/status-light-2x.png
ADDED
Binary file
|
_inc/images/status-light.png
ADDED
Binary file
|
_inc/images/tb-close-2x.png
ADDED
Binary file
|
_inc/images/text-2x.png
ADDED
Binary file
|
_inc/images/video-2x.png
ADDED
Binary file
|
_inc/images/wheel-2x.png
ADDED
Binary file
|
_inc/images/wpicons-2x.png
ADDED
Binary file
|
_inc/images/wpspin_light-2x.gif
ADDED
Binary file
|
_inc/images/xit-2x.gif
ADDED
Binary file
|
_inc/jetpack-admin.js
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
(function($) {
|
2 |
-
|
3 |
-
///////////////////////////////////////
|
4 |
-
// INIT
|
5 |
-
///////////////////////////////////////
|
6 |
-
|
7 |
-
$(document).ready(function () {
|
8 |
-
initEvents();
|
9 |
-
configFixedElements();
|
10 |
-
});
|
11 |
-
|
12 |
-
///////////////////////////////////////
|
13 |
-
// FUNCTIONS
|
14 |
-
///////////////////////////////////////
|
15 |
-
|
16 |
-
function configFixedElements() {
|
17 |
-
var jpTopFrame = $('.frame.top'),
|
18 |
-
jpBottomFrame = $('.frame.bottom'),
|
19 |
-
$body = $('body');
|
20 |
-
|
21 |
-
$body.scroll(function(){
|
22 |
-
if ( 33 > jpTopFrame.offset().top ) {
|
23 |
-
jpTopFrame.addClass('fixed');
|
24 |
-
$body.addClass('jp-frame-top-fixed');
|
25 |
-
}
|
26 |
-
if ( 120 <= jpBottomFrame.offset().top ) {
|
27 |
-
jpTopFrame.removeClass('fixed');
|
28 |
-
$body.removeClass('jp-frame-top-fixed');
|
29 |
-
}
|
30 |
-
});
|
31 |
-
}
|
32 |
-
|
33 |
-
function initEvents() {
|
34 |
-
// toggle search and filters at mobile resolution
|
35 |
-
$('.filter-search').on('click', function () {
|
36 |
-
$(this).toggleClass('active');
|
37 |
-
$('.manage-right').toggleClass('show');
|
38 |
-
$('.shade').toggle();
|
39 |
-
});
|
40 |
-
|
41 |
-
// Toggle all checkboxes
|
42 |
-
$('.checkall').on('click', function () {
|
43 |
-
$('.table-bordered').find(':checkbox').prop('checked', this.checked);
|
44 |
-
});
|
45 |
-
|
46 |
-
// Clicking outside modal, or close X closes modal
|
47 |
-
$('.shade, .modal .close').on('click', function ( event ) {
|
48 |
-
$('.shade, .modal').hide();
|
49 |
-
$('.manage-right').removeClass('show');
|
50 |
-
event.preventDefault();
|
51 |
-
});
|
52 |
-
}
|
53 |
-
|
54 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jetpack-jitm.js
DELETED
@@ -1,135 +0,0 @@
|
|
1 |
-
/* global jitmL10n, jQuery */
|
2 |
-
|
3 |
-
(function($, jitmL10n) {
|
4 |
-
|
5 |
-
///////////////////////////////////////
|
6 |
-
// INIT
|
7 |
-
///////////////////////////////////////
|
8 |
-
|
9 |
-
var data;
|
10 |
-
|
11 |
-
$(document).ready(function () {
|
12 |
-
|
13 |
-
data = {
|
14 |
-
'action' : 'jitm_ajax',
|
15 |
-
'jitmNonce' : jitmL10n.jitm_nonce,
|
16 |
-
'photon' : jitmL10n.photon_msgs,
|
17 |
-
'manage' : jitmL10n.manage_msgs,
|
18 |
-
'stats' : jitmL10n.stats_msgs,
|
19 |
-
'jitm_stats_url' : jitmL10n.jitm_stats_url,
|
20 |
-
'enabledModules' : []
|
21 |
-
};
|
22 |
-
|
23 |
-
initEvents();
|
24 |
-
|
25 |
-
});
|
26 |
-
|
27 |
-
///////////////////////////////////////
|
28 |
-
// FUNCTIONS
|
29 |
-
///////////////////////////////////////
|
30 |
-
|
31 |
-
function initEvents() {
|
32 |
-
|
33 |
-
var module_slug, success_msg, fail_msg, hide_msg,
|
34 |
-
$body = $( 'body' );
|
35 |
-
|
36 |
-
// On dismiss of JITM admin notice
|
37 |
-
$body.on( 'click', '.jp-jitm .dismiss', function() {
|
38 |
-
var $self = $( this );
|
39 |
-
|
40 |
-
// hide the notice
|
41 |
-
$self.closest( '.jp-jitm' ).hide();
|
42 |
-
|
43 |
-
// ajax request to save dismiss and never show again
|
44 |
-
data.jitmActionToTake = 'dismiss';
|
45 |
-
module_slug = $self.data( 'module' );
|
46 |
-
data.jitmModule = module_slug;
|
47 |
-
|
48 |
-
$.post( jitmL10n.ajaxurl, data, function ( response ) {
|
49 |
-
if ( true === response.success ) {
|
50 |
-
//console.log('successfully dismissed for ever')
|
51 |
-
}
|
52 |
-
});
|
53 |
-
});
|
54 |
-
|
55 |
-
$body.on( 'click', '.jp-jitm .activate', function() {
|
56 |
-
|
57 |
-
var $self = $( this ),
|
58 |
-
$jitm = $self.closest( '.jp-jitm' );
|
59 |
-
$jitm.find( '.button' ).addClass( 'hide' );
|
60 |
-
$jitm.find( '.j-spinner' ).toggleClass( 'hide' );
|
61 |
-
data.jitmActionToTake = 'activate';
|
62 |
-
|
63 |
-
// get the module we're working with using the data-module attribute
|
64 |
-
module_slug = $self.data( 'module' );
|
65 |
-
// Check if there's a custom success message, otherwise use default.
|
66 |
-
success_msg = $self.data( 'module-success' ) ? $self.data( 'module-success' ) : data[module_slug].success;
|
67 |
-
fail_msg = data[module_slug].fail;
|
68 |
-
|
69 |
-
data.jitmModule = module_slug;
|
70 |
-
|
71 |
-
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
72 |
-
$.post( jitmL10n.ajaxurl, data, function ( response ) {
|
73 |
-
// If there's no response, something bad happened
|
74 |
-
if ( true === response.success ) {
|
75 |
-
var $msg = $jitm.find( '.msg' );
|
76 |
-
$msg.html( success_msg );
|
77 |
-
$jitm.find( '.j-spinner' ).add( '#jetpack-wordpressdotcom' ).toggleClass( 'hide' );
|
78 |
-
if ( 'manage' !== data.jitmModule ) {
|
79 |
-
hide_msg = setTimeout( function () {
|
80 |
-
$jitm.hide( 'slow' );
|
81 |
-
}, 5000 );
|
82 |
-
}
|
83 |
-
$jitm.find( '.show-after-enable.hide' ).removeClass( 'hide' );
|
84 |
-
data.enabledModules.push( module_slug );
|
85 |
-
} else {
|
86 |
-
$jitm.html( '<p><span class="icon"></span>' + fail_msg + '</p>' );
|
87 |
-
}
|
88 |
-
});
|
89 |
-
|
90 |
-
});
|
91 |
-
|
92 |
-
$body.on( 'click', '.jp-jitm .launch', function() {
|
93 |
-
var $jitm = $(this).closest( '.jp-jitm' );
|
94 |
-
|
95 |
-
if ( $jitm.data( 'stats_url' ) ) {
|
96 |
-
data.jitm_stats_url = $jitm.data( 'stats_url' );
|
97 |
-
new Image().src = data.jitm_stats_url;
|
98 |
-
}
|
99 |
-
|
100 |
-
data.jitmModule = $jitm.data( 'track' ) ? $jitm.data( 'track' ) : $(this).data( 'module' );
|
101 |
-
data.jitmActionToTake = 'launch';
|
102 |
-
// ajax request to save click in stat
|
103 |
-
$.post( jitmL10n.ajaxurl, data );
|
104 |
-
} );
|
105 |
-
|
106 |
-
$body.on( 'click', '#jetpack-wordpressdotcom', function() {
|
107 |
-
//Log user heads to wordpress.com/plugins
|
108 |
-
new Image().src = data.jitm_stats_url;
|
109 |
-
});
|
110 |
-
|
111 |
-
// Display Photon JITM after user started uploading an image.
|
112 |
-
if ( $( '#tmpl-jitm-photon' ).length > 0 ) {
|
113 |
-
wp.Uploader.queue.on( 'add', function ( e ) {
|
114 |
-
if ( -1 === $.inArray( 'photon', data.enabledModules ) ) {
|
115 |
-
if ( 'image' === e.attributes.type ) {
|
116 |
-
var jitmTemplate = wp.template( 'jitm-photon' ),
|
117 |
-
$menu = wp.media.frame.$el.find( '.media-menu' ),
|
118 |
-
$jitm;
|
119 |
-
if ( $menu.length > 0 && 0 === $menu.find( '.jp-jitm' ).length ) {
|
120 |
-
$jitm = $menu.append( jitmTemplate() ).find( '.jp-jitm' );
|
121 |
-
|
122 |
-
// JITM is visible to user, track it.
|
123 |
-
data.jitmActionToTake = 'viewed';
|
124 |
-
data.jitmModule = $jitm.data( 'track' );
|
125 |
-
$.post( jitmL10n.ajaxurl, data );
|
126 |
-
}
|
127 |
-
} else {
|
128 |
-
$( '.media-menu' ).find( '.jp-jitm' ).remove();
|
129 |
-
}
|
130 |
-
}
|
131 |
-
} );
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
})(jQuery, jitmL10n);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jetpack-modules.js
DELETED
@@ -1,150 +0,0 @@
|
|
1 |
-
|
2 |
-
( function( window, $, items, models, views, i18n, modalinfo, nonces ) {
|
3 |
-
'use strict';
|
4 |
-
|
5 |
-
var modules, list_table, handle_module_tag_click, $the_table, $the_filters, $the_search, $jp_frame, $bulk_button, show_modal, hide_modal, set_modal_tab, originPoint;
|
6 |
-
|
7 |
-
$the_table = $( '.wp-list-table.jetpack-modules' );
|
8 |
-
$the_filters = $( '.navbar-form' );
|
9 |
-
$the_search = $( '#srch-term-search-input' );
|
10 |
-
$jp_frame = $( '.jp-frame' );
|
11 |
-
$bulk_button = $( '#doaction' );
|
12 |
-
|
13 |
-
modules = new models.Modules( {
|
14 |
-
items : items
|
15 |
-
} );
|
16 |
-
|
17 |
-
list_table = new views.List_Table( {
|
18 |
-
el : '#the-list',
|
19 |
-
model : modules
|
20 |
-
} );
|
21 |
-
|
22 |
-
// Kick off an initial redraw.
|
23 |
-
modules.trigger( 'change' );
|
24 |
-
|
25 |
-
// Handle the filtering of modules.
|
26 |
-
handle_module_tag_click = function( event ) {
|
27 |
-
// Switch the item in the subsubsub list that's flagged as current.
|
28 |
-
$( '.subsubsub' ).find( 'a[data-title="' + $(this).data('title') + '"]' ).addClass( 'current' )
|
29 |
-
.closest( 'li' ).siblings().find( 'a.current' ).removeClass( 'current' );
|
30 |
-
|
31 |
-
event.preventDefault();
|
32 |
-
modules.trigger( 'change' );
|
33 |
-
};
|
34 |
-
|
35 |
-
$( '.subsubsub a' ).on( 'click', { modules : modules }, handle_module_tag_click );
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Attach event listener for ESC key to close modal
|
39 |
-
*/
|
40 |
-
|
41 |
-
$( window ).on( 'keydown', function( e ) {
|
42 |
-
// If pressing ESC close the modal
|
43 |
-
if ( 27 === e.keyCode ) {
|
44 |
-
hide_modal();
|
45 |
-
}
|
46 |
-
});
|
47 |
-
|
48 |
-
/**
|
49 |
-
* The modal details.
|
50 |
-
*/
|
51 |
-
|
52 |
-
show_modal = function( module ) {
|
53 |
-
$jp_frame.children( '.modal, .shade' ).show();
|
54 |
-
$( '.modal ').empty().html( wp.template( 'modal' )( items[ module ] ) );
|
55 |
-
$( '.modal' )[0].setAttribute( 'tabindex', '0' );
|
56 |
-
$( '.modal' ).focus();
|
57 |
-
$( 'body' ).css( 'overflow', 'hidden' );
|
58 |
-
};
|
59 |
-
|
60 |
-
/**
|
61 |
-
* If modalinfo is defined, auto popup the modal
|
62 |
-
*/
|
63 |
-
$( document ).ready(function() {
|
64 |
-
if ( modalinfo ) {
|
65 |
-
show_modal( modalinfo );
|
66 |
-
}
|
67 |
-
});
|
68 |
-
|
69 |
-
hide_modal = function() {
|
70 |
-
$jp_frame.children( '.modal, .shade' ).hide();
|
71 |
-
$jp_frame.children( '.modal' ).data( 'current-module', '' );
|
72 |
-
set_modal_tab( null );
|
73 |
-
originPoint.focus();
|
74 |
-
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
75 |
-
$( 'body' ).css( 'overflow', 'auto' );
|
76 |
-
event.preventDefault();
|
77 |
-
};
|
78 |
-
|
79 |
-
set_modal_tab = function( tab ) {
|
80 |
-
$jp_frame.find( '.modal .active' ).removeClass( 'active' );
|
81 |
-
switch ( tab ) {
|
82 |
-
case 'learn-more':
|
83 |
-
$jp_frame.find( '.modal .learn-more a' ).addClass( 'active' );
|
84 |
-
$jp_frame.children( '.modal' ).trigger( 'learn-more' );
|
85 |
-
break;
|
86 |
-
case 'config':
|
87 |
-
$jp_frame.find( '.modal .config a' ).addClass( 'active' );
|
88 |
-
$jp_frame.children( '.modal' ).trigger( 'config' );
|
89 |
-
break;
|
90 |
-
default:
|
91 |
-
break;
|
92 |
-
}
|
93 |
-
};
|
94 |
-
|
95 |
-
$jp_frame.on( 'click', '.modal .close, .shade', hide_modal );
|
96 |
-
|
97 |
-
$jp_frame.children( '.modal' ).on( 'learn-more', function() {
|
98 |
-
var current_module = $jp_frame.children( '.modal' ).data( 'current-module' );
|
99 |
-
$(this).find('.content').html( items[ current_module ].long_description );
|
100 |
-
} );
|
101 |
-
|
102 |
-
$jp_frame.children( '.modal' ).on( 'config', function() {
|
103 |
-
var current_module = $jp_frame.children( '.modal' ).data( 'current-module' );
|
104 |
-
// Hack. Until we import the form to the modal, just redirect to where it would have gone.
|
105 |
-
hide_modal();
|
106 |
-
window.location.href = items[ current_module ].configure_url;
|
107 |
-
// $(this).find('.content').html( items[ current_module ].configure_form );
|
108 |
-
} );
|
109 |
-
|
110 |
-
$the_table.on( 'click', '.info a', { modules : modules }, function( event ) {
|
111 |
-
event.preventDefault();
|
112 |
-
originPoint = this;
|
113 |
-
show_modal( $(this).closest('.jetpack-module').attr('id'), 'learn-more' );
|
114 |
-
} );
|
115 |
-
|
116 |
-
$the_filters.on( 'click', '.button-group .button', { modules : modules }, function( event ) {
|
117 |
-
event.preventDefault();
|
118 |
-
$(this).addClass('active').siblings('.active').removeClass('active');
|
119 |
-
modules.trigger( 'change' );
|
120 |
-
} );
|
121 |
-
|
122 |
-
$the_search.on( 'keyup search', function( e ) {
|
123 |
-
// Don't trigger change on tab, since it's only used for accessibility
|
124 |
-
// anyway, and will remove all checked boxes
|
125 |
-
if ( e.keyCode !== 9 ) {
|
126 |
-
modules.trigger( 'change' );
|
127 |
-
}
|
128 |
-
} );
|
129 |
-
|
130 |
-
$the_search.prop( 'placeholder', i18n.search_placeholder );
|
131 |
-
|
132 |
-
$bulk_button.on( 'click', function( event ) {
|
133 |
-
var selectedModules = $('.jetpack-modules-list-table-form').serialize(),
|
134 |
-
selectedAction = $(this).siblings('select').val(),
|
135 |
-
url;
|
136 |
-
|
137 |
-
if ( selectedModules.length && '-1' !== selectedAction ) {
|
138 |
-
url = 'admin.php?page=jetpack&action=' + encodeURIComponent( selectedAction );
|
139 |
-
url += '&' + selectedModules;
|
140 |
-
url += '&_wpnonce=' + encodeURIComponent( nonces.bulk );
|
141 |
-
|
142 |
-
window.location.href = url;
|
143 |
-
} else {
|
144 |
-
// Possibly add in an alert here explaining why nothing's happening?
|
145 |
-
}
|
146 |
-
|
147 |
-
event.preventDefault();
|
148 |
-
} );
|
149 |
-
|
150 |
-
} ) ( this, jQuery, window.jetpackModulesData.modules, this.jetpackModules.models, this.jetpackModules.views, window.jetpackModulesData.i18n, window.jetpackModulesData.modalinfo, window.jetpackModulesData.nonces );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jetpack-modules.models.js
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
|
2 |
-
this.jetpackModules = this.jetpackModules || {};
|
3 |
-
|
4 |
-
window.jetpackModules.models = (function( window, $, _, Backbone ) {
|
5 |
-
'use strict';
|
6 |
-
|
7 |
-
var models = {};
|
8 |
-
|
9 |
-
models.Modules = Backbone.Model.extend({
|
10 |
-
visibles : {},
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Updates modules.items dataset to be a reflection of both the current
|
14 |
-
* modules.raw data, as well as any filters or sorting that may be in effect.
|
15 |
-
*/
|
16 |
-
filter_and_sort : function() {
|
17 |
-
var subsubsub = $('.subsubsub .current'),
|
18 |
-
items = this.get( 'raw' ),
|
19 |
-
m_filter = $('.button-group.filter-active .active'),
|
20 |
-
m_sort = $('.button-group.sort .active'),
|
21 |
-
m_search = $('#srch-term-search-input').val().toLowerCase(),
|
22 |
-
groups;
|
23 |
-
|
24 |
-
// If a module filter has been selected, filter it!
|
25 |
-
if ( ! subsubsub.closest('li').hasClass( 'all' ) ) {
|
26 |
-
items = _.filter( items, function( item ) {
|
27 |
-
return _.contains( item.module_tags, subsubsub.data( 'title' ) );
|
28 |
-
} );
|
29 |
-
}
|
30 |
-
|
31 |
-
if ( m_filter.data('filter-by') ) {
|
32 |
-
items = _.filter( items, function( item ) {
|
33 |
-
return item[ m_filter.data('filter-by') ] === m_filter.data('filter-value');
|
34 |
-
} );
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( m_search.length ) {
|
38 |
-
items = _.filter( items, function( item ) {
|
39 |
-
var search_text = item.name + ' ' + item.description + ' ' + item.long_description + ' ' + item.search_terms + ' ' + item.jumpstart_desc + ' ' + item.module_tags;
|
40 |
-
return ( -1 !== search_text.toLowerCase().indexOf( m_search ) );
|
41 |
-
} );
|
42 |
-
}
|
43 |
-
|
44 |
-
if ( m_sort.data('sort-by') ) {
|
45 |
-
items = _.sortBy( items, m_sort.data('sort-by') );
|
46 |
-
if ( 'reverse' === m_sort.data('sort-order') ) {
|
47 |
-
items.reverse();
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
// Sort unavailable modules to the end if the user is running in local mode.
|
52 |
-
groups = _.groupBy( items, 'available' );
|
53 |
-
if ( _.has( groups, 'false' ) ) {
|
54 |
-
items = [].concat( groups[true], groups[false] );
|
55 |
-
}
|
56 |
-
|
57 |
-
// Now shove it back in.
|
58 |
-
this.set( 'items', items );
|
59 |
-
|
60 |
-
return this;
|
61 |
-
},
|
62 |
-
|
63 |
-
initialize : function() {
|
64 |
-
var items = this.get( 'items' );
|
65 |
-
this.set( 'raw', items );
|
66 |
-
}
|
67 |
-
|
68 |
-
});
|
69 |
-
|
70 |
-
return models;
|
71 |
-
|
72 |
-
})( this, jQuery, _, Backbone );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jetpack-modules.views.js
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
|
2 |
-
this.jetpackModules = this.jetpackModules || {};
|
3 |
-
|
4 |
-
window.jetpackModules.views = (function( window, $, _, Backbone, wp ) {
|
5 |
-
'use strict';
|
6 |
-
|
7 |
-
var views = {};
|
8 |
-
|
9 |
-
views.List_Table = Backbone.View.extend({
|
10 |
-
|
11 |
-
template : wp.template( 'Jetpack_Modules_List_Table_Template' ),
|
12 |
-
|
13 |
-
/**
|
14 |
-
* If we can, use replaceState to change the URL and indicate the new filtering.
|
15 |
-
* This will be handy with redirecting back to the same state after activating/deactivating.
|
16 |
-
*/
|
17 |
-
updateUrl : function() {
|
18 |
-
if ( ! window.history.replaceState ) {
|
19 |
-
return;
|
20 |
-
}
|
21 |
-
|
22 |
-
var url = window.location.href.split('?')[0] + '?page=jetpack_modules',
|
23 |
-
m_tag = $('.subsubsub .current'),
|
24 |
-
m_filter = $('.button-group.filter-active .active'),
|
25 |
-
m_sort = $('.button-group.sort .active'),
|
26 |
-
m_search = $('#srch-term-search-input').val();
|
27 |
-
|
28 |
-
if ( m_search.length ) {
|
29 |
-
url += '&s=' + encodeURIComponent( m_search );
|
30 |
-
}
|
31 |
-
|
32 |
-
if ( ! m_tag.hasClass('all') ) {
|
33 |
-
url += '&module_tag=' + encodeURIComponent( m_tag.data('title') );
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( m_filter.data('filter-by') ) {
|
37 |
-
url += '&' + encodeURIComponent( m_filter.data('filter-by') ) + '=' + encodeURIComponent( m_filter.data('filter-value') );
|
38 |
-
}
|
39 |
-
|
40 |
-
if ( 'name' !== m_sort.data('sort-by') ) {
|
41 |
-
url += '&sort_by=' + encodeURIComponent( m_sort.data('sort-by') );
|
42 |
-
}
|
43 |
-
|
44 |
-
window.history.replaceState( {}, '', url );
|
45 |
-
},
|
46 |
-
|
47 |
-
render : function() {
|
48 |
-
this.model.filter_and_sort();
|
49 |
-
this.$el.html( this.template( this.model.attributes ) );
|
50 |
-
this.updateUrl();
|
51 |
-
return this;
|
52 |
-
},
|
53 |
-
|
54 |
-
initialize : function() {
|
55 |
-
this.listenTo( this.model, 'change', this.render );
|
56 |
-
}
|
57 |
-
|
58 |
-
});
|
59 |
-
|
60 |
-
return views;
|
61 |
-
|
62 |
-
})( this, jQuery, _, Backbone, wp );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jetpack-retina.css
ADDED
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Retina core icons */
|
2 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
3 |
+
/* TinyMCE buttons */
|
4 |
+
.wp_themeSkin .mceToolbar span.mce_undo,
|
5 |
+
.wp_themeSkin .mceToolbar span.mce_redo,
|
6 |
+
.wp_themeSkin .mceToolbar span.mce_bullist,
|
7 |
+
.wp_themeSkin .mceToolbar span.mce_numlist,
|
8 |
+
.wp_themeSkin .mceToolbar span.mce_blockquote,
|
9 |
+
.wp_themeSkin .mceToolbar span.mce_charmap,
|
10 |
+
.wp_themeSkin .mceToolbar span.mce_bold,
|
11 |
+
.wp_themeSkin .mceToolbar span.mce_italic,
|
12 |
+
.wp_themeSkin .mceToolbar span.mce_underline,
|
13 |
+
.wp_themeSkin .mceToolbar span.mce_justifyleft,
|
14 |
+
.wp_themeSkin .mceToolbar span.mce_justifyright,
|
15 |
+
.wp_themeSkin .mceToolbar span.mce_justifycenter,
|
16 |
+
.wp_themeSkin .mceToolbar span.mce_justifyfull,
|
17 |
+
.wp_themeSkin .mceToolbar span.mce_indent,
|
18 |
+
.wp_themeSkin .mceToolbar span.mce_outdent,
|
19 |
+
.wp_themeSkin .mceToolbar span.mce_link,
|
20 |
+
.wp_themeSkin .mceToolbar span.mce_unlink,
|
21 |
+
.wp_themeSkin .mceToolbar span.mce_help,
|
22 |
+
.wp_themeSkin .mceToolbar span.mce_removeformat,
|
23 |
+
.wp_themeSkin .mceToolbar span.mce_fullscreen,
|
24 |
+
.wp_themeSkin .mceToolbar span.mce_wp_fullscreen,
|
25 |
+
.wp_themeSkin .mceToolbar span.mce_media,
|
26 |
+
.wp_themeSkin .mceToolbar span.mce_pastetext,
|
27 |
+
.wp_themeSkin .mceToolbar span.mce_pasteword,
|
28 |
+
.wp_themeSkin .mceToolbar span.mce_wp_help,
|
29 |
+
.wp_themeSkin .mceToolbar span.mce_wp_adv,
|
30 |
+
.wp_themeSkin .mceToolbar span.mce_wp_more,
|
31 |
+
.wp_themeSkin .mceToolbar span.mce_strikethrough,
|
32 |
+
.wp_themeSkin .mceToolbar span.mce_spellchecker,
|
33 |
+
.wp_themeSkin .mceToolbar span.mce_forecolor,
|
34 |
+
.wp_themeSkin .mceToolbar .mce_forecolorpicker,
|
35 |
+
.wp_themeSkin .mceToolbar .mceSplitButton .mce_spellchecker span.mce_spellchecker,
|
36 |
+
.wp_themeSkin .mceToolbar .mceSplitButton .mce_forecolor span.mce_forecolor,
|
37 |
+
.wp_themeSkin .mceToolbar .mceSplitButton span.mce_numlist,
|
38 |
+
.wp_themeSkin .mceToolbar .mceSplitButton span.mce_bullist {
|
39 |
+
background-image: url('images/wpicons-2x.png');
|
40 |
+
background-size: 560px 40px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.view-switch #view-switch-list,
|
44 |
+
.view-switch .current #view-switch-list,
|
45 |
+
.view-switch #view-switch-excerpt,
|
46 |
+
.view-switch .current #view-switch-excerpt {
|
47 |
+
background-image: url('images/list-2x.png');
|
48 |
+
background-size: 80px 20px;
|
49 |
+
}
|
50 |
+
|
51 |
+
.imgedit-crop,
|
52 |
+
.imgedit-rleft,
|
53 |
+
.imgedit-rright,
|
54 |
+
.imgedit-flipv,
|
55 |
+
.imgedit-fliph,
|
56 |
+
.imgedit-undo,
|
57 |
+
.imgedit-redo {
|
58 |
+
background-image: url('images/imgedit-icons-2x.png');
|
59 |
+
background-size: 260px 64px;
|
60 |
+
}
|
61 |
+
|
62 |
+
/* Welcome screen close button */
|
63 |
+
.welcome-panel .welcome-panel-close:before {
|
64 |
+
background-image: url('images/xit-2x.gif');
|
65 |
+
background-size: 20px 10px;
|
66 |
+
}
|
67 |
+
|
68 |
+
/* Dismiss tag buttons */
|
69 |
+
.tagchecklist span a, #bulk-titles div a {
|
70 |
+
background-image: url('images/xit-2x.gif') !important;
|
71 |
+
background-size: 20px 10px !important;
|
72 |
+
}
|
73 |
+
.tagchecklist span a:hover, #bulk-titles div a:hover {
|
74 |
+
background-image: url('images/xit-2x.gif') !important;
|
75 |
+
background-size: 20px 10px !important;
|
76 |
+
}
|
77 |
+
|
78 |
+
/* Pointer dismiss button */
|
79 |
+
.wp-pointer-buttons a.close::before {
|
80 |
+
background-image: url('images/xit-2x.gif');
|
81 |
+
background-size: 20px 10px;
|
82 |
+
}
|
83 |
+
|
84 |
+
/* Pointer icon */
|
85 |
+
.wp-pointer-content h3::before {
|
86 |
+
background-image: url('images/icon-pointer-flag-2x.png');
|
87 |
+
background-size: 36px 37px;
|
88 |
+
}
|
89 |
+
|
90 |
+
/* Pointer arrow */
|
91 |
+
.wp-pointer-arrow {
|
92 |
+
background-image: url('images/arrow-pointer-blue-2x.png') !important;
|
93 |
+
background-size: 30px 60px !important;
|
94 |
+
}
|
95 |
+
|
96 |
+
/* Screen options links */
|
97 |
+
#screen-meta-links a.show-settings {
|
98 |
+
background-image: url('images/arrows-2x.png') !important;
|
99 |
+
background-size: 15px 123px !important;
|
100 |
+
}
|
101 |
+
body.admin-color-classic #screen-meta-links a.show-settings {
|
102 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
103 |
+
}
|
104 |
+
|
105 |
+
/* Collapse button divs */
|
106 |
+
#collapse-button div {
|
107 |
+
background-image: url('images/arrows-2x.png') !important;
|
108 |
+
background-size: 15px 123px !important;
|
109 |
+
}
|
110 |
+
body.admin-color-classic #collapse-button div {
|
111 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
112 |
+
}
|
113 |
+
|
114 |
+
/* Metabox handle arrows */
|
115 |
+
.meta-box-sortables .postbox:hover .handlediv {
|
116 |
+
background-image: url('images/arrows-2x.png') !important;
|
117 |
+
background-size: 15px 123px !important;
|
118 |
+
}
|
119 |
+
body.admin-color-classic .meta-box-sortables .postbox:hover .handlediv {
|
120 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
121 |
+
}
|
122 |
+
|
123 |
+
/* Date button */
|
124 |
+
.curtime #timestamp {
|
125 |
+
background-image: url('images/date-button-2x.gif') !important;
|
126 |
+
background-size: 16px 16px;
|
127 |
+
display: inline-block;
|
128 |
+
height: 16px;
|
129 |
+
}
|
130 |
+
|
131 |
+
/* Comments column bubble */
|
132 |
+
.column-comments .vers img {
|
133 |
+
padding-top: 12px;
|
134 |
+
height: 0;
|
135 |
+
width: 12px;
|
136 |
+
background: transparent url('images/comment-grey-bubble-2x.png') no-repeat center center;
|
137 |
+
background-size: 12px 12px;
|
138 |
+
}
|
139 |
+
.post-com-count {
|
140 |
+
background-image: url('images/bubble_bg-2x.png') !important;
|
141 |
+
background-size: 18px 100px;
|
142 |
+
}
|
143 |
+
|
144 |
+
/* Post sorting indicator */
|
145 |
+
.sorting-indicator {
|
146 |
+
background-image: url('images/sort-2x.gif');
|
147 |
+
background-size: 14px 4px;
|
148 |
+
}
|
149 |
+
|
150 |
+
/* Widget arrows */
|
151 |
+
.sidebar-name-arrow {
|
152 |
+
background-image: url('images/arrows-2x.png') !important;
|
153 |
+
background-size: 15px 123px !important;
|
154 |
+
}
|
155 |
+
body.admin-color-classic .sidebar-name-arrow {
|
156 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
157 |
+
}
|
158 |
+
.sidebar-name:hover .sidebar-name-arrow {
|
159 |
+
background-image: url('images/arrows-dark-2x.png') !important;
|
160 |
+
}
|
161 |
+
body.admin-color-classic .sidebar-name:hover .sidebar-name-arrow {
|
162 |
+
background-image: url('images/arrows-dark-vs-2x.png') !important;
|
163 |
+
}
|
164 |
+
.widget-top a.widget-action {
|
165 |
+
background-image: url('images/arrows-2x.png') !important;
|
166 |
+
background-size: 15px 123px !important;
|
167 |
+
}
|
168 |
+
body.admin-color-classic .widget-top a.widget-action {
|
169 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
170 |
+
}
|
171 |
+
.widget-top a.widget-action:hover {
|
172 |
+
background-image: url('images/arrows-dark-2x.png') !important;
|
173 |
+
}
|
174 |
+
body.admin-color-classic .widget-top a.widget-action:hover {
|
175 |
+
background-image: url('images/arrows-dark-vs-2x.png') !important;
|
176 |
+
}
|
177 |
+
|
178 |
+
/* Menu editor item arrows */
|
179 |
+
.item-edit {
|
180 |
+
background-image: url('images/arrows-2x.png') !important;
|
181 |
+
background-size: 15px 123px !important;
|
182 |
+
}
|
183 |
+
body.admin-color-classic .item-edit {
|
184 |
+
background-image: url('images/arrows-vs-2x.png') !important;
|
185 |
+
}
|
186 |
+
.item-edit:hover {
|
187 |
+
background-image: url('images/arrows-dark-2x.png') !important;
|
188 |
+
background-size: 15px 123px !important;
|
189 |
+
}
|
190 |
+
body.admin-color-classic .item-edit:hover {
|
191 |
+
background-image: url('images/arrows-dark-vs-2x.png') !important;
|
192 |
+
}
|
193 |
+
|
194 |
+
/* Plugin install star ratings */
|
195 |
+
div.star-holder {
|
196 |
+
background-image: url('images/stars-2x.png');
|
197 |
+
background-size: 21px 37px;
|
198 |
+
}
|
199 |
+
div.star-holder .star-rating {
|
200 |
+
background-image: url('images/stars-2x.png');
|
201 |
+
background-size: 21px 37px;
|
202 |
+
}
|
203 |
+
|
204 |
+
/* Press This bookmarklet icon */
|
205 |
+
.pressthis a span {
|
206 |
+
background-image: url('images/press-this-2x.png');
|
207 |
+
background-size: 24px 20px;
|
208 |
+
}
|
209 |
+
|
210 |
+
/* Media button */
|
211 |
+
#wp-content-media-buttons a.add_media img, #dashboard_quick_press a.add_media img {
|
212 |
+
padding-top: 15px;
|
213 |
+
width: 15px;
|
214 |
+
height: 0;
|
215 |
+
background: url('images/media-button-2x.png') no-repeat center center;
|
216 |
+
background-size: 15px 15px;
|
217 |
+
}
|
218 |
+
|
219 |
+
/* After the Deadline MCE icon */
|
220 |
+
a#content_AtD img {
|
221 |
+
padding-top: 20px;
|
222 |
+
width: 20px;
|
223 |
+
height: 0;
|
224 |
+
background: url('images/atdbuttontr-2x.png') no-repeat center center;
|
225 |
+
background-size: 20px 20px;
|
226 |
+
}
|
227 |
+
|
228 |
+
/* Resize editor */
|
229 |
+
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
230 |
+
background-image: url('images/resize-2x.gif') !important;
|
231 |
+
background-size: 11px 11px !important;
|
232 |
+
}
|
233 |
+
|
234 |
+
/* MCE dropdowns */
|
235 |
+
.wp_themeSkin .mceListBox .mceOpen span, .wp_themeSkin .mceSplitButton a.mceOpen {
|
236 |
+
background-image: url("images/down_arrow-2x.gif") !important;
|
237 |
+
background-size: 10px 20px;
|
238 |
+
}
|
239 |
+
|
240 |
+
/* Img overlay buttons */
|
241 |
+
#wp_editimgbtn, #wp_delimgbtn, #wp_editgallery, #wp_delgallery {
|
242 |
+
padding-top: 24px !important;
|
243 |
+
height: 0;
|
244 |
+
width: 24px;
|
245 |
+
background: url("images/delete-2x.png") no-repeat center center !important;
|
246 |
+
background-size: 24px 24px;
|
247 |
+
}
|
248 |
+
|
249 |
+
#wp_editimgbtn, #wp_delimgbtn, #wp_editgallery, #wp_delgallery {
|
250 |
+
padding-top: 24px !important;
|
251 |
+
height: 0;
|
252 |
+
width: 24px;
|
253 |
+
background-size: 24px 24px;
|
254 |
+
}
|
255 |
+
|
256 |
+
#wp_editimgbtn, #wp_editgallery {
|
257 |
+
background: #eee url("images/image-2x.png") no-repeat center center !important;
|
258 |
+
}
|
259 |
+
|
260 |
+
#wp_delimgbtn, #wp_delgallery {
|
261 |
+
background: #eee url("images/delete-2x.png") no-repeat center center !important;
|
262 |
+
}
|
263 |
+
|
264 |
+
/* AJAX loading spinners */
|
265 |
+
img.ajax-loading, img.ajax-feedback {
|
266 |
+
width: 16px;
|
267 |
+
height: 0;
|
268 |
+
padding-top: 19px !important;
|
269 |
+
background: url("images/wpspin_light-2x.gif") no-repeat center center !important;
|
270 |
+
background-size: 16px 16px;
|
271 |
+
}
|
272 |
+
|
273 |
+
/* Align buttons (in image properties in the media library) */
|
274 |
+
.image-align-none-label {
|
275 |
+
background: url('images/align-none-2x.png') no-repeat center left;
|
276 |
+
background-size: 21px 15px;
|
277 |
+
}
|
278 |
+
|
279 |
+
.image-align-left-label {
|
280 |
+
background: url('images/align-left-2x.png') no-repeat center left;
|
281 |
+
background-size: 22px 15px;
|
282 |
+
}
|
283 |
+
|
284 |
+
.image-align-center-label {
|
285 |
+
background: url('images/align-center-2x.png') no-repeat center left;
|
286 |
+
background-size: 21px 15px;
|
287 |
+
}
|
288 |
+
|
289 |
+
.image-align-right-label {
|
290 |
+
background: url('images/align-right-2x.png') no-repeat center left;
|
291 |
+
background-size: 22px 15px;
|
292 |
+
}
|
293 |
+
|
294 |
+
.button,
|
295 |
+
.submit input,
|
296 |
+
.button-secondary {
|
297 |
+
background-color: #f5f5f5;
|
298 |
+
background-image: -webkit-gradient(linear, left bottom, left top, from(#fff), to(#f2f2f2));
|
299 |
+
background-image: -webkit-linear-gradient(top, #fff, #f2f2f2);
|
300 |
+
background-image: -moz-linear-gradient(top, #fff, #f2f2f2);
|
301 |
+
background-image: -o-linear-gradient(top, #fff, #f2f2f2);
|
302 |
+
background-image: linear-gradient(to bottom, #fff, #f2f2f2);
|
303 |
+
}
|
304 |
+
|
305 |
+
.button:active,
|
306 |
+
.submit input:active,
|
307 |
+
.button-secondary:active {
|
308 |
+
background-image: -webkit-gradient(linear, left bottom, left top, from(#f2f2f2), to(#fff));
|
309 |
+
background-image: -webkit-linear-gradient(top, #f2f2f2, #fff);
|
310 |
+
background-image: -moz-linear-gradient(top, #f2f2f2, #fff);
|
311 |
+
background-image: -o-linear-gradient(top, #f2f2f2, #fff);
|
312 |
+
background-image: linear-gradient(to bottom, #f2f2f2, #fff);
|
313 |
+
}
|
314 |
+
|
315 |
+
input.button-primary,
|
316 |
+
button.button-primary,
|
317 |
+
a.button-primary {
|
318 |
+
background-color: #21759B;
|
319 |
+
background-image: -webkit-gradient(linear, left bottom, left top, from(#298bb9), to(#217196));
|
320 |
+
background-image: -webkit-linear-gradient(top, #298bb9, #217196);
|
321 |
+
background-image: -moz-linear-gradient(top, #298bb9, #217196);
|
322 |
+
background-image: -o-linear-gradient(top, #298bb9, #217196);
|
323 |
+
background-image: linear-gradient(to bottom, #298bb9, #217196);
|
324 |
+
}
|
325 |
+
|
326 |
+
input.button-primary:active,
|
327 |
+
button.button-primary:active,
|
328 |
+
a.button-primary:active {
|
329 |
+
background-image: -webkit-gradient(linear, left bottom, left top, from(#217196), to(#298bb9));
|
330 |
+
background-image: -webkit-linear-gradient(top, #217196, #298bb9);
|
331 |
+
background-image: -moz-linear-gradient(top, #217196, #298bb9);
|
332 |
+
background-image: -o-linear-gradient(top, #217196, #298bb9);
|
333 |
+
background-image: linear-gradient(to bottom, #217196, #298bb9);
|
334 |
+
}
|
335 |
+
|
336 |
+
.admin-color-classic #quicktags,
|
337 |
+
.admin-color-classic .wp-editor-wrap .wp_themeSkin tr.mceFirst td.mceToolbar {
|
338 |
+
background-color: #cfdfe9;
|
339 |
+
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#d3e2eb));
|
340 |
+
background-image: -webkit-linear-gradient(top, #eff8ff, #d3e2eb);
|
341 |
+
background-image: -moz-linear-gradient(top, #eff8ff, #d3e2eb);
|
342 |
+
background-image: -o-linear-gradient(top, #eff8ff, #d3e2eb);
|
343 |
+
background-image: linear-gradient(to bottom, #eff8ff, #d3e2eb);
|
344 |
+
}
|
345 |
+
|
346 |
+
/* Uploader close button */
|
347 |
+
#TB_closeWindowButton img {
|
348 |
+
background: url('images/tb-close-2x.png') no-repeat center center;
|
349 |
+
padding-top: 15px;
|
350 |
+
width: 15px;
|
351 |
+
height: 0;
|
352 |
+
background-size: 15px 15px;
|
353 |
+
}
|
354 |
+
|
355 |
+
td.media-icon img[src$='wp-includes/images/crystal/archive.png'],
|
356 |
+
td.A1B1 img[src$='wp-includes/images/crystal/archive.png'] {
|
357 |
+
background: url('images/archive-2x.png') no-repeat center center;
|
358 |
+
padding-top: 60px;
|
359 |
+
width: 46px;
|
360 |
+
height: 0;
|
361 |
+
background-size: 46px 60px;
|
362 |
+
}
|
363 |
+
|
364 |
+
td.media-icon img[src$='wp-includes/images/crystal/audio.png'],
|
365 |
+
td.A1B1 img[src$='wp-includes/images/crystal/audio.png'] {
|
366 |
+
background: url('images/audio-2x.png') no-repeat center center;
|
367 |
+
padding-top: 60px;
|
368 |
+
width: 46px;
|
369 |
+
height: 0;
|
370 |
+
background-size: 46px 60px;
|
371 |
+
}
|
372 |
+
|
373 |
+
td.media-icon img[src$='wp-includes/images/crystal/code.png'],
|
374 |
+
td.A1B1 img[src$='wp-includes/images/crystal/code.png'] {
|
375 |
+
background: url('images/code-2x.png') no-repeat center center;
|
376 |
+
padding-top: 60px;
|
377 |
+
width: 46px;
|
378 |
+
height: 0;
|
379 |
+
background-size: 46px 60px;
|
380 |
+
}
|
381 |
+
|
382 |
+
td.media-icon img[src$='wp-includes/images/crystal/default.png'],
|
383 |
+
td.A1B1 img[src$='wp-includes/images/crystal/default.png'] {
|
384 |
+
background: url('images/default-2x.png') no-repeat center center;
|
385 |
+
padding-top: 60px;
|
386 |
+
width: 46px;
|
387 |
+
height: 0;
|
388 |
+
background-size: 46px 60px;
|
389 |
+
}
|
390 |
+
|
391 |
+
td.media-icon img[src$='wp-includes/images/crystal/document.png'],
|
392 |
+
td.A1B1 img[src$='wp-includes/images/crystal/document.png'] {
|
393 |
+
background: url('images/document-2x.png') no-repeat center center;
|
394 |
+
padding-top: 60px;
|
395 |
+
width: 46px;
|
396 |
+
height: 0;
|
397 |
+
background-size: 46px 60px;
|
398 |
+
}
|
399 |
+
|
400 |
+
td.media-icon img[src$='wp-includes/images/crystal/interactive.png'],
|
401 |
+
td.A1B1 img[src$='wp-includes/images/crystal/interactive.png'] {
|
402 |
+
background: url('images/interactive-2x.png') no-repeat center center;
|
403 |
+
padding-top: 60px;
|
404 |
+
width: 46px;
|
405 |
+
height: 0;
|
406 |
+
background-size: 46px 60px;
|
407 |
+
}
|
408 |
+
|
409 |
+
td.media-icon img[src$='wp-includes/images/crystal/spreadsheet.png'],
|
410 |
+
td.A1B1 img[src$='wp-includes/images/crystal/spreadsheet.png'] {
|
411 |
+
background: url('images/spreadsheet-2x.png') no-repeat center center;
|
412 |
+
padding-top: 60px;
|
413 |
+
width: 46px;
|
414 |
+
height: 0;
|
415 |
+
background-size: 46px 60px;
|
416 |
+
}
|
417 |
+
|
418 |
+
td.media-icon img[src$='wp-includes/images/crystal/text.png'],
|
419 |
+
td.A1B1 img[src$='wp-includes/images/crystal/text.png'] {
|
420 |
+
background: url('images/text-2x.png') no-repeat center center;
|
421 |
+
padding-top: 60px;
|
422 |
+
width: 46px;
|
423 |
+
height: 0;
|
424 |
+
background-size: 46px 60px;
|
425 |
+
}
|
426 |
+
|
427 |
+
td.media-icon img[src$='wp-includes/images/crystal/video.png'],
|
428 |
+
td.A1B1 img[src$='wp-includes/images/crystal/video.png'] {
|
429 |
+
background: url('images/video-2x.png') no-repeat center center;
|
430 |
+
padding-top: 60px;
|
431 |
+
width: 46px;
|
432 |
+
height: 0;
|
433 |
+
background-size: 46px 60px;
|
434 |
+
}
|
435 |
+
|
436 |
+
.farbtastic .marker {
|
437 |
+
background-image: url('images/marker-2x.png');
|
438 |
+
background-size: 17px 17px;
|
439 |
+
}
|
440 |
+
|
441 |
+
.farbtastic .wheel {
|
442 |
+
background-image: url('images/wheel-2x.png');
|
443 |
+
background-size: 195px 195px;
|
444 |
+
}
|
445 |
+
|
446 |
+
.farbtastic .overlay {
|
447 |
+
background-image: url('images/mask-2x.png');
|
448 |
+
background-size: 101px 101px;
|
449 |
+
}
|
450 |
+
|
451 |
+
/* Generic admin menu icon */
|
452 |
+
#adminmenu img[src$='wp-admin/images/generic.png'] {
|
453 |
+
background: url('images/generic-2x.png') no-repeat center center;
|
454 |
+
padding-top: 25px;
|
455 |
+
width: 16px;
|
456 |
+
height: 0;
|
457 |
+
background-size: 16px 16px;
|
458 |
+
}
|
459 |
+
|
460 |
+
/* Editor dialogs close button */
|
461 |
+
.clearlooks2 .mceClose,
|
462 |
+
.clearlooks2 .mceMin,
|
463 |
+
.clearlooks2 .mceMed,
|
464 |
+
.clearlooks2 .mceMax,
|
465 |
+
.wp-dialog .ui-dialog-titlebar-close {
|
466 |
+
background-image: url('images/buttons-2x.gif') !important;
|
467 |
+
background-size: 116px 48px !important;
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
_inc/jetpack-rtl.css
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#jp-header #jp-clouds {
|
2 |
+
background-position: -632px 100%;
|
3 |
+
}
|
4 |
+
#jp-header.small #jp-clouds {
|
5 |
+
background-position: -425px 100%;
|
6 |
+
}
|
7 |
+
|
8 |
+
#jp-header #jp-clouds #jp-disconnect {
|
9 |
+
float: left;
|
10 |
+
margin: -35px 0 0 25px;
|
11 |
+
text-align: left;
|
12 |
+
}
|
13 |
+
|
14 |
+
#jp-header #jp-clouds #jp-disconnect a {
|
15 |
+
background-position: 100% 90%;
|
16 |
+
padding: 4px 30px 3px 10px;
|
17 |
+
}
|
18 |
+
#jp-header #jp-clouds #jp-disconnect a:hover {
|
19 |
+
background-position: 100% 3%;
|
20 |
+
}
|
21 |
+
|
22 |
+
#jp-header h3 {
|
23 |
+
background-position: top right;
|
24 |
+
right: 25px;
|
25 |
+
left: auto;
|
26 |
+
}
|
27 |
+
|
28 |
+
#jp-header p {
|
29 |
+
right: 390px;
|
30 |
+
left: auto;
|
31 |
+
text-align: right;
|
32 |
+
}
|
33 |
+
|
34 |
+
#jp-info {
|
35 |
+
margin: 0 28px 0 12px;
|
36 |
+
}
|
37 |
+
|
38 |
+
#jp-info p {
|
39 |
+
float:right;
|
40 |
+
}
|
41 |
+
|
42 |
+
#jp-info a.jp-button {
|
43 |
+
float: left;
|
44 |
+
margin: 8px 20px 0 0;
|
45 |
+
}
|
46 |
+
|
47 |
+
.jp-connect { padding: 10px 0 5px !important; }
|
48 |
+
|
49 |
+
#jetpack-settings > .jetpack-message { margin: 10px 15px 10px 13px }
|
50 |
+
|
51 |
+
.jetpack-message .squeezer {
|
52 |
+
text-align: right;
|
53 |
+
}
|
54 |
+
.jetpack-message h4 {
|
55 |
+
margin: 0 0 10px 10px;
|
56 |
+
}
|
57 |
+
|
58 |
+
.more-info {
|
59 |
+
margin: 0 15px 5px 12px;
|
60 |
+
background: transparent url( images/header-clouds-sm.png ) bottom right repeat-x;
|
61 |
+
}
|
62 |
+
.more-info .jp-close {
|
63 |
+
left: 0;
|
64 |
+
right: auto;
|
65 |
+
padding: 0 6px 0 4px;
|
66 |
+
-moz-border-radius: 3px;
|
67 |
+
-webkit-border-radius: 3px;
|
68 |
+
border-radius: 3px;
|
69 |
+
-moz-border-radius-topright: 0;
|
70 |
+
-moz-border-radius-bottomright: 0;
|
71 |
+
-webkit-border-top-left-radius: 0;
|
72 |
+
-webkit-border-bottom-left-radius: 0;
|
73 |
+
border-top-left-radius: 0;
|
74 |
+
border-bottom-left-radius: 0;
|
75 |
+
}
|
76 |
+
|
77 |
+
.more-info div.jp-info-img {
|
78 |
+
float: left;
|
79 |
+
margin: 0 20px 0 30px;
|
80 |
+
}
|
81 |
+
|
82 |
+
.jetpack-module {
|
83 |
+
float: right;
|
84 |
+
margin: 0 15px 15px 0;
|
85 |
+
padding: 15px 15px 35px 0;
|
86 |
+
}
|
87 |
+
.jetpack-module div.module-image {
|
88 |
+
float: left;
|
89 |
+
margin: 0 10px 5px 0;
|
90 |
+
-webkit-border-radius: 0;
|
91 |
+
-moz-border-radius: 0;
|
92 |
+
border-radius: 0;
|
93 |
+
-webkit-border-top-right-radius: 5px;
|
94 |
+
-moz-border-radius-topleft: 5px;
|
95 |
+
border-top-right-radius: 5px;
|
96 |
+
-webkit-border-bottom-right-radius: 5px;
|
97 |
+
-moz-border-radius-bottomleft: 5px;
|
98 |
+
border-bottom-right-radius: 5px;
|
99 |
+
}
|
100 |
+
|
101 |
+
.jetpack-module div.module-image p {
|
102 |
+
-webkit-border-radius: 0;
|
103 |
+
-moz-border-radius: 0;
|
104 |
+
border-radius: 0;
|
105 |
+
-webkit-border-bottom-right-radius: 5px;
|
106 |
+
-moz-border-radius-bottomleft: 5px;
|
107 |
+
border-bottom-right-radius: 5px;
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
.jetpack-module .jetpack-module-actions {
|
112 |
+
right: 15px;
|
113 |
+
left: auto;
|
114 |
+
}
|
115 |
+
|
116 |
+
.placeholder h3 {
|
117 |
+
margin-left: 15px;
|
118 |
+
margin-right: auto;
|
119 |
+
}
|
120 |
+
|
121 |
+
#jp-footer .automattic {
|
122 |
+
padding-right: 3px;
|
123 |
+
padding-left: 0;
|
124 |
+
}
|
125 |
+
|
126 |
+
#jp-footer .automattic span {
|
127 |
+
margin: 0 1px 0 5px;
|
128 |
+
}
|
_inc/jetpack.css
ADDED
@@ -0,0 +1,1066 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#jp-header {
|
2 |
+
min-width: 741px;
|
3 |
+
z-index: 0;
|
4 |
+
margin: 30px 0 -30px 0;
|
5 |
+
}
|
6 |
+
#jp-header.small {
|
7 |
+
margin-bottom: 50px;
|
8 |
+
}
|
9 |
+
|
10 |
+
#jp-header #jp-clouds {
|
11 |
+
position: relative;
|
12 |
+
background: transparent url( images/header-clouds.png ) -315px 100% repeat-x;
|
13 |
+
padding-top: 110px;
|
14 |
+
-webkit-border-radius: 3px;
|
15 |
+
-moz-border-radius: 3px;
|
16 |
+
border-radius: 3px;
|
17 |
+
}
|
18 |
+
#jp-header.small #jp-clouds {
|
19 |
+
background: transparent url( images/header-clouds-small.png ) -120px 100% repeat-x;
|
20 |
+
padding: 50px 0 0 0;
|
21 |
+
height: 70px;
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
#jp-header #jp-clouds #jp-disconnectors {
|
26 |
+
font-size: 12px;
|
27 |
+
color: #fff;
|
28 |
+
float: right;
|
29 |
+
margin-top: -35px;
|
30 |
+
text-align: left;
|
31 |
+
position: relative;
|
32 |
+
left: -45px;
|
33 |
+
}
|
34 |
+
|
35 |
+
#jp-header #jp-clouds .jp-disconnect a {
|
36 |
+
background: #8caa46 url( images/status-light.png ) 3px 85% no-repeat;
|
37 |
+
display: inline-block;
|
38 |
+
position: relative;
|
39 |
+
width: 100%;
|
40 |
+
height: 1.7em;
|
41 |
+
overflow: hidden;
|
42 |
+
padding: 4px 0 3px 30px;
|
43 |
+
margin: 0 -20px 3px 0;
|
44 |
+
color: #fff;
|
45 |
+
text-decoration: none;
|
46 |
+
border: 1px solid #7a943d;
|
47 |
+
-moz-border-radius: 5px;
|
48 |
+
-webkit-border-radius: 5px;
|
49 |
+
border-radius: 5px;
|
50 |
+
-moz-box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 );
|
51 |
+
-webkit-box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 );
|
52 |
+
box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 );
|
53 |
+
text-shadow: 0px -1px 0px rgba( 0,0,0,0.3 );
|
54 |
+
}
|
55 |
+
#jp-header #jp-clouds .jp-disconnect a:hover {
|
56 |
+
background: #8caa46 url( images/status-light.png ) 3px -2% no-repeat;
|
57 |
+
background-color: #839f40;
|
58 |
+
border-color: #6a8037;
|
59 |
+
}
|
60 |
+
|
61 |
+
#jp-header #jp-clouds .jp-disconnect div {
|
62 |
+
position: relative;
|
63 |
+
line-height: 1.7em;
|
64 |
+
height: 1.7em;
|
65 |
+
}
|
66 |
+
|
67 |
+
#jp-header #jp-clouds .jp-disconnect a:hover div,
|
68 |
+
#jp-header #jp-clouds .jp-disconnect a.clicked div {
|
69 |
+
top: -1.7em;
|
70 |
+
}
|
71 |
+
|
72 |
+
/* Retina Header Clouds & Status Light */
|
73 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
74 |
+
#jp-header #jp-clouds {
|
75 |
+
background: transparent url( images/header-clouds-2x.png ) -315px 100% repeat-x;
|
76 |
+
background-size:1600px 400px;
|
77 |
+
}
|
78 |
+
#jp-header.small #jp-clouds {
|
79 |
+
background: transparent url( images/header-clouds-small-2x.png ) -120px 100% repeat-x;
|
80 |
+
background-size:980px 140px;
|
81 |
+
}
|
82 |
+
|
83 |
+
#jp-header #jp-clouds .jp-disconnect a {
|
84 |
+
background: #8caa46 url( images/status-light-2x.png ) 3px 85% no-repeat;
|
85 |
+
background-size:25px 57px;
|
86 |
+
}
|
87 |
+
#jp-header #jp-clouds .jp-disconnect a:hover {
|
88 |
+
background: #8caa46 url( images/status-light-2x.png ) 3px -2% no-repeat;
|
89 |
+
background-size:25px 57px;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
#jp-header h3 {
|
95 |
+
position: relative;
|
96 |
+
background: transparent url( images/logo.png ) top left no-repeat;
|
97 |
+
width: 252px;
|
98 |
+
height: 200px;
|
99 |
+
overflow: hidden;
|
100 |
+
text-indent: -999em;
|
101 |
+
top: -95px;
|
102 |
+
left: 25px;
|
103 |
+
margin: 0;
|
104 |
+
padding: 0;
|
105 |
+
}
|
106 |
+
#jp-header.small h3 {
|
107 |
+
background: transparent url( images/logo-small.png ) top left no-repeat;
|
108 |
+
width: 149px;
|
109 |
+
height: 120px;
|
110 |
+
top: -35px;
|
111 |
+
}
|
112 |
+
|
113 |
+
/* Retina Logo */
|
114 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
115 |
+
#jp-header h3 {
|
116 |
+
background: transparent url( images/logo-2x.png ) top left no-repeat;
|
117 |
+
background-size:250px 200px;
|
118 |
+
}
|
119 |
+
#jp-header.small h3 {
|
120 |
+
background: transparent url( images/logo-small-2x.png ) top left no-repeat;
|
121 |
+
background-size:150px 120px;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
#jp-header p {
|
128 |
+
position: absolute;
|
129 |
+
left: 390px;
|
130 |
+
text-align: left;
|
131 |
+
top: 30px;
|
132 |
+
width: 48%;
|
133 |
+
color: #fff;
|
134 |
+
font-size: 25px;
|
135 |
+
line-height: 130%;
|
136 |
+
text-shadow: 0px 1px 1px rgba(0,0,0,0.5);
|
137 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
138 |
+
-webkit-font-smoothing: antialiased;
|
139 |
+
}
|
140 |
+
|
141 |
+
#jp-info {
|
142 |
+
position: relative;
|
143 |
+
overflow: visible;
|
144 |
+
z-index: 50;
|
145 |
+
margin: 0 12px 0 28px;
|
146 |
+
min-width: 780px;
|
147 |
+
}
|
148 |
+
|
149 |
+
#jp-info p {
|
150 |
+
font-size: 17px;
|
151 |
+
line-height: 150%;
|
152 |
+
text-shadow: 0px 1px 0px #fff;
|
153 |
+
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
154 |
+
color: #666;
|
155 |
+
margin: 0 0 40px;
|
156 |
+
float:left;
|
157 |
+
width: 58%;
|
158 |
+
}
|
159 |
+
#jp-info p.small {
|
160 |
+
font-size: 14px;
|
161 |
+
}
|
162 |
+
|
163 |
+
#jp-info a.jp-button {
|
164 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
165 |
+
float: right;
|
166 |
+
margin: 8px 0 0 20px;
|
167 |
+
display: inline-block;
|
168 |
+
background: #69acce;
|
169 |
+
-moz-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
170 |
+
-webkit-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
171 |
+
box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
172 |
+
padding: 12px 20px;
|
173 |
+
border: 1px solid #2a8cba;
|
174 |
+
-moz-border-radius: 5px;
|
175 |
+
-webkit-border-radius: 5px;
|
176 |
+
border-radius: 5px;
|
177 |
+
line-height: 100%;
|
178 |
+
color: #fff;
|
179 |
+
text-align: center;
|
180 |
+
font-size: 20px;
|
181 |
+
font-weight: bold;
|
182 |
+
text-decoration: none;
|
183 |
+
text-shadow: 0px 1px 2px rgba( 0,0,0,0.5);
|
184 |
+
-webkit-transition-duration: .3s;
|
185 |
+
-moz-transition-duration: .3s;
|
186 |
+
cursor: pointer;
|
187 |
+
}
|
188 |
+
#jp-info a.jp-button:hover, #jp-info a.jp-button:active {
|
189 |
+
background-color: #f0a000;
|
190 |
+
border-color: #c87800;
|
191 |
+
-webkit-transition-duration: .3s;
|
192 |
+
outline: none;
|
193 |
+
-moz-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5);
|
194 |
+
-webkit-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5);
|
195 |
+
box-shadow: inset 0 0 2px #fff, 0 1px 7spx rgba(240,160,0,0.5);
|
196 |
+
}
|
197 |
+
|
198 |
+
.jetpack-message {
|
199 |
+
position: relative;
|
200 |
+
z-index: 100;
|
201 |
+
border: 1px solid #2a8cba !important;
|
202 |
+
-moz-border-radius: 3px;
|
203 |
+
-webkit-border-radius: 3px;
|
204 |
+
border-radius: 3px;
|
205 |
+
background: url( images/alertbox-clouds.png ) 100% 100% no-repeat;
|
206 |
+
background-color: #6aafcf !important;
|
207 |
+
-webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
208 |
+
-moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
209 |
+
box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
210 |
+
padding: 18px 90px 8px 15px !important;
|
211 |
+
overflow: hidden;
|
212 |
+
line-height: 180%;
|
213 |
+
}
|
214 |
+
|
215 |
+
/* Retina alertbox clouds */
|
216 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
217 |
+
.jetpack-message {
|
218 |
+
background: url( images/alertbox-clouds-2x.png ) 100% 100% no-repeat;
|
219 |
+
background-size:95px 55px;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
.jp-connect { padding: 10px 0 5px !important; }
|
224 |
+
|
225 |
+
#jetpack-settings > .jetpack-message { margin: 10px 13px 10px 15px }
|
226 |
+
|
227 |
+
.jetpack-message .squeezer {
|
228 |
+
max-width: 940px;
|
229 |
+
margin: 0 0 2px;
|
230 |
+
padding: 0 10px;
|
231 |
+
text-align: left;
|
232 |
+
overflow: hidden;
|
233 |
+
}
|
234 |
+
.jetpack-message h4 {
|
235 |
+
margin: 0 10px 10px 0;
|
236 |
+
font-size: 18px;
|
237 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
238 |
+
font-weight: normal;
|
239 |
+
color: #fff;
|
240 |
+
text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
|
241 |
+
-moz-border-radius: 5px;
|
242 |
+
-webkit-border-radius: 5px;
|
243 |
+
border-radius: 5px;
|
244 |
+
display: inline-block;
|
245 |
+
}
|
246 |
+
|
247 |
+
.jetpack-message h5 {
|
248 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
249 |
+
margin: 0;
|
250 |
+
}
|
251 |
+
|
252 |
+
.jetpack-message .squeezer a, .jetpack-message .squeezer a:visited {
|
253 |
+
color: #fff;
|
254 |
+
text-decoration: underline;
|
255 |
+
}
|
256 |
+
|
257 |
+
.jetpack-message .squeezer a:hover {
|
258 |
+
color: #f0a000;
|
259 |
+
}
|
260 |
+
|
261 |
+
.jetpack-message code, .jetpack-err p {
|
262 |
+
background: rgba( 0,0,0,0.2 );
|
263 |
+
font-size: 14px;
|
264 |
+
padding: 3px 5px !important;
|
265 |
+
text-shadow: 0px 1px 1px rgba(0,0,0,0.4);
|
266 |
+
color: #fff;
|
267 |
+
}
|
268 |
+
|
269 |
+
.jetpack-message p {
|
270 |
+
margin: -1px 0 0 0 !important;
|
271 |
+
padding: 0;
|
272 |
+
display: inline-block;
|
273 |
+
}
|
274 |
+
.jetpack-err p {
|
275 |
+
overflow: hidden;
|
276 |
+
margin-bottom: 10px !important;
|
277 |
+
}
|
278 |
+
|
279 |
+
.jetpack-message p a.button-primary {
|
280 |
+
font-size: 16px !important;
|
281 |
+
display: inline-block;
|
282 |
+
padding: 8px 15px;
|
283 |
+
color: #fff;
|
284 |
+
text-align: center;
|
285 |
+
font-size: 20px;
|
286 |
+
text-decoration: none;
|
287 |
+
-moz-border-radius: 5px;
|
288 |
+
-webkit-border-radius: 5px;
|
289 |
+
border-radius: 5px;
|
290 |
+
border: 1px solid #8caa46;
|
291 |
+
background: #b4d278;
|
292 |
+
-moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
293 |
+
-webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
294 |
+
box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
295 |
+
text-shadow: 0px -1px 0px rgba( 0,0,0,0.3);
|
296 |
+
-webkit-transition-duration: .3s;
|
297 |
+
-moz-transition-duration: .3s;
|
298 |
+
cursor: pointer;
|
299 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
300 |
+
}
|
301 |
+
.jetpack-message p a.button-primary:hover, .jetpack-message p a.button-primary:active {
|
302 |
+
background-color: #f0a000;
|
303 |
+
border-color: #c87800;
|
304 |
+
-webkit-transition-duration: .3s;
|
305 |
+
outline: none;
|
306 |
+
}
|
307 |
+
|
308 |
+
.inline-message p strong { display: block; }
|
309 |
+
|
310 |
+
.more-info {
|
311 |
+
position: relative;
|
312 |
+
top: -5px;
|
313 |
+
margin: 0 15px 5px 15px;
|
314 |
+
height: 230px; /* Have to set height otherwise slideDown() doesn't work. */
|
315 |
+
padding-right: 15px !important;
|
316 |
+
padding-bottom: 15px;
|
317 |
+
clear: both;
|
318 |
+
overflow: visible !important;
|
319 |
+
color: #666 !important;
|
320 |
+
background: transparent url( images/module-clouds.png ) bottom left repeat-x;
|
321 |
+
background-color: #f0f0f0 !important;
|
322 |
+
border-color: #dcdcdc !important;
|
323 |
+
text-shadow: 0px 1px 0px #fff;
|
324 |
+
-webkit-box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
325 |
+
-moz-box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
326 |
+
box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
327 |
+
}
|
328 |
+
|
329 |
+
/* Retina moreinfo bg clouds */
|
330 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
331 |
+
.more-info {
|
332 |
+
background: transparent url( images/module-clouds-2x.png ) bottom left repeat-x;
|
333 |
+
background-size:980px 140px;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
.more-info h4 {
|
339 |
+
padding: 0;
|
340 |
+
background: none;
|
341 |
+
font-weight: normal;
|
342 |
+
color: #000;
|
343 |
+
font-size: 19px;
|
344 |
+
text-shadow: 0px 1px 0px #fff;
|
345 |
+
}
|
346 |
+
|
347 |
+
.more-info h5 {
|
348 |
+
margin-left: 0;
|
349 |
+
font-size: 12px !important;
|
350 |
+
}
|
351 |
+
.more-info .arrow {
|
352 |
+
position: absolute;
|
353 |
+
width: 29px;
|
354 |
+
height: 18px;
|
355 |
+
top: -16px;
|
356 |
+
left: 0;
|
357 |
+
background: url( images/arrow.png ) top left no-repeat;
|
358 |
+
}
|
359 |
+
|
360 |
+
/* Retina module more info arrow */
|
361 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
362 |
+
.more-info .arrow {
|
363 |
+
background: url( images/arrow-2x.png ) top left no-repeat;
|
364 |
+
background-size:29px 16px;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
|
368 |
+
.more-info p {
|
369 |
+
margin: 0 0 10px 0 !important;
|
370 |
+
font-size: 14px;
|
371 |
+
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
372 |
+
line-height: 150%;
|
373 |
+
display: block;
|
374 |
+
}
|
375 |
+
|
376 |
+
.more-info ul {
|
377 |
+
font-size: 14px;
|
378 |
+
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
379 |
+
line-height: 150%;
|
380 |
+
}
|
381 |
+
|
382 |
+
.more-info li {
|
383 |
+
list-style-type: disc;
|
384 |
+
list-style-position: inside;
|
385 |
+
}
|
386 |
+
|
387 |
+
.more-info code {
|
388 |
+
background: rgba( 0,0,0,0.05 );
|
389 |
+
font-size: 12px;
|
390 |
+
padding: 1px;
|
391 |
+
text-shadow: none;
|
392 |
+
color: #555;
|
393 |
+
}
|
394 |
+
|
395 |
+
.more-info .jp-close {
|
396 |
+
position: absolute;
|
397 |
+
top: 18px;
|
398 |
+
right: 0;
|
399 |
+
background: #888;
|
400 |
+
background: rgba(0,0,0,0.4);
|
401 |
+
color: #fff;
|
402 |
+
font-size: 14px !important;
|
403 |
+
height: 22px;
|
404 |
+
line-height: 20px;
|
405 |
+
padding: 0 6px 0 6px;
|
406 |
+
font-weight: bold !important;
|
407 |
+
-moz-border-radius: 3px;
|
408 |
+
-webkit-border-radius: 3px;
|
409 |
+
border-radius: 3px;
|
410 |
+
-moz-border-radius-topright: 0;
|
411 |
+
-moz-border-radius-bottomright: 0;
|
412 |
+
-webkit-border-top-right-radius: 0;
|
413 |
+
-webkit-border-bottom-right-radius: 0;
|
414 |
+
border-top-right-radius: 0;
|
415 |
+
border-bottom-right-radius: 0;
|
416 |
+
cursor: pointer;
|
417 |
+
text-shadow: 0 1px 0 rgba(0,0,0,0.2);
|
418 |
+
}
|
419 |
+
.more-info .jp-close:hover {
|
420 |
+
background: #69acce;
|
421 |
+
}
|
422 |
+
|
423 |
+
.more-info div.jp-info-img {
|
424 |
+
float: right;
|
425 |
+
width: 320px;
|
426 |
+
margin: 0 30px 0 20px;
|
427 |
+
}
|
428 |
+
|
429 |
+
.more-info img.jp-info-img {
|
430 |
+
padding: 3px;
|
431 |
+
background: rgba( 255, 255, 255, 0.65 );
|
432 |
+
border: 5px solid #ddd;
|
433 |
+
}
|
434 |
+
|
435 |
+
.jetpack-activated {
|
436 |
+
background: #fffff5 url( images/jp-enabled-bg.jpg ) top left repeat-x !important;
|
437 |
+
height: 154px;
|
438 |
+
padding: 60px 0 0 200px !important;
|
439 |
+
position: relative;
|
440 |
+
min-width: 650px;
|
441 |
+
top: 15px;
|
442 |
+
z-index: 5;
|
443 |
+
position: relative;
|
444 |
+
}
|
445 |
+
.jetpack-activated h3 {
|
446 |
+
position: relative;
|
447 |
+
z-index: 5;
|
448 |
+
color: #444;
|
449 |
+
font-size: 42px;
|
450 |
+
font-weight: bold;
|
451 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
452 |
+
margin: 0;
|
453 |
+
padding: 0;
|
454 |
+
background: none;
|
455 |
+
display: block;
|
456 |
+
text-transform: uppercase;
|
457 |
+
}
|
458 |
+
.jetpack-activated p {
|
459 |
+
position: relative;
|
460 |
+
z-index: 3;
|
461 |
+
top: 3px;
|
462 |
+
left: 10px;
|
463 |
+
font-size: 16px;
|
464 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
465 |
+
font-weight: normal;
|
466 |
+
color: #666;
|
467 |
+
background: rgba( 255, 255, 255, 0.75 );
|
468 |
+
padding: 7px 10px 6px;
|
469 |
+
-moz-border-radius: 5px;
|
470 |
+
-webkit-border-radius: 5px;
|
471 |
+
border-radius: 5px;
|
472 |
+
display: inline-block;
|
473 |
+
}
|
474 |
+
.jetpack-activated .jetpack {
|
475 |
+
position: absolute;
|
476 |
+
top: 0;
|
477 |
+
left: 0;
|
478 |
+
width: 238px;
|
479 |
+
height: 214px;
|
480 |
+
background: url( images/jp-enabled-jetpack.jpg ) top left no-repeat;
|
481 |
+
z-index: 2;
|
482 |
+
}
|
483 |
+
.jetpack-activated .clouds {
|
484 |
+
position: absolute;
|
485 |
+
right: 0;
|
486 |
+
bottom: 0;
|
487 |
+
width: 566px;
|
488 |
+
height: 214px;
|
489 |
+
background: url( images/jp-enabled-clouds.png ) bottom left no-repeat;
|
490 |
+
z-index: 0;
|
491 |
+
-webkit-border-bottom-right-radius: 5px;
|
492 |
+
-moz-border-radius-bottomright: 5px;
|
493 |
+
border-bottom-right-radius: 5px;
|
494 |
+
-webkit-box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 );
|
495 |
+
-moz-box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 );
|
496 |
+
box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 );
|
497 |
+
}
|
498 |
+
|
499 |
+
p.jp-help {
|
500 |
+
padding: 10px 0 15px;
|
501 |
+
}
|
502 |
+
|
503 |
+
.module-container {
|
504 |
+
overflow: hidden;
|
505 |
+
min-width: 740px;
|
506 |
+
margin: 25px 0;
|
507 |
+
width: 100%;
|
508 |
+
}
|
509 |
+
|
510 |
+
.jetpack-module {
|
511 |
+
position: relative;
|
512 |
+
float: left;
|
513 |
+
width: 210px;
|
514 |
+
min-height: 160px;
|
515 |
+
max-height: 220px;
|
516 |
+
margin: 0 0 15px 15px;
|
517 |
+
border: 1px solid #dedede;
|
518 |
+
-moz-border-radius: 3px;
|
519 |
+
-webkit-border-radius: 3px;
|
520 |
+
border-radius: 3px;
|
521 |
+
background: #fff;
|
522 |
+
padding: 15px 0 35px 15px;
|
523 |
+
-webkit-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
524 |
+
-moz-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
525 |
+
box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
|
526 |
+
-webkit-transition-duration: .4s;
|
527 |
+
-moz-transition-duration: .4s
|
528 |
+
}
|
529 |
+
/*
|
530 |
+
.jetpack-module:hover {
|
531 |
+
border-color: #bbb;
|
532 |
+
-webkit-box-shadow: 0 1px 2px rgba( 0,0,0,0.2 );
|
533 |
+
-moz-box-shadow: 0 1px 2px rgba( 0,0,0,0.2 );
|
534 |
+
box-shadow: 0 1px 2px rgba( 0,0,0,0.2 );
|
535 |
+
-webkit-transition-duration: .4s;
|
536 |
+
-moz-transition-duration: .4s
|
537 |
+
}
|
538 |
+
*/
|
539 |
+
.jetpack-module div.module-image {
|
540 |
+
float: right;
|
541 |
+
margin: 0 0 5px 10px;
|
542 |
+
padding: 60px 0 0;
|
543 |
+
background: #cbe0a1;
|
544 |
+
width: 80px;
|
545 |
+
-webkit-border-top-left-radius: 3px;
|
546 |
+
-moz-border-radius-topleft: 3px;
|
547 |
+
border-top-left-radius: 3px;
|
548 |
+
-webkit-border-bottom-left-radius: 3px;
|
549 |
+
-moz-border-radius-bottomleft: 3px;
|
550 |
+
border-bottom-left-radius: 3px;
|
551 |
+
background-repeat: no-repeat;
|
552 |
+
background-image: url( images/module-icons-sprite.png );
|
553 |
+
background-size: 2500px 50px; /* remember to update this every time a new module is added! */
|
554 |
+
}
|
555 |
+
|
556 |
+
|
557 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
558 |
+
.jetpack-module div.module-image {
|
559 |
+
background-image: url( images/module-icons-sprite-2x.png );
|
560 |
+
}
|
561 |
+
}
|
562 |
+
|
563 |
+
#stats.jetpack-module div.module-image {
|
564 |
+
background-position: -510px 5px;
|
565 |
+
}
|
566 |
+
#comments.jetpack-module div.module-image {
|
567 |
+
background-position: -1210px 5px;
|
568 |
+
}
|
569 |
+
#subscriptions.jetpack-module div.module-image {
|
570 |
+
background-position: -1009px 5px;
|
571 |
+
}
|
572 |
+
#sharedaddy.jetpack-module div.module-image {
|
573 |
+
background-position: -710px 5px;
|
574 |
+
}
|
575 |
+
#after-the-deadline.jetpack-module div.module-image {
|
576 |
+
background-position: -308px 5px;
|
577 |
+
}
|
578 |
+
#vaultpress.jetpack-module div.module-image {
|
579 |
+
background-position: -910px 5px;
|
580 |
+
}
|
581 |
+
#gravatar-hovercards.jetpack-module div.module-image {
|
582 |
+
background-position: -410px 5px;
|
583 |
+
}
|
584 |
+
#contact-form.jetpack-module div.module-image {
|
585 |
+
background-position: -1107px 5px;
|
586 |
+
}
|
587 |
+
#shortlinks.jetpack-module div.module-image {
|
588 |
+
background-position: -108px 5px;
|
589 |
+
}
|
590 |
+
#shortcodes.jetpack-module div.module-image {
|
591 |
+
background-position: -608px 5px;
|
592 |
+
}
|
593 |
+
#latex.jetpack-module div.module-image {
|
594 |
+
background-position: -208px 5px;
|
595 |
+
}
|
596 |
+
#widgets.jetpack-module div.module-image {
|
597 |
+
background-position: -5px 5px;
|
598 |
+
}
|
599 |
+
#enhanced-distribution.jetpack-module div.module-image {
|
600 |
+
background-position: -808px 5px;
|
601 |
+
}
|
602 |
+
#carousel.jetpack-module div.module-image {
|
603 |
+
background-position: -1325px 5px;
|
604 |
+
}
|
605 |
+
#custom-css.jetpack-module div.module-image {
|
606 |
+
background-position: -1459px 5px;
|
607 |
+
}
|
608 |
+
#minileven.jetpack-module div.module-image {
|
609 |
+
background-position: -1570px 5px;
|
610 |
+
}
|
611 |
+
#notes.jetpack-module div.module-image {
|
612 |
+
background-position: -1806px 5px;
|
613 |
+
}
|
614 |
+
#json-api.jetpack-module div.module-image {
|
615 |
+
background-position: -1689px 5px;
|
616 |
+
}
|
617 |
+
#mobile-push.jetpack-module div.module-image {
|
618 |
+
background-position: -1925px 5px;
|
619 |
+
}
|
620 |
+
#publicize.jetpack-module div.module-image {
|
621 |
+
background-position: -2136px 5px;
|
622 |
+
}
|
623 |
+
#post-by-email.jetpack-module div.module-image {
|
624 |
+
background-position: -2025px 5px;
|
625 |
+
}
|
626 |
+
#infinite-scroll.jetpack-module div.module-image {
|
627 |
+
background-position: -2230px 5px;
|
628 |
+
}
|
629 |
+
#photon.jetpack-module div.module-image {
|
630 |
+
background-position: -2320px 5px;
|
631 |
+
}
|
632 |
+
#tiled-gallery.jetpack-module div.module-image {
|
633 |
+
background-position: -2400px 5px;
|
634 |
+
}
|
635 |
+
|
636 |
+
.jetpack-module div.module-image p {
|
637 |
+
background-color: #b4d278;
|
638 |
+
color: #fff;
|
639 |
+
text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
|
640 |
+
text-align: center;
|
641 |
+
margin: 0;
|
642 |
+
padding: 0;
|
643 |
+
clear: both;
|
644 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
645 |
+
font-weight: bold;
|
646 |
+
-webkit-font-smoothing: antialiased;
|
647 |
+
-webkit-border-bottom-left-radius: 2px;
|
648 |
+
-moz-border-radius-bottomleft: 2px;
|
649 |
+
border-bottom-left-radius: 2px;
|
650 |
+
}
|
651 |
+
|
652 |
+
.jetpack-new-module div.module-image p {
|
653 |
+
background-color: #f5bd4d;
|
654 |
+
}
|
655 |
+
|
656 |
+
.jetpack-updated-module div.module-image p {
|
657 |
+
background-color: #6aafcf;
|
658 |
+
}
|
659 |
+
|
660 |
+
.jetpack-new-module:hover div.module-image p {
|
661 |
+
background-color: #b4d278;
|
662 |
+
}
|
663 |
+
|
664 |
+
.jetpack-updated-module:hover div.module-image p {
|
665 |
+
background-color: #b4d278;
|
666 |
+
}
|
667 |
+
|
668 |
+
.jetpack-new-module:hover div.module-image span.module-image-free,
|
669 |
+
.jetpack-updated-module:hover div.module-image span.module-image-free {
|
670 |
+
display: inline !important;
|
671 |
+
}
|
672 |
+
|
673 |
+
.jetpack-new-module:hover div.module-image span.module-image-badge,
|
674 |
+
.jetpack-updated-module:hover div.module-image span.module-image-badge {
|
675 |
+
display: none;
|
676 |
+
}
|
677 |
+
|
678 |
+
.jetpack-toggle {
|
679 |
+
float: right;
|
680 |
+
padding: 2px 4px 4px;
|
681 |
+
}
|
682 |
+
.jetpack-toggle a {
|
683 |
+
text-decoration: none;
|
684 |
+
font-weight: bold;
|
685 |
+
font-size: 180%;
|
686 |
+
color: #bbb;
|
687 |
+
}
|
688 |
+
|
689 |
+
.jetpack-active .jetpack-toggle-button:hover { color: #b90000; }
|
690 |
+
|
691 |
+
.jetpack-module h3 {
|
692 |
+
line-height: 1.1;
|
693 |
+
margin: 0;
|
694 |
+
padding: 0;
|
695 |
+
font-size: 17px;
|
696 |
+
font-weight: normal;
|
697 |
+
font-style: normal;
|
698 |
+
color: #000;
|
699 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
700 |
+
}
|
701 |
+
|
702 |
+
.jetpack-module-description p {
|
703 |
+
line-height: 150%;
|
704 |
+
font-size: 12px;
|
705 |
+
font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
|
706 |
+
margin-bottom: 20px;
|
707 |
+
color: #666;
|
708 |
+
}
|
709 |
+
|
710 |
+
.jetpack-module .jetpack-module-actions {
|
711 |
+
position: absolute;
|
712 |
+
bottom: 20px;
|
713 |
+
left: 15px;
|
714 |
+
background: #fff;
|
715 |
+
display: block;
|
716 |
+
}
|
717 |
+
|
718 |
+
.jetpack-module .jetpack-module-actions a {
|
719 |
+
position: relative;
|
720 |
+
font-weight: bold;
|
721 |
+
color: #888;
|
722 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
723 |
+
}
|
724 |
+
|
725 |
+
.jetpack-inactive {
|
726 |
+
border-color: #eee;
|
727 |
+
cursor: pointer;
|
728 |
+
}
|
729 |
+
.jetpack-inactive *, jetpack-inactive:hover * { -webkit-transition-duration: .4s; -moz-transition-duration: .4s }
|
730 |
+
|
731 |
+
.jetpack-inactive h3, .jetpack-inactive p, .jetpack-inactive span {
|
732 |
+
color: #ccc;
|
733 |
+
}
|
734 |
+
|
735 |
+
.jetpack-inactive .jetpack-configure-button { display: none; }
|
736 |
+
.jetpack-inactive div.module-image {
|
737 |
+
opacity: 0.6;
|
738 |
+
}
|
739 |
+
|
740 |
+
.jetpack-inactive .jetpack-module-description p a {
|
741 |
+
color: #92b8d0;
|
742 |
+
}
|
743 |
+
.jetpack-inactive:hover .jetpack-module-description p a {
|
744 |
+
color: #5590b7;
|
745 |
+
}
|
746 |
+
|
747 |
+
|
748 |
+
.jetpack-inactive:hover {
|
749 |
+
border-color: #ddd;
|
750 |
+
}
|
751 |
+
|
752 |
+
.jetpack-inactive:hover h3, .jetpack-inactive:hover p, .jetpack-inactive:hover span {
|
753 |
+
color: #aaa;
|
754 |
+
}
|
755 |
+
|
756 |
+
.jetpack-inactive:hover div.module-image {
|
757 |
+
opacity: 0.75;
|
758 |
+
}
|
759 |
+
|
760 |
+
.placeholder {
|
761 |
+
border-color: #eee !important;
|
762 |
+
cursor: default !important;
|
763 |
+
}
|
764 |
+
|
765 |
+
.placeholder h3 {
|
766 |
+
color: #dadada;
|
767 |
+
margin-top: 55px;
|
768 |
+
text-align: center;
|
769 |
+
background: transparent url(images/icon-comingsoon.png) top center no-repeat;
|
770 |
+
padding: 40px 0 0 0;
|
771 |
+
margin-right: 15px;
|
772 |
+
box-shadow: none;
|
773 |
+
}
|
774 |
+
|
775 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
776 |
+
.placeholder h3 {
|
777 |
+
background: transparent url(images/icon-comingsoon-2x.png) top center no-repeat;
|
778 |
+
background-size:32px 32px;
|
779 |
+
}
|
780 |
+
}
|
781 |
+
|
782 |
+
#jp-settings-screen {
|
783 |
+
margin: 0 25px;
|
784 |
+
}
|
785 |
+
#jp-settings-screen h3 {
|
786 |
+
font-size: 18px;
|
787 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
788 |
+
color: #555;
|
789 |
+
padding-bottom: 20px;
|
790 |
+
border-bottom: 1px solid #eee;
|
791 |
+
}
|
792 |
+
|
793 |
+
p#news-sub {
|
794 |
+
text-align: center;
|
795 |
+
}
|
796 |
+
|
797 |
+
#jp-footer {
|
798 |
+
background: url( images/footer-clouds.png ) top center no-repeat;
|
799 |
+
margin: 30px 0;
|
800 |
+
padding-top: 60px;
|
801 |
+
text-align: center;
|
802 |
+
}
|
803 |
+
|
804 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
805 |
+
#jp-footer {
|
806 |
+
background: url( images/footer-clouds-2x.png ) top center no-repeat;
|
807 |
+
background-size:700px 150px;
|
808 |
+
}
|
809 |
+
}
|
810 |
+
|
811 |
+
|
812 |
+
#jp-footer .automattic {
|
813 |
+
color: #999;
|
814 |
+
font-size: 10px;
|
815 |
+
line-height: 15px;
|
816 |
+
text-transform: uppercase;
|
817 |
+
letter-spacing: 3px;
|
818 |
+
padding-left: 3px;
|
819 |
+
}
|
820 |
+
|
821 |
+
#jp-footer .automattic span {
|
822 |
+
text-indent: -999em;
|
823 |
+
overflow: hidden;
|
824 |
+
background: url( images/automattic.png ) center top no-repeat;
|
825 |
+
display: inline-block;
|
826 |
+
width: 165px;
|
827 |
+
vertical-align: top;
|
828 |
+
margin: 0 5px 0 1px;
|
829 |
+
line-height: 14px;
|
830 |
+
height: 14px;
|
831 |
+
filter: alpha(opacity=40);
|
832 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
833 |
+
opacity: 0.5;
|
834 |
+
}
|
835 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
836 |
+
#jp-footer .automattic span {
|
837 |
+
background: url( images/automattic-2x.png ) center top no-repeat;
|
838 |
+
background-size:165px 14px;
|
839 |
+
}
|
840 |
+
}
|
841 |
+
|
842 |
+
#jp-footer p.small {
|
843 |
+
font-size: 11px;
|
844 |
+
color: #ccc;
|
845 |
+
}
|
846 |
+
|
847 |
+
#jp-footer .small a {
|
848 |
+
text-decoration: none;
|
849 |
+
}
|
850 |
+
|
851 |
+
#jp-footer .small a:hover {
|
852 |
+
text-decoration: underline;
|
853 |
+
}
|
854 |
+
|
855 |
+
#jetpack-configuration code {
|
856 |
+
font-size: 14px;
|
857 |
+
}
|
858 |
+
|
859 |
+
.clear {
|
860 |
+
clear: both;
|
861 |
+
}
|
862 |
+
|
863 |
+
.error, .updated { position: relative; z-index: 100; }
|
864 |
+
|
865 |
+
.toplevel_page_jetpack .wrap {
|
866 |
+
max-width: 983px;
|
867 |
+
min-width: 741px;
|
868 |
+
margin-top: 15px;
|
869 |
+
}
|
870 |
+
|
871 |
+
#jetpack-settings .button-primary {
|
872 |
+
color: #fff !important;
|
873 |
+
}
|
874 |
+
|
875 |
+
.jp-survey {
|
876 |
+
position: relative;
|
877 |
+
z-index: 100;
|
878 |
+
border: 1px solid #ccc !important;
|
879 |
+
-moz-border-radius: 3px;
|
880 |
+
-webkit-border-radius: 3px;
|
881 |
+
border-radius: 3px;
|
882 |
+
background-color: #efefef !important;
|
883 |
+
-webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
884 |
+
-moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
885 |
+
box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 );
|
886 |
+
padding: 18px 90px 8px 15px !important;
|
887 |
+
overflow: hidden;
|
888 |
+
line-height: 180%;
|
889 |
+
}
|
890 |
+
|
891 |
+
#jetpack-settings > .jp-survey { margin: 10px 13px 40px 15px }
|
892 |
+
|
893 |
+
.jp-survey h4 {
|
894 |
+
margin: 0;
|
895 |
+
font-size: 18px;
|
896 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
897 |
+
font-weight: normal;
|
898 |
+
color: #333;
|
899 |
+
text-shadow: 0 1px 0 #fff;
|
900 |
+
-moz-border-radius: 5px;
|
901 |
+
-webkit-border-radius: 5px;
|
902 |
+
border-radius: 5px;
|
903 |
+
display: block;
|
904 |
+
float: left;
|
905 |
+
}
|
906 |
+
|
907 |
+
.jp-survey p {
|
908 |
+
float: right;
|
909 |
+
margin: -1px 0 0 0 !important;
|
910 |
+
padding: 0;
|
911 |
+
display: block;
|
912 |
+
}
|
913 |
+
|
914 |
+
.jp-survey-container {
|
915 |
+
overflow: hidden;
|
916 |
+
padding: 0 20px 8px 0;
|
917 |
+
}
|
918 |
+
|
919 |
+
.jp-survey-text {
|
920 |
+
float: left;
|
921 |
+
width: 68.421053%; /* 390px / 570px */
|
922 |
+
}
|
923 |
+
|
924 |
+
.jp-survey-button-container {
|
925 |
+
position: absolute;
|
926 |
+
top: 28px;
|
927 |
+
right: 15px;
|
928 |
+
}
|
929 |
+
|
930 |
+
.jetpack-close-button-container {
|
931 |
+
position: absolute;
|
932 |
+
top: 0;
|
933 |
+
right: 0;
|
934 |
+
}
|
935 |
+
|
936 |
+
.jetpack-close-button {
|
937 |
+
display: block;
|
938 |
+
width: 16px;
|
939 |
+
height: 16px;
|
940 |
+
text-indent: -9999px;
|
941 |
+
background: transparent url( images/alertbox-closeicon.png ) no-repeat center center;
|
942 |
+
border: 0 none;
|
943 |
+
-moz-border-radius: 0 0 0 5px;
|
944 |
+
-webkit-border-radius: 0 0 0 5px;
|
945 |
+
-o-border-radius: 0 0 0 5px;
|
946 |
+
-ms-border-radius: 0 0 0 5px;
|
947 |
+
border-radius: 0 0 0 5px;
|
948 |
+
-moz-box-shadow: none;
|
949 |
+
-webkit-box-shadow: none;
|
950 |
+
box-shadow: none;
|
951 |
+
-webkit-transition-duration: .3s;
|
952 |
+
-moz-transition-duration: .3s;
|
953 |
+
-o-transition-duration: .3s;
|
954 |
+
-ms-transition-duration: .3s;
|
955 |
+
transition-duration: .3s;
|
956 |
+
cursor: pointer;
|
957 |
+
}
|
958 |
+
|
959 |
+
@media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
|
960 |
+
.jetpack-close-button {
|
961 |
+
background: transparent url( images/alertbox-closeicon-2x.png ) no-repeat center center;
|
962 |
+
background-size:16px 16px;
|
963 |
+
}
|
964 |
+
}
|
965 |
+
|
966 |
+
.jetpack-close-button:hover {
|
967 |
+
background-color: #fff;
|
968 |
+
border: 0 none;
|
969 |
+
outline: none;
|
970 |
+
-webkit-transition-duration: .3s;
|
971 |
+
-moz-transition-duration: .3s;
|
972 |
+
-o-transition-duration: .3s;
|
973 |
+
-ms-transition-duration: .3s;
|
974 |
+
transition-duration: .3s;
|
975 |
+
}
|
976 |
+
|
977 |
+
.jetpack-close-button:active {
|
978 |
+
background-color: #efefef;
|
979 |
+
border: 0 none;
|
980 |
+
-webkit-transition-duration: .3s;
|
981 |
+
-moz-transition-duration: .3s;
|
982 |
+
-o-transition-duration: .3s;
|
983 |
+
-ms-transition-duration: .3s;
|
984 |
+
transition-duration: .3s;
|
985 |
+
}
|
986 |
+
|
987 |
+
.jetpack-wrap-container {
|
988 |
+
overflow: hidden;
|
989 |
+
padding: 0 20px 8px 15px;
|
990 |
+
}
|
991 |
+
|
992 |
+
.jetpack-text-container {
|
993 |
+
float: left;
|
994 |
+
width: 68.421053%; /* 390px / 570px */
|
995 |
+
}
|
996 |
+
|
997 |
+
.jetpack-install-container p a.button-connector {
|
998 |
+
position: absolute;
|
999 |
+
bottom: 5px;
|
1000 |
+
right: 15px;
|
1001 |
+
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
1002 |
+
float: right;
|
1003 |
+
display: inline-block;
|
1004 |
+
background: #b4d278;
|
1005 |
+
-moz-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
1006 |
+
-webkit-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
1007 |
+
box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3);
|
1008 |
+
padding: 8px 15px;
|
1009 |
+
border: 1px solid #2a8cba;
|
1010 |
+
-moz-border-radius: 5px;
|
1011 |
+
-webkit-border-radius: 5px;
|
1012 |
+
border-radius: 5px;
|
1013 |
+
line-height: 1.3;
|
1014 |
+
color: #fff;
|
1015 |
+
text-align: center;
|
1016 |
+
font-size: 16px;
|
1017 |
+
font-weight: bold;
|
1018 |
+
text-decoration: none;
|
1019 |
+
text-shadow: 0px 1px 2px rgba( 0,0,0,0.5);
|
1020 |
+
-webkit-transition-duration: .3s;
|
1021 |
+
-moz-transition-duration: .3s;
|
1022 |
+
cursor: pointer;
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
.jetpack-install-container p a.button-connector:hover, .jetpack-install-container p a.button-connector:active {
|
1026 |
+
background-color: #f0a000;
|
1027 |
+
border-color: #c87800;
|
1028 |
+
-webkit-transition-duration: .3s;
|
1029 |
+
outline: none;
|
1030 |
+
-moz-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5);
|
1031 |
+
-webkit-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5);
|
1032 |
+
box-shadow: inset 0 0 2px #fff, 0 1px 7spx rgba(240,160,0,0.5);
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
.jetpack-inline-error, .jetpack-inline-message {
|
1036 |
+
padding: .5em 1em .5em 1em;
|
1037 |
+
-moz-border-radius: 3px;
|
1038 |
+
-webkit-border-radius: 3px;
|
1039 |
+
border-radius: 3px;
|
1040 |
+
border-width: 1px;
|
1041 |
+
border-style: solid;
|
1042 |
+
color: #333;
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
.jetpack-inline-error {
|
1046 |
+
background-color: #ffebe8;
|
1047 |
+
border-color: #c00;
|
1048 |
+
}
|
1049 |
+
|
1050 |
+
.jetpack-inline-message {
|
1051 |
+
background-color: #ffffe0;
|
1052 |
+
border-color: #e6db55;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
.jetpack-targetable {
|
1056 |
+
border-top: 28px solid transparent;
|
1057 |
+
margin-top: -28px;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
.jetpack-targetable:target {
|
1061 |
+
background-color: #ffffe0;
|
1062 |
+
background-clip: padding-box;
|
1063 |
+
padding: 0 10px;
|
1064 |
+
margin-left: -10px;
|
1065 |
+
margin-right: -10px;
|
1066 |
+
}
|
_inc/jetpack.js
CHANGED
@@ -1,9 +1,5 @@
|
|
1 |
-
/* global jetpack: true, isRtl, jetpackL10n, userSettings, confirm */
|
2 |
-
|
3 |
// ScrollTo Plugin 1.4.2 | Copyright (c) 2007-2009 Ariel Flesler | GPL/MIT License
|
4 |
-
/* jshint ignore:start */
|
5 |
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
6 |
-
/* jshint ignore:end */
|
7 |
|
8 |
jetpack = {
|
9 |
numModules: 0,
|
@@ -14,7 +10,7 @@ jetpack = {
|
|
14 |
resizeTimer: null,
|
15 |
shadowTimer: null,
|
16 |
statusText: null,
|
17 |
-
isRTL: !( 'undefined'
|
18 |
didDebug: false,
|
19 |
|
20 |
init: function() {
|
@@ -29,7 +25,7 @@ jetpack = {
|
|
29 |
e.preventDefault();
|
30 |
jetpack.hide_shadows();
|
31 |
|
32 |
-
if ( jetpack.linkClicked && jetpack.linkClicked.parents( 'div.jetpack-module' ).attr( 'id' )
|
33 |
jetpack.close_learn_more( function() { jetpack.show_shadows(); } );
|
34 |
} else {
|
35 |
jetpack.linkClicked = jQuery(this);
|
@@ -60,12 +56,13 @@ jetpack = {
|
|
60 |
jetpack.toggle_debug();
|
61 |
});
|
62 |
|
|
|
63 |
jQuery( '#jp-disconnect a' ).click( function() {
|
64 |
if ( confirm( jetpackL10n.ays_disconnect ) ) {
|
65 |
jQuery( this ).addClass( 'clicked' ).css( {
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
} ).unbind( 'click' ).click( function() { return false; } );
|
70 |
} else {
|
71 |
return false;
|
@@ -74,16 +71,15 @@ jetpack = {
|
|
74 |
jQuery( '#jp-unlink a' ).click( function() {
|
75 |
if ( confirm( jetpackL10n.ays_unlink ) ) {
|
76 |
jQuery( this ).css( {
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
} ).unbind( 'click' ).click( function() { return false; } );
|
81 |
} else {
|
82 |
return false;
|
83 |
}
|
84 |
} );
|
85 |
|
86 |
-
jQuery( '#screen-meta, #screen-meta-links' ).wrapAll( '<div class="screen-meta-wrap" />' );
|
87 |
},
|
88 |
|
89 |
level_modules: function() {
|
@@ -95,17 +91,16 @@ jetpack = {
|
|
95 |
} ).height( max_height );
|
96 |
},
|
97 |
|
98 |
-
level_placeholders: function() {
|
99 |
jQuery( 'div.placeholder' ).show();
|
100 |
|
101 |
var containerWidth = jetpack.container.width(),
|
102 |
-
|
103 |
|
104 |
-
if ( jetpack.numModules * 242 > containerWidth )
|
105 |
jQuery( 'div.placeholder' ).slice( needed ).hide();
|
106 |
-
|
107 |
jQuery( 'div.placeholder' ).hide();
|
108 |
-
}
|
109 |
},
|
110 |
|
111 |
level_placeholders_on_resize: function() {
|
@@ -124,28 +119,27 @@ jetpack = {
|
|
124 |
|
125 |
insert_learn_more: function( card, callback ) {
|
126 |
var perRow = parseInt( jetpack.container.width() / 242, 10 ),
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
|
131 |
// Get the position of the card clicked.
|
132 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
133 |
-
if ( jQuery(el).attr('id')
|
134 |
cardPosition = i;
|
135 |
-
}
|
136 |
} );
|
137 |
|
138 |
cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
139 |
|
140 |
// Insert the more info box after the last item of the row.
|
141 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
142 |
-
if ( i + 1
|
143 |
// More info box already exists.
|
144 |
if ( jQuery( 'div.more-info' ).length ) {
|
145 |
if ( jQuery( el ).next().hasClass( 'more-info' ) ) {
|
146 |
jQuery( 'div.more-info div.jp-content' ).fadeOut( 100 );
|
147 |
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
148 |
-
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600, function() { if ( typeof callback
|
149 |
} else {
|
150 |
jQuery( 'div.more-info div.jp-content' ).hide();
|
151 |
jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() {
|
@@ -156,7 +150,7 @@ jetpack = {
|
|
156 |
$this.css( { height: '230px', minHeight: 0 } ).slideDown( 300, function() {
|
157 |
$this.css( { height: 'auto', minHeight: '230px' } );
|
158 |
} );
|
159 |
-
jQuery( window ).scrollTo( ( $this.prev().offset().top ) - 70, 600, function() { if ( typeof callback
|
160 |
} );
|
161 |
}
|
162 |
|
@@ -173,7 +167,7 @@ jetpack = {
|
|
173 |
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
174 |
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600 );
|
175 |
|
176 |
-
if ( typeof callback
|
177 |
} );
|
178 |
|
179 |
jQuery( 'div.more-info' ).children( 'div.arrow' ).animate( { left: jQuery(card).offset().left - jetpack.container.offset().left + learnMoreOffset + 'px' }, 300 );
|
@@ -197,21 +191,19 @@ jetpack = {
|
|
197 |
},
|
198 |
|
199 |
reposition_learn_more: function( card ) {
|
200 |
-
var perRow = parseInt( jetpack.container.width() / 242, 10 )
|
201 |
-
|
202 |
-
cardRow;
|
203 |
|
204 |
// Get the position of the card clicked.
|
205 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
206 |
-
if ( jQuery(el).attr('id')
|
207 |
cardPosition = i;
|
208 |
-
}
|
209 |
} );
|
210 |
|
211 |
-
cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
212 |
|
213 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
214 |
-
if ( i + 1
|
215 |
jQuery( 'div.more-info' ).detach().insertAfter( el );
|
216 |
jQuery( 'div.more-info' ).children( 'div.arrow' ).css( { left: jQuery(card).offset().left - jetpack.container.offset().left + 28 + 'px' }, 300 );
|
217 |
}
|
@@ -219,7 +211,7 @@ jetpack = {
|
|
219 |
},
|
220 |
|
221 |
learn_more_content: function( module_id ) {
|
222 |
-
|
223 |
jQuery( 'div.more-info div.jp-content' ).html( response ).hide().fadeIn( 300 );
|
224 |
},
|
225 |
|
@@ -232,7 +224,7 @@ jetpack = {
|
|
232 |
jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-configure-button' ).show();
|
233 |
jetpack.linkClicked = null;
|
234 |
|
235 |
-
if ( typeof callback
|
236 |
} );
|
237 |
},
|
238 |
|
@@ -252,5 +244,5 @@ jetpack = {
|
|
252 |
jQuery( 'div.jetpack-module' ).css( { '-webkit-box-shadow': 'inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
253 |
jQuery( 'div.more-info' ).css( { '-webkit-box-shadow': 'inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
254 |
}
|
255 |
-
}
|
256 |
jQuery( function() { jetpack.init(); } );
|
|
|
|
|
1 |
// ScrollTo Plugin 1.4.2 | Copyright (c) 2007-2009 Ariel Flesler | GPL/MIT License
|
|
|
2 |
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
|
|
3 |
|
4 |
jetpack = {
|
5 |
numModules: 0,
|
10 |
resizeTimer: null,
|
11 |
shadowTimer: null,
|
12 |
statusText: null,
|
13 |
+
isRTL: !( 'undefined' == typeof isRtl || !isRtl ),
|
14 |
didDebug: false,
|
15 |
|
16 |
init: function() {
|
25 |
e.preventDefault();
|
26 |
jetpack.hide_shadows();
|
27 |
|
28 |
+
if ( jetpack.linkClicked && jetpack.linkClicked.parents( 'div.jetpack-module' ).attr( 'id' ) == jQuery(this).parents( 'div.jetpack-module' ).attr( 'id' ) ) {
|
29 |
jetpack.close_learn_more( function() { jetpack.show_shadows(); } );
|
30 |
} else {
|
31 |
jetpack.linkClicked = jQuery(this);
|
56 |
jetpack.toggle_debug();
|
57 |
});
|
58 |
|
59 |
+
var widerWidth = 0;
|
60 |
jQuery( '#jp-disconnect a' ).click( function() {
|
61 |
if ( confirm( jetpackL10n.ays_disconnect ) ) {
|
62 |
jQuery( this ).addClass( 'clicked' ).css( {
|
63 |
+
"background-image": 'url( ' + userSettings.url + 'wp-admin/images/wpspin_light.gif )',
|
64 |
+
"background-position": '9px 5px',
|
65 |
+
"background-size": '16px 16px'
|
66 |
} ).unbind( 'click' ).click( function() { return false; } );
|
67 |
} else {
|
68 |
return false;
|
71 |
jQuery( '#jp-unlink a' ).click( function() {
|
72 |
if ( confirm( jetpackL10n.ays_unlink ) ) {
|
73 |
jQuery( this ).css( {
|
74 |
+
"background-image": 'url( ' + userSettings.url + 'wp-admin/images/wpspin_light.gif )',
|
75 |
+
"background-position": '9px 5px',
|
76 |
+
"background-size": '16px 16px'
|
77 |
} ).unbind( 'click' ).click( function() { return false; } );
|
78 |
} else {
|
79 |
return false;
|
80 |
}
|
81 |
} );
|
82 |
|
|
|
83 |
},
|
84 |
|
85 |
level_modules: function() {
|
91 |
} ).height( max_height );
|
92 |
},
|
93 |
|
94 |
+
level_placeholders: function( w ) {
|
95 |
jQuery( 'div.placeholder' ).show();
|
96 |
|
97 |
var containerWidth = jetpack.container.width(),
|
98 |
+
needed = 5 * parseInt( containerWidth / 242, 10 ) - jetpack.numModules
|
99 |
|
100 |
+
if ( jetpack.numModules * 242 > containerWidth )
|
101 |
jQuery( 'div.placeholder' ).slice( needed ).hide();
|
102 |
+
else
|
103 |
jQuery( 'div.placeholder' ).hide();
|
|
|
104 |
},
|
105 |
|
106 |
level_placeholders_on_resize: function() {
|
119 |
|
120 |
insert_learn_more: function( card, callback ) {
|
121 |
var perRow = parseInt( jetpack.container.width() / 242, 10 ),
|
122 |
+
cardPosition = 0,
|
123 |
+
cardRow = 0,
|
124 |
+
learnMoreOffset = jetpack.isRTL ? 144 : 28;
|
125 |
|
126 |
// Get the position of the card clicked.
|
127 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
128 |
+
if ( jQuery(el).attr('id') == jQuery(card).attr('id') )
|
129 |
cardPosition = i;
|
|
|
130 |
} );
|
131 |
|
132 |
cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
133 |
|
134 |
// Insert the more info box after the last item of the row.
|
135 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
136 |
+
if ( i + 1 == ( perRow * cardRow ) ) {
|
137 |
// More info box already exists.
|
138 |
if ( jQuery( 'div.more-info' ).length ) {
|
139 |
if ( jQuery( el ).next().hasClass( 'more-info' ) ) {
|
140 |
jQuery( 'div.more-info div.jp-content' ).fadeOut( 100 );
|
141 |
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
142 |
+
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600, function() { if ( typeof callback == 'function' ) callback.call( this ); } );
|
143 |
} else {
|
144 |
jQuery( 'div.more-info div.jp-content' ).hide();
|
145 |
jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() {
|
150 |
$this.css( { height: '230px', minHeight: 0 } ).slideDown( 300, function() {
|
151 |
$this.css( { height: 'auto', minHeight: '230px' } );
|
152 |
} );
|
153 |
+
jQuery( window ).scrollTo( ( $this.prev().offset().top ) - 70, 600, function() { if ( typeof callback == 'function' ) callback.call( this ); } );
|
154 |
} );
|
155 |
}
|
156 |
|
167 |
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
168 |
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600 );
|
169 |
|
170 |
+
if ( typeof callback == 'function' ) callback.call( this );
|
171 |
} );
|
172 |
|
173 |
jQuery( 'div.more-info' ).children( 'div.arrow' ).animate( { left: jQuery(card).offset().left - jetpack.container.offset().left + learnMoreOffset + 'px' }, 300 );
|
191 |
},
|
192 |
|
193 |
reposition_learn_more: function( card ) {
|
194 |
+
var perRow = parseInt( jetpack.container.width() / 242, 10 );
|
195 |
+
var cardPosition = 0;
|
|
|
196 |
|
197 |
// Get the position of the card clicked.
|
198 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
199 |
+
if ( jQuery(el).attr('id') == jQuery(card).attr('id') )
|
200 |
cardPosition = i;
|
|
|
201 |
} );
|
202 |
|
203 |
+
var cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
204 |
|
205 |
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
206 |
+
if ( i + 1 == ( perRow * cardRow ) ) {
|
207 |
jQuery( 'div.more-info' ).detach().insertAfter( el );
|
208 |
jQuery( 'div.more-info' ).children( 'div.arrow' ).css( { left: jQuery(card).offset().left - jetpack.container.offset().left + 28 + 'px' }, 300 );
|
209 |
}
|
211 |
},
|
212 |
|
213 |
learn_more_content: function( module_id ) {
|
214 |
+
response = jQuery( '#jp-more-info-' + module_id ).html();
|
215 |
jQuery( 'div.more-info div.jp-content' ).html( response ).hide().fadeIn( 300 );
|
216 |
},
|
217 |
|
224 |
jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-configure-button' ).show();
|
225 |
jetpack.linkClicked = null;
|
226 |
|
227 |
+
if ( typeof callback == 'function' ) callback.call( this );
|
228 |
} );
|
229 |
},
|
230 |
|
244 |
jQuery( 'div.jetpack-module' ).css( { '-webkit-box-shadow': 'inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
245 |
jQuery( 'div.more-info' ).css( { '-webkit-box-shadow': 'inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
246 |
}
|
247 |
+
}
|
248 |
jQuery( function() { jetpack.init(); } );
|
_inc/jp-my-jetpack.js
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
/* global jpConnection, jQuery */
|
2 |
-
|
3 |
-
(function( $, jpConnection ) {
|
4 |
-
|
5 |
-
///////////////////////////////////////
|
6 |
-
// INIT
|
7 |
-
///////////////////////////////////////
|
8 |
-
|
9 |
-
var data = {
|
10 |
-
'jetpackIsActive' : jpConnection.jetpackIsActive,
|
11 |
-
'isAdmin' : jpConnection.isAdmin,
|
12 |
-
'otherAdminsLinked' : jpConnection.otherAdminsLinked,
|
13 |
-
'stats_urls' : jpConnection.my_jetpack_stats_urls,
|
14 |
-
'masterUser' : jpConnection.masterUser,
|
15 |
-
'masterUserLink' : jpConnection.masterUser.masterUserLink,
|
16 |
-
'currentUser' : jpConnection.currentUser
|
17 |
-
};
|
18 |
-
|
19 |
-
$( document ).ready(function () {
|
20 |
-
renderPageTemplate( data );
|
21 |
-
|
22 |
-
// Set someone as master.
|
23 |
-
$( '#change-primary-btn' ).click( function() {
|
24 |
-
$( '#change-primary-btn' ).hide();
|
25 |
-
$( '#user-list' ).show();
|
26 |
-
$( '#save-primary-btn' ).show();
|
27 |
-
|
28 |
-
//Log My Jetpack event "change primary" in MC Stats
|
29 |
-
new Image().src = data.stats_urls.change_primary;
|
30 |
-
});
|
31 |
-
|
32 |
-
// Hide the success message after a little bit
|
33 |
-
setTimeout( function(){
|
34 |
-
jQuery( '.jetpack-message:not( .stay-visible, .jetpack-err )' ).hide( 600 );
|
35 |
-
}, 6000);
|
36 |
-
|
37 |
-
});
|
38 |
-
|
39 |
-
function renderPageTemplate( data ) {
|
40 |
-
$( '#my-jetpack-page-template' ).html( wp.template( 'connection-page' )( data ) );
|
41 |
-
// Save the focused element, then shift focus to the modal window.
|
42 |
-
confirmJetpackDisconnect();
|
43 |
-
}
|
44 |
-
|
45 |
-
/*
|
46 |
-
The function used to display the disconnect confirmation and support buttons
|
47 |
-
*/
|
48 |
-
function confirmJetpackDisconnect() {
|
49 |
-
if ( window.location.hash.substr( '#disconnect' ) ) {
|
50 |
-
$( '#jetpack-disconnect-content' ).show();
|
51 |
-
$( '#my-jetpack-content, .my-jetpack-actions' ).hide();
|
52 |
-
|
53 |
-
//Log My Jetpack event "wants to disconnect Jetpack" in MC Stats
|
54 |
-
new Image().src = data.stats_urls.disconnect_site;
|
55 |
-
}
|
56 |
-
|
57 |
-
$( '#jetpack-disconnect' ).click( function() {
|
58 |
-
$( '#jetpack-disconnect-content' ).show();
|
59 |
-
$( '#my-jetpack-content, .my-jetpack-actions' ).hide();
|
60 |
-
|
61 |
-
//Log My Jetpack event "wants to disconnect Jetpack" in MC Stats
|
62 |
-
new Image().src = data.stats_urls.disconnect_site;
|
63 |
-
});
|
64 |
-
|
65 |
-
$( '#cancel-disconnect' ).click( function() {
|
66 |
-
event.preventDefault();
|
67 |
-
|
68 |
-
$( '#jetpack-disconnect-content' ).hide();
|
69 |
-
$( '#my-jetpack-content, .my-jetpack-actions' ).show();
|
70 |
-
|
71 |
-
//Log My Jetpack event "decided not to disconnect Jetpack" in MC Stats
|
72 |
-
new Image().src = data.stats_urls.cancel_disconnect;
|
73 |
-
});
|
74 |
-
|
75 |
-
$( '#jetpack-disconnect-content #support-no-disconnect' ).click( function() {
|
76 |
-
//Log My Jetpack event "get support instead of disconnecting site" in MC Stats
|
77 |
-
new Image().src = data.stats_urls.support_no_disconnect;
|
78 |
-
});
|
79 |
-
|
80 |
-
$( '#jetpack-disconnect-content #confirm-disconnect' ).click( function() {
|
81 |
-
//Log My Jetpack event "confirm the disconnecting of a the site" in MC Stats
|
82 |
-
new Image().src = data.stats_urls.confirm_disconnect;
|
83 |
-
});
|
84 |
-
}
|
85 |
-
|
86 |
-
})( jQuery, jpConnection );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jp.js
DELETED
@@ -1,433 +0,0 @@
|
|
1 |
-
/* global wp, jetpackL10n, jQuery */
|
2 |
-
|
3 |
-
(function( $, modules, currentVersion, jetpackL10n ) {
|
4 |
-
|
5 |
-
///////////////////////////////////////
|
6 |
-
// INIT
|
7 |
-
///////////////////////////////////////
|
8 |
-
|
9 |
-
var originPoint,
|
10 |
-
data;
|
11 |
-
|
12 |
-
$( document ).ready(function () {
|
13 |
-
|
14 |
-
data = {
|
15 |
-
'jumpstartModules' : jetpackL10n.jumpstart_modules,
|
16 |
-
'jumpstartModSlug' : jetpackL10n.jumpstart_modules,
|
17 |
-
'jumpstartNonce' : jetpackL10n.activate_nonce,
|
18 |
-
'jumpstartStatsURLS' : jetpackL10n.jumpstart_stats_urls,
|
19 |
-
'nuxAdminStatsURLS' : jetpackL10n.admin_stats_urls,
|
20 |
-
'showJumpstart' : jetpackL10n.show_jumpstart,
|
21 |
-
'adminNonce' : jetpackL10n.admin_nonce
|
22 |
-
};
|
23 |
-
|
24 |
-
initEvents();
|
25 |
-
loadModules( 'Performance-Security', 'mod-nux', '#nux-performance-security' );
|
26 |
-
loadModules( 'Traffic', 'mod-nux', '#nux-traffic' );
|
27 |
-
if('1' === data.showJumpstart) {
|
28 |
-
loadModules( 'Jumpstart', 'mod-jumpstart', '#jp-config-list' );
|
29 |
-
}
|
30 |
-
|
31 |
-
/*
|
32 |
-
We are listening to see if we need to refresh the data.
|
33 |
-
We'd need to refresh the data only if the page is navigated to
|
34 |
-
via the back or forward browser buttons. We do this so the
|
35 |
-
browser cache isn't out of sync with the real data generated by the
|
36 |
-
AJAX event.
|
37 |
-
*/
|
38 |
-
onload = function() {
|
39 |
-
if ( window.location.hash.substr( '#refresh' ) ) {
|
40 |
-
refreshData();
|
41 |
-
}
|
42 |
-
};
|
43 |
-
|
44 |
-
jumpStartAJAX();
|
45 |
-
adminAJAX();
|
46 |
-
});
|
47 |
-
|
48 |
-
///////////////////////////////////////
|
49 |
-
// FUNCTIONS
|
50 |
-
///////////////////////////////////////
|
51 |
-
|
52 |
-
function closeShadeToggle() {
|
53 |
-
// Clicking outside modal, or close X closes modal
|
54 |
-
$( '.shade, .modal .close' ).on( 'click', function () {
|
55 |
-
$( '.shade, .modal' ).hide();
|
56 |
-
$( '.manage-right' ).removeClass( 'show' );
|
57 |
-
originPoint.focus();
|
58 |
-
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
59 |
-
$( 'body' ).css( 'overflow', 'auto' );
|
60 |
-
return false;
|
61 |
-
});
|
62 |
-
|
63 |
-
$( window ).on( 'keydown', function( e ) {
|
64 |
-
// If pressing ESC close the modal
|
65 |
-
if ( 27 === e.keyCode ) {
|
66 |
-
$( '.shade, .modal' ).hide();
|
67 |
-
$( '.manage-right' ).removeClass( 'show' );
|
68 |
-
originPoint.focus();
|
69 |
-
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
70 |
-
$( 'body' ).css( 'overflow', 'auto' );
|
71 |
-
}
|
72 |
-
});
|
73 |
-
}
|
74 |
-
|
75 |
-
function initEvents () {
|
76 |
-
// Only show module table if Jumpstart isn't there
|
77 |
-
if ( ! data.showJumpstart ) {
|
78 |
-
$( '.nux-intro' ).show();
|
79 |
-
}
|
80 |
-
|
81 |
-
// Show preconfigured list of features to enable via "Jump-start"
|
82 |
-
$( '.jp-config-list-btn' ).click(function(){
|
83 |
-
$( '#jp-config-list' ).toggle();
|
84 |
-
recalculateModuleHeights();
|
85 |
-
|
86 |
-
//Log Jump Start event "learn more" in MC Stats
|
87 |
-
new Image().src = data.jumpstartStatsURLS.learnmore;
|
88 |
-
});
|
89 |
-
|
90 |
-
// Hide the successful connection message after a little bit
|
91 |
-
setTimeout( function(){
|
92 |
-
jQuery( '.jetpack-message:not( .stay-visible, .jetpack-err )' ).hide( 600 );
|
93 |
-
}, 6000);
|
94 |
-
|
95 |
-
// Modal events
|
96 |
-
$( document ).ready(function () {
|
97 |
-
initModalEvents();
|
98 |
-
});
|
99 |
-
|
100 |
-
// Debounce the resize event
|
101 |
-
var pauseResize = false;
|
102 |
-
window.onresize = function() {
|
103 |
-
if ( !pauseResize ) {
|
104 |
-
pauseResize = true;
|
105 |
-
recalculateModuleHeights();
|
106 |
-
setTimeout(function () {
|
107 |
-
pauseResize = false;
|
108 |
-
}, 100 );
|
109 |
-
}
|
110 |
-
};
|
111 |
-
|
112 |
-
// This function will track the number of clicks on the "See the other X Jetpack features"
|
113 |
-
$( '.full-features-btn' ).click( function() {
|
114 |
-
new Image().src = data.nuxAdminStatsURLS.learnmore+'-full-features-btn';
|
115 |
-
});
|
116 |
-
}
|
117 |
-
|
118 |
-
function initModalEvents() {
|
119 |
-
var $modal = $( '.modal' );
|
120 |
-
$( '.module h3, .feature a, .configs a, .more-info, .feat h4' ).on( 'click keypress', function (e) {
|
121 |
-
// Only show modal on enter when keypress recorded (accessibility)
|
122 |
-
if ( e.keyCode && 13 !== e.keyCode ) {
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
|
126 |
-
e.preventDefault();
|
127 |
-
|
128 |
-
$( '.shade' ).show();
|
129 |
-
|
130 |
-
// Show loading message on init
|
131 |
-
$modal.html( wp.template( 'modalLoading' )( {} ) ).fadeIn();
|
132 |
-
// Load & populate with content
|
133 |
-
var $this = $( this ).parent(),
|
134 |
-
index = $this.data( 'index' ),
|
135 |
-
name = $this.data( 'name' );
|
136 |
-
|
137 |
-
$modal.empty().html( wp.template( 'modal' )( $.extend( modules[index], { name: name } ) ) );
|
138 |
-
// Save the focused element, then shift focus to the modal window.
|
139 |
-
originPoint = this;
|
140 |
-
$modal[0].setAttribute( 'tabindex', '0' );
|
141 |
-
$modal.focus();
|
142 |
-
|
143 |
-
// Disallow scroll
|
144 |
-
$( 'body' ).css( 'overflow', 'hidden' );
|
145 |
-
|
146 |
-
closeShadeToggle();
|
147 |
-
|
148 |
-
// Modal header links
|
149 |
-
$( '.modal header li a.title' ).on( 'click', function () {
|
150 |
-
$( '.modal header li a.title' ).removeClass( 'active' );
|
151 |
-
$( this ).addClass( 'active' );
|
152 |
-
return false;
|
153 |
-
});
|
154 |
-
});
|
155 |
-
}
|
156 |
-
|
157 |
-
|
158 |
-
/*
|
159 |
-
Load Modules for a template
|
160 |
-
@param string: The module tag you'd like to filter by
|
161 |
-
@param string: The template name
|
162 |
-
@param string: The target element to display the template
|
163 |
-
*/
|
164 |
-
function loadModules( prop, template, location ) {
|
165 |
-
// Mapping prior to sorting improves performance by over 50%
|
166 |
-
var html = '',
|
167 |
-
result = [],
|
168 |
-
val = '',
|
169 |
-
i,
|
170 |
-
length,
|
171 |
-
renderingmodules = [];
|
172 |
-
|
173 |
-
// create the map
|
174 |
-
for ( i = 0, length = modules.length; i < length; i++ ) {
|
175 |
-
if( modules[i].feature.indexOf(prop) !== -1 ) {
|
176 |
-
val = modules[i].name.toLowerCase();
|
177 |
-
result.push( {
|
178 |
-
index: i,
|
179 |
-
value: val,
|
180 |
-
order: modules[i].recommendation_order
|
181 |
-
});
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
// Sort modules by recommendation order
|
186 |
-
result.sort(function( a, b ) {
|
187 |
-
if (a.order === b.order ) {
|
188 |
-
return 0;
|
189 |
-
}
|
190 |
-
return ( a.order < b.order ) ? -1 : 1;
|
191 |
-
});
|
192 |
-
|
193 |
-
// copy values in right order
|
194 |
-
for ( i = 0, length = result.length; i < length; i++ ) {
|
195 |
-
renderingmodules.push( modules[result[i].index] );
|
196 |
-
renderingmodules[i].index = result[i].index; // make sure we set the index to the right order*/
|
197 |
-
}
|
198 |
-
|
199 |
-
|
200 |
-
// Render modules. Don't show active in Jumpstart.
|
201 |
-
for ( i = 0; i < renderingmodules.length; i++ ) {
|
202 |
-
if ( 'Jumpstart' === prop && ! renderingmodules[i].activated ) {
|
203 |
-
html += wp.template( template )( renderingmodules[i] );
|
204 |
-
} else if ( 'Jumpstart' !== prop ) {
|
205 |
-
html += wp.template( template )( renderingmodules[i] );
|
206 |
-
}
|
207 |
-
}
|
208 |
-
|
209 |
-
$( location ).append( html );
|
210 |
-
|
211 |
-
// track Jump Start views
|
212 |
-
if('Jumpstart' === prop) {
|
213 |
-
new Image().src = data.jumpstartStatsURLS.viewed;
|
214 |
-
}
|
215 |
-
|
216 |
-
recalculateModuleHeights();
|
217 |
-
initModalEvents();
|
218 |
-
}
|
219 |
-
|
220 |
-
function recalculateModuleHeights () {
|
221 |
-
// Resize module heights based on screen resolution
|
222 |
-
var module = $( '.jp-jumpstart, .module, .jp-support-column-left .widget-text' ),
|
223 |
-
tallest = 0,
|
224 |
-
thisHeight;
|
225 |
-
|
226 |
-
// Remove heights
|
227 |
-
module.css( 'height', 'auto' );
|
228 |
-
|
229 |
-
// Determine new height
|
230 |
-
module.each(function() {
|
231 |
-
|
232 |
-
thisHeight = $( this ).outerHeight();
|
233 |
-
|
234 |
-
if ( thisHeight > tallest ) {
|
235 |
-
tallest = thisHeight;
|
236 |
-
}
|
237 |
-
});
|
238 |
-
|
239 |
-
// Apply new height plus 20 pixels
|
240 |
-
module.css( 'height', ( parseInt( tallest, 10 ) + 5 ) + 'px' );
|
241 |
-
}
|
242 |
-
|
243 |
-
/*
|
244 |
-
Handles the jump start ajax requests.
|
245 |
-
|
246 |
-
Dismissing the Jump Start area will set an option, so it will never be seen again
|
247 |
-
Initiating Jump Start will activate all modules that are recommended and set a sharing options while doing so.
|
248 |
-
For either request, if update_option has failed, look for an error in the console.
|
249 |
-
@todo delete the "reset everything" call - meant for testing only.
|
250 |
-
*/
|
251 |
-
function jumpStartAJAX() {
|
252 |
-
|
253 |
-
// Will dismiss the Jump Start area, and set wp option in callback
|
254 |
-
$( '.dismiss-jumpstart' ).click(function(){
|
255 |
-
$( '#jump-start-area' ).hide( 600 );
|
256 |
-
|
257 |
-
data.disableJumpStart = true;
|
258 |
-
data.action = 'jetpack_jumpstart_ajax';
|
259 |
-
|
260 |
-
$.post( jetpackL10n.ajaxurl, data, function (response) {
|
261 |
-
// If there's no response, something bad happened
|
262 |
-
if ( ! response ) {
|
263 |
-
//console.log( 'Option "jetpack_dismiss_jumpstart" not updated.' );
|
264 |
-
}
|
265 |
-
|
266 |
-
window.location.hash = 'refresh';
|
267 |
-
});
|
268 |
-
|
269 |
-
$( '.nux-intro' ).show();
|
270 |
-
|
271 |
-
// Log Jump Start event in MC Stats
|
272 |
-
new Image().src = data.jumpstartStatsURLS.dismiss;
|
273 |
-
|
274 |
-
return false;
|
275 |
-
});
|
276 |
-
|
277 |
-
// Activate all Jump-start modules
|
278 |
-
$( '#jump-start' ).click(function () {
|
279 |
-
var module, dataName, configURL, checkBox;
|
280 |
-
|
281 |
-
$( '.jumpstart-spinner' ).show().css( 'display', 'block' );
|
282 |
-
$( '#jump-start' ).hide();
|
283 |
-
$( '.dismiss-jumpstart' ).hide();
|
284 |
-
|
285 |
-
data.jumpStartActivate = 'jump-start-activate';
|
286 |
-
data.action = 'jetpack_jumpstart_ajax';
|
287 |
-
|
288 |
-
$( '#jp-config-list' ).hide();
|
289 |
-
|
290 |
-
$.post( jetpackL10n.ajaxurl, data, function (response) {
|
291 |
-
// If there's no response, option 'sharing-services' was not updated.
|
292 |
-
if ( ! response ) {
|
293 |
-
//console.log( 'Option "sharing-services" not updated. Either you already had sharing buttons enabled, or something is broken.' );
|
294 |
-
}
|
295 |
-
|
296 |
-
module = data.jumpstartModules;
|
297 |
-
|
298 |
-
// Only target Jump Start modules
|
299 |
-
_.each( module, function( mod ) {
|
300 |
-
dataName = $( 'label[for="active-' + mod.module_slug + '"]' + '.plugin-action__label' );
|
301 |
-
configURL = mod.configure_url;
|
302 |
-
checkBox = $( 'input[id="active-' + mod.module_slug + '"]' );
|
303 |
-
|
304 |
-
$( '#toggle-' + mod.module_slug ).addClass( 'activated' );
|
305 |
-
dataName.html( 'ACTIVE' );
|
306 |
-
$( checkBox ).prop( 'checked', true );
|
307 |
-
});
|
308 |
-
|
309 |
-
$( '.jumpstart-spinner, .jstart, #jumpstart-cta, .manage-cta-inactive' ).hide();
|
310 |
-
$( '.jumpstart-message, .manage-cta-active' ).toggle();
|
311 |
-
$( '#jump-start-area' ).delay( 5000 ).hide( 600 );
|
312 |
-
|
313 |
-
// Log Jump Start event in MC Stats
|
314 |
-
new Image().src = data.jumpstartStatsURLS.jumpstarted;
|
315 |
-
|
316 |
-
$( '.nux-intro' ).show();
|
317 |
-
|
318 |
-
window.location.hash = 'refresh';
|
319 |
-
});
|
320 |
-
|
321 |
-
return false;
|
322 |
-
});
|
323 |
-
|
324 |
-
/*
|
325 |
-
RESET EVERYTHING (for testing only)
|
326 |
-
@todo remove
|
327 |
-
*/
|
328 |
-
|
329 |
-
$( '#jump-start-deactivate' ).click(function () {
|
330 |
-
$( '.jumpstart-spinner' ).show();
|
331 |
-
|
332 |
-
data.jumpStartDeactivate = 'jump-start-deactivate';
|
333 |
-
data.action = 'jetpack_jumpstart_ajax';
|
334 |
-
|
335 |
-
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
336 |
-
//$('#jumpstart-cta').html(response);
|
337 |
-
$( '#deactivate-success' ).html( response );
|
338 |
-
$( '.jumpstart-spinner' ).hide();
|
339 |
-
window.location.hash = '';
|
340 |
-
|
341 |
-
});
|
342 |
-
|
343 |
-
return false;
|
344 |
-
});
|
345 |
-
}
|
346 |
-
|
347 |
-
/*
|
348 |
-
Handles the module activation ajax actions
|
349 |
-
*/
|
350 |
-
function adminAJAX() {
|
351 |
-
$( '.nux-in' ).on( 'keypress click', '.form-toggle', function( e ){
|
352 |
-
if ( e.which !== 13 && e.type !== 'click' ) {
|
353 |
-
return;
|
354 |
-
}
|
355 |
-
var thisElementId = e.target.id,
|
356 |
-
thisLabel = $( 'label[for="' + thisElementId + '"]' + '.plugin-action__label'),
|
357 |
-
index;
|
358 |
-
|
359 |
-
data.action = 'jetpack_admin_ajax';
|
360 |
-
data.thisModuleSlug = thisElementId.replace( 'active-', '' );
|
361 |
-
data.toggleModule = 'nux-toggle-module';
|
362 |
-
|
363 |
-
index = $( '#toggle-' + data.thisModuleSlug ).data( 'index' );
|
364 |
-
|
365 |
-
thisLabel.hide();
|
366 |
-
$( '.module-spinner-' + data.thisModuleSlug ).show();
|
367 |
-
|
368 |
-
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
369 |
-
if ( 0 !== response ) {
|
370 |
-
|
371 |
-
// Log NUX Admin event in MC Stats
|
372 |
-
if( true === response.activated ){
|
373 |
-
new Image().src = data.nuxAdminStatsURLS.enabled+','+'enabled-'+data.thisModuleSlug;
|
374 |
-
}else{
|
375 |
-
new Image().src = data.nuxAdminStatsURLS.deactivated+','+'deactivated-'+data.thisModuleSlug;
|
376 |
-
}
|
377 |
-
|
378 |
-
$( '.module-spinner-' + response.module ).hide();
|
379 |
-
|
380 |
-
// This is a hacky way around not showing the config link when activated.
|
381 |
-
response.noConfig = _.indexOf( [ 'photon', 'enhanced-distribution' ], response.module );
|
382 |
-
|
383 |
-
// Preserves the modal index so it can be rendered properly after the data has changed
|
384 |
-
response.index = index;
|
385 |
-
|
386 |
-
$( '#toggle-' + response.module ).replaceWith( wp.template( 'mod-nux' )( response ) );
|
387 |
-
|
388 |
-
// Refreshes the modal element data
|
389 |
-
_.extend( _.findWhere( modules, { module: response.module } ), response );
|
390 |
-
|
391 |
-
// Manual element alteration for Manage, since it's not part of the template
|
392 |
-
if ( 'manage' === data.thisModuleSlug ) {
|
393 |
-
if ( response.activated ) {
|
394 |
-
thisLabel.show().html( 'ACTIVE' );
|
395 |
-
$( '#manage-row' ).addClass( 'activated' );
|
396 |
-
} else {
|
397 |
-
thisLabel.show().html( 'INACTIVE' );
|
398 |
-
$( '#manage-row' ).removeClass( 'activated' );
|
399 |
-
}
|
400 |
-
|
401 |
-
$( '.manage-cta-inactive' ).toggle();
|
402 |
-
$( '.manage-cta-active' ).toggle();
|
403 |
-
return;
|
404 |
-
}
|
405 |
-
|
406 |
-
initModalEvents();
|
407 |
-
window.location.hash = 'refresh';
|
408 |
-
}
|
409 |
-
|
410 |
-
}, 'json' );
|
411 |
-
});
|
412 |
-
}
|
413 |
-
|
414 |
-
/*
|
415 |
-
This function will refresh any data elements that we've
|
416 |
-
changed via AJAX. Necessary when page is visited via back/forward
|
417 |
-
browsing.
|
418 |
-
*/
|
419 |
-
function refreshData() {
|
420 |
-
// Clean up
|
421 |
-
$( '#nux-performance-security, #nux-traffic' ).empty();
|
422 |
-
$( '#jump-start-area' ).hide();
|
423 |
-
$( '.nux-intro' ).show();
|
424 |
-
|
425 |
-
data.action = 'jetpack_admin_ajax_refresh';
|
426 |
-
data.refreshData = 'refresh';
|
427 |
-
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
428 |
-
modules = _.values( response );
|
429 |
-
loadModules( 'Performance-Security', 'mod-nux', '#nux-performance-security' );
|
430 |
-
loadModules( 'Traffic', 'mod-nux', '#nux-traffic' );
|
431 |
-
}, 'json' );
|
432 |
-
}
|
433 |
-
})( jQuery, jetpackL10n.modules, jetpackL10n.currentVersion, jetpackL10n );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jquery.inview.js
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* author Christopher Blum
|
3 |
-
* - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/
|
4 |
-
* - forked from http://github.com/zuk/jquery.inview/
|
5 |
-
*/
|
6 |
-
(function ($) {
|
7 |
-
var inviewObjects = {}, viewportSize, viewportOffset,
|
8 |
-
d = document, w = window, documentElement = d.documentElement, expando = $.expando;
|
9 |
-
|
10 |
-
$.event.special.inview = {
|
11 |
-
add: function(data) {
|
12 |
-
inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) };
|
13 |
-
},
|
14 |
-
|
15 |
-
remove: function(data) {
|
16 |
-
try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {}
|
17 |
-
}
|
18 |
-
};
|
19 |
-
|
20 |
-
function getViewportSize() {
|
21 |
-
var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth };
|
22 |
-
|
23 |
-
// if this is correct then return it. iPad has compat Mode, so will
|
24 |
-
// go into check clientHeight/clientWidth (which has the wrong value).
|
25 |
-
if (!size.height) {
|
26 |
-
mode = d.compatMode;
|
27 |
-
if (mode || !$.support.boxModel) { // IE, Gecko
|
28 |
-
domObject = mode === 'CSS1Compat' ?
|
29 |
-
documentElement : // Standards
|
30 |
-
d.body; // Quirks
|
31 |
-
size = {
|
32 |
-
height: domObject.clientHeight,
|
33 |
-
width: domObject.clientWidth
|
34 |
-
};
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
return size;
|
39 |
-
}
|
40 |
-
|
41 |
-
function getViewportOffset() {
|
42 |
-
return {
|
43 |
-
top: w.pageYOffset || documentElement.scrollTop || d.body.scrollTop,
|
44 |
-
left: w.pageXOffset || documentElement.scrollLeft || d.body.scrollLeft
|
45 |
-
};
|
46 |
-
}
|
47 |
-
|
48 |
-
function checkInView() {
|
49 |
-
var $elements = $(), elementsLength, i = 0;
|
50 |
-
|
51 |
-
$.each(inviewObjects, function(i, inviewObject) {
|
52 |
-
var selector = inviewObject.data.selector,
|
53 |
-
$element = inviewObject.$element;
|
54 |
-
$elements = $elements.add(selector ? $element.find(selector) : $element);
|
55 |
-
});
|
56 |
-
|
57 |
-
elementsLength = $elements.length;
|
58 |
-
if (elementsLength) {
|
59 |
-
viewportSize = viewportSize || getViewportSize();
|
60 |
-
viewportOffset = viewportOffset || getViewportOffset();
|
61 |
-
|
62 |
-
for (; i<elementsLength; i++) {
|
63 |
-
// Ignore elements that are not in the DOM tree
|
64 |
-
if (!$.contains(documentElement, $elements[i])) {
|
65 |
-
continue;
|
66 |
-
}
|
67 |
-
|
68 |
-
var element = $elements[i],
|
69 |
-
$element = $(element),
|
70 |
-
elementSize = {},
|
71 |
-
elementOffset = {},
|
72 |
-
inView = $element.data('inview'),
|
73 |
-
visiblePartX,
|
74 |
-
visiblePartY,
|
75 |
-
visiblePartsMerged;
|
76 |
-
|
77 |
-
// for the case where 'display:none' is used in place of 'visibility:hidden'
|
78 |
-
// count and sum the above items to get and move closer to the correct values
|
79 |
-
// IMPORTANT :: insert element into container empty
|
80 |
-
if($element.css('display') == 'none')
|
81 |
-
{
|
82 |
-
var parentElement = $element.parent();
|
83 |
-
|
84 |
-
elementOffset.top = parentElement.offset().top;
|
85 |
-
elementOffset.left = parentElement.offset().left;
|
86 |
-
elementSize.height = parentElement.height();
|
87 |
-
elementSize.width = parentElement.width();
|
88 |
-
} else {
|
89 |
-
elementSize = { height: $element.height(), width: $element.width() }
|
90 |
-
elementOffset = $element.offset();
|
91 |
-
}
|
92 |
-
|
93 |
-
// Don't ask me why because I haven't figured out yet:
|
94 |
-
// viewportOffset and viewportSize are sometimes suddenly null in Firefox 5.
|
95 |
-
// Even though it sounds weird:
|
96 |
-
// It seems that the execution of this function is interferred by the onresize/onscroll event
|
97 |
-
// where viewportOffset and viewportSize are unset
|
98 |
-
if (!viewportOffset || !viewportSize) {
|
99 |
-
return;
|
100 |
-
}
|
101 |
-
|
102 |
-
if (element.offsetWidth >= 0 && element.offsetHeight >= 0 && element.style.display != "none" &&
|
103 |
-
elementOffset.top + elementSize.height > viewportOffset.top &&
|
104 |
-
elementOffset.top < viewportOffset.top + viewportSize.height &&
|
105 |
-
elementOffset.left + elementSize.width > viewportOffset.left &&
|
106 |
-
elementOffset.left < viewportOffset.left + viewportSize.width) {
|
107 |
-
visiblePartX = (viewportOffset.left > elementOffset.left ?
|
108 |
-
'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ?
|
109 |
-
'left' : 'both');
|
110 |
-
visiblePartY = (viewportOffset.top > elementOffset.top ?
|
111 |
-
'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ?
|
112 |
-
'top' : 'both');
|
113 |
-
visiblePartsMerged = visiblePartX + "-" + visiblePartY;
|
114 |
-
if (!inView || inView !== visiblePartsMerged) {
|
115 |
-
$element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]);
|
116 |
-
}
|
117 |
-
} else if (inView) {
|
118 |
-
$element.data('inview', false).trigger('inview', [false]);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
$(w).bind("scroll resize", function() {
|
125 |
-
viewportSize = viewportOffset = null;
|
126 |
-
});
|
127 |
-
|
128 |
-
// IE < 9 scrolls to focused elements without firing the "scroll" event
|
129 |
-
if (!documentElement.addEventListener && documentElement.attachEvent) {
|
130 |
-
documentElement.attachEvent("onfocusin", function() {
|
131 |
-
viewportOffset = null;
|
132 |
-
});
|
133 |
-
}
|
134 |
-
|
135 |
-
// Use setInterval in order to also make sure this captures elements within
|
136 |
-
// "overflow:scroll" elements or elements that appeared in the dom tree due to
|
137 |
-
// dom manipulation and reflow
|
138 |
-
// old: $(window).scroll(checkInView);
|
139 |
-
//
|
140 |
-
// By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays
|
141 |
-
// intervals while the user scrolls. Therefore the inview event might fire a bit late there
|
142 |
-
setInterval(checkInView, 250);
|
143 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/jquery.jetpack-resize.js
DELETED
@@ -1,285 +0,0 @@
|
|
1 |
-
/* global Jetpack */
|
2 |
-
/**
|
3 |
-
* Resizeable Iframes.
|
4 |
-
*
|
5 |
-
* Start listening to resize postMessage events for selected iframes:
|
6 |
-
* $( selector ).Jetpack( 'resizeable' );
|
7 |
-
* - OR -
|
8 |
-
* Jetpack.resizeable( 'on', context );
|
9 |
-
*
|
10 |
-
* Resize selected iframes:
|
11 |
-
* $( selector ).Jetpack( 'resizeable', 'resize', { width: 100, height: 200 } );
|
12 |
-
* - OR -
|
13 |
-
* Jetpack.resizeable( 'resize', { width: 100, height: 200 }, context );
|
14 |
-
*
|
15 |
-
* Stop listening to resize postMessage events for selected iframes:
|
16 |
-
* $( selector ).Jetpack( 'resizeable', 'off' );
|
17 |
-
* - OR -
|
18 |
-
* Jetpack.resizeable( 'off', context );
|
19 |
-
*
|
20 |
-
* Stop listening to all resize postMessage events:
|
21 |
-
* Jetpack.resizeable( 'off' );
|
22 |
-
*/
|
23 |
-
(function($) {
|
24 |
-
var listening = false, // Are we listening for resize postMessage events
|
25 |
-
sourceOrigins = [], // What origins are allowed to send resize postMessage events
|
26 |
-
$sources = false, // What iframe elements are we tracking resize postMessage events from
|
27 |
-
|
28 |
-
URLtoOrigin, // Utility to convert URLs into origins
|
29 |
-
setupListener, // Binds global resize postMessage event handler
|
30 |
-
destroyListener, // Unbinds global resize postMessage event handler
|
31 |
-
|
32 |
-
methods; // Jetpack.resizeable methods
|
33 |
-
|
34 |
-
// Setup the Jetpack global
|
35 |
-
if ( 'undefined' === typeof window.Jetpack ) {
|
36 |
-
window.Jetpack = {
|
37 |
-
/**
|
38 |
-
* Handles the two different calling methods:
|
39 |
-
* $( selector ).Jetpack( 'namespace', 'method', context ) // here, context is optional and is used to filter the collection
|
40 |
-
* - vs. -
|
41 |
-
* Jetpack.namespace( 'method', context ) // here context defines the collection
|
42 |
-
*
|
43 |
-
* @internal
|
44 |
-
*
|
45 |
-
* Call as: Jetpack.getTarget.call( this, context )
|
46 |
-
*
|
47 |
-
* @param string context: jQuery selector
|
48 |
-
* @return jQuery|undefined object on which to perform operations or undefined when context cannot be determined
|
49 |
-
*/
|
50 |
-
getTarget: function( context ) {
|
51 |
-
if ( this instanceof jQuery ) {
|
52 |
-
return context ? this.filter( context ) : this;
|
53 |
-
}
|
54 |
-
|
55 |
-
return context ? $( context ) : context;
|
56 |
-
}
|
57 |
-
};
|
58 |
-
}
|
59 |
-
|
60 |
-
// Setup the Jetpack jQuery method
|
61 |
-
if ( 'undefined' === typeof $.fn.Jetpack ) {
|
62 |
-
/**
|
63 |
-
* Dispatches calls to the correct namespace
|
64 |
-
*
|
65 |
-
* @param string namespace
|
66 |
-
* @param ...
|
67 |
-
* @return mixed|jQuery (chainable)
|
68 |
-
*/
|
69 |
-
$.fn.Jetpack = function( namespace ) {
|
70 |
-
if ( 'function' === typeof Jetpack[namespace] ) {
|
71 |
-
// Send the call to the correct Jetpack.namespace
|
72 |
-
return Jetpack[namespace].apply( this, Array.prototype.slice.call( arguments, 1 ) );
|
73 |
-
} else {
|
74 |
-
$.error( 'Namespace "' + namespace + '" does not exist on jQuery.Jetpack' );
|
75 |
-
}
|
76 |
-
};
|
77 |
-
}
|
78 |
-
|
79 |
-
// Define Jetpack.resizeable() namespace to just always bail if no postMessage
|
80 |
-
if ( 'function' !== typeof window.postMessage ) {
|
81 |
-
$.extend( window.Jetpack, {
|
82 |
-
/**
|
83 |
-
* Defines the Jetpack.resizeable() namespace.
|
84 |
-
* See below for non-trivial definition for browsers with postMessage.
|
85 |
-
*/
|
86 |
-
resizeable: function() {
|
87 |
-
$.error( 'Browser does not support window.postMessage' );
|
88 |
-
}
|
89 |
-
} );
|
90 |
-
|
91 |
-
return;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Utility to convert URLs into origins
|
96 |
-
*
|
97 |
-
* http://example.com:port/path?query#fragment -> http://example.com:port
|
98 |
-
*
|
99 |
-
* @param string URL
|
100 |
-
* @return string origin
|
101 |
-
*/
|
102 |
-
URLtoOrigin = function( URL ) {
|
103 |
-
if ( ! URL.match( /^https?:\/\// ) ) {
|
104 |
-
URL = document.location.href;
|
105 |
-
}
|
106 |
-
return URL.split( '/' ).slice( 0, 3 ).join( '/' );
|
107 |
-
};
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Binds global resize postMessage event handler
|
111 |
-
*/
|
112 |
-
setupListener = function() {
|
113 |
-
listening = true;
|
114 |
-
|
115 |
-
$( window ).on( 'message.JetpackResizeableIframe', function( e ) {
|
116 |
-
var event = e.originalEvent,
|
117 |
-
data;
|
118 |
-
|
119 |
-
// Ensure origin is allowed
|
120 |
-
if ( -1 === $.inArray( event.origin, sourceOrigins ) ) {
|
121 |
-
return;
|
122 |
-
}
|
123 |
-
|
124 |
-
// Some browsers send structured data, some send JSON strings
|
125 |
-
if ( 'object' === typeof event.data ) {
|
126 |
-
data = event.data.data;
|
127 |
-
} else {
|
128 |
-
try {
|
129 |
-
data = JSON.parse( event.data );
|
130 |
-
} catch ( err ) {
|
131 |
-
data = false;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( !data.data ) {
|
136 |
-
return;
|
137 |
-
}
|
138 |
-
|
139 |
-
// Un-nest
|
140 |
-
data = data.data;
|
141 |
-
|
142 |
-
// Is it a resize event?
|
143 |
-
if ( 'undefined' === typeof data.action || 'resize' !== data.action ) {
|
144 |
-
return;
|
145 |
-
}
|
146 |
-
|
147 |
-
// Find the correct iframe and resize it
|
148 |
-
$sources.filter( function() {
|
149 |
-
if ( 'undefined' !== typeof data.name ) {
|
150 |
-
return this.name === data.name;
|
151 |
-
} else {
|
152 |
-
return event.source === this.contentWindow;
|
153 |
-
}
|
154 |
-
} ).first().Jetpack( 'resizeable', 'resize', data );
|
155 |
-
} );
|
156 |
-
};
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Unbinds global resize postMessage event handler
|
160 |
-
*/
|
161 |
-
destroyListener = function() {
|
162 |
-
listening = false;
|
163 |
-
$( window ).off( 'message.JetpackResizeableIframe' );
|
164 |
-
|
165 |
-
sourceOrigins = [];
|
166 |
-
$( '.jetpack-resizeable' ).removeClass( 'jetpack-resizeable' );
|
167 |
-
$sources = false;
|
168 |
-
};
|
169 |
-
|
170 |
-
// Methods for Jetpack.resizeable() namespace
|
171 |
-
methods = {
|
172 |
-
/**
|
173 |
-
* Start listening for resize postMessage events on the given iframes
|
174 |
-
*
|
175 |
-
* Call statically as: Jetpack.resizeable( 'on', context )
|
176 |
-
* Call as: $( selector ).Jetpack( 'resizeable', 'on', context ) // context optional: used to filter the collectino
|
177 |
-
*
|
178 |
-
* @param string context jQuery selector.
|
179 |
-
* @return jQuery (chainable)
|
180 |
-
*/
|
181 |
-
on: function( context ) {
|
182 |
-
var target = Jetpack.getTarget.call( this, context );
|
183 |
-
|
184 |
-
if ( ! listening ) {
|
185 |
-
setupListener();
|
186 |
-
}
|
187 |
-
|
188 |
-
target.each( function() {
|
189 |
-
sourceOrigins.push( URLtoOrigin( $( this ).attr( 'src' ) ) );
|
190 |
-
} ).addClass( 'jetpack-resizeable' );
|
191 |
-
|
192 |
-
$sources = $( '.jetpack-resizeable' );
|
193 |
-
|
194 |
-
return target;
|
195 |
-
},
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Stop listening for resize postMessage events on the given iframes
|
199 |
-
*
|
200 |
-
* Call statically as: Jetpack.resizeable( 'off', context )
|
201 |
-
* Call as: $( selector ).Jetpack( 'resizeable', 'off', context ) // context optional: used to filter the collectino
|
202 |
-
*
|
203 |
-
* @param string context jQuery selector
|
204 |
-
* @return jQuery (chainable)
|
205 |
-
*/
|
206 |
-
off: function( context ) {
|
207 |
-
var target = Jetpack.getTarget.call( this, context );
|
208 |
-
|
209 |
-
if ( 'undefined' === typeof target ) {
|
210 |
-
destroyListener();
|
211 |
-
|
212 |
-
return target;
|
213 |
-
}
|
214 |
-
|
215 |
-
target.each( function() {
|
216 |
-
var origin = URLtoOrigin( $( this ).attr( 'src' ) ),
|
217 |
-
pos = $.inArray( origin, sourceOrigins );
|
218 |
-
|
219 |
-
if ( -1 !== pos ) {
|
220 |
-
sourceOrigins.splice( pos, 1 );
|
221 |
-
}
|
222 |
-
} ).removeClass( 'jetpack-resizeable' );
|
223 |
-
|
224 |
-
$sources = $( '.jetpack-resizeable' );
|
225 |
-
|
226 |
-
return target;
|
227 |
-
},
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Resize the given iframes
|
231 |
-
*
|
232 |
-
* Call statically as: Jetpack.resizeable( 'resize', dimensions, context )
|
233 |
-
* Call as: $( selector ).Jetpack( 'resizeable', 'resize', dimensions, context ) // context optional: used to filter the collectino
|
234 |
-
*
|
235 |
-
* @param object dimensions in pixels: { width: (int), height: (int) }
|
236 |
-
* @param string context jQuery selector
|
237 |
-
* @return jQuery (chainable)
|
238 |
-
*/
|
239 |
-
resize: function( dimensions, context ) {
|
240 |
-
var target = Jetpack.getTarget.call( this, context );
|
241 |
-
|
242 |
-
$.each( [ 'width', 'height' ], function( i, variable ) {
|
243 |
-
var value = 0,
|
244 |
-
container;
|
245 |
-
if ( 'undefined' !== typeof dimensions[variable] ) {
|
246 |
-
value = parseInt( dimensions[variable], 10 );
|
247 |
-
}
|
248 |
-
|
249 |
-
if ( 0 !== value ) {
|
250 |
-
target[variable]( value );
|
251 |
-
container = target.parent();
|
252 |
-
if ( container.hasClass( 'slim-likes-widget' ) ) {
|
253 |
-
container[variable]( value );
|
254 |
-
}
|
255 |
-
}
|
256 |
-
} );
|
257 |
-
|
258 |
-
return target;
|
259 |
-
}
|
260 |
-
};
|
261 |
-
|
262 |
-
// Define Jetpack.resizeable() namespace
|
263 |
-
$.extend( window.Jetpack, {
|
264 |
-
/**
|
265 |
-
* Defines the Jetpack.resizeable() namespace.
|
266 |
-
* See above for trivial definition for browsers with no postMessage.
|
267 |
-
*
|
268 |
-
* @param string method
|
269 |
-
* @param ...
|
270 |
-
* @return mixed|jQuery (chainable)
|
271 |
-
*/
|
272 |
-
resizeable: function( method ) {
|
273 |
-
if ( methods[method] ) {
|
274 |
-
// Send the call to the correct Jetpack.resizeable() method
|
275 |
-
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) );
|
276 |
-
} else if ( ! method ) {
|
277 |
-
// By default, send to Jetpack.resizeable( 'on' ), which isn't useful in that form but is when called as
|
278 |
-
// jQuery( selector ).Jetpack( 'resizeable' )
|
279 |
-
return methods.on.apply( this );
|
280 |
-
} else {
|
281 |
-
$.error( 'Method ' + method + ' does not exist on Jetpack.resizeable' );
|
282 |
-
}
|
283 |
-
}
|
284 |
-
} );
|
285 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_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/jquery.spin.js
CHANGED
@@ -1,104 +1,86 @@
|
|
1 |
-
|
2 |
-
*
|
3 |
-
*
|
|
|
4 |
*/
|
5 |
|
6 |
/*
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$(
|
12 |
-
$(
|
13 |
-
|
14 |
-
$(
|
15 |
-
|
16 |
-
|
17 |
-
==============
|
18 |
-
|
19 |
-
$('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el.
|
20 |
-
$('#el').spin('large', '#fff'); // Creates a 'large' white Spinner.
|
21 |
-
|
22 |
-
Adding a custom preset:
|
23 |
-
=======================
|
24 |
-
|
25 |
-
$.fn.spin.presets.flower = {
|
26 |
-
lines: 9
|
27 |
-
length: 10
|
28 |
-
width: 20
|
29 |
-
radius: 0
|
30 |
-
}
|
31 |
-
|
32 |
-
$('#el').spin('flower', 'red');
|
33 |
-
|
34 |
*/
|
35 |
|
36 |
-
(function(
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
$.fn.spin.presets['large-right'] = $.extend( { right: 5 }, $.fn.spin.presets.large );
|
104 |
-
})(jQuery);
|
1 |
+
/*
|
2 |
+
* Matt Husby https://github.com/matthusby/spin.js
|
3 |
+
* Based on the jquery plugin by Bradley Smith
|
4 |
+
* https://gist.github.com/1290439
|
5 |
*/
|
6 |
|
7 |
/*
|
8 |
+
Add spin to the jQuery object
|
9 |
+
If color is not passed the spinner will be black
|
10 |
+
You can now create a spinner using any of the variants below:
|
11 |
+
$("#el").spin(); // Produces default Spinner
|
12 |
+
$("#el").spin("small"); // Produces a 'small' Spinner
|
13 |
+
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
|
14 |
+
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
|
15 |
+
$("#el").spin("small-right"); // Pin the small spinner to the right edge
|
16 |
+
$("#el").spin("{small, medium, large}-{left, right, top, bottom}"); // All options for where to pin
|
17 |
+
$("#el").spin(false); // Kills the spinner.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
*/
|
19 |
|
20 |
+
( function( $ ) {
|
21 |
+
$.fn.spin = function( opts, color ) {
|
22 |
+
var presets = {
|
23 |
+
"small": { lines: 8, length: 2, width: 2, radius: 3, trail: 60, speed: 1.3 },
|
24 |
+
"medium": { lines: 8, length: 4, width: 3, radius: 5, trail: 60, speed: 1.3 },
|
25 |
+
"large": { lines: 10, length: 6, width: 4, radius: 7, trail: 60, speed: 1.3 }
|
26 |
+
};
|
27 |
+
if ( Spinner ) {
|
28 |
+
return this.each( function() {
|
29 |
+
var $this = $( this ),
|
30 |
+
data = $this.data();
|
31 |
+
|
32 |
+
if ( data.spinner ) {
|
33 |
+
data.spinner.stop();
|
34 |
+
delete data.spinner;
|
35 |
+
}
|
36 |
+
if ( opts !== false ) {
|
37 |
+
var spinner_options;
|
38 |
+
if ( typeof opts === "string" ) {
|
39 |
+
var spinner_base = opts.indexOf( '-' );
|
40 |
+
if( spinner_base == -1 ) {
|
41 |
+
spinner_base = opts;
|
42 |
+
} else {
|
43 |
+
spinner_base = opts.substring( 0, spinner_base );
|
44 |
+
}
|
45 |
+
if ( spinner_base in presets ) {
|
46 |
+
spinner_options = presets[spinner_base];
|
47 |
+
} else {
|
48 |
+
spinner_options = {};
|
49 |
+
}
|
50 |
+
var padding;
|
51 |
+
if ( opts.indexOf( "-right" ) != -1 ) {
|
52 |
+
padding = jQuery( this ).css( 'padding-left' );
|
53 |
+
if( typeof padding === "undefined" ) {
|
54 |
+
padding = 0;
|
55 |
+
} else {
|
56 |
+
padding = padding.replace( 'px', '' );
|
57 |
+
}
|
58 |
+
spinner_options.left = jQuery( this ).outerWidth() - ( 2 * ( spinner_options.length + spinner_options.width + spinner_options.radius ) ) - padding - 5;
|
59 |
+
}
|
60 |
+
if ( opts.indexOf( '-left' ) != -1 ) {
|
61 |
+
spinner_options.left = 5;
|
62 |
+
}
|
63 |
+
if ( opts.indexOf( '-top' ) != -1 ) {
|
64 |
+
spinner_options.top = 5;
|
65 |
+
}
|
66 |
+
if ( opts.indexOf( '-bottom' ) != -1 ) {
|
67 |
+
padding = jQuery( this ).css( 'padding-top' );
|
68 |
+
if( typeof padding === "undefined" ) {
|
69 |
+
padding = 0;
|
70 |
+
} else {
|
71 |
+
padding = padding.replace( 'px', '' );
|
72 |
+
}
|
73 |
+
spinner_options.top = jQuery( this ).outerHeight() - ( 2 * ( spinner_options.length + spinner_options.width + spinner_options.radius ) ) - padding - 5;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
if( color ){
|
77 |
+
spinner_options.color = color;
|
78 |
+
}
|
79 |
+
data.spinner = new Spinner( spinner_options ).spin( this );
|
80 |
+
}
|
81 |
+
});
|
82 |
+
} else {
|
83 |
+
throw "Spinner class not available.";
|
84 |
+
}
|
85 |
+
};
|
86 |
+
})( jQuery );
|
|
|
|
_inc/lib/admin-pages/class.jetpack-admin-page.php
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Shared logic between Jetpack admin pages
|
4 |
-
abstract class Jetpack_Admin_Page {
|
5 |
-
// Add page specific actions given the page hook
|
6 |
-
abstract function add_page_actions( $hook );
|
7 |
-
|
8 |
-
// Create a menu item for the page and returns the hook
|
9 |
-
abstract function get_page_hook();
|
10 |
-
|
11 |
-
// Enqueue and localize page specific scripts
|
12 |
-
abstract function page_admin_scripts();
|
13 |
-
|
14 |
-
// Render page specific HTML
|
15 |
-
abstract function page_render();
|
16 |
-
|
17 |
-
function __construct() {
|
18 |
-
$this->jetpack = Jetpack::init();
|
19 |
-
}
|
20 |
-
|
21 |
-
function add_actions() {
|
22 |
-
/**
|
23 |
-
* Don't add in the modules page unless modules are available!
|
24 |
-
*/
|
25 |
-
if ( $this->dont_show_if_not_active && ! Jetpack::is_active() && ! Jetpack::is_development_mode() ) {
|
26 |
-
return;
|
27 |
-
}
|
28 |
-
|
29 |
-
// Initialize menu item for the page in the admin
|
30 |
-
$hook = $this->get_page_hook();
|
31 |
-
|
32 |
-
// Attach hooks common to all Jetpack admin pages based on the created
|
33 |
-
// hook
|
34 |
-
add_action( "load-$hook", array( $this, 'admin_help' ) );
|
35 |
-
add_action( "load-$hook", array( $this, 'admin_page_load' ) );
|
36 |
-
add_action( "admin_head-$hook", array( $this, 'admin_head' ) );
|
37 |
-
|
38 |
-
add_action( "admin_footer-$hook", array( $this, 'module_modal_js_template' ) );
|
39 |
-
|
40 |
-
add_action( "admin_print_styles-$hook", array( $this, 'admin_styles' ) );
|
41 |
-
add_action( "admin_print_scripts-$hook", array( $this, 'admin_scripts' ) );
|
42 |
-
|
43 |
-
// Attach page specific actions in addition to the above
|
44 |
-
$this->add_page_actions( $hook );
|
45 |
-
}
|
46 |
-
|
47 |
-
function admin_head() {
|
48 |
-
if ( isset( $_GET['configure'] ) && Jetpack::is_module( $_GET['configure'] ) && current_user_can( 'manage_options' ) ) {
|
49 |
-
/**
|
50 |
-
* Fires in the <head> of a particular Jetpack configuation page.
|
51 |
-
*
|
52 |
-
* The dynamic portion of the hook name, `$_GET['configure']`,
|
53 |
-
* refers to the slug of module, such as 'stats', 'sso', etc.
|
54 |
-
* A complete hook for the latter would be
|
55 |
-
* 'jetpack_module_configuation_head_sso'.
|
56 |
-
*
|
57 |
-
* @since 3.0.0
|
58 |
-
*/
|
59 |
-
do_action( 'jetpack_module_configuration_head_' . $_GET['configure'] );
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
// Render the page with a common top and bottom part, and page specific
|
64 |
-
// content
|
65 |
-
function render() {
|
66 |
-
$this->admin_page_top();
|
67 |
-
$this->page_render();
|
68 |
-
$this->admin_page_bottom();
|
69 |
-
}
|
70 |
-
|
71 |
-
function admin_help() {
|
72 |
-
$this->jetpack->admin_help();
|
73 |
-
}
|
74 |
-
|
75 |
-
function admin_page_load() {
|
76 |
-
// This is big. For the moment, just call the existing one.
|
77 |
-
$this->jetpack->admin_page_load();
|
78 |
-
}
|
79 |
-
|
80 |
-
// Load underscore template for the landing page and settings page modal
|
81 |
-
function module_modal_js_template() {
|
82 |
-
Jetpack::init()->load_view( 'admin/module-modal-template.php' );
|
83 |
-
}
|
84 |
-
|
85 |
-
function admin_page_top() {
|
86 |
-
include_once( JETPACK__PLUGIN_DIR . '_inc/header.php' );
|
87 |
-
}
|
88 |
-
|
89 |
-
function admin_page_bottom() {
|
90 |
-
include_once( JETPACK__PLUGIN_DIR . '_inc/footer.php' );
|
91 |
-
}
|
92 |
-
|
93 |
-
// Add page specific scripts and jetpack stats for all menu pages
|
94 |
-
function admin_scripts() {
|
95 |
-
$this->page_admin_scripts(); // Delegate to inheriting class
|
96 |
-
add_action( 'admin_footer', array( $this->jetpack, 'do_stats' ) );
|
97 |
-
}
|
98 |
-
|
99 |
-
// Enqueue the Jetpack admin stylesheet
|
100 |
-
function admin_styles() {
|
101 |
-
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
102 |
-
|
103 |
-
wp_enqueue_style( 'jetpack-google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,400,700,600,800' );
|
104 |
-
|
105 |
-
wp_enqueue_style( 'jetpack-admin', plugins_url( "css/jetpack-admin{$min}.css", JETPACK__PLUGIN_FILE ), array( 'genericons' ), JETPACK__VERSION . '-20121016' );
|
106 |
-
wp_style_add_data( 'jetpack-admin', 'rtl', 'replace' );
|
107 |
-
wp_style_add_data( 'jetpack-admin', 'suffix', $min );
|
108 |
-
}
|
109 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/admin-pages/class.jetpack-landing-page.php
DELETED
@@ -1,299 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
include_once( 'class.jetpack-admin-page.php' );
|
3 |
-
|
4 |
-
// Builds the landing page and its menu
|
5 |
-
class Jetpack_Landing_Page extends Jetpack_Admin_Page {
|
6 |
-
protected $dont_show_if_not_active = false;
|
7 |
-
|
8 |
-
function get_page_hook() {
|
9 |
-
$title = _x( 'Jetpack', 'The menu item label', 'jetpack' );
|
10 |
-
|
11 |
-
list( $jetpack_version ) = explode( ':', Jetpack_Options::get_option( 'version' ) );
|
12 |
-
if (
|
13 |
-
$jetpack_version
|
14 |
-
&&
|
15 |
-
$jetpack_version != JETPACK__VERSION
|
16 |
-
&&
|
17 |
-
( $new_modules = Jetpack::get_default_modules( $jetpack_version, JETPACK__VERSION ) )
|
18 |
-
&&
|
19 |
-
is_array( $new_modules )
|
20 |
-
&&
|
21 |
-
( $new_modules_count = count( $new_modules ) )
|
22 |
-
&&
|
23 |
-
( Jetpack::is_active() || Jetpack::is_development_mode() )
|
24 |
-
) {
|
25 |
-
$new_count_i18n = number_format_i18n( $new_modules_count );
|
26 |
-
$span_title = esc_attr( sprintf( _n( 'One New Jetpack Module', '%s New Jetpack Modules', $new_modules_count, 'jetpack' ), $new_count_i18n ) );
|
27 |
-
$format = _x( 'Jetpack %s', 'The menu item label with a new module count as %s', 'jetpack' );
|
28 |
-
$update_markup = "<span class='update-plugins count-{$new_modules_count}' title='$span_title'><span class='update-count'>$new_count_i18n</span></span>";
|
29 |
-
$title = sprintf( $format, $update_markup );
|
30 |
-
}
|
31 |
-
|
32 |
-
// Add the main admin Jetpack menu with possible information about new
|
33 |
-
// modules
|
34 |
-
add_menu_page( 'Jetpack', $title, 'jetpack_admin_page', 'jetpack', array( $this, 'render' ), 'div' );
|
35 |
-
// also create the submenu
|
36 |
-
return add_submenu_page( 'jetpack', $title, $title, 'jetpack_admin_page', 'jetpack' );
|
37 |
-
}
|
38 |
-
|
39 |
-
function add_page_actions( $hook ) {
|
40 |
-
// Add landing page specific underscore templates
|
41 |
-
/**
|
42 |
-
* Filters the js_templates callback value
|
43 |
-
*
|
44 |
-
* @since 3.6.0
|
45 |
-
*
|
46 |
-
* @param array array( $this, 'js_templates' ) js_templates callback.
|
47 |
-
* @param string $hook Specific admin page.
|
48 |
-
*/
|
49 |
-
add_action( "admin_footer-$hook", apply_filters( 'jetpack_landing_page_js_templates_callback', array( $this, 'js_templates' ), $hook ) );
|
50 |
-
/** This action is documented in class.jetpack.php */
|
51 |
-
do_action( 'jetpack_admin_menu', $hook );
|
52 |
-
|
53 |
-
// Place the Jetpack menu item on top and others in the order they
|
54 |
-
// appear
|
55 |
-
add_filter( 'custom_menu_order', '__return_true' );
|
56 |
-
add_filter( 'menu_order', array( $this, 'jetpack_menu_order' ) );
|
57 |
-
|
58 |
-
add_action( 'jetpack_notices_update_settings', array( $this, 'show_notices_update_settings' ), 10, 1 );
|
59 |
-
}
|
60 |
-
|
61 |
-
/*
|
62 |
-
* Build an array of a specific module tag.
|
63 |
-
*
|
64 |
-
* @param string Name of the module tag
|
65 |
-
* @return array The module slug, config url, and name of each Jump Start module
|
66 |
-
*/
|
67 |
-
function jumpstart_module_tag( $tag ) {
|
68 |
-
$modules = Jetpack_Admin::init()->get_modules();
|
69 |
-
|
70 |
-
$module_info = array();
|
71 |
-
foreach ( $modules as $module => $value ) {
|
72 |
-
if ( in_array( $tag, $value['feature'] ) ) {
|
73 |
-
$module_info[] = array(
|
74 |
-
'module_slug' => $value['module'],
|
75 |
-
'module_name' => $value['name'],
|
76 |
-
'configure_url' => $value['configure_url'],
|
77 |
-
);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
return $module_info;
|
81 |
-
}
|
82 |
-
|
83 |
-
/*
|
84 |
-
* Only show Jump Start on first activation.
|
85 |
-
* Any option 'jumpstart' other than 'new connection' will hide it.
|
86 |
-
*
|
87 |
-
* The option can be of 4 things, and will be stored as such:
|
88 |
-
* new_connection : Brand new connection - Show
|
89 |
-
* jumpstart_activated : Jump Start has been activated - dismiss
|
90 |
-
* jetpack_action_taken: Manual activation of a module already happened - dismiss
|
91 |
-
* jumpstart_dismissed : Manual dismissal of Jump Start - dismiss
|
92 |
-
*
|
93 |
-
* @return bool | show or hide
|
94 |
-
*/
|
95 |
-
function jetpack_show_jumpstart() {
|
96 |
-
$jumpstart_option = Jetpack_Options::get_option( 'jumpstart' );
|
97 |
-
|
98 |
-
$hide_options = array(
|
99 |
-
'jumpstart_activated',
|
100 |
-
'jetpack_action_taken',
|
101 |
-
'jumpstart_dismissed'
|
102 |
-
);
|
103 |
-
|
104 |
-
if ( ! $jumpstart_option || in_array( $jumpstart_option, $hide_options ) ) {
|
105 |
-
return false;
|
106 |
-
}
|
107 |
-
|
108 |
-
return true;
|
109 |
-
}
|
110 |
-
|
111 |
-
/*
|
112 |
-
* List of recommended modules for the Jump Start paragraph text.
|
113 |
-
* Will only show up in the paragraph if they are not active.
|
114 |
-
*
|
115 |
-
* @return string | comma-separated recommended modules that are not active
|
116 |
-
*/
|
117 |
-
function jumpstart_list_modules() {
|
118 |
-
$jumpstart_recommended = $this->jumpstart_module_tag( 'Jumpstart' );
|
119 |
-
|
120 |
-
$module_name = array();
|
121 |
-
foreach ( $jumpstart_recommended as $module => $val ) {
|
122 |
-
if ( ! Jetpack::is_module_active( $val['module_slug'] ) ) {
|
123 |
-
$module_name[] = $val['module_name'];
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
return $module_name;
|
128 |
-
}
|
129 |
-
|
130 |
-
function jetpack_menu_order( $menu_order ) {
|
131 |
-
$jp_menu_order = array();
|
132 |
-
|
133 |
-
foreach ( $menu_order as $index => $item ) {
|
134 |
-
if ( $item != 'jetpack' )
|
135 |
-
$jp_menu_order[] = $item;
|
136 |
-
|
137 |
-
if ( $index == 0 )
|
138 |
-
$jp_menu_order[] = 'jetpack';
|
139 |
-
}
|
140 |
-
|
141 |
-
return $jp_menu_order;
|
142 |
-
}
|
143 |
-
|
144 |
-
function js_templates() {
|
145 |
-
Jetpack::init()->load_view( 'admin/landing-page-templates.php' );
|
146 |
-
}
|
147 |
-
|
148 |
-
function page_render() {
|
149 |
-
// Handle redirects to configuration pages
|
150 |
-
if ( ! empty( $_GET['configure'] ) ) {
|
151 |
-
return $this->render_nojs_configurable();
|
152 |
-
}
|
153 |
-
|
154 |
-
global $current_user;
|
155 |
-
|
156 |
-
$is_connected = Jetpack::is_active();
|
157 |
-
$user_token = Jetpack_Data::get_access_token( $current_user->ID );
|
158 |
-
$is_user_connected = $user_token && ! is_wp_error( $user_token );
|
159 |
-
$is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' );
|
160 |
-
|
161 |
-
if ( Jetpack::is_development_mode() ) {
|
162 |
-
$is_connected = true;
|
163 |
-
$is_user_connected = true;
|
164 |
-
$is_master_user = false;
|
165 |
-
}
|
166 |
-
|
167 |
-
// Set template data for the admin page template
|
168 |
-
$data = array(
|
169 |
-
'is_connected' => $is_connected,
|
170 |
-
'is_user_connected' => $is_user_connected,
|
171 |
-
'is_master_user' => $is_master_user,
|
172 |
-
'show_jumpstart' => $this->jetpack_show_jumpstart(),
|
173 |
-
'jumpstart_list' => $this->jumpstart_list_modules(),
|
174 |
-
'recommended_list' => $this->jumpstart_module_tag( 'Recommended' ),
|
175 |
-
);
|
176 |
-
Jetpack::init()->load_view( 'admin/admin-page.php', $data );
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Shows a notice message to users after they save Module config settings
|
181 |
-
* @param string $module_id
|
182 |
-
* @return null
|
183 |
-
*/
|
184 |
-
function show_notices_update_settings( $module_id ) {
|
185 |
-
$state = Jetpack::state( 'message' );
|
186 |
-
|
187 |
-
switch( $state ) {
|
188 |
-
case 'module_activated' :
|
189 |
-
if ( $module = Jetpack::get_module( Jetpack::state( 'module' ) ) ) {
|
190 |
-
$message = sprintf( __( '<strong>%s Activated!</strong> You can change the setting of it here.', 'jetpack' ), $module['name'] );
|
191 |
-
}
|
192 |
-
break;
|
193 |
-
case 'module_configured':
|
194 |
-
$message = __( '<strong>Module settings were saved.</strong> ', 'jetpack' );
|
195 |
-
break;
|
196 |
-
case 'no_message' :
|
197 |
-
break;
|
198 |
-
}
|
199 |
-
|
200 |
-
if ( isset( $message ) ) {
|
201 |
-
?>
|
202 |
-
<div id="message" class="jetpack-message">
|
203 |
-
<div class="squeezer">
|
204 |
-
<h2><?php echo wp_kses( $message, array( 'strong' => array(), 'a' => array( 'href' => true ), 'br' => true ) ); ?></h2>
|
205 |
-
<?php
|
206 |
-
/**
|
207 |
-
* Fires within the displayed message when a feature configuation is updated.
|
208 |
-
*
|
209 |
-
* This is a dynamic hook with `$module_id` being the slug of the module being updated.
|
210 |
-
*
|
211 |
-
* @since 3.4.0
|
212 |
-
*/
|
213 |
-
do_action( 'jetpack_notices_update_settings_' . $module_id ); ?>
|
214 |
-
</div>
|
215 |
-
</div>
|
216 |
-
<?php
|
217 |
-
}
|
218 |
-
add_action( 'jetpack_notices', array( Jetpack::init(), 'admin_notices' ) );
|
219 |
-
}
|
220 |
-
|
221 |
-
// Render the configuration page for the module if it exists and an error
|
222 |
-
// screen if the module is not configurable
|
223 |
-
function render_nojs_configurable() {
|
224 |
-
echo '<div class="clouds-sm"></div>';
|
225 |
-
echo '<div class="wrap configure-module">';
|
226 |
-
|
227 |
-
$module_name = preg_replace( '/[^\da-z\-]+/', '', $_GET['configure'] );
|
228 |
-
if ( Jetpack::is_module( $module_name ) && current_user_can( 'jetpack_configure_modules' ) ) {
|
229 |
-
Jetpack::admin_screen_configure_module( $module_name );
|
230 |
-
} else {
|
231 |
-
echo '<h2>' . esc_html__( 'Error, bad module.', 'jetpack' ) . '</h2>';
|
232 |
-
}
|
233 |
-
|
234 |
-
echo '</div><!-- /wrap -->';
|
235 |
-
}
|
236 |
-
|
237 |
-
/*
|
238 |
-
* Build an array of Jump Start stats urls.
|
239 |
-
* requires the build URL args passed as an array
|
240 |
-
*
|
241 |
-
* @param array $jumpstart_stats
|
242 |
-
* @return (array) of built stats urls
|
243 |
-
*/
|
244 |
-
function build_jumpstart_stats_urls( $jumpstart_stats ) {
|
245 |
-
$jumpstart_urls = array();
|
246 |
-
|
247 |
-
foreach ( $jumpstart_stats as $value) {
|
248 |
-
$jumpstart_urls[$value] = Jetpack::build_stats_url( array( 'x_jetpack-jumpstart' => $value ) );
|
249 |
-
}
|
250 |
-
|
251 |
-
return $jumpstart_urls;
|
252 |
-
|
253 |
-
}
|
254 |
-
|
255 |
-
/*
|
256 |
-
* Build an array of NUX admin stats urls.
|
257 |
-
* requires the build URL args passed as an array
|
258 |
-
*
|
259 |
-
* @param array $nux_admin_stats
|
260 |
-
* @return (array) of built stats urls
|
261 |
-
*/
|
262 |
-
function build_nux_admin_stats_urls( $nux_admin_stats ) {
|
263 |
-
$nux_admin_urls = array();
|
264 |
-
|
265 |
-
foreach ( $nux_admin_stats as $value) {
|
266 |
-
$nux_admin_urls[ $value ] = Jetpack::build_stats_url( array( 'x_jetpack-nux' => $value ) );
|
267 |
-
}
|
268 |
-
|
269 |
-
return $nux_admin_urls;
|
270 |
-
|
271 |
-
}
|
272 |
-
|
273 |
-
function page_admin_scripts() {
|
274 |
-
// Enqueue jp.js and localize it
|
275 |
-
wp_enqueue_script( 'jetpack-js', plugins_url( '_inc/jp.js', JETPACK__PLUGIN_FILE ),
|
276 |
-
array( 'jquery', 'wp-util' ), JETPACK__VERSION . '-20121111' );
|
277 |
-
wp_localize_script(
|
278 |
-
'jetpack-js',
|
279 |
-
'jetpackL10n',
|
280 |
-
array(
|
281 |
-
'ays_disconnect' => __( "This will deactivate all Jetpack modules.\nAre you sure you want to disconnect?", 'jetpack' ),
|
282 |
-
'ays_unlink' => __( "This will prevent user-specific modules such as Publicize, Notifications and Post By Email from working.\nAre you sure you want to unlink?", 'jetpack' ),
|
283 |
-
'ays_dismiss' => __( "This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?", 'jetpack' ),
|
284 |
-
'view_all_features' => __( 'View all Jetpack features', 'jetpack' ),
|
285 |
-
'no_modules_found' => sprintf( __( 'Sorry, no modules were found for the search term "%s"', 'jetpack' ), '{term}' ),
|
286 |
-
'modules' => Jetpack::get_translated_modules( array_values( Jetpack_Admin::init()->get_modules() ) ),
|
287 |
-
'currentVersion' => JETPACK__VERSION,
|
288 |
-
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
289 |
-
'jumpstart_modules' => $this->jumpstart_module_tag( 'Jumpstart' ),
|
290 |
-
'show_jumpstart' => $this->jetpack_show_jumpstart(),
|
291 |
-
'activate_nonce' => wp_create_nonce( 'jetpack-jumpstart-nonce' ),
|
292 |
-
'admin_nonce' => wp_create_nonce( 'jetpack-admin-nonce' ),
|
293 |
-
'jumpstart_stats_urls' => $this->build_jumpstart_stats_urls( array( 'dismiss', 'jumpstarted', 'learnmore', 'viewed', 'manual' ) ),
|
294 |
-
'admin_stats_urls' => $this->build_nux_admin_stats_urls( array( 'enabled', 'deactivated', 'learnmore' ) ),
|
295 |
-
'site_url_manage' => Jetpack::build_raw_urls( get_site_url() ),
|
296 |
-
)
|
297 |
-
);
|
298 |
-
}
|
299 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/admin-pages/class.jetpack-my-jetpack-page.php
DELETED
@@ -1,187 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
include_once( 'class.jetpack-admin-page.php' );
|
3 |
-
include_once( JETPACK__PLUGIN_DIR . 'class.jetpack-modules-list-table.php' );
|
4 |
-
|
5 |
-
// Builds the My Jetpack page
|
6 |
-
class Jetpack_My_Jetpack_Page extends Jetpack_Admin_Page {
|
7 |
-
// Show the settings page only when Jetpack is connected or in dev mode
|
8 |
-
protected $dont_show_if_not_active = true;
|
9 |
-
function add_page_actions( $hook ) {} // There are no page specific actions to attach to the menu
|
10 |
-
|
11 |
-
// Adds the My Jetpack page, but hides it from the submenu
|
12 |
-
function get_page_hook() {
|
13 |
-
return add_submenu_page( null, __( 'My Jetpack', 'jetpack' ), __( 'My Jetpack', 'jetpack' ), 'jetpack_connect_user', 'my_jetpack', array( $this, 'render' ) );
|
14 |
-
}
|
15 |
-
|
16 |
-
// Renders the view file
|
17 |
-
function page_render() {
|
18 |
-
Jetpack::init()->load_view( 'admin/my-jetpack-page.php' );
|
19 |
-
|
20 |
-
//My Jetpack view tracking, send to MC Stats
|
21 |
-
Jetpack::init()->stat( 'admin', 'my-jetpack' );
|
22 |
-
Jetpack::init()->do_stats( 'server_side' );
|
23 |
-
|
24 |
-
}
|
25 |
-
|
26 |
-
/*
|
27 |
-
* Handle the change in master user
|
28 |
-
*/
|
29 |
-
function jetpack_my_jetpack_change_user() {
|
30 |
-
if ( ! isset( $_POST['_my_jetpack_nonce'] ) || ! wp_verify_nonce( $_POST['_my_jetpack_nonce'], 'jetpack_change_primary_user' ) ) {
|
31 |
-
wp_die( __( 'Failed permissions, please try again.', 'jetpack' ) );
|
32 |
-
exit;
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( isset( $_POST['jetpack-new-master'] ) ) {
|
36 |
-
$old_master_user = Jetpack_Options::get_option( 'master_user' );
|
37 |
-
$new_master_user = $_POST['jetpack-new-master'];
|
38 |
-
$user_token = Jetpack_Data::get_access_token( $new_master_user );
|
39 |
-
$is_user_connected = $user_token && ! is_wp_error( $user_token );
|
40 |
-
if ( current_user_can( 'manage_options' ) && $is_user_connected ) {
|
41 |
-
Jetpack::log( 'switch_master_user', array( 'old_master' => $old_master_user, 'new_master' => $new_master_user ) );
|
42 |
-
Jetpack_Options::update_option( 'master_user', $new_master_user );
|
43 |
-
Jetpack::state( 'message', 'switch_master' );
|
44 |
-
|
45 |
-
//My Jetpack primary user successfully changed, send to MC Stats
|
46 |
-
Jetpack::init()->stat( 'admin', 'change-primary-successful' );
|
47 |
-
Jetpack::init()->do_stats( 'server_side' );
|
48 |
-
|
49 |
-
// Change the blog owner dotcom side
|
50 |
-
$this->wpcom_switch_blog_owner( $new_master_user );
|
51 |
-
}
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
/*
|
56 |
-
* Tell wpcom that the master user has switched
|
57 |
-
* so we can update the 'wpcom_blog_owner'
|
58 |
-
*/
|
59 |
-
function wpcom_switch_blog_owner( $new_master ) {
|
60 |
-
$request = array(
|
61 |
-
'new_blog_owner' => $new_master
|
62 |
-
);
|
63 |
-
|
64 |
-
// Tell wpcom about the change
|
65 |
-
Jetpack::load_xml_rpc_client();
|
66 |
-
$xml = new Jetpack_IXR_Client( array(
|
67 |
-
'user_id' => get_current_user_id(),
|
68 |
-
) );
|
69 |
-
|
70 |
-
$xml->query( 'jetpack.switchBlogOwner', $request );
|
71 |
-
}
|
72 |
-
|
73 |
-
/*
|
74 |
-
* Checks to see if there are any other users available to become primary
|
75 |
-
* Users must both:
|
76 |
-
* - Be linked to wpcom
|
77 |
-
* - Be an admin
|
78 |
-
*
|
79 |
-
* @return bool
|
80 |
-
*/
|
81 |
-
function jetpack_are_other_users_linked_and_admin() {
|
82 |
-
// If only one admin
|
83 |
-
$all_users = count_users();
|
84 |
-
if ( 2 > $all_users['avail_roles']['administrator'] ) {
|
85 |
-
return false;
|
86 |
-
}
|
87 |
-
|
88 |
-
$users = get_users();
|
89 |
-
$available = array();
|
90 |
-
// If no one else is linked to dotcom
|
91 |
-
foreach ( $users as $user ) {
|
92 |
-
if ( isset( $user->caps['administrator'] ) && Jetpack::is_user_connected( $user->ID ) ) {
|
93 |
-
$available[] = $user->ID;
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
if ( 2 > count( $available ) ) {
|
98 |
-
return false;
|
99 |
-
}
|
100 |
-
|
101 |
-
return true;
|
102 |
-
}
|
103 |
-
|
104 |
-
/*
|
105 |
-
* All the data we'll need about the Master User
|
106 |
-
* for the My Jetpack page template
|
107 |
-
*
|
108 |
-
* @return array
|
109 |
-
*/
|
110 |
-
function jetpack_master_user_data() {
|
111 |
-
// If the master user has disappeared, none of this is useful.
|
112 |
-
// @todo throw up a warning and offer a solution
|
113 |
-
$master = Jetpack_Options::get_option( 'master_user' );
|
114 |
-
if ( ! get_user_by( 'id', $master ) ) {
|
115 |
-
return false;
|
116 |
-
}
|
117 |
-
|
118 |
-
$master_user = get_userdata( $master );
|
119 |
-
$master_user_data_com = Jetpack::get_connected_user_data( $master_user->ID );
|
120 |
-
$gravatar = sprintf( '<a href="%s">%s</a>', get_edit_user_link( $master_user->ID ), get_avatar( $master_user->ID, 40 ) );
|
121 |
-
|
122 |
-
$master_user_data = array(
|
123 |
-
'masterUser' => $master_user,
|
124 |
-
'masterDataCom' => $master_user_data_com,
|
125 |
-
'gravatar' => $gravatar,
|
126 |
-
);
|
127 |
-
|
128 |
-
return $master_user_data;
|
129 |
-
}
|
130 |
-
|
131 |
-
/*
|
132 |
-
* All the data we'll need about the Current User
|
133 |
-
*
|
134 |
-
* @return array
|
135 |
-
*/
|
136 |
-
function jetpack_current_user_data() {
|
137 |
-
global $current_user;
|
138 |
-
$is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' );
|
139 |
-
$dotcom_data = Jetpack::get_connected_user_data();
|
140 |
-
|
141 |
-
$current_user_data = array(
|
142 |
-
'isUserConnected' => Jetpack::is_user_connected( $current_user->ID ),
|
143 |
-
'isMasterUser' => $is_master_user,
|
144 |
-
'adminUsername' => $current_user->user_login,
|
145 |
-
'userComData' => $dotcom_data,
|
146 |
-
'gravatar' => sprintf( '<a href="%s">%s</a>', get_edit_user_link( $current_user->ID ), get_avatar( $current_user->ID, 40 ) ),
|
147 |
-
);
|
148 |
-
|
149 |
-
return $current_user_data;
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
/*
|
154 |
-
* Build an array of My Jetpack stats urls.
|
155 |
-
* requires the build URL args passed as an array
|
156 |
-
*
|
157 |
-
* @param array $my_jetpack_stats
|
158 |
-
* @return (array) of built stats urls
|
159 |
-
*/
|
160 |
-
function build_my_jetpack_stats_urls( $my_jetpack_stats ) {
|
161 |
-
$my_jetpack_urls = array();
|
162 |
-
|
163 |
-
foreach ( $my_jetpack_stats as $value ) {
|
164 |
-
$my_jetpack_urls[ $value ] = Jetpack::build_stats_url( array( 'x_jetpack-admin' => $value ) );
|
165 |
-
}
|
166 |
-
|
167 |
-
return $my_jetpack_urls;
|
168 |
-
|
169 |
-
}
|
170 |
-
|
171 |
-
// Load up admin scripts
|
172 |
-
function page_admin_scripts() {
|
173 |
-
wp_enqueue_script( 'jp-connection-js', plugins_url( '_inc/jp-my-jetpack.js', JETPACK__PLUGIN_FILE ), array( 'jquery', 'wp-util' ), JETPACK__VERSION . 'yep' );
|
174 |
-
|
175 |
-
wp_localize_script( 'jp-connection-js', 'jpConnection',
|
176 |
-
array(
|
177 |
-
'jetpackIsActive' => Jetpack::is_active(),
|
178 |
-
'isAdmin' => current_user_can( 'jetpack_manage_modules' ),
|
179 |
-
'otherAdminsLinked' => $this->jetpack_are_other_users_linked_and_admin(),
|
180 |
-
'masterUser' => $this->jetpack_master_user_data(),
|
181 |
-
'currentUser' => $this->jetpack_current_user_data(),
|
182 |
-
'my_jetpack_stats_urls' => $this->build_my_jetpack_stats_urls( array( 'change_primary', 'disconnect_site', 'confirm_disconnect', 'support_no_disconnect', 'cancel_disconnect' ) ),
|
183 |
-
'alertText' => __( 'You must link another admin account before switching primary account holders.', 'jetpack' ),
|
184 |
-
)
|
185 |
-
);
|
186 |
-
}
|
187 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/admin-pages/class.jetpack-settings-page.php
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
include_once( 'class.jetpack-admin-page.php' );
|
3 |
-
include_once( JETPACK__PLUGIN_DIR . 'class.jetpack-modules-list-table.php' );
|
4 |
-
|
5 |
-
// Builds the settings page and its menu
|
6 |
-
class Jetpack_Settings_Page extends Jetpack_Admin_Page {
|
7 |
-
// Show the settings page only when Jetpack is connected or in dev mode
|
8 |
-
protected $dont_show_if_not_active = true;
|
9 |
-
function add_page_actions( $hook ) {} // There are no page specific actions to attach to the menu
|
10 |
-
|
11 |
-
// Adds the Settings sub menu
|
12 |
-
function get_page_hook() {
|
13 |
-
return add_submenu_page( 'jetpack', __( 'Jetpack Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'jetpack_manage_modules', 'jetpack_modules', array( $this, 'render' ) );
|
14 |
-
}
|
15 |
-
|
16 |
-
// Renders the module list table where you can use bulk action or row
|
17 |
-
// actions to activate/deactivate and configure modules
|
18 |
-
function page_render() {
|
19 |
-
$list_table = new Jetpack_Modules_List_Table;
|
20 |
-
?>
|
21 |
-
<div class="clouds-sm"></div>
|
22 |
-
<?php /** This action is already documented in views/admin/admin-page.php */
|
23 |
-
do_action( 'jetpack_notices' ) ?>
|
24 |
-
<div class="page-content configure">
|
25 |
-
<div class="frame top hide-if-no-js">
|
26 |
-
<div class="wrap">
|
27 |
-
<div class="manage-left">
|
28 |
-
<table class="table table-bordered fixed-top">
|
29 |
-
<thead>
|
30 |
-
<tr>
|
31 |
-
<th class="check-column"><input type="checkbox" class="checkall"></th>
|
32 |
-
<th colspan="2">
|
33 |
-
<?php $list_table->unprotected_display_tablenav( 'top' ); ?>
|
34 |
-
<span class="filter-search">
|
35 |
-
<button type="button" class="button">Filter</button>
|
36 |
-
</span>
|
37 |
-
</th>
|
38 |
-
</tr>
|
39 |
-
</thead>
|
40 |
-
</table>
|
41 |
-
</div>
|
42 |
-
</div><!-- /.wrap -->
|
43 |
-
</div><!-- /.frame -->
|
44 |
-
<div class="frame bottom">
|
45 |
-
<div class="wrap">
|
46 |
-
<div class="manage-right">
|
47 |
-
<div class="bumper">
|
48 |
-
<form class="navbar-form" role="search">
|
49 |
-
<input type="hidden" name="page" value="jetpack_modules" />
|
50 |
-
<?php $list_table->search_box( __( 'Search', 'jetpack' ), 'srch-term' ); ?>
|
51 |
-
<p><?php esc_html_e( 'View:', 'jetpack' ); ?></p>
|
52 |
-
<div class="button-group filter-active">
|
53 |
-
<button type="button" class="button <?php if ( empty( $_GET['activated'] ) ) echo 'active'; ?>"><?php esc_html_e( 'All', 'jetpack' ); ?></button>
|
54 |
-
<button type="button" class="button <?php if ( ! empty( $_GET['activated'] ) && 'true' == $_GET['activated'] ) echo 'active'; ?>" data-filter-by="activated" data-filter-value="true"><?php esc_html_e( 'Active', 'jetpack' ); ?></button>
|
55 |
-
<button type="button" class="button <?php if ( ! empty( $_GET['activated'] ) && 'false' == $_GET['activated'] ) echo 'active'; ?>" data-filter-by="activated" data-filter-value="false"><?php esc_html_e( 'Inactive', 'jetpack' ); ?></button>
|
56 |
-
</div>
|
57 |
-
<p><?php esc_html_e( 'Sort by:', 'jetpack' ); ?></p>
|
58 |
-
<div class="button-group sort">
|
59 |
-
<button type="button" class="button <?php if ( empty( $_GET['sort_by'] ) ) echo 'active'; ?>" data-sort-by="name"><?php esc_html_e( 'Alphabetical', 'jetpack' ); ?></button>
|
60 |
-
<button type="button" class="button <?php if ( ! empty( $_GET['sort_by'] ) && 'introduced' == $_GET['sort_by'] ) echo 'active'; ?>" data-sort-by="introduced" data-sort-order="reverse"><?php esc_html_e( 'Newest', 'jetpack' ); ?></button>
|
61 |
-
<button type="button" class="button <?php if ( ! empty( $_GET['sort_by'] ) && 'sort' == $_GET['sort_by'] ) echo 'active'; ?>" data-sort-by="sort"><?php esc_html_e( 'Popular', 'jetpack' ); ?></button>
|
62 |
-
</div>
|
63 |
-
<p><?php esc_html_e( 'Show:', 'jetpack' ); ?></p>
|
64 |
-
<?php $list_table->views(); ?>
|
65 |
-
</form>
|
66 |
-
</div>
|
67 |
-
</div>
|
68 |
-
<div class="manage-left">
|
69 |
-
<form class="jetpack-modules-list-table-form" onsubmit="return false;">
|
70 |
-
<table class="<?php echo implode( ' ', $list_table->get_table_classes() ); ?>">
|
71 |
-
<tbody id="the-list">
|
72 |
-
<?php $list_table->display_rows_or_placeholder(); ?>
|
73 |
-
</tbody>
|
74 |
-
</table>
|
75 |
-
</form>
|
76 |
-
</div>
|
77 |
-
</div><!-- /.wrap -->
|
78 |
-
</div><!-- /.frame -->
|
79 |
-
</div><!-- /.content -->
|
80 |
-
<?php
|
81 |
-
}
|
82 |
-
|
83 |
-
// Javascript logic specific to the list table
|
84 |
-
function page_admin_scripts() {
|
85 |
-
wp_enqueue_script( 'jetpack-admin-js', plugins_url( '_inc/jetpack-admin.js', JETPACK__PLUGIN_FILE ), array( 'jquery' ), JETPACK__VERSION . '-20121111' );
|
86 |
-
}
|
87 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/class.color.php
DELETED
@@ -1,755 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Color utility and conversion
|
4 |
-
*
|
5 |
-
* Represents a color value, and converts between RGB/HSV/XYZ/Lab/HSL
|
6 |
-
*
|
7 |
-
* Example:
|
8 |
-
* $color = new Jetpack_Color(0xFFFFFF);
|
9 |
-
*
|
10 |
-
* @author Harold Asbridge <hasbridge@gmail.com>
|
11 |
-
* @author Matt Wiebe <wiebe@automattic.com>
|
12 |
-
* @license http://www.opensource.org/licenses/MIT
|
13 |
-
*/
|
14 |
-
|
15 |
-
class Jetpack_Color {
|
16 |
-
/**
|
17 |
-
* @var int
|
18 |
-
*/
|
19 |
-
protected $color = 0;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Initialize object
|
23 |
-
*
|
24 |
-
* @param string|array $color A color of the type $type
|
25 |
-
* @param string $type The type of color we will construct from.
|
26 |
-
* One of hex (default), rgb, hsl, int
|
27 |
-
*/
|
28 |
-
public function __construct( $color = null, $type = 'hex' ) {
|
29 |
-
if ( $color ) {
|
30 |
-
switch ( $type ) {
|
31 |
-
case 'hex':
|
32 |
-
$this->fromHex( $color );
|
33 |
-
break;
|
34 |
-
case 'rgb':
|
35 |
-
if ( is_array( $color ) && count( $color ) == 3 ) {
|
36 |
-
list( $r, $g, $b ) = array_values( $color );
|
37 |
-
$this->fromRgbInt( $r, $g, $b );
|
38 |
-
}
|
39 |
-
break;
|
40 |
-
case 'hsl':
|
41 |
-
if ( is_array( $color ) && count( $color ) == 3 ) {
|
42 |
-
list( $h, $s, $l ) = array_values( $color );
|
43 |
-
$this->fromHsl( $h, $s, $l );
|
44 |
-
}
|
45 |
-
break;
|
46 |
-
case 'int':
|
47 |
-
$this->fromInt( $color );
|
48 |
-
break;
|
49 |
-
default:
|
50 |
-
// there is no default.
|
51 |
-
break;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Init color from hex value
|
58 |
-
*
|
59 |
-
* @param string $hexValue
|
60 |
-
*
|
61 |
-
* @return Jetpack_Color
|
62 |
-
*/
|
63 |
-
public function fromHex($hexValue) {
|
64 |
-
$hexValue = str_replace( '#', '', $hexValue );
|
65 |
-
// handle short hex codes like #fff
|
66 |
-
if ( 3 === strlen( $hexValue ) ) {
|
67 |
-
$short = $hexValue;
|
68 |
-
$i = 0;
|
69 |
-
$hexValue = '';
|
70 |
-
while ( $i < 3 ) {
|
71 |
-
$chunk = substr($short, $i, 1 );
|
72 |
-
$hexValue .= $chunk . $chunk;
|
73 |
-
$i++;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
$intValue = hexdec( $hexValue );
|
77 |
-
|
78 |
-
if ( $intValue < 0 || $intValue > 16777215 ) {
|
79 |
-
throw new RangeException( $hexValue . " out of valid color code range" );
|
80 |
-
}
|
81 |
-
|
82 |
-
$this->color = $intValue;
|
83 |
-
|
84 |
-
return $this;
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Init color from integer RGB values
|
89 |
-
*
|
90 |
-
* @param int $red
|
91 |
-
* @param int $green
|
92 |
-
* @param int $blue
|
93 |
-
*
|
94 |
-
* @return Jetpack_Color
|
95 |
-
*/
|
96 |
-
public function fromRgbInt($red, $green, $blue)
|
97 |
-
{
|
98 |
-
if ( $red < 0 || $red > 255 )
|
99 |
-
throw new RangeException( "Red value " . $red . " out of valid color code range" );
|
100 |
-
|
101 |
-
if ( $green < 0 || $green > 255 )
|
102 |
-
throw new RangeException( "Green value " . $green . " out of valid color code range" );
|
103 |
-
|
104 |
-
if ( $blue < 0 || $blue > 255 )
|
105 |
-
throw new RangeException( "Blue value " . $blue . " out of valid color code range" );
|
106 |
-
|
107 |
-
$this->color = (int)(($red << 16) + ($green << 8) + $blue);
|
108 |
-
|
109 |
-
return $this;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Init color from hex RGB values
|
114 |
-
*
|
115 |
-
* @param string $red
|
116 |
-
* @param string $green
|
117 |
-
* @param string $blue
|
118 |
-
*
|
119 |
-
* @return Jetpack_Color
|
120 |
-
*/
|
121 |
-
public function fromRgbHex($red, $green, $blue)
|
122 |
-
{
|
123 |
-
return $this->fromRgbInt(hexdec($red), hexdec($green), hexdec($blue));
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Converts an HSL color value to RGB. Conversion formula
|
128 |
-
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
129 |
-
* @param int $h Hue. [0-360]
|
130 |
-
* @param in $s Saturation [0, 100]
|
131 |
-
* @param int $l Lightness [0, 100]
|
132 |
-
*/
|
133 |
-
public function fromHsl( $h, $s, $l ) {
|
134 |
-
$h /= 360; $s /= 100; $l /= 100;
|
135 |
-
|
136 |
-
if ( $s == 0 ) {
|
137 |
-
$r = $g = $b = $l; // achromatic
|
138 |
-
}
|
139 |
-
else {
|
140 |
-
$q = $l < 0.5 ? $l * ( 1 + $s ) : $l + $s - $l * $s;
|
141 |
-
$p = 2 * $l - $q;
|
142 |
-
$r = $this->hue2rgb( $p, $q, $h + 1/3 );
|
143 |
-
$g = $this->hue2rgb( $p, $q, $h );
|
144 |
-
$b = $this->hue2rgb( $p, $q, $h - 1/3 );
|
145 |
-
}
|
146 |
-
|
147 |
-
return $this->fromRgbInt( $r * 255, $g * 255, $b * 255 );
|
148 |
-
}
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Helper function for Jetpack_Color::fromHsl()
|
152 |
-
*/
|
153 |
-
private function hue2rgb( $p, $q, $t ) {
|
154 |
-
if ( $t < 0 ) $t += 1;
|
155 |
-
if ( $t > 1 ) $t -= 1;
|
156 |
-
if ( $t < 1/6 ) return $p + ( $q - $p ) * 6 * $t;
|
157 |
-
if ( $t < 1/2 ) return $q;
|
158 |
-
if ( $t < 2/3 ) return $p + ( $q - $p ) * ( 2/3 - $t ) * 6;
|
159 |
-
return $p;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Init color from integer value
|
164 |
-
*
|
165 |
-
* @param int $intValue
|
166 |
-
*
|
167 |
-
* @return Jetpack_Color
|
168 |
-
*/
|
169 |
-
public function fromInt($intValue)
|
170 |
-
{
|
171 |
-
if ( $intValue < 0 || $intValue > 16777215 )
|
172 |
-
throw new RangeException( $intValue . " out of valid color code range" );
|
173 |
-
|
174 |
-
$this->color = $intValue;
|
175 |
-
|
176 |
-
return $this;
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Convert color to hex
|
181 |
-
*
|
182 |
-
* @return string
|
183 |
-
*/
|
184 |
-
public function toHex()
|
185 |
-
{
|
186 |
-
return str_pad(dechex($this->color), 6, '0', STR_PAD_LEFT);
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Convert color to RGB array (integer values)
|
191 |
-
*
|
192 |
-
* @return array
|
193 |
-
*/
|
194 |
-
public function toRgbInt()
|
195 |
-
{
|
196 |
-
return array(
|
197 |
-
'red' => (int)(255 & ($this->color >> 16)),
|
198 |
-
'green' => (int)(255 & ($this->color >> 8)),
|
199 |
-
'blue' => (int)(255 & ($this->color))
|
200 |
-
);
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Convert color to RGB array (hex values)
|
205 |
-
*
|
206 |
-
* @return array
|
207 |
-
*/
|
208 |
-
public function toRgbHex()
|
209 |
-
{
|
210 |
-
$r = array();
|
211 |
-
foreach ($this->toRgbInt() as $item) {
|
212 |
-
$r[] = dechex($item);
|
213 |
-
}
|
214 |
-
return $r;
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Get Hue/Saturation/Value for the current color
|
219 |
-
* (float values, slow but accurate)
|
220 |
-
*
|
221 |
-
* @return array
|
222 |
-
*/
|
223 |
-
public function toHsvFloat()
|
224 |
-
{
|
225 |
-
$rgb = $this->toRgbInt();
|
226 |
-
|
227 |
-
$rgbMin = min($rgb);
|
228 |
-
$rgbMax = max($rgb);
|
229 |
-
|
230 |
-
$hsv = array(
|
231 |
-
'hue' => 0,
|
232 |
-
'sat' => 0,
|
233 |
-
'val' => $rgbMax
|
234 |
-
);
|
235 |
-
|
236 |
-
// If v is 0, color is black
|
237 |
-
if ($hsv['val'] == 0) {
|
238 |
-
return $hsv;
|
239 |
-
}
|
240 |
-
|
241 |
-
// Normalize RGB values to 1
|
242 |
-
$rgb['red'] /= $hsv['val'];
|
243 |
-
$rgb['green'] /= $hsv['val'];
|
244 |
-
$rgb['blue'] /= $hsv['val'];
|
245 |
-
$rgbMin = min($rgb);
|
246 |
-
$rgbMax = max($rgb);
|
247 |
-
|
248 |
-
// Calculate saturation
|
249 |
-
$hsv['sat'] = $rgbMax - $rgbMin;
|
250 |
-
if ($hsv['sat'] == 0) {
|
251 |
-
$hsv['hue'] = 0;
|
252 |
-
return $hsv;
|
253 |
-
}
|
254 |
-
|
255 |
-
// Normalize saturation to 1
|
256 |
-
$rgb['red'] = ($rgb['red'] - $rgbMin) / ($rgbMax - $rgbMin);
|
257 |
-
$rgb['green'] = ($rgb['green'] - $rgbMin) / ($rgbMax - $rgbMin);
|
258 |
-
$rgb['blue'] = ($rgb['blue'] - $rgbMin) / ($rgbMax - $rgbMin);
|
259 |
-
$rgbMin = min($rgb);
|
260 |
-
$rgbMax = max($rgb);
|
261 |
-
|
262 |
-
// Calculate hue
|
263 |
-
if ($rgbMax == $rgb['red']) {
|
264 |
-
$hsv['hue'] = 0.0 + 60 * ($rgb['green'] - $rgb['blue']);
|
265 |
-
if ($hsv['hue'] < 0) {
|
266 |
-
$hsv['hue'] += 360;
|
267 |
-
}
|
268 |
-
} else if ($rgbMax == $rgb['green']) {
|
269 |
-
$hsv['hue'] = 120 + (60 * ($rgb['blue'] - $rgb['red']));
|
270 |
-
} else {
|
271 |
-
$hsv['hue'] = 240 + (60 * ($rgb['red'] - $rgb['green']));
|
272 |
-
}
|
273 |
-
|
274 |
-
return $hsv;
|
275 |
-
}
|
276 |
-
|
277 |
-
/**
|
278 |
-
* Get HSV values for color
|
279 |
-
* (integer values from 0-255, fast but less accurate)
|
280 |
-
*
|
281 |
-
* @return int
|
282 |
-
*/
|
283 |
-
public function toHsvInt()
|
284 |
-
{
|
285 |
-
$rgb = $this->toRgbInt();
|
286 |
-
|
287 |
-
$rgbMin = min($rgb);
|
288 |
-
$rgbMax = max($rgb);
|
289 |
-
|
290 |
-
$hsv = array(
|
291 |
-
'hue' => 0,
|
292 |
-
'sat' => 0,
|
293 |
-
'val' => $rgbMax
|
294 |
-
);
|
295 |
-
|
296 |
-
// If value is 0, color is black
|
297 |
-
if ($hsv['val'] == 0) {
|
298 |
-
return $hsv;
|
299 |
-
}
|
300 |
-
|
301 |
-
// Calculate saturation
|
302 |
-
$hsv['sat'] = round(255 * ($rgbMax - $rgbMin) / $hsv['val']);
|
303 |
-
if ($hsv['sat'] == 0) {
|
304 |
-
$hsv['hue'] = 0;
|
305 |
-
return $hsv;
|
306 |
-
}
|
307 |
-
|
308 |
-
// Calculate hue
|
309 |
-
if ($rgbMax == $rgb['red']) {
|
310 |
-
$hsv['hue'] = round(0 + 43 * ($rgb['green'] - $rgb['blue']) / ($rgbMax - $rgbMin));
|
311 |
-
} else if ($rgbMax == $rgb['green']) {
|
312 |
-
$hsv['hue'] = round(85 + 43 * ($rgb['blue'] - $rgb['red']) / ($rgbMax - $rgbMin));
|
313 |
-
} else {
|
314 |
-
$hsv['hue'] = round(171 + 43 * ($rgb['red'] - $rgb['green']) / ($rgbMax - $rgbMin));
|
315 |
-
}
|
316 |
-
if ($hsv['hue'] < 0) {
|
317 |
-
$hsv['hue'] += 255;
|
318 |
-
}
|
319 |
-
|
320 |
-
return $hsv;
|
321 |
-
}
|
322 |
-
|
323 |
-
/**
|
324 |
-
* Converts an RGB color value to HSL. Conversion formula
|
325 |
-
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
326 |
-
* Assumes r, g, and b are contained in the set [0, 255] and
|
327 |
-
* returns h in [0, 360], s in [0, 100], l in [0, 100]
|
328 |
-
*
|
329 |
-
* @return Array The HSL representation
|
330 |
-
*/
|
331 |
-
public function toHsl() {
|
332 |
-
list( $r, $g, $b ) = array_values( $this->toRgbInt() );
|
333 |
-
$r /= 255; $g /= 255; $b /= 255;
|
334 |
-
$max = max( $r, $g, $b );
|
335 |
-
$min = min( $r, $g, $b );
|
336 |
-
$h = $s = $l = ( $max + $min ) / 2;
|
337 |
-
#var_dump( array( compact('max', 'min', 'r', 'g', 'b')) );
|
338 |
-
if ( $max == $min ) {
|
339 |
-
$h = $s = 0; // achromatic
|
340 |
-
}
|
341 |
-
else {
|
342 |
-
$d = $max - $min;
|
343 |
-
$s = $l > 0.5 ? $d / ( 2 - $max - $min ) : $d / ( $max + $min );
|
344 |
-
switch ( $max ) {
|
345 |
-
case $r:
|
346 |
-
$h = ( $g - $b ) / $d + ( $g < $b ? 6 : 0 );
|
347 |
-
break;
|
348 |
-
case $g:
|
349 |
-
$h = ( $b - $r ) / $d + 2;
|
350 |
-
break;
|
351 |
-
case $b:
|
352 |
-
$h = ( $r - $g ) / $d + 4;
|
353 |
-
break;
|
354 |
-
}
|
355 |
-
$h /= 6;
|
356 |
-
}
|
357 |
-
$h = (int) round( $h * 360 );
|
358 |
-
$s = (int) round( $s * 100 );
|
359 |
-
$l = (int) round( $l * 100 );
|
360 |
-
return compact( 'h', 's', 'l' );
|
361 |
-
}
|
362 |
-
|
363 |
-
public function toCSS( $type = 'hex', $alpha = 1 ) {
|
364 |
-
switch ( $type ) {
|
365 |
-
case 'hex':
|
366 |
-
return $this->toString();
|
367 |
-
break;
|
368 |
-
case 'rgb':
|
369 |
-
case 'rgba':
|
370 |
-
list( $r, $g, $b ) = array_values( $this->toRgbInt() );
|
371 |
-
if ( is_numeric( $alpha ) && $alpha < 1 ) {
|
372 |
-
return "rgba( {$r}, {$g}, {$b}, $alpha )";
|
373 |
-
}
|
374 |
-
else {
|
375 |
-
return "rgb( {$r}, {$g}, {$b} )";
|
376 |
-
}
|
377 |
-
break;
|
378 |
-
case 'hsl':
|
379 |
-
case 'hsla':
|
380 |
-
list( $h, $s, $l ) = array_values( $this->toHsl() );
|
381 |
-
if ( is_numeric( $alpha ) && $alpha < 1 ) {
|
382 |
-
return "hsla( {$h}, {$s}, {$l}, $alpha )";
|
383 |
-
}
|
384 |
-
else {
|
385 |
-
return "hsl( {$h}, {$s}, {$l} )";
|
386 |
-
}
|
387 |
-
break;
|
388 |
-
default:
|
389 |
-
return $this->toString();
|
390 |
-
break;
|
391 |
-
}
|
392 |
-
}
|
393 |
-
|
394 |
-
/**
|
395 |
-
* Get current color in XYZ format
|
396 |
-
*
|
397 |
-
* @return array
|
398 |
-
*/
|
399 |
-
public function toXyz()
|
400 |
-
{
|
401 |
-
$rgb = $this->toRgbInt();
|
402 |
-
|
403 |
-
// Normalize RGB values to 1
|
404 |
-
|
405 |
-
$rgb_new = array();
|
406 |
-
foreach ($rgb as $item) {
|
407 |
-
$rgb_new[] = $item / 255;
|
408 |
-
}
|
409 |
-
$rgb = $rgb_new;
|
410 |
-
|
411 |
-
$rgb_new = array();
|
412 |
-
foreach ($rgb as $item) {
|
413 |
-
if ($item > 0.04045) {
|
414 |
-
$item = pow((($item + 0.055) / 1.055), 2.4);
|
415 |
-
} else {
|
416 |
-
$item = $item / 12.92;
|
417 |
-
}
|
418 |
-
$rgb_new[] = $item * 100;
|
419 |
-
}
|
420 |
-
$rgb = $rgb_new;
|
421 |
-
|
422 |
-
// Observer. = 2°, Illuminant = D65
|
423 |
-
$xyz = array(
|
424 |
-
'x' => ($rgb['red'] * 0.4124) + ($rgb['green'] * 0.3576) + ($rgb['blue'] * 0.1805),
|
425 |
-
'y' => ($rgb['red'] * 0.2126) + ($rgb['green'] * 0.7152) + ($rgb['blue'] * 0.0722),
|
426 |
-
'z' => ($rgb['red'] * 0.0193) + ($rgb['green'] * 0.1192) + ($rgb['blue'] * 0.9505)
|
427 |
-
);
|
428 |
-
|
429 |
-
return $xyz;
|
430 |
-
}
|
431 |
-
|
432 |
-
/**
|
433 |
-
* Get color CIE-Lab values
|
434 |
-
*
|
435 |
-
* @return array
|
436 |
-
*/
|
437 |
-
public function toLabCie()
|
438 |
-
{
|
439 |
-
$xyz = $this->toXyz();
|
440 |
-
|
441 |
-
//Ovserver = 2*, Iluminant=D65
|
442 |
-
$xyz['x'] /= 95.047;
|
443 |
-
$xyz['y'] /= 100;
|
444 |
-
$xyz['z'] /= 108.883;
|
445 |
-
|
446 |
-
$xyz_new = array();
|
447 |
-
foreach ($xyz as $item) {
|
448 |
-
if ($item > 0.008856) {
|
449 |
-
$xyz_new[] = pow($item, 1/3);
|
450 |
-
} else {
|
451 |
-
$xyz_new[] = (7.787 * $item) + (16 / 116);
|
452 |
-
}
|
453 |
-
}
|
454 |
-
$xyz = $xyz_new;
|
455 |
-
|
456 |
-
$lab = array(
|
457 |
-
'l' => (116 * $xyz['y']) - 16,
|
458 |
-
'a' => 500 * ($xyz['x'] - $xyz['y']),
|
459 |
-
'b' => 200 * ($xyz['y'] - $xyz['z'])
|
460 |
-
);
|
461 |
-
|
462 |
-
return $lab;
|
463 |
-
}
|
464 |
-
|
465 |
-
/**
|
466 |
-
* Convert color to integer
|
467 |
-
*
|
468 |
-
* @return int
|
469 |
-
*/
|
470 |
-
public function toInt()
|
471 |
-
{
|
472 |
-
return $this->color;
|
473 |
-
}
|
474 |
-
|
475 |
-
/**
|
476 |
-
* Alias of toString()
|
477 |
-
*
|
478 |
-
* @return string
|
479 |
-
*/
|
480 |
-
public function __toString()
|
481 |
-
{
|
482 |
-
return $this->toString();
|
483 |
-
}
|
484 |
-
|
485 |
-
/**
|
486 |
-
* Get color as string
|
487 |
-
*
|
488 |
-
* @return string
|
489 |
-
*/
|
490 |
-
public function toString()
|
491 |
-
{
|
492 |
-
$str = $this->toHex();
|
493 |
-
return strtoupper("#{$str}");
|
494 |
-
}
|
495 |
-
|
496 |
-
/**
|
497 |
-
* Get the distance between this color and the given color
|
498 |
-
*
|
499 |
-
* @param Jetpack_Color $color
|
500 |
-
*
|
501 |
-
* @return int
|
502 |
-
*/
|
503 |
-
public function getDistanceRgbFrom(Jetpack_Color $color)
|
504 |
-
{
|
505 |
-
$rgb1 = $this->toRgbInt();
|
506 |
-
$rgb2 = $color->toRgbInt();
|
507 |
-
|
508 |
-
$rDiff = abs($rgb1['red'] - $rgb2['red']);
|
509 |
-
$gDiff = abs($rgb1['green'] - $rgb2['green']);
|
510 |
-
$bDiff = abs($rgb1['blue'] - $rgb2['blue']);
|
511 |
-
|
512 |
-
// Sum of RGB differences
|
513 |
-
$diff = $rDiff + $gDiff + $bDiff;
|
514 |
-
return $diff;
|
515 |
-
}
|
516 |
-
|
517 |
-
/**
|
518 |
-
* Get distance from the given color using the Delta E method
|
519 |
-
*
|
520 |
-
* @param Jetpack_Color $color
|
521 |
-
*
|
522 |
-
* @return float
|
523 |
-
*/
|
524 |
-
public function getDistanceLabFrom(Jetpack_Color $color)
|
525 |
-
{
|
526 |
-
$lab1 = $this->toLabCie();
|
527 |
-
$lab2 = $color->toLabCie();
|
528 |
-
|
529 |
-
$lDiff = abs($lab2['l'] - $lab1['l']);
|
530 |
-
$aDiff = abs($lab2['a'] - $lab1['a']);
|
531 |
-
$bDiff = abs($lab2['b'] - $lab1['b']);
|
532 |
-
|
533 |
-
$delta = sqrt($lDiff + $aDiff + $bDiff);
|
534 |
-
|
535 |
-
return $delta;
|
536 |
-
}
|
537 |
-
|
538 |
-
public function toLuminosity() {
|
539 |
-
$lum = array();
|
540 |
-
foreach( $this->toRgbInt() as $slot => $value ) {
|
541 |
-
$chan = $value / 255;
|
542 |
-
$lum[ $slot ] = ( $chan <= 0.03928 ) ? $chan / 12.92 : pow( ( ( $chan + 0.055 ) / 1.055 ), 2.4 );
|
543 |
-
}
|
544 |
-
return 0.2126 * $lum['red'] + 0.7152 * $lum['green'] + 0.0722 * $lum['blue'];
|
545 |
-
}
|
546 |
-
|
547 |
-
/**
|
548 |
-
* Get distance between colors using luminance.
|
549 |
-
* Should be more than 5 for readable contrast
|
550 |
-
*
|
551 |
-
* @param Jetpack_Color $color Another color
|
552 |
-
* @return float
|
553 |
-
*/
|
554 |
-
public function getDistanceLuminosityFrom( Jetpack_Color $color ) {
|
555 |
-
$L1 = $this->toLuminosity();
|
556 |
-
$L2 = $color->toLuminosity();
|
557 |
-
if ( $L1 > $L2 ) {
|
558 |
-
return ( $L1 + 0.05 ) / ( $L2 + 0.05 );
|
559 |
-
}
|
560 |
-
else{
|
561 |
-
return ( $L2 + 0.05 ) / ( $L1 + 0.05 );
|
562 |
-
}
|
563 |
-
}
|
564 |
-
|
565 |
-
public function getMaxContrastColor() {
|
566 |
-
$withBlack = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#000') );
|
567 |
-
$withWhite = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#fff') );
|
568 |
-
$color = new Jetpack_Color;
|
569 |
-
$hex = ( $withBlack >= $withWhite ) ? '#000000' : '#ffffff';
|
570 |
-
return $color->fromHex( $hex );
|
571 |
-
}
|
572 |
-
|
573 |
-
public function getGrayscaleContrastingColor( $contrast = false ) {
|
574 |
-
if ( ! $contrast ) {
|
575 |
-
return $this->getMaxContrastColor();
|
576 |
-
}
|
577 |
-
// don't allow less than 5
|
578 |
-
$target_contrast = ( $contrast < 5 ) ? 5 : $contrast;
|
579 |
-
$color = $this->getMaxContrastColor();
|
580 |
-
$contrast = $color->getDistanceLuminosityFrom( $this );
|
581 |
-
|
582 |
-
// if current max contrast is less than the target contrast, we had wishful thinking.
|
583 |
-
if ( $contrast <= $target_contrast ) {
|
584 |
-
return $color;
|
585 |
-
}
|
586 |
-
|
587 |
-
$incr = ( '#000000' === $color->toString() ) ? 1 : -1;
|
588 |
-
while ( $contrast > $target_contrast ) {
|
589 |
-
$color = $color->incrementLightness( $incr );
|
590 |
-
$contrast = $color->getDistanceLuminosityFrom( $this );
|
591 |
-
}
|
592 |
-
|
593 |
-
return $color;
|
594 |
-
}
|
595 |
-
|
596 |
-
/**
|
597 |
-
* Gets a readable contrasting color. $this is assumed to be the text and $color the background color.
|
598 |
-
* @param object $bg_color A Color object that will be compared against $this
|
599 |
-
* @param integer $min_contrast The minimum contrast to achieve, if possible.
|
600 |
-
* @return object A Color object, an increased contrast $this compared against $bg_color
|
601 |
-
*/
|
602 |
-
public function getReadableContrastingColor( $bg_color = false, $min_contrast = 5 ) {
|
603 |
-
if ( ! $bg_color || ! is_a( $bg_color, 'Jetpack_Color' ) ) {
|
604 |
-
return $this;
|
605 |
-
}
|
606 |
-
// you shouldn't use less than 5, but you might want to.
|
607 |
-
$target_contrast = $min_contrast;
|
608 |
-
// working things
|
609 |
-
$contrast = $bg_color->getDistanceLuminosityFrom( $this );
|
610 |
-
$max_contrast_color = $bg_color->getMaxContrastColor();
|
611 |
-
$max_contrast = $max_contrast_color->getDistanceLuminosityFrom( $bg_color );
|
612 |
-
|
613 |
-
// if current max contrast is less than the target contrast, we had wishful thinking.
|
614 |
-
// still, go max
|
615 |
-
if ( $max_contrast <= $target_contrast ) {
|
616 |
-
return $max_contrast_color;
|
617 |
-
}
|
618 |
-
// or, we might already have sufficient contrast
|
619 |
-
if ( $contrast >= $target_contrast ) {
|
620 |
-
return $this;
|
621 |
-
}
|
622 |
-
|
623 |
-
$incr = ( 0 === $max_contrast_color->toInt() ) ? -1 : 1;
|
624 |
-
while ( $contrast < $target_contrast ) {
|
625 |
-
$this->incrementLightness( $incr );
|
626 |
-
$contrast = $bg_color->getDistanceLuminosityFrom( $this );
|
627 |
-
// infininite loop prevention: you never know.
|
628 |
-
if ( $this->color === 0 || $this->color === 16777215 ) {
|
629 |
-
break;
|
630 |
-
}
|
631 |
-
}
|
632 |
-
|
633 |
-
return $this;
|
634 |
-
}
|
635 |
-
|
636 |
-
/**
|
637 |
-
* Detect if color is grayscale
|
638 |
-
*
|
639 |
-
* @param int @threshold
|
640 |
-
*
|
641 |
-
* @return bool
|
642 |
-
*/
|
643 |
-
public function isGrayscale($threshold = 16)
|
644 |
-
{
|
645 |
-
$rgb = $this->toRgbInt();
|
646 |
-
|
647 |
-
// Get min and max rgb values, then difference between them
|
648 |
-
$rgbMin = min($rgb);
|
649 |
-
$rgbMax = max($rgb);
|
650 |
-
$diff = $rgbMax - $rgbMin;
|
651 |
-
|
652 |
-
return $diff < $threshold;
|
653 |
-
}
|
654 |
-
|
655 |
-
/**
|
656 |
-
* Get the closest matching color from the given array of colors
|
657 |
-
*
|
658 |
-
* @param array $colors array of integers or Jetpack_Color objects
|
659 |
-
*
|
660 |
-
* @return mixed the array key of the matched color
|
661 |
-
*/
|
662 |
-
public function getClosestMatch(array $colors)
|
663 |
-
{
|
664 |
-
$matchDist = 10000;
|
665 |
-
$matchKey = null;
|
666 |
-
foreach($colors as $key => $color) {
|
667 |
-
if (false === ($color instanceof Jetpack_Color)) {
|
668 |
-
$c = new Jetpack_Color($color);
|
669 |
-
}
|
670 |
-
$dist = $this->getDistanceLabFrom($c);
|
671 |
-
if ($dist < $matchDist) {
|
672 |
-
$matchDist = $dist;
|
673 |
-
$matchKey = $key;
|
674 |
-
}
|
675 |
-
}
|
676 |
-
|
677 |
-
return $matchKey;
|
678 |
-
}
|
679 |
-
|
680 |
-
/* TRANSFORMS */
|
681 |
-
|
682 |
-
public function darken( $amount = 5 ) {
|
683 |
-
return $this->incrementLightness( - $amount );
|
684 |
-
}
|
685 |
-
|
686 |
-
public function lighten( $amount = 5 ) {
|
687 |
-
return $this->incrementLightness( $amount );
|
688 |
-
}
|
689 |
-
|
690 |
-
public function incrementLightness( $amount ) {
|
691 |
-
$hsl = $this->toHsl();
|
692 |
-
extract( $hsl );
|
693 |
-
$l += $amount;
|
694 |
-
if ( $l < 0 ) $l = 0;
|
695 |
-
if ( $l > 100 ) $l = 100;
|
696 |
-
return $this->fromHsl( $h, $s, $l );
|
697 |
-
}
|
698 |
-
|
699 |
-
public function saturate( $amount = 15 ) {
|
700 |
-
return $this->incrementSaturation( $amount );
|
701 |
-
}
|
702 |
-
|
703 |
-
public function desaturate( $amount = 15 ) {
|
704 |
-
return $this->incrementSaturation( - $amount );
|
705 |
-
}
|
706 |
-
|
707 |
-
public function incrementSaturation( $amount ) {
|
708 |
-
$hsl = $this->toHsl();
|
709 |
-
extract( $hsl );
|
710 |
-
$s += $amount;
|
711 |
-
if ( $s < 0 ) $s = 0;
|
712 |
-
if ( $s > 100 ) $s = 100;
|
713 |
-
return $this->fromHsl( $h, $s, $l );
|
714 |
-
}
|
715 |
-
|
716 |
-
public function toGrayscale() {
|
717 |
-
$hsl = $this->toHsl();
|
718 |
-
extract( $hsl );
|
719 |
-
$s = 0;
|
720 |
-
return $this->fromHsl( $h, $s, $l );
|
721 |
-
}
|
722 |
-
|
723 |
-
public function getComplement() {
|
724 |
-
return $this->incrementHue( 180 );
|
725 |
-
}
|
726 |
-
|
727 |
-
public function getSplitComplement( $step = 1 ) {
|
728 |
-
$incr = 180 + ( $step * 30 );
|
729 |
-
return $this->incrementHue( $incr );
|
730 |
-
}
|
731 |
-
|
732 |
-
public function getAnalog( $step = 1 ) {
|
733 |
-
$incr = $step * 30;
|
734 |
-
return $this->incrementHue( $incr );
|
735 |
-
}
|
736 |
-
|
737 |
-
public function getTetrad( $step = 1 ) {
|
738 |
-
$incr = $step * 60;
|
739 |
-
return $this->incrementHue( $incr );
|
740 |
-
}
|
741 |
-
|
742 |
-
public function getTriad( $step = 1 ) {
|
743 |
-
$incr = $step * 120;
|
744 |
-
return $this->incrementHue( $incr );
|
745 |
-
}
|
746 |
-
|
747 |
-
public function incrementHue( $amount ) {
|
748 |
-
$hsl = $this->toHsl();
|
749 |
-
extract( $hsl );
|
750 |
-
$h = ( $h + $amount ) % 360;
|
751 |
-
if ( $h < 0 ) $h = 360 - $h;
|
752 |
-
return $this->fromHsl( $h, $s, $l );
|
753 |
-
}
|
754 |
-
|
755 |
-
} // class Jetpack_Color
|
|
|
|
|
|
|
|
|
|
|
|
|
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 'MarkdownExtra_Parser' ) )
|
4 |
-
jetpack_require_lib( 'markdown/extra' );
|
5 |
-
|
6 |
-
jetpack_require_lib( 'markdown/gfm' );
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/markdown/README.md
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
# Markdown parsing library
|
2 |
-
|
3 |
-
Contains two libraries:
|
4 |
-
|
5 |
-
* `/extra`
|
6 |
-
- Gives you `MardownExtra_Parser` and `Markdown_Parser`
|
7 |
-
- Docs at http://michelf.ca/projects/php-markdown/extra/
|
8 |
-
|
9 |
-
* `/gfm` -- Github Flavored MArkdown
|
10 |
-
- Gives you `WPCom_GHF_Markdown_Parser`
|
11 |
-
- It has the same interface as `MarkdownExtra_Parser`
|
12 |
-
- Adds support for fenced code blocks: https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
|
13 |
-
- By default it replaces them with a code shortcode
|
14 |
-
- You can change this using the `$use_code_shortcode` member variable
|
15 |
-
- You can change the code shortcode wrapping with `$shortcode_start` and `$shortcode_end` member variables
|
16 |
-
- The `$preserve_shortcodes` member variable will preserve all registered shortcodes untouched. Requires WordPress to be loaded for `get_shortcode_regex()`
|
17 |
-
- The `$preserve_latex` member variable will preserve oldskool $latex yer-latex$ codes untouched.
|
18 |
-
- The `$strip_paras` member variable will strip <p> tags because that's what WordPress likes.
|
19 |
-
- See `WPCom_GHF_Markdown_Parser::__construct()` for how the above member variable defaults are set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/markdown/extra.php
DELETED
@@ -1,3194 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
#
|
3 |
-
# Markdown Extra - A text-to-HTML conversion tool for web writers
|
4 |
-
#
|
5 |
-
# PHP Markdown & Extra
|
6 |
-
# Copyright (c) 2004-2013 Michel Fortin
|
7 |
-
# <http://michelf.ca/projects/php-markdown/>
|
8 |
-
#
|
9 |
-
# Original Markdown
|
10 |
-
# Copyright (c) 2004-2006 John Gruber
|
11 |
-
# <http://daringfireball.net/projects/markdown/>
|
12 |
-
#
|
13 |
-
# Tweaked to remove WordPress interface
|
14 |
-
|
15 |
-
|
16 |
-
define( 'MARKDOWN_VERSION', "1.0.2" ); # 29 Nov 2013
|
17 |
-
define( 'MARKDOWNEXTRA_VERSION', "1.2.8" ); # 29 Nov 2013
|
18 |
-
|
19 |
-
|
20 |
-
#
|
21 |
-
# Global default settings:
|
22 |
-
#
|
23 |
-
|
24 |
-
# Change to ">" for HTML output
|
25 |
-
@define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />");
|
26 |
-
|
27 |
-
# Define the width of a tab for code blocks.
|
28 |
-
@define( 'MARKDOWN_TAB_WIDTH', 4 );
|
29 |
-
|
30 |
-
# Optional title attribute for footnote links and backlinks.
|
31 |
-
@define( 'MARKDOWN_FN_LINK_TITLE', "" );
|
32 |
-
@define( 'MARKDOWN_FN_BACKLINK_TITLE', "" );
|
33 |
-
|
34 |
-
# Optional class attribute for footnote links and backlinks.
|
35 |
-
@define( 'MARKDOWN_FN_LINK_CLASS', "" );
|
36 |
-
@define( 'MARKDOWN_FN_BACKLINK_CLASS', "" );
|
37 |
-
|
38 |
-
# Optional class prefix for fenced code block.
|
39 |
-
@define( 'MARKDOWN_CODE_CLASS_PREFIX', "" );
|
40 |
-
|
41 |
-
# Class attribute for code blocks goes on the `code` tag;
|
42 |
-
# setting this to true will put attributes on the `pre` tag instead.
|
43 |
-
@define( 'MARKDOWN_CODE_ATTR_ON_PRE', false );
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
### Standard Function Interface ###
|
48 |
-
|
49 |
-
@define( 'MARKDOWN_PARSER_CLASS', 'MarkdownExtra_Parser' );
|
50 |
-
|
51 |
-
function Markdown($text) {
|
52 |
-
#
|
53 |
-
# Initialize the parser and return the result of its transform method.
|
54 |
-
#
|
55 |
-
# Setup static parser variable.
|
56 |
-
static $parser;
|
57 |
-
if (!isset($parser)) {
|
58 |
-
$parser_class = MARKDOWN_PARSER_CLASS;
|
59 |
-
$parser = new $parser_class;
|
60 |
-
}
|
61 |
-
|
62 |
-
# Transform text using parser.
|
63 |
-
return $parser->transform($text);
|
64 |
-
}
|
65 |
-
|
66 |
-
#
|
67 |
-
# Markdown Parser Class
|
68 |
-
#
|
69 |
-
|
70 |
-
class Markdown_Parser {
|
71 |
-
|
72 |
-
### Configuration Variables ###
|
73 |
-
|
74 |
-
# Change to ">" for HTML output.
|
75 |
-
public $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX;
|
76 |
-
public $tab_width = MARKDOWN_TAB_WIDTH;
|
77 |
-
|
78 |
-
# Change to `true` to disallow markup or entities.
|
79 |
-
public $no_markup = false;
|
80 |
-
public $no_entities = false;
|
81 |
-
|
82 |
-
# Predefined urls and titles for reference links and images.
|
83 |
-
public $predef_urls = array();
|
84 |
-
public $predef_titles = array();
|
85 |
-
|
86 |
-
|
87 |
-
### Parser Implementation ###
|
88 |
-
|
89 |
-
# Regex to match balanced [brackets].
|
90 |
-
# Needed to insert a maximum bracked depth while converting to PHP.
|
91 |
-
public $nested_brackets_depth = 6;
|
92 |
-
public $nested_brackets_re;
|
93 |
-
|
94 |
-
public $nested_url_parenthesis_depth = 4;
|
95 |
-
public $nested_url_parenthesis_re;
|
96 |
-
|
97 |
-
# Table of hash values for escaped characters:
|
98 |
-
public $escape_chars = '\`*_{}[]()>#+-.!';
|
99 |
-
public $escape_chars_re;
|
100 |
-
|
101 |
-
|
102 |
-
function __construct() {
|
103 |
-
#
|
104 |
-
# Constructor function. Initialize appropriate member variables.
|
105 |
-
#
|
106 |
-
$this->_initDetab();
|
107 |
-
$this->prepareItalicsAndBold();
|
108 |
-
|
109 |
-
$this->nested_brackets_re =
|
110 |
-
str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth).
|
111 |
-
str_repeat('\])*', $this->nested_brackets_depth);
|
112 |
-
|
113 |
-
$this->nested_url_parenthesis_re =
|
114 |
-
str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth).
|
115 |
-
str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth);
|
116 |
-
|
117 |
-
$this->escape_chars_re = '['.preg_quote($this->escape_chars).']';
|
118 |
-
|
119 |
-
# Sort document, block, and span gamut in ascendent priority order.
|
120 |
-
asort($this->document_gamut);
|
121 |
-
asort($this->block_gamut);
|
122 |
-
asort($this->span_gamut);
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
# Internal hashes used during transformation.
|
127 |
-
public $urls = array();
|
128 |
-
public $titles = array();
|
129 |
-
public $html_hashes = array();
|
130 |
-
|
131 |
-
# Status flag to avoid invalid nesting.
|
132 |
-
public $in_anchor = false;
|
133 |
-
|
134 |
-
|
135 |
-
function setup() {
|
136 |
-
#
|
137 |
-
# Called before the transformation process starts to setup parser
|
138 |
-
# states.
|
139 |
-
#
|
140 |
-
# Clear global hashes.
|
141 |
-
$this->urls = $this->predef_urls;
|
142 |
-
$this->titles = $this->predef_titles;
|
143 |
-
$this->html_hashes = array();
|
144 |
-
|
145 |
-
$this->in_anchor = false;
|
146 |
-
}
|
147 |
-
|
148 |
-
function teardown() {
|
149 |
-
#
|
150 |
-
# Called after the transformation process to clear any variable
|
151 |
-
# which may be taking up memory unnecessarly.
|
152 |
-
#
|
153 |
-
$this->urls = array();
|
154 |
-
$this->titles = array();
|
155 |
-
$this->html_hashes = array();
|
156 |
-
}
|
157 |
-
|
158 |
-
|
159 |
-
function transform($text) {
|
160 |
-
#
|
161 |
-
# Main function. Performs some preprocessing on the input text
|
162 |
-
# and pass it through the document gamut.
|
163 |
-
#
|
164 |
-
$this->setup();
|
165 |
-
|
166 |
-
# Remove UTF-8 BOM and marker character in input, if present.
|
167 |
-
$text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
|
168 |
-
|
169 |
-
# Standardize line endings:
|
170 |
-
# DOS to Unix and Mac to Unix
|
171 |
-
$text = preg_replace('{\r\n?}', "\n", $text);
|
172 |
-
|
173 |
-
# Make sure $text ends with a couple of newlines:
|
174 |
-
$text .= "\n\n";
|
175 |
-
|
176 |
-
# Convert all tabs to spaces.
|
177 |
-
$text = $this->detab($text);
|
178 |
-
|
179 |
-
# Turn block-level HTML blocks into hash entries
|
180 |
-
$text = $this->hashHTMLBlocks($text);
|
181 |
-
|
182 |
-
# Strip any lines consisting only of spaces and tabs.
|
183 |
-
# This makes subsequent regexen easier to write, because we can
|
184 |
-
# match consecutive blank lines with /\n+/ instead of something
|
185 |
-
# contorted like /[ ]*\n+/ .
|
186 |
-
$text = preg_replace('/^[ ]+$/m', '', $text);
|
187 |
-
|
188 |
-
# Run document gamut methods.
|
189 |
-
foreach ($this->document_gamut as $method => $priority) {
|
190 |
-
$text = $this->$method($text);
|
191 |
-
}
|
192 |
-
|
193 |
-
$this->teardown();
|
194 |
-
|
195 |
-
return $text . "\n";
|
196 |
-
}
|
197 |
-
|
198 |
-
public $document_gamut = array(
|
199 |
-
# Strip link definitions, store in hashes.
|
200 |
-
"stripLinkDefinitions" => 20,
|
201 |
-
|
202 |
-
"runBasicBlockGamut" => 30,
|
203 |
-
);
|
204 |
-
|
205 |
-
|
206 |
-
function stripLinkDefinitions($text) {
|
207 |
-
#
|
208 |
-
# Strips link definitions from text, stores the URLs and titles in
|
209 |
-
# hash references.
|
210 |
-
#
|
211 |
-
$less_than_tab = $this->tab_width - 1;
|
212 |
-
|
213 |
-
# Link defs are in the form: ^[id]: url "optional title"
|
214 |
-
$text = preg_replace_callback('{
|
215 |
-
^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1
|
216 |
-
[ ]*
|
217 |
-
\n? # maybe *one* newline
|
218 |
-
[ ]*
|
219 |
-
(?:
|
220 |
-
<(.+?)> # url = $2
|
221 |
-
|
|
222 |
-
(\S+?) # url = $3
|
223 |
-
)
|
224 |
-
[ ]*
|
225 |
-
\n? # maybe one newline
|
226 |
-
[ ]*
|
227 |
-
(?:
|
228 |
-
(?<=\s) # lookbehind for whitespace
|
229 |
-
["(]
|
230 |
-
(.*?) # title = $4
|
231 |
-
[")]
|
232 |
-
[ ]*
|
233 |
-
)? # title is optional
|
234 |
-
(?:\n+|\Z)
|
235 |
-
}xm',
|
236 |
-
array(&$this, '_stripLinkDefinitions_callback'),
|
237 |
-
$text);
|
238 |
-
return $text;
|
239 |
-
}
|
240 |
-
function _stripLinkDefinitions_callback($matches) {
|
241 |
-
$link_id = strtolower($matches[1]);
|
242 |
-
$url = $matches[2] == '' ? $matches[3] : $matches[2];
|
243 |
-
$this->urls[$link_id] = $url;
|
244 |
-
$this->titles[$link_id] =& $matches[4];
|
245 |
-
return ''; # String that will replace the block
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
function hashHTMLBlocks($text) {
|
250 |
-
if ($this->no_markup) return $text;
|
251 |
-
|
252 |
-
$less_than_tab = $this->tab_width - 1;
|
253 |
-
|
254 |
-
# Hashify HTML blocks:
|
255 |
-
# We only want to do this for block-level HTML tags, such as headers,
|
256 |
-
# lists, and tables. That's because we still want to wrap <p>s around
|
257 |
-
# "paragraphs" that are wrapped in non-block-level tags, such as anchors,
|
258 |
-
# phrase emphasis, and spans. The list of tags we're looking for is
|
259 |
-
# hard-coded:
|
260 |
-
#
|
261 |
-
# * List "a" is made of tags which can be both inline or block-level.
|
262 |
-
# These will be treated block-level when the start tag is alone on
|
263 |
-
# its line, otherwise they're not matched here and will be taken as
|
264 |
-
# inline later.
|
265 |
-
# * List "b" is made of tags which are always block-level;
|
266 |
-
#
|
267 |
-
$block_tags_a_re = 'ins|del';
|
268 |
-
$block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
|
269 |
-
'script|noscript|form|fieldset|iframe|math|svg|'.
|
270 |
-
'article|section|nav|aside|hgroup|header|footer|'.
|
271 |
-
'figure';
|
272 |
-
|
273 |
-
# Regular expression for the content of a block tag.
|
274 |
-
$nested_tags_level = 4;
|
275 |
-
$attr = '
|
276 |
-
(?> # optional tag attributes
|
277 |
-
\s # starts with whitespace
|
278 |
-
(?>
|
279 |
-
[^>"/]+ # text outside quotes
|
280 |
-
|
|
281 |
-
/+(?!>) # slash not followed by ">"
|
282 |
-
|
|
283 |
-
"[^"]*" # text inside double quotes (tolerate ">")
|
284 |
-
|
|
285 |
-
\'[^\']*\' # text inside single quotes (tolerate ">")
|
286 |
-
)*
|
287 |
-
)?
|
288 |
-
';
|
289 |
-
$content =
|
290 |
-
str_repeat('
|
291 |
-
(?>
|
292 |
-
[^<]+ # content without tag
|
293 |
-
|
|
294 |
-
<\2 # nested opening tag
|
295 |
-
'.$attr.' # attributes
|
296 |
-
(?>
|
297 |
-
/>
|
298 |
-
|
|
299 |
-
>', $nested_tags_level). # end of opening tag
|
300 |
-
'.*?'. # last level nested tag content
|
301 |
-
str_repeat('
|
302 |
-
</\2\s*> # closing nested tag
|
303 |
-
)
|
304 |
-
|
|
305 |
-
<(?!/\2\s*> # other tags with a different name
|
306 |
-
)
|
307 |
-
)*',
|
308 |
-
$nested_tags_level);
|
309 |
-
$content2 = str_replace('\2', '\3', $content);
|
310 |
-
|
311 |
-
# First, look for nested blocks, e.g.:
|
312 |
-
# <div>
|
313 |
-
# <div>
|
314 |
-
# tags for inner block must be indented.
|
315 |
-
# </div>
|
316 |
-
# </div>
|
317 |
-
#
|
318 |
-
# The outermost tags must start at the left margin for this to match, and
|
319 |
-
# the inner nested divs must be indented.
|
320 |
-
# We need to do this before the next, more liberal match, because the next
|
321 |
-
# match will start at the first `<div>` and stop at the first `</div>`.
|
322 |
-
$text = preg_replace_callback('{(?>
|
323 |
-
(?>
|
324 |
-
(?<=\n\n) # Starting after a blank line
|
325 |
-
| # or
|
326 |
-
\A\n? # the beginning of the doc
|
327 |
-
)
|
328 |
-
( # save in $1
|
329 |
-
|
330 |
-
# Match from `\n<tag>` to `</tag>\n`, handling nested tags
|
331 |
-
# in between.
|
332 |
-
|
333 |
-
[ ]{0,'.$less_than_tab.'}
|
334 |
-
<('.$block_tags_b_re.')# start tag = $2
|
335 |
-
'.$attr.'> # attributes followed by > and \n
|
336 |
-
'.$content.' # content, support nesting
|
337 |
-
</\2> # the matching end tag
|
338 |
-
[ ]* # trailing spaces/tabs
|
339 |
-
(?=\n+|\Z) # followed by a newline or end of document
|
340 |
-
|
341 |
-
| # Special version for tags of group a.
|
342 |
-
|
343 |
-
[ ]{0,'.$less_than_tab.'}
|
344 |
-
<('.$block_tags_a_re.')# start tag = $3
|
345 |
-
'.$attr.'>[ ]*\n # attributes followed by >
|
346 |
-
'.$content2.' # content, support nesting
|
347 |
-
</\3> # the matching end tag
|
348 |
-
[ ]* # trailing spaces/tabs
|
349 |
-
(?=\n+|\Z) # followed by a newline or end of document
|
350 |
-
|
351 |
-
| # Special case just for <hr />. It was easier to make a special
|
352 |
-
# case than to make the other regex more complicated.
|
353 |
-
|
354 |
-
[ ]{0,'.$less_than_tab.'}
|
355 |
-
<(hr) # start tag = $2
|
356 |
-
'.$attr.' # attributes
|
357 |
-
/?> # the matching end tag
|
358 |
-
[ ]*
|
359 |
-
(?=\n{2,}|\Z) # followed by a blank line or end of document
|
360 |
-
|
361 |
-
| # Special case for standalone HTML comments:
|
362 |
-
|
363 |
-
[ ]{0,'.$less_than_tab.'}
|
364 |
-
(?s:
|
365 |
-
<!-- .*? -->
|
366 |
-
)
|
367 |
-
[ ]*
|
368 |
-
(?=\n{2,}|\Z) # followed by a blank line or end of document
|
369 |
-
|
370 |
-
| # PHP and ASP-style processor instructions (<? and <%)
|
371 |
-
|
372 |
-
[ ]{0,'.$less_than_tab.'}
|
373 |
-
(?s:
|
374 |
-
<([?%]) # $2
|
375 |
-
.*?
|
376 |
-
\2>
|
377 |
-
)
|
378 |
-
[ ]*
|
379 |
-
(?=\n{2,}|\Z) # followed by a blank line or end of document
|
380 |
-
|
381 |
-
)
|
382 |
-
)}Sxmi',
|
383 |
-
array(&$this, '_hashHTMLBlocks_callback'),
|
384 |
-
$text);
|
385 |
-
|
386 |
-
return $text;
|
387 |
-
}
|
388 |
-
function _hashHTMLBlocks_callback($matches) {
|
389 |
-
$text = $matches[1];
|
390 |
-
$key = $this->hashBlock($text);
|
391 |
-
return "\n\n$key\n\n";
|
392 |
-
}
|
393 |
-
|
394 |
-
|
395 |
-
function hashPart($text, $boundary = 'X') {
|
396 |
-
#
|
397 |
-
# Called whenever a tag must be hashed when a function insert an atomic
|
398 |
-
# element in the text stream. Passing $text to through this function gives
|
399 |
-
# a unique text-token which will be reverted back when calling unhash.
|
400 |
-
#
|
401 |
-
# The $boundary argument specify what character should be used to surround
|
402 |
-
# the token. By convension, "B" is used for block elements that needs not
|
403 |
-
# to be wrapped into paragraph tags at the end, ":" is used for elements
|
404 |
-
# that are word separators and "X" is used in the general case.
|
405 |
-
#
|
406 |
-
# Swap back any tag hash found in $text so we do not have to `unhash`
|
407 |
-
# multiple times at the end.
|
408 |
-
$text = $this->unhash($text);
|
409 |
-
|
410 |
-
# Then hash the block.
|
411 |
-
static $i = 0;
|
412 |
-
$key = "$boundary\x1A" . ++$i . $boundary;
|
413 |
-
$this->html_hashes[$key] = $text;
|
414 |
-
return $key; # String that will replace the tag.
|
415 |
-
}
|
416 |
-
|
417 |
-
|
418 |
-
function hashBlock($text) {
|
419 |
-
#
|
420 |
-
# Shortcut function for hashPart with block-level boundaries.
|
421 |
-
#
|
422 |
-
return $this->hashPart($text, 'B');
|
423 |
-
}
|
424 |
-
|
425 |
-
|
426 |
-
public $block_gamut = array(
|
427 |
-
#
|
428 |
-
# These are all the transformations that form block-level
|
429 |
-
# tags like paragraphs, headers, and list items.
|
430 |
-
#
|
431 |
-
"doHeaders" => 10,
|
432 |
-
"doHorizontalRules" => 20,
|
433 |
-
|
434 |
-
"doLists" => 40,
|
435 |
-
"doCodeBlocks" => 50,
|
436 |
-
"doBlockQuotes" => 60,
|
437 |
-
);
|
438 |
-
|
439 |
-
function runBlockGamut($text) {
|
440 |
-
#
|
441 |
-
# Run block gamut tranformations.
|
442 |
-
#
|
443 |
-
# We need to escape raw HTML in Markdown source before doing anything
|
444 |
-
# else. This need to be done for each block, and not only at the
|
445 |
-
# beginning in the Markdown function since hashed blocks can be part of
|
446 |
-
# list items and could have been indented. Indented blocks would have
|
447 |
-
# been seen as a code block in a previous pass of hashHTMLBlocks.
|
448 |
-
$text = $this->hashHTMLBlocks($text);
|
449 |
-
|
450 |
-
return $this->runBasicBlockGamut($text);
|
451 |
-
}
|
452 |
-
|
453 |
-
function runBasicBlockGamut($text) {
|
454 |
-
#
|
455 |
-
# Run block gamut tranformations, without hashing HTML blocks. This is
|
456 |
-
# useful when HTML blocks are known to be already hashed, like in the first
|
457 |
-
# whole-document pass.
|
458 |
-
#
|
459 |
-
foreach ($this->block_gamut as $method => $priority) {
|
460 |
-
$text = $this->$method($text);
|
461 |
-
}
|
462 |
-
|
463 |
-
# Finally form paragraph and restore hashed blocks.
|
464 |
-
$text = $this->formParagraphs($text);
|
465 |
-
|
466 |
-
return $text;
|
467 |
-
}
|
468 |
-
|
469 |
-
|
470 |
-
function doHorizontalRules($text) {
|
471 |
-
# Do Horizontal Rules:
|
472 |
-
return preg_replace(
|
473 |
-
'{
|
474 |
-
^[ ]{0,3} # Leading space
|
475 |
-
([-*_]) # $1: First marker
|
476 |
-
(?> # Repeated marker group
|
477 |
-
[ ]{0,2} # Zero, one, or two spaces.
|
478 |
-
\1 # Marker character
|
479 |
-
){2,} # Group repeated at least twice
|
480 |
-
[ ]* # Tailing spaces
|
481 |
-
$ # End of line.
|
482 |
-
}mx',
|
483 |
-
"\n".$this->hashBlock("<hr$this->empty_element_suffix")."\n",
|
484 |
-
$text);
|
485 |
-
}
|
486 |
-
|
487 |
-
|
488 |
-
public $span_gamut = array(
|
489 |
-
#
|
490 |
-
# These are all the transformations that occur *within* block-level
|
491 |
-
# tags like paragraphs, headers, and list items.
|
492 |
-
#
|
493 |
-
# Process character escapes, code spans, and inline HTML
|
494 |
-
# in one shot.
|
495 |
-
"parseSpan" => -30,
|
496 |
-
|
497 |
-
# Process anchor and image tags. Images must come first,
|
498 |
-
# because ![foo][f] looks like an anchor.
|
499 |
-
"doImages" => 10,
|
500 |
-
"doAnchors" => 20,
|
501 |
-
|
502 |
-
# Make links out of things like `<http://example.com/>`
|
503 |
-
# Must come after doAnchors, because you can use < and >
|
504 |
-
# delimiters in inline links like [this](<url>).
|
505 |
-
"doAutoLinks" => 30,
|
506 |
-
"encodeAmpsAndAngles" => 40,
|
507 |
-
|
508 |
-
"doItalicsAndBold" => 50,
|
509 |
-
"doHardBreaks" => 60,
|
510 |
-
);
|
511 |
-
|
512 |
-
function runSpanGamut($text) {
|
513 |
-
#
|
514 |
-
# Run span gamut tranformations.
|
515 |
-
#
|
516 |
-
foreach ($this->span_gamut as $method => $priority) {
|
517 |
-
$text = $this->$method($text);
|
518 |
-
}
|
519 |
-
|
520 |
-
return $text;
|
521 |
-
}
|
522 |
-
|
523 |
-
|
524 |
-
function doHardBreaks($text) {
|
525 |
-
# Do hard breaks:
|
526 |
-
return preg_replace_callback('/ {2,}\n/',
|
527 |
-
array(&$this, '_doHardBreaks_callback'), $text);
|
528 |
-
}
|
529 |
-
function _doHardBreaks_callback($matches) {
|
530 |
-
return $this->hashPart("<br$this->empty_element_suffix\n");
|
531 |
-
}
|
532 |
-
|
533 |
-
|
534 |
-
function doAnchors($text) {
|
535 |
-
#
|
536 |
-
# Turn Markdown link shortcuts into XHTML <a> tags.
|
537 |
-
#
|
538 |
-
if ($this->in_anchor) return $text;
|
539 |
-
$this->in_anchor = true;
|
540 |
-
|
541 |
-
#
|
542 |
-
# First, handle reference-style links: [link text] [id]
|
543 |
-
#
|
544 |
-
$text = preg_replace_callback('{
|
545 |
-
( # wrap whole match in $1
|
546 |
-
\[
|
547 |
-
('.$this->nested_brackets_re.') # link text = $2
|
548 |
-
\]
|
549 |
-
|
550 |
-
[ ]? # one optional space
|
551 |
-
(?:\n[ ]*)? # one optional newline followed by spaces
|
552 |
-
|
553 |
-
\[
|
554 |
-
(.*?) # id = $3
|
555 |
-
\]
|
556 |
-
)
|
557 |
-
}xs',
|
558 |
-
array(&$this, '_doAnchors_reference_callback'), $text);
|
559 |
-
|
560 |
-
#
|
561 |
-
# Next, inline-style links: [link text](url "optional title")
|
562 |
-
#
|
563 |
-
$text = preg_replace_callback('{
|
564 |
-
( # wrap whole match in $1
|
565 |
-
\[
|
566 |
-
('.$this->nested_brackets_re.') # link text = $2
|
567 |
-
\]
|
568 |
-
\( # literal paren
|
569 |
-
[ \n]*
|
570 |
-
(?:
|
571 |
-
<(.+?)> # href = $3
|
572 |
-
|
|
573 |
-
('.$this->nested_url_parenthesis_re.') # href = $4
|
574 |
-
)
|
575 |
-
[ \n]*
|
576 |
-
( # $5
|
577 |
-
([\'"]) # quote char = $6
|
578 |
-
(.*?) # Title = $7
|
579 |
-
\6 # matching quote
|
580 |
-
[ \n]* # ignore any spaces/tabs between closing quote and )
|
581 |
-
)? # title is optional
|
582 |
-
\)
|
583 |
-
)
|
584 |
-
}xs',
|
585 |
-
array(&$this, '_doAnchors_inline_callback'), $text);
|
586 |
-
|
587 |
-
#
|
588 |
-
# Last, handle reference-style shortcuts: [link text]
|
589 |
-
# These must come last in case you've also got [link text][1]
|
590 |
-
# or [link text](/foo)
|
591 |
-
#
|
592 |
-
$text = preg_replace_callback('{
|
593 |
-
( # wrap whole match in $1
|
594 |
-
\[
|
595 |
-
([^\[\]]+) # link text = $2; can\'t contain [ or ]
|
596 |
-
\]
|
597 |
-
)
|
598 |
-
}xs',
|
599 |
-
array(&$this, '_doAnchors_reference_callback'), $text);
|
600 |
-
|
601 |
-
$this->in_anchor = false;
|
602 |
-
return $text;
|
603 |
-
}
|
604 |
-
function _doAnchors_reference_callback($matches) {
|
605 |
-
$whole_match = $matches[1];
|
606 |
-
$link_text = $matches[2];
|
607 |
-
$link_id =& $matches[3];
|
608 |
-
|
609 |
-
if ($link_id == "") {
|
610 |
-
# for shortcut links like [this][] or [this].
|
611 |
-
$link_id = $link_text;
|
612 |
-
}
|
613 |
-
|
614 |
-
# lower-case and turn embedded newlines into spaces
|
615 |
-
$link_id = strtolower($link_id);
|
616 |
-
$link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
|
617 |
-
|
618 |
-
if (isset($this->urls[$link_id])) {
|
619 |
-
$url = $this->urls[$link_id];
|
620 |
-
$url = $this->encodeAttribute($url);
|
621 |
-
|
622 |
-
$result = "<a href=\"$url\"";
|
623 |
-
if ( isset( $this->titles[$link_id] ) ) {
|
624 |
-
$title = $this->titles[$link_id];
|
625 |
-
$title = $this->encodeAttribute($title);
|
626 |
-
$result .= " title=\"$title\"";
|
627 |
-
}
|
628 |
-
|
629 |
-
$link_text = $this->runSpanGamut($link_text);
|
630 |
-
$result .= ">$link_text</a>";
|
631 |
-
$result = $this->hashPart($result);
|
632 |
-
}
|
633 |
-
else {
|
634 |
-
$result = $whole_match;
|
635 |
-
}
|
636 |
-
return $result;
|
637 |
-
}
|
638 |
-
function _doAnchors_inline_callback($matches) {
|
639 |
-
$whole_match = $matches[1];
|
640 |
-
$link_text = $this->runSpanGamut($matches[2]);
|
641 |
-
$url = $matches[3] == '' ? $matches[4] : $matches[3];
|
642 |
-
$title =& $matches[7];
|
643 |
-
|
644 |
-
$url = $this->encodeAttribute($url);
|
645 |
-
|
646 |
-
$result = "<a href=\"$url\"";
|
647 |
-
if (isset($title)) {
|
648 |
-
$title = $this->encodeAttribute($title);
|
649 |
-
$result .= " title=\"$title\"";
|
650 |
-
}
|
651 |
-
|
652 |
-
$link_text = $this->runSpanGamut($link_text);
|
653 |
-
$result .= ">$link_text</a>";
|
654 |
-
|
655 |
-
return $this->hashPart($result);
|
656 |
-
}
|
657 |
-
|
658 |
-
|
659 |
-
function doImages($text) {
|
660 |
-
#
|
661 |
-
# Turn Markdown image shortcuts into <img> tags.
|
662 |
-
#
|
663 |
-
#
|
664 |
-
# First, handle reference-style labeled images: ![alt text][id]
|
665 |
-
#
|
666 |
-
$text = preg_replace_callback('{
|
667 |
-
( # wrap whole match in $1
|
668 |
-
!\[
|
669 |
-
('.$this->nested_brackets_re.') # alt text = $2
|
670 |
-
\]
|
671 |
-
|
672 |
-
[ ]? # one optional space
|
673 |
-
(?:\n[ ]*)? # one optional newline followed by spaces
|
674 |
-
|
675 |
-
\[
|
676 |
-
(.*?) # id = $3
|
677 |
-
\]
|
678 |
-
|
679 |
-
)
|
680 |
-
}xs',
|
681 |
-
array(&$this, '_doImages_reference_callback'), $text);
|
682 |
-
|
683 |
-
#
|
684 |
-
# Next, handle inline images: ![alt text](url "optional title")
|
685 |
-
# Don't forget: encode * and _
|
686 |
-
#
|
687 |
-
$text = preg_replace_callback('{
|
688 |
-
( # wrap whole match in $1
|
689 |
-
!\[
|
690 |
-
('.$this->nested_brackets_re.') # alt text = $2
|
691 |
-
\]
|
692 |
-
\s? # One optional whitespace character
|
693 |
-
\( # literal paren
|
694 |
-
[ \n]*
|
695 |
-
(?:
|
696 |
-
<(\S*)> # src url = $3
|
697 |
-
|
|
698 |
-
('.$this->nested_url_parenthesis_re.') # src url = $4
|
699 |
-
)
|
700 |
-
[ \n]*
|
701 |
-
( # $5
|
702 |
-
([\'"]) # quote char = $6
|
703 |
-
(.*?) # title = $7
|
704 |
-
\6 # matching quote
|
705 |
-
[ \n]*
|
706 |
-
)? # title is optional
|
707 |
-
\)
|
708 |
-
)
|
709 |
-
}xs',
|
710 |
-
array(&$this, '_doImages_inline_callback'), $text);
|
711 |
-
|
712 |
-
return $text;
|
713 |
-
}
|
714 |
-
function _doImages_reference_callback($matches) {
|
715 |
-
$whole_match = $matches[1];
|
716 |
-
$alt_text = $matches[2];
|
717 |
-
$link_id = strtolower($matches[3]);
|
718 |
-
|
719 |
-
if ($link_id == "") {
|
720 |
-
$link_id = strtolower($alt_text); # for shortcut links like ![this][].
|
721 |
-
}
|
722 |
-
|
723 |
-
$alt_text = $this->encodeAttribute($alt_text);
|
724 |
-
if (isset($this->urls[$link_id])) {
|
725 |
-
$url = $this->encodeAttribute($this->urls[$link_id]);
|
726 |
-
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
727 |
-
if (isset($this->titles[$link_id])) {
|
728 |
-
$title = $this->titles[$link_id];
|
729 |
-
$title = $this->encodeAttribute($title);
|
730 |
-
$result .= " title=\"$title\"";
|
731 |
-
}
|
732 |
-
$result .= $this->empty_element_suffix;
|
733 |
-
$result = $this->hashPart($result);
|
734 |
-
}
|
735 |
-
else {
|
736 |
-
# If there's no such link ID, leave intact:
|
737 |
-
$result = $whole_match;
|
738 |
-
}
|
739 |
-
|
740 |
-
return $result;
|
741 |
-
}
|
742 |
-
function _doImages_inline_callback($matches) {
|
743 |
-
$whole_match = $matches[1];
|
744 |
-
$alt_text = $matches[2];
|
745 |
-
$url = $matches[3] == '' ? $matches[4] : $matches[3];
|
746 |
-
$title =& $matches[7];
|
747 |
-
|
748 |
-
$alt_text = $this->encodeAttribute($alt_text);
|
749 |
-
$url = $this->encodeAttribute($url);
|
750 |
-
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
751 |
-
if (isset($title)) {
|
752 |
-
$title = $this->encodeAttribute($title);
|
753 |
-
$result .= " title=\"$title\""; # $title already quoted
|
754 |
-
}
|
755 |
-
$result .= $this->empty_element_suffix;
|
756 |
-
|
757 |
-
return $this->hashPart($result);
|
758 |
-
}
|
759 |
-
|
760 |
-
|
761 |
-
function doHeaders($text) {
|
762 |
-
# Setext-style headers:
|
763 |
-
# Header 1
|
764 |
-
# ========
|
765 |
-
#
|
766 |
-
# Header 2
|
767 |
-
# --------
|
768 |
-
#
|
769 |
-
$text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx',
|
770 |
-
array(&$this, '_doHeaders_callback_setext'), $text);
|
771 |
-
|
772 |
-
# atx-style headers:
|
773 |
-
# # Header 1
|
774 |
-
# ## Header 2
|
775 |
-
# ## Header 2 with closing hashes ##
|
776 |
-
# ...
|
777 |
-
# ###### Header 6
|
778 |
-
#
|
779 |
-
$text = preg_replace_callback('{
|
780 |
-
^(\#{1,6}) # $1 = string of #\'s
|
781 |
-
[ ]*
|
782 |
-
(.+?) # $2 = Header text
|
783 |
-
[ ]*
|
784 |
-
\#* # optional closing #\'s (not counted)
|
785 |
-
\n+
|
786 |
-
}xm',
|
787 |
-
array(&$this, '_doHeaders_callback_atx'), $text);
|
788 |
-
|
789 |
-
return $text;
|
790 |
-
}
|
791 |
-
function _doHeaders_callback_setext($matches) {
|
792 |
-
# Terrible hack to check we haven't found an empty list item.
|
793 |
-
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
|
794 |
-
return $matches[0];
|
795 |
-
|
796 |
-
$level = $matches[2]{0} == '=' ? 1 : 2;
|
797 |
-
$block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
|
798 |
-
return "\n" . $this->hashBlock($block) . "\n\n";
|
799 |
-
}
|
800 |
-
function _doHeaders_callback_atx($matches) {
|
801 |
-
$level = strlen($matches[1]);
|
802 |
-
$block = "<h$level>".$this->runSpanGamut($matches[2])."</h$level>";
|
803 |
-
return "\n" . $this->hashBlock($block) . "\n\n";
|
804 |
-
}
|
805 |
-
|
806 |
-
|
807 |
-
function doLists($text) {
|
808 |
-
#
|
809 |
-
# Form HTML ordered (numbered) and unordered (bulleted) lists.
|
810 |
-
#
|
811 |
-
$less_than_tab = $this->tab_width - 1;
|
812 |
-
|
813 |
-
# Re-usable patterns to match list item bullets and number markers:
|
814 |
-
$marker_ul_re = '[*+-]';
|
815 |
-
$marker_ol_re = '\d+[\.]';
|
816 |
-
$marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
|
817 |
-
|
818 |
-
$markers_relist = array(
|
819 |
-
$marker_ul_re => $marker_ol_re,
|
820 |
-
$marker_ol_re => $marker_ul_re,
|
821 |
-
);
|
822 |
-
|
823 |
-
foreach ($markers_relist as $marker_re => $other_marker_re) {
|
824 |
-
# Re-usable pattern to match any entirel ul or ol list:
|
825 |
-
$whole_list_re = '
|
826 |
-
( # $1 = whole list
|
827 |
-
( # $2
|
828 |
-
([ ]{0,'.$less_than_tab.'}) # $3 = number of spaces
|
829 |
-
('.$marker_re.') # $4 = first list item marker
|
830 |
-
[ ]+
|
831 |
-
)
|
832 |
-
(?s:.+?)
|
833 |
-
( # $5
|
834 |
-
\z
|
835 |
-
|
|
836 |
-
\n{2,}
|
837 |
-
(?=\S)
|
838 |
-
(?! # Negative lookahead for another list item marker
|
839 |
-
[ ]*
|
840 |
-
'.$marker_re.'[ ]+
|
841 |
-
)
|
842 |
-
|
|
843 |
-
(?= # Lookahead for another kind of list
|
844 |
-
\n
|
845 |
-
\3 # Must have the same indentation
|
846 |
-
'.$other_marker_re.'[ ]+
|
847 |
-
)
|
848 |
-
)
|
849 |
-
)
|
850 |
-
'; // mx
|
851 |
-
|
852 |
-
# We use a different prefix before nested lists than top-level lists.
|
853 |
-
# See extended comment in _ProcessListItems().
|
854 |
-
|
855 |
-
if ($this->list_level) {
|
856 |
-
$text = preg_replace_callback('{
|
857 |
-
^
|
858 |
-
'.$whole_list_re.'
|
859 |
-
}mx',
|
860 |
-
array(&$this, '_doLists_callback'), $text);
|
861 |
-
}
|
862 |
-
else {
|
863 |
-
$text = preg_replace_callback('{
|
864 |
-
(?:(?<=\n)\n|\A\n?) # Must eat the newline
|
865 |
-
'.$whole_list_re.'
|
866 |
-
}mx',
|
867 |
-
array(&$this, '_doLists_callback'), $text);
|
868 |
-
}
|
869 |
-
}
|
870 |
-
|
871 |
-
return $text;
|
872 |
-
}
|
873 |
-
function _doLists_callback($matches) {
|
874 |
-
# Re-usable patterns to match list item bullets and number markers:
|
875 |
-
$marker_ul_re = '[*+-]';
|
876 |
-
$marker_ol_re = '\d+[\.]';
|
877 |
-
$marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
|
878 |
-
|
879 |
-
$list = $matches[1];
|
880 |
-
$list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol";
|
881 |
-
|
882 |
-
$marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re );
|
883 |
-
|
884 |
-
$list .= "\n";
|
885 |
-
$result = $this->processListItems($list, $marker_any_re);
|
886 |
-
|
887 |
-
$result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>");
|
888 |
-
return "\n". $result ."\n\n";
|
889 |
-
}
|
890 |
-
|
891 |
-
public $list_level = 0;
|
892 |
-
|
893 |
-
function processListItems($list_str, $marker_any_re) {
|
894 |
-
#
|
895 |
-
# Process the contents of a single ordered or unordered list, splitting it
|
896 |
-
# into individual list items.
|
897 |
-
#
|
898 |
-
# The $this->list_level global keeps track of when we're inside a list.
|
899 |
-
# Each time we enter a list, we increment it; when we leave a list,
|
900 |
-
# we decrement. If it's zero, we're not in a list anymore.
|
901 |
-
#
|
902 |
-
# We do this because when we're not inside a list, we want to treat
|
903 |
-
# something like this:
|
904 |
-
#
|
905 |
-
# I recommend upgrading to version
|
906 |
-
# 8. Oops, now this line is treated
|
907 |
-
# as a sub-list.
|
908 |
-
#
|
909 |
-
# As a single paragraph, despite the fact that the second line starts
|
910 |
-
# with a digit-period-space sequence.
|
911 |
-
#
|
912 |
-
# Whereas when we're inside a list (or sub-list), that line will be
|
913 |
-
# treated as the start of a sub-list. What a kludge, huh? This is
|
914 |
-
# an aspect of Markdown's syntax that's hard to parse perfectly
|
915 |
-
# without resorting to mind-reading. Perhaps the solution is to
|
916 |
-
# change the syntax rules such that sub-lists must start with a
|
917 |
-
# starting cardinal number; e.g. "1." or "a.".
|
918 |
-
|
919 |
-
$this->list_level++;
|
920 |
-
|
921 |
-
# trim trailing blank lines:
|
922 |
-
$list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
|
923 |
-
|
924 |
-
$list_str = preg_replace_callback('{
|
925 |
-
(\n)? # leading line = $1
|
926 |
-
(^[ ]*) # leading whitespace = $2
|
927 |
-
('.$marker_any_re.' # list marker and space = $3
|
928 |
-
(?:[ ]+|(?=\n)) # space only required if item is not empty
|
929 |
-
)
|
930 |
-
((?s:.*?)) # list item text = $4
|
931 |
-
(?:(\n+(?=\n))|\n) # tailing blank line = $5
|
932 |
-
(?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n))))
|
933 |
-
}xm',
|
934 |
-
array(&$this, '_processListItems_callback'), $list_str);
|
935 |
-
|
936 |
-
$this->list_level--;
|
937 |
-
return $list_str;
|
938 |
-
}
|
939 |
-
function _processListItems_callback($matches) {
|
940 |
-
$item = $matches[4];
|
941 |
-
$leading_line =& $matches[1];
|
942 |
-
$leading_space =& $matches[2];
|
943 |
-
$marker_space = $matches[3];
|
944 |
-
$tailing_blank_line =& $matches[5];
|
945 |
-
|
946 |
-
if ($leading_line || $tailing_blank_line ||
|
947 |
-
preg_match('/\n{2,}/', $item))
|
948 |
-
{
|
949 |
-
# Replace marker with the appropriate whitespace indentation
|
950 |
-
$item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item;
|
951 |
-
$item = $this->runBlockGamut($this->outdent($item)."\n");
|
952 |
-
}
|
953 |
-
else {
|
954 |
-
# Recursion for sub-lists:
|
955 |
-
$item = $this->doLists($this->outdent($item));
|
956 |
-
$item = preg_replace('/\n+$/', '', $item);
|
957 |
-
$item = $this->runSpanGamut($item);
|
958 |
-
}
|
959 |
-
|
960 |
-
return "<li>" . $item . "</li>\n";
|
961 |
-
}
|
962 |
-
|
963 |
-
|
964 |
-
function doCodeBlocks($text) {
|
965 |
-
#
|
966 |
-
# Process Markdown `<pre><code>` blocks.
|
967 |
-
#
|
968 |
-
$text = preg_replace_callback('{
|
969 |
-
(?:\n\n|\A\n?)
|
970 |
-
( # $1 = the code block -- one or more lines, starting with a space/tab
|
971 |
-
(?>
|
972 |
-
[ ]{'.$this->tab_width.'} # Lines must start with a tab or a tab-width of spaces
|
973 |
-
.*\n+
|
974 |
-
)+
|
975 |
-
)
|
976 |
-
((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
|
977 |
-
}xm',
|
978 |
-
array(&$this, '_doCodeBlocks_callback'), $text);
|
979 |
-
|
980 |
-
return $text;
|
981 |
-
}
|
982 |
-
function _doCodeBlocks_callback($matches) {
|
983 |
-
$codeblock = $matches[1];
|
984 |
-
|
985 |
-
$codeblock = $this->outdent($codeblock);
|
986 |
-
$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
|
987 |
-
|
988 |
-
# trim leading newlines and trailing newlines
|
989 |
-
$codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
|
990 |
-
|
991 |
-
$codeblock = "<pre><code>$codeblock\n</code></pre>";
|
992 |
-
return "\n\n".$this->hashBlock($codeblock)."\n\n";
|
993 |
-
}
|
994 |
-
|
995 |
-
|
996 |
-
function makeCodeSpan($code) {
|
997 |
-
#
|
998 |
-
# Create a code span markup for $code. Called from handleSpanToken.
|
999 |
-
#
|
1000 |
-
$code = htmlspecialchars(trim($code), ENT_NOQUOTES);
|
1001 |
-
return $this->hashPart("<code>$code</code>");
|
1002 |
-
}
|
1003 |
-
|
1004 |
-
|
1005 |
-
public $em_relist = array(
|
1006 |
-
'' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?=\S|$)(?![\.,:;]\s)',
|
1007 |
-
'*' => '(?<=\S|^)(?<!\*)\*(?!\*)',
|
1008 |
-
'_' => '(?<=\S|^)(?<!_)_(?!_)',
|
1009 |
-
);
|
1010 |
-
public $strong_relist = array(
|
1011 |
-
'' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?=\S|$)(?![\.,:;]\s)',
|
1012 |
-
'**' => '(?<=\S|^)(?<!\*)\*\*(?!\*)',
|
1013 |
-
'__' => '(?<=\S|^)(?<!_)__(?!_)',
|
1014 |
-
);
|
1015 |
-
public $em_strong_relist = array(
|
1016 |
-
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?=\S|$)(?![\.,:;]\s)',
|
1017 |
-
'***' => '(?<=\S|^)(?<!\*)\*\*\*(?!\*)',
|
1018 |
-
'___' => '(?<=\S|^)(?<!_)___(?!_)',
|
1019 |
-
);
|
1020 |
-
public $em_strong_prepared_relist;
|
1021 |
-
|
1022 |
-
function prepareItalicsAndBold() {
|
1023 |
-
#
|
1024 |
-
# Prepare regular expressions for searching emphasis tokens in any
|
1025 |
-
# context.
|
1026 |
-
#
|
1027 |
-
foreach ($this->em_relist as $em => $em_re) {
|
1028 |
-
foreach ($this->strong_relist as $strong => $strong_re) {
|
1029 |
-
# Construct list of allowed token expressions.
|
1030 |
-
$token_relist = array();
|
1031 |
-
if (isset($this->em_strong_relist["$em$strong"])) {
|
1032 |
-
$token_relist[] = $this->em_strong_relist["$em$strong"];
|
1033 |
-
}
|
1034 |
-
$token_relist[] = $em_re;
|
1035 |
-
$token_relist[] = $strong_re;
|
1036 |
-
|
1037 |
-
# Construct master expression from list.
|
1038 |
-
$token_re = '{('. implode('|', $token_relist) .')}';
|
1039 |
-
$this->em_strong_prepared_relist["$em$strong"] = $token_re;
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
function doItalicsAndBold($text) {
|
1045 |
-
$token_stack = array('');
|
1046 |
-
$text_stack = array('');
|
1047 |
-
$em = '';
|
1048 |
-
$strong = '';
|
1049 |
-
$tree_char_em = false;
|
1050 |
-
|
1051 |
-
while (1) {
|
1052 |
-
#
|
1053 |
-
# Get prepared regular expression for seraching emphasis tokens
|
1054 |
-
# in current context.
|
1055 |
-
#
|
1056 |
-
$token_re = $this->em_strong_prepared_relist["$em$strong"];
|
1057 |
-
|
1058 |
-
#
|
1059 |
-
# Each loop iteration search for the next emphasis token.
|
1060 |
-
# Each token is then passed to handleSpanToken.
|
1061 |
-
#
|
1062 |
-
$parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
|
1063 |
-
$text_stack[0] .= $parts[0];
|
1064 |
-
$token =& $parts[1];
|
1065 |
-
$text =& $parts[2];
|
1066 |
-
|
1067 |
-
if (empty($token)) {
|
1068 |
-
# Reached end of text span: empty stack without emitting.
|
1069 |
-
# any more emphasis.
|
1070 |
-
while ($token_stack[0]) {
|
1071 |
-
$text_stack[1] .= array_shift($token_stack);
|
1072 |
-
$text_stack[0] .= array_shift($text_stack);
|
1073 |
-
}
|
1074 |
-
break;
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
$token_len = strlen($token);
|
1078 |
-
if ($tree_char_em) {
|
1079 |
-
# Reached closing marker while inside a three-char emphasis.
|
1080 |
-
if ($token_len == 3) {
|
1081 |
-
# Three-char closing marker, close em and strong.
|
1082 |
-
array_shift($token_stack);
|
1083 |
-
$span = array_shift($text_stack);
|
1084 |
-
$span = $this->runSpanGamut($span);
|
1085 |
-
$span = "<strong><em>$span</em></strong>";
|
1086 |
-
$text_stack[0] .= $this->hashPart($span);
|
1087 |
-
$em = '';
|
1088 |
-
$strong = '';
|
1089 |
-
} else {
|
1090 |
-
# Other closing marker: close one em or strong and
|
1091 |
-
# change current token state to match the other
|
1092 |
-
$token_stack[0] = str_repeat($token{0}, 3-$token_len);
|
1093 |
-
$tag = $token_len == 2 ? "strong" : "em";
|
1094 |
-
$span = $text_stack[0];
|
1095 |
-
$span = $this->runSpanGamut($span);
|
1096 |
-
$span = "<$tag>$span</$tag>";
|
1097 |
-
$text_stack[0] = $this->hashPart($span);
|
1098 |
-
$$tag = ''; # $$tag stands for $em or $strong
|
1099 |
-
}
|
1100 |
-
$tree_char_em = false;
|
1101 |
-
} else if ($token_len == 3) {
|
1102 |
-
if ($em) {
|
1103 |
-
# Reached closing marker for both em and strong.
|
1104 |
-
# Closing strong marker:
|
1105 |
-
for ($i = 0; $i < 2; ++$i) {
|
1106 |
-
$shifted_token = array_shift($token_stack);
|
1107 |
-
$tag = strlen($shifted_token) == 2 ? "strong" : "em";
|
1108 |
-
$span = array_shift($text_stack);
|
1109 |
-
$span = $this->runSpanGamut($span);
|
1110 |
-
$span = "<$tag>$span</$tag>";
|
1111 |
-
$text_stack[0] .= $this->hashPart($span);
|
1112 |
-
$$tag = ''; # $$tag stands for $em or $strong
|
1113 |
-
}
|
1114 |
-
} else {
|
1115 |
-
# Reached opening three-char emphasis marker. Push on token
|
1116 |
-
# stack; will be handled by the special condition above.
|
1117 |
-
$em = $token{0};
|
1118 |
-
$strong = "$em$em";
|
1119 |
-
array_unshift($token_stack, $token);
|
1120 |
-
array_unshift($text_stack, '');
|
1121 |
-
$tree_char_em = true;
|
1122 |
-
}
|
1123 |
-
} else if ($token_len == 2) {
|
1124 |
-
if ($strong) {
|
1125 |
-
# Unwind any dangling emphasis marker:
|
1126 |
-
if (strlen($token_stack[0]) == 1) {
|
1127 |
-
$text_stack[1] .= array_shift($token_stack);
|
1128 |
-
$text_stack[0] .= array_shift($text_stack);
|
1129 |
-
}
|
1130 |
-
# Closing strong marker:
|
1131 |
-
array_shift($token_stack);
|
1132 |
-
$span = array_shift($text_stack);
|
1133 |
-
$span = $this->runSpanGamut($span);
|
1134 |
-
$span = "<strong>$span</strong>";
|
1135 |
-
$text_stack[0] .= $this->hashPart($span);
|
1136 |
-
$strong = '';
|
1137 |
-
} else {
|
1138 |
-
array_unshift($token_stack, $token);
|
1139 |
-
array_unshift($text_stack, '');
|
1140 |
-
$strong = $token;
|
1141 |
-
}
|
1142 |
-
} else {
|
1143 |
-
# Here $token_len == 1
|
1144 |
-
if ($em) {
|
1145 |
-
if (strlen($token_stack[0]) == 1) {
|
1146 |
-
# Closing emphasis marker:
|
1147 |
-
array_shift($token_stack);
|
1148 |
-
$span = array_shift($text_stack);
|
1149 |
-
$span = $this->runSpanGamut($span);
|
1150 |
-
$span = "<em>$span</em>";
|
1151 |
-
$text_stack[0] .= $this->hashPart($span);
|
1152 |
-
$em = '';
|
1153 |
-
} else {
|
1154 |
-
$text_stack[0] .= $token;
|
1155 |
-
}
|
1156 |
-
} else {
|
1157 |
-
array_unshift($token_stack, $token);
|
1158 |
-
array_unshift($text_stack, '');
|
1159 |
-
$em = $token;
|
1160 |
-
}
|
1161 |
-
}
|
1162 |
-
}
|
1163 |
-
return $text_stack[0];
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
|
1167 |
-
function doBlockQuotes($text) {
|
1168 |
-
$text = preg_replace_callback('/
|
1169 |
-
( # Wrap whole match in $1
|
1170 |
-
(?>
|
1171 |
-
^[ ]*>[ ]? # ">" at the start of a line
|
1172 |
-
.+\n # rest of the first line
|
1173 |
-
(.+\n)* # subsequent consecutive lines
|
1174 |
-
\n* # blanks
|
1175 |
-
)+
|
1176 |
-
)
|
1177 |
-
/xm',
|
1178 |
-
array(&$this, '_doBlockQuotes_callback'), $text);
|
1179 |
-
|
1180 |
-
return $text;
|
1181 |
-
}
|
1182 |
-
function _doBlockQuotes_callback($matches) {
|
1183 |
-
$bq = $matches[1];
|
1184 |
-
# trim one level of quoting - trim whitespace-only lines
|
1185 |
-
$bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);
|
1186 |
-
$bq = $this->runBlockGamut($bq); # recurse
|
1187 |
-
|
1188 |
-
$bq = preg_replace('/^/m', " ", $bq);
|
1189 |
-
# These leading spaces cause problem with <pre> content,
|
1190 |
-
# so we need to fix that:
|
1191 |
-
$bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
|
1192 |
-
array(&$this, '_doBlockQuotes_callback2'), $bq);
|
1193 |
-
|
1194 |
-
return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n";
|
1195 |
-
}
|
1196 |
-
function _doBlockQuotes_callback2($matches) {
|
1197 |
-
$pre = $matches[1];
|
1198 |
-
$pre = preg_replace('/^ /m', '', $pre);
|
1199 |
-
return $pre;
|
1200 |
-
}
|
1201 |
-
|
1202 |
-
|
1203 |
-
function formParagraphs($text) {
|
1204 |
-
#
|
1205 |
-
# Params:
|
1206 |
-
# $text - string to process with html <p> tags
|
1207 |
-
#
|
1208 |
-
# Strip leading and trailing lines:
|
1209 |
-
$text = preg_replace('/\A\n+|\n+\z/', '', $text);
|
1210 |
-
|
1211 |
-
$grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
|
1212 |
-
|
1213 |
-
#
|
1214 |
-
# Wrap <p> tags and unhashify HTML blocks
|
1215 |
-
#
|
1216 |
-
foreach ($grafs as $key => $value) {
|
1217 |
-
if (!preg_match('/^B\x1A[0-9]+B$/', $value)) {
|
1218 |
-
# Is a paragraph.
|
1219 |
-
$value = $this->runSpanGamut($value);
|
1220 |
-
$value = preg_replace('/^([ ]*)/', "<p>", $value);
|
1221 |
-
$value .= "</p>";
|
1222 |
-
$grafs[$key] = $this->unhash($value);
|
1223 |
-
}
|
1224 |
-
else {
|
1225 |
-
# Is a block.
|
1226 |
-
# Modify elements of @grafs in-place...
|
1227 |
-
$graf = $value;
|
1228 |
-
$block = $this->html_hashes[$graf];
|
1229 |
-
$graf = $block;
|
1230 |
-
// if (preg_match('{
|
1231 |
-
// \A
|
1232 |
-
// ( # $1 = <div> tag
|
1233 |
-
// <div \s+
|
1234 |
-
// [^>]*
|
1235 |
-
// \b
|
1236 |
-
// markdown\s*=\s* ([\'"]) # $2 = attr quote char
|
1237 |
-
// 1
|
1238 |
-
// \2
|
1239 |
-
// [^>]*
|
1240 |
-
// >
|
1241 |
-
// )
|
1242 |
-
// ( # $3 = contents
|
1243 |
-
// .*
|
1244 |
-
// )
|
1245 |
-
// (</div>) # $4 = closing tag
|
1246 |
-
// \z
|
1247 |
-
// }xs', $block, $matches))
|
1248 |
-
// {
|
1249 |
-
// list(, $div_open, , $div_content, $div_close) = $matches;
|
1250 |
-
//
|
1251 |
-
// # We can't call Markdown(), because that resets the hash;
|
1252 |
-
// # that initialization code should be pulled into its own sub, though.
|
1253 |
-
// $div_content = $this->hashHTMLBlocks($div_content);
|
1254 |
-
//
|
1255 |
-
// # Run document gamut methods on the content.
|
1256 |
-
// foreach ($this->document_gamut as $method => $priority) {
|
1257 |
-
// $div_content = $this->$method($div_content);
|
1258 |
-
// }
|
1259 |
-
//
|
1260 |
-
// $div_open = preg_replace(
|
1261 |
-
// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open);
|
1262 |
-
//
|
1263 |
-
// $graf = $div_open . "\n" . $div_content . "\n" . $div_close;
|
1264 |
-
// }
|
1265 |
-
$grafs[$key] = $graf;
|
1266 |
-
}
|
1267 |
-
}
|
1268 |
-
|
1269 |
-
return implode("\n\n", $grafs);
|
1270 |
-
}
|
1271 |
-
|
1272 |
-
|
1273 |
-
function encodeAttribute($text) {
|
1274 |
-
#
|
1275 |
-
# Encode text for a double-quoted HTML attribute. This function
|
1276 |
-
# is *not* suitable for attributes enclosed in single quotes.
|
1277 |
-
#
|
1278 |
-
$text = $this->encodeAmpsAndAngles($text);
|
1279 |
-
$text = str_replace('"', '"', $text);
|
1280 |
-
return $text;
|
1281 |
-
}
|
1282 |
-
|
1283 |
-
|
1284 |
-
function encodeAmpsAndAngles($text) {
|
1285 |
-
#
|
1286 |
-
# Smart processing for ampersands and angle brackets that need to
|
1287 |
-
# be encoded. Valid character entities are left alone unless the
|
1288 |
-
# no-entities mode is set.
|
1289 |
-
#
|
1290 |
-
if ($this->no_entities) {
|
1291 |
-
$text = str_replace('&', '&', $text);
|
1292 |
-
} else {
|
1293 |
-
# Ampersand-encoding based entirely on Nat Irons's Amputator
|
1294 |
-
# MT plugin: <http://bumppo.net/projects/amputator/>
|
1295 |
-
$text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
|
1296 |
-
'&', $text);;
|
1297 |
-
}
|
1298 |
-
# Encode remaining <'s
|
1299 |
-
$text = str_replace('<', '<', $text);
|
1300 |
-
|
1301 |
-
return $text;
|
1302 |
-
}
|
1303 |
-
|
1304 |
-
|
1305 |
-
function doAutoLinks($text) {
|
1306 |
-
$text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
|
1307 |
-
array(&$this, '_doAutoLinks_url_callback'), $text);
|
1308 |
-
|
1309 |
-
# Email addresses: <address@domain.foo>
|
1310 |
-
$text = preg_replace_callback('{
|
1311 |
-
<
|
1312 |
-
(?:mailto:)?
|
1313 |
-
(
|
1314 |
-
(?:
|
1315 |
-
[-!#$%&\'*+/=?^_`.{|}~\w\x80-\xFF]+
|
1316 |
-
|
|
1317 |
-
".*?"
|
1318 |
-
)
|
1319 |
-
\@
|
1320 |
-
(?:
|
1321 |
-
[-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+
|
1322 |
-
|
|
1323 |
-
\[[\d.a-fA-F:]+\] # IPv4 & IPv6
|
1324 |
-
)
|
1325 |
-
)
|
1326 |
-
>
|
1327 |
-
}xi',
|
1328 |
-
array(&$this, '_doAutoLinks_email_callback'), $text);
|
1329 |
-
$text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text);
|
1330 |
-
|
1331 |
-
return $text;
|
1332 |
-
}
|
1333 |
-
function _doAutoLinks_tel_callback($matches) {
|
1334 |
-
$url = $this->encodeAttribute($matches[1]);
|
1335 |
-
$tel = $this->encodeAttribute($matches[2]);
|
1336 |
-
$link = "<a href=\"$url\">$tel</a>";
|
1337 |
-
return $this->hashPart($link);
|
1338 |
-
}
|
1339 |
-
function _doAutoLinks_url_callback($matches) {
|
1340 |
-
$url = $this->encodeAttribute($matches[1]);
|
1341 |
-
$link = "<a href=\"$url\">$url</a>";
|
1342 |
-
return $this->hashPart($link);
|
1343 |
-
}
|
1344 |
-
function _doAutoLinks_email_callback($matches) {
|
1345 |
-
$address = $matches[1];
|
1346 |
-
$link = $this->encodeEmailAddress($address);
|
1347 |
-
return $this->hashPart($link);
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
|
1351 |
-
function encodeEmailAddress($addr) {
|
1352 |
-
#
|
1353 |
-
# Input: an email address, e.g. "foo@example.com"
|
1354 |
-
#
|
1355 |
-
# Output: the email address as a mailto link, with each character
|
1356 |
-
# of the address encoded as either a decimal or hex entity, in
|
1357 |
-
# the hopes of foiling most address harvesting spam bots. E.g.:
|
1358 |
-
#
|
1359 |
-
# <p><a href="mailto:foo
|
1360 |
-
# @example.co
|
1361 |
-
# m">foo@exampl
|
1362 |
-
# e.com</a></p>
|
1363 |
-
#
|
1364 |
-
# Based by a filter by Matthew Wickline, posted to BBEdit-Talk.
|
1365 |
-
# With some optimizations by Milian Wolff.
|
1366 |
-
#
|
1367 |
-
$addr = "mailto:" . $addr;
|
1368 |
-
$chars = preg_split('/(?<!^)(?!$)/', $addr);
|
1369 |
-
$seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.
|
1370 |
-
|
1371 |
-
foreach ($chars as $key => $char) {
|
1372 |
-
$ord = ord($char);
|
1373 |
-
# Ignore non-ascii chars.
|
1374 |
-
if ($ord < 128) {
|
1375 |
-
$r = ($seed * (1 + $key)) % 100; # Pseudo-random function.
|
1376 |
-
# roughly 10% raw, 45% hex, 45% dec
|
1377 |
-
# '@' *must* be encoded. I insist.
|
1378 |
-
if ($r > 90 && $char != '@') /* do nothing */;
|
1379 |
-
else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';
|
1380 |
-
else $chars[$key] = '&#'.$ord.';';
|
1381 |
-
}
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
$addr = implode('', $chars);
|
1385 |
-
$text = implode('', array_slice($chars, 7)); # text without `mailto:`
|
1386 |
-
$addr = "<a href=\"$addr\">$text</a>";
|
1387 |
-
|
1388 |
-
return $addr;
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
|
1392 |
-
function parseSpan($str) {
|
1393 |
-
#
|
1394 |
-
# Take the string $str and parse it into tokens, hashing embedded HTML,
|
1395 |
-
# escaped characters and handling code spans.
|
1396 |
-
#
|
1397 |
-
$output = '';
|
1398 |
-
|
1399 |
-
$span_re = '{
|
1400 |
-
(
|
1401 |
-
\\\\'.$this->escape_chars_re.'
|
1402 |
-
|
|
1403 |
-
(?<![`\\\\])
|
1404 |
-
`+ # code span marker
|
1405 |
-
'.( $this->no_markup ? '' : '
|
1406 |
-
|
|
1407 |
-
<!-- .*? --> # comment
|
1408 |
-
|
|
1409 |
-
<\?.*?\?> | <%.*?%> # processing instruction
|
1410 |
-
|
|
1411 |
-
<[!$]?[-a-zA-Z0-9:_]+ # regular tags
|
1412 |
-
(?>
|
1413 |
-
\s
|
1414 |
-
(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
|
1415 |
-
)?
|
1416 |
-
>
|
1417 |
-
|
|
1418 |
-
<[-a-zA-Z0-9:_]+\s*/> # xml-style empty tag
|
1419 |
-
|
|
1420 |
-
</[-a-zA-Z0-9:_]+\s*> # closing tag
|
1421 |
-
').'
|
1422 |
-
)
|
1423 |
-
}xs';
|
1424 |
-
|
1425 |
-
while (1) {
|
1426 |
-
#
|
1427 |
-
# Each loop iteration search for either the next tag, the next
|
1428 |
-
# openning code span marker, or the next escaped character.
|
1429 |
-
# Each token is then passed to handleSpanToken.
|
1430 |
-
#
|
1431 |
-
$parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
|
1432 |
-
|
1433 |
-
# Create token from text preceding tag.
|
1434 |
-
if ($parts[0] != "") {
|
1435 |
-
$output .= $parts[0];
|
1436 |
-
}
|
1437 |
-
|
1438 |
-
# Check if we reach the end.
|
1439 |
-
if (isset($parts[1])) {
|
1440 |
-
$output .= $this->handleSpanToken($parts[1], $parts[2]);
|
1441 |
-
$str = $parts[2];
|
1442 |
-
}
|
1443 |
-
else {
|
1444 |
-
break;
|
1445 |
-
}
|
1446 |
-
}
|
1447 |
-
|
1448 |
-
return $output;
|
1449 |
-
}
|
1450 |
-
|
1451 |
-
|
1452 |
-
function handleSpanToken($token, &$str) {
|
1453 |
-
#
|
1454 |
-
# Handle $token provided by parseSpan by determining its nature and
|
1455 |
-
# returning the corresponding value that should replace it.
|
1456 |
-
#
|
1457 |
-
switch ($token{0}) {
|
1458 |
-
case "\\":
|
1459 |
-
return $this->hashPart("&#". ord($token{1}). ";");
|
1460 |
-
case "`":
|
1461 |
-
# Search for end marker in remaining text.
|
1462 |
-
if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',
|
1463 |
-
$str, $matches))
|
1464 |
-
{
|
1465 |
-
$str = $matches[2];
|
1466 |
-
$codespan = $this->makeCodeSpan($matches[1]);
|
1467 |
-
return $this->hashPart($codespan);
|
1468 |
-
}
|
1469 |
-
return $token; // return as text since no ending marker found.
|
1470 |
-
default:
|
1471 |
-
return $this->hashPart($token);
|
1472 |
-
}
|
1473 |
-
}
|
1474 |
-
|
1475 |
-
|
1476 |
-
function outdent($text) {
|
1477 |
-
#
|
1478 |
-
# Remove one level of line-leading tabs or spaces
|
1479 |
-
#
|
1480 |
-
return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text);
|
1481 |
-
}
|
1482 |
-
|
1483 |
-
|
1484 |
-
# String length function for detab. `_initDetab` will create a function to
|
1485 |
-
# hanlde UTF-8 if the default function does not exist.
|
1486 |
-
public $utf8_strlen = 'mb_strlen';
|
1487 |
-
|
1488 |
-
function detab($text) {
|
1489 |
-
#
|
1490 |
-
# Replace tabs with the appropriate amount of space.
|
1491 |
-
#
|
1492 |
-
# For each line we separate the line in blocks delemited by
|
1493 |
-
# tab characters. Then we reconstruct every line by adding the
|
1494 |
-
# appropriate number of space between each blocks.
|
1495 |
-
|
1496 |
-
$text = preg_replace_callback('/^.*\t.*$/m',
|
1497 |
-
array(&$this, '_detab_callback'), $text);
|
1498 |
-
|
1499 |
-
return $text;
|
1500 |
-
}
|
1501 |
-
function _detab_callback($matches) {
|
1502 |
-
$line = $matches[0];
|
1503 |
-
$strlen = $this->utf8_strlen; # strlen function for UTF-8.
|
1504 |
-
|
1505 |
-
# Split in blocks.
|
1506 |
-
$blocks = explode("\t", $line);
|
1507 |
-
# Add each blocks to the line.
|
1508 |
-
$line = $blocks[0];
|
1509 |
-
unset($blocks[0]); # Do not add first block twice.
|
1510 |
-
foreach ($blocks as $block) {
|
1511 |
-
# Calculate amount of space, insert spaces, insert block.
|
1512 |
-
$amount = $this->tab_width -
|
1513 |
-
$strlen($line, 'UTF-8') % $this->tab_width;
|
1514 |
-
$line .= str_repeat(" ", $amount) . $block;
|
1515 |
-
}
|
1516 |
-
return $line;
|
1517 |
-
}
|
1518 |
-
function _initDetab() {
|
1519 |
-
#
|
1520 |
-
# Check for the availability of the function in the `utf8_strlen` property
|
1521 |
-
# (initially `mb_strlen`). If the function is not available, create a
|
1522 |
-
# function that will loosely count the number of UTF-8 characters with a
|
1523 |
-
# regular expression.
|
1524 |
-
#
|
1525 |
-
if (function_exists($this->utf8_strlen)) return;
|
1526 |
-
$this->utf8_strlen = create_function('$text', 'return preg_match_all(
|
1527 |
-
"/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
|
1528 |
-
$text, $m);');
|
1529 |
-
}
|
1530 |
-
|
1531 |
-
|
1532 |
-
function unhash($text) {
|
1533 |
-
#
|
1534 |
-
# Swap back in all the tags hashed by _HashHTMLBlocks.
|
1535 |
-
#
|
1536 |
-
return preg_replace_callback('/(.)\x1A[0-9]+\1/',
|
1537 |
-
array(&$this, '_unhash_callback'), $text);
|
1538 |
-
}
|
1539 |
-
function _unhash_callback($matches) {
|
1540 |
-
return $this->html_hashes[$matches[0]];
|
1541 |
-
}
|
1542 |
-
|
1543 |
-
}
|
1544 |
-
|
1545 |
-
|
1546 |
-
#
|
1547 |
-
# Markdown Extra Parser Class
|
1548 |
-
#
|
1549 |
-
|
1550 |
-
class MarkdownExtra_Parser extends Markdown_Parser {
|
1551 |
-
|
1552 |
-
### Configuration Variables ###
|
1553 |
-
|
1554 |
-
# Prefix for footnote ids.
|
1555 |
-
public $fn_id_prefix = "";
|
1556 |
-
|
1557 |
-
# Optional title attribute for footnote links and backlinks.
|
1558 |
-
public $fn_link_title = MARKDOWN_FN_LINK_TITLE;
|
1559 |
-
public $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE;
|
1560 |
-
|
1561 |
-
# Optional class attribute for footnote links and backlinks.
|
1562 |
-
public $fn_link_class = MARKDOWN_FN_LINK_CLASS;
|
1563 |
-
public $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS;
|
1564 |
-
|
1565 |
-
# Optional class prefix for fenced code block.
|
1566 |
-
public $code_class_prefix = MARKDOWN_CODE_CLASS_PREFIX;
|
1567 |
-
# Class attribute for code blocks goes on the `code` tag;
|
1568 |
-
# setting this to true will put attributes on the `pre` tag instead.
|
1569 |
-
public $code_attr_on_pre = MARKDOWN_CODE_ATTR_ON_PRE;
|
1570 |
-
|
1571 |
-
# Predefined abbreviations.
|
1572 |
-
public $predef_abbr = array();
|
1573 |
-
|
1574 |
-
|
1575 |
-
### Parser Implementation ###
|
1576 |
-
|
1577 |
-
function __construct() {
|
1578 |
-
#
|
1579 |
-
# Constructor function. Initialize the parser object.
|
1580 |
-
#
|
1581 |
-
# Add extra escapable characters before parent constructor
|
1582 |
-
# initialize the table.
|
1583 |
-
$this->escape_chars .= ':|';
|
1584 |
-
|
1585 |
-
# Insert extra document, block, and span transformations.
|
1586 |
-
# Parent constructor will do the sorting.
|
1587 |
-
$this->document_gamut += array(
|
1588 |
-
"doFencedCodeBlocks" => 5,
|
1589 |
-
"stripFootnotes" => 15,
|
1590 |
-
"stripAbbreviations" => 25,
|
1591 |
-
"appendFootnotes" => 50,
|
1592 |
-
);
|
1593 |
-
$this->block_gamut += array(
|
1594 |
-
"doFencedCodeBlocks" => 5,
|
1595 |
-
"doTables" => 15,
|
1596 |
-
"doDefLists" => 45,
|
1597 |
-
);
|
1598 |
-
$this->span_gamut += array(
|
1599 |
-
"doFootnotes" => 5,
|
1600 |
-
"doAbbreviations" => 70,
|
1601 |
-
);
|
1602 |
-
|
1603 |
-
parent::__construct();
|
1604 |
-
}
|
1605 |
-
|
1606 |
-
|
1607 |
-
# Extra variables used during extra transformations.
|
1608 |
-
public $footnotes = array();
|
1609 |
-
public $footnotes_ordered = array();
|
1610 |
-
public $footnotes_ref_count = array();
|
1611 |
-
public $footnotes_numbers = array();
|
1612 |
-
public $abbr_desciptions = array();
|
1613 |
-
public $abbr_word_re = '';
|
1614 |
-
|
1615 |
-
# Give the current footnote number.
|
1616 |
-
public $footnote_counter = 1;
|
1617 |
-
|
1618 |
-
|
1619 |
-
function setup() {
|
1620 |
-
#
|
1621 |
-
# Setting up Extra-specific variables.
|
1622 |
-
#
|
1623 |
-
parent::setup();
|
1624 |
-
|
1625 |
-
$this->footnotes = array();
|
1626 |
-
$this->footnotes_ordered = array();
|
1627 |
-
$this->footnotes_ref_count = array();
|
1628 |
-
$this->footnotes_numbers = array();
|
1629 |
-
$this->abbr_desciptions = array();
|
1630 |
-
$this->abbr_word_re = '';
|
1631 |
-
$this->footnote_counter = 1;
|
1632 |
-
|
1633 |
-
foreach ($this->predef_abbr as $abbr_word => $abbr_desc) {
|
1634 |
-
if ($this->abbr_word_re)
|
1635 |
-
$this->abbr_word_re .= '|';
|
1636 |
-
$this->abbr_word_re .= preg_quote($abbr_word);
|
1637 |
-
$this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
|
1638 |
-
}
|
1639 |
-
}
|
1640 |
-
|
1641 |
-
function teardown() {
|
1642 |
-
#
|
1643 |
-
# Clearing Extra-specific variables.
|
1644 |
-
#
|
1645 |
-
$this->footnotes = array();
|
1646 |
-
$this->footnotes_ordered = array();
|
1647 |
-
$this->footnotes_ref_count = array();
|
1648 |
-
$this->footnotes_numbers = array();
|
1649 |
-
$this->abbr_desciptions = array();
|
1650 |
-
$this->abbr_word_re = '';
|
1651 |
-
|
1652 |
-
parent::teardown();
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
|
1656 |
-
### Extra Attribute Parser ###
|
1657 |
-
|
1658 |
-
# Expression to use to catch attributes (includes the braces)
|
1659 |
-
public $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}';
|
1660 |
-
# Expression to use when parsing in a context when no capture is desired
|
1661 |
-
public $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}';
|
1662 |
-
|
1663 |
-
function doExtraAttributes($tag_name, $attr) {
|
1664 |
-
#
|
1665 |
-
# Parse attributes caught by the $this->id_class_attr_catch_re expression
|
1666 |
-
# and return the HTML-formatted list of attributes.
|
1667 |
-
#
|
1668 |
-
# Currently supported attributes are .class and #id.
|
1669 |
-
#
|
1670 |
-
if (empty($attr)) return "";
|
1671 |
-
|
1672 |
-
# Split on components
|
1673 |
-
preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches);
|
1674 |
-
$elements = $matches[0];
|
1675 |
-
|
1676 |
-
# handle classes and ids (only first id taken into account)
|
1677 |
-
$classes = array();
|
1678 |
-
$id = false;
|
1679 |
-
foreach ($elements as $element) {
|
1680 |
-
if ($element{0} == '.') {
|
1681 |
-
$classes[] = substr($element, 1);
|
1682 |
-
} else if ($element{0} == '#') {
|
1683 |
-
if ($id === false) $id = substr($element, 1);
|
1684 |
-
}
|
1685 |
-
}
|
1686 |
-
|
1687 |
-
# compose attributes as string
|
1688 |
-
$attr_str = "";
|
1689 |
-
if (!empty($id)) {
|
1690 |
-
$attr_str .= ' id="'.$id.'"';
|
1691 |
-
}
|
1692 |
-
if (!empty($classes)) {
|
1693 |
-
$attr_str .= ' class="'.implode(" ", $classes).'"';
|
1694 |
-
}
|
1695 |
-
return $attr_str;
|
1696 |
-
}
|
1697 |
-
|
1698 |
-
|
1699 |
-
function stripLinkDefinitions($text) {
|
1700 |
-
#
|
1701 |
-
# Strips link definitions from text, stores the URLs and titles in
|
1702 |
-
# hash references.
|
1703 |
-
#
|
1704 |
-
$less_than_tab = $this->tab_width - 1;
|
1705 |
-
|
1706 |
-
# Link defs are in the form: ^[id]: url "optional title"
|
1707 |
-
$text = preg_replace_callback('{
|
1708 |
-
^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1
|
1709 |
-
[ ]*
|
1710 |
-
\n? # maybe *one* newline
|
1711 |
-
[ ]*
|
1712 |
-
(?:
|
1713 |
-
<(.+?)> # url = $2
|
1714 |
-
|
|
1715 |
-
(\S+?) # url = $3
|
1716 |
-
)
|
1717 |
-
[ ]*
|
1718 |
-
\n? # maybe one newline
|
1719 |
-
[ ]*
|
1720 |
-
(?:
|
1721 |
-
(?<=\s) # lookbehind for whitespace
|
1722 |
-
["(]
|
1723 |
-
(.*?) # title = $4
|
1724 |
-
[")]
|
1725 |
-
[ ]*
|
1726 |
-
)? # title is optional
|
1727 |
-
(?:[ ]* '.$this->id_class_attr_catch_re.' )? # $5 = extra id & class attr
|
1728 |
-
(?:\n+|\Z)
|
1729 |
-
}xm',
|
1730 |
-
array(&$this, '_stripLinkDefinitions_callback'),
|
1731 |
-
$text);
|
1732 |
-
return $text;
|
1733 |
-
}
|
1734 |
-
function _stripLinkDefinitions_callback($matches) {
|
1735 |
-
$link_id = strtolower($matches[1]);
|
1736 |
-
$url = $matches[2] == '' ? $matches[3] : $matches[2];
|
1737 |
-
$this->urls[$link_id] = $url;
|
1738 |
-
$this->titles[$link_id] =& $matches[4];
|
1739 |
-
$this->ref_attr[$link_id] = $this->doExtraAttributes("", $dummy =& $matches[5]);
|
1740 |
-
return ''; # String that will replace the block
|
1741 |
-
}
|
1742 |
-
|
1743 |
-
|
1744 |
-
### HTML Block Parser ###
|
1745 |
-
|
1746 |
-
# Tags that are always treated as block tags:
|
1747 |
-
public $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption';
|
1748 |
-
|
1749 |
-
# Tags treated as block tags only if the opening tag is alone on its line:
|
1750 |
-
public $context_block_tags_re = 'script|noscript|ins|del|iframe|object|source|track|param|math|svg|canvas|audio|video';
|
1751 |
-
|
1752 |
-
# Tags where markdown="1" default to span mode:
|
1753 |
-
public $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address';
|
1754 |
-
|
1755 |
-
# Tags which must not have their contents modified, no matter where
|
1756 |
-
# they appear:
|
1757 |
-
public $clean_tags_re = 'script|math|svg';
|
1758 |
-
|
1759 |
-
# Tags that do not need to be closed.
|
1760 |
-
public $auto_close_tags_re = 'hr|img|param|source|track';
|
1761 |
-
|
1762 |
-
|
1763 |
-
function hashHTMLBlocks($text) {
|
1764 |
-
#
|
1765 |
-
# Hashify HTML Blocks and "clean tags".
|
1766 |
-
#
|
1767 |
-
# We only want to do this for block-level HTML tags, such as headers,
|
1768 |
-
# lists, and tables. That's because we still want to wrap <p>s around
|
1769 |
-
# "paragraphs" that are wrapped in non-block-level tags, such as anchors,
|
1770 |
-
# phrase emphasis, and spans. The list of tags we're looking for is
|
1771 |
-
# hard-coded.
|
1772 |
-
#
|
1773 |
-
# This works by calling _HashHTMLBlocks_InMarkdown, which then calls
|
1774 |
-
# _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1"
|
1775 |
-
# attribute is found within a tag, _HashHTMLBlocks_InHTML calls back
|
1776 |
-
# _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag.
|
1777 |
-
# These two functions are calling each other. It's recursive!
|
1778 |
-
#
|
1779 |
-
if ($this->no_markup) return $text;
|
1780 |
-
|
1781 |
-
#
|
1782 |
-
# Call the HTML-in-Markdown hasher.
|
1783 |
-
#
|
1784 |
-
list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text);
|
1785 |
-
|
1786 |
-
return $text;
|
1787 |
-
}
|
1788 |
-
function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
|
1789 |
-
$enclosing_tag_re = '', $span = false)
|
1790 |
-
{
|
1791 |
-
#
|
1792 |
-
# Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags.
|
1793 |
-
#
|
1794 |
-
# * $indent is the number of space to be ignored when checking for code
|
1795 |
-
# blocks. This is important because if we don't take the indent into
|
1796 |
-
# account, something like this (which looks right) won't work as expected:
|
1797 |
-
#
|
1798 |
-
# <div>
|
1799 |
-
# <div markdown="1">
|
1800 |
-
# Hello World. <-- Is this a Markdown code block or text?
|
1801 |
-
# </div> <-- Is this a Markdown code block or a real tag?
|
1802 |
-
# <div>
|
1803 |
-
#
|
1804 |
-
# If you don't like this, just don't indent the tag on which
|
1805 |
-
# you apply the markdown="1" attribute.
|
1806 |
-
#
|
1807 |
-
# * If $enclosing_tag_re is not empty, stops at the first unmatched closing
|
1808 |
-
# tag with that name. Nested tags supported.
|
1809 |
-
#
|
1810 |
-
# * If $span is true, text inside must treated as span. So any double
|
1811 |
-
# newline will be replaced by a single newline so that it does not create
|
1812 |
-
# paragraphs.
|
1813 |
-
#
|
1814 |
-
# Returns an array of that form: ( processed text , remaining text )
|
1815 |
-
#
|
1816 |
-
if ($text === '') return array('', '');
|
1817 |
-
|
1818 |
-
# Regex to check for the presence of newlines around a block tag.
|
1819 |
-
$newline_before_re = '/(?:^\n?|\n\n)*$/';
|
1820 |
-
$newline_after_re =
|
1821 |
-
'{
|
1822 |
-
^ # Start of text following the tag.
|
1823 |
-
(?>[ ]*<!--.*?-->)? # Optional comment.
|
1824 |
-
[ ]*\n # Must be followed by newline.
|
1825 |
-
}xs';
|
1826 |
-
|
1827 |
-
# Regex to match any tag.
|
1828 |
-
$block_tag_re =
|
1829 |
-
'{
|
1830 |
-
( # $2: Capture whole tag.
|
1831 |
-
</? # Any opening or closing tag.
|
1832 |
-
(?> # Tag name.
|
1833 |
-
'.$this->block_tags_re.' |
|
1834 |
-
'.$this->context_block_tags_re.' |
|
1835 |
-
'.$this->clean_tags_re.' |
|
1836 |
-
(?!\s)'.$enclosing_tag_re.'
|
1837 |
-
)
|
1838 |
-
(?:
|
1839 |
-
(?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
|
1840 |
-
(?>
|
1841 |
-
".*?" | # Double quotes (can contain `>`)
|
1842 |
-
\'.*?\' | # Single quotes (can contain `>`)
|
1843 |
-
.+? # Anything but quotes and `>`.
|
1844 |
-
)*?
|
1845 |
-
)?
|
1846 |
-
> # End of tag.
|
1847 |
-
|
|
1848 |
-
<!-- .*? --> # HTML Comment
|
1849 |
-
|
|
1850 |
-
<\?.*?\?> | <%.*?%> # Processing instruction
|
1851 |
-
|
|
1852 |
-
<!\[CDATA\[.*?\]\]> # CData Block
|
1853 |
-
'. ( !$span ? ' # If not in span.
|
1854 |
-
|
|
1855 |
-
# Indented code block
|
1856 |
-
(?: ^[ ]*\n | ^ | \n[ ]*\n )
|
1857 |
-
[ ]{'.($indent+4).'}[^\n]* \n
|
1858 |
-
(?>
|
1859 |
-
(?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n
|
1860 |
-
)*
|
1861 |
-
|
|
1862 |
-
# Fenced code block marker
|
1863 |
-
(?<= ^ | \n )
|
1864 |
-
[ ]{0,'.($indent+3).'}(?:~{3,}|`{3,})
|
1865 |
-
[ ]*
|
1866 |
-
(?:
|
1867 |
-
\.?[-_:a-zA-Z0-9]+ # standalone class name
|
1868 |
-
|
|
1869 |
-
'.$this->id_class_attr_nocatch_re.' # extra attributes
|
1870 |
-
)?
|
1871 |
-
[ ]*
|
1872 |
-
(?= \n )
|
1873 |
-
' : '' ). ' # End (if not is span).
|
1874 |
-
|
|
1875 |
-
# Code span marker
|
1876 |
-
# Note, this regex needs to go after backtick fenced
|
1877 |
-
# code blocks but it should also be kept outside of the
|
1878 |
-
# "if not in span" condition adding backticks to the parser
|
1879 |
-
`+
|
1880 |
-
)
|
1881 |
-
}xs';
|
1882 |
-
|
1883 |
-
|
1884 |
-
$depth = 0; # Current depth inside the tag tree.
|
1885 |
-
$parsed = ""; # Parsed text that will be returned.
|
1886 |
-
|
1887 |
-
#
|
1888 |
-
# Loop through every tag until we find the closing tag of the parent
|
1889 |
-
# or loop until reaching the end of text if no parent tag specified.
|
1890 |
-
#
|
1891 |
-
do {
|
1892 |
-
#
|
1893 |
-
# Split the text using the first $tag_match pattern found.
|
1894 |
-
# Text before pattern will be first in the array, text after
|
1895 |
-
# pattern will be at the end, and between will be any catches made
|
1896 |
-
# by the pattern.
|
1897 |
-
#
|
1898 |
-
$parts = preg_split($block_tag_re, $text, 2,
|
1899 |
-
PREG_SPLIT_DELIM_CAPTURE);
|
1900 |
-
|
1901 |
-
# If in Markdown span mode, add a empty-string span-level hash
|
1902 |
-
# after each newline to prevent triggering any block element.
|
1903 |
-
if ($span) {
|
1904 |
-
$void = $this->hashPart("", ':');
|
1905 |
-
$newline = "$void\n";
|
1906 |
-
$parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void;
|
1907 |
-
}
|
1908 |
-
|
1909 |
-
$parsed .= $parts[0]; # Text before current tag.
|
1910 |
-
|
1911 |
-
# If end of $text has been reached. Stop loop.
|
1912 |
-
if (count($parts) < 3) {
|
1913 |
-
$text = "";
|
1914 |
-
break;
|
1915 |
-
}
|
1916 |
-
|
1917 |
-
$tag = $parts[1]; # Tag to handle.
|
1918 |
-
$text = $parts[2]; # Remaining text after current tag.
|
1919 |
-
$tag_re = preg_quote($tag); # For use in a regular expression.
|
1920 |
-
|
1921 |
-
#
|
1922 |
-
# Check for: Fenced code block marker.
|
1923 |
-
# Note: need to recheck the whole tag to disambiguate backtick
|
1924 |
-
# fences from code spans
|
1925 |
-
#
|
1926 |
-
if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~{3,}|`{3,})[ ]*(?:\.?[-_:a-zA-Z0-9]+|'.$this->id_class_attr_nocatch_re.')?[ ]*\n?$}', $tag, $capture)) {
|
1927 |
-
# Fenced code block marker: find matching end marker.
|
1928 |
-
$fence_indent = strlen($capture[1]); # use captured indent in re
|
1929 |
-
$fence_re = $capture[2]; # use captured fence in re
|
1930 |
-
if (preg_match('{^(?>.*\n)*?[ ]{'.($fence_indent).'}'.$fence_re.'[ ]*(?:\n|$)}', $text,
|
1931 |
-
$matches))
|
1932 |
-
{
|
1933 |
-
# End marker found: pass text unchanged until marker.
|
1934 |
-
$parsed .= $tag . $matches[0];
|
1935 |
-
$text = substr($text, strlen($matches[0]));
|
1936 |
-
}
|
1937 |
-
else {
|
1938 |
-
# No end marker: just skip it.
|
1939 |
-
$parsed .= $tag;
|
1940 |
-
}
|
1941 |
-
}
|
1942 |
-
#
|
1943 |
-
# Check for: Indented code block.
|
1944 |
-
#
|
1945 |
-
else if ($tag{0} == "\n" || $tag{0} == " ") {
|
1946 |
-
# Indented code block: pass it unchanged, will be handled
|
1947 |
-
# later.
|
1948 |
-
$parsed .= $tag;
|
1949 |
-
}
|
1950 |
-
#
|
1951 |
-
# Check for: Code span marker
|
1952 |
-
# Note: need to check this after backtick fenced code blocks
|
1953 |
-
#
|
1954 |
-
else if ($tag{0} == "`") {
|
1955 |
-
# Find corresponding end marker.
|
1956 |
-
$tag_re = preg_quote($tag);
|
1957 |
-
if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}',
|
1958 |
-
$text, $matches))
|
1959 |
-
{
|
1960 |
-
# End marker found: pass text unchanged until marker.
|
1961 |
-
$parsed .= $tag . $matches[0];
|
1962 |
-
$text = substr($text, strlen($matches[0]));
|
1963 |
-
}
|
1964 |
-
else {
|
1965 |
-
# Unmatched marker: just skip it.
|
1966 |
-
$parsed .= $tag;
|
1967 |
-
}
|
1968 |
-
}
|
1969 |
-
#
|
1970 |
-
# Check for: Opening Block level tag or
|
1971 |
-
# Opening Context Block tag (like ins and del)
|
1972 |
-
# used as a block tag (tag is alone on it's line).
|
1973 |
-
#
|
1974 |
-
else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) ||
|
1975 |
-
( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) &&
|
1976 |
-
preg_match($newline_before_re, $parsed) &&
|
1977 |
-
preg_match($newline_after_re, $text) )
|
1978 |
-
)
|
1979 |
-
{
|
1980 |
-
# Need to parse tag and following text using the HTML parser.
|
1981 |
-
list($block_text, $text) =
|
1982 |
-
$this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true);
|
1983 |
-
|
1984 |
-
# Make sure it stays outside of any paragraph by adding newlines.
|
1985 |
-
$parsed .= "\n\n$block_text\n\n";
|
1986 |
-
}
|
1987 |
-
#
|
1988 |
-
# Check for: Clean tag (like script, math)
|
1989 |
-
# HTML Comments, processing instructions.
|
1990 |
-
#
|
1991 |
-
else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) ||
|
1992 |
-
$tag{1} == '!' || $tag{1} == '?')
|
1993 |
-
{
|
1994 |
-
# Need to parse tag and following text using the HTML parser.
|
1995 |
-
# (don't check for markdown attribute)
|
1996 |
-
list($block_text, $text) =
|
1997 |
-
$this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false);
|
1998 |
-
|
1999 |
-
$parsed .= $block_text;
|
2000 |
-
}
|
2001 |
-
#
|
2002 |
-
# Check for: Tag with same name as enclosing tag.
|
2003 |
-
#
|
2004 |
-
else if ($enclosing_tag_re !== '' &&
|
2005 |
-
# Same name as enclosing tag.
|
2006 |
-
preg_match('{^</?(?:'.$enclosing_tag_re.')\b}', $tag))
|
2007 |
-
{
|
2008 |
-
#
|
2009 |
-
# Increase/decrease nested tag count.
|
2010 |
-
#
|
2011 |
-
if ($tag{1} == '/') $depth--;
|
2012 |
-
else if ($tag{strlen($tag)-2} != '/') $depth++;
|
2013 |
-
|
2014 |
-
if ($depth < 0) {
|
2015 |
-
#
|
2016 |
-
# Going out of parent element. Clean up and break so we
|
2017 |
-
# return to the calling function.
|
2018 |
-
#
|
2019 |
-
$text = $tag . $text;
|
2020 |
-
break;
|
2021 |
-
}
|
2022 |
-
|
2023 |
-
$parsed .= $tag;
|
2024 |
-
}
|
2025 |
-
else {
|
2026 |
-
$parsed .= $tag;
|
2027 |
-
}
|
2028 |
-
} while ($depth >= 0);
|
2029 |
-
|
2030 |
-
return array($parsed, $text);
|
2031 |
-
}
|
2032 |
-
function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
|
2033 |
-
#
|
2034 |
-
# Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
|
2035 |
-
#
|
2036 |
-
# * Calls $hash_method to convert any blocks.
|
2037 |
-
# * Stops when the first opening tag closes.
|
2038 |
-
# * $md_attr indicate if the use of the `markdown="1"` attribute is allowed.
|
2039 |
-
# (it is not inside clean tags)
|
2040 |
-
#
|
2041 |
-
# Returns an array of that form: ( processed text , remaining text )
|
2042 |
-
#
|
2043 |
-
if ($text === '') return array('', '');
|
2044 |
-
|
2045 |
-
# Regex to match `markdown` attribute inside of a tag.
|
2046 |
-
$markdown_attr_re = '
|
2047 |
-
{
|
2048 |
-
\s* # Eat whitespace before the `markdown` attribute
|
2049 |
-
markdown
|
2050 |
-
\s*=\s*
|
2051 |
-
(?>
|
2052 |
-
(["\']) # $1: quote delimiter
|
2053 |
-
(.*?) # $2: attribute value
|
2054 |
-
\1 # matching delimiter
|
2055 |
-
|
|
2056 |
-
([^\s>]*) # $3: unquoted attribute value
|
2057 |
-
)
|
2058 |
-
() # $4: make $3 always defined (avoid warnings)
|
2059 |
-
}xs';
|
2060 |
-
|
2061 |
-
# Regex to match any tag.
|
2062 |
-
$tag_re = '{
|
2063 |
-
( # $2: Capture whole tag.
|
2064 |
-
</? # Any opening or closing tag.
|
2065 |
-
[\w:$]+ # Tag name.
|
2066 |
-
(?:
|
2067 |
-
(?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
|
2068 |
-
(?>
|
2069 |
-
".*?" | # Double quotes (can contain `>`)
|
2070 |
-
\'.*?\' | # Single quotes (can contain `>`)
|
2071 |
-
.+? # Anything but quotes and `>`.
|
2072 |
-
)*?
|
2073 |
-
)?
|
2074 |
-
> # End of tag.
|
2075 |
-
|
|
2076 |
-
<!-- .*? --> # HTML Comment
|
2077 |
-
|
|
2078 |
-
<\?.*?\?> | <%.*?%> # Processing instruction
|
2079 |
-
|
|
2080 |
-
<!\[CDATA\[.*?\]\]> # CData Block
|
2081 |
-
)
|
2082 |
-
}xs';
|
2083 |
-
|
2084 |
-
$original_text = $text; # Save original text in case of faliure.
|
2085 |
-
|
2086 |
-
$depth = 0; # Current depth inside the tag tree.
|
2087 |
-
$block_text = ""; # Temporary text holder for current text.
|
2088 |
-
$parsed = ""; # Parsed text that will be returned.
|
2089 |
-
|
2090 |
-
#
|
2091 |
-
# Get the name of the starting tag.
|
2092 |
-
# (This pattern makes $base_tag_name_re safe without quoting.)
|
2093 |
-
#
|
2094 |
-
if (preg_match('/^<([\w:$]*)\b/', $text, $matches))
|
2095 |
-
$base_tag_name_re = $matches[1];
|
2096 |
-
|
2097 |
-
#
|
2098 |
-
# Loop through every tag until we find the corresponding closing tag.
|
2099 |
-
#
|
2100 |
-
do {
|
2101 |
-
#
|
2102 |
-
# Split the text using the first $tag_match pattern found.
|
2103 |
-
# Text before pattern will be first in the array, text after
|
2104 |
-
# pattern will be at the end, and between will be any catches made
|
2105 |
-
# by the pattern.
|
2106 |
-
#
|
2107 |
-
$parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
|
2108 |
-
|
2109 |
-
if (count($parts) < 3) {
|
2110 |
-
#
|
2111 |
-
# End of $text reached with unbalenced tag(s).
|
2112 |
-
# In that case, we return original text unchanged and pass the
|
2113 |
-
# first character as filtered to prevent an infinite loop in the
|
2114 |
-
# parent function.
|
2115 |
-
#
|
2116 |
-
return array($original_text{0}, substr($original_text, 1));
|
2117 |
-
}
|
2118 |
-
|
2119 |
-
$block_text .= $parts[0]; # Text before current tag.
|
2120 |
-
$tag = $parts[1]; # Tag to handle.
|
2121 |
-
$text = $parts[2]; # Remaining text after current tag.
|
2122 |
-
|
2123 |
-
#
|
2124 |
-
# Check for: Auto-close tag (like <hr/>)
|
2125 |
-
# Comments and Processing Instructions.
|
2126 |
-
#
|
2127 |
-
if (preg_match('{^</?(?:'.$this->auto_close_tags_re.')\b}', $tag) ||
|
2128 |
-
$tag{1} == '!' || $tag{1} == '?')
|
2129 |
-
{
|
2130 |
-
# Just add the tag to the block as if it was text.
|
2131 |
-
$block_text .= $tag;
|
2132 |
-
}
|
2133 |
-
else {
|
2134 |
-
#
|
2135 |
-
# Increase/decrease nested tag count. Only do so if
|
2136 |
-
# the tag's name match base tag's.
|
2137 |
-
#
|
2138 |
-
if (preg_match('{^</?'.$base_tag_name_re.'\b}', $tag)) {
|
2139 |
-
if ($tag{1} == '/') $depth--;
|
2140 |
-
else if ($tag{strlen($tag)-2} != '/') $depth++;
|
2141 |
-
}
|
2142 |
-
|
2143 |
-
#
|
2144 |
-
# Check for `markdown="1"` attribute and handle it.
|
2145 |
-
#
|
2146 |
-
if ($md_attr &&
|
2147 |
-
preg_match($markdown_attr_re, $tag, $attr_m) &&
|
2148 |
-
preg_match('/^1|block|span$/', $attr_m[2] . $attr_m[3]))
|
2149 |
-
{
|
2150 |
-
# Remove `markdown` attribute from opening tag.
|
2151 |
-
$tag = preg_replace($markdown_attr_re, '', $tag);
|
2152 |
-
|
2153 |
-
# Check if text inside this tag must be parsed in span mode.
|
2154 |
-
$this->mode = $attr_m[2] . $attr_m[3];
|
2155 |
-
$span_mode = $this->mode == 'span' || $this->mode != 'block' &&
|
2156 |
-
preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag);
|
2157 |
-
|
2158 |
-
# Calculate indent before tag.
|
2159 |
-
if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) {
|
2160 |
-
$strlen = $this->utf8_strlen;
|
2161 |
-
$indent = $strlen($matches[1], 'UTF-8');
|
2162 |
-
} else {
|
2163 |
-
$indent = 0;
|
2164 |
-
}
|
2165 |
-
|
2166 |
-
# End preceding block with this tag.
|
2167 |
-
$block_text .= $tag;
|
2168 |
-
$parsed .= $this->$hash_method($block_text);
|
2169 |
-
|
2170 |
-
# Get enclosing tag name for the ParseMarkdown function.
|
2171 |
-
# (This pattern makes $tag_name_re safe without quoting.)
|
2172 |
-
preg_match('/^<([\w:$]*)\b/', $tag, $matches);
|
2173 |
-
$tag_name_re = $matches[1];
|
2174 |
-
|
2175 |
-
# Parse the content using the HTML-in-Markdown parser.
|
2176 |
-
list ($block_text, $text)
|
2177 |
-
= $this->_hashHTMLBlocks_inMarkdown($text, $indent,
|
2178 |
-
$tag_name_re, $span_mode);
|
2179 |
-
|
2180 |
-
# Outdent markdown text.
|
2181 |
-
if ($indent > 0) {
|
2182 |
-
$block_text = preg_replace("/^[ ]{1,$indent}/m", "",
|
2183 |
-
$block_text);
|
2184 |
-
}
|
2185 |
-
|
2186 |
-
# Append tag content to parsed text.
|
2187 |
-
if (!$span_mode) $parsed .= "\n\n$block_text\n\n";
|
2188 |
-
else $parsed .= "$block_text";
|
2189 |
-
|
2190 |
-
# Start over with a new block.
|
2191 |
-
$block_text = "";
|
2192 |
-
}
|
2193 |
-
else $block_text .= $tag;
|
2194 |
-
}
|
2195 |
-
|
2196 |
-
} while ($depth > 0);
|
2197 |
-
|
2198 |
-
#
|
2199 |
-
# Hash last block text that wasn't processed inside the loop.
|
2200 |
-
#
|
2201 |
-
$parsed .= $this->$hash_method($block_text);
|
2202 |
-
|
2203 |
-
return array($parsed, $text);
|
2204 |
-
}
|
2205 |
-
|
2206 |
-
|
2207 |
-
function hashClean($text) {
|
2208 |
-
#
|
2209 |
-
# Called whenever a tag must be hashed when a function inserts a "clean" tag
|
2210 |
-
# in $text, it passes through this function and is automaticaly escaped,
|
2211 |
-
# blocking invalid nested overlap.
|
2212 |
-
#
|
2213 |
-
return $this->hashPart($text, 'C');
|
2214 |
-
}
|
2215 |
-
|
2216 |
-
|
2217 |
-
function doAnchors($text) {
|
2218 |
-
#
|
2219 |
-
# Turn Markdown link shortcuts into XHTML <a> tags.
|
2220 |
-
#
|
2221 |
-
if ($this->in_anchor) return $text;
|
2222 |
-
$this->in_anchor = true;
|
2223 |
-
|
2224 |
-
#
|
2225 |
-
# First, handle reference-style links: [link text] [id]
|
2226 |
-
#
|
2227 |
-
$text = preg_replace_callback('{
|
2228 |
-
( # wrap whole match in $1
|
2229 |
-
\[
|
2230 |
-
('.$this->nested_brackets_re.') # link text = $2
|
2231 |
-
\]
|
2232 |
-
|
2233 |
-
[ ]? # one optional space
|
2234 |
-
(?:\n[ ]*)? # one optional newline followed by spaces
|
2235 |
-
|
2236 |
-
\[
|
2237 |
-
(.*?) # id = $3
|
2238 |
-
\]
|
2239 |
-
)
|
2240 |
-
}xs',
|
2241 |
-
array(&$this, '_doAnchors_reference_callback'), $text);
|
2242 |
-
|
2243 |
-
#
|
2244 |
-
# Next, inline-style links: [link text](url "optional title")
|
2245 |
-
#
|
2246 |
-
$text = preg_replace_callback('{
|
2247 |
-
( # wrap whole match in $1
|
2248 |
-
\[
|
2249 |
-
('.$this->nested_brackets_re.') # link text = $2
|
2250 |
-
\]
|
2251 |
-
\( # literal paren
|
2252 |
-
[ \n]*
|
2253 |
-
(?:
|
2254 |
-
<(.+?)> # href = $3
|
2255 |
-
|
|
2256 |
-
('.$this->nested_url_parenthesis_re.') # href = $4
|
2257 |
-
)
|
2258 |
-
[ \n]*
|
2259 |
-
( # $5
|
2260 |
-
([\'"]) # quote char = $6
|
2261 |
-
(.*?) # Title = $7
|
2262 |
-
\6 # matching quote
|
2263 |
-
[ \n]* # ignore any spaces/tabs between closing quote and )
|
2264 |
-
)? # title is optional
|
2265 |
-
\)
|
2266 |
-
(?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
|
2267 |
-
)
|
2268 |
-
}xs',
|
2269 |
-
array(&$this, '_doAnchors_inline_callback'), $text);
|
2270 |
-
|
2271 |
-
#
|
2272 |
-
# Last, handle reference-style shortcuts: [link text]
|
2273 |
-
# These must come last in case you've also got [link text][1]
|
2274 |
-
# or [link text](/foo)
|
2275 |
-
#
|
2276 |
-
$text = preg_replace_callback('{
|
2277 |
-
( # wrap whole match in $1
|
2278 |
-
\[
|
2279 |
-
([^\[\]]+) # link text = $2; can\'t contain [ or ]
|
2280 |
-
\]
|
2281 |
-
)
|
2282 |
-
}xs',
|
2283 |
-
array(&$this, '_doAnchors_reference_callback'), $text);
|
2284 |
-
|
2285 |
-
$this->in_anchor = false;
|
2286 |
-
return $text;
|
2287 |
-
}
|
2288 |
-
function _doAnchors_reference_callback($matches) {
|
2289 |
-
$whole_match = $matches[1];
|
2290 |
-
$link_text = $matches[2];
|
2291 |
-
$link_id =& $matches[3];
|
2292 |
-
|
2293 |
-
if ($link_id == "") {
|
2294 |
-
# for shortcut links like [this][] or [this].
|
2295 |
-
$link_id = $link_text;
|
2296 |
-
}
|
2297 |
-
|
2298 |
-
# lower-case and turn embedded newlines into spaces
|
2299 |
-
$link_id = strtolower($link_id);
|
2300 |
-
$link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
|
2301 |
-
|
2302 |
-
if (isset($this->urls[$link_id])) {
|
2303 |
-
$url = $this->urls[$link_id];
|
2304 |
-
$url = $this->encodeAttribute($url);
|
2305 |
-
|
2306 |
-
$result = "<a href=\"$url\"";
|
2307 |
-
if ( isset( $this->titles[$link_id] ) ) {
|
2308 |
-
$title = $this->titles[$link_id];
|
2309 |
-
$title = $this->encodeAttribute($title);
|
2310 |
-
$result .= " title=\"$title\"";
|
2311 |
-
}
|
2312 |
-
if (isset($this->ref_attr[$link_id]))
|
2313 |
-
$result .= $this->ref_attr[$link_id];
|
2314 |
-
|
2315 |
-
$link_text = $this->runSpanGamut($link_text);
|
2316 |
-
$result .= ">$link_text</a>";
|
2317 |
-
$result = $this->hashPart($result);
|
2318 |
-
}
|
2319 |
-
else {
|
2320 |
-
$result = $whole_match;
|
2321 |
-
}
|
2322 |
-
return $result;
|
2323 |
-
}
|
2324 |
-
function _doAnchors_inline_callback($matches) {
|
2325 |
-
$whole_match = $matches[1];
|
2326 |
-
$link_text = $this->runSpanGamut($matches[2]);
|
2327 |
-
$url = $matches[3] == '' ? $matches[4] : $matches[3];
|
2328 |
-
$title =& $matches[7];
|
2329 |
-
$attr = $this->doExtraAttributes("a", $dummy =& $matches[8]);
|
2330 |
-
|
2331 |
-
|
2332 |
-
$url = $this->encodeAttribute($url);
|
2333 |
-
|
2334 |
-
$result = "<a href=\"$url\"";
|
2335 |
-
if (isset($title)) {
|
2336 |
-
$title = $this->encodeAttribute($title);
|
2337 |
-
$result .= " title=\"$title\"";
|
2338 |
-
}
|
2339 |
-
$result .= $attr;
|
2340 |
-
|
2341 |
-
$link_text = $this->runSpanGamut($link_text);
|
2342 |
-
$result .= ">$link_text</a>";
|
2343 |
-
|
2344 |
-
return $this->hashPart($result);
|
2345 |
-
}
|
2346 |
-
|
2347 |
-
|
2348 |
-
function doImages($text) {
|
2349 |
-
#
|
2350 |
-
# Turn Markdown image shortcuts into <img> tags.
|
2351 |
-
#
|
2352 |
-
#
|
2353 |
-
# First, handle reference-style labeled images: ![alt text][id]
|
2354 |
-
#
|
2355 |
-
$text = preg_replace_callback('{
|
2356 |
-
( # wrap whole match in $1
|
2357 |
-
!\[
|
2358 |
-
('.$this->nested_brackets_re.') # alt text = $2
|
2359 |
-
\]
|
2360 |
-
|
2361 |
-
[ ]? # one optional space
|
2362 |
-
(?:\n[ ]*)? # one optional newline followed by spaces
|
2363 |
-
|
2364 |
-
\[
|
2365 |
-
(.*?) # id = $3
|
2366 |
-
\]
|
2367 |
-
|
2368 |
-
)
|
2369 |
-
}xs',
|
2370 |
-
array(&$this, '_doImages_reference_callback'), $text);
|
2371 |
-
|
2372 |
-
#
|
2373 |
-
# Next, handle inline images: ![alt text](url "optional title")
|
2374 |
-
# Don't forget: encode * and _
|
2375 |
-
#
|
2376 |
-
$text = preg_replace_callback('{
|
2377 |
-
( # wrap whole match in $1
|
2378 |
-
!\[
|
2379 |
-
('.$this->nested_brackets_re.') # alt text = $2
|
2380 |
-
\]
|
2381 |
-
\s? # One optional whitespace character
|
2382 |
-
\( # literal paren
|
2383 |
-
[ \n]*
|
2384 |
-
(?:
|
2385 |
-
<(\S*)> # src url = $3
|
2386 |
-
|
|
2387 |
-
('.$this->nested_url_parenthesis_re.') # src url = $4
|
2388 |
-
)
|
2389 |
-
[ \n]*
|
2390 |
-
( # $5
|
2391 |
-
([\'"]) # quote char = $6
|
2392 |
-
(.*?) # title = $7
|
2393 |
-
\6 # matching quote
|
2394 |
-
[ \n]*
|
2395 |
-
)? # title is optional
|
2396 |
-
\)
|
2397 |
-
(?:[ ]? '.$this->id_class_attr_catch_re.' )? # $8 = id/class attributes
|
2398 |
-
)
|
2399 |
-
}xs',
|
2400 |
-
array(&$this, '_doImages_inline_callback'), $text);
|
2401 |
-
|
2402 |
-
return $text;
|
2403 |
-
}
|
2404 |
-
function _doImages_reference_callback($matches) {
|
2405 |
-
$whole_match = $matches[1];
|
2406 |
-
$alt_text = $matches[2];
|
2407 |
-
$link_id = strtolower($matches[3]);
|
2408 |
-
|
2409 |
-
if ($link_id == "") {
|
2410 |
-
$link_id = strtolower($alt_text); # for shortcut links like ![this][].
|
2411 |
-
}
|
2412 |
-
|
2413 |
-
$alt_text = $this->encodeAttribute($alt_text);
|
2414 |
-
if (isset($this->urls[$link_id])) {
|
2415 |
-
$url = $this->encodeAttribute($this->urls[$link_id]);
|
2416 |
-
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
2417 |
-
if (isset($this->titles[$link_id])) {
|
2418 |
-
$title = $this->titles[$link_id];
|
2419 |
-
$title = $this->encodeAttribute($title);
|
2420 |
-
$result .= " title=\"$title\"";
|
2421 |
-
}
|
2422 |
-
if (isset($this->ref_attr[$link_id]))
|
2423 |
-
$result .= $this->ref_attr[$link_id];
|
2424 |
-
$result .= $this->empty_element_suffix;
|
2425 |
-
$result = $this->hashPart($result);
|
2426 |
-
}
|
2427 |
-
else {
|
2428 |
-
# If there's no such link ID, leave intact:
|
2429 |
-
$result = $whole_match;
|
2430 |
-
}
|
2431 |
-
|
2432 |
-
return $result;
|
2433 |
-
}
|
2434 |
-
function _doImages_inline_callback($matches) {
|
2435 |
-
$whole_match = $matches[1];
|
2436 |
-
$alt_text = $matches[2];
|
2437 |
-
$url = $matches[3] == '' ? $matches[4] : $matches[3];
|
2438 |
-
$title =& $matches[7];
|
2439 |
-
$attr = $this->doExtraAttributes("img", $dummy =& $matches[8]);
|
2440 |
-
|
2441 |
-
$alt_text = $this->encodeAttribute($alt_text);
|
2442 |
-
$url = $this->encodeAttribute($url);
|
2443 |
-
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
2444 |
-
if (isset($title)) {
|
2445 |
-
$title = $this->encodeAttribute($title);
|
2446 |
-
$result .= " title=\"$title\""; # $title already quoted
|
2447 |
-
}
|
2448 |
-
$result .= $attr;
|
2449 |
-
$result .= $this->empty_element_suffix;
|
2450 |
-
|
2451 |
-
return $this->hashPart($result);
|
2452 |
-
}
|
2453 |
-
|
2454 |
-
|
2455 |
-
function doHeaders($text) {
|
2456 |
-
#
|
2457 |
-
# Redefined to add id and class attribute support.
|
2458 |
-
#
|
2459 |
-
# Setext-style headers:
|
2460 |
-
# Header 1 {#header1}
|
2461 |
-
# ========
|
2462 |
-
#
|
2463 |
-
# Header 2 {#header2 .class1 .class2}
|
2464 |
-
# --------
|
2465 |
-
#
|
2466 |
-
$text = preg_replace_callback(
|
2467 |
-
'{
|
2468 |
-
(^.+?) # $1: Header text
|
2469 |
-
(?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
|
2470 |
-
[ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer
|
2471 |
-
}mx',
|
2472 |
-
array(&$this, '_doHeaders_callback_setext'), $text);
|
2473 |
-
|
2474 |
-
# atx-style headers:
|
2475 |
-
# # Header 1 {#header1}
|
2476 |
-
# ## Header 2 {#header2}
|
2477 |
-
# ## Header 2 with closing hashes ## {#header3.class1.class2}
|
2478 |
-
# ...
|
2479 |
-
# ###### Header 6 {.class2}
|
2480 |
-
#
|
2481 |
-
$text = preg_replace_callback('{
|
2482 |
-
^(\#{1,6}) # $1 = string of #\'s
|
2483 |
-
[ ]*
|
2484 |
-
(.+?) # $2 = Header text
|
2485 |
-
[ ]*
|
2486 |
-
\#* # optional closing #\'s (not counted)
|
2487 |
-
(?:[ ]+ '.$this->id_class_attr_catch_re.' )? # $3 = id/class attributes
|
2488 |
-
[ ]*
|
2489 |
-
\n+
|
2490 |
-
}xm',
|
2491 |
-
array(&$this, '_doHeaders_callback_atx'), $text);
|
2492 |
-
|
2493 |
-
return $text;
|
2494 |
-
}
|
2495 |
-
function _doHeaders_callback_setext($matches) {
|
2496 |
-
if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
|
2497 |
-
return $matches[0];
|
2498 |
-
$level = $matches[3]{0} == '=' ? 1 : 2;
|
2499 |
-
$attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]);
|
2500 |
-
$block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>";
|
2501 |
-
return "\n" . $this->hashBlock($block) . "\n\n";
|
2502 |
-
}
|
2503 |
-
function _doHeaders_callback_atx($matches) {
|
2504 |
-
$level = strlen($matches[1]);
|
2505 |
-
$attr = $this->doExtraAttributes("h$level", $dummy =& $matches[3]);
|
2506 |
-
$block = "<h$level$attr>".$this->runSpanGamut($matches[2])."</h$level>";
|
2507 |
-
return "\n" . $this->hashBlock($block) . "\n\n";
|
2508 |
-
}
|
2509 |
-
|
2510 |
-
|
2511 |
-
function doTables($text) {
|
2512 |
-
#
|
2513 |
-
# Form HTML tables.
|
2514 |
-
#
|
2515 |
-
$less_than_tab = $this->tab_width - 1;
|
2516 |
-
#
|
2517 |
-
# Find tables with leading pipe.
|
2518 |
-
#
|
2519 |
-
# | Header 1 | Header 2
|
2520 |
-
# | -------- | --------
|
2521 |
-
# | Cell 1 | Cell 2
|
2522 |
-
# | Cell 3 | Cell 4
|
2523 |
-
#
|
2524 |
-
$text = preg_replace_callback('
|
2525 |
-
{
|
2526 |
-
^ # Start of a line
|
2527 |
-
[ ]{0,'.$less_than_tab.'} # Allowed whitespace.
|
2528 |
-
[|] # Optional leading pipe (present)
|
2529 |
-
(.+) \n # $1: Header row (at least one pipe)
|
2530 |
-
|
2531 |
-
[ ]{0,'.$less_than_tab.'} # Allowed whitespace.
|
2532 |
-
[|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline
|
2533 |
-
|
2534 |
-
( # $3: Cells
|
2535 |
-
(?>
|
2536 |
-
[ ]* # Allowed whitespace.
|
2537 |
-
[|] .* \n # Row content.
|
2538 |
-
)*
|
2539 |
-
)
|
2540 |
-
(?=\n|\Z) # Stop at final double newline.
|
2541 |
-
}xm',
|
2542 |
-
array(&$this, '_doTable_leadingPipe_callback'), $text);
|
2543 |
-
|
2544 |
-
#
|
2545 |
-
# Find tables without leading pipe.
|
2546 |
-
#
|
2547 |
-
# Header 1 | Header 2
|
2548 |
-
# -------- | --------
|
2549 |
-
# Cell 1 | Cell 2
|
2550 |
-
# Cell 3 | Cell 4
|
2551 |
-
#
|
2552 |
-
$text = preg_replace_callback('
|
2553 |
-
{
|
2554 |
-
^ # Start of a line
|
2555 |
-
[ ]{0,'.$less_than_tab.'} # Allowed whitespace.
|
2556 |
-
(\S.*[|].*) \n # $1: Header row (at least one pipe)
|
2557 |
-
|
2558 |
-
[ ]{0,'.$less_than_tab.'} # Allowed whitespace.
|
2559 |
-
([-:]+[ ]*[|][-| :]*) \n # $2: Header underline
|
2560 |
-
|
2561 |
-
( # $3: Cells
|
2562 |
-
(?>
|
2563 |
-
.* [|] .* \n # Row content
|
2564 |
-
)*
|
2565 |
-
)
|
2566 |
-
(?=\n|\Z) # Stop at final double newline.
|
2567 |
-
}xm',
|
2568 |
-
array(&$this, '_DoTable_callback'), $text);
|
2569 |
-
|
2570 |
-
return $text;
|
2571 |
-
}
|
2572 |
-
function _doTable_leadingPipe_callback($matches) {
|
2573 |
-
$head = $matches[1];
|
2574 |
-
$underline = $matches[2];
|
2575 |
-
$content = $matches[3];
|
2576 |
-
|
2577 |
-
# Remove leading pipe for each row.
|
2578 |
-
$content = preg_replace('/^ *[|]/m', '', $content);
|
2579 |
-
|
2580 |
-
return $this->_doTable_callback(array($matches[0], $head, $underline, $content));
|
2581 |
-
}
|
2582 |
-
function _doTable_callback($matches) {
|
2583 |
-
$head = $matches[1];
|
2584 |
-
$underline = $matches[2];
|
2585 |
-
$content = $matches[3];
|
2586 |
-
|
2587 |
-
# Remove any tailing pipes for each line.
|
2588 |
-
$head = preg_replace('/[|] *$/m', '', $head);
|
2589 |
-
$underline = preg_replace('/[|] *$/m', '', $underline);
|
2590 |
-
$content = preg_replace('/[|] *$/m', '', $content);
|
2591 |
-
|
2592 |
-
# Reading alignement from header underline.
|
2593 |
-
$separators = preg_split('/ *[|] */', $underline);
|
2594 |
-
foreach ($separators as $n => $s) {
|
2595 |
-
if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"';
|
2596 |
-
else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"';
|
2597 |
-
else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"';
|
2598 |
-
else $attr[$n] = '';
|
2599 |
-
}
|
2600 |
-
|
2601 |
-
# Parsing span elements, including code spans, character escapes,
|
2602 |
-
# and inline HTML tags, so that pipes inside those gets ignored.
|
2603 |
-
$head = $this->parseSpan($head);
|
2604 |
-
$headers = preg_split('/ *[|] */', $head);
|
2605 |
-
$col_count = count($headers);
|
2606 |
-
$attr = array_pad($attr, $col_count, '');
|
2607 |
-
|
2608 |
-
# Write column headers.
|
2609 |
-
$text = "<table>\n";
|
2610 |
-
$text .= "<thead>\n";
|
2611 |
-
$text .= "<tr>\n";
|
2612 |
-
foreach ($headers as $n => $header)
|
2613 |
-
$text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n";
|
2614 |
-
$text .= "</tr>\n";
|
2615 |
-
$text .= "</thead>\n";
|
2616 |
-
|
2617 |
-
# Split content by row.
|
2618 |
-
$rows = explode("\n", trim($content, "\n"));
|
2619 |
-
|
2620 |
-
$text .= "<tbody>\n";
|
2621 |
-
foreach ($rows as $row) {
|
2622 |
-
# Parsing span elements, including code spans, character escapes,
|
2623 |
-
# and inline HTML tags, so that pipes inside those gets ignored.
|
2624 |
-
$row = $this->parseSpan($row);
|
2625 |
-
|
2626 |
-
# Split row by cell.
|
2627 |
-
$row_cells = preg_split('/ *[|] */', $row, $col_count);
|
2628 |
-
$row_cells = array_pad($row_cells, $col_count, '');
|
2629 |
-
|
2630 |
-
$text .= "<tr>\n";
|
2631 |
-
foreach ($row_cells as $n => $cell)
|
2632 |
-
$text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n";
|
2633 |
-
$text .= "</tr>\n";
|
2634 |
-
}
|
2635 |
-
$text .= "</tbody>\n";
|
2636 |
-
$text .= "</table>";
|
2637 |
-
|
2638 |
-
return $this->hashBlock($text) . "\n";
|
2639 |
-
}
|
2640 |
-
|
2641 |
-
|
2642 |
-
function doDefLists($text) {
|
2643 |
-
#
|
2644 |
-
# Form HTML definition lists.
|
2645 |
-
#
|
2646 |
-
$less_than_tab = $this->tab_width - 1;
|
2647 |
-
|
2648 |
-
# Re-usable pattern to match any entire dl list:
|
2649 |
-
$whole_list_re = '(?>
|
2650 |
-
( # $1 = whole list
|
2651 |
-
( # $2
|
2652 |
-
[ ]{0,'.$less_than_tab.'}
|
2653 |
-
((?>.*\S.*\n)+) # $3 = defined term
|
2654 |
-
\n?
|
2655 |
-
[ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
|
2656 |
-
)
|
2657 |
-
(?s:.+?)
|
2658 |
-
( # $4
|
2659 |
-
\z
|
2660 |
-
|
|
2661 |
-
\n{2,}
|
2662 |
-
(?=\S)
|
2663 |
-
(?! # Negative lookahead for another term
|
2664 |
-
[ ]{0,'.$less_than_tab.'}
|
2665 |
-
(?: \S.*\n )+? # defined term
|
2666 |
-
\n?
|
2667 |
-
[ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
|
2668 |
-
)
|
2669 |
-
(?! # Negative lookahead for another definition
|
2670 |
-
[ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
|
2671 |
-
)
|
2672 |
-
)
|
2673 |
-
)
|
2674 |
-
)'; // mx
|
2675 |
-
|
2676 |
-
$text = preg_replace_callback('{
|
2677 |
-
(?>\A\n?|(?<=\n\n))
|
2678 |
-
'.$whole_list_re.'
|
2679 |
-
}mx',
|
2680 |
-
array(&$this, '_doDefLists_callback'), $text);
|
2681 |
-
|
2682 |
-
return $text;
|
2683 |
-
}
|
2684 |
-
function _doDefLists_callback($matches) {
|
2685 |
-
# Re-usable patterns to match list item bullets and number markers:
|
2686 |
-
$list = $matches[1];
|
2687 |
-
|
2688 |
-
# Turn double returns into triple returns, so that we can make a
|
2689 |
-
# paragraph for the last item in a list, if necessary:
|
2690 |
-
$result = trim($this->processDefListItems($list));
|
2691 |
-
$result = "<dl>\n" . $result . "\n</dl>";
|
2692 |
-
return $this->hashBlock($result) . "\n\n";
|
2693 |
-
}
|
2694 |
-
|
2695 |
-
|
2696 |
-
function processDefListItems($list_str) {
|
2697 |
-
#
|
2698 |
-
# Process the contents of a single definition list, splitting it
|
2699 |
-
# into individual term and definition list items.
|
2700 |
-
#
|
2701 |
-
$less_than_tab = $this->tab_width - 1;
|
2702 |
-
|
2703 |
-
# trim trailing blank lines:
|
2704 |
-
$list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
|
2705 |
-
|
2706 |
-
# Process definition terms.
|
2707 |
-
$list_str = preg_replace_callback('{
|
2708 |
-
(?>\A\n?|\n\n+) # leading line
|
2709 |
-
( # definition terms = $1
|
2710 |
-
[ ]{0,'.$less_than_tab.'} # leading whitespace
|
2711 |
-
(?!\:[ ]|[ ]) # negative lookahead for a definition
|
2712 |
-
# mark (colon) or more whitespace.
|
2713 |
-
(?> \S.* \n)+? # actual term (not whitespace).
|
2714 |
-
)
|
2715 |
-
(?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed
|
2716 |
-
# with a definition mark.
|
2717 |
-
}xm',
|
2718 |
-
array(&$this, '_processDefListItems_callback_dt'), $list_str);
|
2719 |
-
|
2720 |
-
# Process actual definitions.
|
2721 |
-
$list_str = preg_replace_callback('{
|
2722 |
-
\n(\n+)? # leading line = $1
|
2723 |
-
( # marker space = $2
|
2724 |
-
[ ]{0,'.$less_than_tab.'} # whitespace before colon
|
2725 |
-
\:[ ]+ # definition mark (colon)
|
2726 |
-
)
|
2727 |
-
((?s:.+?)) # definition text = $3
|
2728 |
-
(?= \n+ # stop at next definition mark,
|
2729 |
-
(?: # next term or end of text
|
2730 |
-
[ ]{0,'.$less_than_tab.'} \:[ ] |
|
2731 |
-
<dt> | \z
|
2732 |
-
)
|
2733 |
-
)
|
2734 |
-
}xm',
|
2735 |
-
array(&$this, '_processDefListItems_callback_dd'), $list_str);
|
2736 |
-
|
2737 |
-
return $list_str;
|
2738 |
-
}
|
2739 |
-
function _processDefListItems_callback_dt($matches) {
|
2740 |
-
$terms = explode("\n", trim($matches[1]));
|
2741 |
-
$text = '';
|
2742 |
-
foreach ($terms as $term) {
|
2743 |
-
$term = $this->runSpanGamut(trim($term));
|
2744 |
-
$text .= "\n<dt>" . $term . "</dt>";
|
2745 |
-
}
|
2746 |
-
return $text . "\n";
|
2747 |
-
}
|
2748 |
-
function _processDefListItems_callback_dd($matches) {
|
2749 |
-
$leading_line = $matches[1];
|
2750 |
-
$marker_space = $matches[2];
|
2751 |
-
$def = $matches[3];
|
2752 |
-
|
2753 |
-
if ($leading_line || preg_match('/\n{2,}/', $def)) {
|
2754 |
-
# Replace marker with the appropriate whitespace indentation
|
2755 |
-
$def = str_repeat(' ', strlen($marker_space)) . $def;
|
2756 |
-
$def = $this->runBlockGamut($this->outdent($def . "\n\n"));
|
2757 |
-
$def = "\n". $def ."\n";
|
2758 |
-
}
|
2759 |
-
else {
|
2760 |
-
$def = rtrim($def);
|
2761 |
-
$def = $this->runSpanGamut($this->outdent($def));
|
2762 |
-
}
|
2763 |
-
|
2764 |
-
return "\n<dd>" . $def . "</dd>\n";
|
2765 |
-
}
|
2766 |
-
|
2767 |
-
|
2768 |
-
function doFencedCodeBlocks($text) {
|
2769 |
-
#
|
2770 |
-
# Adding the fenced code block syntax to regular Markdown:
|
2771 |
-
#
|
2772 |
-
# ~~~
|
2773 |
-
# Code block
|
2774 |
-
# ~~~
|
2775 |
-
#
|
2776 |
-
$less_than_tab = $this->tab_width;
|
2777 |
-
|
2778 |
-
$text = preg_replace_callback('{
|
2779 |
-
(?:\n|\A)
|
2780 |
-
# 1: Opening marker
|
2781 |
-
(
|
2782 |
-
(?:~{3,}|`{3,}) # 3 or more tildes/backticks.
|
2783 |
-
)
|
2784 |
-
[ ]*
|
2785 |
-
(?:
|
2786 |
-
\.?([-_:a-zA-Z0-9]+) # 2: standalone class name
|
2787 |
-
|
|
2788 |
-
'.$this->id_class_attr_catch_re.' # 3: Extra attributes
|
2789 |
-
)?
|
2790 |
-
[ ]* \n # Whitespace and newline following marker.
|
2791 |
-
|
2792 |
-
# 4: Content
|
2793 |
-
(
|
2794 |
-
(?>
|
2795 |
-
(?!\1 [ ]* \n) # Not a closing marker.
|
2796 |
-
.*\n+
|
2797 |
-
)+
|
2798 |
-
)
|
2799 |
-
|
2800 |
-
# Closing marker.
|
2801 |
-
\1 [ ]* (?= \n )
|
2802 |
-
}xm',
|
2803 |
-
array(&$this, '_doFencedCodeBlocks_callback'), $text);
|
2804 |
-
|
2805 |
-
return $text;
|
2806 |
-
}
|
2807 |
-
function _doFencedCodeBlocks_callback($matches) {
|
2808 |
-
$classname =& $matches[2];
|
2809 |
-
$attrs =& $matches[3];
|
2810 |
-
$codeblock = $matches[4];
|
2811 |
-
$codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
|
2812 |
-
$codeblock = preg_replace_callback('/^\n+/',
|
2813 |
-
array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock);
|
2814 |
-
|
2815 |
-
if ($classname != "") {
|
2816 |
-
if ($classname{0} == '.')
|
2817 |
-
$classname = substr($classname, 1);
|
2818 |
-
$attr_str = ' class="'.$this->code_class_prefix.$classname.'"';
|
2819 |
-
} else {
|
2820 |
-
$attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs);
|
2821 |
-
}
|
2822 |
-
$pre_attr_str = $this->code_attr_on_pre ? $attr_str : '';
|
2823 |
-
$code_attr_str = $this->code_attr_on_pre ? '' : $attr_str;
|
2824 |
-
$codeblock = "<pre$pre_attr_str><code$code_attr_str>$codeblock</code></pre>";
|
2825 |
-
|
2826 |
-
return "\n\n".$this->hashBlock($codeblock)."\n\n";
|
2827 |
-
}
|
2828 |
-
function _doFencedCodeBlocks_newlines($matches) {
|
2829 |
-
return str_repeat("<br$this->empty_element_suffix",
|
2830 |
-
strlen($matches[0]));
|
2831 |
-
}
|
2832 |
-
|
2833 |
-
|
2834 |
-
#
|
2835 |
-
# Redefining emphasis markers so that emphasis by underscore does not
|
2836 |
-
# work in the middle of a word.
|
2837 |
-
#
|
2838 |
-
public $em_relist = array(
|
2839 |
-
'' => '(?:(?<!\*)\*(?!\*)|(?<![a-zA-Z0-9_])_(?!_))(?=\S|$)(?![\.,:;]\s)',
|
2840 |
-
'*' => '(?<=\S|^)(?<!\*)\*(?!\*)',
|
2841 |
-
'_' => '(?<=\S|^)(?<!_)_(?![a-zA-Z0-9_])',
|
2842 |
-
);
|
2843 |
-
public $strong_relist = array(
|
2844 |
-
'' => '(?:(?<!\*)\*\*(?!\*)|(?<![a-zA-Z0-9_])__(?!_))(?=\S|$)(?![\.,:;]\s)',
|
2845 |
-
'**' => '(?<=\S|^)(?<!\*)\*\*(?!\*)',
|
2846 |
-
'__' => '(?<=\S|^)(?<!_)__(?![a-zA-Z0-9_])',
|
2847 |
-
);
|
2848 |
-
public $em_strong_relist = array(
|
2849 |
-
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<![a-zA-Z0-9_])___(?!_))(?=\S|$)(?![\.,:;]\s)',
|
2850 |
-
'***' => '(?<=\S|^)(?<!\*)\*\*\*(?!\*)',
|
2851 |
-
'___' => '(?<=\S|^)(?<!_)___(?![a-zA-Z0-9_])',
|
2852 |
-
);
|
2853 |
-
|
2854 |
-
|
2855 |
-
function formParagraphs($text) {
|
2856 |
-
#
|
2857 |
-
# Params:
|
2858 |
-
# $text - string to process with html <p> tags
|
2859 |
-
#
|
2860 |
-
# Strip leading and trailing lines:
|
2861 |
-
$text = preg_replace('/\A\n+|\n+\z/', '', $text);
|
2862 |
-
|
2863 |
-
$grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
|
2864 |
-
|
2865 |
-
#
|
2866 |
-
# Wrap <p> tags and unhashify HTML blocks
|
2867 |
-
#
|
2868 |
-
foreach ($grafs as $key => $value) {
|
2869 |
-
$value = trim($this->runSpanGamut($value));
|
2870 |
-
|
2871 |
-
# Check if this should be enclosed in a paragraph.
|
2872 |
-
# Clean tag hashes & block tag hashes are left alone.
|
2873 |
-
$is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value);
|
2874 |
-
|
2875 |
-
if ($is_p) {
|
2876 |
-
$value = "<p>$value</p>";
|
2877 |
-
}
|
2878 |
-
$grafs[$key] = $value;
|
2879 |
-
}
|
2880 |
-
|
2881 |
-
# Join grafs in one text, then unhash HTML tags.
|
2882 |
-
$text = implode("\n\n", $grafs);
|
2883 |
-
|
2884 |
-
# Finish by removing any tag hashes still present in $text.
|
2885 |
-
$text = $this->unhash($text);
|
2886 |
-
|
2887 |
-
return $text;
|
2888 |
-
}
|
2889 |
-
|
2890 |
-
|
2891 |
-
### Footnotes
|
2892 |
-
|
2893 |
-
function stripFootnotes($text) {
|
2894 |
-
#
|
2895 |
-
# Strips link definitions from text, stores the URLs and titles in
|
2896 |
-
# hash references.
|
2897 |
-
#
|
2898 |
-
$less_than_tab = $this->tab_width - 1;
|
2899 |
-
|
2900 |
-
# Link defs are in the form: [^id]: url "optional title"
|
2901 |
-
$text = preg_replace_callback('{
|
2902 |
-
^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1
|
2903 |
-
[ ]*
|
2904 |
-
\n? # maybe *one* newline
|
2905 |
-
( # text = $2 (no blank lines allowed)
|
2906 |
-
(?:
|
2907 |
-
.+ # actual text
|
2908 |
-
|
|
2909 |
-
\n # newlines but
|
2910 |
-
(?!\[\^.+?\]:\s)# negative lookahead for footnote marker.
|
2911 |
-
(?!\n+[ ]{0,3}\S)# ensure line is not blank and followed
|
2912 |
-
# by non-indented content
|
2913 |
-
)*
|
2914 |
-
)
|
2915 |
-
}xm',
|
2916 |
-
array(&$this, '_stripFootnotes_callback'),
|
2917 |
-
$text);
|
2918 |
-
return $text;
|
2919 |
-
}
|
2920 |
-
function _stripFootnotes_callback($matches) {
|
2921 |
-
$note_id = $this->fn_id_prefix . $matches[1];
|
2922 |
-
$this->footnotes[$note_id] = $this->outdent($matches[2]);
|
2923 |
-
return ''; # String that will replace the block
|
2924 |
-
}
|
2925 |
-
|
2926 |
-
|
2927 |
-
function doFootnotes($text) {
|
2928 |
-
#
|
2929 |
-
# Replace footnote references in $text [^id] with a special text-token
|
2930 |
-
# which will be replaced by the actual footnote marker in appendFootnotes.
|
2931 |
-
#
|
2932 |
-
if (!$this->in_anchor) {
|
2933 |
-
$text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text);
|
2934 |
-
}
|
2935 |
-
return $text;
|
2936 |
-
}
|
2937 |
-
|
2938 |
-
|
2939 |
-
function appendFootnotes($text) {
|
2940 |
-
#
|
2941 |
-
# Append footnote list to text.
|
2942 |
-
#
|
2943 |
-
$text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
|
2944 |
-
array(&$this, '_appendFootnotes_callback'), $text);
|
2945 |
-
|
2946 |
-
if (!empty($this->footnotes_ordered)) {
|
2947 |
-
$text .= "\n\n";
|
2948 |
-
$text .= "<div class=\"footnotes\">\n";
|
2949 |
-
$text .= "<hr". $this->empty_element_suffix ."\n";
|
2950 |
-
$text .= "<ol>\n\n";
|
2951 |
-
|
2952 |
-
$attr = "";
|
2953 |
-
if ($this->fn_backlink_class != "") {
|
2954 |
-
$class = $this->fn_backlink_class;
|
2955 |
-
$class = $this->encodeAttribute($class);
|
2956 |
-
$attr .= " class=\"$class\"";
|
2957 |
-
}
|
2958 |
-
if ($this->fn_backlink_title != "") {
|
2959 |
-
$title = $this->fn_backlink_title;
|
2960 |
-
$title = $this->encodeAttribute($title);
|
2961 |
-
$attr .= " title=\"$title\"";
|
2962 |
-
}
|
2963 |
-
$num = 0;
|
2964 |
-
|
2965 |
-
while (!empty($this->footnotes_ordered)) {
|
2966 |
-
$footnote = reset($this->footnotes_ordered);
|
2967 |
-
$note_id = key($this->footnotes_ordered);
|
2968 |
-
unset($this->footnotes_ordered[$note_id]);
|
2969 |
-
$ref_count = $this->footnotes_ref_count[$note_id];
|
2970 |
-
unset($this->footnotes_ref_count[$note_id]);
|
2971 |
-
unset($this->footnotes[$note_id]);
|
2972 |
-
|
2973 |
-
$footnote .= "\n"; # Need to append newline before parsing.
|
2974 |
-
$footnote = $this->runBlockGamut("$footnote\n");
|
2975 |
-
$footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
|
2976 |
-
array(&$this, '_appendFootnotes_callback'), $footnote);
|
2977 |
-
|
2978 |
-
$attr = str_replace("%%", ++$num, $attr);
|
2979 |
-
$note_id = $this->encodeAttribute($note_id);
|
2980 |
-
|
2981 |
-
# Prepare backlink, multiple backlinks if multiple references
|
2982 |
-
$backlink = "<a href=\"#fnref:$note_id\"$attr>↩</a>";
|
2983 |
-
for ($ref_num = 2; $ref_num <= $ref_count; ++$ref_num) {
|
2984 |
-
$backlink .= " <a href=\"#fnref$ref_num:$note_id\"$attr>↩</a>";
|
2985 |
-
}
|
2986 |
-
# Add backlink to last paragraph; create new paragraph if needed.
|
2987 |
-
if (preg_match('{</p>$}', $footnote)) {
|
2988 |
-
$footnote = substr($footnote, 0, -4) . " $backlink</p>";
|
2989 |
-
} else {
|
2990 |
-
$footnote .= "\n\n<p>$backlink</p>";
|
2991 |
-
}
|
2992 |
-
|
2993 |
-
$text .= "<li id=\"fn:$note_id\">\n";
|
2994 |
-
$text .= $footnote . "\n";
|
2995 |
-
$text .= "</li>\n\n";
|
2996 |
-
}
|
2997 |
-
|
2998 |
-
$text .= "</ol>\n";
|
2999 |
-
$text .= "</div>";
|
3000 |
-
}
|
3001 |
-
return $text;
|
3002 |
-
}
|
3003 |
-
function _appendFootnotes_callback($matches) {
|
3004 |
-
$node_id = $this->fn_id_prefix . $matches[1];
|
3005 |
-
|
3006 |
-
# Create footnote marker only if it has a corresponding footnote *and*
|
3007 |
-
# the footnote hasn't been used by another marker.
|
3008 |
-
if (isset($this->footnotes[$node_id])) {
|
3009 |
-
$num =& $this->footnotes_numbers[$node_id];
|
3010 |
-
if (!isset($num)) {
|
3011 |
-
# Transfer footnote content to the ordered list and give it its
|
3012 |
-
# number
|
3013 |
-
$this->footnotes_ordered[$node_id] = $this->footnotes[$node_id];
|
3014 |
-
$this->footnotes_ref_count[$node_id] = 1;
|
3015 |
-
$num = $this->footnote_counter++;
|
3016 |
-
$ref_count_mark = '';
|
3017 |
-
} else {
|
3018 |
-
$ref_count_mark = $this->footnotes_ref_count[$node_id] += 1;
|
3019 |
-
}
|
3020 |
-
|
3021 |
-
$attr = "";
|
3022 |
-
if ($this->fn_link_class != "") {
|
3023 |
-
$class = $this->fn_link_class;
|
3024 |
-
$class = $this->encodeAttribute($class);
|
3025 |
-
$attr .= " class=\"$class\"";
|
3026 |
-
}
|
3027 |
-
if ($this->fn_link_title != "") {
|
3028 |
-
$title = $this->fn_link_title;
|
3029 |
-
$title = $this->encodeAttribute($title);
|
3030 |
-
$attr .= " title=\"$title\"";
|
3031 |
-
}
|
3032 |
-
|
3033 |
-
$attr = str_replace("%%", $num, $attr);
|
3034 |
-
$node_id = $this->encodeAttribute($node_id);
|
3035 |
-
|
3036 |
-
return
|
3037 |
-
"<sup id=\"fnref$ref_count_mark:$node_id\">".
|
3038 |
-
"<a href=\"#fn:$node_id\"$attr>$num</a>".
|
3039 |
-
"</sup>";
|
3040 |
-
}
|
3041 |
-
|
3042 |
-
return "[^".$matches[1]."]";
|
3043 |
-
}
|
3044 |
-
|
3045 |
-
|
3046 |
-
### Abbreviations ###
|
3047 |
-
|
3048 |
-
function stripAbbreviations($text) {
|
3049 |
-
#
|
3050 |
-
# Strips abbreviations from text, stores titles in hash references.
|
3051 |
-
#
|
3052 |
-
$less_than_tab = $this->tab_width - 1;
|
3053 |
-
|
3054 |
-
# Link defs are in the form: [id]*: url "optional title"
|
3055 |
-
$text = preg_replace_callback('{
|
3056 |
-
^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1
|
3057 |
-
(.*) # text = $2 (no blank lines allowed)
|
3058 |
-
}xm',
|
3059 |
-
array(&$this, '_stripAbbreviations_callback'),
|
3060 |
-
$text);
|
3061 |
-
return $text;
|
3062 |
-
}
|
3063 |
-
function _stripAbbreviations_callback($matches) {
|
3064 |
-
$abbr_word = $matches[1];
|
3065 |
-
$abbr_desc = $matches[2];
|
3066 |
-
if ($this->abbr_word_re)
|
3067 |
-
$this->abbr_word_re .= '|';
|
3068 |
-
$this->abbr_word_re .= preg_quote($abbr_word);
|
3069 |
-
$this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
|
3070 |
-
return ''; # String that will replace the block
|
3071 |
-
}
|
3072 |
-
|
3073 |
-
|
3074 |
-
function doAbbreviations($text) {
|
3075 |
-
#
|
3076 |
-
# Find defined abbreviations in text and wrap them in <abbr> elements.
|
3077 |
-
#
|
3078 |
-
if ($this->abbr_word_re) {
|
3079 |
-
// cannot use the /x modifier because abbr_word_re may
|
3080 |
-
// contain significant spaces:
|
3081 |
-
$text = preg_replace_callback('{'.
|
3082 |
-
'(?<![\w\x1A])'.
|
3083 |
-
'(?:'.$this->abbr_word_re.')'.
|
3084 |
-
'(?![\w\x1A])'.
|
3085 |
-
'}',
|
3086 |
-
array(&$this, '_doAbbreviations_callback'), $text);
|
3087 |
-
}
|
3088 |
-
return $text;
|
3089 |
-
}
|
3090 |
-
function _doAbbreviations_callback($matches) {
|
3091 |
-
$abbr = $matches[0];
|
3092 |
-
if (isset($this->abbr_desciptions[$abbr])) {
|
3093 |
-
$desc = $this->abbr_desciptions[$abbr];
|
3094 |
-
if (empty($desc)) {
|
3095 |
-
return $this->hashPart("<abbr>$abbr</abbr>");
|
3096 |
-
} else {
|
3097 |
-
$desc = $this->encodeAttribute($desc);
|
3098 |
-
return $this->hashPart("<abbr title=\"$desc\">$abbr</abbr>");
|
3099 |
-
}
|
3100 |
-
} else {
|
3101 |
-
return $matches[0];
|
3102 |
-
}
|
3103 |
-
}
|
3104 |
-
|
3105 |
-
}
|
3106 |
-
|
3107 |
-
|
3108 |
-
/*
|
3109 |
-
|
3110 |
-
PHP Markdown Extra
|
3111 |
-
==================
|
3112 |
-
|
3113 |
-
Description
|
3114 |
-
-----------
|
3115 |
-
|
3116 |
-
This is a PHP port of the original Markdown formatter written in Perl
|
3117 |
-
by John Gruber. This special "Extra" version of PHP Markdown features
|
3118 |
-
further enhancements to the syntax for making additional constructs
|
3119 |
-
such as tables and definition list.
|
3120 |
-
|
3121 |
-
Markdown is a text-to-HTML filter; it translates an easy-to-read /
|
3122 |
-
easy-to-write structured text format into HTML. Markdown's text format
|
3123 |
-
is mostly similar to that of plain text email, and supports features such
|
3124 |
-
as headers, *emphasis*, code blocks, blockquotes, and links.
|
3125 |
-
|
3126 |
-
Markdown's syntax is designed not as a generic markup language, but
|
3127 |
-
specifically to serve as a front-end to (X)HTML. You can use span-level
|
3128 |
-
HTML tags anywhere in a Markdown document, and you can use block level
|
3129 |
-
HTML tags (like <div> and <table> as well).
|
3130 |
-
|
3131 |
-
For more information about Markdown's syntax, see:
|
3132 |
-
|
3133 |
-
<http://daringfireball.net/projects/markdown/>
|
3134 |
-
|
3135 |
-
|
3136 |
-
Bugs
|
3137 |
-
----
|
3138 |
-
|
3139 |
-
To file bug reports please send email to:
|
3140 |
-
|
3141 |
-
<michel.fortin@michelf.ca>
|
3142 |
-
|
3143 |
-
Please include with your report: (1) the example input; (2) the output you
|
3144 |
-
expected; (3) the output Markdown actually produced.
|
3145 |
-
|
3146 |
-
|
3147 |
-
Version History
|
3148 |
-
---------------
|
3149 |
-
|
3150 |
-
See the readme file for detailed release notes for this version.
|
3151 |
-
|
3152 |
-
|
3153 |
-
Copyright and License
|
3154 |
-
---------------------
|
3155 |
-
|
3156 |
-
PHP Markdown & Extra
|
3157 |
-
Copyright (c) 2004-2013 Michel Fortin
|
3158 |
-
<http://michelf.ca/>
|
3159 |
-
All rights reserved.
|
3160 |
-
|
3161 |
-
Based on Markdown
|
3162 |
-
Copyright (c) 2003-2006 John Gruber
|
3163 |
-
<http://daringfireball.net/>
|
3164 |
-
All rights reserved.
|
3165 |
-
|
3166 |
-
Redistribution and use in source and binary forms, with or without
|
3167 |
-
modification, are permitted provided that the following conditions are
|
3168 |
-
met:
|
3169 |
-
|
3170 |
-
* Redistributions of source code must retain the above copyright notice,
|
3171 |
-
this list of conditions and the following disclaimer.
|
3172 |
-
|
3173 |
-
* Redistributions in binary form must reproduce the above copyright
|
3174 |
-
notice, this list of conditions and the following disclaimer in the
|
3175 |
-
documentation and/or other materials provided with the distribution.
|
3176 |
-
|
3177 |
-
* Neither the name "Markdown" nor the names of its contributors may
|
3178 |
-
be used to endorse or promote products derived from this software
|
3179 |
-
without specific prior written permission.
|
3180 |
-
|
3181 |
-
This software is provided by the copyright holders and contributors "as
|
3182 |
-
is" and any express or implied warranties, including, but not limited
|
3183 |
-
to, the implied warranties of merchantability and fitness for a
|
3184 |
-
particular purpose are disclaimed. In no event shall the copyright owner
|
3185 |
-
or contributors be liable for any direct, indirect, incidental, special,
|
3186 |
-
exemplary, or consequential damages (including, but not limited to,
|
3187 |
-
procurement of substitute goods or services; loss of use, data, or
|
3188 |
-
profits; or business interruption) however caused and on any theory of
|
3189 |
-
liability, whether in contract, strict liability, or tort (including
|
3190 |
-
negligence or otherwise) arising in any way out of the use of this
|
3191 |
-
software, even if advised of the possibility of such damage.
|
3192 |
-
|
3193 |
-
*/
|
3194 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/markdown/gfm.php
DELETED
@@ -1,389 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* GitHub-Flavoured Markdown. Inspired by Evan's plugin, but modified.
|
4 |
-
*
|
5 |
-
* @author Evan Solomon
|
6 |
-
* @author Matt Wiebe <wiebe@automattic.com>
|
7 |
-
* @link https://github.com/evansolomon/wp-github-flavored-markdown-comments
|
8 |
-
*
|
9 |
-
* Add a few extras from GitHub's Markdown implementation. Must be used in a WordPress environment.
|
10 |
-
*/
|
11 |
-
|
12 |
-
class WPCom_GHF_Markdown_Parser extends MarkdownExtra_Parser {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Hooray somewhat arbitrary numbers that are fearful of 1.0.x.
|
16 |
-
*/
|
17 |
-
const WPCOM_GHF_MARDOWN_VERSION = '0.9.0';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Use a [code] shortcode when encountering a fenced code block
|
21 |
-
* @var boolean
|
22 |
-
*/
|
23 |
-
public $use_code_shortcode = true;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Preserve shortcodes, untouched by Markdown.
|
27 |
-
* This requires use within a WordPress installation.
|
28 |
-
* @var boolean
|
29 |
-
*/
|
30 |
-
public $preserve_shortcodes = true;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Preserve the legacy $latex your-latex-code-here$ style
|
34 |
-
* LaTeX markup
|
35 |
-
*/
|
36 |
-
public $preserve_latex = true;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Preserve single-line <code> blocks.
|
40 |
-
* @var boolean
|
41 |
-
*/
|
42 |
-
public $preserve_inline_code_blocks = true;
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Strip paragraphs from the output. This is the right default for WordPress,
|
46 |
-
* which generally wants to create its own paragraphs with `wpautop`
|
47 |
-
* @var boolean
|
48 |
-
*/
|
49 |
-
public $strip_paras = true;
|
50 |
-
|
51 |
-
// Will run through sprintf - you can supply your own syntax if you want
|
52 |
-
public $shortcode_start = '[code lang=%s]';
|
53 |
-
public $shortcode_end = '[/code]';
|
54 |
-
|
55 |
-
// Stores shortcodes we remove and then replace
|
56 |
-
protected $preserve_text_hash = array();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Set environment defaults based on presence of key functions/classes.
|
60 |
-
*/
|
61 |
-
public function __construct() {
|
62 |
-
$this->use_code_shortcode = class_exists( 'SyntaxHighlighter' );
|
63 |
-
$this->preserve_shortcodes = function_exists( 'get_shortcode_regex' );
|
64 |
-
$this->preserve_latex = function_exists( 'latex_markup' );
|
65 |
-
$this->strip_paras = function_exists( 'wpautop' );
|
66 |
-
|
67 |
-
parent::__construct();
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Overload to specify heading styles only if the hash has space(s) after it. This is actually in keeping with
|
72 |
-
* the documentation and eases the semantic overload of the hash character.
|
73 |
-
* #Will Not Produce a Heading 1
|
74 |
-
* # This Will Produce a Heading 1
|
75 |
-
*
|
76 |
-
* @param string $text Markdown text
|
77 |
-
* @return string HTML-transformed text
|
78 |
-
*/
|
79 |
-
public function transform( $text ) {
|
80 |
-
// Preserve anything inside a single-line <code> element
|
81 |
-
if ( $this->preserve_inline_code_blocks ) {
|
82 |
-
$text = $this->single_line_code_preserve( $text );
|
83 |
-
}
|
84 |
-
// Remove all shortcodes so their interiors are left intact
|
85 |
-
if ( $this->preserve_shortcodes ) {
|
86 |
-
$text = $this->shortcode_preserve( $text );
|
87 |
-
}
|
88 |
-
// Remove legacy LaTeX so it's left intact
|
89 |
-
if ( $this->preserve_latex ) {
|
90 |
-
$text = $this->latex_preserve( $text );
|
91 |
-
}
|
92 |
-
|
93 |
-
// escape line-beginning # chars that do not have a space after them.
|
94 |
-
$text = preg_replace_callback( '|^#{1,6}( )?|um', array( $this, '_doEscapeForHashWithoutSpacing' ), $text );
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Allow third-party plugins to define custom patterns that won't be processed by Markdown.
|
98 |
-
*
|
99 |
-
* @module markdown
|
100 |
-
*
|
101 |
-
* @since 3.9.2
|
102 |
-
*
|
103 |
-
* @param array $custom_patterns Array of custom patterns to be ignored by Markdown.
|
104 |
-
*/
|
105 |
-
$custom_patterns = apply_filters( 'jetpack_markdown_preserve_pattern', array() );
|
106 |
-
if ( is_array( $custom_patterns ) && ! empty( $custom_patterns ) ) {
|
107 |
-
foreach ( $custom_patterns as $pattern ) {
|
108 |
-
$text = preg_replace_callback( $pattern, array( $this, '_doRemoveText'), $text );
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
// run through core Markdown
|
113 |
-
$text = parent::transform( $text );
|
114 |
-
|
115 |
-
// Occasionally Markdown Extra chokes on a para structure, producing odd paragraphs.
|
116 |
-
$text = str_replace( "<p><</p>\n\n<p>p>", '<p>', $text );
|
117 |
-
|
118 |
-
// put start-of-line # chars back in place
|
119 |
-
$text = $this->restore_leading_hash( $text );
|
120 |
-
|
121 |
-
// Strip paras if set
|
122 |
-
if ( $this->strip_paras ) {
|
123 |
-
$text = $this->unp( $text );
|
124 |
-
}
|
125 |
-
|
126 |
-
// Restore preserved things like shortcodes/LaTeX
|
127 |
-
$text = $this->do_restore( $text );
|
128 |
-
|
129 |
-
return $text;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Prevents blocks like <code>__this__</code> from turning into <code><strong>this</strong></code>
|
134 |
-
* @param string $text Text that may need preserving
|
135 |
-
* @return string Text that was preserved if needed
|
136 |
-
*/
|
137 |
-
public function single_line_code_preserve( $text ) {
|
138 |
-
return preg_replace_callback( '|<code\b[^>]*>(.*?)</code>|', array( $this, 'do_single_line_code_preserve' ), $text );
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Regex callback for inline code presevation
|
143 |
-
* @param array $matches Regex matches
|
144 |
-
* @return string Hashed content for later restoration
|
145 |
-
*/
|
146 |
-
public function do_single_line_code_preserve( $matches ) {
|
147 |
-
return '<code>' . $this->hash_block( $matches[1] ) . '</code>';
|
148 |
-
}
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Preserve code block contents by HTML encoding them. Useful before getting to KSES stripping.
|
152 |
-
* @param string $text Markdown/HTML content
|
153 |
-
* @return string Markdown/HTML content with escaped code blocks
|
154 |
-
*/
|
155 |
-
public function codeblock_preserve( $text ) {
|
156 |
-
return preg_replace_callback( "/^([`~]{3})([^`\n]+)?\n([^`~]+)(\\1)/m", array( $this, 'do_codeblock_preserve' ), $text );
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Regex callback for code block preservation.
|
161 |
-
* @param array $matches Regex matches
|
162 |
-
* @return string Codeblock with escaped interior
|
163 |
-
*/
|
164 |
-
public function do_codeblock_preserve( $matches ) {
|
165 |
-
$block = stripslashes( $matches[3] );
|
166 |
-
$block = esc_html( $block );
|
167 |
-
$block = str_replace( '\\', '\\\\', $block );
|
168 |
-
$open = $matches[1] . $matches[2] . "\n";
|
169 |
-
return $open . $block . $matches[4];
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Restore previously preserved (i.e. escaped) code block contents.
|
174 |
-
* @param string $text Markdown/HTML content with escaped code blocks
|
175 |
-
* @return string Markdown/HTML content
|
176 |
-
*/
|
177 |
-
public function codeblock_restore( $text ) {
|
178 |
-
return preg_replace_callback( "/^([`~]{3})([^`\n]+)?\n([^`~]+)(\\1)/m", array( $this, 'do_codeblock_restore' ), $text );
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Regex callback for code block restoration (unescaping).
|
183 |
-
* @param array $matches Regex matches
|
184 |
-
* @return string Codeblock with unescaped interior
|
185 |
-
*/
|
186 |
-
public function do_codeblock_restore( $matches ) {
|
187 |
-
$block = html_entity_decode( $matches[3], ENT_QUOTES );
|
188 |
-
$open = $matches[1] . $matches[2] . "\n";
|
189 |
-
return $open . $block . $matches[4];
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Called to preserve legacy LaTeX like $latex some-latex-text $
|
194 |
-
* @param string $text Text in which to preserve LaTeX
|
195 |
-
* @return string Text with LaTeX replaced by a hash that will be restored later
|
196 |
-
*/
|
197 |
-
protected function latex_preserve( $text ) {
|
198 |
-
// regex from latex_remove()
|
199 |
-
$regex = '%
|
200 |
-
\$latex(?:=\s*|\s+)
|
201 |
-
((?:
|
202 |
-
[^$]+ # Not a dollar
|
203 |
-
|
|
204 |
-
(?<=(?<!\\\\)\\\\)\$ # Dollar preceded by exactly one slash
|
205 |
-
)+)
|
206 |
-
(?<!\\\\)\$ # Dollar preceded by zero slashes
|
207 |
-
%ix';
|
208 |
-
$text = preg_replace_callback( $regex, array( $this, '_doRemoveText'), $text );
|
209 |
-
return $text;
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Called to preserve WP shortcodes from being formatted by Markdown in any way.
|
214 |
-
* @param string $text Text in which to preserve shortcodes
|
215 |
-
* @return string Text with shortcodes replaced by a hash that will be restored later
|
216 |
-
*/
|
217 |
-
protected function shortcode_preserve( $text ) {
|
218 |
-
$text = preg_replace_callback( $this->get_shortcode_regex(), array( $this, '_doRemoveText' ), $text );
|
219 |
-
return $text;
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Restores any text preserved by $this->hash_block()
|
224 |
-
* @param string $text Text that may have hashed preservation placeholders
|
225 |
-
* @return string Text with hashed preseravtion placeholders replaced by original text
|
226 |
-
*/
|
227 |
-
protected function do_restore( $text ) {
|
228 |
-
foreach( $this->preserve_text_hash as $hash => $value ) {
|
229 |
-
$placeholder = $this->hash_maker( $hash );
|
230 |
-
$text = str_replace( $placeholder, $value, $text );
|
231 |
-
}
|
232 |
-
// reset the hash
|
233 |
-
$this->preserve_text_hash = array();
|
234 |
-
return $text;
|
235 |
-
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Regex callback for text preservation
|
239 |
-
* @param array $m Regex $matches array
|
240 |
-
* @return string A placeholder that will later be replaced by the original text
|
241 |
-
*/
|
242 |
-
protected function _doRemoveText( $m ) {
|
243 |
-
return $this->hash_block( $m[0] );
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* Call this to store a text block for later restoration.
|
248 |
-
* @param string $text Text to preserve for later
|
249 |
-
* @return string Placeholder that will be swapped out later for the original text
|
250 |
-
*/
|
251 |
-
protected function hash_block( $text ) {
|
252 |
-
$hash = md5( $text );
|
253 |
-
$this->preserve_text_hash[ $hash ] = $text;
|
254 |
-
$placeholder = $this->hash_maker( $hash );
|
255 |
-
return $placeholder;
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Less glamorous than the Keymaker
|
260 |
-
* @param string $hash An md5 hash
|
261 |
-
* @return string A placeholder hash
|
262 |
-
*/
|
263 |
-
protected function hash_maker( $hash ) {
|
264 |
-
return 'MARKDOWN_HASH' . $hash . 'MARKDOWN_HASH';
|
265 |
-
}
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Remove bare <p> elements. <p>s with attributes will be preserved.
|
269 |
-
* @param string $text HTML content
|
270 |
-
* @return string <p>-less content
|
271 |
-
*/
|
272 |
-
public function unp( $text ) {
|
273 |
-
return preg_replace( "#<p>(.*?)</p>(\n|$)#ums", '$1$2', $text );
|
274 |
-
}
|
275 |
-
|
276 |
-
/**
|
277 |
-
* A regex of all shortcodes currently registered by the current
|
278 |
-
* WordPress installation
|
279 |
-
* @uses get_shortcode_regex()
|
280 |
-
* @return string A regex for grabbing shortcodes.
|
281 |
-
*/
|
282 |
-
protected function get_shortcode_regex() {
|
283 |
-
$pattern = get_shortcode_regex();
|
284 |
-
|
285 |
-
// don't match markdown link anchors that could be mistaken for shortcodes.
|
286 |
-
$pattern .= '(?!\()';
|
287 |
-
|
288 |
-
return "/$pattern/s";
|
289 |
-
}
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Since we escape unspaced #Headings, put things back later.
|
293 |
-
* @param string $text text with a leading escaped hash
|
294 |
-
* @return string text with leading hashes unescaped
|
295 |
-
*/
|
296 |
-
protected function restore_leading_hash( $text ) {
|
297 |
-
return preg_replace( "/^(<p>)?(#|\\\\#)/um", "$1#", $text );
|
298 |
-
}
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Overload to support ```-fenced code blocks for pre-Markdown Extra 1.2.8
|
302 |
-
* https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
|
303 |
-
*/
|
304 |
-
public function doFencedCodeBlocks( $text ) {
|
305 |
-
// If we're at least at 1.2.8, native fenced code blocks are in.
|
306 |
-
// Below is just copied from it in case we somehow got loaded on
|
307 |
-
// top of someone else's Markdown Extra
|
308 |
-
if ( version_compare( MARKDOWNEXTRA_VERSION, '1.2.8', '>=' ) )
|
309 |
-
return parent::doFencedCodeBlocks( $text );
|
310 |
-
|
311 |
-
#
|
312 |
-
# Adding the fenced code block syntax to regular Markdown:
|
313 |
-
#
|
314 |
-
# ~~~
|
315 |
-
# Code block
|
316 |
-
# ~~~
|
317 |
-
#
|
318 |
-
$less_than_tab = $this->tab_width;
|
319 |
-
|
320 |
-
$text = preg_replace_callback('{
|
321 |
-
(?:\n|\A)
|
322 |
-
# 1: Opening marker
|
323 |
-
(
|
324 |
-
(?:~{3,}|`{3,}) # 3 or more tildes/backticks.
|
325 |
-
)
|
326 |
-
[ ]*
|
327 |
-
(?:
|
328 |
-
\.?([-_:a-zA-Z0-9]+) # 2: standalone class name
|
329 |
-
|
|
330 |
-
'.$this->id_class_attr_catch_re.' # 3: Extra attributes
|
331 |
-
)?
|
332 |
-
[ ]* \n # Whitespace and newline following marker.
|
333 |
-
|
334 |
-
# 4: Content
|
335 |
-
(
|
336 |
-
(?>
|
337 |
-
(?!\1 [ ]* \n) # Not a closing marker.
|
338 |
-
.*\n+
|
339 |
-
)+
|
340 |
-
)
|
341 |
-
|
342 |
-
# Closing marker.
|
343 |
-
\1 [ ]* (?= \n )
|
344 |
-
}xm',
|
345 |
-
array($this, '_doFencedCodeBlocks_callback'), $text);
|
346 |
-
|
347 |
-
return $text;
|
348 |
-
}
|
349 |
-
|
350 |
-
/**
|
351 |
-
* Callback for pre-processing start of line hashes to slyly escape headings that don't
|
352 |
-
* have a leading space
|
353 |
-
* @param array $m preg_match matches
|
354 |
-
* @return string possibly escaped start of line hash
|
355 |
-
*/
|
356 |
-
public function _doEscapeForHashWithoutSpacing( $m ) {
|
357 |
-
if ( ! isset( $m[1] ) )
|
358 |
-
$m[0] = '\\' . $m[0];
|
359 |
-
return $m[0];
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Overload to support Viper's [code] shortcode. Because awesome.
|
364 |
-
*/
|
365 |
-
public function _doFencedCodeBlocks_callback( $matches ) {
|
366 |
-
// in case we have some escaped leading hashes right at the start of the block
|
367 |
-
$matches[4] = $this->restore_leading_hash( $matches[4] );
|
368 |
-
// just MarkdownExtra_Parser if we're not going ultra-deluxe
|
369 |
-
if ( ! $this->use_code_shortcode ) {
|
370 |
-
return parent::_doFencedCodeBlocks_callback( $matches );
|
371 |
-
}
|
372 |
-
|
373 |
-
// default to a "text" class if one wasn't passed. Helps with encoding issues later.
|
374 |
-
if ( empty( $matches[2] ) ) {
|
375 |
-
$matches[2] = 'text';
|
376 |
-
}
|
377 |
-
|
378 |
-
$classname =& $matches[2];
|
379 |
-
$codeblock = preg_replace_callback('/^\n+/', array( $this, '_doFencedCodeBlocks_newlines' ), $matches[4] );
|
380 |
-
|
381 |
-
if ( $classname{0} == '.' )
|
382 |
-
$classname = substr( $classname, 1 );
|
383 |
-
|
384 |
-
$codeblock = esc_html( $codeblock );
|
385 |
-
$codeblock = sprintf( $this->shortcode_start, $classname ) . "\n{$codeblock}" . $this->shortcode_end;
|
386 |
-
return "\n\n" . $this->hashBlock( $codeblock ). "\n\n";
|
387 |
-
}
|
388 |
-
|
389 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tonesque.php
DELETED
@@ -1,215 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Tonesque
|
4 |
-
Plugin URI: http://automattic.com/
|
5 |
-
Description: Grab an average color representation from an image.
|
6 |
-
Version: 1.0
|
7 |
-
Author: Automattic, Matias Ventura
|
8 |
-
Author URI: http://automattic.com/
|
9 |
-
License: GNU General Public License v2 or later
|
10 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
-
*/
|
12 |
-
|
13 |
-
class Tonesque {
|
14 |
-
|
15 |
-
private $image_url = '';
|
16 |
-
private $image_obj = NULL;
|
17 |
-
private $color = '';
|
18 |
-
|
19 |
-
function __construct( $image_url ) {
|
20 |
-
if ( ! class_exists( 'Jetpack_Color' ) )
|
21 |
-
jetpack_require_lib( 'class.color' );
|
22 |
-
|
23 |
-
$this->image_url = esc_url_raw( $image_url );
|
24 |
-
$this->image_url = trim( $this->image_url );
|
25 |
-
/**
|
26 |
-
* Allows any image URL to be passed in for $this->image_url.
|
27 |
-
*
|
28 |
-
* @module theme-tools
|
29 |
-
*
|
30 |
-
* @since 2.5.0
|
31 |
-
*
|
32 |
-
* @param string $image_url The URL to any image
|
33 |
-
*/
|
34 |
-
$this->image_url = apply_filters( 'tonesque_image_url', $this->image_url );
|
35 |
-
|
36 |
-
$this->image_obj = self::imagecreatefromurl( $this->image_url );
|
37 |
-
}
|
38 |
-
|
39 |
-
public static function imagecreatefromurl( $image_url ) {
|
40 |
-
// Grab the extension
|
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 |
-
/**
|
64 |
-
*
|
65 |
-
* Construct object from image.
|
66 |
-
*
|
67 |
-
* @param optional $type (hex, rgb, hsl)
|
68 |
-
* @return color as a string formatted as $type
|
69 |
-
*
|
70 |
-
*/
|
71 |
-
function color( $type = 'hex' ) {
|
72 |
-
// Bail if there is no image to work with
|
73 |
-
if ( ! $this->image_obj )
|
74 |
-
return false;
|
75 |
-
|
76 |
-
// Finds dominant color
|
77 |
-
$color = self::grab_color();
|
78 |
-
// Passes value to Color class
|
79 |
-
$color = self::get_color( $color, $type );
|
80 |
-
return $color;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
*
|
85 |
-
* Grabs the color index for each of five sample points of the image
|
86 |
-
*
|
87 |
-
* @param $image
|
88 |
-
* @param $type can be 'index' or 'hex'
|
89 |
-
* @return array() with color indices
|
90 |
-
*
|
91 |
-
*/
|
92 |
-
function grab_points( $type = 'index' ) {
|
93 |
-
$img = $this->image_obj;
|
94 |
-
if ( ! $img )
|
95 |
-
return false;
|
96 |
-
|
97 |
-
$height = imagesy( $img );
|
98 |
-
$width = imagesx( $img );
|
99 |
-
|
100 |
-
// Sample five points in the image
|
101 |
-
// Based on rule of thirds and center
|
102 |
-
$topy = round( $height / 3 );
|
103 |
-
$bottomy = round( ( $height / 3 ) * 2 );
|
104 |
-
$leftx = round( $width / 3 );
|
105 |
-
$rightx = round( ( $width / 3 ) * 2 );
|
106 |
-
$centery = round( $height / 2 );
|
107 |
-
$centerx = round( $width / 2 );
|
108 |
-
|
109 |
-
// Cast those colors into an array
|
110 |
-
$points = array(
|
111 |
-
imagecolorat( $img, $leftx, $topy ),
|
112 |
-
imagecolorat( $img, $rightx, $topy ),
|
113 |
-
imagecolorat( $img, $leftx, $bottomy ),
|
114 |
-
imagecolorat( $img, $rightx, $bottomy ),
|
115 |
-
imagecolorat( $img, $centerx, $centery ),
|
116 |
-
);
|
117 |
-
|
118 |
-
if ( 'hex' == $type ) {
|
119 |
-
foreach ( $points as $i => $p ) {
|
120 |
-
$c = imagecolorsforindex( $img, $p );
|
121 |
-
$points[ $i ] = self::get_color( array(
|
122 |
-
'r' => $c['red'],
|
123 |
-
'g' => $c['green'],
|
124 |
-
'b' => $c['blue'],
|
125 |
-
), 'hex' );
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
return $points;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
*
|
134 |
-
* Finds the average color of the image based on five sample points
|
135 |
-
*
|
136 |
-
* @param $image
|
137 |
-
* @return array() with rgb color
|
138 |
-
*
|
139 |
-
*/
|
140 |
-
function grab_color() {
|
141 |
-
$img = $this->image_obj;
|
142 |
-
if ( ! $img )
|
143 |
-
return false;
|
144 |
-
|
145 |
-
$rgb = self::grab_points();
|
146 |
-
|
147 |
-
// Process the color points
|
148 |
-
// Find the average representation
|
149 |
-
foreach ( $rgb as $color ) {
|
150 |
-
$index = imagecolorsforindex( $img, $color );
|
151 |
-
$r[] = $index['red'];
|
152 |
-
$g[] = $index['green'];
|
153 |
-
$b[] = $index['blue'];
|
154 |
-
|
155 |
-
$red = round( array_sum( $r ) / 5 );
|
156 |
-
$green = round( array_sum( $g ) / 5 );
|
157 |
-
$blue = round( array_sum( $b ) / 5 );
|
158 |
-
}
|
159 |
-
|
160 |
-
// The average color of the image as rgb array
|
161 |
-
$color = array(
|
162 |
-
'r' => $red,
|
163 |
-
'g' => $green,
|
164 |
-
'b' => $blue,
|
165 |
-
);
|
166 |
-
|
167 |
-
return $color;
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
*
|
172 |
-
* Get a Color object using /lib class.color
|
173 |
-
* Convert to appropriate type
|
174 |
-
*
|
175 |
-
* @return string
|
176 |
-
*
|
177 |
-
*/
|
178 |
-
function get_color( $color, $type ) {
|
179 |
-
$c = new Jetpack_Color( $color, 'rgb' );
|
180 |
-
$this->color = $c;
|
181 |
-
|
182 |
-
switch ( $type ) {
|
183 |
-
case 'rgb' :
|
184 |
-
$color = implode( $c->toRgbInt(), ',' );
|
185 |
-
break;
|
186 |
-
case 'hex' :
|
187 |
-
$color = $c->toHex();
|
188 |
-
break;
|
189 |
-
case 'hsv' :
|
190 |
-
$color = implode( $c->toHsvInt(), ',' );
|
191 |
-
break;
|
192 |
-
default:
|
193 |
-
return $color = $c->toHex();
|
194 |
-
}
|
195 |
-
|
196 |
-
return $color;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
*
|
201 |
-
* Checks contrast against main color
|
202 |
-
* Gives either black or white for using with opacity
|
203 |
-
*
|
204 |
-
* @return string
|
205 |
-
*
|
206 |
-
*/
|
207 |
-
function contrast() {
|
208 |
-
if ( ! $this->color )
|
209 |
-
return false;
|
210 |
-
|
211 |
-
$c = $this->color->getMaxContrastColor();
|
212 |
-
return implode( $c->toRgbInt(), ',' );
|
213 |
-
}
|
214 |
-
|
215 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tracks/class.tracks-client.php
DELETED
@@ -1,168 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Jetpack_Tracks_Client
|
5 |
-
* @autounit nosara tracks-client
|
6 |
-
*
|
7 |
-
* Send Tracks events on behalf of a user
|
8 |
-
*
|
9 |
-
* Example Usage:
|
10 |
-
```php
|
11 |
-
require( dirname(__FILE__).'path/to/tracks/class.tracks-client' );
|
12 |
-
|
13 |
-
$result = Jetpack_Tracks_Client::record_event( array(
|
14 |
-
'_en' => $event_name, // required
|
15 |
-
'_ui' => $user_id, // required unless _ul is provided
|
16 |
-
'_ul' => $user_login, // required unless _ui is provided
|
17 |
-
|
18 |
-
// Optional, but recommended
|
19 |
-
'_ts' => $ts_in_ms, // Default: now
|
20 |
-
'_via_ip' => $client_ip, // we use it for geo, etc.
|
21 |
-
|
22 |
-
// Possibly useful to set some context for the event
|
23 |
-
'_via_ua' => $client_user_agent,
|
24 |
-
'_via_url' => $client_url,
|
25 |
-
'_via_ref' => $client_referrer,
|
26 |
-
|
27 |
-
// For user-targeted tests
|
28 |
-
'abtest_name' => $abtest_name,
|
29 |
-
'abtest_variation' => $abtest_variation,
|
30 |
-
|
31 |
-
// Your application-specific properties
|
32 |
-
'custom_property' => $some_value,
|
33 |
-
) );
|
34 |
-
|
35 |
-
if ( is_wp_error( $result ) ) {
|
36 |
-
// Handle the error in your app
|
37 |
-
}
|
38 |
-
```
|
39 |
-
*/
|
40 |
-
|
41 |
-
require_once( dirname(__FILE__).'/class.tracks-client.php' );
|
42 |
-
|
43 |
-
class Jetpack_Tracks_Client {
|
44 |
-
const PIXEL = 'http://pixel.wp.com/t.gif';
|
45 |
-
const BROWSER_TYPE = 'php-agent';
|
46 |
-
const USER_AGENT_SLUG = 'tracks-client';
|
47 |
-
const VERSION = '0.3';
|
48 |
-
|
49 |
-
/**
|
50 |
-
* record_event
|
51 |
-
* @param mixed $event Event object to send to Tracks. An array will be cast to object. Required.
|
52 |
-
* Properties are included directly in the pixel query string after light validation.
|
53 |
-
* @return mixed True on success, WP_Error on failure
|
54 |
-
*/
|
55 |
-
static function record_event( $event ) {
|
56 |
-
if ( ! $event instanceof Jetpack_Tracks_Event ) {
|
57 |
-
$event = new Jetpack_Tracks_Event( $event );
|
58 |
-
}
|
59 |
-
if ( is_wp_error( $event ) ) {
|
60 |
-
return $event;
|
61 |
-
}
|
62 |
-
|
63 |
-
$pixel = $event->build_pixel_url( $event );
|
64 |
-
|
65 |
-
if ( ! $pixel ) {
|
66 |
-
return new WP_Error( 'invalid_pixel', 'cannot generate tracks pixel for given input', 400 );
|
67 |
-
}
|
68 |
-
|
69 |
-
return self::record_pixel( $pixel );
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Synchronously request the pixel
|
74 |
-
*/
|
75 |
-
static function record_pixel( $pixel ) {
|
76 |
-
// Add the Request Timestamp and URL terminator just before the HTTP request.
|
77 |
-
$pixel .= '&_rt=' . self::build_timestamp() . '&_=_';
|
78 |
-
|
79 |
-
$response = wp_remote_get( $pixel, array(
|
80 |
-
'blocking' => true, // The default, but being explicit here :)
|
81 |
-
'timeout' => 1,
|
82 |
-
'redirection' => 2,
|
83 |
-
'httpversion' => '1.1',
|
84 |
-
'user-agent' => self::get_user_agent(),
|
85 |
-
) );
|
86 |
-
|
87 |
-
if ( is_wp_error( $response ) ) {
|
88 |
-
return $response;
|
89 |
-
}
|
90 |
-
|
91 |
-
$code = isset( $response['response']['code'] ) ? $response['response']['code'] : 0;
|
92 |
-
|
93 |
-
if ( $code !== 200 ) {
|
94 |
-
return new WP_Error( 'request_failed', 'Tracks pixel request failed', $code );
|
95 |
-
}
|
96 |
-
|
97 |
-
return true;
|
98 |
-
}
|
99 |
-
|
100 |
-
static function get_user_agent() {
|
101 |
-
return Jetpack_Tracks_Client::USER_AGENT_SLUG . '-v' . Jetpack_Tracks_Client::VERSION;
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Build an event and return its tracking URL
|
106 |
-
* @deprecated Call the `build_pixel_url` method on a Jetpack_Tracks_Event object instead.
|
107 |
-
* @param array $event Event keys and values
|
108 |
-
* @return string URL of a tracking pixel
|
109 |
-
*/
|
110 |
-
static function build_pixel_url( $event ) {
|
111 |
-
$_event = new Jetpack_Tracks_Event( $event );
|
112 |
-
return $_event->build_pixel_url();
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Validate input for a tracks event.
|
117 |
-
* @deprecated Instantiate a Jetpack_Tracks_Event object instead
|
118 |
-
* @param array $event Event keys and values
|
119 |
-
* @return mixed Validated keys and values or WP_Error on failure
|
120 |
-
*/
|
121 |
-
private static function validate_and_sanitize( $event ) {
|
122 |
-
$_event = new Jetpack_Tracks_Event( $event );
|
123 |
-
if ( is_wp_error( $_event ) ) {
|
124 |
-
return $_event;
|
125 |
-
}
|
126 |
-
return get_object_vars( $_event );
|
127 |
-
}
|
128 |
-
|
129 |
-
// Milliseconds since 1970-01-01
|
130 |
-
static function build_timestamp() {
|
131 |
-
$ts = round( microtime( true ) * 1000 );
|
132 |
-
return number_format( $ts, 0, '', '' );
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Grabs the user's anon id from cookies, or generates and sets a new one
|
137 |
-
*
|
138 |
-
* @return string An anon id for the user
|
139 |
-
*/
|
140 |
-
static function get_anon_id() {
|
141 |
-
static $anon_id = null;
|
142 |
-
|
143 |
-
if ( ! isset( $anon_id ) ) {
|
144 |
-
|
145 |
-
// Did the browser send us a cookie?
|
146 |
-
if ( isset( $_COOKIE[ 'tk_ai' ] ) && preg_match( '#^[A-Za-z0-9+/=]{24}$#', $_COOKIE[ 'tk_ai' ] ) ) {
|
147 |
-
$anon_id = $_COOKIE[ 'tk_ai' ];
|
148 |
-
} else {
|
149 |
-
|
150 |
-
$binary = '';
|
151 |
-
|
152 |
-
// Generate a new anonId and try to save it in the browser's cookies
|
153 |
-
// Note that base64-encoding an 18 character string generates a 24-character anon id
|
154 |
-
for ( $i = 0; $i < 18; ++$i ) {
|
155 |
-
$binary .= chr( mt_rand( 0, 255 ) );
|
156 |
-
}
|
157 |
-
|
158 |
-
$anon_id = 'jetpack:' . base64_encode( $binary );
|
159 |
-
|
160 |
-
if ( ! headers_sent() ) {
|
161 |
-
setcookie( 'tk_ai', $anon_id );
|
162 |
-
}
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
return $anon_id;
|
167 |
-
}
|
168 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tracks/class.tracks-event.php
DELETED
@@ -1,149 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @autounit nosara tracks-client
|
5 |
-
*
|
6 |
-
* Example Usage:
|
7 |
-
```php
|
8 |
-
require_once( dirname(__FILE__) . 'path/to/tracks/class.tracks-event' );
|
9 |
-
|
10 |
-
$event = new Jetpack_Tracks_Event( array(
|
11 |
-
'_en' => $event_name, // required
|
12 |
-
'_ui' => $user_id, // required unless _ul is provided
|
13 |
-
'_ul' => $user_login, // required unless _ui is provided
|
14 |
-
|
15 |
-
// Optional, but recommended
|
16 |
-
'_via_ip' => $client_ip, // for geo, etc.
|
17 |
-
|
18 |
-
// Possibly useful to set some context for the event
|
19 |
-
'_via_ua' => $client_user_agent,
|
20 |
-
'_via_url' => $client_url,
|
21 |
-
'_via_ref' => $client_referrer,
|
22 |
-
|
23 |
-
// For user-targeted tests
|
24 |
-
'abtest_name' => $abtest_name,
|
25 |
-
'abtest_variation' => $abtest_variation,
|
26 |
-
|
27 |
-
// Your application-specific properties
|
28 |
-
'custom_property' => $some_value,
|
29 |
-
) );
|
30 |
-
|
31 |
-
if ( is_wp_error( $event->error ) ) {
|
32 |
-
// Handle the error in your app
|
33 |
-
}
|
34 |
-
|
35 |
-
$bump_and_redirect_pixel = $event->build_signed_pixel_url();
|
36 |
-
```
|
37 |
-
*/
|
38 |
-
|
39 |
-
require_once( dirname(__FILE__) . '/class.tracks-client.php' );
|
40 |
-
|
41 |
-
class Jetpack_Tracks_Event {
|
42 |
-
const EVENT_NAME_REGEX = '/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/';
|
43 |
-
const PROP_NAME_REGEX = '/^[a-z_][a-z0-9_]*$/';
|
44 |
-
public $error;
|
45 |
-
|
46 |
-
function __construct( $event ) {
|
47 |
-
$_event = self::validate_and_sanitize( $event );
|
48 |
-
if ( is_wp_error( $_event ) ) {
|
49 |
-
$this->error = $_event;
|
50 |
-
return;
|
51 |
-
}
|
52 |
-
|
53 |
-
foreach( $_event as $key => $value ) {
|
54 |
-
$this->{$key} = $value;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
function record() {
|
59 |
-
return Jetpack_Tracks_Client::record_event( $this );
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Annotate the event with all relevant info.
|
64 |
-
* @param mixed $event Object or (flat) array
|
65 |
-
* @return mixed The transformed event array or WP_Error on failure.
|
66 |
-
*/
|
67 |
-
static function validate_and_sanitize( $event ) {
|
68 |
-
$event = (object) $event;
|
69 |
-
|
70 |
-
// Required
|
71 |
-
if ( ! $event->_en ) {
|
72 |
-
return new WP_Error( 'invalid_event', 'A valid event must be specified via `_en`', 400 );
|
73 |
-
}
|
74 |
-
|
75 |
-
// delete non-routable addresses otherwise geoip will discard the record entirely
|
76 |
-
if ( property_exists( $event, '_via_ip' ) && preg_match( '/^192\.168|^10\./', $event->_via_ip ) ) {
|
77 |
-
unset($event->_via_ip);
|
78 |
-
}
|
79 |
-
|
80 |
-
$validated = array(
|
81 |
-
'browser_type' => Jetpack_Tracks_Client::BROWSER_TYPE,
|
82 |
-
'_aua' => Jetpack_Tracks_Client::get_user_agent(),
|
83 |
-
);
|
84 |
-
|
85 |
-
$_event = (object) array_merge( (array) $event, $validated );
|
86 |
-
|
87 |
-
// If you want to blacklist property names, do it here.
|
88 |
-
|
89 |
-
// Make sure we have an event timestamp.
|
90 |
-
if ( ! isset( $_event->_ts ) ) {
|
91 |
-
$_event->_ts = Jetpack_Tracks_Client::build_timestamp();
|
92 |
-
}
|
93 |
-
|
94 |
-
return $_event;
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Build a pixel URL that will send a Tracks event when fired.
|
99 |
-
* On error, returns an empty string ('').
|
100 |
-
*
|
101 |
-
* @return string A pixel URL or empty string ('') if there were invalid args.
|
102 |
-
*/
|
103 |
-
function build_pixel_url() {
|
104 |
-
if ( $this->error ) {
|
105 |
-
return '';
|
106 |
-
}
|
107 |
-
|
108 |
-
$args = get_object_vars( $this );
|
109 |
-
|
110 |
-
// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.
|
111 |
-
unset( $args['_rt'] );
|
112 |
-
unset( $args['_'] );
|
113 |
-
|
114 |
-
$validated = self::validate_and_sanitize( $args );
|
115 |
-
|
116 |
-
if ( is_wp_error( $validated ) )
|
117 |
-
return '';
|
118 |
-
|
119 |
-
return Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );
|
120 |
-
}
|
121 |
-
|
122 |
-
static function event_name_is_valid( $name ) {
|
123 |
-
return preg_match( Jetpack_Tracks_Event::EVENT_NAME_REGEX, $name );
|
124 |
-
}
|
125 |
-
|
126 |
-
static function prop_name_is_valid( $name ) {
|
127 |
-
return preg_match( Jetpack_Tracks_Event::PROP_NAME_REGEX, $name );
|
128 |
-
}
|
129 |
-
|
130 |
-
static function scrutinize_event_names( $event ) {
|
131 |
-
if ( ! Jetpack_Tracks_Event::event_name_is_valid( $event->_en ) ) {
|
132 |
-
return;
|
133 |
-
}
|
134 |
-
|
135 |
-
$whitelisted_key_names = array(
|
136 |
-
'anonId',
|
137 |
-
'Browser_Type',
|
138 |
-
);
|
139 |
-
|
140 |
-
foreach ( array_keys( (array) $event ) as $key ) {
|
141 |
-
if ( in_array( $key, $whitelisted_key_names ) ) {
|
142 |
-
continue;
|
143 |
-
}
|
144 |
-
if ( ! Jetpack_Tracks_Event::prop_name_is_valid( $key ) ) {
|
145 |
-
return;
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
149 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tracks/client.php
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PHP Tracks Client
|
4 |
-
* @autounit nosara tracks-client
|
5 |
-
* Example Usage:
|
6 |
-
*
|
7 |
-
```php
|
8 |
-
include( plugin_dir_path( __FILE__ ) . 'lib/tracks/client.php');
|
9 |
-
$result = jetpack_tracks_record_event( $user, $event_name, $properties );
|
10 |
-
|
11 |
-
if ( is_wp_error( $result ) ) {
|
12 |
-
// Handle the error in your app
|
13 |
-
}
|
14 |
-
```
|
15 |
-
*/
|
16 |
-
|
17 |
-
// Load the client classes
|
18 |
-
require_once( dirname(__FILE__) . '/class.tracks-event.php' );
|
19 |
-
require_once( dirname(__FILE__) . '/class.tracks-client.php' );
|
20 |
-
|
21 |
-
// Now, let's export a sprinkling of syntactic sugar!
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Procedurally (vs. Object-oriented), track an event object (or flat array)
|
25 |
-
* NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
|
26 |
-
* @param \Jetpack_Tracks_Event $event The event object.
|
27 |
-
* @return \Jetpack_Tracks_Event|\WP_Error
|
28 |
-
*/
|
29 |
-
function jetpack_tracks_record_event_raw( $event ) {
|
30 |
-
return Jetpack_Tracks_Client::record_event( $event );
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Procedurally build a Tracks Event Object.
|
35 |
-
* NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
|
36 |
-
* @param $identity WP_user object
|
37 |
-
* @param string $event_name The name of the event
|
38 |
-
* @param array $properties Custom properties to send with the event
|
39 |
-
* @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
|
40 |
-
* @return \Jetpack_Tracks_Event|\WP_Error
|
41 |
-
*/
|
42 |
-
function jetpack_tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
|
43 |
-
|
44 |
-
$identity = jetpack_tracks_get_identity( $user->ID );
|
45 |
-
|
46 |
-
$properties['user_lang'] = $user->get( 'WPLANG' );
|
47 |
-
|
48 |
-
$blog_details = array(
|
49 |
-
'blog_lang' => isset( $properties['blog_lang'] ) ? $properties['blog_lang'] : get_bloginfo( 'language' )
|
50 |
-
);
|
51 |
-
|
52 |
-
$timestamp = ( $event_timestamp_millis !== false ) ? $event_timestamp_millis : round( microtime( true ) * 1000 );
|
53 |
-
$timestamp_string = is_string( $timestamp ) ? $timestamp : number_format( $timestamp, 0, '', '' );
|
54 |
-
|
55 |
-
return new Jetpack_Tracks_Event( array_merge( $blog_details, (array) $properties, $identity, array(
|
56 |
-
'_en' => $event_name,
|
57 |
-
'_ts' => $timestamp_string
|
58 |
-
) ) );
|
59 |
-
}
|
60 |
-
|
61 |
-
/*
|
62 |
-
* Get the identity to send to tracks.
|
63 |
-
*
|
64 |
-
* @param int $user_id The user id of the local user
|
65 |
-
* @return array $identity
|
66 |
-
*/
|
67 |
-
function jetpack_tracks_get_identity( $user_id ) {
|
68 |
-
|
69 |
-
// Meta is set, and user is still connected. Use WPCOM ID
|
70 |
-
$wpcom_id = get_user_meta( $user_id, 'jetpack_tracks_wpcom_id', true );
|
71 |
-
if ( $wpcom_id && Jetpack::is_user_connected( $user_id ) ) {
|
72 |
-
return array(
|
73 |
-
'_ut' => 'wpcom:user_id',
|
74 |
-
'_ui' => $wpcom_id
|
75 |
-
);
|
76 |
-
}
|
77 |
-
|
78 |
-
// User is connected, but no meta is set yet. Use WPCOM ID and set meta.
|
79 |
-
if ( Jetpack::is_user_connected( $user_id ) ) {
|
80 |
-
$wpcom_user_data = Jetpack::get_connected_user_data( $user_id );
|
81 |
-
add_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'], true );
|
82 |
-
|
83 |
-
return array(
|
84 |
-
'_ut' => 'wpcom:user_id',
|
85 |
-
'_ui' => $wpcom_user_data['ID']
|
86 |
-
);
|
87 |
-
}
|
88 |
-
|
89 |
-
// User isn't linked at all. Fall back to anonymous ID.
|
90 |
-
$anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true );
|
91 |
-
if ( ! $anon_id ) {
|
92 |
-
$anon_id = Jetpack_Tracks_Client::get_anon_id();
|
93 |
-
add_user_meta( $user_id, 'jetpack_tracks_anon_id', $anon_id, false );
|
94 |
-
}
|
95 |
-
|
96 |
-
if ( ! isset( $_COOKIE[ 'tk_ai' ] ) && ! headers_sent() ) {
|
97 |
-
setcookie( 'tk_ai', $anon_id );
|
98 |
-
}
|
99 |
-
|
100 |
-
return array(
|
101 |
-
'_ut' => 'anon',
|
102 |
-
'_ui' => $anon_id
|
103 |
-
);
|
104 |
-
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Record an event in Tracks - this is the preferred way to record events from PHP.
|
109 |
-
*
|
110 |
-
* @param mixed $identity username, user_id, or WP_user object
|
111 |
-
* @param string $event_name The name of the event
|
112 |
-
* @param array $properties Custom properties to send with the event
|
113 |
-
* @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
|
114 |
-
* @return bool true for success | \WP_Error if the event pixel could not be fired
|
115 |
-
*/
|
116 |
-
function jetpack_tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
|
117 |
-
$event_obj = jetpack_tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis );
|
118 |
-
|
119 |
-
if ( is_wp_error( $event_obj->error ) ) {
|
120 |
-
return $event_obj->error;
|
121 |
-
}
|
122 |
-
|
123 |
-
return $event_obj->record();
|
124 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/lib/tracks/tracks-ajax.js
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
/* global jpTracksAJAX, jQuery */
|
2 |
-
|
3 |
-
(function( $, jpTracksAJAX ) {
|
4 |
-
|
5 |
-
$( document ).ready( function () {
|
6 |
-
$( 'body' ).on( 'click', '.jptracks a, a.jptracks', function( event ) {
|
7 |
-
|
8 |
-
// We know that the jptracks element is either this, or its ancestor
|
9 |
-
var $jptracks = $( this ).closest( '.jptracks' );
|
10 |
-
|
11 |
-
var data = {
|
12 |
-
tracksNonce: jpTracksAJAX.jpTracksAJAX_nonce,
|
13 |
-
action: 'jetpack_tracks',
|
14 |
-
tracksEventType: 'click',
|
15 |
-
tracksEventName: $jptracks.attr( 'data-jptracks-name' ),
|
16 |
-
tracksEventProp: $jptracks.attr( 'data-jptracks-prop' ) || false
|
17 |
-
};
|
18 |
-
|
19 |
-
// We need an event name at least
|
20 |
-
if ( undefined === data.tracksEventName ) {
|
21 |
-
return;
|
22 |
-
}
|
23 |
-
|
24 |
-
var url = $( this ).attr( 'href' );
|
25 |
-
var target = $( this ).get( 0 ).target;
|
26 |
-
if ( url && target && '_self' !== target ) {
|
27 |
-
var newTabWindow = window.open( '', target );
|
28 |
-
}
|
29 |
-
|
30 |
-
event.preventDefault();
|
31 |
-
|
32 |
-
$.ajax( {
|
33 |
-
type: 'POST',
|
34 |
-
url: jpTracksAJAX.ajaxurl,
|
35 |
-
data: data
|
36 |
-
} ).always( function() {
|
37 |
-
// Continue on to whatever url they were trying to get to.
|
38 |
-
if ( url ) {
|
39 |
-
if ( newTabWindow ) {
|
40 |
-
newTabWindow.location = url;
|
41 |
-
return;
|
42 |
-
}
|
43 |
-
window.location = url;
|
44 |
-
}
|
45 |
-
} );
|
46 |
-
});
|
47 |
-
});
|
48 |
-
|
49 |
-
})( jQuery, jpTracksAJAX );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/postmessage.js
DELETED
@@ -1,438 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
The MIT License
|
3 |
-
|
4 |
-
Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com)
|
5 |
-
|
6 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
-
of this software and associated documentation files (the "Software"), to deal
|
8 |
-
in the Software without restriction, including without limitation the rights
|
9 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
-
copies of the Software, and to permit persons to whom the Software is
|
11 |
-
furnished to do so, subject to the following conditions:
|
12 |
-
|
13 |
-
The above copyright notice and this permission notice shall be included in
|
14 |
-
all copies or substantial portions of the Software.
|
15 |
-
|
16 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
-
THE SOFTWARE.
|
23 |
-
**/
|
24 |
-
var NO_JQUERY = {};
|
25 |
-
(function(window, $, undefined) {
|
26 |
-
|
27 |
-
if (!("console" in window)) {
|
28 |
-
var c = window.console = {};
|
29 |
-
c.log = c.warn = c.error = c.debug = function(){};
|
30 |
-
}
|
31 |
-
|
32 |
-
if ($ === NO_JQUERY) {
|
33 |
-
// jQuery is optional
|
34 |
-
$ = {
|
35 |
-
fn: {},
|
36 |
-
extend: function() {
|
37 |
-
var a = arguments[0];
|
38 |
-
for (var i=1,len=arguments.length; i<len; i++) {
|
39 |
-
var b = arguments[i];
|
40 |
-
for (var prop in b) {
|
41 |
-
a[prop] = b[prop];
|
42 |
-
}
|
43 |
-
}
|
44 |
-
return a;
|
45 |
-
}
|
46 |
-
};
|
47 |
-
}
|
48 |
-
|
49 |
-
$.fn.pm = function() {
|
50 |
-
console.log("usage: \nto send: $.pm(options)\nto receive: $.pm.bind(type, fn, [origin])");
|
51 |
-
return this;
|
52 |
-
};
|
53 |
-
|
54 |
-
// send postmessage
|
55 |
-
$.pm = window.pm = function(options) {
|
56 |
-
pm.send(options);
|
57 |
-
};
|
58 |
-
|
59 |
-
// bind postmessage handler
|
60 |
-
$.pm.bind = window.pm.bind = function(type, fn, origin, hash, async_reply) {
|
61 |
-
pm.bind(type, fn, origin, hash, async_reply === true);
|
62 |
-
};
|
63 |
-
|
64 |
-
// unbind postmessage handler
|
65 |
-
$.pm.unbind = window.pm.unbind = function(type, fn) {
|
66 |
-
pm.unbind(type, fn);
|
67 |
-
};
|
68 |
-
|
69 |
-
// default postmessage origin on bind
|
70 |
-
$.pm.origin = window.pm.origin = null;
|
71 |
-
|
72 |
-
// default postmessage polling if using location hash to pass postmessages
|
73 |
-
$.pm.poll = window.pm.poll = 200;
|
74 |
-
|
75 |
-
var pm = {
|
76 |
-
|
77 |
-
send: function(options) {
|
78 |
-
var o = $.extend({}, pm.defaults, options),
|
79 |
-
target = o.target;
|
80 |
-
if (!o.target) {
|
81 |
-
console.warn("postmessage target window required");
|
82 |
-
return;
|
83 |
-
}
|
84 |
-
if (!o.type) {
|
85 |
-
console.warn("postmessage type required");
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
var msg = {data:o.data, type:o.type};
|
89 |
-
if (o.success) {
|
90 |
-
msg.callback = pm._callback(o.success);
|
91 |
-
}
|
92 |
-
if (o.error) {
|
93 |
-
msg.errback = pm._callback(o.error);
|
94 |
-
}
|
95 |
-
if (("postMessage" in target) && !o.hash) {
|
96 |
-
pm._bind();
|
97 |
-
target.postMessage(JSON.stringify(msg), o.origin || '*');
|
98 |
-
}
|
99 |
-
else {
|
100 |
-
pm.hash._bind();
|
101 |
-
pm.hash.send(o, msg);
|
102 |
-
}
|
103 |
-
},
|
104 |
-
|
105 |
-
bind: function(type, fn, origin, hash, async_reply) {
|
106 |
-
pm._replyBind ( type, fn, origin, hash, async_reply );
|
107 |
-
},
|
108 |
-
|
109 |
-
_replyBind: function(type, fn, origin, hash, isCallback) {
|
110 |
-
if (("postMessage" in window) && !hash) {
|
111 |
-
pm._bind();
|
112 |
-
}
|
113 |
-
else {
|
114 |
-
pm.hash._bind();
|
115 |
-
}
|
116 |
-
var l = pm.data("listeners.postmessage");
|
117 |
-
if (!l) {
|
118 |
-
l = {};
|
119 |
-
pm.data("listeners.postmessage", l);
|
120 |
-
}
|
121 |
-
var fns = l[type];
|
122 |
-
if (!fns) {
|
123 |
-
fns = [];
|
124 |
-
l[type] = fns;
|
125 |
-
}
|
126 |
-
fns.push({fn:fn, callback: isCallback, origin:origin || $.pm.origin});
|
127 |
-
},
|
128 |
-
|
129 |
-
unbind: function(type, fn) {
|
130 |
-
var l = pm.data("listeners.postmessage");
|
131 |
-
if (l) {
|
132 |
-
if (type) {
|
133 |
-
if (fn) {
|
134 |
-
// remove specific listener
|
135 |
-
var fns = l[type];
|
136 |
-
if (fns) {
|
137 |
-
var m = [];
|
138 |
-
for (var i=0,len=fns.length; i<len; i++) {
|
139 |
-
var o = fns[i];
|
140 |
-
if (o.fn !== fn) {
|
141 |
-
m.push(o);
|
142 |
-
}
|
143 |
-
}
|
144 |
-
l[type] = m;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
else {
|
148 |
-
// remove all listeners by type
|
149 |
-
delete l[type];
|
150 |
-
}
|
151 |
-
}
|
152 |
-
else {
|
153 |
-
// unbind all listeners of all type
|
154 |
-
for (var i in l) {
|
155 |
-
delete l[i];
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
},
|
160 |
-
|
161 |
-
data: function(k, v) {
|
162 |
-
if (v === undefined) {
|
163 |
-
return pm._data[k];
|
164 |
-
}
|
165 |
-
pm._data[k] = v;
|
166 |
-
return v;
|
167 |
-
},
|
168 |
-
|
169 |
-
_data: {},
|
170 |
-
|
171 |
-
_CHARS: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
|
172 |
-
|
173 |
-
_random: function() {
|
174 |
-
var r = [];
|
175 |
-
for (var i=0; i<32; i++) {
|
176 |
-
r[i] = pm._CHARS[0 | Math.random() * 32];
|
177 |
-
};
|
178 |
-
return r.join("");
|
179 |
-
},
|
180 |
-
|
181 |
-
_callback: function(fn) {
|
182 |
-
var cbs = pm.data("callbacks.postmessage");
|
183 |
-
if (!cbs) {
|
184 |
-
cbs = {};
|
185 |
-
pm.data("callbacks.postmessage", cbs);
|
186 |
-
}
|
187 |
-
var r = pm._random();
|
188 |
-
cbs[r] = fn;
|
189 |
-
return r;
|
190 |
-
},
|
191 |
-
|
192 |
-
_bind: function() {
|
193 |
-
// are we already listening to message events on this w?
|
194 |
-
if (!pm.data("listening.postmessage")) {
|
195 |
-
if (window.addEventListener) {
|
196 |
-
window.addEventListener("message", pm._dispatch, false);
|
197 |
-
}
|
198 |
-
else if (window.attachEvent) {
|
199 |
-
window.attachEvent("onmessage", pm._dispatch);
|
200 |
-
}
|
201 |
-
pm.data("listening.postmessage", 1);
|
202 |
-
}
|
203 |
-
},
|
204 |
-
|
205 |
-
_dispatch: function(e) {
|
206 |
-
//console.log("$.pm.dispatch", e, this);
|
207 |
-
try {
|
208 |
-
var msg = JSON.parse(e.data);
|
209 |
-
}
|
210 |
-
catch (ex) {
|
211 |
-
//console.warn("postmessage data invalid json: ", ex); //message wasn't meant for pm
|
212 |
-
return;
|
213 |
-
}
|
214 |
-
if (!msg.type) {
|
215 |
-
//console.warn("postmessage message type required"); //message wasn't meant for pm
|
216 |
-
return;
|
217 |
-
}
|
218 |
-
var cbs = pm.data("callbacks.postmessage") || {},
|
219 |
-
cb = cbs[msg.type];
|
220 |
-
if (cb) {
|
221 |
-
cb(msg.data);
|
222 |
-
}
|
223 |
-
else {
|
224 |
-
var l = pm.data("listeners.postmessage") || {};
|
225 |
-
var fns = l[msg.type] || [];
|
226 |
-
for (var i=0,len=fns.length; i<len; i++) {
|
227 |
-
var o = fns[i];
|
228 |
-
if (o.origin && o.origin !== '*' && e.origin !== o.origin) {
|
229 |
-
console.warn("postmessage message origin mismatch", e.origin, o.origin);
|
230 |
-
if (msg.errback) {
|
231 |
-
// notify post message errback
|
232 |
-
var error = {
|
233 |
-
message: "postmessage origin mismatch",
|
234 |
-
origin: [e.origin, o.origin]
|
235 |
-
};
|
236 |
-
pm.send({target:e.source, data:error, type:msg.errback});
|
237 |
-
}
|
238 |
-
continue;
|
239 |
-
}
|
240 |
-
|
241 |
-
function sendReply ( data ) {
|
242 |
-
if (msg.callback) {
|
243 |
-
pm.send({target:e.source, data:data, type:msg.callback});
|
244 |
-
}
|
245 |
-
}
|
246 |
-
|
247 |
-
try {
|
248 |
-
if ( o.callback ) {
|
249 |
-
o.fn(msg.data, sendReply, e);
|
250 |
-
} else {
|
251 |
-
sendReply ( o.fn(msg.data, e) );
|
252 |
-
}
|
253 |
-
}
|
254 |
-
catch (ex) {
|
255 |
-
if (msg.errback) {
|
256 |
-
// notify post message errback
|
257 |
-
pm.send({target:e.source, data:ex, type:msg.errback});
|
258 |
-
} else {
|
259 |
-
throw ex;
|
260 |
-
}
|
261 |
-
}
|
262 |
-
};
|
263 |
-
}
|
264 |
-
}
|
265 |
-
};
|
266 |
-
|
267 |
-
// location hash polling
|
268 |
-
pm.hash = {
|
269 |
-
|
270 |
-
send: function(options, msg) {
|
271 |
-
//console.log("hash.send", target_window, options, msg);
|
272 |
-
var target_window = options.target,
|
273 |
-
target_url = options.url;
|
274 |
-
if (!target_url) {
|
275 |
-
console.warn("postmessage target window url is required");
|
276 |
-
return;
|
277 |
-
}
|
278 |
-
target_url = pm.hash._url(target_url);
|
279 |
-
var source_window,
|
280 |
-
source_url = pm.hash._url(window.location.href);
|
281 |
-
if (window == target_window.parent) {
|
282 |
-
source_window = "parent";
|
283 |
-
}
|
284 |
-
else {
|
285 |
-
try {
|
286 |
-
for (var i=0,len=parent.frames.length; i<len; i++) {
|
287 |
-
var f = parent.frames[i];
|
288 |
-
if (f == window) {
|
289 |
-
source_window = i;
|
290 |
-
break;
|
291 |
-
}
|
292 |
-
};
|
293 |
-
}
|
294 |
-
catch(ex) {
|
295 |
-
// Opera: security error trying to access parent.frames x-origin
|
296 |
-
// juse use window.name
|
297 |
-
source_window = window.name;
|
298 |
-
}
|
299 |
-
}
|
300 |
-
if (source_window == null) {
|
301 |
-
console.warn("postmessage windows must be direct parent/child windows and the child must be available through the parent window.frames list");
|
302 |
-
return;
|
303 |
-
}
|
304 |
-
var hashmessage = {
|
305 |
-
"x-requested-with": "postmessage",
|
306 |
-
source: {
|
307 |
-
name: source_window,
|
308 |
-
url: source_url
|
309 |
-
},
|
310 |
-
postmessage: msg
|
311 |
-
};
|
312 |
-
var hash_id = "#x-postmessage-id=" + pm._random();
|
313 |
-
target_window.location = target_url + hash_id + encodeURIComponent(JSON.stringify(hashmessage));
|
314 |
-
},
|
315 |
-
|
316 |
-
_regex: /^\#x\-postmessage\-id\=(\w{32})/,
|
317 |
-
|
318 |
-
_regex_len: "#x-postmessage-id=".length + 32,
|
319 |
-
|
320 |
-
_bind: function() {
|
321 |
-
// are we already listening to message events on this w?
|
322 |
-
if (!pm.data("polling.postmessage")) {
|
323 |
-
setInterval(function() {
|
324 |
-
var hash = "" + window.location.hash,
|
325 |
-
m = pm.hash._regex.exec(hash);
|
326 |
-
if (m) {
|
327 |
-
var id = m[1];
|
328 |
-
if (pm.hash._last !== id) {
|
329 |
-
pm.hash._last = id;
|
330 |
-
pm.hash._dispatch(hash.substring(pm.hash._regex_len));
|
331 |
-
}
|
332 |
-
}
|
333 |
-
}, $.pm.poll || 200);
|
334 |
-
pm.data("polling.postmessage", 1);
|
335 |
-
}
|
336 |
-
},
|
337 |
-
|
338 |
-
_dispatch: function(hash) {
|
339 |
-
if (!hash) {
|
340 |
-
return;
|
341 |
-
}
|
342 |
-
try {
|
343 |
-
hash = JSON.parse(decodeURIComponent(hash));
|
344 |
-
if (!(hash['x-requested-with'] === 'postmessage' &&
|
345 |
-
hash.source && hash.source.name != null && hash.source.url && hash.postmessage)) {
|
346 |
-
// ignore since hash could've come from somewhere else
|
347 |
-
return;
|
348 |
-
}
|
349 |
-
}
|
350 |
-
catch (ex) {
|
351 |
-
// ignore since hash could've come from somewhere else
|
352 |
-
return;
|
353 |
-
}
|
354 |
-
var msg = hash.postmessage,
|
355 |
-
cbs = pm.data("callbacks.postmessage") || {},
|
356 |
-
cb = cbs[msg.type];
|
357 |
-
if (cb) {
|
358 |
-
cb(msg.data);
|
359 |
-
}
|
360 |
-
else {
|
361 |
-
var source_window;
|
362 |
-
if (hash.source.name === "parent") {
|
363 |
-
source_window = window.parent;
|
364 |
-
}
|
365 |
-
else {
|
366 |
-
source_window = window.frames[hash.source.name];
|
367 |
-
}
|
368 |
-
var l = pm.data("listeners.postmessage") || {};
|
369 |
-
var fns = l[msg.type] || [];
|
370 |
-
for (var i=0,len=fns.length; i<len; i++) {
|
371 |
-
var o = fns[i];
|
372 |
-
if (o.origin) {
|
373 |
-
var origin = /https?\:\/\/[^\/]*/.exec(hash.source.url)[0];
|
374 |
-
if (o.origin !== '*' && origin !== o.origin) {
|
375 |
-
console.warn("postmessage message origin mismatch", origin, o.origin);
|
376 |
-
if (msg.errback) {
|
377 |
-
// notify post message errback
|
378 |
-
var error = {
|
379 |
-
message: "postmessage origin mismatch",
|
380 |
-
origin: [origin, o.origin]
|
381 |
-
};
|
382 |
-
pm.send({target:source_window, data:error, type:msg.errback, hash:true, url:hash.source.url});
|
383 |
-
}
|
384 |
-
continue;
|
385 |
-
}
|
386 |
-
}
|
387 |
-
|
388 |
-
function sendReply ( data ) {
|
389 |
-
if (msg.callback) {
|
390 |
-
pm.send({target:source_window, data:data, type:msg.callback, hash:true, url:hash.source.url});
|
391 |
-
}
|
392 |
-
}
|
393 |
-
|
394 |
-
try {
|
395 |
-
if ( o.callback ) {
|
396 |
-
o.fn(msg.data, sendReply);
|
397 |
-
} else {
|
398 |
-
sendReply ( o.fn(msg.data) );
|
399 |
-
}
|
400 |
-
}
|
401 |
-
catch (ex) {
|
402 |
-
if (msg.errback) {
|
403 |
-
// notify post message errback
|
404 |
-
pm.send({target:source_window, data:ex, type:msg.errback, hash:true, url:hash.source.url});
|
405 |
-
} else {
|
406 |
-
throw ex;
|
407 |
-
}
|
408 |
-
}
|
409 |
-
};
|
410 |
-
}
|
411 |
-
},
|
412 |
-
|
413 |
-
_url: function(url) {
|
414 |
-
// url minus hash part
|
415 |
-
return (""+url).replace(/#.*$/, "");
|
416 |
-
}
|
417 |
-
|
418 |
-
};
|
419 |
-
|
420 |
-
$.extend(pm, {
|
421 |
-
defaults: {
|
422 |
-
target: null, /* target window (required) */
|
423 |
-
url: null, /* target window url (required if no window.postMessage or hash == true) */
|
424 |
-
type: null, /* message type (required) */
|
425 |
-
data: null, /* message data (required) */
|
426 |
-
success: null, /* success callback (optional) */
|
427 |
-
error: null, /* error callback (optional) */
|
428 |
-
origin: "*", /* postmessage origin (optional) */
|
429 |
-
hash: false /* use location hash for message passing (optional) */
|
430 |
-
}
|
431 |
-
});
|
432 |
-
|
433 |
-
})(this, typeof jQuery === "undefined" ? NO_JQUERY : jQuery);
|
434 |
-
|
435 |
-
/**
|
436 |
-
* http://www.JSON.org/json2.js
|
437 |
-
**/
|
438 |
-
if (! ("JSON" in window && window.JSON)){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/spin.js
CHANGED
@@ -1,349 +1,301 @@
|
|
1 |
-
//fgnass.github.com/spin.js#v1.
|
|
|
2 |
|
3 |
/**
|
4 |
-
* Copyright (c) 2011
|
5 |
* Licensed under the MIT license
|
6 |
*/
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
}
|
302 |
-
|
303 |
-
var margin = -(o.width+o.length)*2 + 'px'
|
304 |
-
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
305 |
-
, i
|
306 |
-
|
307 |
-
function seg(i, dx, filter) {
|
308 |
-
ins(g,
|
309 |
-
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
|
310 |
-
ins(css(vml('roundrect', {arcsize: o.corners}), {
|
311 |
-
width: r,
|
312 |
-
height: o.width,
|
313 |
-
left: o.radius,
|
314 |
-
top: -o.width>>1,
|
315 |
-
filter: filter
|
316 |
-
}),
|
317 |
-
vml('fill', {color: o.color, opacity: o.opacity}),
|
318 |
-
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
319 |
-
)
|
320 |
-
)
|
321 |
-
)
|
322 |
-
}
|
323 |
-
|
324 |
-
if (o.shadow)
|
325 |
-
for (i = 1; i <= o.lines; i++)
|
326 |
-
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
|
327 |
-
|
328 |
-
for (i = 1; i <= o.lines; i++) seg(i)
|
329 |
-
return ins(el, g)
|
330 |
-
}
|
331 |
-
|
332 |
-
Spinner.prototype.opacity = function(el, i, val, o) {
|
333 |
-
var c = el.firstChild
|
334 |
-
o = o.shadow && o.lines || 0
|
335 |
-
if (c && i+o < c.childNodes.length) {
|
336 |
-
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
|
337 |
-
if (c) c.opacity = val
|
338 |
-
}
|
339 |
-
}
|
340 |
-
}
|
341 |
-
|
342 |
-
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
|
343 |
-
|
344 |
-
if (!vendor(probe, 'transform') && probe.adj) initVML()
|
345 |
-
else useCssAnimations = vendor(probe, 'animation')
|
346 |
-
|
347 |
-
return Spinner
|
348 |
-
|
349 |
-
}));
|
1 |
+
//fgnass.github.com/spin.js#v1.2.4
|
2 |
+
(function(window, document, undefined) {
|
3 |
|
4 |
/**
|
5 |
+
* Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
|
6 |
* Licensed under the MIT license
|
7 |
*/
|
8 |
+
|
9 |
+
var prefixes = ['webkit', 'Moz', 'ms', 'O']; /* Vendor prefixes */
|
10 |
+
var animations = {}; /* Animation rules keyed by their name */
|
11 |
+
var useCssAnimations;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Utility function to create elements. If no tag name is given,
|
15 |
+
* a DIV is created. Optionally properties can be passed.
|
16 |
+
*/
|
17 |
+
function createEl(tag, prop) {
|
18 |
+
var el = document.createElement(tag || 'div');
|
19 |
+
var n;
|
20 |
+
|
21 |
+
for(n in prop) {
|
22 |
+
el[n] = prop[n];
|
23 |
+
}
|
24 |
+
return el;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Appends children and returns the parent.
|
29 |
+
*/
|
30 |
+
function ins(parent /* child1, child2, ...*/) {
|
31 |
+
for (var i=1, n=arguments.length; i<n; i++) {
|
32 |
+
parent.appendChild(arguments[i]);
|
33 |
+
}
|
34 |
+
return parent;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Insert a new stylesheet to hold the @keyframe or VML rules.
|
39 |
+
*/
|
40 |
+
var sheet = function() {
|
41 |
+
var el = createEl('style');
|
42 |
+
ins(document.getElementsByTagName('head')[0], el);
|
43 |
+
return el.sheet || el.styleSheet;
|
44 |
+
}();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Creates an opacity keyframe animation rule and returns its name.
|
48 |
+
* Since most mobile Webkits have timing issues with animation-delay,
|
49 |
+
* we create separate rules for each line/segment.
|
50 |
+
*/
|
51 |
+
function addAnimation(alpha, trail, i, lines) {
|
52 |
+
var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-');
|
53 |
+
var start = 0.01 + i/lines*100;
|
54 |
+
var z = Math.max(1-(1-alpha)/trail*(100-start) , alpha);
|
55 |
+
var prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase();
|
56 |
+
var pre = prefix && '-'+prefix+'-' || '';
|
57 |
+
|
58 |
+
if (!animations[name]) {
|
59 |
+
sheet.insertRule(
|
60 |
+
'@' + pre + 'keyframes ' + name + '{' +
|
61 |
+
'0%{opacity:'+z+'}' +
|
62 |
+
start + '%{opacity:'+ alpha + '}' +
|
63 |
+
(start+0.01) + '%{opacity:1}' +
|
64 |
+
(start+trail)%100 + '%{opacity:'+ alpha + '}' +
|
65 |
+
'100%{opacity:'+ z + '}' +
|
66 |
+
'}', 0);
|
67 |
+
animations[name] = 1;
|
68 |
+
}
|
69 |
+
return name;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Tries various vendor prefixes and returns the first supported property.
|
74 |
+
**/
|
75 |
+
function vendor(el, prop) {
|
76 |
+
var s = el.style;
|
77 |
+
var pp;
|
78 |
+
var i;
|
79 |
+
|
80 |
+
if(s[prop] !== undefined) return prop;
|
81 |
+
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
82 |
+
for(i=0; i<prefixes.length; i++) {
|
83 |
+
pp = prefixes[i]+prop;
|
84 |
+
if(s[pp] !== undefined) return pp;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Sets multiple style properties at once.
|
90 |
+
*/
|
91 |
+
function css(el, prop) {
|
92 |
+
for (var n in prop) {
|
93 |
+
el.style[vendor(el, n)||n] = prop[n];
|
94 |
+
}
|
95 |
+
return el;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Fills in default values.
|
100 |
+
*/
|
101 |
+
function merge(obj) {
|
102 |
+
for (var i=1; i < arguments.length; i++) {
|
103 |
+
var def = arguments[i];
|
104 |
+
for (var n in def) {
|
105 |
+
if (obj[n] === undefined) obj[n] = def[n];
|
106 |
+
}
|
107 |
+
}
|
108 |
+
return obj;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Returns the absolute page-offset of the given element.
|
113 |
+
*/
|
114 |
+
function pos(el) {
|
115 |
+
var o = {x:el.offsetLeft, y:el.offsetTop};
|
116 |
+
while((el = el.offsetParent)) {
|
117 |
+
o.x+=el.offsetLeft;
|
118 |
+
o.y+=el.offsetTop;
|
119 |
+
}
|
120 |
+
return o;
|
121 |
+
}
|
122 |
+
|
123 |
+
var defaults = {
|
124 |
+
lines: 12, // The number of lines to draw
|
125 |
+
length: 7, // The length of each line
|
126 |
+
width: 5, // The line thickness
|
127 |
+
radius: 10, // The radius of the inner circle
|
128 |
+
color: '#000', // #rgb or #rrggbb
|
129 |
+
speed: 1, // Rounds per second
|
130 |
+
trail: 100, // Afterglow percentage
|
131 |
+
opacity: 1/4, // Opacity of the lines
|
132 |
+
fps: 20, // Frames per second when using setTimeout()
|
133 |
+
zIndex: 2e9, // Use a high z-index by default
|
134 |
+
className: 'spinner', // CSS class to assign to the element
|
135 |
+
top: 'auto', // center vertically
|
136 |
+
left: 'auto' // center horizontally
|
137 |
+
};
|
138 |
+
|
139 |
+
/** The constructor */
|
140 |
+
var Spinner = function Spinner(o) {
|
141 |
+
if (!this.spin) return new Spinner(o);
|
142 |
+
this.opts = merge(o || {}, Spinner.defaults, defaults);
|
143 |
+
};
|
144 |
+
|
145 |
+
Spinner.defaults = {};
|
146 |
+
Spinner.prototype = {
|
147 |
+
spin: function(target) {
|
148 |
+
this.stop();
|
149 |
+
var self = this;
|
150 |
+
var o = self.opts;
|
151 |
+
var el = self.el = css(createEl(0, {className: o.className}), {position: 'relative', zIndex: o.zIndex});
|
152 |
+
var mid = o.radius+o.length+o.width;
|
153 |
+
var ep; // element position
|
154 |
+
var tp; // target position
|
155 |
+
|
156 |
+
if (target) {
|
157 |
+
target.insertBefore(el, target.firstChild||null);
|
158 |
+
tp = pos(target);
|
159 |
+
ep = pos(el);
|
160 |
+
css(el, {
|
161 |
+
left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : o.left+mid) + 'px',
|
162 |
+
top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : o.top+mid) + 'px'
|
163 |
+
});
|
164 |
+
}
|
165 |
+
|
166 |
+
el.setAttribute('aria-role', 'progressbar');
|
167 |
+
self.lines(el, self.opts);
|
168 |
+
|
169 |
+
if (!useCssAnimations) {
|
170 |
+
// No CSS animation support, use setTimeout() instead
|
171 |
+
var i = 0;
|
172 |
+
var fps = o.fps;
|
173 |
+
var f = fps/o.speed;
|
174 |
+
var ostep = (1-o.opacity)/(f*o.trail / 100);
|
175 |
+
var astep = f/o.lines;
|
176 |
+
|
177 |
+
!function anim() {
|
178 |
+
i++;
|
179 |
+
for (var s=o.lines; s; s--) {
|
180 |
+
var alpha = Math.max(1-(i+s*astep)%f * ostep, o.opacity);
|
181 |
+
self.opacity(el, o.lines-s, alpha, o);
|
182 |
+
}
|
183 |
+
self.timeout = self.el && setTimeout(anim, ~~(1000/fps));
|
184 |
+
}();
|
185 |
+
}
|
186 |
+
return self;
|
187 |
+
},
|
188 |
+
stop: function() {
|
189 |
+
var el = this.el;
|
190 |
+
if (el) {
|
191 |
+
clearTimeout(this.timeout);
|
192 |
+
if (el.parentNode) el.parentNode.removeChild(el);
|
193 |
+
this.el = undefined;
|
194 |
+
}
|
195 |
+
return this;
|
196 |
+
},
|
197 |
+
lines: function(el, o) {
|
198 |
+
var i = 0;
|
199 |
+
var seg;
|
200 |
+
|
201 |
+
function fill(color, shadow) {
|
202 |
+
return css(createEl(), {
|
203 |
+
position: 'absolute',
|
204 |
+
width: (o.length+o.width) + 'px',
|
205 |
+
height: o.width + 'px',
|
206 |
+
background: color,
|
207 |
+
boxShadow: shadow,
|
208 |
+
transformOrigin: 'left',
|
209 |
+
transform: 'rotate(' + ~~(360/o.lines*i) + 'deg) translate(' + o.radius+'px' +',0)',
|
210 |
+
borderRadius: (o.width>>1) + 'px'
|
211 |
+
});
|
212 |
+
}
|
213 |
+
for (; i < o.lines; i++) {
|
214 |
+
seg = css(createEl(), {
|
215 |
+
position: 'absolute',
|
216 |
+
top: 1+~(o.width/2) + 'px',
|
217 |
+
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
|
218 |
+
opacity: o.opacity,
|
219 |
+
animation: useCssAnimations && addAnimation(o.opacity, o.trail, i, o.lines) + ' ' + 1/o.speed + 's linear infinite'
|
220 |
+
});
|
221 |
+
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}));
|
222 |
+
ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)')));
|
223 |
+
}
|
224 |
+
return el;
|
225 |
+
},
|
226 |
+
opacity: function(el, i, val) {
|
227 |
+
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val;
|
228 |
+
}
|
229 |
+
};
|
230 |
+
|
231 |
+
/////////////////////////////////////////////////////////////////////////
|
232 |
+
// VML rendering for IE
|
233 |
+
/////////////////////////////////////////////////////////////////////////
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Check and init VML support
|
237 |
+
*/
|
238 |
+
!function() {
|
239 |
+
var s = css(createEl('group'), {behavior: 'url(#default#VML)'});
|
240 |
+
var i;
|
241 |
+
|
242 |
+
if (!vendor(s, 'transform') && s.adj) {
|
243 |
+
|
244 |
+
// VML support detected. Insert CSS rules ...
|
245 |
+
for (i=4; i--;) sheet.addRule(['group', 'roundrect', 'fill', 'stroke'][i], 'behavior:url(#default#VML)');
|
246 |
+
|
247 |
+
Spinner.prototype.lines = function(el, o) {
|
248 |
+
var r = o.length+o.width;
|
249 |
+
var s = 2*r;
|
250 |
+
|
251 |
+
function grp() {
|
252 |
+
return css(createEl('group', {coordsize: s +' '+s, coordorigin: -r +' '+-r}), {width: s, height: s});
|
253 |
+
}
|
254 |
+
|
255 |
+
var margin = -(o.width+o.length)*2+'px';
|
256 |
+
var g = css(grp(), {position: 'absolute', top: margin, left: margin});
|
257 |
+
|
258 |
+
var i;
|
259 |
+
|
260 |
+
function seg(i, dx, filter) {
|
261 |
+
ins(g,
|
262 |
+
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
|
263 |
+
ins(css(createEl('roundrect', {arcsize: 1}), {
|
264 |
+
width: r,
|
265 |
+
height: o.width,
|
266 |
+
left: o.radius,
|
267 |
+
top: -o.width>>1,
|
268 |
+
filter: filter
|
269 |
+
}),
|
270 |
+
createEl('fill', {color: o.color, opacity: o.opacity}),
|
271 |
+
createEl('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
272 |
+
)
|
273 |
+
)
|
274 |
+
);
|
275 |
+
}
|
276 |
+
|
277 |
+
if (o.shadow) {
|
278 |
+
for (i = 1; i <= o.lines; i++) {
|
279 |
+
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');
|
280 |
+
}
|
281 |
+
}
|
282 |
+
for (i = 1; i <= o.lines; i++) seg(i);
|
283 |
+
return ins(el, g);
|
284 |
+
};
|
285 |
+
Spinner.prototype.opacity = function(el, i, val, o) {
|
286 |
+
var c = el.firstChild;
|
287 |
+
o = o.shadow && o.lines || 0;
|
288 |
+
if (c && i+o < c.childNodes.length) {
|
289 |
+
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild;
|
290 |
+
if (c) c.opacity = val;
|
291 |
+
}
|
292 |
+
};
|
293 |
+
}
|
294 |
+
else {
|
295 |
+
useCssAnimations = vendor(s, 'animation');
|
296 |
+
}
|
297 |
+
}();
|
298 |
+
|
299 |
+
window.Spinner = Spinner;
|
300 |
+
|
301 |
+
})(window, document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/twitter-timeline.js
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
/* global twttr */
|
2 |
-
|
3 |
-
/* jshint ignore:start */
|
4 |
-
!function(d,s,id){
|
5 |
-
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
|
6 |
-
if(!d.getElementById(id)){
|
7 |
-
js=d.createElement(s);
|
8 |
-
js.id=id;js.src=p+"://platform.twitter.com/widgets.js";
|
9 |
-
fjs.parentNode.insertBefore(js,fjs);
|
10 |
-
}
|
11 |
-
}(document,"script","twitter-wjs");
|
12 |
-
/* jshint ignore:end */
|
13 |
-
|
14 |
-
jQuery( function() {
|
15 |
-
var hasSelectiveRefresh = (
|
16 |
-
'undefined' !== typeof wp &&
|
17 |
-
wp.customize &&
|
18 |
-
wp.customize.selectiveRefresh &&
|
19 |
-
wp.customize.widgetsPreview &&
|
20 |
-
wp.customize.widgetsPreview.WidgetPartial
|
21 |
-
);
|
22 |
-
if ( ! hasSelectiveRefresh ) {
|
23 |
-
return;
|
24 |
-
}
|
25 |
-
|
26 |
-
// Re-load Twitter widgets when a partial is rendered.
|
27 |
-
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
|
28 |
-
if ( placement.container ) {
|
29 |
-
twttr.widgets.load( placement.container[0] );
|
30 |
-
}
|
31 |
-
} );
|
32 |
-
|
33 |
-
// Refresh a moved partial containing a Twitter timeline iframe, since it has to be re-built.
|
34 |
-
wp.customize.selectiveRefresh.bind( 'partial-content-moved', function( placement ) {
|
35 |
-
if ( placement.container && placement.container.find( 'iframe.twitter-timeline:not([src]):first' ).length ) {
|
36 |
-
placement.partial.refresh();
|
37 |
-
}
|
38 |
-
} );
|
39 |
-
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changelog.txt
DELETED
@@ -1,1639 +0,0 @@
|
|
1 |
-
== Changelog ==
|
2 |
-
= 3.9.4 =
|
3 |
-
Release date: March 10th, 2016
|
4 |
-
|
5 |
-
Bug fix: Shortcodes: Addresses an issue with embedded Vimeo content
|
6 |
-
|
7 |
-
= 3.9.3 =
|
8 |
-
Release date: March 9th, 2016
|
9 |
-
Release post: http://wp.me/p1moTy-396
|
10 |
-
|
11 |
-
Featured:
|
12 |
-
|
13 |
-
* Site Logo now supports Custom Logo - a theme tool to be introduced in WordPress 4.5.
|
14 |
-
|
15 |
-
Enhancements:
|
16 |
-
|
17 |
-
* Carousel: Made the full size image URL use a Photon URL if enabled.
|
18 |
-
* Comments: Removed an unnecessary redirect by always connecting via HTTPS.
|
19 |
-
* General: Added new actions that fire before automatic updates.
|
20 |
-
* Infinite Scroll: Introduced a later filter for settings.
|
21 |
-
* Infinite Scroll: Removed code that is now redundant due to WordPress Core.
|
22 |
-
* Markdown: Removed deprecated markup from the output.
|
23 |
-
* Publicize: Improved handling of featured images in posts.
|
24 |
-
* Shortcodes: Added houzz.com support.
|
25 |
-
* Sitemaps: Added a language attribute to the news sitemap.
|
26 |
-
* Sitemaps: Improved the image retrieval mechanism for posts.
|
27 |
-
* Widgets: Added new filters in the Top Posts Widget code.
|
28 |
-
* Widgets: Cleaned up the CSS for the Subscription widget.
|
29 |
-
|
30 |
-
Bug Fixes:
|
31 |
-
|
32 |
-
* Comments: No longer reloading the page on clicking the reply button.
|
33 |
-
* Contact Forms: Fixed a fatal error on missing metadata.
|
34 |
-
* Contact Forms: Fixed message formatting for plaintext email clients.
|
35 |
-
* Shortcodes: Fixed dimensions of Vimeo embeds in certain cases.
|
36 |
-
* Shortcodes: Fixed warnings and allowed shorter style Vimeo embeds.
|
37 |
-
* Shortcodes: Removed alignment markup from feeds for YouTube embeds.
|
38 |
-
* Sitemaps: Made URLs display properly according to the permalink structure.
|
39 |
-
* Stats: Fixed non-XHTML-valid markup.
|
40 |
-
* Widgets: No longer showing errors when adding new instances of the Display Post Widget.
|
41 |
-
|
42 |
-
= 3.9.2 =
|
43 |
-
Release date: February 25th, 2016
|
44 |
-
Release post: http://wp.me/p1moTy-2Ei
|
45 |
-
|
46 |
-
Maintenance and Security Release
|
47 |
-
|
48 |
-
Featured:
|
49 |
-
|
50 |
-
* Beautiful Math: fix XSS vulnerability when parsing LaTeX markup within HTML elements.
|
51 |
-
* Contact Form: do not save private site credentials in post meta. Thanks to @visualdatasolutions.
|
52 |
-
|
53 |
-
Enhancements:
|
54 |
-
|
55 |
-
* Contact Info: Added two hooks for adding arbitrary information to the widget.
|
56 |
-
* Development: Added new possibilities for REST API debugging.
|
57 |
-
* Embeds: Added Codepen embeds support.
|
58 |
-
* Embeds: Added Sketchfab embeds support.
|
59 |
-
* I18n: Added support for translation packages for the Finnish language.
|
60 |
-
* Markdown: Added a filter to enable skipping processing of developer supplied patterns.
|
61 |
-
* Related Posts: Added a filter to change heading markup.
|
62 |
-
* Staging: Added a constant to force staging mode.
|
63 |
-
* Staging: Added a notice to make staging mode more obvious.
|
64 |
-
* Top Posts Widget: Added a new `[jetpack_top_posts_widget]` shortcode.
|
65 |
-
|
66 |
-
Bug Fixes:
|
67 |
-
|
68 |
-
* Custom Post Types: Nova: Fixed a JavaScript bug on adding multiple items.
|
69 |
-
* Embeds: Allowing embeds from Instagram with a www in an URL.
|
70 |
-
* General: Fixed untranslated module names on the Settings screen.
|
71 |
-
* General: Improved module descriptions and fixed misleading or broken links in descriptions.
|
72 |
-
* General: No more notices on module deprecation on older installations.
|
73 |
-
* General: Only showing one prompt to enable Photon when uploading several new images.
|
74 |
-
* Multisite: Fixed a problem with site lists for older WordPress installations.
|
75 |
-
* OpenGraph: Fixed a bug to properly fallback to a WordPress Site Icon image.
|
76 |
-
* Photon: Improve performance for images over a secure connection.
|
77 |
-
* Photon: No longer including links from data attributes.
|
78 |
-
* Publicize: Fixed problems for en_AU and en_CA locales with Facebook.
|
79 |
-
* Related Posts: Fixed a notice on certain requests.
|
80 |
-
* Site Logo: It's no longer possible to choose a non-image.
|
81 |
-
* Widget Visibility: No longer confusing page IDs and titles in certain cases.
|
82 |
-
|
83 |
-
= 3.9.1 =
|
84 |
-
Release date: January 21st, 2016
|
85 |
-
|
86 |
-
Bug Fixes:
|
87 |
-
|
88 |
-
* General: Addresses a namespacing issue which was causing conflicts on some hosting providers.
|
89 |
-
* Sitemaps: Added MSM-Sitemap to the list of plugins which, if installed, will prevent Jetpack Sitemaps from being used
|
90 |
-
|
91 |
-
= 3.9 =
|
92 |
-
Release date: January 20th, 2016
|
93 |
-
|
94 |
-
Featured:
|
95 |
-
|
96 |
-
* New sharing button: let users share your content using Skype.
|
97 |
-
* New "Social Menu" theme tool that uses Genericons to display Social Links.
|
98 |
-
* Sitemap support for better search engine indexing.
|
99 |
-
|
100 |
-
Enhancements:
|
101 |
-
|
102 |
-
* Contact Form: Added a new filter that allows you to change the "Required" text.
|
103 |
-
* General: Hidden archived sites in multisite site list.
|
104 |
-
* General: Removed several function calls that would be deprecated in WordPress 4.5.
|
105 |
-
* Infinite Scroll: Added a new filter to check if Infinite Scroll has been triggered.
|
106 |
-
* Likes: Added a conditional to ensure WordPress 4.5 compatibility.
|
107 |
-
* Photon: Improved compatibility with responsive images feature added in WordPress 4.4.
|
108 |
-
* Photon: Now enabled by default on sites using HTTPS.
|
109 |
-
* REST API: Extended the ability to manage users from WordPress.com.
|
110 |
-
* REST API: Increased the performance of the plugin update endpoint.
|
111 |
-
* Responsive Videos: Centering videos when they are wrapped in a centered paragraph.
|
112 |
-
* Sharing: Added a new filter to customize the default OpenGraph description.
|
113 |
-
* Shortcodes: Added Wistia oEmbed support.
|
114 |
-
* Shortcodes: Bandcamp: Added support for new attributes for tracks approved by artists.
|
115 |
-
* Shortcodes: Improved Medium path format recognition.
|
116 |
-
* Slideshow: Improved compatibility with older IE versions.
|
117 |
-
* Staging: Improved staging environment detection.
|
118 |
-
* Widgets: Added "width" option to the Facebook Page widget.
|
119 |
-
* Widgets: Added size parameters to tags in Top Posts to avoid warnings.
|
120 |
-
* Widgets: Introduced major performance and stability improvements to the Display Posts Widget.
|
121 |
-
* Widgets: Refactored to remove deprecated code patterns.
|
122 |
-
|
123 |
-
Bug Fixes:
|
124 |
-
|
125 |
-
* AtD: Fixed replacing emojis with images in the text editor in Chrome.
|
126 |
-
* AtD: Made pre tags be excluded from spell-checking.
|
127 |
-
* CPT: Not registering Nova if it is already registered.
|
128 |
-
* Carousel: Fixed a bug where full size images were not always served by Photon.
|
129 |
-
* Carousel: Reverted a change that broke direct link to carousel image.
|
130 |
-
* Contact Form: Fixed a CSV export bug with multiple choice questions.
|
131 |
-
* Contact Form: Fixed notices when creating feedback entries without a contact form.
|
132 |
-
* General: Fixed a scrolling bug on modal window closing.
|
133 |
-
* Infinite Scroll: Disabled in the Customizer when previewing a non-active theme.
|
134 |
-
* Publicize: Fixed notices appearing with bbPress or BuddyPress installed.
|
135 |
-
* Publicize: Showing options only to users that can change them.
|
136 |
-
* Related Posts: Fixed incorrect URLs generated for posts.
|
137 |
-
* Responsive Videos: Fixed warnings in debug mode.
|
138 |
-
* Shortcodes: Bandcamp: Fixed a problem with large track IDs.
|
139 |
-
* Shortcodes: Fixed a problem with dynamic Gist embeds.
|
140 |
-
* Stats: Fixed dashboard widget resize problem.
|
141 |
-
* Widgets: Added a fallback to English US when a locale isn't supported by Facebook.
|
142 |
-
* Widgets: Fixed layout for Twenty Sixteen.
|
143 |
-
|
144 |
-
= 3.8.2 =
|
145 |
-
Release date: December 17th, 2015
|
146 |
-
Release post: http://wp.me/p1moTy-26v
|
147 |
-
|
148 |
-
Jetpack 3.8.2 is here to squash a few annoying bugs.
|
149 |
-
|
150 |
-
Bug Fixes:
|
151 |
-
|
152 |
-
* Photon: Fixed a bug where some custom thumbnail image sizes weren't being sized properly.
|
153 |
-
* Shortcodes: Fixed an incompatibility with how WordPress renders the YouTube shortcode.
|
154 |
-
* Shortcodes: Tightened up security in the Wufoo shortcode.
|
155 |
-
* Image Widget: Now shows the caption.
|
156 |
-
* Fixed typos in inline docs.
|
157 |
-
* Very minor fixes to: Carousel, Publicize, Google+, and Infinite Scroll.
|
158 |
-
|
159 |
-
= 3.8.1 =
|
160 |
-
Release date: December 1st, 2015
|
161 |
-
Release post: http://wp.me/p1moTy-23V
|
162 |
-
|
163 |
-
Jetpack 3.8.1 is here and is fully compatible with WordPress 4.4.
|
164 |
-
|
165 |
-
Featured:
|
166 |
-
|
167 |
-
* Photon + Responsive Images FTW.
|
168 |
-
* Fully compatible with Twenty Sixteen.
|
169 |
-
* More accessibility enhancements.
|
170 |
-
* Dropped some weight by optimizing Jetpack's plugin images.
|
171 |
-
|
172 |
-
Enhancements:
|
173 |
-
|
174 |
-
* Comments: filter to allow disabling comments per post type.
|
175 |
-
|
176 |
-
Bug Fixes:
|
177 |
-
|
178 |
-
* Carousel: Stop page from scrolling to top when Carousel is closed.
|
179 |
-
* Carousel: Browser compatibility fixes with older version of IE.
|
180 |
-
* Markdown: Fixed a bug that would strip markdown when saving in "Quick Edit" mode.
|
181 |
-
* Single Sign On: Fixed login always redirecting to the admin dashboard.
|
182 |
-
* Subscriptions: Filter to allow per-post emails fixed for use in themes.
|
183 |
-
|
184 |
-
= 3.8.0 =
|
185 |
-
Release date: November 4th, 2015
|
186 |
-
Release post: http://wp.me/p1moTy-1VN
|
187 |
-
|
188 |
-
We're happy to introduce Jetpack 3.8, which has significant contributions from the Jetpack community. Read more about it here: http://wp.me/p1moTy-1VN
|
189 |
-
|
190 |
-
Feature enhancements:
|
191 |
-
|
192 |
-
* New Google+ Badge Widget. Display your profile, page, or community Google+ badge.
|
193 |
-
* New twitch.tv shortcode embeds. Display a Twitch.tv stream in your posts.
|
194 |
-
* Accessibility enhancements.
|
195 |
-
* A handful of new filters to allow further customization of Jetpack.
|
196 |
-
|
197 |
-
Other enhancements:
|
198 |
-
|
199 |
-
* Carousel: Added support to retrieve image dimensions from an image url.
|
200 |
-
* Carousel: Simpler algorithm to detect shutter speeds.
|
201 |
-
* Contact Form: New "Checkbox with Multiple Items" field available in the Contact Form.
|
202 |
-
* Contact Form: Allow pre-filling form fields with URL parameters.
|
203 |
-
* Contact Form: Better styling of the emailed form responses.
|
204 |
-
* Performance: Replaced some custom-built functions with core's native functions.
|
205 |
-
* Related Posts: New filter to add post classes to post's container class.
|
206 |
-
* Sharing: New filter to choose if sharing meta box should be shown.
|
207 |
-
* Sharing: New filter to allow sharing button markup to be editable.
|
208 |
-
* Sharing: New filter to allow you to specify a custom Facebook app ID.
|
209 |
-
* Social Media Icons Widget: Added option for YouTube username as well as Channel ID.
|
210 |
-
* Social Media Icons Widget: Added Google+ icon.
|
211 |
-
* Social Media Icons Widget: New filter to allow you to add your own social media icons and links.
|
212 |
-
* Subscriptions: Better errors to your visitors if their subscription sign-up fails.
|
213 |
-
* Subscriptions: Removed "widget" class from Subs shortcode form.
|
214 |
-
|
215 |
-
|
216 |
-
Bug fixes:
|
217 |
-
|
218 |
-
* Carousel: Fixed browser back/forward button behavior.
|
219 |
-
* Contact Form: Allow the email field to be set to empty when building form in post editor.
|
220 |
-
* Facebook Likebox Widget: Fixed an issue where some languages were not translating.
|
221 |
-
* Facebook Likebox Widget: Return a language when none found.
|
222 |
-
* General: Fixed some minor styling issues in the Jetpack admin areas.
|
223 |
-
* General: Add missing parameter to the_title filter call.
|
224 |
-
* General: Prevent scrolling of body when the Jetpack admin modals are opened.
|
225 |
-
* General: Update doc to reflect that Open Graph filter jetpack_enable_opengraph has been deprecated in favor of jetpack_enable_open_graph.
|
226 |
-
* Infinite Scroll: Fixed an error that sometimes occurred that would stop posts from loading.
|
227 |
-
* JSON API: Fixed some undefined notices when publishing a post with the API.
|
228 |
-
* Open Graph: Fixed bug where facebook description content was sometimes being polluted by a filter.
|
229 |
-
* Sharing: Use full SSL Pinterest url instead of protocol relative.
|
230 |
-
* Sharing: Fixed plus signs appearing in tweets shared from iOS.
|
231 |
-
* Shortcodes: Prefer HTTPS for video embeds to avoid mixed content warnings.
|
232 |
-
* Subscriptions Widget: Fix HTML Validation error.
|
233 |
-
* Theme Tools: Check oEmbeds for the presence of a video before adding the responsive videos filter.
|
234 |
-
* Tiled Galleries: Add image alt attribute if there is a title set. This was breaking some screen reader functionality.
|
235 |
-
|
236 |
-
= 3.7.2 =
|
237 |
-
Release date: September 29th, 2015
|
238 |
-
|
239 |
-
* Bug Fix: REST API: Fixed an error when saving drafts and publishing posts
|
240 |
-
|
241 |
-
= 3.7.1 =
|
242 |
-
Release date: September 28th, 2015
|
243 |
-
|
244 |
-
* Enhancement: General: Added inline documentation for various filters and functions
|
245 |
-
* Enhancement: General: Added custom capabilities for module management on multi-site installs
|
246 |
-
* Enhancement: General: Cleaned up old changelog entries from readme
|
247 |
-
* Enhancement: General: Cleaned up unused i18n textdomains
|
248 |
-
* Enhancement: General: Updated the new settings page to look better in various translations
|
249 |
-
* Enhancement: REST API: Added new endpoints to manage users
|
250 |
-
* Enhancement: Sharing: Updated the Google logo
|
251 |
-
* Bug Fix: Carousel: Page scroll no longer disappears after closing the carousel
|
252 |
-
* Bug Fix: Contact Form: Fields are sent and displayed in the correct order
|
253 |
-
* Bug Fix: Contact Form: No longer showing a notice on AJAX actions in feedback lists
|
254 |
-
* Bug Fix: Contact Form: Made using more than two notification emails possible
|
255 |
-
* Bug Fix: Contact Form: Mitigate a potential stored XSS vulnerability. Thanks to Marc-Alexandre Montpas (Sucuri)
|
256 |
-
* Bug Fix: General: Mitigate a potential information disclosure. Thanks to Jaime Delgado Horna
|
257 |
-
* Bug Fix: General: Fixed a locale error in the notifications popout
|
258 |
-
* Bug Fix: General: Fixed a possible fatal error in the client area
|
259 |
-
* Bug Fix: General: Fixed compatibility issues with certain use cases
|
260 |
-
* Bug Fix: General: Disabled connection warnings for multisites with domain mapping
|
261 |
-
* Bug Fix: General: Updated translations for correct link display in admin notices
|
262 |
-
* Bug Fix: REST API: Fixed a fatal error in one of the endpoints
|
263 |
-
* Bug Fix: Sharing: Fixed OpenGraph tags for Instagram embeds
|
264 |
-
* Bug Fix: Sharing: Fixed compatibility issues with bbPress
|
265 |
-
* Bug Fix: Widget Visibility: Fixed a fatal error in case of a missing tag
|
266 |
-
|
267 |
-
= 3.7.0 =
|
268 |
-
Release date: September 9th, 2015
|
269 |
-
|
270 |
-
Feature Enhancements:
|
271 |
-
|
272 |
-
* New admin page interface to easily configure Jetpack
|
273 |
-
* Added staging site support for testing a connected Jetpack site
|
274 |
-
|
275 |
-
Additional changes:
|
276 |
-
|
277 |
-
* Enhancement: CLI: Added a possibility to change all options with confirmation for some of them
|
278 |
-
* Enhancement: Gallery: Added filters to allow new gallery types to be declared
|
279 |
-
* Enhancement: General: Added inline documentation for actions, filters, etc.
|
280 |
-
* Enhancement: General: Changed class variable declarations keyword from var to public
|
281 |
-
* Enhancement: General: Made the Settings page module toggle buttons more accessible
|
282 |
-
* Enhancement: General: The admin bar now loads new notifications popout
|
283 |
-
* Enhancement: General: Renamed some modules to avoid redundant prefixes
|
284 |
-
* Enhancement: General: Switched to the WordPress Core's spinner image
|
285 |
-
* Enhancement: General: Updated the bot list
|
286 |
-
* Enhancement: Manage: Added the ability to activate a network-wide plugin on a single site from WordPress.com
|
287 |
-
* Enhancement: Photon: Added a way to check image URLs against custom domains
|
288 |
-
* Enhancement: Photon: Added prompts on the media upload page telling the user about Photon
|
289 |
-
* Enhancement: Publicize: Added width and height values to OpenGraph tags for default images
|
290 |
-
* Enhancement: Related Posts: Added a filter to allow disabling nofollow
|
291 |
-
* Enhancement: REST API: Added new API endpoints to extend API functionality
|
292 |
-
* Enhancement: REST API: Added new fields to existing API endpoints
|
293 |
-
* Enhancement: Sharing: Added a possibility to opt-out of sharing for a single post
|
294 |
-
* Enhancement: Sharing: Added bbPress support
|
295 |
-
* Enhancement: Sharing: Added more configuration to the Likes modal
|
296 |
-
* Enhancement: Sharing: Made the reddit button open a new tab
|
297 |
-
* Enhancement: Sharing: Removed unused files
|
298 |
-
* Enhancement: Shortcodes: Added auto embed option inside comments
|
299 |
-
* Enhancement: Shortcodes: Added autohide parameter to the YouTube shortcode
|
300 |
-
* Enhancement: Subscriptions: added an action that triggers at the end of the subscription process
|
301 |
-
* Enhancement: VideoPress: Videos are now embedded using a new player
|
302 |
-
* Enhancement: Widget Visibility: Added parent page logic
|
303 |
-
* Enhancement: Widget Visibility: Added support for split terms
|
304 |
-
* Enhancement: Widgets: Added actions to the Social Media widget
|
305 |
-
* Enhancement: Widgets: Switched the Display Posts widget to the new API version
|
306 |
-
* Bug Fix: General: Fixed scrolling to top after modal window closing
|
307 |
-
* Bug Fix: Infinite Scroll: Added a check for cases when output buffering is disabled
|
308 |
-
* Bug Fix: Infinite Scroll: Added translation to the copyright message
|
309 |
-
* Bug Fix: Manage: Fixed automatic update synchronization on WordPress multisite network admin
|
310 |
-
* Bug Fix: Manage: Redirects back to WordPress.com are allowed from the customizer view
|
311 |
-
* Bug Fix: Media: Fixed duplicate images bug in the Media Extractor
|
312 |
-
* Bug Fix: Publicize: Made it possible to remove previously set message
|
313 |
-
* Bug Fix: Sharing: Added a thumbnail image to OpenGraph tags on pages with DailyMotion embeds
|
314 |
-
* Bug Fix: Sharing: Fixed Twitter Cards tags escaping
|
315 |
-
* Bug Fix: Sharing: Made OpenGraph tags for title and description use proper punctuation
|
316 |
-
* Bug Fix: Sharing: Made sure Likes can be disabled on the front page
|
317 |
-
* Bug Fix: Shortcodes: Fixed Facebook embeds by placing the scipt in the footer
|
318 |
-
* Bug Fix: Shortcodes: Fixed PollDaddy shortcode issues over SSL connections
|
319 |
-
* Bug Fix: Shortcodes: Made responsive video wrappers only wrap video embeds
|
320 |
-
* Bug Fix: Shortcodes: Made SoundCloud accept percents for dimensions
|
321 |
-
* Bug Fix: Social Links: Fixed a possible conflict with another class
|
322 |
-
* Bug Fix: Stats: Made sure the Stats URL is always escaped properly
|
323 |
-
|
324 |
-
= 3.6.1 =
|
325 |
-
Release Date: July 24, 2015
|
326 |
-
|
327 |
-
* Enhancement: Fully compatible with upcoming WordPress 4.3
|
328 |
-
* Enhancement: Site Icon: Start to deprecate Site Icon in favor of Core's version (if available)
|
329 |
-
* Bug Fix: Subscriptions: You can now use more than one Subscription form on a single page
|
330 |
-
* Bug Fix: Quieted PHP notices and warnings with the JSON API, Display Posts Widget and Gallery Widget (slideshow mode)
|
331 |
-
* Bug Fix: Correct permissions check for connection panel
|
332 |
-
* Hardening: Increase permissions checks
|
333 |
-
|
334 |
-
= 3.6 =
|
335 |
-
Release Date: July 6th, 2015
|
336 |
-
Release Post: http://jetpack.com/2015/07/06/jetpack-3-6-updated-social-widgets-jetpack-cli-and-more/
|
337 |
-
|
338 |
-
Feature Enhancements:
|
339 |
-
|
340 |
-
* CLI: Add a number of Jetpack CLI improvements: see http://jetpack.com/support/jetpack-cli
|
341 |
-
* New Jetpack admin page for connection management
|
342 |
-
* New Social Media Icons widget
|
343 |
-
* FB Like Box: A visual refresh of the Facebook likebox widget
|
344 |
-
* Protect: When your IP is blocked, use a math captcha as a fallback instead of a complete block
|
345 |
-
|
346 |
-
Additional changes:
|
347 |
-
|
348 |
-
* Enhancement: Custom CSS: Add more Flexbox support and other enhancements
|
349 |
-
* Enhancement: Extra Sidebar Widgets: Top Posts Widget: Choose what Post Types to display
|
350 |
-
* Enhancement: General: Save on some requests! print CSS inline when there isn't much of it
|
351 |
-
* Enhancement: Likes: Likes can now be shown on all post types
|
352 |
-
* Enhancement: Minileven: Add Featured Image to Gallery Post Format and Pages
|
353 |
-
* Enhancement: Mobile Theme: Add div wrapping View Mobile Site link to allow for easier CSS customizations
|
354 |
-
* Enhancement: Omnisearch: Link to edit post in titles
|
355 |
-
* Enhancement: Protect: Learn Trusted Headers locally and cache blocks properly
|
356 |
-
* Enhancement: REST API: Add locale support
|
357 |
-
* Enhancement: Sharing: Retire StumbleUpon
|
358 |
-
* Enhancement: Sharing: Upgrade to reCAPTCHA 2.0 for Email Sharing
|
359 |
-
* Enhancement: Shortcode Embeds: Add Mesh oembed support
|
360 |
-
* Enhancement: Shortcode Embeds: New Wufoo Shortcode from WordPress.com
|
361 |
-
* Enhancement: Shortcode Embeds: Mixcloud: handle accented characters in URLs
|
362 |
-
* Enhancement: Site Logo: Adding itemprops to support logo schema.
|
363 |
-
* Enhancement: Slideshow Gallery: New parameters *size* and *autostart*
|
364 |
-
* Enhancement: Slideshow Gallery: Use more reliable CSS for resizing instead of js
|
365 |
-
* Enhancement: Stats: No longer track stats for preview pages
|
366 |
-
* Enhancement: Tiled Gallery: Improve the shapes and distributions of shapes in the Tiled Gallery, based on observations for its usage.
|
367 |
-
* Enhancement: Protect: Whitelist for multisite globally and locally
|
368 |
-
* Enhancement: Sharing: LinkedIn always uses https for share counts. (saved extra http request)
|
369 |
-
* Bug Fix: Carousel: Jetpack Carousel now supports HTML5 gallery
|
370 |
-
* Bug Fix: Extra Sidebar Widgets: Choose Images button works in accessibility mode
|
371 |
-
* Bug Fix: General: Fix: Cannot remove hooks from filter 'jetpack_get_available_modules'
|
372 |
-
* Bug Fix: Infinite Scroll: Check that search terms exist before matching against post title. fixes #2075
|
373 |
-
* Bug Fix: Likes: Never double show on search results
|
374 |
-
* Bug Fix: Notifications: Notifications didn't load on wp-admin/network pages
|
375 |
-
* Bug Fix: Sharing: Fix Facebook share button not showing for Australian & Canadian locale
|
376 |
-
* Bug Fix: Shortcode Embed: Slideshare Shortcode now fixed
|
377 |
-
* Bug Fix: SSO: Hide login no matter what when using the filter to do so
|
378 |
-
* Bug Fix: Subs Widget: Don't hide email input if submit failed
|
379 |
-
* Bug Fix: Tiled Gallery: Show columns setting for Thumbnail Grid when Tiled Mosaic galleries are the default
|
380 |
-
* Bug Fix: Twitter Cards: Remove deprecated card types
|
381 |
-
|
382 |
-
= 3.5.3 =
|
383 |
-
Release Date: May 6th, 2015
|
384 |
-
|
385 |
-
* Security Hardening: Remove Genericons example.html file.
|
386 |
-
|
387 |
-
= 3.5.2 =
|
388 |
-
Release Date: May 5th, 2015
|
389 |
-
|
390 |
-
* Bug Fix: Sharing: Changes Facebook share count endpoint
|
391 |
-
|
392 |
-
|
393 |
-
= 3.5.1 =
|
394 |
-
Release Date: May 5th, 2015
|
395 |
-
|
396 |
-
* Enhancement: Sharing: Changes Facebook share count method per Facebook API change
|
397 |
-
* Enhancement: General: Remove .po files to reduce plugin size
|
398 |
-
* Bug Fix: General: Remove identity crisis notification
|
399 |
-
* Bug Fix: Subscriptions: Correct required input validation
|
400 |
-
* Security hardening
|
401 |
-
|
402 |
-
= 3.5 =
|
403 |
-
Release Date: April 23rd, 2015
|
404 |
-
Release Post: http://jetpack.com/2016/04/23/jetpack-3-5-menu-management/
|
405 |
-
|
406 |
-
Jetpack 3.5 introduces the ability to manage your site's menus directly from WordPress.com and several bug fixes and enhancements. This upgrade is recommended for all users.
|
407 |
-
|
408 |
-
* Enhancement: General: Change security reporting to use a transient instead of option to reduce backup load
|
409 |
-
* Enhancement: General: Improve module search
|
410 |
-
* Enhancement: JSON API: Allow users to manage menus through WordPress.com
|
411 |
-
* Enhancement: Sharing: Reduce spam through email sharing
|
412 |
-
* Bug Fix: Custom CSS: Improve recall of CSS revisions
|
413 |
-
* Bug Fix: Extra Sidebar Widgets: Change class name for Contact Info widget
|
414 |
-
* Bug Fix: Extra Sidebar Widgets: Fix errors when adding widgets via the customizer
|
415 |
-
* Bug Fix: Extra Sidebar Widgets: Fix PHP notices in RSS widget
|
416 |
-
* Bug Fix: General: Fix redirect loop on activation
|
417 |
-
* Bug Fix: General: Styling fixes
|
418 |
-
* Bug Fix: Protect: Add IP translation fallback when inet_pton is not available
|
419 |
-
* Bug Fix: Protect: Always allow login from local IDs
|
420 |
-
* Bug Fix: Protect: Sanitize displayed IP after block
|
421 |
-
* Bug Fix: Publicize: Prevent generating Facebook profile links for app-scoped user IDs
|
422 |
-
* Bug Fix: Subscriptions: Improve error handling
|
423 |
-
* Bug Fix: Theme Tools: Include breadcrumb code
|
424 |
-
* Misc: Extra Sidebar Widgets: Remove Readmill Widget
|
425 |
-
|
426 |
-
= 3.4.3 =
|
427 |
-
Release Date: April 20th, 2015
|
428 |
-
|
429 |
-
* Security hardening.
|
430 |
-
|
431 |
-
= 3.4.2 =
|
432 |
-
Release Date: April 19th, 2015
|
433 |
-
|
434 |
-
* Bug Fix: Contact info widget namespacing
|
435 |
-
* Bug Fix: Javascript errors on wp-admin due to stats display code
|
436 |
-
* Bug Fix: Potential fatal error from improperly called function
|
437 |
-
* Bug Fix: Potential fatal error when protect servers are unreachable for WordPress Multisite
|
438 |
-
|
439 |
-
= 3.4.1 =
|
440 |
-
Release Date: March 19th, 2015
|
441 |
-
|
442 |
-
* Bug Fix: General: Modules not displaying properly in non-English installs
|
443 |
-
* Bug Fix: Manage: Some installs showing a transient fatal error
|
444 |
-
* Bug Fix: Protect: Protect module not auto-activating for users who upgrade
|
445 |
-
* Bug Fix: Omnisearch: Some installs not properly reporting WP version number, causing Omnisearch error
|
446 |
-
* Bug Fix: Stats: Top posts/pages widget not loading
|
447 |
-
* Bug Fix: Contact Info Widget: Fix conflict with Avada theme
|
448 |
-
|
449 |
-
= 3.4 =
|
450 |
-
Release Date: March 18th, 2015
|
451 |
-
|
452 |
-
Release Post: http://jetpack.com/2015/03/17/jetpack-3-4-protect-secure-and-simplify/
|
453 |
-
|
454 |
-
* Enhancement : Config Settings: provide a notification for users that update features settings
|
455 |
-
* Enhancement : Config Settings: provide a notification for users that update features settings
|
456 |
-
* Enhancement : Contact Form: Use the predefined $title variable in the anchor tag in grunion contact form button
|
457 |
-
* Enhancement : Contact Form: Use the predefined $title variable in the anchor tag in the button on admin
|
458 |
-
* Enhancement : Custom Content Type: Add all Custom Post Types to Omnisearch
|
459 |
-
* Enhancement : Custom Content Type: Add option to add Testimonial Custom Content Type in admin
|
460 |
-
* Enhancement : Custom Content Type: bring consistency between the portfolio and testimonial shared codebase
|
461 |
-
* Enhancement : Custom Content Type: code cleanup
|
462 |
-
* Enhancement : Custom Content Type: register namespaced 'jetpack_portfolio' shortcode/use a prefix for shortcode for Portfolio
|
463 |
-
* Enhancement : Custom Content Type: set shortcode image size to 'large' and add jetpack_portfolio_thumbnail_size filter to allow themes to set their own size for Portfolio
|
464 |
-
* Enhancement : Custom Content Type: testimonial shortcode enhancement
|
465 |
-
* Enhancement : Extra Sidebar Widgets: Add subscription widget wildcard
|
466 |
-
* Enhancement : Extra Sidebar Widgets: Likes and Sharing Shortcodes
|
467 |
-
* Enhancement : Extra Sidebar Widgets: Minor fixes to Facebook widget plugin for SSL
|
468 |
-
* Enhancement : Fix/update jetpack version
|
469 |
-
* Enhancement : General: Add DNS Prefetching
|
470 |
-
* Enhancement : General: Add Jetpack admin dashboard widget
|
471 |
-
* Enhancement : GlotPress: Update GP_Locales and GP_Locale classes
|
472 |
-
* Enhancement : Improved control over Nova Theme Menu output markup
|
473 |
-
* Enhancement : Infinite Scroll: Adds a `button` wrapper for the infinity handle.
|
474 |
-
* Enhancement : Infinite Scroll: Check for response.html before using indexOf
|
475 |
-
* Enhancement : Integrate BruteProtect for protection against Brute Force attacks
|
476 |
-
* Enhancement : JSON API Manage: Added Mock Jetpack Option to Sync options that don't have to live in the Database
|
477 |
-
* Enhancement : JSON API: Add/empty trash days option to sync
|
478 |
-
* Enhancement : Jump Start: Add "Jump Start" interface for new users
|
479 |
-
* Enhancement : Manage: Add "modified_before" and "modified_after" parameters to /sites/%s/posts/ via JSON API
|
480 |
-
* Enhancement : Mobile Theme: Add filter for choosing mobile theme menu
|
481 |
-
* Enhancement : Notifications: Changes to load the new notifications client.
|
482 |
-
* Enhancement : Protect: Add a filter so that user can add thier own bots
|
483 |
-
* Enhancement : Protect: Add security reporting
|
484 |
-
* Enhancement : Protect: Add/whitelist endpoints via JSON API for Jetpack Protect
|
485 |
-
* Enhancement : Publicize: update connection confirmation message
|
486 |
-
* Enhancement : Sharing: Add custom service name as a class
|
487 |
-
* Enhancement : Sharing: display name of custom service in link title
|
488 |
-
* Enhancement : Sharing: Remove default post types for showing share links
|
489 |
-
* Enhancement : Sharing: use Jetpack version number when enqueing sharing.js
|
490 |
-
* Enhancement : Shortcodes Team Partnerships: Backport fixes from SoundCloud 2.3.1 through 3.0.2
|
491 |
-
* Enhancement : Shortlinks: use HTTPS when possible
|
492 |
-
* Enhancement : Stats: Make loading of stats async
|
493 |
-
* Enhancement : Subscriptions: Added settings field for comment sub text
|
494 |
-
* Enhancement : Subscriptions: Hide Form After Submit
|
495 |
-
* Enhancement : Subscriptions: remove label from widget title
|
496 |
-
* Enhancement : Subscriptions: Update subscriptions.php
|
497 |
-
* Bug Fix : Contact form: Increase CSS specificity for Contact Forms in widgets
|
498 |
-
* Bug Fix : Custom Content Type: Testimonial Custom Content Type: use core `WP_Customize_Image_Control` instead of custom...
|
499 |
-
* Bug Fix : Extra Sidebar Widgets: add missing & to if statement for widget visibility
|
500 |
-
* Bug Fix : Extra Sidebar Widgets: Don't require height/width values in the Twitter Timeline widget
|
501 |
-
* Bug Fix : Extra Sidebar Widgets: Upload images from the customizer/Extra Sidebar Widgets Tiled Galleries for Gallery Widget
|
502 |
-
* Bug Fix : General: Fix bug that was preventing modules from displaying properly
|
503 |
-
* Bug Fix : Manage: When calling /sites/%s/posts/ include all attachments not just the first five via JSON API
|
504 |
-
* Bug Fix : Mobile Theme: Minileven; Start after DOM ready
|
505 |
-
* Bug Fix : Sharing: Open sharing in same window
|
506 |
-
* Bug Fix : Stats language
|
507 |
-
* Bug Fix : Subscritpions: fix invalid field when no email address
|
508 |
-
|
509 |
-
|
510 |
-
= 3.3.2 =
|
511 |
-
Release Date: February 19th, 2015
|
512 |
-
|
513 |
-
* Enhancement: Updated translation files.
|
514 |
-
* Enhancement: Heartbeat: Correctly stat new datasets.
|
515 |
-
* Bug Fix: Widget Visibility: Correct some caching of visibility results that may get evaluated too soon.
|
516 |
-
* Bug Fix: Contact Form: Hardening.
|
517 |
-
* Bug Fix: Photon: Make sure our gallery filter can parse array inputs as well as the default html.
|
518 |
-
|
519 |
-
= 3.3.1 =
|
520 |
-
Release Date: February 11th, 2015
|
521 |
-
|
522 |
-
* Bug Fix: JSON API: Minor versioning data.
|
523 |
-
* Bug Fix: Markdown: Re-run KSES after processing to account for syntax changes.
|
524 |
-
* Bug Fix: Media Extractor: Don't call a gallery a gallery if it hasn't got any pictures!
|
525 |
-
* Bug Fix: Module Management: Handle a core api change for folks running trunk.
|
526 |
-
* Bug Fix: Related Posts: CSS -- better clear rows.
|
527 |
-
* Bug Fix: Sharing: Including sharing account on Pinterest unofficial buttons as well.
|
528 |
-
* Bug Fix: Sharing: Properly version external assets by Jetpack release version.
|
529 |
-
* Bug Fix: Shortcodes: Soundcloud: Backport API compatibility fixes.
|
530 |
-
* Bug Fix: Shortcodes: Flickr: Tidy up our regex url pattern matching.
|
531 |
-
* Bug Fix: Subscriptions: Don't add 'Email Address' as the value -- we have placeholders!
|
532 |
-
* Bug Fix: Widgets: Gallery Widget: Allow folks to upload images from the widget area in the customizer.
|
533 |
-
|
534 |
-
= 3.3 =
|
535 |
-
Release Date: December 15th, 2014
|
536 |
-
Release Post: http://jetpack.com/2014/12/16/jetpack-3-3-a-single-home-for-all-your-wordpress-sites/
|
537 |
-
|
538 |
-
* Enhancement: Adds responsive video support to BuddyPress.
|
539 |
-
* Enhancement: Custom Content Types: Added 'order' and 'orderby' options to portfolio shortcode.
|
540 |
-
* Enhancement: Display notice when Jetpack Development Mode is on.
|
541 |
-
* Enhancement: General: Update compatibility with Twenty Fifteen.
|
542 |
-
* Enhancement: Image URL can now be overwritten with the `jetpack_images_fit_image_url_override` filter after dimensions are set by Photon.
|
543 |
-
* Enhancement: JSON API: Add Endpoint for trigger Plugin Autoupdates.
|
544 |
-
* Enhancement: JSON API: General Improvements. Documentation on http://developer.wordpress.com/
|
545 |
-
* Enhancement: Likes: Updated the code to accept arbitrary CPTs.
|
546 |
-
* Enhancement: Related Posts: Allow filter by `post_format`.
|
547 |
-
* Enhancement: Sharing: add new `jetpack_sharing_counts` filter for option to turn off sharing counts.
|
548 |
-
* Enhancement: Sharing: Use the Site Logo Theme Tool and the Site Icon as fallbacks for image tags.
|
549 |
-
* Enhancement: Shortcodes: Made the code more readable by using output buffers instead of string concatenation.
|
550 |
-
* Enhancement: Site Logo: Add alias functions to provide backward compatibility for themes expecting the old function calls.
|
551 |
-
* Enhancement: Slideshow: Add title and alt text to images.
|
552 |
-
* Enhancement: Subscription Form: Do not display the logged in user's email address by default.
|
553 |
-
* Enhancement: Top Posts Widget: Refactor to allow conditional loading of the css.
|
554 |
-
* Enhancement: Top Posts: Add `jetpack_top_posts_widget_count` filter to control number of displayed posts.
|
555 |
-
* Bug Fix: Change subscribe_text from `p` to `div` so that it can contain block-level elements.
|
556 |
-
* Bug Fix: Fonts: Change path to look for the svg in the right directory.
|
557 |
-
* Bug Fix: Increase CSS specificity for Contact Forms in widgets.
|
558 |
-
* Bug Fix: JSON API: Plugins Update: Make sure the plugin doesn't get deactivated.
|
559 |
-
* Bug Fix: Likes: Fixes issues where likes don't load, load master iframe after scripts are loaded.
|
560 |
-
* Bug Fix: Notes Module: Avoid a PHP Notice in cli scripts when the request doesn't contain a User-Agent header.
|
561 |
-
* Bug Fix: Nova Menu CPT: fix notice when we have no taxonomies.
|
562 |
-
* Bug Fix: Nova Menus: Use current instance to maintain object context.
|
563 |
-
* Bug Fix: Related Posts: Add filter for `_enabled_for_request()`.
|
564 |
-
* Bug Fix: Sharing: Prevent duplicate @ in shared Tweets.
|
565 |
-
* Bug Fix: Site Logo: `get_site_logo()` now properly returns the site logo ID when provided in the `$show` argument.
|
566 |
-
* Bug Fix: Site Logo: Correct evaluation of the Display Header Text in Customizer preview.
|
567 |
-
|
568 |
-
= 3.2.1 =
|
569 |
-
Release Date: November 14th, 2014
|
570 |
-
|
571 |
-
* Enhancement: Updated translation files.
|
572 |
-
* Enhancement: JSON API: More object vars passed back to some queries. Documentation on http://developer.wordpress.com/
|
573 |
-
* Bug Fix: JSON API: Pass back correct author in `me/posts` data.
|
574 |
-
* Bug Fix: JSON API: Don't check if a post is freshly pressed on remote Jetpack sites where the function doesn't exist.
|
575 |
-
* Bug Fix: Site Logo: Add backward-compatible template tags to match the standalone release.
|
576 |
-
* Bug Fix: Don't use __DIR__ -- it's 5.3+ only, and WordPress supports back to 5.2.
|
577 |
-
* Bug Fix: Retool how we remove the source styles when using the concatenated version.
|
578 |
-
* Bug Fix: Shortcodes: TED: Correct default language code from `eng` to `en`.
|
579 |
-
* Bug Fix: Gallery Widget: Add a default background color.
|
580 |
-
* Bug Fix: Subscription Notifications: Remove the label.
|
581 |
-
* Bug Fix: Sharing: enqueue Genericons on static front page as well if selected.
|
582 |
-
|
583 |
-
= 3.2 =
|
584 |
-
Release Date: October 29, 2014
|
585 |
-
Release Post: http://jetpack.com/2014/11/03/jetpack-3-2/
|
586 |
-
|
587 |
-
* Enhancement: Speed Improvements (woohoo!).
|
588 |
-
* Enhancement: Add site icons: an avatar for your blog.
|
589 |
-
* Enhancement: Improvements to API endpoints.
|
590 |
-
* Enhancement: Add oEmbed sources (Twitter, SoundCloud, Instagram, DailyMotion, Vine).
|
591 |
-
* Enhancement: Add indicators to make it easier to see which modules are active.
|
592 |
-
* Enhancement: Improve debug tool.
|
593 |
-
* Enhancement: Add new 'Site Logos' code to theme tools, for themes that opt in to support it.
|
594 |
-
* Enhancement: Improved caching for related posts.
|
595 |
-
* Enhancement: Added "Remember Me" functionality to Single Sign On.
|
596 |
-
* Enhancement: Improved accessibility.
|
597 |
-
* Enhancement: Added additional filters to Widget Visibility.
|
598 |
-
* Bug Fix: Fixed PHP Notice errors for Likes, Widget Visibility.
|
599 |
-
* Bug Fix: Improvements to the testimonials CPT.
|
600 |
-
* Bug Fix: Improved RTL on VideoPress admin.
|
601 |
-
* Bug Fix: Removed Google+ Authorship module (discontinued by Google).
|
602 |
-
* Bug Fix: Fixed use of deprecated function in mobile theme.
|
603 |
-
* Bug Fix: Various fixes to Tiled Galleries.
|
604 |
-
* Bug Fix: Various fixes to Contact Form.
|
605 |
-
* Bug Fix: Various fixes to oEmbed.
|
606 |
-
* Bug Fix: Various fixes to Single Sign On.
|
607 |
-
* Bug Fix: Fixed styles in ShareDaddy.
|
608 |
-
* Bug Fix: Better match protocols (http/https) to the site.
|
609 |
-
|
610 |
-
|
611 |
-
= 3.1.1 =
|
612 |
-
Release Date: August 7, 2014
|
613 |
-
|
614 |
-
* Enhancement: Update translation files for strings that had been submitted/approved since release.
|
615 |
-
* Bug Fix: Social Links: Add a function check to better degrade if Publicize isn't around.
|
616 |
-
* Bug Fix: Open Graph: Add WordPress SEO back to the blacklist, until they update how they opt us out.
|
617 |
-
* Bug Fix: Asset Minification: Add another caveat ( empty $plugin ) to short out on.
|
618 |
-
* Bug Fix: Deprecated Hooks: Fixing our expectations where something that should be an array occasionally wasn't.
|
619 |
-
* Bug Fix: Custom CSS: Add extra whitelist rule for -o-keyframe rules.
|
620 |
-
|
621 |
-
= 3.1 =
|
622 |
-
Release Date: July 31, 2014
|
623 |
-
Release Post: http://jetpack.com/2014/07/31/jetpack-3-1-portfolio-custom-post-types-a-new-logo-and-much-more/
|
624 |
-
|
625 |
-
* Enhancement: New Custom Content Types module.
|
626 |
-
* Enhancement: New Jetpack Logo.
|
627 |
-
* Enhancement: New optional JSON API endpoints for viewing updates and managing plugins and themes.
|
628 |
-
* Enhancement: New Custom Post Type: Portfolio!
|
629 |
-
* Enhancement: Rearranged buttons on the modules modals for easier management.
|
630 |
-
* Enhancement: Jetpack Settings have improved keyboard accessibility.
|
631 |
-
* Enhancement: Improved RTL support for After the Deadline, Carousel, Contact Form, Comics CPT, Custom CSS, Omnisearch, Publicize, Related Posts, Slideshow short code, Tiled Gallery, Widget-Visibility and Widgets Gallery.
|
632 |
-
* Enhancement: Contact Form: Add an "Empty Spam" option.
|
633 |
-
* Enhancement: i18n: Change the priority of where plugin_textdomain is hooked so that the plugins can better translate Jetpack.
|
634 |
-
* Enhancement: Monitor: Displays how often the site is checked for downtime.
|
635 |
-
* Enhancement: Shortcode: Added Mixcloud shortcode and oEmbed support.
|
636 |
-
* Enhancement: Social Links: Improved handling of customizer hooks in non-admin context.
|
637 |
-
* Enhancement: Stats: The smiley image is gone by default.
|
638 |
-
* Enhancement: Stats: Added link to the configure page for stats so that the stats settings page is easier to find.
|
639 |
-
* Enhancement: Theme Tools: Added the responsive videos to theme tools so that themes can support responsive videos more easily.
|
640 |
-
* Update: Updated Genericons to version 3.1, new icons for website, ellipsis, foursquare, x-post, sitemap, hierarchy and paintbrush.
|
641 |
-
* Bug Fix: Contact Form: Prefix function to avoid conflicts with other plugins.
|
642 |
-
* Bug Fix: Custom CSS: Admin UI has a responsive layout.
|
643 |
-
* Bug Fix: Custom CSS: Custom $content_width value doesn't overwrite theme's $content_width.
|
644 |
-
* Bug Fix: Contact Form: Feedback link takes you to the form page.
|
645 |
-
* Bug Fix: Carousel: Confirms an avatar is returned by get_avatar before displaying.
|
646 |
-
* Bug Fix: Featured Content: Don't remove setting validation.
|
647 |
-
* Bug Fix: Infinite Scroll: Google Universal Analytics support added.
|
648 |
-
* Bug Fix: Multisite: Add message when updating multisite settings.
|
649 |
-
* Bug Fix: Photon: Photon will no longer upscale images larger than the original size.
|
650 |
-
* Bug Fix: Photon: Check that the image exists before rewriting the image URL to utilize Photon.
|
651 |
-
* Bug Fix: Sharing: Pinterest adds attribute to display share count.
|
652 |
-
* Bug Fix: Sharing: Respect an empty sharing title.
|
653 |
-
* Bug Fix: Sharing: Share buttons now appear in the bbPress forms.
|
654 |
-
* Bug Fix: Sharing: Support for multiple meta html tag og:image values.
|
655 |
-
* Bug Fix: Single Sign On: Logout allows override of forcing Single Sign On.
|
656 |
-
* Bug Fix: Single Sign On: Remove the lost password link on auto-forward logout.
|
657 |
-
* Bug Fix: Social Links: Do not use anonymous function for compatibility with PHP 5.2.
|
658 |
-
* Bug Fix: Tiled Galleries: Update jQuery mouseover caption effect to reduce flickering.
|
659 |
-
* Bug Fix: Widgets Visibility: Works better in the customizer admin view.
|
660 |
-
|
661 |
-
= 3.0.2 =
|
662 |
-
Release Date: June 17, 2014
|
663 |
-
|
664 |
-
* Enhancement: General: Make module categories filter more visible when active.
|
665 |
-
* Enhancement: General: Updated translation files with more strings added since the last release.
|
666 |
-
* Enhancement: General: Allow deep-linking to the Contact Support form.
|
667 |
-
* Bug Fix: General: RTL Jetpack Admin UI looks better.
|
668 |
-
* Bug Fix: General: Fixed PHP warning when bulk deactivating modules.
|
669 |
-
* Bug Fix: General: Removed an unnecessary description.
|
670 |
-
* Bug Fix: General: Resolved an SSL error on Jetpack Admin UI.
|
671 |
-
* Bug Fix: General: Fix error comparing signatures when the WordPress installation is using site_url filters (applied mostly to WPEngine sites).
|
672 |
-
* Bug Fix: General: Resolved PHP strict error on the mobile menu.
|
673 |
-
* Bug Fix: General: Fix timing of conditional checks, so that calling developer mode via a plugin works again.
|
674 |
-
* Bug Fix: General: Main page categories tab now properly translates module names.
|
675 |
-
* Bug Fix: Related Posts: Fix a typo, the "more info" link now works.
|
676 |
-
* Bug Fix: Likes: Improve button styling.
|
677 |
-
* Bug Fix: Likes: Remove unused UI for Reblog settings on social settings page.
|
678 |
-
* Bug Fix: Contact Form: Updated to no longer use a deprecated Akismet function.
|
679 |
-
* Bug Fix: Contact Form: Sends email to the administrator that is not marked as spam again.
|
680 |
-
* Bug Fix: Open Graph: Resolved PHP warning on open graph gallery pages when the gallery is empty.
|
681 |
-
|
682 |
-
= 3.0.1 =
|
683 |
-
Release Date: May 22, 2014
|
684 |
-
|
685 |
-
* Bug Fix: AtD: A wpcom-only function got synced by mistake and caused a few errors. Fixed.
|
686 |
-
* Bug Fix: Post By Email: Add static keyword to a function.
|
687 |
-
* Bug Fix: ShareDaddy: In the admin-side configuration of sharing links, we used a Path icon instead of Pinterest. Oops!
|
688 |
-
* Bug Fix: ShareDaddy: We inadvertently appended `via @jetpack` to some twitter shares. This is no longer the case.
|
689 |
-
* Bug Fix: Related Posts: Tidying up and relocation of the `resync` button formerly on the more info modal.
|
690 |
-
* Bug Fix: Infinite Scroll: Work better with core's MediaElement.js
|
691 |
-
* Bug Fix: Heartbeat: Undeclared variable fixed.
|
692 |
-
|
693 |
-
= 3.0 =
|
694 |
-
Release Date: May 20, 2014
|
695 |
-
Release Post: http://jetpack.com/2014/05/20/jetpack-3-0/
|
696 |
-
|
697 |
-
* New User Interface for managing modules and settings
|
698 |
-
* New Module: Verfication Tools
|
699 |
-
* Enhancement: New look for the Sharing module
|
700 |
-
* Enhancement: Multiple improvements on which Twitter handle a Twitter card will display
|
701 |
-
* Enhancement: Add option to hide Google+ Authorship banner while still receiving the benefits
|
702 |
-
* Enhancement: Many Infinite Scroll enhancements to improve performance
|
703 |
-
* Enhancement: Infinite Scroll will use your CPT's display name instead of "Older Posts"
|
704 |
-
* Enhancement: JSON API added /media/new endpoint
|
705 |
-
* Enhancement: Added filter to assign new default image for Open Graph tags
|
706 |
-
* Enhancement: New [jetpack-related-posts] shortcode to add Related Posts to page instead of default placement
|
707 |
-
* Enhancement: Added SSO option to turn off login form completely, to use WordPress.com login exclusively
|
708 |
-
* Enhancement: The [googlemaps] shortcode allows for Google Maps Engine
|
709 |
-
* Enhancement: YouTube shortcode allows HD playback
|
710 |
-
* Enhancement: Smoother, Faster Tiled Galleries!
|
711 |
-
* Enhancement: New languages! Use Jetpack in Irish, Fulah, and Tigrinya
|
712 |
-
* Bug Fix: Use your browser's Back and Forward buttons when naviagating a Carousel
|
713 |
-
* Bug Fix: Various Related Posts fixes and improvements for added flexibility
|
714 |
-
* Bug Fix: WordPress 3.9: Restores ability to edit Contact Forms
|
715 |
-
* Bug Fix: WordPress 3.9: Restores Gallery Widget compatability
|
716 |
-
* Bug Fix: Ensure Markdown is kept when Bulk Editing posts
|
717 |
-
* Bug Fix: Improved Jetpack's Multisite Network Admin page for networks with a large number of sites
|
718 |
-
* Bug Fix: Ensure Sharing settings persist when Bulk Editing a post
|
719 |
-
* Bug Fix: Various other shortcode improvements
|
720 |
-
|
721 |
-
= 2.9.3 =
|
722 |
-
Release Date: April 10, 2014
|
723 |
-
|
724 |
-
* Important security update. CVE-2014-0173
|
725 |
-
|
726 |
-
= 2.9.2 =
|
727 |
-
Release Date: March 17, 2014
|
728 |
-
|
729 |
-
* Bug Fix: Publicize: When publishing from a mobile app or third-party client, Publicize now works again.
|
730 |
-
|
731 |
-
= 2.9.1 =
|
732 |
-
Release Date: March 6, 2014
|
733 |
-
|
734 |
-
* Bug Fix: After the Deadline: Fix a Javascript glitch that could prevent publishing of posts.
|
735 |
-
* Bug Fix: SSO: Disable the implementation of an option that had been removed before release. This would have only been an issue if a site administrator had enabled the module during an early beta of 2.9.
|
736 |
-
|
737 |
-
= 2.9 =
|
738 |
-
Release Date: February 26, 2014
|
739 |
-
Release Post: http://jetpack.com/2014/02/26/jetpack-2-9/
|
740 |
-
|
741 |
-
* Added Multisite network functionality
|
742 |
-
* New Module: Related Posts
|
743 |
-
* Enhancement: Single Sign On
|
744 |
-
* Enhancement: Mixcloud shortcode and oEmbed
|
745 |
-
* Enhancement: Gist shortcode and oEmbed
|
746 |
-
* Enhancement: Modify Facebook Like Box widget to support new Facebook parameters
|
747 |
-
* Enhancement: Rolled the Push Notifications module into the Notes module
|
748 |
-
* Enhancement: Update kses with Markdown
|
749 |
-
* Enhancement: Adding keyboard accessibility to sharing buttons config page
|
750 |
-
* Enhancement: Pull WordPress testing bits from the new official git mirror at WordPress.org
|
751 |
-
* Bug Fix: Widget Visibility
|
752 |
-
* Bug Fix: Revisions box in Custom CSS
|
753 |
-
* Bug Fix: Fix several bugs in the WordPress Posts Widget so that it correctly updates
|
754 |
-
* Bug Fix: Limit Login Attempts no longer generates false positives from xmlrpc.
|
755 |
-
* Bug Fix: Clear max_posts transient on theme switch.
|
756 |
-
* Bug Fix: Lower priority of sync to allow all CPTs to be registered.
|
757 |
-
* Bug Fix: Contact form fields emailed in correct order.
|
758 |
-
|
759 |
-
* Other bugfixes and enhancements at https://github.com/Automattic/jetpack/commits/2.9
|
760 |
-
|
761 |
-
= 2.8 =
|
762 |
-
Release Date: January 31, 2014
|
763 |
-
Release Post: http://jetpack.com/2014/01/31/jetpack-2-8-introducing-markdown-and-improving-monitor/
|
764 |
-
|
765 |
-
* New Module: Markdown
|
766 |
-
* Module Update: Jetpack Monitor
|
767 |
-
* Enhancement: Infinite Scroll: Keep track of $current_day between requests so the_date() works well.
|
768 |
-
* Enhancement: Embeds: New filter to turn off embeds in comments.
|
769 |
-
* Enhancement: Contact Form: Add placeholder support.
|
770 |
-
* Enhancement: Widget: Gravatar Profile: Added filters to allow users to customize headings and fixed output of personal links.
|
771 |
-
* Enhancement: Facebook OG Tags: Add `published_time`, `modified_time`, and `author` if the post type supports it.
|
772 |
-
* Enhancement: Sharing: Display buttons on CPT archive pages.
|
773 |
-
* Enhancement: Sharing: Add `get_share_title` function and filter.
|
774 |
-
* Enhancement: Sharing: Add filter `sharing_display_link`.
|
775 |
-
* Enhancement: Twitter Timeline: Flesh out tweet limit option.
|
776 |
-
* Enhancement: Social Links: Add Google+ to the list of supported services.
|
777 |
-
* Enhancement: Stats: Improve dashboard styles in 3.8.
|
778 |
-
* Enhancement: Stats: No longer use Quantcast.
|
779 |
-
* Enhancement: Top Posts: Add `jetpack_top_posts_days` filter.
|
780 |
-
* Enhancement: AtD: Add TinyMCE 4 compatibility for its pending arrival in WordPress 3.9
|
781 |
-
* Enhancement: Genericons: Update to v3.0.3
|
782 |
-
* Enhancement: Tiled Galleries: Add alt attributes to images.
|
783 |
-
* Enhancement: Shortcode: YouTube: Accept protocol-relative URLs.
|
784 |
-
* Enhancement: Shortcode: Slideshow: Add white background option.
|
785 |
-
* Enhancement: Shortcode: YouTube: Add support for the two closed-caption arguments.
|
786 |
-
* Enhancement: Shortcode: Vimeo: Update the regex to support the new embed code.
|
787 |
-
* Enhancement: Shortcode: Google Maps: Update the regex to handle new format for embeds.
|
788 |
-
* Enhancement: Likes: Avoid a PHP Notice when $_POST['post_type'] is not set in meta_box_save.
|
789 |
-
* Enhancement: Smush images to save on file size.
|
790 |
-
* Enhancement: Publicize: Enable opt-in publicizing of custom post types.
|
791 |
-
* Bug Fix: Random Redirect: Further namespace to avoid conflicts.
|
792 |
-
* Bug Fix: Twitter Timeline: Resolve undefined index notice.
|
793 |
-
* Bug Fix: Featured Content: Add extra class_exists() check to be extra careful.
|
794 |
-
* Bug Fix: Facebook OG Tags: Change OG type of Home and Front Page to 'website'
|
795 |
-
* Bug Fix: Widget Visibility: Add support for old-style single use widgets.
|
796 |
-
* Bug Fix: Google Authorship: Support apostrophe in author names.
|
797 |
-
* Bug Fix: Media Extractor: Assorted graceful failure caveats.
|
798 |
-
* Bug Fix: Carousel: 'Link to None' bug fixed.
|
799 |
-
* Bug Fix: Embeds: Bandcamp: Switch escaping function for album and track IDs to handle (int)s greater than PHP_INT_MAX
|
800 |
-
* Bug Fix: Some plugins trying to catch brute-force attacks mistakenly flagged the Jetpack connection as one.
|
801 |
-
|
802 |
-
= 2.7 =
|
803 |
-
Release Date: December 11, 2013
|
804 |
-
Release Post: http://jetpack.com/2013/12/11/jetpack-2-7-publicize/
|
805 |
-
|
806 |
-
* Enhancement: Google+ Publicize
|
807 |
-
* Enhancement: Add Cloudup as an oEmbed provider
|
808 |
-
* Enhancement: Subscriptions: Add subscribe_field_id filter to allow updated ids when using multiple widgets
|
809 |
-
* Enhancement: Infinite Scroll: TwentyFourteen Support
|
810 |
-
* Bug Fix: Contact Form: Fix warning when form is called outside the loop
|
811 |
-
* Bug Fix: Featured Content: Moving Settings to Customizer, provide option to set default tag as fallback, specify all supported post-types rather than just additional ones. Description Updates
|
812 |
-
* Bug Fix: Featured Content: Compat with 'additional_post_types' theme support argument. Comment updates
|
813 |
-
* Bug Fix: Featured Content: Make sure $term is an object before we treat it as one
|
814 |
-
* Bug Fix: GlotPress: Merge with latest GlotPress
|
815 |
-
* Bug Fix: Infinite Scroll: prevent Undefined index notice that can cause IS to fail when user has WP_DEBUG set to true
|
816 |
-
* Bug Fix: Infinite Scroll: Improved compatibility with Carousel, Tiled Galleries, VideoPress, and the `[audio]` and `[video]` shortcodes
|
817 |
-
* Bug Fix: Likes: Stop manually including version.php and trust the global. Some whitespace fixes, and if it's an attachment, follow the post_status of the parent post
|
818 |
-
* Bug Fix: Mobile Theme: Display password field for Gallery format protected posts
|
819 |
-
* Bug Fix: Sharing: Add new translation width for share button, and Google Plus icons
|
820 |
-
* Bug Fix: Shortcodes: Support Ineternational Google domains for maps
|
821 |
-
* Bug Fix: Shortcodes: Facebook Embeds: Register alternate permalink.php URL for posts
|
822 |
-
* Bug Fix: Subscriptions: Moved inline styles from widget email input to separate css file
|
823 |
-
* Bug Fix: Theme Tools: Fix glitch where random-redirect.php also showed as a plugin being deleted if you were deleting Jetpack
|
824 |
-
* Bug Fix: Misc: Internationalization & RTL updates
|
825 |
-
* Bug Fix: Misc: Prevent collisions with 'Facebook Featured Image & OG Meta Tags' plugin
|
826 |
-
|
827 |
-
= 2.6.1 =
|
828 |
-
Release Date: December 3, 2013
|
829 |
-
|
830 |
-
* Bug Fix: minor styling fix in pre- and post-MP6/3.8 UI changes.
|
831 |
-
* Bug Fix: Stats: spinner gif url fix when the user is viewing it over https.
|
832 |
-
* Bug Fix: Stats: Switch to esc_html from htmlspecialchars in error message -- better to be native
|
833 |
-
* Bug Fix: Media Extractor: some hosts don't compile unicode for preg_match_all, so we temporarily removed the block that depended on it.
|
834 |
-
* Bug Fix: Media Extractor: Add in some error handling for malformed URLs.
|
835 |
-
* Bug Fix: Twitter Cards: treat single-image galleries as a photo-type.
|
836 |
-
* Bug Fix: Update conflicting plugins for OG tags and Twitter Cards.
|
837 |
-
* Bug Fix: Correct max supported version number -- had been 3.6, update to 3.7.1
|
838 |
-
|
839 |
-
= 2.6 =
|
840 |
-
Release Date: November 28, 2013
|
841 |
-
Release Post: http://jetpack.com/2013/11/26/new-release-jetpack-2-6/
|
842 |
-
|
843 |
-
* Enhancement: WPCC / now called [SSO](http://jetpack.com/support/sso/): refactored.
|
844 |
-
* Enhancement: Monitor: new module which will notify you if your site goes down(http://jetpack.com/support/monitor/).
|
845 |
-
* Enhancement: Custom CSS: replace Ace editor with Codemirror.
|
846 |
-
* Enhancement: Widgets: new “Display Posts” widget.
|
847 |
-
* Enhancement: WP-CLI: add commands to disconnect a site and manage modules.
|
848 |
-
* Enhancement: Contact Form: new filters, `grunion_contact_form_field_html` and `grunion_should_send_email`.
|
849 |
-
* Enhancement: Custom Post Types: new restaurant post type.
|
850 |
-
* Enhancement: Genericons: update to version 3.0.2.
|
851 |
-
* Enhancement: Infinite Scroll: many improvements and fixes.
|
852 |
-
* Enhancement: Likes: performance improvements.
|
853 |
-
* Enhancement: MP6: Jetpack icons are now compatible with WordPress 3.8.
|
854 |
-
* Enhancement: Open Graph: better descriptions, fallback images, and media extraction from video posts.
|
855 |
-
* Enhancement: Publicize: new background token tests for connected publicize services and display problems on settings sharing and add new post.
|
856 |
-
* Enhancement: Shortcodes: updated Bandcamp shortcode to support the `tracklist` and `minimal` attributes, as well as more `artwork` attribute values.
|
857 |
-
* Enhancement: Shortlinks: add Custom Post Type support.
|
858 |
-
* Enhancement: Subscriptions: add more ways to customize the subscriptions widget.
|
859 |
-
* Enhancement: Twitter Cards: better media management and card type detection, and better handling of conflicts with other Twitter Cards plugins.
|
860 |
-
* Enhancement: better handling of conflicts with other plugins.
|
861 |
-
* Bug Fix: After the Deadline: add a typeof check for `tinyMCEPreInit.mceInit` to prevent js errors.
|
862 |
-
* Bug Fix: Carousel: speed improvements and several bugfixes.
|
863 |
-
* Bug Fix: Contact Form: remove nonce creating issues with caching plugins.
|
864 |
-
* Bug Fix: Custom Post Types: Testimonials: return if featured image is empty so it can be removed after it’s been set.
|
865 |
-
* Bug Fix: Featured Content: add additional post type support through the `additional_post_types` argument.
|
866 |
-
* Bug Fix: Google Authorship: support apostrophes in Google+ profiles.
|
867 |
-
* Bug Fix: Google Authorship: use a regexp Instead of using `mb_convert_encoding`, which doesn’t enjoy universal support.
|
868 |
-
* Bug Fix: Heartbeat: ensure that it never triggers more than once per week.
|
869 |
-
* Bug Fix: JSON API: add new `?meta=` parameter that allows you to expand the data found in the `meta->links` responses.
|
870 |
-
* Bug Fix: JSON API: add new `is_private` response to the sites endpoint and `global_ID` response to the reader and post endpoints.
|
871 |
-
* Bug Fix: Mobile Theme: allow small images to display inline.
|
872 |
-
* Bug Fix: Mobile Theme: fix fatal errors for missing `minileven_header` function.
|
873 |
-
* Bug Fix: Photon: fix errors when an image is not uploaded properly.
|
874 |
-
* Bug Fix: Shortcodes: improvements to Archives, Google+, Presentations, Vine and Youtube.
|
875 |
-
* Bug Fix: Tiled Galleries: improve display of panoramic images and fix errors when an image is not uploaded properly.
|
876 |
-
|
877 |
-
= 2.5 =
|
878 |
-
Release Date: September 19, 2013
|
879 |
-
Release Post: http://jetpack.com/2013/09/19/jetpack-2-5/
|
880 |
-
|
881 |
-
* Enhancement: Connect your Google+ profile and WordPress site to prove authorship of posts.
|
882 |
-
* Enhancement: Improved sharing buttons display.
|
883 |
-
* Enhancement: Comment on your posts using Google+ to signin.
|
884 |
-
* Enhancement: Embed Google+ posts into your posts.
|
885 |
-
* Enhancement: Added event logging capabilities for debugging
|
886 |
-
* Enhancement: LaTeX is now available in dev mode
|
887 |
-
* Enhancement: Introduced gallery widget
|
888 |
-
* Enhancement: Added new module: VideoPress
|
889 |
-
* Enhancement: Updated identity crisis checker
|
890 |
-
* Enhancement: Tiled Gallery widget added
|
891 |
-
* Enhancement: Google +1 button changed to Google+ Share button, to avoid confusion
|
892 |
-
* Enhancement: Added check to ensure Google+ authorship accounts have disconnected properly
|
893 |
-
* Enhancement: Updated identity crisis checker
|
894 |
-
* Enhancement: Tiled Gallery widget added
|
895 |
-
* Enhancement: Google +1 button changed to Google+ Share button, to avoid confusion
|
896 |
-
* Enhancement: Added the ability to embed Facebook posts
|
897 |
-
* Bug Fix: Redirect issue with G+ authorship when WordPress is not in the root directory
|
898 |
-
* Enhancement: Better security if carousel to prevent self-XSS
|
899 |
-
* Enhancement: Better handling of cookies for subsites on multisite installs
|
900 |
-
* Bug Fix: Check for post in G+ authorship before accessing it
|
901 |
-
|
902 |
-
= 2.4.2 =
|
903 |
-
Release Date: September 5, 2013
|
904 |
-
|
905 |
-
* Enhancement: Converted to module headers to detect Auto-Activating modules.
|
906 |
-
* Enhancement: WPCC: Added 'Close' link to deactivate WPCC in the admin nag.
|
907 |
-
* Enhancement: JSON API: Add User Nicename to the user data.
|
908 |
-
* Bug Fix: Contact Form: Stopped using a short tag.
|
909 |
-
* Bug Fix: Changed CSS selector to catch MP6 stylings.
|
910 |
-
* Bug Fix: Dropped __FILE__ references in class.jetpack.php in favor of JETPACK__PLUGIN_DIR constant, now code that deactivates the plugin from the connect nag works again.
|
911 |
-
* Bug Fix: Random Redirect: Add random-redirect to the plugins overriden list, in case someone is using Matt's Random Redirect plugin.
|
912 |
-
* Bug Fix: Tiled Gallery: Revert r757178 relating to tiled gallery defaults.
|
913 |
-
* Bug Fix: Return false, not zero, if $GLOBALS['content_width'] isn't defined.
|
914 |
-
* Bug Fix: WPCC: Don't call wp_login_url() in the constructor -- if someone is running a custom login page, that can break things if their plugin runs get_permalink as a filter before init.
|
915 |
-
* Bug Fix: Tiled Gallery: Add fallback if post_parent == 0 due to infinite_scroll_load_other_plugins_scripts.
|
916 |
-
* Bug Fix: Custom CSS: Set the ACE gutter z-index to 1.
|
917 |
-
* Bug Fix: Custom Post Types: Switch from wp_redirect() to wp_safe_redirect().
|
918 |
-
* Bug Fix: Likes: Set overflow:hidden; on the likes adminbar item.
|
919 |
-
* Bug Fix: Mobile Theme: Migrate where/when the custom header stuff is included.
|
920 |
-
* Bug Fix: Slideshow Shortcode: Add a height of 410px.
|
921 |
-
|
922 |
-
= 2.4.1 =
|
923 |
-
Release Date: September 4, 2013
|
924 |
-
|
925 |
-
* Enhancement: Don't auto-activate WPCC.
|
926 |
-
|
927 |
-
= 2.4 =
|
928 |
-
Release Date: August 30, 2013
|
929 |
-
Release Post: http://jetpack.com/2013/09/04/jetpack-2-4-widget-visibility-and-wpcc-and-more/
|
930 |
-
|
931 |
-
* Enhancement: WordPress.com Connect (WPCC): New Module.
|
932 |
-
* Enhancement: Widget Visibility: New Module.
|
933 |
-
* Enhancement: Shortcode: Addition of new Twitter Timeline shortcode.
|
934 |
-
* Enhancement: Shortcode: Addition of new Presentation shortcode.
|
935 |
-
* Enhancement: Shortcode: Addition of new Vine shortcode.
|
936 |
-
* Enhancement: Custom Post Types: CPTs are available.
|
937 |
-
* Enhancement: Subscriptions: Add 'jetpack_is_post_mailable' filter.
|
938 |
-
* Enhancement: OpenGraph: Add Twitter Cards meta tags as well.
|
939 |
-
* Enhancement: Custom CSS: Update lessc and scssc preprocessors to 0.4.0 and 0.0.7 respectively.
|
940 |
-
* Enhancement: Omnisearch: Add Media results.
|
941 |
-
* Enhancement: Likes: Use a protocol-agnostic iframe, instead of forced HTTPS.
|
942 |
-
* Enhancement: Top Posts: Increase post limit.
|
943 |
-
* Enhancement: Publicize: Updated JS and UI.
|
944 |
-
* Enhancement: Photon: New filter to let site admins/owners enable photon for HTTPS urls.
|
945 |
-
* Enhancement: New jetpack_get_available_modules filter.
|
946 |
-
* Enhancement: Subscriptions: Antispam measures.
|
947 |
-
* Bug Fix: Add inline style to keep plugins/themes from inadvertently hiding the Connect box.
|
948 |
-
* Bug Fix: Custom CSS: Respect the new wp_revisions_to_keep filter.
|
949 |
-
* Bug Fix: Photon: Only hook jetpack_photon_url into the filter if the user has Photon active.
|
950 |
-
* Bug Fix: Heartbeat: Used wrong object, occasinally fatal-erroring out for the cron.
|
951 |
-
* Bug Fix: Add an empty debug.php file to the /modules/ folder, to solve some update issues where it never got deleted.
|
952 |
-
|
953 |
-
= 2.3.5 =
|
954 |
-
Release Date: August 12, 2013
|
955 |
-
|
956 |
-
* Enhancement: Added Path support to Publicize.
|
957 |
-
|
958 |
-
= 2.3.4 =
|
959 |
-
Release Date: August 6, 2013
|
960 |
-
|
961 |
-
* Bug Fix: Correct when output occurs with CSV export for feedback.
|
962 |
-
* Bug Fix: Tidy up the Heartbeat API.
|
963 |
-
* Enhancement: User Agent: Improve detecting of bots.
|
964 |
-
* Enhancement: Genericons: Make sure we're pulling the freshest version from genericons.com on each release.
|
965 |
-
* Enhancement: JSON API: Open up replies/new endpoints so that users can comment on blogs that are not in their access token.
|
966 |
-
* Enhancement: Photon: Apply to `get_post_gallery()` function as well.
|
967 |
-
* Enhancement: Tiled Galleries: Add a default bottom margin to be more robust out of the box.
|
968 |
-
* Translations: Adding in fresher translation files.
|
969 |
-
* Deprecation: Removing the retinization code for 3.4, as it was included in WordPress trunk from 3.5 onwards.
|
970 |
-
|
971 |
-
= 2.3.3 =
|
972 |
-
Release Date: July 26, 2013
|
973 |
-
|
974 |
-
* Bug Fix: We were inadvertently overwriting cron schedules with our Jetpack heartbeat. This should now be fixed.
|
975 |
-
* Enhancement: New Facebook Sharing icons.
|
976 |
-
* Enhancement: Minor update to the Minileven stylesheet.
|
977 |
-
|
978 |
-
= 2.3.2 =
|
979 |
-
Release Date: July 25, 2013
|
980 |
-
|
981 |
-
* Bug Fix: Fixed an issue where Facebook Pages were not available when connecting a Publicize account.
|
982 |
-
* Bug Fix: For some web hosts, fixed an issue where 'Jetpack ID' error would occur consistently on connecting to WordPress.com.
|
983 |
-
* Enhancement: Adding some new stats and heartbeat checking to Jetpack.
|
984 |
-
|
985 |
-
= 2.3.1 =
|
986 |
-
Release Date: July 2, 2013
|
987 |
-
|
988 |
-
* Enhancement: Social Links: Retooling the class for better consistency and performance behind the scenes.
|
989 |
-
* Enhancement: Omnisearch: Make it easier to search Custom Post Types. No longer need to extend the class, if all you want is a basic display. Just call `new Jetpack_Omnisearch_Posts( 'cpt' );`
|
990 |
-
* Enhancement: Sharing Buttons: LinkedIn: Use the official button's sharing link on the Jetpack implementation for a more consistent sharing experience and produce better results on LinkedIn's end.
|
991 |
-
* Enhancement: Debug / Connection: Better logic in determining whether the server can use SSL to connect to WPCOM servers.
|
992 |
-
* Enhancement: Sharing: Twitter: Calculate the size of the Tweet based on the short URL rather than the full URL size.
|
993 |
-
* Enhancement: Debug: More readable and understandable messages.
|
994 |
-
* Enhancement: Likes: Including some MP6 styles.
|
995 |
-
* Enhancement: Comments: Add new core classes to comment form. See http://core.trac.wordpress.org/changeset/24525
|
996 |
-
* Bug Fix: Omnisearch: Don't load everything initially, run the providers off admin_init, and then issue an action for folks to hook into.
|
997 |
-
* Bug Fix: Omnisearch: Modify some child class functions to match the parent's parameters and avoid strict notices in newer versions of PHP.
|
998 |
-
* Bug Fix: Omnisearch: Hide the search form in the module description if the current user can't use it.
|
999 |
-
* Bug Fix: Comment Form: Use edit_pages, not edit_page (fixes glitch in previous beta, never publicly released).
|
1000 |
-
* Bug Fix: Twitter Timeline Widget: Additional testing of values and casting to default if they are nonconforming.
|
1001 |
-
* Bug Fix: Sharing: Pinterest: Make the button wider if there's a count to avoid overlapping with others.
|
1002 |
-
* Bug Fix: Post By Email: Change configuration_redirect to static.
|
1003 |
-
* Bug Fix: Likes: Don't call configuration_redirect as a static, do it as a method.
|
1004 |
-
* Bug Fix: Add some further security measures to module activation.
|
1005 |
-
|
1006 |
-
= 2.3 =
|
1007 |
-
Release Date: June 19, 2013
|
1008 |
-
Release Post: http://jetpack.com/2013/06/19/jetpack-2-3/
|
1009 |
-
|
1010 |
-
* Enhancement: Omnisearch: Search once, get results from everything! Omnisearch is a single search box that lets you search many different things
|
1011 |
-
* Enhancement: Debugger: this module helps you debug connection issues right from your dashboard, and contact the Jetpack support team if needed
|
1012 |
-
* Enhancement: Social Links: this module is a canonical source, based on Publicize, that themes can use to let users specify where social icons should link to
|
1013 |
-
* Enhancement: It’s now easier to find out if a module is active or note, thanks to the new Jetpack::is_module_active()
|
1014 |
-
* Enhancement: Contact Form: You are now able to customize the submit button text thanks to the submit_button_text parameter
|
1015 |
-
* Enhancement: Comments: We've added a filter to let users customize the Comment Reply label, and users can now also customize the prompt on the comment form again.
|
1016 |
-
* Enhancement: Mobile Theme: Add genericons.css and registering it so it’s easily accessible to other modules that may want it
|
1017 |
-
* Enhancement: Tiled Galleries: You can now customize the captions, thanks to the jetpack_slideshow_slide_caption filter
|
1018 |
-
* Enhancement: Widgets: Twitter Timeline: Add the noscrollbar option
|
1019 |
-
* Enhancement: Widgets: Facebook Like Box Widget: add a show_border attribute
|
1020 |
-
* Enhancement: Widgets: FB Like Box: let Jetpack users override the iframe background color set in an inline style attribute by using the jetpack_fb_likebox_bg filter
|
1021 |
-
* Bug Fix: Carousel: Fix a bug where double-clicking a gallery thumbnail broke the carousel functionality
|
1022 |
-
* Bug Fix: Comments: Change “must-log-in” to class from ID
|
1023 |
-
* Bug Fix: Contact Form: Make the Add Contact Form link a button, ala Add Media in core
|
1024 |
-
* Bug Fix: Contact Form: Fix encoding of field labels
|
1025 |
-
* Bug Fix: Contact Form: Remove references to missing images
|
1026 |
-
* Bug Fix: Fix 2 XSS vulnerabilities
|
1027 |
-
* Bug Fix: JSON API: Minor fixes for bbPress compatibility
|
1028 |
-
* Bug Fix: JSON API: Fix metadata bugs
|
1029 |
-
* Bug Fix: JSON API: Add a new hook that is fired when a post is posted using the API
|
1030 |
-
* Bug Fix: JSON API: Prefork/REST: update path normalizer to accept versions other than 1
|
1031 |
-
* Bug Fix: JSON API: Remove extra parenthesis in CSS
|
1032 |
-
* Bug Fix: Custom CSS: Move content width filters higher up so that they’re active for all users, not just logged-in admins.
|
1033 |
-
* Bug Fix: Custom CSS: All CSS properties that accept images as values need to be allowed to be declared multiple times so that cross-browser gradients work
|
1034 |
-
* Bug Fix: Infinite Scroll: Allow themes to define a custom function to render the IS footer
|
1035 |
-
* Bug Fix: Infinite Scroll: Fix up Twenty Thirteen styles for RTL and small viewports.
|
1036 |
-
* Bug Fix: Likes: Fix ‘Call to undefined function’
|
1037 |
-
* Bug Fix: Likes: Add scrolling no to iframe to make sure that like button in admin bar does not show scrollbars
|
1038 |
-
* Bug Fix: Likes: Remove setInterval( JetpackLikesWidgetQueueHandler, 250 ) call that was causing heavy CPU load
|
1039 |
-
* Bug Fix: Mobile Theme: Remove unused variable & function call
|
1040 |
-
* Bug Fix: Publicize: Fix LinkedIn profile URL generation
|
1041 |
-
* Bug Fix: Publicize: Better refresh handling for services such as LinkedIn and Facebook
|
1042 |
-
* Bug Fix: Shortcodes: Audio shortcode: Treat src as element 0. Fixes audio shortcodes created by wp_embed_register_handler when an audio url is on a line by itself
|
1043 |
-
* Bug Fix: Bandcamp: Updates to the Bandcamp shortcode
|
1044 |
-
* Bug Fix: Stats: Fix missing function get_editable_roles on non-admin page loads
|
1045 |
-
* Bug Fix: Widgets: Twitter Timeline: Fix HTML links in admin; set default values for width/height; change some of the sanitization functions
|
1046 |
-
* Bug Fix: Widgets: Top Posts Widget: Exclude attachments
|
1047 |
-
* Bug Fix: Widgets: Top Posts Widget: fix data validation for number of posts
|
1048 |
-
* Bug Fix: Fix PHP warnings non-static method called dynamically
|
1049 |
-
* Bug Fix: Fixed an issue in image extraction from HTML content
|
1050 |
-
* Bug Fix: Open Graph: Change default minimum size for og:image too 200×200
|
1051 |
-
* Note: The old Twitter widget was removed in favour of Twitter Timeline widget
|
1052 |
-
* Note: Add is_module_active() to make it easier to detect what is and what isn’t
|
1053 |
-
* Note: Compressing images via lossless methods
|
1054 |
-
* Note: Tidying up jetpack’s CSS
|
1055 |
-
* Note: Set the max DB version for our retina overrides that were meant to stop for WordPress 3.5
|
1056 |
-
* Note: Updating spin.js to the current version, and shifting to the canonical jquery.spin.js library
|
1057 |
-
* Note: Adding Jetpack_Options class, and abstracting out options functions to it
|
1058 |
-
|
1059 |
-
= 2.2.5 =
|
1060 |
-
Release Date: May 1, 2013
|
1061 |
-
|
1062 |
-
* Enhancement: Stats: Counting of registered users' views can now be enabled for specific roles
|
1063 |
-
* Bug Fix: Security tightening for metadata support in the REST API
|
1064 |
-
* Bug Fix: Update the method for checking Twitter Timeline widget_id and update coding standards
|
1065 |
-
* Bug Fix: Custom CSS: Allow the content width setting to be larger than the theme's content width
|
1066 |
-
* Bug Fix: Custom CSS: Fix possible missing argument warning.
|
1067 |
-
|
1068 |
-
= 2.2.4 =
|
1069 |
-
Release Date: April 26, 2013
|
1070 |
-
|
1071 |
-
* Bug Fix: JSON API compat file include was not assigning a variable correctly, thus throwing errors. This has been resolved.
|
1072 |
-
|
1073 |
-
= 2.2.3 =
|
1074 |
-
Release Date: April 26, 2013
|
1075 |
-
|
1076 |
-
* Enhancement: Comments - Add the reply-title H3 to the comment form so that themes or user CSS can style it
|
1077 |
-
* Enhancement: Custom CSS - Support for the CSS @viewport
|
1078 |
-
* Enhancement: JSON API - Support for i_like, is_following, and is_reblogged
|
1079 |
-
* Enhancement: JSON API: Custom Post Type Support
|
1080 |
-
* Enhancement: JSON API: Meta Data Support
|
1081 |
-
* Enhancement: JSON API: Bundled Support for bbPress
|
1082 |
-
* Enhancement: JSON API: Additions of following, reblog, and like status for post endpoints.
|
1083 |
-
* Enhancement: Shortcodes - Add Bandcamp shortcode
|
1084 |
-
* Enhancement: Tiled Galleries - Add code to get blog_id
|
1085 |
-
* Bug Fix: Carousel - Support relative image paths incase a plugin is filtering attachment URLs to be relative instead of absolute
|
1086 |
-
* Bug Fix: Carousel - Add likes widget to images / Respect comment settings for name/email
|
1087 |
-
* Bug Fix: Carousel - Make name and email optional if the setting in the admin area says they are
|
1088 |
-
* Bug Fix: Contact Form - Bug fixes, including a fix for WP-CLI
|
1089 |
-
* Bug Fix: Contact Form - Remove deprecated .live calls, delegate lazily to jQuery(document) since it's all in an iframe modal
|
1090 |
-
* Bug Fix: Contact Form - RTL styles
|
1091 |
-
* Bug Fix: Contact Form - Better handle MP6 icons
|
1092 |
-
* Bug Fix: Custom CSS - array_shift() took a variable by reference, so avoid passing it the result of a function
|
1093 |
-
* Bug Fix: Custom CSS - Allow case-insensitive CSS properties (<a href="http://wordpress.org/support/topic/two-issues-with-jetpack-css-module?replies=9">ref</a>)
|
1094 |
-
* Bug Fix: Infinite Scroll - Maintain main query's `post__not_in` values when querying posts for IS
|
1095 |
-
* 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
|
1096 |
-
* Bug Fix: Infinite Scroll - CSS update - IS footer was too large in Firefox
|
1097 |
-
* Bug Fix: Infinite Scroll - Add bundled support for Twenty Thirteen default theme
|
1098 |
-
* Bug Fix: Infinite Scroll - Include posts table's prefix when modifying the SQL WordPress generates to retrieve posts for Infinite Scroll
|
1099 |
-
* Bug Fix: JSON API - Use wp_set_comment_status to change the comment status, to make sure actions are run where needed
|
1100 |
-
* Bug Fix: Likes - Update style and logic for matching id's
|
1101 |
-
* Bug Fix: Mobile Theme - Ensure that <code>minileven_actual_current_theme()</code> is child-theme compatible + other updates
|
1102 |
-
* Bug Fix: Mobile Theme - Update method for finding currently active theme.
|
1103 |
-
* Bug Fix: Notifications - Remove the postmessage.js enqueue since this feature solely supports native postMessage
|
1104 |
-
* Bug Fix: Notifications - Clean up script enqueues and use core versions of underscore and backbone on wpcom as fallbacks
|
1105 |
-
* Bug Fix: Notifications - Enqueue v2 scripts and style
|
1106 |
-
* Bug Fix: Notifications - Prefix module-specific scripts and style to prevent collision
|
1107 |
-
* Bug Fix: Notifications - Include lang and dir attributes on #wpnt-notes-panel so the notifications iframe can use these to display correctly
|
1108 |
-
* Bug Fix: Open Graph: Use the profile OG type instead of author. Add tags for first/last names
|
1109 |
-
* Bug Fix: Publicize - Remove the Yahoo! service because they stopped supporting that API entirely
|
1110 |
-
* Bug Fix: Publicize - fix fatal errors caused by using a method on a non-object. Props @ipstenu
|
1111 |
-
* Bug Fix: Sharing - Adding 2x graphics for Pocket sharing service
|
1112 |
-
* Bug Fix: Sharing - Bug fixes, and a new filter
|
1113 |
-
* Bug Fix: Shortcodes - Audio: make sure that the Jetpack audion shortcode does not override the 3.6 core audio shortcode. Also, we need to filter the old Jetpack-style shortcode to properly set the params for the Core audio shortcode.
|
1114 |
-
* Bug Fix: Shortcodes - Audio: Re-enable the flash player
|
1115 |
-
* Bug Fix: Shortcodes - Slideshow: RTL styling update
|
1116 |
-
* Bug Fix: Tiled Galleries - Fix IE8 display bug where it doesn't honor inline CSS for width on images
|
1117 |
-
* Bug Fix: Tiled Galleries - Remove depreacted hover call, use mouseenter mouseleave instead
|
1118 |
-
* Enhancement: Twitter Timeline Widget: New JavaScript based widget. Old one will discontinue May 7th.
|
1119 |
-
|
1120 |
-
= 2.2.2 =
|
1121 |
-
Release Date: April 5, 2013
|
1122 |
-
|
1123 |
-
* Enhancement: Mobile Theme: Add controls for custom CSS.
|
1124 |
-
* Enhancement: Sharing: Add Pocket to the available services.
|
1125 |
-
* Bug Fix: Custom CSS: Update the method for generating content width setting.
|
1126 |
-
* Bug Fix: JSON API: Security updates.
|
1127 |
-
* Bug Fix: Likes: Add settings for email notifications and misc style updates.
|
1128 |
-
* Bug Fix: Notifications: Add the post types to sync after init.
|
1129 |
-
* Bug Fix: Publicize: RTL styling.
|
1130 |
-
* Bug Fix: Shortcodes: security fixes and function prefixing.
|
1131 |
-
* Bug Fix: Widgets: Update wording on the Top Posts widget for clarity.
|
1132 |
-
* Bug Fix: Jetpack Post Images security fixes.
|
1133 |
-
|
1134 |
-
= 2.2.1 =
|
1135 |
-
Release Date: March 28, 2013
|
1136 |
-
|
1137 |
-
* Enhancement: Development Mode: Define the `JETPACK_DEV_DEBUG` constant to `true` to enable an offline mode for localhost development. Only modules that don't require a WordPress.com connection can be enabled in this mode.
|
1138 |
-
* Enhancement: Likes: Added the number of likes to the wp-admin/edit.php screens.
|
1139 |
-
* Enhancement: Mobile Theme - design refresh
|
1140 |
-
* Enhancement: Shortcodes - Add a filter to the shortcode loading section so that a plugin can override what Jetpack loads for shortcodes
|
1141 |
-
* Enhancement: Widgets - Filter Jetpack's widgets so that a plugin can control which widgets get loaded
|
1142 |
-
* Bug Fix: Comments - Add in a wrapper div with id='commentform'
|
1143 |
-
* Bug Fix: Contact Form - Added date field with datepicker
|
1144 |
-
* Bug Fix: Contact Form - Allowed non-text widgets to use contact forms by running their output through the widget_text filter
|
1145 |
-
* Bug Fix: Custom CSS - Allowing color values to be defined multiple times
|
1146 |
-
* Bug Fix: Custom CSS - Dynamically loading the correct CSS/LESS/SCSS mode for the CSS editor if the user changes the preprocessor
|
1147 |
-
* Bug Fix: Custom CSS - Using the unminified worker CSS
|
1148 |
-
* Bug Fix: Custom CSS - Added rule: reminder about using .custom-background on body selector
|
1149 |
-
* Bug Fix: Custom CSS - Modified rule: Removed portion of overqualification rule that deems 'a.foo' overqualified if there are no other 'a' rules
|
1150 |
-
* Bug Fix: Custom CSS - Ensuring that the editor and the textarea behind it are using the same font so that the cursor appears in the correct location
|
1151 |
-
* Bug Fix: Custom CSS - Fix a bug that caused some sites to always ignore the base theme's CSS when in preview mode
|
1152 |
-
* Bug Fix: Custom CSS - Run stripslashes() before passing CSS to save()
|
1153 |
-
* Bug Fix: Custom CSS - Moving inline CSS and JavaScript into external files
|
1154 |
-
* Bug Fix: Infinite Scroll - Use the `is_main_query()` function and query method
|
1155 |
-
* Bug Fix: Infinite Scroll - Remove unused styles and an unnecessary margin setting
|
1156 |
-
* Bug Fix: Infinite Scroll - Allow the query used with IS to be filtered, so IS can be applied to a new query within a page template
|
1157 |
-
* Bug Fix: JSON API - Catch the 'User cannot view password protected post' error from can_view_post and bypass it for likes actions if the user has the password entered
|
1158 |
-
* Bug Fix: Likes - Bump cache buster, Don't show likes for password protected posts
|
1159 |
-
* Bug Fix: Notifications - Remove a redundant span closing tag
|
1160 |
-
* Bug Fix: Photon - If an image is already served from Photon but the anchor tag that surrounds it hasn't had its `href` value rewritten to use Photon, do so. Accounts for WP galleries whose individual items are linked to the original image files
|
1161 |
-
* Bug Fix: Publicize - Allows GLOBAL_CAP to be filtered, Adds an AYS to connection deletion, UI improvement for MP6 (and in general)
|
1162 |
-
* Bug Fix: Sharedaddy - Fire the sharing redirect earlier for increased plugin compatibility
|
1163 |
-
* Bug Fix: Stats - Move the display:none CSS output to wp_head so it gets written inside the HEAD tag if the option to hide the stats smilie is active
|
1164 |
-
* Bug Fix: Tiled Galleries - A more descriptive name for the default gallery type
|
1165 |
-
* Bug Fix: Tiled Galleries - Hide the Columns setting for gallery types that don't support it
|
1166 |
-
* Bug Fix: Run the admin_menu action late so that plugins hooking into it get a chance to run
|
1167 |
-
* Bug Fix: Prophylactic strict equality check
|
1168 |
-
|
1169 |
-
= 2.2 =
|
1170 |
-
Release Date: February 26, 2013
|
1171 |
-
Release Post: http://jetpack.com/2013/02/26/jetpack-2-2-likes/
|
1172 |
-
|
1173 |
-
* Enhancement: Likes: Allow your readers to show their appreciation of your posts.
|
1174 |
-
* Enhancement: Shortcodes: SoundCloud: Update to version 2.3 of the SoundCloud plugin (HTML5 default player, various fixes).
|
1175 |
-
* Enhancement: Shortcodes: Subscriptions: Add a shortcode to enable placement of a subscription signup form in a post or page.
|
1176 |
-
* Enhancement: Sharedaddy: Allow selecting multiple images from a post using the Pinterest share button.
|
1177 |
-
* Enhancement: Contact Form: Allow feedbacks to be marked spam in bulk.
|
1178 |
-
* Enhancement: Widgets: Readmill Widget: Give your visitors a link to send your book to their Readmill library.
|
1179 |
-
* Note: Notifications: Discontinue support for Internet Explorer 7 and below.
|
1180 |
-
* Bug Fix: JSON API: Fix authorization problems that some users were experiencing.
|
1181 |
-
* Bug Fix: JSON API: Sticky posts were not being sorted correctly in /posts requests.
|
1182 |
-
* Bug Fix: Stats: sync stats_options so server has roles array needed for view_stats cap check.
|
1183 |
-
* Bug Fix: Infinite Scroll: Display improvements.
|
1184 |
-
* Bug Fix: Infinite Scroll: WordPress compatibility fixes.
|
1185 |
-
* Bug Fix: Photon: Only rewrite iamge urls if the URL is compatible with Photon.
|
1186 |
-
* Bug Fix: Photon: Account for registered image sizes with one or more dimesions set to zero.
|
1187 |
-
* Bug Fix: Subscriptions: Make HTML markup more valid.
|
1188 |
-
* Bug Fix: Subscriptions: Fixed notices displayed in debug mode.
|
1189 |
-
* Bug Fix: Custom CSS: CSS warnings and errors should now work in environments where JavaScript is concatenated or otherwise modified before being served.
|
1190 |
-
* Bug Fix: Hovercards: WordPress compatibility fixes.
|
1191 |
-
* Bug Fix: Improved image handling for the Sharing and Publicize modules.
|
1192 |
-
* Bug Fix: Carousel: Display and Scrollbar fixes.
|
1193 |
-
* Bug Fix: Tiled Galleries: Restrict images in tiled galleries from being set larger than their containers.
|
1194 |
-
* Bug Fix: Widgets: Gravatar Profile: CSS fixes.
|
1195 |
-
* Bug Fix: Publicize: Strip HTML comments from the data we send to the third party services.
|
1196 |
-
* Bug Fix: Notifications: Dropped support for IE7 and below in the notifications menu.
|
1197 |
-
* Bug Fix: Custom CSS Editor: Allow custom themes to save CSS more easily.
|
1198 |
-
* Bug Fix: Infinite Scroll: Waits until the DOM is ready before loading the scrolling code.
|
1199 |
-
* Bug Fix: Mobile Theme: If the user has disabled the custom header text color, show the default black header text color.
|
1200 |
-
* Bug Fix: Mobile Theme: Fix for the "View Full Site" link.
|
1201 |
-
* Bug Fix: Mobile Theme: Use a filter to modify the output of wp_title().
|
1202 |
-
* Bug Fix: Publicize: Twitter: Re-enable character count turning red when more than 140 characters are typed.
|
1203 |
-
|
1204 |
-
= 2.1.2 =
|
1205 |
-
Release Date: February 5, 2013
|
1206 |
-
|
1207 |
-
* Enhancement: Infinite Scroll: Introduce filters for Infinite Scroll.
|
1208 |
-
* Enhancement: Shortcodes: TED shortcode.
|
1209 |
-
* Bug Fix: Carousel: Make sure to use large image sizes.
|
1210 |
-
* Bug Fix: Carousel: Clicking the back button in your browser after exiting a carousel gallery brings you back to the gallery.
|
1211 |
-
* Bug Fix: Carousel: Fix a scrollbar issue.
|
1212 |
-
* Bug Fix: Comments: Move the get_avatar() function out of the base class.
|
1213 |
-
* Bug Fix: Contact Form: Prevent the form from displaying i18n characters.
|
1214 |
-
* Bug Fix: Contact Form: Remove the !important CSS rule.
|
1215 |
-
* Bug Fix: Infinite Scroll: Main query arguments are not respected when using default permalink.
|
1216 |
-
* Bug Fix: JSON API: Trap 'wp_die' for new comments and image uploads.
|
1217 |
-
* Bug Fix: JSON API: Use a better array key for the user_ID.
|
1218 |
-
* Bug Fix: JSON API: Make the class instantiable only once, but multi-use.
|
1219 |
-
* Bug Fix: JSON API: Fix lookup of pages by page slug.
|
1220 |
-
* Bug Fix: JSON API: Updates for post likes.
|
1221 |
-
* Bug Fix: Mobile Theme: Remove Android download link for BB10 and Playbook.
|
1222 |
-
* Bug Fix: Open Graph: Stop using Loop functions to get post data for meta tags.
|
1223 |
-
* Bug Fix: Photon: Suppress and check for warnings when pasing_url and using it.
|
1224 |
-
* Bug Fix: Photon: Ensure full image size can be used.
|
1225 |
-
* Bug Fix: Photon: Resolve Photon / YouTube embed conflict.
|
1226 |
-
* Bug Fix: Photon: Fix dimension parsing from URLs.
|
1227 |
-
* Bug Fix: Photon: Make sure that width/height atts are greater than zero.
|
1228 |
-
* Bug Fix: Sharedaddy: Layout fixes for share buttons.
|
1229 |
-
* Bug Fix: Sharedaddy: Always send Facebook a language locale.
|
1230 |
-
* Bug Fix: Sharedaddy: Don't look up share counts for empty URLs.
|
1231 |
-
* Bug Fix: Shortcodes: Ensure that images don't overflow their containers in the slideshow shortcode.
|
1232 |
-
* Bug Fix: Shortcodes: only enqueue jquery if archive supports Infinite Scroll in the Audio Shortcode.
|
1233 |
-
* Bug Fix: Tiled Galleries: Use a more specific class for gallery item size to avoid conflicts.
|
1234 |
-
* Bug Fix: Tiled Galleries: Fixing scrolling issue when tapping on a Tiled Gallery on Android.
|
1235 |
-
* Bug Fix: Widgets: Gravatar profile widget typo.
|
1236 |
-
* Bug Fix: Widgets: Add (Jetpack) to widget titles.
|
1237 |
-
* Bug Fix: Widgets: Twitter wasn't wrapping links in the t.co shortener.
|
1238 |
-
* Bug Fix: Widgets: Facebook Likebox updates to handling the language locale.
|
1239 |
-
* Bug Fix: Widgets: Top Posts: Fixed a WP_DEBUG notice.
|
1240 |
-
* Bug Fix: Widgets: Gravatar Profile Widget: transient names must be less than 45 characters long.
|
1241 |
-
* Bug Fix: typo in delete_post_action function.
|
1242 |
-
* Bug Fix: Load rendered LaTeX image on same protocol as its page.
|
1243 |
-
|
1244 |
-
|
1245 |
-
= 2.1.1 =
|
1246 |
-
Release Date: January 5, 2013
|
1247 |
-
|
1248 |
-
* Bug Fix: Fix for an error appearing for blogs updating from Jetpack 1.9.2 or earlier to 2.1.
|
1249 |
-
|
1250 |
-
= 2.1 =
|
1251 |
-
Release Date: January 4, 2013
|
1252 |
-
Release Post: http://jetpack.com/2013/01/04/galleries/
|
1253 |
-
|
1254 |
-
* Enhancement: Tiled Galleries: Show off your photos with cool mosaic galleries.
|
1255 |
-
* Enhancement: Slideshow gallery type: Display any gallery as a slideshow.
|
1256 |
-
* Enhancement: Custom CSS: Allow zoom property.
|
1257 |
-
* Enhancement: Stats: Show WordPress.com subscribers in stats.
|
1258 |
-
* Bug Fix: Fix errors shown after connecting Jetpack to WordPress.com.
|
1259 |
-
* Bug Fix: Photon: Fix bug causing errors to be shown in some posts.
|
1260 |
-
* Bug Fix: Photon: Convert all images in posts when Photon is active.
|
1261 |
-
* Bug Fix: Infinite Scroll: Improved compatibility with the other modules.
|
1262 |
-
* Bug Fix: Custom CSS: Updated editor to fix missing file errors.
|
1263 |
-
* Bug Fix: Publicize: Don't show the Facebook profile option if this is a Page-only account.
|
1264 |
-
* Bug Fix: Photon: A fix for photos appearing shrunken if they didn't load quickly enough.
|
1265 |
-
* Bug Fix: Sharing: A compatibility fix for posts that only have partial featured image data.
|
1266 |
-
* Bug Fix: Publicize/Sharing: For sites without a static homepage, don't set the OpenGraph url value to the first post permalink.
|
1267 |
-
* Bug Fix: Mobile Theme: Better compatibility with the customizer on mobile devices.
|
1268 |
-
* Bug Fix: Sharing: Don't show sharing options on front page if that option is turned off.
|
1269 |
-
* Bug Fix: Contact Form: Fix PHP warning shown when adding a Contact Form in WordPress 3.5.
|
1270 |
-
* Bug Fix: Photon: Handle images with relative paths.
|
1271 |
-
* Bug Fix: Contact Form: Fix compatibility with the Shortcode Embeds module.
|
1272 |
-
|
1273 |
-
|
1274 |
-
= 2.0.4 =
|
1275 |
-
Release Date: December 14, 2012
|
1276 |
-
|
1277 |
-
* Bug Fix: Open Graph: Correct a bug that prevents Jetpack from being activated if the SharePress plugin isn't installed.
|
1278 |
-
|
1279 |
-
= 2.0.3 =
|
1280 |
-
Release Date: December 14, 2012
|
1281 |
-
|
1282 |
-
* Enhancement: Infinite Scroll: support [VideoPress](http://wordpress.org/extend/plugins/video/) plugin.
|
1283 |
-
* Enhancement: Photon: Apply to all images retrieved from the Media Library.
|
1284 |
-
* Enhancement: Photon: Retina image support.
|
1285 |
-
* Enhancement: Custom CSS: Refined editor interface.
|
1286 |
-
* Enhancement: Custom CSS: Support [Sass](http://sass-lang.com/) and [LESS](http://lesscss.org/) with built-in preprocessors.
|
1287 |
-
* Enhancement: Open Graph: Better checks for other plugins that may be loading Open Graph tags to prevent Jetpack from doubling meta tag output.
|
1288 |
-
* Bug Fix: Infinite Scroll: Respect relative image dimensions.
|
1289 |
-
* Bug Fix: Photon: Detect custom-cropped images and use those with Photon, rather than trying to use the original.
|
1290 |
-
* Bug Fix: Custom CSS: Fix for bug preventing @import from working with url()-style URLs.
|
1291 |
-
|
1292 |
-
= 2.0.2 =
|
1293 |
-
Release Date: November 21, 2012
|
1294 |
-
|
1295 |
-
* Bug Fix: Remove an erroneous PHP short open tag with the full tag to correct fatal errors under certain PHP configurations.
|
1296 |
-
|
1297 |
-
= 2.0.1 =
|
1298 |
-
Release Date: November 21, 2012
|
1299 |
-
|
1300 |
-
* Enhancement: Photon: Support for the [Lazy Load](http://wordpress.org/extend/plugins/lazy-load/) plugin.
|
1301 |
-
* Bug Fix: Photon: Fix warped images with un- or under-specified dimensions.
|
1302 |
-
* Bug Fix: Photon: Fix warped images with pre-photonized URLs; don't try to photonize them twice.
|
1303 |
-
* Bug Fix: Infinite Scroll: Check a child theme's parent theme for infinite scroll support.
|
1304 |
-
* Bug Fix: Infinite Scroll: Correct a bug with archives that resulted in posts appearing on archives that they didn't belong on.
|
1305 |
-
* Bug Fix: Publicize: Send the correct shortlink to Twitter (et al.) if your site uses a shortener other than wp.me.
|
1306 |
-
* Bug Fix: Sharing: Improved theme compatibility for the Google+ button.
|
1307 |
-
* Bug Fix: Notifications: Use locally-installed Javascript libraries if available.
|
1308 |
-
|
1309 |
-
= 2.0 =
|
1310 |
-
Release Date: November 8, 2012
|
1311 |
-
Release Post: http://jetpack.com/2012/11/08/jetpack-2-0-publicize-to-facebook-twitter-linkedin-tumblr-post-by-email-photon-infinite-scroll/
|
1312 |
-
|
1313 |
-
* Enhancement: Publicize: Connect your site to popular social networks and automatically share new posts with your friends.
|
1314 |
-
* Enhancement: Post By Email: Publish posts to your blog directly from your personal email account.
|
1315 |
-
* Enhancement: Photon: Images served through the global WordPress.com cloud.
|
1316 |
-
* Enhancement: Infinite Scroll: Better/faster browsing by pulling the next set of posts into view automatically when the reader approaches the bottom of the page.
|
1317 |
-
* Enhancement: Open Graph: Provides more detailed information about your posts to social networks.
|
1318 |
-
* Enhancement: JSON API: New parameters for creating and viewing posts.
|
1319 |
-
* Enhancement: Improved compatibility for the upcoming WordPress 3.5.
|
1320 |
-
* Bug Fix: Sharing: When you set your sharing buttons to use icon, text, or icon + text mode, the Google+ button will display accordingly.
|
1321 |
-
* Bug Fix: Gravatar Profile Widget: Allow basic HTML to be displayed.
|
1322 |
-
* Bug Fix: Twitter Widget: Error handling fixes.
|
1323 |
-
* Bug Fix: Sharing: Improved theme compatibility
|
1324 |
-
* Bug Fix: JSON API: Fixed error when creating some posts in some versions of PHP.
|
1325 |
-
|
1326 |
-
= 1.9.2 =
|
1327 |
-
Release Date: October 29, 2012
|
1328 |
-
|
1329 |
-
* Bug Fix: Only sync options on upgrade once.
|
1330 |
-
|
1331 |
-
= 1.9.1 =
|
1332 |
-
* Enhancement: Notifications feature is enabled for logged-out users when the module is active & the toolbar is shown by another plugin.
|
1333 |
-
* Bug Fix: Use proper CDN addresses to avoid SSL cert issues.
|
1334 |
-
* Bug Fix: Prioritize syncing comments over deleting comments on WordPress.com. Fixes comment notifications marked as spam appearing to be trashed.
|
1335 |
-
|
1336 |
-
= 1.9 =
|
1337 |
-
Release Date: October 26, 2012
|
1338 |
-
Release Post: http://jetpack.com/2012/10/26/jetpack-1-9-toolbar-notifications/
|
1339 |
-
|
1340 |
-
* Enhancement: Notifications: Display Notifications in the toolbar and support reply/moderation of comment notifications.
|
1341 |
-
* Enhancement: Mobile Push Notifications: Added support for mobile push notifications of new comments for users that linked their accounts to WordPress.com accounts.
|
1342 |
-
* Enhancement: JSON API: Allows applications to send API requests via WordPress.com (see [the docs](http://developer.wordpress.com/docs/api/) )
|
1343 |
-
* Enhancement: Sync: Modules (that require the data) sync full Post/Comment to ensure consistent data on WP.com (eg Stats)
|
1344 |
-
* Enhancement: Sync: Improve syncing of site options to WP.com
|
1345 |
-
* Enhancement: Sync: Sync attachment parents to WP.com
|
1346 |
-
* Enhancement: Sync: Add signing of WP.com user ids for Jetpack Comments
|
1347 |
-
* Enhancement: Sync: Mark and obfuscate private posts.
|
1348 |
-
* Enhancement: Privacy: Default disable enhanced-distribution and json-api modules if site appears to be private.
|
1349 |
-
* Enhancement: Custom CSS: allow applying Custom CSS to mobile theme.
|
1350 |
-
* Enhancement: Sharing: On HTTPS pageloads, load as much of the sharing embeds as possible from HTTPS URLs.
|
1351 |
-
* Enhancement: Contact Form: Overhaul of the contact form code to fix incompatibilites with other plugins.
|
1352 |
-
* Bug Fix: Only allow users with manage_options permission to enable/disable modules
|
1353 |
-
* Bug Fix: Custom CSS: allow '/' in media query units; e.g. (-o-min-device-pixel-ratio: 3/2)
|
1354 |
-
* Bug Fix: Custom CSS: leave comments alone in CSS when editing but minify on the frontend
|
1355 |
-
* Bug Fix: Sharing: Keep "more" pane open so Google+ Button isn't obscured
|
1356 |
-
* Bug Fix: Carousel: Make sure the original size is used, even when it is exceedingly large.
|
1357 |
-
* Bug Fix: Exclude iPad from Twitter on iPhone mobile browsing
|
1358 |
-
* Bug Fix: Sync: On .org user role changes synchronize the change to .com
|
1359 |
-
* Bug Fix: Contact Form: Fix a bug where some web hosts would reject mail from the contact form due to email address spoofing.
|
1360 |
-
|
1361 |
-
= 1.8.3 =
|
1362 |
-
Release Date: October 23, 2012
|
1363 |
-
|
1364 |
-
* Bug Fix: Subscriptions: Fix a bug where subscriptions were not being sent from the blog.
|
1365 |
-
* Bug Fix: Twitter: Fix a bug where the Twitter username was being saved as blank.
|
1366 |
-
* Bug Fix: Fix a bug where Contact Form notification emails were not being sent.
|
1367 |
-
|
1368 |
-
= 1.8.2 =
|
1369 |
-
Release Date: October 4, 2012
|
1370 |
-
|
1371 |
-
* Bug Fix: Subscriptions: Fix a bug where subscriptions were not sent for posts and comments written by some authors.
|
1372 |
-
* Bug Fix: Widgets: Fix CSS that was uglifying some themes (like P2).
|
1373 |
-
* Bug Fix: Widgets: Improve Top Posts and Pages styling.
|
1374 |
-
* Bug Fix: Custom CSS: Make the default "Welcome" message translatable.
|
1375 |
-
* Bug Fix: Fix Lithuanian translation.
|
1376 |
-
|
1377 |
-
= 1.8.1 =
|
1378 |
-
Release Date: September 28, 2012
|
1379 |
-
|
1380 |
-
* Bug Fix: Stats: Fixed a bug preventing some users from viewing stats.
|
1381 |
-
* Bug Fix: Mobile Theme: Fixed some disabled toolbar buttons.
|
1382 |
-
* Bug Fix: Top Posts widget: Fixed a bug preventing the usage of the Top Posts widget.
|
1383 |
-
* Bug Fix: Mobile Theme: Fixed a bug that broke some sites when the Subscriptions module was not enabled and the Mobile Theme module was enabled.
|
1384 |
-
* Bug Fix: Mobile Theme: Made mobile app promos in the Mobile Theme footer opt-in.
|
1385 |
-
* Bug Fix: Twitter Widget: A fix to prevent malware warnings.
|
1386 |
-
* Bug Fix: Mobile Theme: Fixed a bug that caused errors for some users with custom header images.
|
1387 |
-
|
1388 |
-
= 1.8 =
|
1389 |
-
Release Date: September 27, 2012
|
1390 |
-
Release Post: http://jetpack.com/2012/09/27/jetpack-1-8-mobile-theme/
|
1391 |
-
|
1392 |
-
* Enhancement: Mobile Theme: Automatically serve a slimmed down version of your site to users on mobile devices.
|
1393 |
-
* Enhancement: Multiuser: Allow multiple users to link their accounts to WordPress.com accounts.
|
1394 |
-
* Enhancement: Custom CSS: Added support for object-fit, object-position, transition, and filter properties.
|
1395 |
-
* Enhancement: Twitter Widget: Added Follow button
|
1396 |
-
* Enhancement: Widgets: Added Top Posts and Pages widget
|
1397 |
-
* Enhancement: Mobile Push Notifications: Added support for mobile push notifications on new comments.
|
1398 |
-
* Enhancement: VideoPress: Shortcodes now support the HD option, for default HD playback.
|
1399 |
-
* Bug Fix: Twitter Widget: Fixed tweet permalinks in the Twitter widget
|
1400 |
-
* Bug Fix: Custom CSS: @import rules and external images are no longer stripped out of custom CSS
|
1401 |
-
* Bug Fix: Custom CSS: Fixed warnings and notices displayed in debug mode
|
1402 |
-
* Bug Fix: Sharing: Fixed double-encoding of image URLs
|
1403 |
-
* Bug Fix: Sharing: Fix Google +1 button HTML validation issues (again :))
|
1404 |
-
* Bug Fix: Gravatar Profile Widget: Reduce size of header margins
|
1405 |
-
|
1406 |
-
= 1.7 =
|
1407 |
-
Release Date: August 23, 2012
|
1408 |
-
Release Post: http://jetpack.com/2012/08/23/jetpack-1-7-custom-css/
|
1409 |
-
|
1410 |
-
* Enhancement: CSS Editor: Customize your site's design without modifying your theme.
|
1411 |
-
* Enhancement: Comments: Submit the comment within the iframe. No more full page load to jetpack.wordpress.com.
|
1412 |
-
* Enhancement: Sharing: Share counts for Twitter, Facebook, LinkedIn
|
1413 |
-
* Enhancement: Sharing: Improve styling
|
1414 |
-
* Enhancement: Sharing: Add support for ReCaptcha
|
1415 |
-
* Enhancement: Sharing: Better extensability through filters
|
1416 |
-
* Enhancement: Widgets: Twitter: Attempt to reduce errors by storing a long lasting copy of the data. Thanks, kareldonk :)
|
1417 |
-
* Regression Fix: Sharing: Properly store and display the sharing label option's default value.
|
1418 |
-
* Bug Fix: Contact Form: remove worse-than-useless nonce.
|
1419 |
-
* Bug Fix: Subscriptions: remove worse-than-useless nonce.
|
1420 |
-
* Bug Fix: Sharing: Don't show sharing buttons twice on attachment pages.
|
1421 |
-
* Bug Fix: Sharing: Increase width of Spanish Like button for Facebook.
|
1422 |
-
* Bug Fix: Sharing: Use the correct URL to the throbber.
|
1423 |
-
* Bug Fix: Stats: Fix notice about undefined variable $alt
|
1424 |
-
* Bug Fix: Subscriptions: Make Subscriptions module obey the settings of the Settngs -> Discussion checkboxes for Follow Blog/Comments
|
1425 |
-
* Bug Fix: Shortcodes: VideoPress: Compatibility with the latest version of VideoPress
|
1426 |
-
* Bug Fix: Shortcodes: Audio: Include JS File for HTML5 audio player
|
1427 |
-
* Bug Fix: Hovercards: Improve cache handling.
|
1428 |
-
* Bug Fix: Widgets: Gravatar Profle: Correctly display service icons in edge cases.
|
1429 |
-
* Bug Fix: Widgets: Gravatar Profle: Prevent ugly "flash" of too-large image when page first loads on some sites
|
1430 |
-
* Bug Fix: Carousel: CSS Compatibility with more themes.
|
1431 |
-
|
1432 |
-
= 1.6.1 =
|
1433 |
-
Release Date: August 4, 2012
|
1434 |
-
|
1435 |
-
* Bug Fix: Prevent Fatal error under certain conditions in sharing module
|
1436 |
-
* Bug Fix: Add cachebuster to sharing.css
|
1437 |
-
* Bug Fix: Disable via for Twitter until more robust code is in place
|
1438 |
-
|
1439 |
-
= 1.6 =
|
1440 |
-
Release Date: August 2, 2012
|
1441 |
-
Release Post: http://jetpack.com/2012/08/02/jetpack-1-6-retina-and-pinterest/
|
1442 |
-
|
1443 |
-
* Enhancement: Carousel: Better image resolution selection based on available width/height.
|
1444 |
-
* Enhancement: Carousel: Load image caption, metadata, comments, et alii when a slide is clicked to switch to instead of waiting.
|
1445 |
-
* Enhancement: Carousel: Added a "Comment" button and handling to scroll to and focus on comment textarea.
|
1446 |
-
* Enhancement: Widgets: Facebook Likebox now supports a height parameter and a better width parameter.
|
1447 |
-
* Enhancement: Widgets: Better feedback when widgets are not set up properly.
|
1448 |
-
* Enhancement: Shortcodes: Google Maps shortcode now supports percentages in the width.
|
1449 |
-
* Enhancement: Shortcodes: Update Polldaddy shortcode for more efficient Javascript libraries.
|
1450 |
-
* Enhancement: Shortcodes: Youtube shortcode now has playlist support.
|
1451 |
-
* Enhancement: Add Gravatar Profile widget.
|
1452 |
-
* Enhancement: Update Sharedaddy to latest version, including Pinterest support.
|
1453 |
-
* Enhancement: Retinize Jetpack and much of WordPress.
|
1454 |
-
* Bug Fix: Shortcodes: Fix Audio shortcode color parameter and rename encoding function.
|
1455 |
-
* Bug Fix: Shortcodes: Don't output HTML 5 version of the Audio shortcode because of a bug with Google Reader.
|
1456 |
-
* Bug Fix: Jetpack Comments: Don't overlead the addComments object if it doesn't exist. Fixes spacing issue with comment form.
|
1457 |
-
* Bug Fix: Contact Form: If send_to_editor() exists, use it. Fixes an IE9 text area issue.
|
1458 |
-
|
1459 |
-
= 1.5 =
|
1460 |
-
Release Date: July 31, 2012
|
1461 |
-
|
1462 |
-
* Enhancement: Add Gallery Carousel feature
|
1463 |
-
* Note: the Carousel module bundles http://fgnass.github.com/spin.js/ (MIT license)
|
1464 |
-
|
1465 |
-
= 1.4.2 =
|
1466 |
-
Release Date: June 20, 2012
|
1467 |
-
|
1468 |
-
* Bug Fix: Jetpack Comments: Add alternative Javascript event listener for Internet 8 users.
|
1469 |
-
* Enhancement: Remove more PHP 4 backwards-compatible code (WordPress andJetpack only support PHP 5).
|
1470 |
-
* Enhancement: Remove more WordPress 3.1 and under backwards-compatible code.
|
1471 |
-
|
1472 |
-
= 1.4.1 =
|
1473 |
-
Release Date: June 15, 2012
|
1474 |
-
|
1475 |
-
* Bug Fix: Jetpack Comments / Subscriptions: Add checkboxes and logic control for the Subscription checkboxes.
|
1476 |
-
|
1477 |
-
= 1.4 =
|
1478 |
-
Release Date: June 14, 2012
|
1479 |
-
|
1480 |
-
* Enhancement: Add Jetpack Comments feature.
|
1481 |
-
* Bug Fix: Sharing: Make the sharing_label translatable.
|
1482 |
-
* Bug Fix: Sharing: Fixed the file type on the LinkedIn graphic.
|
1483 |
-
* Bug Fix: Sharing: Fixes for the Faceboox Like button language locales.
|
1484 |
-
* Bug Fix: Sharing: Updates for the "more" button when used with touch screen devices.
|
1485 |
-
* Bug Fix: Sharing: Properly scope the More button so that multiple More buttons on a page behave properly.
|
1486 |
-
* Bug Fix: Shortcodes: Update the YouTube and Audio shortcodes to better handle spaces in the URLs.
|
1487 |
-
* Bug Fix: Shortcodes: Make the YouTube shortcode respect embed settings in Settings -> Media when appropriate.
|
1488 |
-
* Bug Fix: Shortcodes: Removed the Slide.com shortcode; Slide.com no longer exists.
|
1489 |
-
* Bug Fix: Shortcodes: Match both http and https links in the [googlemaps] shortcode.
|
1490 |
-
* Bug Fix: After the Deadline: Code clean up and removal of inconsistencies.
|
1491 |
-
|
1492 |
-
= 1.3.4 =
|
1493 |
-
Release Date: May 24, 2012
|
1494 |
-
|
1495 |
-
* Bug Fix: Revert changes to the top level menu that are causing problems.
|
1496 |
-
|
1497 |
-
= 1.3.3 =
|
1498 |
-
Release Date: May 22, 2012
|
1499 |
-
|
1500 |
-
* Bug Fix: Fix notices caused by last update
|
1501 |
-
|
1502 |
-
= 1.3.2 =
|
1503 |
-
Release Date: May 22, 2012
|
1504 |
-
|
1505 |
-
* Bug Fix: Fix Jetpack menu so that Akismet and VaultPress submenus show up.
|
1506 |
-
|
1507 |
-
= 1.3.1 =
|
1508 |
-
Release Date: May 22, 2012
|
1509 |
-
|
1510 |
-
* Enhancement: Add a new widget, the Facebook Likebox
|
1511 |
-
* Bug Fix: Sharing: Sharing buttons can now be used on custom post types.
|
1512 |
-
* Bug Fix: Contact Forms: Make Contact Forms widget shortcode less aggressive about the shortcodes it converts.
|
1513 |
-
* Bug Fix: Ensure contact forms are parsed correctly in text widgets.
|
1514 |
-
* Bug Fix: Connection notices now only appear on the Dashboard and plugin page.
|
1515 |
-
* Bug Fix: Connection notices are now dismissable if Jetpack is not network activated.
|
1516 |
-
* Bug Fix: Subscriptions: Fix an issue that was causing errors with new BuddyPress forum posts.
|
1517 |
-
|
1518 |
-
= 1.3 =
|
1519 |
-
Release Date: April 25, 2012
|
1520 |
-
Release Post: http://jetpack.com/2012/04/24/jetpack-1-3-released-contact-forms/
|
1521 |
-
|
1522 |
-
* Enhancement: Add Contact Forms feature. Formerly Grunion Contact Forms.
|
1523 |
-
* Bug Fix: Tweak YouTube autoembedder to catch more YouTube URLs.
|
1524 |
-
* Bug Fix: Correctly load the Sharing CSS files.
|
1525 |
-
|
1526 |
-
= 1.2.4 =
|
1527 |
-
Release Date: April 6, 2012
|
1528 |
-
|
1529 |
-
* Bug Fix: Fix rare bug with static front pages
|
1530 |
-
|
1531 |
-
= 1.2.3 =
|
1532 |
-
Release Date: April 5, 2012
|
1533 |
-
|
1534 |
-
* Enhancement: Twitter Widget: Expand t.co URLs
|
1535 |
-
* Bug Fix: Various PHP Notices.
|
1536 |
-
* Bug Fix: WordPress Deprecated `add_contextual_help()` notices
|
1537 |
-
* Bug Fix: Don't display unimportant DB errors when processing Jetpack nonces
|
1538 |
-
* Bug Fix: Correctly sync data during certain MultiSite cases.
|
1539 |
-
* Bug Fix: Stats: Allow sparkline img to load even when there is a DB upgrade.
|
1540 |
-
* Bug Fix: Stats: Replace "loading title" with post title regardless of type and status.
|
1541 |
-
* Bug Fix: Stats: Avoid edge case infinite redirect for `show_on_front=page` sites where the `home_url()` conatins uppercase letters.
|
1542 |
-
* Bug Fix: Subscriptions: Don't send subscriptions if the feature is turned off in Jetpack.
|
1543 |
-
* Bug Fix: Subscriptions: Fix pagination of subscribers.
|
1544 |
-
* Bug Fix: Subscriptions: Sync data about categories/tags as well to improve subscription emails.
|
1545 |
-
* Bug Fix: Subscriptions: Better styling for the subscription success message.
|
1546 |
-
* Bug Fix: Shortcodes: Support for multiple Google Maps in one post. Support for all Google Maps URLs.
|
1547 |
-
* Bug Fix: Shortcodes: Improved support for youtu.be URLs
|
1548 |
-
* Bug Fix: Shortcodes: Improved Vimeo embeds.
|
1549 |
-
* Bug Fix: Sharing: Switch to the 20px version of Google's +1 button for consistency.
|
1550 |
-
* Bug Fix: Sharing: Fix Google +1 button HTML validation issues.
|
1551 |
-
* Bug Fix: Sharing: Disable sharing buttons during preview.
|
1552 |
-
* Bug Fix: Spelling and Grammar: Properly handle proofreading settings.
|
1553 |
-
* Bug Fix: Spelling and Grammar: Don't prevent post save when proofreading service is unavailable.
|
1554 |
-
|
1555 |
-
= 1.2.2 =
|
1556 |
-
Release Date: December 6, 2011
|
1557 |
-
|
1558 |
-
* Bug Fix: Ensure expected modules get reactivated correctly during upgrade.
|
1559 |
-
* Bug Fix: Don't send subscription request during spam comment submission.
|
1560 |
-
* Bug Fix: Increased theme compatibility for subscriptions.
|
1561 |
-
* Bug Fix: Remove reference to unused background image.
|
1562 |
-
|
1563 |
-
= 1.2.1 =
|
1564 |
-
Release Date: November 18, 2011
|
1565 |
-
|
1566 |
-
* Bug Fix: Ensure Site Stats menu item is accessible.
|
1567 |
-
* Bug Fix: Fixed errors displayed during some upgrades.
|
1568 |
-
* Bug Fix: Fix inaccurate new modules "bubble" in menu for some upgrades.
|
1569 |
-
* Bug Fix: Fix VaultPress detection.
|
1570 |
-
* Bug Fix: Fix link to http://jetpack.com/faq/
|
1571 |
-
|
1572 |
-
= 1.2 =
|
1573 |
-
Release Date: November 17, 2011
|
1574 |
-
Release Post: http://jetpack.com/2011/11/17/announcing-jetpack-1-2/
|
1575 |
-
|
1576 |
-
* Enhancement: Add Subscriptions: Subscribe to site's posts and posts' comments.
|
1577 |
-
* Enhancement: Add Google Maps shortcode.
|
1578 |
-
* Enhancement: Add Image Widget.
|
1579 |
-
* Enhancement: Add RSS Links Widget.
|
1580 |
-
* Enhancement: Stats: More responsive stats dashboard.
|
1581 |
-
* Enhancement: Shortcodes: Google Maps, VideoPress
|
1582 |
-
* Enhancement: Sharing: Google+, LinkedIn
|
1583 |
-
* Enhancement: Enhanced Distribution: Added Jetpack blogs to http://en.wordpress.com/firehose/
|
1584 |
-
* Bug Fix: Spelling and Grammar: WordPress 3.3 compatibility.
|
1585 |
-
* Bug Fix: Translatable module names/descriptinos.
|
1586 |
-
* Bug Fix: Correctly detect host's ability to make outgoing HTTPS requests.
|
1587 |
-
|
1588 |
-
= 1.1.3 =
|
1589 |
-
Release Date: July 19, 2011
|
1590 |
-
|
1591 |
-
* Bug Fix: Increase compatibility with WordPress 3.2's new `wp_remote_request()` API.
|
1592 |
-
* Bug Fix: Increase compatibility with Admin Bar.
|
1593 |
-
* Bug Fix: Stats: Improved performance when creating new posts.
|
1594 |
-
* Bug Fix: Twitter Widget: Fix PHP Notice.
|
1595 |
-
* Bug Fix: Sharedaddy: Fix PHP Warning.
|
1596 |
-
* Enhancement: AtD: Add spellcheck button to Distraction Free Writing screen.
|
1597 |
-
* Translations: Added: Bosnian, Danish, German, Finnish, Galician, Croatian, Indonesian, Macedonian, Norwegian (Bokmål), Russian, Slovak, Serbian, Swedish
|
1598 |
-
* Translations: Updated: Spanish, French, Italian, Japanese, Brazilian Portuguese, Portuguese
|
1599 |
-
|
1600 |
-
= 1.1.2 =
|
1601 |
-
Release Date: July 6, 2011
|
1602 |
-
|
1603 |
-
* Bug Fix: Note, store, and keep fresh the time difference between the Jetpack site's host and the Jetpack servers at WordPress.com. Should fix all "timestamp is too old" errors.
|
1604 |
-
* Bug Fix: Improve experience on hosts capable of making outgoing HTTPS requests but incapable of verifying SSL certificates. Fixes some "register_http_request_failed", "error setting certificate verify locations", and "error:14090086:lib(20):func(144):reason(134)" errors.
|
1605 |
-
* Bug Fix: Better fallback when WordPress.com is experiencing problems.
|
1606 |
-
* Bug Fix: It's Jetpack, not JetPack :)
|
1607 |
-
* Bug Fix: Remove PHP Warnings/Notices.
|
1608 |
-
* Bug Fix: AtD: JS based XSS bug. Props markjaquith.
|
1609 |
-
* Bug Fix: AtD: Prevent stored configuration options from becoming corrupted.
|
1610 |
-
* Bug Fix: Stats: Prevent missing old stats for some blogs.
|
1611 |
-
* Bug Fix: Twitter Widget: Fix formatting of dates/times in PHP4.
|
1612 |
-
* Bug Fix: Twitter Widget: Cache the response from Twitter to prevent "Twitter did not respond. Please wait a few minutes and refresh this page." errors.
|
1613 |
-
* Enhancement: Slightly improved RTL experience. Jetpack 1.2 should include a much better fix.
|
1614 |
-
* Enhancement: Sharedaddy: Improve localization for Facebook Like button.
|
1615 |
-
* Enhancement: Gravatar Hovercards: Improved experience for Windows browsers.
|
1616 |
-
|
1617 |
-
= 1.1.1 =
|
1618 |
-
Release Date: March 19, 2011
|
1619 |
-
* Bug Fix: Improve experience on hosts capable of making outgoing HTTPS requests but incapable of verifying SSL certificates. Fixes most "Your Jetpack has a glitch. Connecting this site with WordPress.com is not possible. This usually means your site is not publicly accessible (localhost)." errors.
|
1620 |
-
* Bug Fix: Sharedaddy: Fatal error under PHP4. Disable on PHP4 hosts.
|
1621 |
-
* Bug Fix: Stats: Fatal error under PHP4. Rewrite to be PHP4 compatible.
|
1622 |
-
* Bug Fix: Stats: Fatal error on some sites modifying/removing core WordPress user roles. Add sanity check.
|
1623 |
-
* Bug Fix: Stats: Replace debug output with error message in dashboard widget.
|
1624 |
-
* Bug Fix: Stats: Rework hook priorities so that stats views are always counted even if a plugin (such as Paginated Comments) bails early on template_redirect.
|
1625 |
-
* Bug Fix: Identify the module that connot be activated to fatal error during single module activation.
|
1626 |
-
* Bug Fix: `glob()` is not always available. Use `opendir()`, `readdir()`, `closedir()`.
|
1627 |
-
* Bug Fix: Send permalink options to Stats Server for improved per post permalink calculation.
|
1628 |
-
* Bug Fix: Do not hide Screen Options and Help links during Jetpack call to connect.
|
1629 |
-
* Bug Fix: Improve readablitiy of text.
|
1630 |
-
* Bug Fix: AtD: Correctly store/display options.
|
1631 |
-
* Enhancement: Output more informative error messages.
|
1632 |
-
* Enhancement: Improve CSS styling.
|
1633 |
-
* Enhancement: Stats: Query all post types and statuses when getting posts for stats reports.
|
1634 |
-
* Enhancement: Improve performance of LaTeX URLs be using cookieless CDN.
|
1635 |
-
|
1636 |
-
= 1.1 =
|
1637 |
-
Release Date: March 9, 2011
|
1638 |
-
|
1639 |
-
* Initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
12 |
-
/**
|
13 |
-
* @var Jetpack
|
14 |
-
**/
|
15 |
-
private $jetpack;
|
16 |
-
|
17 |
-
static function init() {
|
18 |
-
if ( is_null( self::$instance ) ) {
|
19 |
-
self::$instance = new Jetpack_Admin;
|
20 |
-
}
|
21 |
-
return self::$instance;
|
22 |
-
}
|
23 |
-
|
24 |
-
private function __construct() {
|
25 |
-
$this->jetpack = Jetpack::init();
|
26 |
-
|
27 |
-
jetpack_require_lib( 'admin-pages/class.jetpack-landing-page' );
|
28 |
-
$this->landing_page = new Jetpack_Landing_Page;
|
29 |
-
|
30 |
-
jetpack_require_lib( 'admin-pages/class.jetpack-settings-page' );
|
31 |
-
$this->settings_page = new Jetpack_Settings_Page;
|
32 |
-
|
33 |
-
jetpack_require_lib( 'admin-pages/class.jetpack-my-jetpack-page' );
|
34 |
-
$this->my_jetpack_page = new Jetpack_My_Jetpack_Page;
|
35 |
-
|
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' ) );
|
50 |
-
|
51 |
-
// Add module bulk actions handler
|
52 |
-
add_action( 'jetpack_unrecognized_action', array( $this, 'handle_unrecognized_action' ) );
|
53 |
-
}
|
54 |
-
|
55 |
-
static function sort_requires_connection_last( $module1, $module2 ) {
|
56 |
-
if ( $module1['requires_connection'] == $module2['requires_connection'] ) {
|
57 |
-
return 0;
|
58 |
-
} elseif ( $module1['requires_connection'] ) {
|
59 |
-
return 1;
|
60 |
-
} elseif ( $module2['requires_connection'] ) {
|
61 |
-
return -1;
|
62 |
-
}
|
63 |
-
|
64 |
-
return 0;
|
65 |
-
}
|
66 |
-
|
67 |
-
// Produce JS understandable objects of modules containing information for
|
68 |
-
// presentation like description, name, configuration url, etc.
|
69 |
-
function get_modules() {
|
70 |
-
include_once( JETPACK__PLUGIN_DIR . 'modules/module-info.php' );
|
71 |
-
$available_modules = $this->jetpack->get_available_modules();
|
72 |
-
$active_modules = $this->jetpack->get_active_modules();
|
73 |
-
$modules = array();
|
74 |
-
$jetpack_active = Jetpack::is_active() || Jetpack::is_development_mode();
|
75 |
-
foreach ( $available_modules as $module ) {
|
76 |
-
if ( $module_array = $this->jetpack->get_module( $module ) ) {
|
77 |
-
/**
|
78 |
-
* Filters each module's short description.
|
79 |
-
*
|
80 |
-
* @since 3.0.0
|
81 |
-
*
|
82 |
-
* @param string $module_array['description'] Module description.
|
83 |
-
* @param string $module Module slug.
|
84 |
-
*/
|
85 |
-
$short_desc = apply_filters( 'jetpack_short_module_description', $module_array['description'], $module );
|
86 |
-
// Fix: correct multibyte strings truncate with checking for mbstring extension
|
87 |
-
$short_desc_trunc = ( function_exists( 'mb_strlen' ) )
|
88 |
-
? ( ( mb_strlen( $short_desc ) > 143 )
|
89 |
-
? mb_substr( $short_desc, 0, 140 ) . '...'
|
90 |
-
: $short_desc )
|
91 |
-
: ( ( strlen( $short_desc ) > 143 )
|
92 |
-
? substr( $short_desc, 0, 140 ) . '...'
|
93 |
-
: $short_desc );
|
94 |
-
|
95 |
-
$module_array['module'] = $module;
|
96 |
-
$module_array['activated'] = ( $jetpack_active ? in_array( $module, $active_modules ) : false );
|
97 |
-
$module_array['deactivate_nonce'] = wp_create_nonce( 'jetpack_deactivate-' . $module );
|
98 |
-
$module_array['activate_nonce'] = wp_create_nonce( 'jetpack_activate-' . $module );
|
99 |
-
$module_array['available'] = self::is_module_available( $module_array );
|
100 |
-
$module_array['short_description'] = $short_desc_trunc;
|
101 |
-
$module_array['configure_url'] = Jetpack::module_configuration_url( $module );
|
102 |
-
|
103 |
-
ob_start();
|
104 |
-
/**
|
105 |
-
* Allow the display of a "Learn More" button.
|
106 |
-
* The dynamic part of the action, $module, is the module slug.
|
107 |
-
*
|
108 |
-
* @since 3.0.0
|
109 |
-
*/
|
110 |
-
do_action( 'jetpack_learn_more_button_' . $module );
|
111 |
-
$module_array['learn_more_button'] = ob_get_clean();
|
112 |
-
|
113 |
-
ob_start();
|
114 |
-
/**
|
115 |
-
* Allow the display of information text when Jetpack is connected to WordPress.com.
|
116 |
-
* The dynamic part of the action, $module, is the module slug.
|
117 |
-
*
|
118 |
-
* @since 3.0.0
|
119 |
-
*/
|
120 |
-
do_action( 'jetpack_module_more_info_' . $module );
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Filter the long description of a module.
|
124 |
-
*
|
125 |
-
* @since 3.5.0
|
126 |
-
*
|
127 |
-
* @param string ob_get_clean() The module long description.
|
128 |
-
* @param string $module The module name.
|
129 |
-
*/
|
130 |
-
$module_array['long_description'] = apply_filters( 'jetpack_long_module_description', ob_get_clean(), $module );
|
131 |
-
|
132 |
-
ob_start();
|
133 |
-
/**
|
134 |
-
* Filter the search terms for a module
|
135 |
-
*
|
136 |
-
* Search terms are typically added to the module headers, under "Additional Search Queries".
|
137 |
-
*
|
138 |
-
* Use syntax:
|
139 |
-
* function jetpack_$module_search_terms( $terms ) {
|
140 |
-
* $terms = _x( 'term 1, term 2', 'search terms', 'jetpack' );
|
141 |
-
* return $terms;
|
142 |
-
* }
|
143 |
-
* add_filter( 'jetpack_search_terms_$module', 'jetpack_$module_search_terms' );
|
144 |
-
*
|
145 |
-
* @since 3.5.0
|
146 |
-
*
|
147 |
-
* @param string The search terms (comma separated).
|
148 |
-
*/
|
149 |
-
echo apply_filters( 'jetpack_search_terms_' . $module, $module_array['additional_search_queries'] );
|
150 |
-
$module_array['search_terms'] = ob_get_clean();
|
151 |
-
|
152 |
-
$module_array['configurable'] = false;
|
153 |
-
if (
|
154 |
-
current_user_can( 'manage_options' ) &&
|
155 |
-
/**
|
156 |
-
* Allow the display of a configuration link in the Jetpack Settings screen.
|
157 |
-
*
|
158 |
-
* @since 3.0.0
|
159 |
-
*
|
160 |
-
* @param string $module Module name.
|
161 |
-
* @param bool false Should the Configure module link be displayed? Default to false.
|
162 |
-
*/
|
163 |
-
apply_filters( 'jetpack_module_configurable_' . $module, false )
|
164 |
-
) {
|
165 |
-
$module_array['configurable'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( Jetpack::module_configuration_url( $module ) ), __( 'Configure', 'jetpack' ) );
|
166 |
-
}
|
167 |
-
|
168 |
-
$modules[ $module ] = $module_array;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
uasort( $modules, array( $this->jetpack, 'sort_modules' ) );
|
173 |
-
|
174 |
-
if ( ! Jetpack::is_active() ) {
|
175 |
-
uasort( $modules, array( __CLASS__, 'sort_requires_connection_last' ) );
|
176 |
-
}
|
177 |
-
|
178 |
-
return $modules;
|
179 |
-
}
|
180 |
-
|
181 |
-
static function is_module_available( $module ) {
|
182 |
-
if ( ! is_array( $module ) || empty( $module ) )
|
183 |
-
return false;
|
184 |
-
|
185 |
-
/**
|
186 |
-
* We never want to show VaultPress as activatable through Jetpack.
|
187 |
-
*/
|
188 |
-
if ( 'vaultpress' === $module['module'] ) {
|
189 |
-
return false;
|
190 |
-
}
|
191 |
-
|
192 |
-
if ( Jetpack::is_development_mode() ) {
|
193 |
-
return ! ( $module['requires_connection'] );
|
194 |
-
} else {
|
195 |
-
return Jetpack::is_active();
|
196 |
-
}
|
197 |
-
}
|
198 |
-
|
199 |
-
function handle_unrecognized_action( $action ) {
|
200 |
-
switch( $action ) {
|
201 |
-
case 'bulk-activate' :
|
202 |
-
if ( ! current_user_can( 'jetpack_activate_modules' ) ) {
|
203 |
-
break;
|
204 |
-
}
|
205 |
-
|
206 |
-
$modules = (array) $_GET['modules'];
|
207 |
-
$modules = array_map( 'sanitize_key', $modules );
|
208 |
-
check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
|
209 |
-
foreach( $modules as $module ) {
|
210 |
-
Jetpack::log( 'activate', $module );
|
211 |
-
Jetpack::activate_module( $module, false );
|
212 |
-
}
|
213 |
-
// The following two lines will rarely happen, as Jetpack::activate_module normally exits at the end.
|
214 |
-
wp_safe_redirect( wp_get_referer() );
|
215 |
-
exit;
|
216 |
-
case 'bulk-deactivate' :
|
217 |
-
if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) {
|
218 |
-
break;
|
219 |
-
}
|
220 |
-
|
221 |
-
$modules = (array) $_GET['modules'];
|
222 |
-
$modules = array_map( 'sanitize_key', $modules );
|
223 |
-
check_admin_referer( 'bulk-jetpack_page_jetpack_modules' );
|
224 |
-
foreach ( $modules as $module ) {
|
225 |
-
Jetpack::log( 'deactivate', $module );
|
226 |
-
Jetpack::deactivate_module( $module );
|
227 |
-
Jetpack::state( 'message', 'module_deactivated' );
|
228 |
-
}
|
229 |
-
Jetpack::state( 'module', $modules );
|
230 |
-
wp_safe_redirect( wp_get_referer() );
|
231 |
-
exit;
|
232 |
-
default:
|
233 |
-
return;
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
function fix_redirect( $module, $redirect = true ) {
|
238 |
-
if ( ! $redirect ) {
|
239 |
-
return;
|
240 |
-
}
|
241 |
-
if ( wp_get_referer() ) {
|
242 |
-
add_filter( 'wp_redirect', 'wp_get_referer' );
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
function admin_menu_debugger() {
|
247 |
-
$debugger_hook = add_submenu_page( null, __( 'Jetpack Debugging Center', 'jetpack' ), '', 'manage_options', 'jetpack-debugger', array( $this, 'debugger_page' ) );
|
248 |
-
add_action( "admin_head-$debugger_hook", array( 'Jetpack_Debugger', 'jetpack_debug_admin_head' ) );
|
249 |
-
}
|
250 |
-
|
251 |
-
function debugger_page() {
|
252 |
-
nocache_headers();
|
253 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
254 |
-
die( '-1' );
|
255 |
-
}
|
256 |
-
Jetpack_Debugger::jetpack_debug_display_handler();
|
257 |
-
}
|
258 |
-
}
|
259 |
-
Jetpack_Admin::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-autoupdate.php
DELETED
@@ -1,246 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Handles items that have been selected for automatic updates.
|
5 |
-
* Hooks into WP_Automatic_Updater
|
6 |
-
*/
|
7 |
-
class Jetpack_Autoupdate {
|
8 |
-
|
9 |
-
private $results = array();
|
10 |
-
|
11 |
-
private $expected = array();
|
12 |
-
|
13 |
-
private $success = array(
|
14 |
-
'plugin' => array(),
|
15 |
-
'theme' => array(),
|
16 |
-
);
|
17 |
-
|
18 |
-
private $failed = array(
|
19 |
-
'plugin' => array(),
|
20 |
-
'theme' => array(),
|
21 |
-
);
|
22 |
-
|
23 |
-
private static $instance = null;
|
24 |
-
|
25 |
-
static function init() {
|
26 |
-
if ( is_null( self::$instance ) ) {
|
27 |
-
self::$instance = new Jetpack_Autoupdate;
|
28 |
-
}
|
29 |
-
return self::$instance;
|
30 |
-
}
|
31 |
-
|
32 |
-
private function __construct() {
|
33 |
-
if ( Jetpack::is_module_active( 'manage' ) ) {
|
34 |
-
add_filter( 'auto_update_plugin', array( $this, 'autoupdate_plugin' ), 10, 2 );
|
35 |
-
add_filter( 'auto_update_theme', array( $this, 'autoupdate_theme' ), 10, 2 );
|
36 |
-
add_filter( 'auto_update_core', array( $this, 'autoupdate_core' ), 10, 2 );
|
37 |
-
add_action( 'automatic_updates_complete', array( $this, 'automatic_updates_complete' ), 999, 1 );
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
public function autoupdate_plugin( $update, $item ) {
|
42 |
-
$autoupdate_plugin_list = Jetpack_Options::get_option( 'autoupdate_plugins', array() );
|
43 |
-
if ( in_array( $item->plugin, $autoupdate_plugin_list ) ) {
|
44 |
-
$this->expect( $item->plugin, 'plugin' );
|
45 |
-
return true;
|
46 |
-
}
|
47 |
-
return $update;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function autoupdate_theme( $update, $item ) {
|
51 |
-
$autoupdate_theme_list = Jetpack_Options::get_option( 'autoupdate_themes', array() );
|
52 |
-
if ( in_array( $item->theme , $autoupdate_theme_list) ) {
|
53 |
-
$this->expect( $item->theme, 'theme' );
|
54 |
-
return true;
|
55 |
-
}
|
56 |
-
return $update;
|
57 |
-
}
|
58 |
-
|
59 |
-
public function autoupdate_core( $update, $item ) {
|
60 |
-
$autoupdate_core = Jetpack_Options::get_option( 'autoupdate_core', false );
|
61 |
-
if ( $autoupdate_core ) {
|
62 |
-
return $autoupdate_core;
|
63 |
-
}
|
64 |
-
return $update;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Stores the an item identifier to the expected array.
|
69 |
-
*
|
70 |
-
* @param string $item Example: 'jetpack/jetpack.php' for type 'plugin' or 'twentyfifteen' for type 'theme'
|
71 |
-
* @param string $type 'plugin' or 'theme'
|
72 |
-
*/
|
73 |
-
private function expect( $item, $type ) {
|
74 |
-
if ( ! isset( $this->expected[ $type ] ) ) {
|
75 |
-
$this->expected[ $type ] = array();
|
76 |
-
}
|
77 |
-
$this->expected[ $type ][] = $item;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* On completion of an automatic update, let's store the results.
|
82 |
-
*
|
83 |
-
* @param $results - Sent by WP_Automatic_Updater after it completes an autoupdate action. Results may be empty.
|
84 |
-
*/
|
85 |
-
public function automatic_updates_complete( $results ) {
|
86 |
-
if ( empty( $this->expected ) ) {
|
87 |
-
return;
|
88 |
-
}
|
89 |
-
$this->results = empty( $results ) ? self::get_possible_failures() : $results;
|
90 |
-
|
91 |
-
add_action( 'shutdown', array( $this, 'bump_stats' ) );
|
92 |
-
|
93 |
-
Jetpack::init();
|
94 |
-
|
95 |
-
$items_to_log = array( 'plugin', 'theme' );
|
96 |
-
foreach( $items_to_log as $items ) {
|
97 |
-
$this->log_items( $items );
|
98 |
-
}
|
99 |
-
|
100 |
-
Jetpack::log( 'autoupdates', $this->get_log() );
|
101 |
-
}
|
102 |
-
|
103 |
-
public function get_log() {
|
104 |
-
return array(
|
105 |
-
'results' => $this->results,
|
106 |
-
'failed' => $this->failed,
|
107 |
-
'success' => $this->success
|
108 |
-
);
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Iterates through expected items ( plugins or themes ) and compares them to actual results.
|
113 |
-
*
|
114 |
-
* @param $items 'plugin' or 'theme'
|
115 |
-
*/
|
116 |
-
private function log_items( $items ) {
|
117 |
-
|
118 |
-
if ( ! isset( $this->expected[ $items ] ) ) {
|
119 |
-
return;
|
120 |
-
}
|
121 |
-
|
122 |
-
$item_results = $this->get_successful_updates( $items );
|
123 |
-
|
124 |
-
if ( is_array( $this->expected[ $items ] ) ) {
|
125 |
-
foreach( $this->expected[ $items ] as $item ) {
|
126 |
-
if ( in_array( $item, $item_results ) ) {
|
127 |
-
$this->success[ $items ][] = $item;
|
128 |
-
} else {
|
129 |
-
$this->failed[ $items ][] = $item;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
public function bump_stats() {
|
136 |
-
$instance = Jetpack::init();
|
137 |
-
$log = array();
|
138 |
-
// Bump numbers
|
139 |
-
if ( ! empty( $this->success['plugin'] ) ) {
|
140 |
-
$instance->stat( 'autoupdates/plugin-success', count( $this->success['plugin'] ) );
|
141 |
-
$log['plugins_success'] = $this->success['plugin'];
|
142 |
-
}
|
143 |
-
|
144 |
-
if ( ! empty( $this->failed['plugin'] ) ) {
|
145 |
-
$instance->stat( 'autoupdates/plugin-fail', count( $this->failed['plugin'] ) );
|
146 |
-
$log['plugins_failed'] = $this->failed['plugin'];
|
147 |
-
}
|
148 |
-
|
149 |
-
if ( ! empty( $this->success['theme'] ) ) {
|
150 |
-
$instance->stat( 'autoupdates/theme-success', count( $this->success['theme'] ) );
|
151 |
-
$log['themes_success'] = $this->success['theme'];
|
152 |
-
}
|
153 |
-
|
154 |
-
if ( ! empty( $this->failed['theme'] ) ) {
|
155 |
-
$instance->stat( 'autoupdates/theme-fail', count( $this->failed['theme'] ) );
|
156 |
-
$log['themes_failed'] = $this->failed['theme'];
|
157 |
-
}
|
158 |
-
|
159 |
-
$instance->do_stats( 'server_side' );
|
160 |
-
|
161 |
-
// Send a more detailed log to logstash
|
162 |
-
if ( ! empty( $log ) ) {
|
163 |
-
Jetpack::load_xml_rpc_client();
|
164 |
-
$xml = new Jetpack_IXR_Client( array(
|
165 |
-
'user_id' => get_current_user_id()
|
166 |
-
) );
|
167 |
-
$log['blog_id'] = Jetpack_Options::get_option( 'id' );
|
168 |
-
$xml->query( 'jetpack.debug_autoupdate', $log );
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Parses the autoupdate results generated by WP_Automatic_Updater and returns a simple array of successful items
|
174 |
-
*
|
175 |
-
* @param string $type 'plugin' or 'theme'
|
176 |
-
*
|
177 |
-
* @return array
|
178 |
-
*/
|
179 |
-
private function get_successful_updates( $type ) {
|
180 |
-
$successful_updates = array();
|
181 |
-
|
182 |
-
if ( ! isset( $this->results[ $type ] ) ) {
|
183 |
-
return $successful_updates;
|
184 |
-
}
|
185 |
-
|
186 |
-
foreach( $this->results[ $type ] as $result ) {
|
187 |
-
if ( $result->result ) {
|
188 |
-
switch( $type ) {
|
189 |
-
case 'theme':
|
190 |
-
$successful_updates[] = $result->item->theme;
|
191 |
-
break;
|
192 |
-
case 'plugin':
|
193 |
-
$successful_updates[] = $result->item->plugin;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
return $successful_updates;
|
199 |
-
}
|
200 |
-
|
201 |
-
static function get_possible_failures() {
|
202 |
-
$result = array();
|
203 |
-
// Lets check some reasons why it might not be working as expected
|
204 |
-
include_once( ABSPATH . '/wp-admin/includes/admin.php' );
|
205 |
-
include_once( ABSPATH . '/wp-admin/includes/class-wp-upgrader.php' );
|
206 |
-
$upgrader = new WP_Automatic_Updater;
|
207 |
-
|
208 |
-
if ( $upgrader->is_disabled() ) {
|
209 |
-
$result[] = 'autoupdates-disabled';
|
210 |
-
}
|
211 |
-
if ( ! is_main_site() ) {
|
212 |
-
$result[] = 'is-not-main-site';
|
213 |
-
}
|
214 |
-
if ( ! is_main_network() ) {
|
215 |
-
$result[] = 'is-not-main-network';
|
216 |
-
}
|
217 |
-
if ( $upgrader->is_vcs_checkout( ABSPATH ) ) {
|
218 |
-
$result[] = 'site-on-vcs';
|
219 |
-
}
|
220 |
-
if ( $upgrader->is_vcs_checkout( WP_PLUGIN_DIR ) ) {
|
221 |
-
$result[] = 'plugin-directory-on-vcs';
|
222 |
-
}
|
223 |
-
if ( $upgrader->is_vcs_checkout( WP_CONTENT_DIR ) ) {
|
224 |
-
$result[] = 'content-directory-on-vcs';
|
225 |
-
}
|
226 |
-
$lock = get_option( 'auto_updater.lock' );
|
227 |
-
if ( $lock > ( time() - HOUR_IN_SECONDS ) ) {
|
228 |
-
$result[] = 'lock-is-set';
|
229 |
-
}
|
230 |
-
$skin = new Automatic_Upgrader_Skin;
|
231 |
-
include_once( ABSPATH . 'wp-admin/includes/file.php' );
|
232 |
-
include_once( ABSPATH . 'wp-admin/includes/template.php' );
|
233 |
-
if ( ! $skin->request_filesystem_credentials( false, ABSPATH, false ) ) {
|
234 |
-
$result[] = 'no-system-write-access';
|
235 |
-
}
|
236 |
-
if ( ! $skin->request_filesystem_credentials( false, WP_PLUGIN_DIR, false ) ) {
|
237 |
-
$result[] = 'no-plugin-directory-write-access';
|
238 |
-
}
|
239 |
-
if ( ! $skin->request_filesystem_credentials( false, WP_CONTENT_DIR, false ) )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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-bbpress-json-api-compat.php
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* bbPress & Jetpack REST API Compatibility
|
4 |
-
* Enables bbPress to work with the Jetpack REST API
|
5 |
-
*/
|
6 |
-
class bbPress_Jetpack_REST_API {
|
7 |
-
|
8 |
-
private static $instance;
|
9 |
-
|
10 |
-
public static function instance() {
|
11 |
-
if ( isset( self::$instance ) )
|
12 |
-
return self::$instance;
|
13 |
-
|
14 |
-
self::$instance = new self;
|
15 |
-
}
|
16 |
-
|
17 |
-
private function __construct() {
|
18 |
-
add_filter( 'rest_api_allowed_post_types', array( $this, 'allow_bbpress_post_types' ) );
|
19 |
-
add_filter( 'bbp_map_meta_caps', array( $this, 'adjust_meta_caps' ), 10, 4 );
|
20 |
-
add_filter( 'rest_api_allowed_public_metadata', array( $this, 'allow_bbpress_public_metadata' ) );
|
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';
|
32 |
-
return $allowed_post_types;
|
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';
|
44 |
-
$allowed_meta_keys[] = '_bbp_forum_type';
|
45 |
-
$allowed_meta_keys[] = '_bbp_forum_subforum_count';
|
46 |
-
$allowed_meta_keys[] = '_bbp_reply_count';
|
47 |
-
$allowed_meta_keys[] = '_bbp_total_reply_count';
|
48 |
-
$allowed_meta_keys[] = '_bbp_topic_count';
|
49 |
-
$allowed_meta_keys[] = '_bbp_total_topic_count';
|
50 |
-
$allowed_meta_keys[] = '_bbp_topic_count_hidden';
|
51 |
-
$allowed_meta_keys[] = '_bbp_last_topic_id';
|
52 |
-
$allowed_meta_keys[] = '_bbp_last_reply_id';
|
53 |
-
$allowed_meta_keys[] = '_bbp_last_active_time';
|
54 |
-
$allowed_meta_keys[] = '_bbp_last_active_id';
|
55 |
-
$allowed_meta_keys[] = '_bbp_sticky_topics';
|
56 |
-
$allowed_meta_keys[] = '_bbp_voice_count';
|
57 |
-
$allowed_meta_keys[] = '_bbp_reply_count_hidden';
|
58 |
-
$allowed_meta_keys[] = '_bbp_anonymous_reply_count';
|
59 |
-
|
60 |
-
return $allowed_meta_keys;
|
61 |
-
}
|
62 |
-
|
63 |
-
function adjust_meta_caps( $caps, $cap, $user_id, $args ) {
|
64 |
-
|
65 |
-
// only run for REST API requests
|
66 |
-
if ( ! defined( 'REST_API_REQUEST' ) || ! REST_API_REQUEST )
|
67 |
-
return $caps;
|
68 |
-
|
69 |
-
// only modify caps for meta caps and for bbPress meta keys
|
70 |
-
if ( ! in_array( $cap, array( 'edit_post_meta', 'delete_post_meta', 'add_post_meta' ) ) || empty( $args[1] ) || false === strpos( $args[1], '_bbp_' ) )
|
71 |
-
return $caps;
|
72 |
-
|
73 |
-
// $args[0] could be a post ID or a post_type string
|
74 |
-
if ( is_int( $args[0] ) ) {
|
75 |
-
$_post = get_post( $args[0] );
|
76 |
-
if ( ! empty( $_post ) ) {
|
77 |
-
$post_type = get_post_type_object( $_post->post_type );
|
78 |
-
}
|
79 |
-
} elseif ( is_string( $args[0] ) ) {
|
80 |
-
$post_type = get_post_type_object( $args[0] );
|
81 |
-
}
|
82 |
-
|
83 |
-
// no post type found, bail
|
84 |
-
if ( empty( $post_type ) )
|
85 |
-
return $caps;
|
86 |
-
|
87 |
-
// reset the needed caps
|
88 |
-
$caps = array();
|
89 |
-
|
90 |
-
// Add 'do_not_allow' cap if user is spam or deleted
|
91 |
-
if ( bbp_is_user_inactive( $user_id ) ) {
|
92 |
-
$caps[] = 'do_not_allow';
|
93 |
-
|
94 |
-
// Moderators can always edit meta
|
95 |
-
} elseif ( user_can( $user_id, 'moderate' ) ) {
|
96 |
-
$caps[] = 'moderate';
|
97 |
-
|
98 |
-
// Unknown so map to edit_posts
|
99 |
-
} else {
|
100 |
-
$caps[] = $post_type->cap->edit_posts;
|
101 |
-
}
|
102 |
-
|
103 |
-
return $caps;
|
104 |
-
}
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
bbPress_Jetpack_REST_API::instance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-cli.php
DELETED
@@ -1,599 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
WP_CLI::add_command( 'jetpack', 'Jetpack_CLI' );
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Control your local Jetpack installation.
|
7 |
-
*/
|
8 |
-
class Jetpack_CLI extends WP_CLI_Command {
|
9 |
-
|
10 |
-
// Aesthetics
|
11 |
-
public $green_open = "\033[32m";
|
12 |
-
public $red_open = "\033[31m";
|
13 |
-
public $yellow_open = "\033[33m";
|
14 |
-
public $color_close = "\033[0m";
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Get Jetpack Details
|
18 |
-
*
|
19 |
-
* ## OPTIONS
|
20 |
-
*
|
21 |
-
* empty: Leave it empty for basic stats
|
22 |
-
*
|
23 |
-
* full: View full stats. It's the data from the heartbeat
|
24 |
-
*
|
25 |
-
* ## EXAMPLES
|
26 |
-
*
|
27 |
-
* wp jetpack status
|
28 |
-
* wp jetpack status full
|
29 |
-
*
|
30 |
-
*/
|
31 |
-
public function status( $args, $assoc_args ) {
|
32 |
-
if ( ! Jetpack::is_active() ) {
|
33 |
-
WP_CLI::error( __( 'Jetpack is not currently connected to WordPress.com', 'jetpack' ) );
|
34 |
-
}
|
35 |
-
|
36 |
-
if ( isset( $args[0] ) && 'full' !== $args[0] ) {
|
37 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $args[0] ) );
|
38 |
-
}
|
39 |
-
|
40 |
-
/*
|
41 |
-
* Are they asking for all data?
|
42 |
-
*
|
43 |
-
* Loop through heartbeat data and organize by priority.
|
44 |
-
*/
|
45 |
-
$all_data = ( isset( $args[0] ) && 'full' == $args[0] ) ? 'full' : false;
|
46 |
-
if ( $all_data ) {
|
47 |
-
WP_CLI::success( __( 'Jetpack is currently connected to WordPress.com', 'jetpack' ) );
|
48 |
-
WP_CLI::line( sprintf( __( "The Jetpack Version is %s", 'jetpack' ), JETPACK__VERSION ) );
|
49 |
-
WP_CLI::line( sprintf( __( "The WordPress.com blog_id is %d", 'jetpack' ), Jetpack_Options::get_option( 'id' ) ) );
|
50 |
-
|
51 |
-
// Heartbeat data
|
52 |
-
WP_CLI::line( "\n" . __( 'Additional data: ', 'jetpack' ) );
|
53 |
-
|
54 |
-
// Get the filtered heartbeat data.
|
55 |
-
// Filtered so we can color/list by severity
|
56 |
-
$stats = Jetpack::jetpack_check_heartbeat_data();
|
57 |
-
|
58 |
-
// Display red flags first
|
59 |
-
foreach ( $stats['bad'] as $stat => $value ) {
|
60 |
-
printf( "$this->red_open%-'.16s %s $this->color_close\n", $stat, $value );
|
61 |
-
}
|
62 |
-
|
63 |
-
// Display caution warnings next
|
64 |
-
foreach ( $stats['caution'] as $stat => $value ) {
|
65 |
-
printf( "$this->yellow_open%-'.16s %s $this->color_close\n", $stat, $value );
|
66 |
-
}
|
67 |
-
|
68 |
-
// The rest of the results are good!
|
69 |
-
foreach ( $stats['good'] as $stat => $value ) {
|
70 |
-
|
71 |
-
// Modules should get special spacing for aestetics
|
72 |
-
if ( strpos( $stat, 'odule-' ) ) {
|
73 |
-
printf( "%-'.30s %s\n", $stat, $value );
|
74 |
-
usleep( 4000 ); // For dramatic effect lolz
|
75 |
-
continue;
|
76 |
-
}
|
77 |
-
printf( "%-'.16s %s\n", $stat, $value );
|
78 |
-
usleep( 4000 ); // For dramatic effect lolz
|
79 |
-
}
|
80 |
-
} else {
|
81 |
-
// Just the basics
|
82 |
-
WP_CLI::success( __( 'Jetpack is currently connected to WordPress.com', 'jetpack' ) );
|
83 |
-
WP_CLI::line( sprintf( __( 'The Jetpack Version is %s', 'jetpack' ), JETPACK__VERSION ) );
|
84 |
-
WP_CLI::line( sprintf( __( 'The WordPress.com blog_id is %d', 'jetpack' ), Jetpack_Options::get_option( 'id' ) ) );
|
85 |
-
WP_CLI::line( "\n" . _x( "View full status with 'wp jetpack status full'", '"wp jetpack status full" is a command - do not translate', 'jetpack' ) );
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Disconnect Jetpack Blogs or Users
|
91 |
-
*
|
92 |
-
* ## OPTIONS
|
93 |
-
*
|
94 |
-
* blog: Disconnect the entire blog.
|
95 |
-
*
|
96 |
-
* user <user_identifier>: Disconnect a specific user from WordPress.com.
|
97 |
-
*
|
98 |
-
* Please note, the primary account that the blog is connected
|
99 |
-
* to WordPress.com with cannot be disconnected without
|
100 |
-
* disconnecting the entire blog.
|
101 |
-
*
|
102 |
-
* ## EXAMPLES
|
103 |
-
*
|
104 |
-
* wp jetpack disconnect blog
|
105 |
-
* wp jetpack disconnect user 13
|
106 |
-
* wp jetpack disconnect user username
|
107 |
-
* wp jetpack disconnect user email@domain.com
|
108 |
-
*
|
109 |
-
* @synopsis <blog|user> [<user_identifier>]
|
110 |
-
*/
|
111 |
-
public function disconnect( $args, $assoc_args ) {
|
112 |
-
if ( ! Jetpack::is_active() ) {
|
113 |
-
WP_CLI::error( __( 'You cannot disconnect, without having first connected.', 'jetpack' ) );
|
114 |
-
}
|
115 |
-
|
116 |
-
$action = isset( $args[0] ) ? $args[0] : 'prompt';
|
117 |
-
if ( ! in_array( $action, array( 'blog', 'user', 'prompt' ) ) ) {
|
118 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
|
119 |
-
}
|
120 |
-
|
121 |
-
if ( in_array( $action, array( 'user' ) ) ) {
|
122 |
-
if ( isset( $args[1] ) ) {
|
123 |
-
$user_id = $args[1];
|
124 |
-
if ( ctype_digit( $user_id ) ) {
|
125 |
-
$field = 'id';
|
126 |
-
$user_id = (int) $user_id;
|
127 |
-
} elseif ( is_email( $user_id ) ) {
|
128 |
-
$field = 'email';
|
129 |
-
$user_id = sanitize_user( $user_id, true );
|
130 |
-
} else {
|
131 |
-
$field = 'login';
|
132 |
-
$user_id = sanitize_user( $user_id, true );
|
133 |
-
}
|
134 |
-
if ( ! $user = get_user_by( $field, $user_id ) ) {
|
135 |
-
WP_CLI::error( __( 'Please specify a valid user.', 'jetpack' ) );
|
136 |
-
}
|
137 |
-
} else {
|
138 |
-
WP_CLI::error( __( 'Please specify a user by either ID, username, or email.', 'jetpack' ) );
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
switch ( $action ) {
|
143 |
-
case 'blog':
|
144 |
-
Jetpack::log( 'disconnect' );
|
145 |
-
Jetpack::disconnect();
|
146 |
-
WP_CLI::success( __( 'Jetpack has been successfully disconnected.', 'jetpack' ) );
|
147 |
-
break;
|
148 |
-
case 'user':
|
149 |
-
if ( Jetpack::unlink_user( $user->ID ) ) {
|
150 |
-
Jetpack::log( 'unlink', $user->ID );
|
151 |
-
WP_CLI::success( sprintf( __( '%s has been successfully disconnected.', 'jetpack' ), $action ) );
|
152 |
-
} else {
|
153 |
-
WP_CLI::error( sprintf( __( '%s could not be disconnected. Are you sure they\'re connected currently?', 'jetpack' ), "{$user->login} <{$user->email}>" ) );
|
154 |
-
}
|
155 |
-
break;
|
156 |
-
case 'prompt':
|
157 |
-
WP_CLI::error( __( 'Please specify if you would like to disconnect a blog or user.', 'jetpack' ) );
|
158 |
-
break;
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Reset Jetpack options and settings to default
|
164 |
-
*
|
165 |
-
* ## OPTIONS
|
166 |
-
*
|
167 |
-
* modules: Resets modules to default state ( get_default_modules() )
|
168 |
-
*
|
169 |
-
* options: Resets all Jetpack options except:
|
170 |
-
* - All private options (Blog token, user token, etc...)
|
171 |
-
* - id (The Client ID/WP.com Blog ID of this site)
|
172 |
-
* - master_user
|
173 |
-
* - version
|
174 |
-
* - activated
|
175 |
-
*
|
176 |
-
* ## EXAMPLES
|
177 |
-
*
|
178 |
-
* wp jetpack reset options
|
179 |
-
* wp jetpack reset modules
|
180 |
-
*
|
181 |
-
* @synopsis <modules|options>
|
182 |
-
*/
|
183 |
-
public function reset( $args, $assoc_args ) {
|
184 |
-
$action = isset( $args[0] ) ? $args[0] : 'prompt';
|
185 |
-
if ( ! in_array( $action, array( 'options', 'modules' ) ) ) {
|
186 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
|
187 |
-
}
|
188 |
-
|
189 |
-
// Are you sure?
|
190 |
-
jetpack_cli_are_you_sure();
|
191 |
-
|
192 |
-
switch ( $action ) {
|
193 |
-
case 'options':
|
194 |
-
$options_to_reset = Jetpack::get_jetpack_options_for_reset();
|
195 |
-
|
196 |
-
// Reset the Jetpack options
|
197 |
-
_e( "Resetting Jetpack Options...\n", "jetpack" );
|
198 |
-
sleep(1); // Take a breath
|
199 |
-
foreach ( $options_to_reset['jp_options'] as $option_to_reset ) {
|
200 |
-
Jetpack_Options::delete_option( $option_to_reset );
|
201 |
-
usleep( 100000 );
|
202 |
-
WP_CLI::success( sprintf( __( '%s option reset', 'jetpack' ), $option_to_reset ) );
|
203 |
-
}
|
204 |
-
|
205 |
-
// Reset the WP options
|
206 |
-
_e( "Resetting the jetpack options stored in wp_options...\n", "jetpack" );
|
207 |
-
usleep( 500000 ); // Take a breath
|
208 |
-
foreach ( $options_to_reset['wp_options'] as $option_to_reset ) {
|
209 |
-
delete_option( $option_to_reset );
|
210 |
-
usleep( 100000 );
|
211 |
-
WP_CLI::success( sprintf( __( '%s option reset', 'jetpack' ), $option_to_reset ) );
|
212 |
-
}
|
213 |
-
|
214 |
-
// Reset to default modules
|
215 |
-
_e( "Resetting default modules...\n", "jetpack" );
|
216 |
-
usleep( 500000 ); // Take a breath
|
217 |
-
$default_modules = Jetpack::get_default_modules();
|
218 |
-
Jetpack_Options::update_option( 'active_modules', $default_modules );
|
219 |
-
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
220 |
-
|
221 |
-
// Jumpstart option is special
|
222 |
-
Jetpack_Options::update_option( 'jumpstart', 'new_connection' );
|
223 |
-
WP_CLI::success( __( 'jumpstart option reset', 'jetpack' ) );
|
224 |
-
break;
|
225 |
-
case 'modules':
|
226 |
-
$default_modules = Jetpack::get_default_modules();
|
227 |
-
Jetpack_Options::update_option( 'active_modules', $default_modules );
|
228 |
-
WP_CLI::success( __( 'Modules reset to default.', 'jetpack' ) );
|
229 |
-
break;
|
230 |
-
case 'prompt':
|
231 |
-
WP_CLI::error( __( 'Please specify if you would like to reset your options, or modules', 'jetpack' ) );
|
232 |
-
break;
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
/**
|
237 |
-
* Manage Jetpack Modules
|
238 |
-
*
|
239 |
-
* ## OPTIONS
|
240 |
-
*
|
241 |
-
* list : View all available modules, and their status.
|
242 |
-
* activate all : Activate all modules
|
243 |
-
* deactivate all: Deactivate all modules
|
244 |
-
*
|
245 |
-
* activate <module_slug> : Activate a module.
|
246 |
-
* deactivate <module_slug> : Deactivate a module.
|
247 |
-
* toggle <module_slug> : Toggle a module on or off.
|
248 |
-
*
|
249 |
-
* ## EXAMPLES
|
250 |
-
*
|
251 |
-
* wp jetpack module list
|
252 |
-
* wp jetpack module activate stats
|
253 |
-
* wp jetpack module deactivate stats
|
254 |
-
* wp jetpack module toggle stats
|
255 |
-
*
|
256 |
-
* wp jetpack module activate all
|
257 |
-
* wp jetpack module deactivate all
|
258 |
-
*
|
259 |
-
* @synopsis <list|activate|deactivate|toggle> [<module_name>]
|
260 |
-
*/
|
261 |
-
public function module( $args, $assoc_args ) {
|
262 |
-
$action = isset( $args[0] ) ? $args[0] : 'list';
|
263 |
-
if ( ! in_array( $action, array( 'list', 'activate', 'deactivate', 'toggle' ) ) ) {
|
264 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
|
265 |
-
}
|
266 |
-
if ( in_array( $action, array( 'activate', 'deactivate', 'toggle' ) ) ) {
|
267 |
-
if ( isset( $args[1] ) ) {
|
268 |
-
$module_slug = $args[1];
|
269 |
-
if ( 'all' !== $module_slug && ! Jetpack::is_module( $module_slug ) ) {
|
270 |
-
WP_CLI::error( sprintf( __( '%s is not a valid module.', 'jetpack' ), $module_slug ) );
|
271 |
-
}
|
272 |
-
if ( 'toggle' == $action ) {
|
273 |
-
$action = Jetpack::is_module_active( $module_slug ) ? 'deactivate' : 'activate';
|
274 |
-
}
|
275 |
-
// Bulk actions
|
276 |
-
if ( 'all' == $args[1] ) {
|
277 |
-
$action = ( 'deactivate' == $action ) ? 'deactivate_all' : 'activate_all';
|
278 |
-
}
|
279 |
-
// VaultPress needs to be handled elsewhere.
|
280 |
-
if ( in_array( $action, array( 'activate', 'deactivate', 'toggle' ) ) && 'vaultpress' == $args[1] ) {
|
281 |
-
WP_CLI::error( sprintf( _x( 'Please visit %s to configure your VaultPress subscription.', '%s is a website', 'jetpack' ), esc_url( 'https://vaultpress.com/jetpack/' ) ) );
|
282 |
-
}
|
283 |
-
} else {
|
284 |
-
WP_CLI::line( __( 'Please specify a valid module.', 'jetpack' ) );
|
285 |
-
$action = 'list';
|
286 |
-
}
|
287 |
-
}
|
288 |
-
switch ( $action ) {
|
289 |
-
case 'list':
|
290 |
-
WP_CLI::line( __( 'Available Modules:', 'jetpack' ) );
|
291 |
-
$modules = Jetpack::get_available_modules();
|
292 |
-
sort( $modules );
|
293 |
-
foreach( $modules as $module_slug ) {
|
294 |
-
if ( 'vaultpress' == $module_slug ) {
|
295 |
-
continue;
|
296 |
-
}
|
297 |
-
$active = Jetpack::is_module_active( $module_slug ) ? __( 'Active', 'jetpack' ) : __( 'Inactive', 'jetpack' );
|
298 |
-
WP_CLI::line( "\t" . str_pad( $module_slug, 24 ) . $active );
|
299 |
-
}
|
300 |
-
break;
|
301 |
-
case 'activate':
|
302 |
-
$module = Jetpack::get_module( $module_slug );
|
303 |
-
Jetpack::log( 'activate', $module_slug );
|
304 |
-
Jetpack::activate_module( $module_slug, false, false );
|
305 |
-
WP_CLI::success( sprintf( __( '%s has been activated.', 'jetpack' ), $module['name'] ) );
|
306 |
-
break;
|
307 |
-
case 'activate_all':
|
308 |
-
$modules = Jetpack::get_available_modules();
|
309 |
-
Jetpack_Options::update_option( 'active_modules', $modules );
|
310 |
-
WP_CLI::success( __( 'All modules activated!', 'jetpack' ) );
|
311 |
-
break;
|
312 |
-
case 'deactivate':
|
313 |
-
$module = Jetpack::get_module( $module_slug );
|
314 |
-
Jetpack::log( 'deactivate', $module_slug );
|
315 |
-
Jetpack::deactivate_module( $module_slug );
|
316 |
-
WP_CLI::success( sprintf( __( '%s has been deactivated.', 'jetpack' ), $module['name'] ) );
|
317 |
-
break;
|
318 |
-
case 'deactivate_all':
|
319 |
-
Jetpack_Options::update_option( 'active_modules', '' );
|
320 |
-
WP_CLI::success( __( 'All modules deactivated!', 'jetpack' ) );
|
321 |
-
break;
|
322 |
-
case 'toggle':
|
323 |
-
// Will never happen, should have been handled above and changed to activate or deactivate.
|
324 |
-
break;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* Manage Protect Settings
|
330 |
-
*
|
331 |
-
* ## OPTIONS
|
332 |
-
*
|
333 |
-
* whitelist: Whitelist an IP address. You can also read or clear the whitelist.
|
334 |
-
*
|
335 |
-
*
|
336 |
-
* ## EXAMPLES
|
337 |
-
*
|
338 |
-
* wp jetpack protect whitelist <ip address>
|
339 |
-
* wp jetpack protect whitelist list
|
340 |
-
* wp jetpack protect whitelist clear
|
341 |
-
*
|
342 |
-
* @synopsis <whitelist> [<ip|ip_low-ip_high|list|clear>]
|
343 |
-
*/
|
344 |
-
public function protect( $args, $assoc_args ) {
|
345 |
-
$action = isset( $args[0] ) ? $args[0] : 'prompt';
|
346 |
-
if ( ! in_array( $action, array( 'whitelist' ) ) ) {
|
347 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
|
348 |
-
}
|
349 |
-
// Check if module is active
|
350 |
-
if ( ! Jetpack::is_module_active( __FUNCTION__ ) ) {
|
351 |
-
WP_CLI::error( sprintf( _x( '%s is not active. You can activate it with "wp jetpack module activate %s"', '"wp jetpack module activate" is a command - do not translate', 'jetpack' ), __FUNCTION__, __FUNCTION__ ) );
|
352 |
-
}
|
353 |
-
if ( in_array( $action, array( 'whitelist' ) ) ) {
|
354 |
-
if ( isset( $args[1] ) ) {
|
355 |
-
$action = 'whitelist';
|
356 |
-
} else {
|
357 |
-
$action = 'prompt';
|
358 |
-
}
|
359 |
-
}
|
360 |
-
switch ( $action ) {
|
361 |
-
case 'whitelist':
|
362 |
-
$whitelist = array();
|
363 |
-
$new_ip = $args[1];
|
364 |
-
$current_whitelist = get_site_option( 'jetpack_protect_whitelist' );
|
365 |
-
|
366 |
-
// Build array of IPs that are already whitelisted.
|
367 |
-
// Re-build manually instead of using jetpack_protect_format_whitelist() so we can easily get
|
368 |
-
// low & high range params for jetpack_protect_ip_address_is_in_range();
|
369 |
-
foreach( $current_whitelist as $whitelisted ) {
|
370 |
-
|
371 |
-
// IP ranges
|
372 |
-
if ( $whitelisted->range ) {
|
373 |
-
|
374 |
-
// Is it already whitelisted?
|
375 |
-
if ( jetpack_protect_ip_address_is_in_range( $new_ip, $whitelisted->range_low, $whitelisted->range_high ) ) {
|
376 |
-
WP_CLI::error( sprintf( __( "%s has already been whitelisted", 'jetpack' ), $new_ip ) );
|
377 |
-
break;
|
378 |
-
}
|
379 |
-
$whitelist[] = $whitelisted->range_low . " - " . $whitelisted->range_high;
|
380 |
-
|
381 |
-
} else { // Individual IPs
|
382 |
-
|
383 |
-
// Check if the IP is already whitelisted (single IP only)
|
384 |
-
if ( $new_ip == $whitelisted->ip_address ) {
|
385 |
-
WP_CLI::error( sprintf( __( "%s has already been whitelisted", 'jetpack' ), $new_ip ) );
|
386 |
-
break;
|
387 |
-
}
|
388 |
-
$whitelist[] = $whitelisted->ip_address;
|
389 |
-
|
390 |
-
}
|
391 |
-
}
|
392 |
-
|
393 |
-
/*
|
394 |
-
* List the whitelist
|
395 |
-
* Done here because it's easier to read the $whitelist array after it's been rebuilt
|
396 |
-
*/
|
397 |
-
if ( isset( $args[1] ) && 'list' == $args[1] ) {
|
398 |
-
if ( ! empty( $whitelist ) ) {
|
399 |
-
WP_CLI::success( __( 'Here are your whitelisted IPs:', 'jetpack' ) );
|
400 |
-
foreach ( $whitelist as $ip ) {
|
401 |
-
WP_CLI::line( "\t" . str_pad( $ip, 24 ) ) ;
|
402 |
-
}
|
403 |
-
} else {
|
404 |
-
WP_CLI::line( __( 'Whitelist is empty.', "jetpack" ) ) ;
|
405 |
-
}
|
406 |
-
break;
|
407 |
-
}
|
408 |
-
|
409 |
-
/*
|
410 |
-
* Clear the whitelist
|
411 |
-
*/
|
412 |
-
if ( isset( $args[1] ) && 'clear' == $args[1] ) {
|
413 |
-
if ( ! empty( $whitelist ) ) {
|
414 |
-
$whitelist = array();
|
415 |
-
jetpack_protect_save_whitelist( $whitelist );
|
416 |
-
WP_CLI::success( __( 'Cleared all whitelisted IPs', 'jetpack' ) );
|
417 |
-
} else {
|
418 |
-
WP_CLI::line( __( 'Whitelist is empty.', "jetpack" ) ) ;
|
419 |
-
}
|
420 |
-
break;
|
421 |
-
}
|
422 |
-
|
423 |
-
// Append new IP to whitelist array
|
424 |
-
array_push( $whitelist, $new_ip );
|
425 |
-
|
426 |
-
// Save whitelist if there are no errors
|
427 |
-
$result = jetpack_protect_save_whitelist( $whitelist );
|
428 |
-
if ( is_wp_error( $result ) ) {
|
429 |
-
WP_CLI::error( __( $result, 'jetpack' ) );
|
430 |
-
}
|
431 |
-
|
432 |
-
WP_CLI::success( sprintf( __( '%s has been whitelisted.', 'jetpack' ), $new_ip ) );
|
433 |
-
break;
|
434 |
-
case 'prompt':
|
435 |
-
WP_CLI::error(
|
436 |
-
__( 'No command found.', 'jetpack' ) . "\n" .
|
437 |
-
__( 'Please enter the IP address you want to whitelist.', 'jetpack' ) . "\n" .
|
438 |
-
_x( 'You can save a range of IPs {low_range}-{high_range}. No spaces allowed. (example: 1.1.1.1-2.2.2.2)', 'Instructions on how to whitelist IP ranges - low_range/high_range should be translated.', 'jetpack' ) . "\n" .
|
439 |
-
_x( "You can also 'list' or 'clear' the whitelist.", "'list' and 'clear' are commands and should not be translated", 'jetpack' ) . "\n"
|
440 |
-
);
|
441 |
-
break;
|
442 |
-
}
|
443 |
-
}
|
444 |
-
|
445 |
-
/**
|
446 |
-
* Manage Jetpack Options
|
447 |
-
*
|
448 |
-
* ## OPTIONS
|
449 |
-
*
|
450 |
-
* list : List all jetpack options and their values
|
451 |
-
* delete : Delete an option
|
452 |
-
* - can only delete options that are white listed.
|
453 |
-
* update : update an option
|
454 |
-
* - can only update option strings
|
455 |
-
* get : get the value of an option
|
456 |
-
*
|
457 |
-
* ## EXAMPLES
|
458 |
-
*
|
459 |
-
* wp jetpack options list
|
460 |
-
* wp jetpack options get <option_name>
|
461 |
-
* wp jetpack options delete <option_name>
|
462 |
-
* wp jetpack options update <option_name> [<option_value>]
|
463 |
-
*
|
464 |
-
* @synopsis <list|get|delete|update> [<option_name>] [<option_value>]
|
465 |
-
*/
|
466 |
-
public function options( $args, $assoc_args ) {
|
467 |
-
$action = isset( $args[0] ) ? $args[0] : 'list';
|
468 |
-
$safe_to_modify = Jetpack::get_jetpack_options_for_reset();
|
469 |
-
|
470 |
-
// Jumpstart is special
|
471 |
-
array_push( $safe_to_modify, 'jumpstart' );
|
472 |
-
|
473 |
-
// Is the option flagged as unsafe?
|
474 |
-
$flagged = ! in_array( $args[1], $safe_to_modify );
|
475 |
-
|
476 |
-
if ( ! in_array( $action, array( 'list', 'get', 'delete', 'update' ) ) ) {
|
477 |
-
WP_CLI::error( sprintf( __( '%s is not a valid command.', 'jetpack' ), $action ) );
|
478 |
-
}
|
479 |
-
|
480 |
-
if ( isset( $args[0] ) ) {
|
481 |
-
if ( 'get' == $args[0] && isset( $args[1] ) ) {
|
482 |
-
$action = 'get';
|
483 |
-
} else if ( 'delete' == $args[0] && isset( $args[1] ) ) {
|
484 |
-
$action = 'delete';
|
485 |
-
} else if ( 'update' == $args[0] && isset( $args[1] ) ) {
|
486 |
-
$action = 'update';
|
487 |
-
} else {
|
488 |
-
$action = 'list';
|
489 |
-
}
|
490 |
-
}
|
491 |
-
|
492 |
-
// Bail if the option isn't found
|
493 |
-
$option = isset( $args[1] ) ? Jetpack_Options::get_option( $args[1] ) : false;
|
494 |
-
if ( isset( $args[1] ) && ! $option && 'update' !== $args[0] ) {
|
495 |
-
WP_CLI::error( __( 'Option not found or is empty. Use "list" to list option names', 'jetpack' ) );
|
496 |
-
}
|
497 |
-
|
498 |
-
// Let's print_r the option if it's an array
|
499 |
-
// Used in the 'get' and 'list' actions
|
500 |
-
$option = is_array( $option ) ? print_r( $option ) : $option;
|
501 |
-
|
502 |
-
switch ( $action ) {
|
503 |
-
case 'get':
|
504 |
-
WP_CLI::success( "\t" . $option );
|
505 |
-
break;
|
506 |
-
case 'delete':
|
507 |
-
jetpack_cli_are_you_sure( $flagged );
|
508 |
-
|
509 |
-
Jetpack_Options::delete_option( $args[1] );
|
510 |
-
WP_CLI::success( sprintf( __( 'Deleted option: %s', 'jetpack' ), $args[1] ) );
|
511 |
-
break;
|
512 |
-
case 'update':
|
513 |
-
jetpack_cli_are_you_sure( $flagged );
|
514 |
-
|
515 |
-
// Updating arrays would get pretty tricky...
|
516 |
-
$value = Jetpack_Options::get_option( $args[1] );
|
517 |
-
if ( $value && is_array( $value ) ) {
|
518 |
-
WP_CLI::error( __( 'Sorry, no updating arrays at this time', 'jetpack' ) );
|
519 |
-
}
|
520 |
-
|
521 |
-
Jetpack_Options::update_option( $args[1], $args[2] );
|
522 |
-
WP_CLI::success( sprintf( _x( 'Updated option: %s to "%s"', 'Updating an option from "this" to "that".', 'jetpack' ), $args[1], $args[2] ) );
|
523 |
-
break;
|
524 |
-
case 'list':
|
525 |
-
$options_compact = Jetpack_Options::get_option_names();
|
526 |
-
$options_non_compact = Jetpack_Options::get_option_names( 'non_compact' );
|
527 |
-
$options_private = Jetpack_Options::get_option_names( 'private' );
|
528 |
-
$options = array_merge( $options_compact, $options_non_compact, $options_private );
|
529 |
-
|
530 |
-
// Table headers
|
531 |
-
WP_CLI::line( "\t" . str_pad( __( 'Option', 'jetpack' ), 30 ) . __( 'Value', 'jetpack' ) );
|
532 |
-
|
533 |
-
// List out the options and their values
|
534 |
-
// Tell them if the value is empty or not
|
535 |
-
// Tell them if it's an array
|
536 |
-
foreach ( $options as $option ) {
|
537 |
-
$value = Jetpack_Options::get_option( $option );
|
538 |
-
if ( ! $value ) {
|
539 |
-
WP_CLI::line( "\t" . str_pad( $option, 30 ) . 'Empty' );
|
540 |
-
continue;
|
541 |
-
}
|
542 |
-
|
543 |
-
if ( ! is_array( $value ) ) {
|
544 |
-
WP_CLI::line( "\t" . str_pad( $option, 30 ) . $value );
|
545 |
-
} else if ( is_array( $value ) ) {
|
546 |
-
WP_CLI::line( "\t" . str_pad( $option, 30 ) . 'Array - Use "get <option>" to read option array.' );
|
547 |
-
}
|
548 |
-
}
|
549 |
-
$option_text = '{' . _x( 'option', 'a variable command that a user can write, provided in the printed instructions', 'jetpack' ) . '}';
|
550 |
-
$value_text = '{' . _x( 'value', 'the value that they want to update the option to', 'jetpack' ) . '}';
|
551 |
-
|
552 |
-
WP_CLI::success(
|
553 |
-
_x( "Above are your options. You may 'get', 'delete', and 'update' them.", "'get', 'delete', and 'update' are commands - do not translate.", 'jetpack' ) . "\n" .
|
554 |
-
str_pad( 'wp jetpack options get', 26 ) . $option_text . "\n" .
|
555 |
-
str_pad( 'wp jetpack options delete', 26 ) . $option_text . "\n" .
|
556 |
-
str_pad( 'wp jetpack options update', 26 ) . "$option_text $value_text" . "\n" .
|
557 |
-
_x( "Type 'wp jetpack options' for more info.", "'wp jetpack options' is a command - do not translate.", 'jetpack' ) . "\n"
|
558 |
-
);
|
559 |
-
break;
|
560 |
-
}
|
561 |
-
}
|
562 |
-
}
|
563 |
-
|
564 |
-
/*
|
565 |
-
* Standard "ask for permission to continue" function.
|
566 |
-
* If action cancelled, ask if they need help.
|
567 |
-
*
|
568 |
-
* Written outside of the class so it's not listed as an executable command w/ 'wp jetpack'
|
569 |
-
*
|
570 |
-
* @param $flagged bool false = normal option | true = flagged by get_jetpack_options_for_reset()
|
571 |
-
* @param $error_msg string (optional)
|
572 |
-
*/
|
573 |
-
function jetpack_cli_are_you_sure( $flagged = false, $error_msg = false ) {
|
574 |
-
$cli = new Jetpack_CLI();
|
575 |
-
|
576 |
-
// Default cancellation message
|
577 |
-
if ( ! $error_msg ) {
|
578 |
-
$error_msg =
|
579 |
-
__( 'Action cancelled. Have a question?', 'jetpack' )
|
580 |
-
. ' '
|
581 |
-
. $cli->green_open
|
582 |
-
. 'jetpack.com/support'
|
583 |
-
. $cli->color_close;
|
584 |
-
}
|
585 |
-
|
586 |
-
if ( ! $flagged ) {
|
587 |
-
$prompt_message = __( 'Are you sure? This cannot be undone. Type "yes" to continue:', '"yes" is a command. Do not translate that.', 'jetpack' );
|
588 |
-
} else {
|
589 |
-
/* translators: Don't translate the word yes here. */
|
590 |
-
$prompt_message = __( 'Are you sure? Modifying this option may disrupt your Jetpack connection. Type "yes" to continue.', 'jetpack' );
|
591 |
-
}
|
592 |
-
|
593 |
-
WP_CLI::line( $prompt_message );
|
594 |
-
$handle = fopen( "php://stdin", "r" );
|
595 |
-
$line = fgets( $handle );
|
596 |
-
if ( 'yes' != trim( $line ) ){
|
597 |
-
WP_CLI::error( $error_msg );
|
598 |
-
}
|
599 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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Server {
|
8 |
-
|
9 |
-
function authorize() {
|
10 |
-
$data = stripslashes_deep( $_GET );
|
11 |
-
$redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : '';
|
12 |
-
|
13 |
-
$jetpack_unique_connection = Jetpack_Options::get_option( 'unique_connection' );
|
14 |
-
// Checking if site has been active/connected previously before recording unique connection
|
15 |
-
if ( ! $jetpack_unique_connection ) {
|
16 |
-
// jetpack_unique_connection option has never been set
|
17 |
-
$jetpack_unique_connection = array(
|
18 |
-
'connected' => 0,
|
19 |
-
'disconnected' => 0,
|
20 |
-
'version' => '3.6.1'
|
21 |
-
);
|
22 |
-
|
23 |
-
update_option( 'jetpack_unique_connection', $jetpack_unique_connection );
|
24 |
-
|
25 |
-
//track unique connection
|
26 |
-
$jetpack = Jetpack::init();
|
27 |
-
|
28 |
-
$jetpack->stat( 'connections', 'unique-connection' );
|
29 |
-
$jetpack->do_stats( 'server_side' );
|
30 |
-
}
|
31 |
-
|
32 |
-
// increment number of times connected
|
33 |
-
$jetpack_unique_connection['connected'] += 1;
|
34 |
-
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
35 |
-
|
36 |
-
do {
|
37 |
-
$jetpack = $this->get_jetpack();
|
38 |
-
$role = $jetpack->translate_current_user_to_role();
|
39 |
-
|
40 |
-
if ( !$role ) {
|
41 |
-
Jetpack::state( 'error', 'no_role' );
|
42 |
-
break;
|
43 |
-
}
|
44 |
-
|
45 |
-
$cap = $jetpack->translate_role_to_cap( $role );
|
46 |
-
if ( !$cap ) {
|
47 |
-
Jetpack::state( 'error', 'no_cap' );
|
48 |
-
break;
|
49 |
-
}
|
50 |
-
|
51 |
-
$this->check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" );
|
52 |
-
|
53 |
-
if ( !empty( $data['error'] ) ) {
|
54 |
-
Jetpack::state( 'error', $data['error'] );
|
55 |
-
break;
|
56 |
-
}
|
57 |
-
|
58 |
-
if ( empty( $data['state'] ) ) {
|
59 |
-
Jetpack::state( 'error', 'no_state' );
|
60 |
-
break;
|
61 |
-
}
|
62 |
-
|
63 |
-
if ( !ctype_digit( $data['state'] ) ) {
|
64 |
-
Jetpack::state( 'error', 'invalid_state' );
|
65 |
-
break;
|
66 |
-
}
|
67 |
-
|
68 |
-
$current_user_id = get_current_user_id();
|
69 |
-
if ( $current_user_id != $data['state'] ) {
|
70 |
-
Jetpack::state( 'error', 'wrong_state' );
|
71 |
-
break;
|
72 |
-
}
|
73 |
-
|
74 |
-
if ( empty( $data['code'] ) ) {
|
75 |
-
Jetpack::state( 'error', 'no_code' );
|
76 |
-
break;
|
77 |
-
}
|
78 |
-
|
79 |
-
$token = $this->get_token( $data );
|
80 |
-
|
81 |
-
if ( is_wp_error( $token ) ) {
|
82 |
-
if ( $error = $token->get_error_code() )
|
83 |
-
Jetpack::state( 'error', $error );
|
84 |
-
else
|
85 |
-
Jetpack::state( 'error', 'invalid_token' );
|
86 |
-
|
87 |
-
Jetpack::state( 'error_description', $token->get_error_message() );
|
88 |
-
|
89 |
-
break;
|
90 |
-
}
|
91 |
-
|
92 |
-
if ( !$token ) {
|
93 |
-
Jetpack::state( 'error', 'no_token' );
|
94 |
-
break;
|
95 |
-
}
|
96 |
-
|
97 |
-
$is_master_user = ! Jetpack::is_active();
|
98 |
-
|
99 |
-
Jetpack::update_user_token( $current_user_id, sprintf( '%s.%d', $token, $current_user_id ), $is_master_user );
|
100 |
-
|
101 |
-
|
102 |
-
if ( $is_master_user ) {
|
103 |
-
Jetpack::state( 'message', 'authorized' );
|
104 |
-
} else {
|
105 |
-
Jetpack::state( 'message', 'linked' );
|
106 |
-
// Don't activate anything since we are just connecting a user.
|
107 |
-
break;
|
108 |
-
}
|
109 |
-
|
110 |
-
if ( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) {
|
111 |
-
Jetpack_Options::delete_option( 'active_modules' );
|
112 |
-
|
113 |
-
Jetpack::activate_default_modules( 999, 1, $active_modules );
|
114 |
-
} else {
|
115 |
-
Jetpack::activate_default_modules();
|
116 |
-
}
|
117 |
-
|
118 |
-
// Sync all registers options and constants
|
119 |
-
/** This action is documented in class.jetpack.php */
|
120 |
-
do_action( 'jetpack_sync_all_registered_options' );
|
121 |
-
|
122 |
-
// Start nonce cleaner
|
123 |
-
wp_clear_scheduled_hook( 'jetpack_clean_nonces' );
|
124 |
-
wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' );
|
125 |
-
} while ( false );
|
126 |
-
|
127 |
-
if ( wp_validate_redirect( $redirect ) ) {
|
128 |
-
$this->wp_safe_redirect( $redirect );
|
129 |
-
} else {
|
130 |
-
$this->wp_safe_redirect( Jetpack::admin_url() );
|
131 |
-
}
|
132 |
-
|
133 |
-
$this->do_exit();
|
134 |
-
}
|
135 |
-
|
136 |
-
public static function deactivate_plugin( $probable_file, $probable_title ) {
|
137 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
138 |
-
if ( is_plugin_active( $probable_file ) ) {
|
139 |
-
deactivate_plugins( $probable_file );
|
140 |
-
return 1;
|
141 |
-
} else {
|
142 |
-
// If the plugin is not in the usual place, try looking through all active plugins.
|
143 |
-
$active_plugins = Jetpack::get_active_plugins();
|
144 |
-
foreach ( $active_plugins as $plugin ) {
|
145 |
-
$data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
|
146 |
-
if ( $data['Name'] == $probable_title ) {
|
147 |
-
deactivate_plugins( $plugin );
|
148 |
-
return 1;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
return 0;
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* @return object|WP_Error
|
158 |
-
*/
|
159 |
-
function get_token( $data ) {
|
160 |
-
$jetpack = $this->get_jetpack();
|
161 |
-
$role = $jetpack->translate_current_user_to_role();
|
162 |
-
|
163 |
-
if ( !$role ) {
|
164 |
-
return new Jetpack_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack' ) );
|
165 |
-
}
|
166 |
-
|
167 |
-
$client_secret = Jetpack_Data::get_access_token();
|
168 |
-
if ( !$client_secret ) {
|
169 |
-
return new Jetpack_Error( 'client_secret', __( 'You need to register your Jetpack before connecting it.', 'jetpack' ) );
|
170 |
-
}
|
171 |
-
|
172 |
-
$redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : '';
|
173 |
-
|
174 |
-
$body = array(
|
175 |
-
'client_id' => Jetpack_Options::get_option( 'id' ),
|
176 |
-
'client_secret' => $client_secret->secret,
|
177 |
-
'grant_type' => 'authorization_code',
|
178 |
-
'code' => $data['code'],
|
179 |
-
'redirect_uri' => add_query_arg( array(
|
180 |
-
'action' => 'authorize',
|
181 |
-
'_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ),
|
182 |
-
'redirect' => $redirect ? urlencode( $redirect ) : false,
|
183 |
-
), menu_page_url( 'jetpack', false ) ),
|
184 |
-
);
|
185 |
-
|
186 |
-
$args = array(
|
187 |
-
'method' => 'POST',
|
188 |
-
'body' => $body,
|
189 |
-
'headers' => array(
|
190 |
-
'Accept' => 'application/json',
|
191 |
-
),
|
192 |
-
);
|
193 |
-
$response = Jetpack_Client::_wp_remote_request( Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'token' ) ), $args );
|
194 |
-
|
195 |
-
if ( is_wp_error( $response ) ) {
|
196 |
-
return new Jetpack_Error( 'token_http_request_failed', $response->get_error_message() );
|
197 |
-
}
|
198 |
-
|
199 |
-
$code = wp_remote_retrieve_response_code( $response );
|
200 |
-
$entity = wp_remote_retrieve_body( $response );
|
201 |
-
|
202 |
-
if ( $entity )
|
203 |
-
$json = json_decode( $entity );
|
204 |
-
else
|
205 |
-
$json = false;
|
206 |
-
|
207 |
-
if ( 200 != $code || !empty( $json->error ) ) {
|
208 |
-
if ( empty( $json->error ) )
|
209 |
-
return new Jetpack_Error( 'unknown', '', $code );
|
210 |
-
|
211 |
-
$error_description = isset( $json->error_description ) ? sprintf( __( 'Error Details: %s', 'jetpack' ), (string) $json->error_description ) : '';
|
212 |
-
|
213 |
-
return new Jetpack_Error( (string) $json->error, $error_description, $code );
|
214 |
-
}
|
215 |
-
|
216 |
-
if ( empty( $json->access_token ) || !is_scalar( $json->access_token ) ) {
|
217 |
-
return new Jetpack_Error( 'access_token', '', $code );
|
218 |
-
}
|
219 |
-
|
220 |
-
if ( empty( $json->token_type ) || 'X_JETPACK' != strtoupper( $json->token_type ) ) {
|
221 |
-
return new Jetpack_Error( 'token_type', '', $code );
|
222 |
-
}
|
223 |
-
|
224 |
-
if ( empty( $json->scope ) ) {
|
225 |
-
return new Jetpack_Error( 'scope', 'No Scope', $code );
|
226 |
-
}
|
227 |
-
@list( $role, $hmac ) = explode( ':', $json->scope );
|
228 |
-
if ( empty( $role ) || empty( $hmac ) ) {
|
229 |
-
return new Jetpack_Error( 'scope', 'Malformed Scope', $code );
|
230 |
-
}
|
231 |
-
if ( $jetpack->sign_role( $role ) !== $json->scope ) {
|
232 |
-
return new Jetpack_Error( 'scope', 'Invalid Scope', $code );
|
233 |
-
}
|
234 |
-
|
235 |
-
if ( !$cap = $jetpack->translate_role_to_cap( $role ) )
|
236 |
-
return new Jetpack_Error( 'scope', 'No Cap', $code );
|
237 |
-
if ( ! current_user_can( $cap ) )
|
238 |
-
return new Jetpack_Error( 'scope', 'current_user_cannot', $code );
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Fires after user has successfully received an auth token.
|
242 |
-
*
|
243 |
-
* @since 3.9.0
|
244 |
-
*/
|
245 |
-
do_action( 'jetpack_user_authorized' );
|
246 |
-
|
247 |
-
return (string) $json->access_token;
|
248 |
-
}
|
249 |
-
|
250 |
-
public function get_jetpack() {
|
251 |
-
return Jetpack::init();
|
252 |
-
}
|
253 |
-
|
254 |
-
public function check_admin_referer( $action ) {
|
255 |
-
return check_admin_referer( $action );
|
256 |
-
}
|
257 |
-
|
258 |
-
public function wp_safe_redirect( $redirect ) {
|
259 |
-
return wp_safe_redirect(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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-client.php
DELETED
@@ -1,287 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Jetpack_Client {
|
4 |
-
const WPCOM_JSON_API_VERSION = '1.1';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Makes an authorized remote request using Jetpack_Signature
|
8 |
-
*
|
9 |
-
* @return array|WP_Error WP HTTP response on success
|
10 |
-
*/
|
11 |
-
public static function remote_request( $args, $body = null ) {
|
12 |
-
$defaults = array(
|
13 |
-
'url' => '',
|
14 |
-
'user_id' => 0,
|
15 |
-
'blog_id' => 0,
|
16 |
-
'auth_location' => JETPACK_CLIENT__AUTH_LOCATION,
|
17 |
-
'method' => 'POST',
|
18 |
-
'timeout' => 10,
|
19 |
-
'redirection' => 0,
|
20 |
-
);
|
21 |
-
|
22 |
-
$args = wp_parse_args( $args, $defaults );
|
23 |
-
|
24 |
-
$args['blog_id'] = (int) $args['blog_id'];
|
25 |
-
|
26 |
-
if ( 'header' != $args['auth_location'] ) {
|
27 |
-
$args['auth_location'] = 'query_string';
|
28 |
-
}
|
29 |
-
|
30 |
-
$token = Jetpack_Data::get_access_token( $args['user_id'] );
|
31 |
-
if ( !$token ) {
|
32 |
-
return new Jetpack_Error( 'missing_token' );
|
33 |
-
}
|
34 |
-
|
35 |
-
$method = strtoupper( $args['method'] );
|
36 |
-
|
37 |
-
$timeout = intval( $args['timeout'] );
|
38 |
-
|
39 |
-
$redirection = $args['redirection'];
|
40 |
-
|
41 |
-
$request = compact( 'method', 'body', 'timeout', 'redirection' );
|
42 |
-
|
43 |
-
@list( $token_key, $secret ) = explode( '.', $token->secret );
|
44 |
-
if ( empty( $token ) || empty( $secret ) ) {
|
45 |
-
return new Jetpack_Error( 'malformed_token' );
|
46 |
-
}
|
47 |
-
|
48 |
-
$token_key = sprintf( '%s:%d:%d', $token_key, JETPACK__API_VERSION, $token->external_user_id );
|
49 |
-
|
50 |
-
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-signature.php';
|
51 |
-
|
52 |
-
$time_diff = (int) Jetpack_Options::get_option( 'time_diff' );
|
53 |
-
$jetpack_signature = new Jetpack_Signature( $token->secret, $time_diff );
|
54 |
-
|
55 |
-
$timestamp = time() + $time_diff;
|
56 |
-
|
57 |
-
if( function_exists( 'wp_generate_password' ) ) {
|
58 |
-
$nonce = wp_generate_password( 10, false );
|
59 |
-
} else {
|
60 |
-
$nonce = substr( sha1( rand( 0, 1000000 ) ), 0, 10);
|
61 |
-
}
|
62 |
-
|
63 |
-
// Kind of annoying. Maybe refactor Jetpack_Signature to handle body-hashing
|
64 |
-
if ( is_null( $body ) ) {
|
65 |
-
$body_hash = '';
|
66 |
-
} else {
|
67 |
-
if ( !is_string( $body ) ) {
|
68 |
-
return new Jetpack_Error( 'invalid_body', 'Body is malformed.' );
|
69 |
-
}
|
70 |
-
$body_hash = jetpack_sha1_base64( $body );
|
71 |
-
}
|
72 |
-
|
73 |
-
$auth = array(
|
74 |
-
'token' => $token_key,
|
75 |
-
'timestamp' => $timestamp,
|
76 |
-
'nonce' => $nonce,
|
77 |
-
'body-hash' => $body_hash,
|
78 |
-
);
|
79 |
-
|
80 |
-
if ( false !== strpos( $args['url'], 'xmlrpc.php' ) ) {
|
81 |
-
$url_args = array(
|
82 |
-
'for' => 'jetpack',
|
83 |
-
'wpcom_blog_id' => Jetpack_Options::get_option( 'id' ),
|
84 |
-
);
|
85 |
-
} else {
|
86 |
-
$url_args = array();
|
87 |
-
}
|
88 |
-
|
89 |
-
if ( 'header' != $args['auth_location'] ) {
|
90 |
-
$url_args += $auth;
|
91 |
-
}
|
92 |
-
|
93 |
-
$url = add_query_arg( urlencode_deep( $url_args ), $args['url'] );
|
94 |
-
$url = Jetpack::fix_url_for_bad_hosts( $url );
|
95 |
-
|
96 |
-
$signature = $jetpack_signature->sign_request( $token_key, $timestamp, $nonce, $body_hash, $method, $url, $body, false );
|
97 |
-
|
98 |
-
if ( !$signature || is_wp_error( $signature ) ) {
|
99 |
-
return $signature;
|
100 |
-
}
|
101 |
-
|
102 |
-
// Send an Authorization header so various caches/proxies do the right thing
|
103 |
-
$auth['signature'] = $signature;
|
104 |
-
$auth['version'] = JETPACK__VERSION;
|
105 |
-
$header_pieces = array();
|
106 |
-
foreach ( $auth as $key => $value ) {
|
107 |
-
$header_pieces[] = sprintf( '%s="%s"', $key, $value );
|
108 |
-
}
|
109 |
-
$request['headers'] = array(
|
110 |
-
'Authorization' => "X_JETPACK " . join( ' ', $header_pieces ),
|
111 |
-
);
|
112 |
-
|
113 |
-
// Make sure we keep the host when we do JETPACK__WPCOM_JSON_API_HOST requests.
|
114 |
-
$host = parse_url( $url, PHP_URL_HOST );
|
115 |
-
if ( $host === JETPACK__WPCOM_JSON_API_HOST ) {
|
116 |
-
$request['headers']['Host'] = 'public-api.wordpress.com';
|
117 |
-
}
|
118 |
-
|
119 |
-
if ( 'header' != $args['auth_location'] ) {
|
120 |
-
$url = add_query_arg( 'signature', urlencode( $signature ), $url );
|
121 |
-
}
|
122 |
-
|
123 |
-
return Jetpack_Client::_wp_remote_request( $url, $request );
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Wrapper for wp_remote_request(). Turns off SSL verification for certain SSL errors.
|
128 |
-
* This is lame, but many, many, many hosts have misconfigured SSL.
|
129 |
-
*
|
130 |
-
* When Jetpack is registered, the jetpack_fallback_no_verify_ssl_certs option is set to the current time if:
|
131 |
-
* 1. a certificate error is found AND
|
132 |
-
* 2. not verifying the certificate works around the problem.
|
133 |
-
*
|
134 |
-
* The option is checked on each request.
|
135 |
-
*
|
136 |
-
* @internal
|
137 |
-
* @see Jetpack::fix_url_for_bad_hosts()
|
138 |
-
*
|
139 |
-
* @return array|WP_Error WP HTTP response on success
|
140 |
-
*/
|
141 |
-
public static function _wp_remote_request( $url, $args, $set_fallback = false ) {
|
142 |
-
/**
|
143 |
-
* SSL verification (`sslverify`) for the JetpackClient remote request
|
144 |
-
* defaults to off, use this filter to force it on.
|
145 |
-
*
|
146 |
-
* Return `true` to ENABLE SSL verification, return `false`
|
147 |
-
* to DISABLE SSL verification.
|
148 |
-
*
|
149 |
-
* @since 3.6.0
|
150 |
-
*
|
151 |
-
* @param bool Whether to force `sslverify` or not.
|
152 |
-
*/
|
153 |
-
if ( apply_filters( 'jetpack_client_verify_ssl_certs', false ) ) {
|
154 |
-
return wp_remote_request( $url, $args );
|
155 |
-
}
|
156 |
-
|
157 |
-
$fallback = Jetpack_Options::get_option( 'fallback_no_verify_ssl_certs' );
|
158 |
-
if ( false === $fallback ) {
|
159 |
-
Jetpack_Options::update_option( 'fallback_no_verify_ssl_certs', 0 );
|
160 |
-
}
|
161 |
-
|
162 |
-
if ( (int) $fallback ) {
|
163 |
-
// We're flagged to fallback
|
164 |
-
$args['sslverify'] = false;
|
165 |
-
}
|
166 |
-
|
167 |
-
$response = wp_remote_request( $url, $args );
|
168 |
-
|
169 |
-
if (
|
170 |
-
!$set_fallback // We're not allowed to set the flag on this request, so whatever happens happens
|
171 |
-
||
|
172 |
-
isset( $args['sslverify'] ) && !$args['sslverify'] // No verification - no point in doing it again
|
173 |
-
||
|
174 |
-
!is_wp_error( $response ) // Let it ride
|
175 |
-
) {
|
176 |
-
Jetpack_Client::set_time_diff( $response, $set_fallback );
|
177 |
-
return $response;
|
178 |
-
}
|
179 |
-
|
180 |
-
// At this point, we're not flagged to fallback and we are allowed to set the flag on this request.
|
181 |
-
|
182 |
-
$message = $response->get_error_message();
|
183 |
-
|
184 |
-
// Is it an SSL Certificate verification error?
|
185 |
-
if (
|
186 |
-
false === strpos( $message, '14090086' ) // OpenSSL SSL3 certificate error
|
187 |
-
&&
|
188 |
-
false === strpos( $message, '1407E086' ) // OpenSSL SSL2 certificate error
|
189 |
-
&&
|
190 |
-
false === strpos( $message, 'error setting certificate verify locations' ) // cURL CA bundle not found
|
191 |
-
&&
|
192 |
-
false === strpos( $message, 'Peer certificate cannot be authenticated with' ) // cURL CURLE_SSL_CACERT: CA bundle found, but not helpful
|
193 |
-
// different versions of curl have different error messages
|
194 |
-
// this string should catch them all
|
195 |
-
&&
|
196 |
-
false === strpos( $message, 'Problem with the SSL CA cert' ) // cURL CURLE_SSL_CACERT_BADFILE: probably access rights
|
197 |
-
) {
|
198 |
-
// No, it is not.
|
199 |
-
return $response;
|
200 |
-
}
|
201 |
-
|
202 |
-
// Redo the request without SSL certificate verification.
|
203 |
-
$args['sslverify'] = false;
|
204 |
-
$response = wp_remote_request( $url, $args );
|
205 |
-
|
206 |
-
if ( !is_wp_error( $response ) ) {
|
207 |
-
// The request went through this time, flag for future fallbacks
|
208 |
-
Jetpack_Options::update_option( 'fallback_no_verify_ssl_certs', time() );
|
209 |
-
Jetpack_Client::set_time_diff( $response, $set_fallback );
|
210 |
-
}
|
211 |
-
|
212 |
-
return $response;
|
213 |
-
}
|
214 |
-
|
215 |
-
public static function set_time_diff( &$response, $force_set = false ) {
|
216 |
-
$code = wp_remote_retrieve_response_code( $response );
|
217 |
-
|
218 |
-
// Only trust the Date header on some responses
|
219 |
-
if ( 200 != $code && 304 != $code && 400 != $code && 401 != $code ) {
|
220 |
-
return;
|
221 |
-
}
|
222 |
-
|
223 |
-
if ( !$date = wp_remote_retrieve_header( $response, 'date' ) ) {
|
224 |
-
return;
|
225 |
-
}
|
226 |
-
|
227 |
-
if ( 0 >= $time = (int) strtotime( $date ) ) {
|
228 |
-
return;
|
229 |
-
}
|
230 |
-
|
231 |
-
$time_diff = $time - time();
|
232 |
-
|
233 |
-
if ( $force_set ) { // during register
|
234 |
-
Jetpack_Options::update_option( 'time_diff', $time_diff );
|
235 |
-
} else { // otherwise
|
236 |
-
$old_diff = Jetpack_Options::get_option( 'time_diff' );
|
237 |
-
if ( false === $old_diff || abs( $time_diff - (int) $old_diff ) > 10 ) {
|
238 |
-
Jetpack_Options::update_option( 'time_diff', $time_diff );
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Query the WordPress.com REST API using the blog token
|
245 |
-
*
|
246 |
-
* @param string $path
|
247 |
-
* @param string $version
|
248 |
-
* @param array $args
|
249 |
-
* @param string $body
|
250 |
-
* @return array|WP_Error $response Data.
|
251 |
-
*/
|
252 |
-
static function wpcom_json_api_request_as_blog( $path, $version = self::WPCOM_JSON_API_VERSION, $args = array(), $body = null ) {
|
253 |
-
$filtered_args = array_intersect_key( $args, array(
|
254 |
-
'method' => 'string',
|
255 |
-
'timeout' => 'int',
|
256 |
-
'redirection' => 'int',
|
257 |
-
) );
|
258 |
-
|
259 |
-
/**
|
260 |
-
* Determines whether Jetpack can send outbound https requests to the WPCOM api.
|
261 |
-
*
|
262 |
-
* @since 3.6.0
|
263 |
-
*
|
264 |
-
* @param bool $proto Defaults to true.
|
265 |
-
*/
|
266 |
-
$proto = apply_filters( 'jetpack_can_make_outbound_https', true ) ? 'https' : 'http';
|
267 |
-
|
268 |
-
// unprecedingslashit
|
269 |
-
$_path = preg_replace( '/^\//', '', $path );
|
270 |
-
|
271 |
-
// Use GET by default whereas `remote_request` uses POST
|
272 |
-
if ( isset( $filtered_args['method'] ) && strtoupper( $filtered_args['method'] === 'POST' ) ) {
|
273 |
-
$request_method = 'POST';
|
274 |
-
} else {
|
275 |
-
$request_method = 'GET';
|
276 |
-
}
|
277 |
-
|
278 |
-
$validated_args = array_merge( $filtered_args, array(
|
279 |
-
'url' => sprintf( '%s://%s/rest/v%s/%s', $proto, JETPACK__WPCOM_JSON_API_HOST, $version, $_path ),
|
280 |
-
'blog_id' => (int) Jetpack_Options::get_option( 'id' ),
|
281 |
-
'method' => $request_method,
|
282 |
-
) );
|
283 |
-
|
284 |
-
return Jetpack_Client::remote_request( $validated_args, $body );
|
285 |
-
}
|
286 |
-
|
287 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-data.php
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Jetpack_Data {
|
4 |
-
/**
|
5 |
-
* Gets locally stored token
|
6 |
-
*
|
7 |
-
* @return object|false
|
8 |
-
*/
|
9 |
-
public static function get_access_token( $user_id = false ) {
|
10 |
-
if ( $user_id ) {
|
11 |
-
if ( !$tokens = Jetpack_Options::get_option( 'user_tokens' ) ) {
|
12 |
-
return false;
|
13 |
-
}
|
14 |
-
if ( $user_id === JETPACK_MASTER_USER ) {
|
15 |
-
if ( !$user_id = Jetpack_Options::get_option( 'master_user' ) ) {
|
16 |
-
return false;
|
17 |
-
}
|
18 |
-
}
|
19 |
-
if ( !isset( $tokens[$user_id] ) || !$token = $tokens[$user_id] ) {
|
20 |
-
return false;
|
21 |
-
}
|
22 |
-
$token_chunks = explode( '.', $token );
|
23 |
-
if ( empty( $token_chunks[1] ) || empty( $token_chunks[2] ) ) {
|
24 |
-
return false;
|
25 |
-
}
|
26 |
-
if ( $user_id != $token_chunks[2] ) {
|
27 |
-
return false;
|
28 |
-
}
|
29 |
-
$token = "{$token_chunks[0]}.{$token_chunks[1]}";
|
30 |
-
} else {
|
31 |
-
$token = Jetpack_Options::get_option( 'blog_token' );
|
32 |
-
if ( empty( $token ) ) {
|
33 |
-
return false;
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
return (object) array(
|
38 |
-
'secret' => $token,
|
39 |
-
'external_user_id' => (int) $user_id,
|
40 |
-
);
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* This function mirrors Jetpack_Data::is_usable_domain() in the WPCOM codebase.
|
45 |
-
*
|
46 |
-
* @param $domain
|
47 |
-
* @param array $extra
|
48 |
-
*
|
49 |
-
* @return bool|WP_Error
|
50 |
-
*/
|
51 |
-
public static function is_usable_domain( $domain, $extra = array() ) {
|
52 |
-
|
53 |
-
// If it's empty, just fail out.
|
54 |
-
if ( ! $domain ) {
|
55 |
-
return new WP_Error( 'fail_domain_empty', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is empty.', 'jetpack' ), $domain ) );
|
56 |
-
}
|
57 |
-
|
58 |
-
// None of the explicit localhosts.
|
59 |
-
$forbidden_domains = array(
|
60 |
-
'wordpress.com',
|
61 |
-
'localhost',
|
62 |
-
'localhost.localdomain',
|
63 |
-
'127.0.0.1',
|
64 |
-
'local.wordpress.dev', // VVV
|
65 |
-
'local.wordpress-trunk.dev', // VVV
|
66 |
-
'src.wordpress-develop.dev', // VVV
|
67 |
-
'build.wordpress-develop.dev', // VVV
|
68 |
-
);
|
69 |
-
if ( in_array( $domain, $forbidden_domains ) ) {
|
70 |
-
return new WP_Error( 'fail_domain_forbidden', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is in the forbidden array.', 'jetpack' ), $domain ) );
|
71 |
-
}
|
72 |
-
|
73 |
-
// No .dev or .local domains
|
74 |
-
if ( preg_match( '#\.(dev|local)$#i', $domain ) ) {
|
75 |
-
return new WP_Error( 'fail_domain_tld', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it uses an invalid top level domain.', 'jetpack' ), $domain ) );
|
76 |
-
}
|
77 |
-
|
78 |
-
// No WPCOM subdomains
|
79 |
-
if ( preg_match( '#\.wordpress\.com$#i', $domain ) ) {
|
80 |
-
return new WP_Error( 'fail_subdomain_wpcom', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as it is a subdomain of WordPress.com.', 'jetpack' ), $domain ) );
|
81 |
-
}
|
82 |
-
|
83 |
-
// If PHP was compiled without support for the Filter module (very edge case)
|
84 |
-
if ( ! function_exists( 'filter_var' ) ) {
|
85 |
-
// Just pass back true for now, and let wpcom sort it out.
|
86 |
-
return true;
|
87 |
-
}
|
88 |
-
|
89 |
-
// Check the IP to make sure it's pingable.
|
90 |
-
$ip = gethostbyname( $domain );
|
91 |
-
|
92 |
-
// Doing this again as I was getting some false positives when gethostbyname() flaked out and returned the domain.
|
93 |
-
$ip = filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ? $ip : gethostbyname( $ip );
|
94 |
-
|
95 |
-
if ( ! filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_IPV4 ) && ! self::php_bug_66229_check( $ip ) ) {
|
96 |
-
return new WP_Error( 'fail_domain_bad_ip_range', sprintf( __( 'Domain `%1$s` just failed is_usable_domain check as its IP `%2$s` is either invalid, or in a reserved or private range.', 'jetpack' ), $domain, $ip ) );
|
97 |
-
}
|
98 |
-
|
99 |
-
return true;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Returns true if the IP address passed in should not be in a reserved range, even if PHP says that it is.
|
104 |
-
* See: https://bugs.php.net/bug.php?id=66229 and https://github.com/php/php-src/commit/d1314893fd1325ca6aa0831101896e31135a2658
|
105 |
-
*
|
106 |
-
* This function mirrors Jetpack_Data::php_bug_66229_check() in the WPCOM codebase.
|
107 |
-
*/
|
108 |
-
public static function php_bug_66229_check( $ip ) {
|
109 |
-
if ( ! filter_var( $ip, FILTER_VALIDATE_IP ) ) {
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
-
$ip_arr = array_map( 'intval', explode( '.', $ip ) );
|
114 |
-
|
115 |
-
if ( 128 == $ip_arr[0] && 0 == $ip_arr[1] ) {
|
116 |
-
return true;
|
117 |
-
}
|
118 |
-
|
119 |
-
if ( 191 == $ip_arr[0] && 255 == $ip_arr[1] ) {
|
120 |
-
return true;
|
121 |
-
}
|
122 |
-
|
123 |
-
return false;
|
124 |
-
}
|
125 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-debugger.php
DELETED
@@ -1,434 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Jetpack_Debugger {
|
4 |
-
|
5 |
-
private static function is_jetpack_support_open() {
|
6 |
-
try {
|
7 |
-
$response = wp_remote_request( "http://jetpack.com/is-support-open" );
|
8 |
-
$body = wp_remote_retrieve_body( $response );
|
9 |
-
$json = json_decode( $body );
|
10 |
-
return ( ( bool ) $json->is_support_open );
|
11 |
-
}
|
12 |
-
catch ( Exception $e ) {
|
13 |
-
return true;
|
14 |
-
}
|
15 |
-
}
|
16 |
-
|
17 |
-
public static function jetpack_increase_timeout() {
|
18 |
-
return 30; // seconds
|
19 |
-
}
|
20 |
-
|
21 |
-
public static function jetpack_debug_display_handler() {
|
22 |
-
if ( ! current_user_can( 'manage_options' ) )
|
23 |
-
wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) );
|
24 |
-
|
25 |
-
$current_user = wp_get_current_user();
|
26 |
-
|
27 |
-
$user_id = get_current_user_id();
|
28 |
-
$user_tokens = Jetpack_Options::get_option( 'user_tokens' );
|
29 |
-
if ( is_array( $user_tokens ) && array_key_exists( $user_id, $user_tokens ) ) {
|
30 |
-
$user_token = $user_tokens[$user_id];
|
31 |
-
} else {
|
32 |
-
$user_token = '[this user has no token]';
|
33 |
-
}
|
34 |
-
unset( $user_tokens );
|
35 |
-
|
36 |
-
$debug_info = "\r\n";
|
37 |
-
foreach ( array(
|
38 |
-
'CLIENT_ID' => 'id',
|
39 |
-
'BLOG_TOKEN' => 'blog_token',
|
40 |
-
'MASTER_USER' => 'master_user',
|
41 |
-
'CERT' => 'fallback_no_verify_ssl_certs',
|
42 |
-
'TIME_DIFF' => 'time_diff',
|
43 |
-
'VERSION' => 'version',
|
44 |
-
'OLD_VERSION' => 'old_version',
|
45 |
-
'PUBLIC' => 'public',
|
46 |
-
) as $label => $option_name ) {
|
47 |
-
$debug_info .= "\r\n" . esc_html( $label . ": " . Jetpack_Options::get_option( $option_name ) );
|
48 |
-
}
|
49 |
-
|
50 |
-
$debug_info .= "\r\n" . esc_html( "USER_ID: " . $user_id );
|
51 |
-
$debug_info .= "\r\n" . esc_html( "USER_TOKEN: " . $user_token );
|
52 |
-
$debug_info .= "\r\n" . esc_html( "PHP_VERSION: " . PHP_VERSION );
|
53 |
-
$debug_info .= "\r\n" . esc_html( "WORDPRESS_VERSION: " . $GLOBALS['wp_version'] );
|
54 |
-
$debug_info .= "\r\n" . esc_html( "JETPACK__VERSION: " . JETPACK__VERSION );
|
55 |
-
$debug_info .= "\r\n" . esc_html( "JETPACK__PLUGIN_DIR: " . JETPACK__PLUGIN_DIR );
|
56 |
-
$debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
|
57 |
-
$debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
|
58 |
-
$debug_info .= "\r\n" . esc_html( "SERVER_PORT: " . $_SERVER['SERVER_PORT'] );
|
59 |
-
|
60 |
-
|
61 |
-
foreach ( array (
|
62 |
-
'GD_PHP_HANDLER',
|
63 |
-
'HTTP_AKAMAI_ORIGIN_HOP',
|
64 |
-
'HTTP_CF_CONNECTING_IP',
|
65 |
-
'HTTP_CLIENT_IP',
|
66 |
-
'HTTP_FASTLY_CLIENT_IP',
|
67 |
-
'HTTP_FORWARDED',
|
68 |
-
'HTTP_FORWARDED_FOR',
|
69 |
-
'HTTP_INCAP_CLIENT_IP',
|
70 |
-
'HTTP_TRUE_CLIENT_IP',
|
71 |
-
'HTTP_X_CLIENTIP',
|
72 |
-
'HTTP_X_CLUSTER_CLIENT_IP',
|
73 |
-
'HTTP_X_FORWARDED',
|
74 |
-
'HTTP_X_FORWARDED_FOR',
|
75 |
-
'HTTP_X_IP_TRAIL',
|
76 |
-
'HTTP_X_REAL_IP',
|
77 |
-
'HTTP_X_VARNISH',
|
78 |
-
'REMOTE_ADDR'
|
79 |
-
) as $header ) {
|
80 |
-
if( isset( $_SERVER[$header] ) ) {
|
81 |
-
$debug_info .= "\r\n" . esc_html( 'IP HEADER: '.$header . ": " . $_SERVER[$header] );
|
82 |
-
} else {
|
83 |
-
$debug_info .= "\r\n" . esc_html( 'IP HEADER: '.$header . ": Not Set" );
|
84 |
-
}
|
85 |
-
}
|
86 |
-
|
87 |
-
|
88 |
-
$debug_info .= "\r\n" . esc_html( "PROTECT_TRUSTED_HEADER: " . json_encode(get_site_option( 'trusted_ip_header' )));
|
89 |
-
|
90 |
-
$debug_info .= "\r\n\r\nTEST RESULTS:\r\n\r\n";
|
91 |
-
$debug_raw_info = '';
|
92 |
-
|
93 |
-
|
94 |
-
$tests = array();
|
95 |
-
|
96 |
-
$tests['HTTP']['result'] = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
|
97 |
-
$tests['HTTP']['fail_message'] = esc_html__( 'Your site isn’t reaching the Jetpack servers.', 'jetpack' );
|
98 |
-
|
99 |
-
$tests['HTTPS']['result'] = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
|
100 |
-
$tests['HTTPS']['fail_message'] = esc_html__( 'Your site isn’t securely reaching the Jetpack servers.', 'jetpack' );
|
101 |
-
|
102 |
-
$identity_crisis_message = '';
|
103 |
-
if ( $identity_crisis = Jetpack::check_identity_crisis( true ) ) {
|
104 |
-
foreach( $identity_crisis as $key => $value ) {
|
105 |
-
$identity_crisis_message .= sprintf( __( 'Your `%1$s` option is set up as `%2$s`, but your WordPress.com connection lists it as `%3$s`!', 'jetpack' ), $key, (string) get_option( $key ), $value ) . "\r\n";
|
106 |
-
}
|
107 |
-
$identity_crisis = new WP_Error( 'identity-crisis', $identity_crisis_message, $identity_crisis );
|
108 |
-
} else {
|
109 |
-
$identity_crisis = 'PASS';
|
110 |
-
}
|
111 |
-
$tests['IDENTITY_CRISIS']['result'] = $identity_crisis;
|
112 |
-
$tests['IDENTITY_CRISIS']['fail_message'] = esc_html__( 'Something has gotten mixed up in your Jetpack Connection!', 'jetpack' );
|
113 |
-
|
114 |
-
$self_xml_rpc_url = home_url( 'xmlrpc.php' );
|
115 |
-
|
116 |
-
$testsite_url = Jetpack::fix_url_for_bad_hosts( JETPACK__API_BASE . 'testsite/1/?url=' );
|
117 |
-
|
118 |
-
add_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
|
119 |
-
|
120 |
-
$tests['SELF']['result'] = wp_remote_get( $testsite_url . $self_xml_rpc_url );
|
121 |
-
$tests['SELF']['fail_message'] = esc_html__( 'It looks like your site can not communicate properly with Jetpack.', 'jetpack' );
|
122 |
-
|
123 |
-
remove_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
|
124 |
-
|
125 |
-
?>
|
126 |
-
<div class="wrap">
|
127 |
-
<h2><?php esc_html_e( 'Jetpack Debugging Center', 'jetpack' ); ?></h2>
|
128 |
-
<h3><?php _e( "Testing your site's compatibility with Jetpack...", 'jetpack' ); ?></h3>
|
129 |
-
<div class="jetpack-debug-test-container">
|
130 |
-
<?php
|
131 |
-
ob_start();
|
132 |
-
foreach ( $tests as $test_name => $test_info ) :
|
133 |
-
if ( 'PASS' !== $test_info['result'] && ( is_wp_error( $test_info['result'] ) ||
|
134 |
-
false == ( $response_code = wp_remote_retrieve_response_code( $test_info['result'] ) ) ||
|
135 |
-
'200' != $response_code ) ) {
|
136 |
-
$debug_info .= $test_name . ": FAIL\r\n";
|
137 |
-
?>
|
138 |
-
<div class="jetpack-test-error">
|
139 |
-
<p>
|
140 |
-
<a class="jetpack-test-heading" href="#"><?php echo $test_info['fail_message']; ?>
|
141 |
-
<span class="noticon noticon-collapse"></span>
|
142 |
-
</a>
|
143 |
-
</p>
|
144 |
-
<pre class="jetpack-test-details"><?php echo esc_html( $test_name ); ?>:
|
145 |
-
<?php echo esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) ); ?></pre>
|
146 |
-
</div><?php
|
147 |
-
} else {
|
148 |
-
$debug_info .= $test_name . ": PASS\r\n";
|
149 |
-
}
|
150 |
-
$debug_raw_info .= "\r\n\r\n" . $test_name . "\r\n" . esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) );
|
151 |
-
?>
|
152 |
-
<?php endforeach;
|
153 |
-
$html = ob_get_clean();
|
154 |
-
|
155 |
-
if ( '' == trim( $html ) ) {
|
156 |
-
echo '<div class="jetpack-tests-succed">' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '</div>';
|
157 |
-
}
|
158 |
-
else {
|
159 |
-
echo '<h3>' . esc_html__( 'There seems to be a problem with your site’s ability to communicate with Jetpack!', 'jetpack' ) . '</h3>';
|
160 |
-
echo $html;
|
161 |
-
}
|
162 |
-
$debug_info .= "\r\n\r\nRAW TEST RESULTS:" . $debug_raw_info ."\r\n";
|
163 |
-
?>
|
164 |
-
</div>
|
165 |
-
<div class="entry-content">
|
166 |
-
<h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
|
167 |
-
<h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
|
168 |
-
<ol>
|
169 |
-
<li><b><em><?php esc_html_e( 'A known issue.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Some themes and plugins have <a href="%1$s">known conflicts</a> with Jetpack – check the <a href="%2$s">list</a>. (You can also browse the <a href="%3$s">Jetpack support pages</a> or <a href="%4$s">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ), 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.com/support/', 'http://wordpress.org/support/plugin/jetpack' ); ?></li>
|
170 |
-
<li><b><em><?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?></em></b> <?php esc_html_e( "Find out by disabling all plugins except Jetpack. If the problem persists, it's not a plugin issue. If the problem is solved, turn your plugins on one by one until the problem pops up again – there's the culprit! Let us know, and we'll try to help.", 'jetpack' ); ?></li>
|
171 |
-
<li>
|
172 |
-
<b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b>
|
173 |
-
<?php
|
174 |
-
$default_theme = wp_get_theme( WP_DEFAULT_THEME );
|
175 |
-
|
176 |
-
if ( $default_theme->exists() ) {
|
177 |
-
echo esc_html( sprintf( __( "If your problem isn't known or caused by a plugin, try activating %s (the default WordPress theme).", 'jetpack' ), $default_theme->get( 'Name' ) ) );
|
178 |
-
} else {
|
179 |
-
esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' );
|
180 |
-
}
|
181 |
-
?>
|
182 |
-
<?php esc_html_e( "If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?>
|
183 |
-
</li>
|
184 |
-
<li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?>
|
185 |
-
<ul>
|
186 |
-
<li>- <?php esc_html_e( "If it's not by itself, a theme or plugin is displaying extra characters. Try steps 2 and 3.", 'jetpack' ); ?></li>
|
187 |
-
<li>- <?php esc_html_e( "If you get a 404 message, contact your web host. Their security may block XMLRPC.", 'jetpack' ); ?></li>
|
188 |
-
</ul>
|
189 |
-
</li>
|
190 |
-
</ol>
|
191 |
-
<?php if ( self::is_jetpack_support_open() ): ?>
|
192 |
-
<p class="jetpack-show-contact-form"><?php echo sprintf( __( 'If none of these help you find a solution, <a href="%s">click here to contact Jetpack support</a>. Tell us as much as you can about the issue and what steps you\'ve tried to resolve it, and one of our Happiness Engineers will be in touch to help.', 'jetpack' ), Jetpack::admin_url( array( 'page' => 'jetpack-debugger', 'contact' => true ) ) ); ?>
|
193 |
-
</p>
|
194 |
-
<?php endif; ?>
|
195 |
-
<?php if ( Jetpack::is_active() ) : ?>
|
196 |
-
<hr />
|
197 |
-
<div id="connected-user-details">
|
198 |
-
<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>
|
199 |
-
</div>
|
200 |
-
<hr />
|
201 |
-
<div id="sync-related-posts">
|
202 |
-
<p><?php echo esc_html__( 'Some features of Jetpack use the WordPress.com infrastructure and require that your public content be mirrored there. If you see intermittent issues only affecting certain posts, please try requesting a reindex of your posts.', 'jetpack' ); ?></p>
|
203 |
-
<?php echo Jetpack::init()->sync->reindex_ui() ?>
|
204 |
-
</div>
|
205 |
-
<?php endif; ?>
|
206 |
-
</div>
|
207 |
-
<div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
|
208 |
-
<?php if ( self::is_jetpack_support_open() ): ?>
|
209 |
-
<form id="contactme" method="post" action="http://jetpack.com/contact-support/">
|
210 |
-
<input type="hidden" name="action" value="submit">
|
211 |
-
<input type="hidden" name="jetpack" value="needs-service">
|
212 |
-
|
213 |
-
<input type="hidden" name="contact_form" id="contact_form" value="1">
|
214 |
-
<input type="hidden" name="blog_url" id="blog_url" value="<?php echo esc_attr( site_url() ); ?>">
|
215 |
-
<?php
|
216 |
-
$subject_line = sprintf(
|
217 |
-
/* translators: %s is the URL of the site */
|
218 |
-
_x( 'from: %s Jetpack contact form', 'Support request email subject line', 'jetpack' ),
|
219 |
-
esc_attr( site_url() )
|
220 |
-
);
|
221 |
-
|
222 |
-
if ( Jetpack::is_development_version() ) {
|
223 |
-
$subject_line = 'BETA ' . $subject_line;
|
224 |
-
}
|
225 |
-
|
226 |
-
$subject_line_input = printf(
|
227 |
-
'<input type="hidden" name="subject" id="subject" value="%s"">',
|
228 |
-
$subject_line
|
229 |
-
);
|
230 |
-
?>
|
231 |
-
<div class="formbox">
|
232 |
-
<label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
|
233 |
-
<textarea name="message" cols="40" rows="7" id="did"></textarea>
|
234 |
-
</div>
|
235 |
-
|
236 |
-
<div id="name_div" class="formbox">
|
237 |
-
<label class="h" for="your_name"><?php esc_html_e( 'Name', 'jetpack' ); ?></label>
|
238 |
-
<span class="errormsg"><?php esc_html_e( 'Let us know your name.', 'jetpack' ); ?></span>
|
239 |
-
<input name="your_name" type="text" id="your_name" value="<?php esc_html_e( $current_user->display_name, 'jetpack'); ?>" size="40">
|
240 |
-
</div>
|
241 |
-
|
242 |
-
<div id="email_div" class="formbox">
|
243 |
-
<label class="h" for="your_email"><?php esc_html_e( 'E-mail', 'jetpack' ); ?></label>
|
244 |
-
<span class="errormsg"><?php esc_html_e( 'Use a valid email address.', 'jetpack' ); ?></span>
|
245 |
-
<input name="your_email" type="text" id="your_email" value="<?php esc_html_e( $current_user->user_email, 'jetpack'); ?>" size="40">
|
246 |
-
</div>
|
247 |
-
|
248 |
-
<div id="toggle_debug_info" class="formbox">
|
249 |
-
<p><?php _e( 'The test results and some other useful debug information will be sent to the support team. Please feel free to <a href="#">review/modify</a> this information.', 'jetpack' ); ?></p>
|
250 |
-
</div>
|
251 |
-
|
252 |
-
<div id="debug_info_div" class="formbox" style="display:none">
|
253 |
-
<label class="h" for="debug_info"><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></label>
|
254 |
-
<textarea name="debug_info" cols="40" rows="7" id="debug_info"><?php echo esc_attr( $debug_info ); ?></textarea>
|
255 |
-
</div>
|
256 |
-
|
257 |
-
<div style="clear: both;"></div>
|
258 |
-
|
259 |
-
<div id="blog_div" class="formbox">
|
260 |
-
<div id="submit_div" class="contact-support">
|
261 |
-
<input type="submit" name="submit" value="<?php esc_html_e( 'Submit »', 'jetpack' ); ?>">
|
262 |
-
</div>
|
263 |
-
</div>
|
264 |
-
<div style="clear: both;"></div>
|
265 |
-
</form>
|
266 |
-
<?php endif; ?>
|
267 |
-
</div>
|
268 |
-
</div>
|
269 |
-
<?php
|
270 |
-
}
|
271 |
-
|
272 |
-
public static function jetpack_debug_admin_head() {
|
273 |
-
?>
|
274 |
-
<style type="text/css">
|
275 |
-
|
276 |
-
.jetpack-debug-test-container {
|
277 |
-
margin-top: 20px;
|
278 |
-
margin-bottom: 30px;
|
279 |
-
}
|
280 |
-
|
281 |
-
.jetpack-tests-succed {
|
282 |
-
font-size: large;
|
283 |
-
color: #8BAB3E;
|
284 |
-
}
|
285 |
-
|
286 |
-
.jetpack-test-details {
|
287 |
-
margin: 4px 6px;
|
288 |
-
padding: 10px;
|
289 |
-
overflow: auto;
|
290 |
-
display: none;
|
291 |
-
}
|
292 |
-
|
293 |
-
.jetpack-test-error {
|
294 |
-
margin-bottom: 10px;
|
295 |
-
background: #FFEBE8;
|
296 |
-
border: solid 1px #C00;
|
297 |
-
border-radius: 3px;
|
298 |
-
}
|
299 |
-
|
300 |
-
.jetpack-test-error p {
|
301 |
-
margin: 0;
|
302 |
-
padding: 0;
|
303 |
-
}
|
304 |
-
|
305 |
-
.jetpack-test-error a.jetpack-test-heading {
|
306 |
-
padding: 4px 6px;
|
307 |
-
display: block;
|
308 |
-
text-decoration: none;
|
309 |
-
color: inherit;
|
310 |
-
}
|
311 |
-
|
312 |
-
.jetpack-test-error .noticon {
|
313 |
-
float: right;
|
314 |
-
}
|
315 |
-
|
316 |
-
form#contactme {
|
317 |
-
border: 1px solid #dfdfdf;
|
318 |
-
background: #eaf3fa;
|
319 |
-
padding: 20px;
|
320 |
-
margin: 10px;
|
321 |
-
background-color: #eaf3fa;
|
322 |
-
border-radius: 5px;
|
323 |
-
font-size: 15px;
|
324 |
-
font-family: "Open Sans", "Helvetica Neue", sans-serif;
|
325 |
-
}
|
326 |
-
|
327 |
-
form#contactme label.h {
|
328 |
-
color: #444;
|
329 |
-
display: block;
|
330 |
-
font-weight: bold;
|
331 |
-
margin: 0 0 7px 10px;
|
332 |
-
text-shadow: 1px 1px 0 #fff;
|
333 |
-
}
|
334 |
-
|
335 |
-
.formbox {
|
336 |
-
margin: 0 0 25px 0;
|
337 |
-
}
|
338 |
-
|
339 |
-
.formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea {
|
340 |
-
border: 1px solid #e5e5e5;
|
341 |
-
border-radius: 11px;
|
342 |
-
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
|
343 |
-
color: #666;
|
344 |
-
font-size: 14px;
|
345 |
-
padding: 10px;
|
346 |
-
width: 97%;
|
347 |
-
}
|
348 |
-
.formbox .contact-support input[type="submit"] {
|
349 |
-
float: right;
|
350 |
-
margin: 0 !important;
|
351 |
-
border-radius: 20px !important;
|
352 |
-
cursor: pointer;
|
353 |
-
font-size: 13pt !important;
|
354 |
-
height: auto !important;
|
355 |
-
margin: 0 0 2em 10px !important;
|
356 |
-
padding: 8px 16px !important;
|
357 |
-
background-color: #ddd;
|
358 |
-
border: 1px solid rgba(0,0,0,0.05);
|
359 |
-
border-top-color: rgba(255,255,255,0.1);
|
360 |
-
border-bottom-color: rgba(0,0,0,0.15);
|
361 |
-
color: #333;
|
362 |
-
font-weight: 400;
|
363 |
-
display: inline-block;
|
364 |
-
text-align: center;
|
365 |
-
text-decoration: none;
|
366 |
-
}
|
367 |
-
|
368 |
-
.formbox span.errormsg {
|
369 |
-
margin: 0 0 10px 10px;
|
370 |
-
color: #d00;
|
371 |
-
display: none;
|
372 |
-
}
|
373 |
-
|
374 |
-
.formbox.error span.errormsg {
|
375 |
-
display: block;
|
376 |
-
}
|
377 |
-
|
378 |
-
#contact-message ul {
|
379 |
-
margin: 0 0 20px 10px;
|
380 |
-
}
|
381 |
-
|
382 |
-
#contact-message li {
|
383 |
-
margin: 0 0 10px 10px;
|
384 |
-
list-style: disc;
|
385 |
-
display: list-item;
|
386 |
-
}
|
387 |
-
|
388 |
-
</style>
|
389 |
-
<script type="text/javascript">
|
390 |
-
jQuery( document ).ready( function($) {
|
391 |
-
|
392 |
-
$('#debug_info').prepend('jQuery version: ' + jQuery.fn.jquery + "\r\n");
|
393 |
-
|
394 |
-
$( '.jetpack-test-error .jetpack-test-heading' ).on( 'click', function() {
|
395 |
-
$( this ).parents( '.jetpack-test-error' ).find( '.jetpack-test-details' ).slideToggle();
|
396 |
-
return false;
|
397 |
-
} );
|
398 |
-
|
399 |
-
$( '.jetpack-show-contact-form a' ).on( 'click', function() {
|
400 |
-
$('#contact-message').slideToggle();
|
401 |
-
return false;
|
402 |
-
} );
|
403 |
-
|
404 |
-
$( '#toggle_debug_info a' ).on( 'click', function() {
|
405 |
-
$('#debug_info_div').slideToggle();
|
406 |
-
return false;
|
407 |
-
} );
|
408 |
-
|
409 |
-
$('form#contactme').on("submit", function(e){
|
410 |
-
var form = $(this);
|
411 |
-
var message = form.find('#did');
|
412 |
-
var name = form.find('#your_name');
|
413 |
-
var email = form.find('#your_email')
|
414 |
-
var validation_error = false;
|
415 |
-
if( !name.val() ) {
|
416 |
-
name.parents('.formbox').addClass('error');
|
417 |
-
validation_error = true;
|
418 |
-
}
|
419 |
-
if( !email.val() ) {
|
420 |
-
email.parents('.formbox').addClass('error');
|
421 |
-
validation_error = true;
|
422 |
-
}
|
423 |
-
if ( validation_error ) {
|
424 |
-
return false;
|
425 |
-
}
|
426 |
-
message.val(message.val() + "\r\n\r\n----------------------------------------------\r\n\r\nDEBUG INFO:\r\n" + $('#debug_info').val() );
|
427 |
-
return true;
|
428 |
-
});
|
429 |
-
|
430 |
-
} );
|
431 |
-
</script>
|
432 |
-
<?php
|
433 |
-
}
|
434 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
2 |
-
|
3 |
-
class Jetpack_Heartbeat {
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Holds the singleton instance of this class
|
7 |
-
*
|
8 |
-
* @since 2.3.3
|
9 |
-
* @var Jetpack_Heartbeat
|
10 |
-
*/
|
11 |
-
private static $instance = false;
|
12 |
-
|
13 |
-
private $cron_name = 'jetpack_v2_heartbeat';
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Singleton
|
17 |
-
*
|
18 |
-
* @since 2.3.3
|
19 |
-
* @static
|
20 |
-
* @return Jetpack_Heartbeat
|
21 |
-
*/
|
22 |
-
public static function init() {
|
23 |
-
if ( ! self::$instance ) {
|
24 |
-
self::$instance = new Jetpack_Heartbeat;
|
25 |
-
}
|
26 |
-
|
27 |
-
return self::$instance;
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Constructor for singleton
|
32 |
-
*
|
33 |
-
* @since 2.3.3
|
34 |
-
* @return Jetpack_Heartbeat
|
35 |
-
*/
|
36 |
-
private function __construct() {
|
37 |
-
if ( ! Jetpack::is_active() )
|
38 |
-
return;
|
39 |
-
|
40 |
-
// Schedule the task
|
41 |
-
add_action( $this->cron_name, array( $this, 'cron_exec' ) );
|
42 |
-
|
43 |
-
if ( ! wp_next_scheduled( $this->cron_name ) ) {
|
44 |
-
// Deal with the old pre-3.0 weekly one.
|
45 |
-
if ( $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ) ) {
|
46 |
-
wp_unschedule_event( $timestamp, 'jetpack_heartbeat' );
|
47 |
-
}
|
48 |
-
|
49 |
-
wp_schedule_event( time(), 'daily', $this->cron_name );
|
50 |
-
}
|
51 |
-
|
52 |
-
add_filter( 'jetpack_xmlrpc_methods', array( __CLASS__, 'jetpack_xmlrpc_methods' ) );
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Method that gets executed on the wp-cron call
|
57 |
-
*
|
58 |
-
* @since 2.3.3
|
59 |
-
* @global string $wp_version
|
60 |
-
*/
|
61 |
-
public function cron_exec() {
|
62 |
-
|
63 |
-
$jetpack = Jetpack::init();
|
64 |
-
|
65 |
-
/*
|
66 |
-
* This should run daily. Figuring in for variances in
|
67 |
-
* WP_CRON, don't let it run more than every 23 hours at most.
|
68 |
-
*
|
69 |
-
* i.e. if it ran less than 23 hours ago, fail out.
|
70 |
-
*/
|
71 |
-
$last = (int) Jetpack_Options::get_option( 'last_heartbeat' );
|
72 |
-
if ( $last && ( $last + DAY_IN_SECONDS - HOUR_IN_SECONDS > time() ) ) {
|
73 |
-
return;
|
74 |
-
}
|
75 |
-
|
76 |
-
/*
|
77 |
-
* Check for an identity crisis
|
78 |
-
*
|
79 |
-
* If one exists:
|
80 |
-
* - Bump stat for ID crisis
|
81 |
-
* - Email site admin about potential ID crisis
|
82 |
-
*/
|
83 |
-
|
84 |
-
// Coming Soon!
|
85 |
-
|
86 |
-
foreach ( self::generate_stats_array( 'v2-' ) as $key => $value ) {
|
87 |
-
$jetpack->stat( $key, $value );
|
88 |
-
}
|
89 |
-
|
90 |
-
Jetpack_Options::update_option( 'last_heartbeat', time() );
|
91 |
-
|
92 |
-
$jetpack->do_stats( 'server_side' );
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Fires when we synchronize all registered options on heartbeat.
|
96 |
-
*
|
97 |
-
* @since 3.3.0
|
98 |
-
*/
|
99 |
-
do_action( 'jetpack_heartbeat' );
|
100 |
-
}
|
101 |
-
|
102 |
-
public static function generate_stats_array( $prefix = '' ) {
|
103 |
-
$return = array();
|
104 |
-
|
105 |
-
$return["{$prefix}version"] = JETPACK__VERSION;
|
106 |
-
$return["{$prefix}wp-version"] = get_bloginfo( 'version' );
|
107 |
-
$return["{$prefix}php-version"] = PHP_VERSION;
|
108 |
-
$return["{$prefix}branch"] = floatval( JETPACK__VERSION );
|
109 |
-
$return["{$prefix}wp-branch"] = floatval( get_bloginfo( 'version' ) );
|
110 |
-
$return["{$prefix}php-branch"] = floatval( PHP_VERSION );
|
111 |
-
$return["{$prefix}public"] = Jetpack_Options::get_option( 'public' );
|
112 |
-
$return["{$prefix}ssl"] = Jetpack::permit_ssl();
|
113 |
-
$return["{$prefix}is-https"] = is_ssl() ? 'https' : 'http';
|
114 |
-
$return["{$prefix}language"] = get_bloginfo( 'language' );
|
115 |
-
$return["{$prefix}charset"] = get_bloginfo( 'charset' );
|
116 |
-
$return["{$prefix}is-multisite"] = is_multisite() ? 'multisite' : 'singlesite';
|
117 |
-
$return["{$prefix}identitycrisis"] = Jetpack::check_identity_crisis( 1 ) ? 'yes' : 'no';
|
118 |
-
$return["{$prefix}plugins"] = implode( ',', Jetpack::get_active_plugins() );
|
119 |
-
|
120 |
-
$return["{$prefix}single-user-site"]= Jetpack::is_single_user_site();
|
121 |
-
|
122 |
-
$return["{$prefix}manage-enabled"] = Jetpack::is_module_active( 'manage' );
|
123 |
-
|
124 |
-
// is-multi-network can have three values, `single-site`, `single-network`, and `multi-network`
|
125 |
-
$return["{$prefix}is-multi-network"] = 'single-site';
|
126 |
-
if ( is_multisite() ) {
|
127 |
-
$return["{$prefix}is-multi-network"] = Jetpack::is_multi_network() ? 'multi-network' : 'single-network';
|
128 |
-
}
|
129 |
-
|
130 |
-
if ( ! empty( $_SERVER['SERVER_ADDR'] ) || ! empty( $_SERVER['LOCAL_ADDR'] ) ) {
|
131 |
-
$ip = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
|
132 |
-
$ip_arr = array_map( 'intval', explode( '.', $ip ) );
|
133 |
-
if ( 4 == count( $ip_arr ) ) {
|
134 |
-
$return["{$prefix}ip-2-octets"] = implode( '.', array_slice( $ip_arr, 0, 2 ) );
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
foreach ( Jetpack::get_available_modules() as $slug ) {
|
139 |
-
$return["{$prefix}module-{$slug}"] = Jetpack::is_module_active( $slug ) ? 'on' : 'off';
|
140 |
-
}
|
141 |
-
|
142 |
-
return $return;
|
143 |
-
}
|
144 |
-
|
145 |
-
public static function jetpack_xmlrpc_methods( $methods ) {
|
146 |
-
$methods['jetpack.getHeartbeatData'] = array( __CLASS__, 'generate_stats_array' );
|
147 |
-
return $methods;
|
148 |
-
}
|
149 |
-
|
150 |
-
public function deactivate() {
|
151 |
-
// Deal with the old pre-3.0 weekly one.
|
152 |
-
if ( $timestamp = wp_next_scheduled( 'jetpack_heartbeat' ) ) {
|
153 |
-
wp_unschedule_event( $timestamp, 'jetpack_heartbeat' );
|
154 |
-
}
|
155 |
-
|
156 |
-
$timestamp = wp_next_scheduled( $this->cron_name );
|
157 |
-
wp_unschedule_event( $timestamp, $this->cron_name );
|
158 |
-
}
|
159 |
-
|
160 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-ixr-client.php
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
require_once( ABSPATH . WPINC . '/class-IXR.php' );
|
4 |
-
|
5 |
/**
|
6 |
* IXR_Client
|
7 |
*
|
@@ -10,9 +8,9 @@ require_once( ABSPATH . WPINC . '/class-IXR.php' );
|
|
10 |
*
|
11 |
*/
|
12 |
class Jetpack_IXR_Client extends IXR_Client {
|
13 |
-
|
14 |
|
15 |
-
function
|
16 |
$defaults = array(
|
17 |
'url' => Jetpack::xmlrpc_api_url(),
|
18 |
'user_id' => 0,
|
@@ -31,6 +29,10 @@ class Jetpack_IXR_Client extends IXR_Client {
|
|
31 |
$request = new IXR_Request( $method, $args );
|
32 |
$xml = trim( $request->getXml() );
|
33 |
|
|
|
|
|
|
|
|
|
34 |
$response = Jetpack_Client::remote_request( $this->jetpack_args, $xml );
|
35 |
|
36 |
if ( is_wp_error( $response ) ) {
|
@@ -47,7 +49,7 @@ class Jetpack_IXR_Client extends IXR_Client {
|
|
47 |
$this->error = new IXR_Error( -32300, 'transport error - HTTP status code was not 200' );
|
48 |
return false;
|
49 |
}
|
50 |
-
|
51 |
$content = wp_remote_retrieve_body( $response );
|
52 |
|
53 |
// Now parse what we've got back
|
@@ -95,10 +97,10 @@ class Jetpack_IXR_Client extends IXR_Client {
|
|
95 |
* @since 1.5
|
96 |
*/
|
97 |
class Jetpack_IXR_ClientMulticall extends Jetpack_IXR_Client {
|
98 |
-
|
99 |
|
100 |
-
function
|
101 |
-
parent::
|
102 |
}
|
103 |
|
104 |
function addCall() {
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
/**
|
4 |
* IXR_Client
|
5 |
*
|
8 |
*
|
9 |
*/
|
10 |
class Jetpack_IXR_Client extends IXR_Client {
|
11 |
+
var $jetpack_args = null;
|
12 |
|
13 |
+
function Jetpack_IXR_Client( $args = array(), $path = false, $port = 80, $timeout = 15 ) {
|
14 |
$defaults = array(
|
15 |
'url' => Jetpack::xmlrpc_api_url(),
|
16 |
'user_id' => 0,
|
29 |
$request = new IXR_Request( $method, $args );
|
30 |
$xml = trim( $request->getXml() );
|
31 |
|
32 |
+
$headers = array(
|
33 |
+
'Content-Type' => 'text/xml',
|
34 |
+
);
|
35 |
+
|
36 |
$response = Jetpack_Client::remote_request( $this->jetpack_args, $xml );
|
37 |
|
38 |
if ( is_wp_error( $response ) ) {
|
49 |
$this->error = new IXR_Error( -32300, 'transport error - HTTP status code was not 200' );
|
50 |
return false;
|
51 |
}
|
52 |
+
|
53 |
$content = wp_remote_retrieve_body( $response );
|
54 |
|
55 |
// Now parse what we've got back
|
97 |
* @since 1.5
|
98 |
*/
|
99 |
class Jetpack_IXR_ClientMulticall extends Jetpack_IXR_Client {
|
100 |
+
var $calls = array();
|
101 |
|
102 |
+
function Jetpack_IXR_ClientMulticall( $args = array(), $path = false, $port = 80, $timeout = 15 ) {
|
103 |
+
parent::Jetpack_IXR_Client( $args, $path, $port, $timeout );
|
104 |
}
|
105 |
|
106 |
function addCall() {
|
class.jetpack-jitm.php
DELETED
@@ -1,473 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Jetpack just in time messaging through out the admin
|
5 |
-
*
|
6 |
-
* @since 3.7.0
|
7 |
-
*/
|
8 |
-
class Jetpack_JITM {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* @var Jetpack_JITM
|
12 |
-
**/
|
13 |
-
private static $instance = null;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Get user dismissed messages.
|
17 |
-
*
|
18 |
-
* @var array
|
19 |
-
*/
|
20 |
-
private static $jetpack_hide_jitm = null;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Whether plugin auto updates are allowed in this WordPress installation or not.
|
24 |
-
*
|
25 |
-
* @var bool
|
26 |
-
*/
|
27 |
-
private static $auto_updates_allowed = false;
|
28 |
-
|
29 |
-
static function init() {
|
30 |
-
if ( is_null( self::$instance ) ) {
|
31 |
-
self::$instance = new Jetpack_JITM;
|
32 |
-
}
|
33 |
-
|
34 |
-
return self::$instance;
|
35 |
-
}
|
36 |
-
|
37 |
-
private function __construct() {
|
38 |
-
if ( ! Jetpack::is_active() || self::is_jitm_dismissed() ) {
|
39 |
-
return;
|
40 |
-
}
|
41 |
-
add_action( 'current_screen', array( $this, 'prepare_jitms' ) );
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Prepare actions according to screen and post type.
|
46 |
-
*
|
47 |
-
* @since 3.8.2
|
48 |
-
*
|
49 |
-
* @uses Jetpack_Autoupdate::get_possible_failures()
|
50 |
-
*
|
51 |
-
* @param object $screen
|
52 |
-
*/
|
53 |
-
function prepare_jitms( $screen ) {
|
54 |
-
if ( ! current_user_can( 'jetpack_manage_modules' ) ) {
|
55 |
-
return;
|
56 |
-
}
|
57 |
-
|
58 |
-
if ( 'edit-comments' == $screen->base && ! Jetpack::is_plugin_active( 'akismet/akismet.php' ) ) {
|
59 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
|
60 |
-
add_action( 'admin_notices', array( $this, 'akismet_msg' ) );
|
61 |
-
}
|
62 |
-
elseif ( 'post' == $screen->base && ( isset( $_GET['message'] ) && 6 == $_GET['message'] ) ) {
|
63 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
|
64 |
-
add_action( 'edit_form_top', array( $this, 'backups_after_publish_msg' ) );
|
65 |
-
}
|
66 |
-
elseif ( 'update-core' == $screen->base && ! Jetpack::is_plugin_active( 'vaultpress/vaultpress.php' ) ) {
|
67 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'jitm_enqueue_files' ) );
|
68 |
-
add_action( 'admin_notices', array( $this, 'backups_updates_msg' ) );
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
/*
|
73 |
-
* Present Manage just in time activation msg on update-core.php
|
74 |
-
*
|
75 |
-
*/
|
76 |
-
function manage_msg() {
|
77 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
78 |
-
?>
|
79 |
-
<div class="jp-jitm">
|
80 |
-
<a href="#" data-module="manage" class="dismiss"><span class="genericon genericon-close"></span></a>
|
81 |
-
|
82 |
-
<div class="jp-emblem">
|
83 |
-
<?php echo self::get_jp_emblem(); ?>
|
84 |
-
</div>
|
85 |
-
<p class="msg">
|
86 |
-
<?php esc_html_e( 'Reduce security risks with automated plugin updates.', 'jetpack' ); ?>
|
87 |
-
</p>
|
88 |
-
|
89 |
-
<p>
|
90 |
-
<img class="j-spinner hide" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="<?php echo esc_attr__( 'Loading...', 'jetpack' ); ?>" /><a href="#" data-module="manage" class="activate button <?php if ( Jetpack::is_module_active( 'manage' ) ) {
|
91 |
-
echo 'hide';
|
92 |
-
} ?>"><?php esc_html_e( 'Activate Now', 'jetpack' ); ?></a><a href="<?php echo esc_url( 'https://wordpress.com/plugins/' . $normalized_site_url ); ?>" target="_blank" title="<?php esc_attr_e( 'Go to WordPress.com to try these features', 'jetpack' ); ?>" id="jetpack-wordpressdotcom" class="button button-jetpack <?php if ( ! Jetpack::is_module_active( 'manage' ) ) {
|
93 |
-
echo 'hide';
|
94 |
-
} ?>"><?php esc_html_e( 'Go to WordPress.com', 'jetpack' ); ?></a>
|
95 |
-
</p>
|
96 |
-
</div>
|
97 |
-
<?php
|
98 |
-
//jitm is being viewed, track it
|
99 |
-
$jetpack = Jetpack::init();
|
100 |
-
$jetpack->stat( 'jitm', 'manage-viewed-' . JETPACK__VERSION );
|
101 |
-
$jetpack->do_stats( 'server_side' );
|
102 |
-
}
|
103 |
-
|
104 |
-
/*
|
105 |
-
* Present Photon just in time activation msg
|
106 |
-
*
|
107 |
-
*/
|
108 |
-
function photon_msg() {
|
109 |
-
?>
|
110 |
-
<div class="jp-jitm">
|
111 |
-
<a href="#" data-module="photon" class="dismiss"><span class="genericon genericon-close"></span></a>
|
112 |
-
|
113 |
-
<div class="jp-emblem">
|
114 |
-
<?php echo self::get_jp_emblem(); ?>
|
115 |
-
</div>
|
116 |
-
<p class="msg">
|
117 |
-
<?php esc_html_e( 'Speed up your photos and save bandwidth costs by using a free content delivery network.', 'jetpack' ); ?>
|
118 |
-
</p>
|
119 |
-
|
120 |
-
<p>
|
121 |
-
<img class="j-spinner hide" style="margin-top: 13px;" width="17" height="17" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="<?php echo esc_attr__( 'Loading...', 'jetpack' ); ?>" /><a href="#" data-module="photon" class="activate button button-jetpack"><?php esc_html_e( 'Activate Photon', 'jetpack' ); ?></a>
|
122 |
-
</p>
|
123 |
-
</div>
|
124 |
-
<?php
|
125 |
-
//jitm is being viewed, track it
|
126 |
-
$jetpack = Jetpack::init();
|
127 |
-
$jetpack->stat( 'jitm', 'photon-viewed-' . JETPACK__VERSION );
|
128 |
-
$jetpack->do_stats( 'server_side' );
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Display Photon JITM template in Media Library after user uploads an image.
|
133 |
-
*
|
134 |
-
* @since 3.9.0
|
135 |
-
*/
|
136 |
-
function photon_tmpl() {
|
137 |
-
?>
|
138 |
-
<script id="tmpl-jitm-photon" type="text/html">
|
139 |
-
<div class="jp-jitm" data-track="photon-modal">
|
140 |
-
<a href="#" data-module="photon" class="dismiss"><span class="genericon genericon-close"></span></a>
|
141 |
-
|
142 |
-
<div class="jp-emblem">
|
143 |
-
<?php echo self::get_jp_emblem(); ?>
|
144 |
-
</div>
|
145 |
-
<p class="msg">
|
146 |
-
<?php esc_html_e( 'Let Jetpack deliver your images optimized and faster than ever.', 'jetpack' ); ?>
|
147 |
-
</p>
|
148 |
-
|
149 |
-
<p>
|
150 |
-
<img class="j-spinner hide" style="margin-top: 13px;" width="17" height="17" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="<?php echo esc_attr__( 'Loading...', 'jetpack' ); ?>" /><a href="#" data-module="photon" class="activate button button-jetpack"><?php esc_html_e( 'Activate Photon', 'jetpack' ); ?></a>
|
151 |
-
</p>
|
152 |
-
</div>
|
153 |
-
</script>
|
154 |
-
<?php
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Display message prompting user to enable auto-updates in WordPress.com.
|
159 |
-
*
|
160 |
-
* @since 3.8.2
|
161 |
-
*/
|
162 |
-
function manage_pi_msg() {
|
163 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
164 |
-
$manage_active = Jetpack::is_module_active( 'manage' );
|
165 |
-
|
166 |
-
// Check if plugin has auto update already enabled in WordPress.com and don't show JITM in such case.
|
167 |
-
$active_before = get_option( 'jetpack_temp_active_plugins_before', array() );
|
168 |
-
delete_option( 'jetpack_temp_active_plugins_before' );
|
169 |
-
$active_now = get_option( 'active_plugins', array() );
|
170 |
-
$activated = array_diff( $active_now, $active_before );
|
171 |
-
$auto_update_plugin_list = Jetpack_Options::get_option( 'autoupdate_plugins', array() );
|
172 |
-
$plugin_auto_update_disabled = false;
|
173 |
-
foreach ( $activated as $plugin ) {
|
174 |
-
if ( ! in_array( $plugin, $auto_update_plugin_list ) ) {
|
175 |
-
|
176 |
-
// Plugin doesn't have auto updates enabled in WordPress.com yet.
|
177 |
-
$plugin_auto_update_disabled = true;
|
178 |
-
|
179 |
-
// We don't need to continue checking, it's ok to show JITM for this plugin.
|
180 |
-
break;
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
// Check if the activated plugin is in the WordPress.org repository
|
185 |
-
$plugin_can_auto_update = false;
|
186 |
-
$plugin_updates = get_site_transient( 'update_plugins' );
|
187 |
-
if ( false === $plugin_updates ) {
|
188 |
-
|
189 |
-
// If update_plugins doesn't exist, display message anyway
|
190 |
-
$plugin_can_auto_update = true;
|
191 |
-
} else {
|
192 |
-
$plugin_updates = array_merge( $plugin_updates->response, $plugin_updates->no_update );
|
193 |
-
foreach ( $activated as $plugin ) {
|
194 |
-
if ( isset( $plugin_updates[ $plugin ] ) ) {
|
195 |
-
|
196 |
-
// There's at least one plugin set cleared for auto updates
|
197 |
-
$plugin_can_auto_update = true;
|
198 |
-
|
199 |
-
// We don't need to continue checking, it's ok to show JITM for this round.
|
200 |
-
break;
|
201 |
-
}
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
if ( ! $manage_active && $plugin_auto_update_disabled && $plugin_can_auto_update && self::$auto_updates_allowed ) :
|
206 |
-
?>
|
207 |
-
<div class="jp-jitm">
|
208 |
-
<a href="#" data-module="manage-pi" class="dismiss"><span class="genericon genericon-close"></span></a>
|
209 |
-
|
210 |
-
<div class="jp-emblem">
|
211 |
-
<?php echo self::get_jp_emblem(); ?>
|
212 |
-
</div>
|
213 |
-
<?php if ( ! $manage_active ) : ?>
|
214 |
-
<p class="msg">
|
215 |
-
<?php esc_html_e( 'Save time with automated plugin updates.', 'jetpack' ); ?>
|
216 |
-
</p>
|
217 |
-
<p>
|
218 |
-
<img class="j-spinner hide" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="<?php echo esc_attr__( 'Loading...', 'jetpack' ); ?>" /><a href="#" data-module="manage" data-module-success="<?php esc_attr_e( 'Success!', 'jetpack' ); ?>" class="activate button"><?php esc_html_e( 'Activate remote management', 'jetpack' ); ?></a>
|
219 |
-
</p>
|
220 |
-
<?php elseif ( $manage_active ) : ?>
|
221 |
-
<p>
|
222 |
-
<?php esc_html_e( 'Save time with auto updates on WordPress.com', 'jetpack' ); ?>
|
223 |
-
</p>
|
224 |
-
<?php endif; // manage inactive
|
225 |
-
?>
|
226 |
-
<p class="show-after-enable <?php echo $manage_active ? '' : 'hide'; ?>">
|
227 |
-
<a href="<?php echo esc_url( 'https://wordpress.com/plugins/' . $normalized_site_url ); ?>" target="_blank" title="<?php esc_attr_e( 'Go to WordPress.com to enable auto-updates for plugins', 'jetpack' ); ?>" data-module="manage-pi" class="button button-jetpack launch show-after-enable"><?php if ( ! $manage_active ) : ?><?php esc_html_e( 'Enable auto-updates on WordPress.com', 'jetpack' ); ?><?php elseif ( $manage_active ) : ?><?php esc_html_e( 'Enable auto-updates', 'jetpack' ); ?><?php endif; // manage inactive ?></a>
|
228 |
-
</p>
|
229 |
-
</div>
|
230 |
-
<?php
|
231 |
-
//jitm is being viewed, track it
|
232 |
-
$jetpack = Jetpack::init();
|
233 |
-
$jetpack->stat( 'jitm', 'manage-pi-viewed-' . JETPACK__VERSION );
|
234 |
-
$jetpack->do_stats( 'server_side' );
|
235 |
-
endif; // manage inactive
|
236 |
-
}
|
237 |
-
|
238 |
-
/**
|
239 |
-
* Display message in editor prompting user to compose entry in WordPress.com.
|
240 |
-
*
|
241 |
-
* @since 3.8.2
|
242 |
-
*/
|
243 |
-
function editor_msg() {
|
244 |
-
global $typenow;
|
245 |
-
if ( current_user_can( 'manage_options' ) ) {
|
246 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
247 |
-
$editor_dismissed = isset( self::$jetpack_hide_jitm['editor'] );
|
248 |
-
if ( ! $editor_dismissed ) :
|
249 |
-
?>
|
250 |
-
<div class="jp-jitm">
|
251 |
-
<a href="#" data-module="editor" class="dismiss"><span class="genericon genericon-close"></span></a>
|
252 |
-
<div class="jp-emblem">
|
253 |
-
<?php echo self::get_jp_emblem(); ?>
|
254 |
-
</div>
|
255 |
-
<p class="msg">
|
256 |
-
<?php esc_html_e( 'Try the brand new editor.', 'jetpack' ); ?>
|
257 |
-
</p>
|
258 |
-
<p>
|
259 |
-
<a href="<?php echo esc_url( 'https://wordpress.com/' . $typenow . '/' . $normalized_site_url ); ?>" target="_blank" title="<?php esc_attr_e( 'Write on WordPress.com', 'jetpack' ); ?>" data-module="editor" class="button button-jetpack launch show-after-enable"><?php esc_html_e( 'Write on WordPress.com', 'jetpack' ); ?></a>
|
260 |
-
</p>
|
261 |
-
</div>
|
262 |
-
<?php
|
263 |
-
//jitm is being viewed, track it
|
264 |
-
$jetpack = Jetpack::init();
|
265 |
-
$jetpack->stat( 'jitm', 'editor-viewed-' . JETPACK__VERSION );
|
266 |
-
$jetpack->do_stats( 'server_side' );
|
267 |
-
endif; // manage or editor inactive
|
268 |
-
}
|
269 |
-
}
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Display message in editor prompting user to enable stats.
|
273 |
-
*
|
274 |
-
* @since 3.9.0
|
275 |
-
*/
|
276 |
-
function stats_msg() {
|
277 |
-
$stats_active = Jetpack::is_module_active( 'stats' );
|
278 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
279 |
-
?>
|
280 |
-
<div class="jp-jitm">
|
281 |
-
<a href="#" data-module="stats" class="dismiss"><span class="genericon genericon-close"></span></a>
|
282 |
-
|
283 |
-
<div class="jp-emblem">
|
284 |
-
<?php echo self::get_jp_emblem(); ?>
|
285 |
-
</div>
|
286 |
-
<p class="msg">
|
287 |
-
<?php esc_html_e( 'Track detailed stats on this post and the rest of your site.', 'jetpack' ); ?>
|
288 |
-
</p>
|
289 |
-
<?php if ( ! $stats_active ) : ?>
|
290 |
-
<p>
|
291 |
-
<img class="j-spinner hide" src="<?php echo esc_url( includes_url( 'images/spinner-2x.gif' ) ); ?>" alt="<?php echo esc_attr__( 'Loading...', 'jetpack' ); ?>" /><a href="#" data-module="stats" data-module-success="<?php esc_attr_e( 'Success! Jetpack Stats is now activated.', 'jetpack' ); ?>" class="activate button"><?php esc_html_e( 'Enable Jetpack Stats', 'jetpack' ); ?></a>
|
292 |
-
</p>
|
293 |
-
<?php endif; // stats inactive
|
294 |
-
?>
|
295 |
-
<p class="show-after-enable <?php echo $stats_active ? '' : 'hide'; ?>">
|
296 |
-
<a href="<?php echo esc_url( 'https://wordpress.com/stats/insights/' . $normalized_site_url ); ?>" target="_blank" title="<?php esc_attr_e( 'Go to WordPress.com', 'jetpack' ); ?>" data-module="stats" class="button button-jetpack launch show-after-enable"><?php esc_html_e( 'Go to WordPress.com', 'jetpack' ); ?></a>
|
297 |
-
</p>
|
298 |
-
</div>
|
299 |
-
<?php
|
300 |
-
//jitm is being viewed, track it
|
301 |
-
$jetpack = Jetpack::init();
|
302 |
-
$jetpack->stat( 'jitm', 'post-stats-viewed-' . JETPACK__VERSION );
|
303 |
-
$jetpack->do_stats( 'server_side' );
|
304 |
-
}
|
305 |
-
|
306 |
-
/**
|
307 |
-
* Display JITM in Updates screen prompting user to enable Backups.
|
308 |
-
*
|
309 |
-
* @since 3.9.5
|
310 |
-
*/
|
311 |
-
function backups_updates_msg() {
|
312 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
313 |
-
$url = 'https://wordpress.com/plans/' . $normalized_site_url;
|
314 |
-
$jitm_stats_url = Jetpack::build_stats_url( array( 'x_jetpack-jitm' => 'vaultpress' ) );
|
315 |
-
?>
|
316 |
-
<div class="jp-jitm" data-track="vaultpress-updates" data-stats_url="<?php echo esc_url( $jitm_stats_url ); ?>">
|
317 |
-
<a href="#" data-module="vaultpress" class="dismiss"><span class="genericon genericon-close"></span></a>
|
318 |
-
|
319 |
-
<div class="jp-emblem">
|
320 |
-
<?php echo self::get_jp_emblem(); ?>
|
321 |
-
</div>
|
322 |
-
<p class="msg">
|
323 |
-
<?php esc_html_e( 'Backups are recommended to protect your site before you make any changes.', 'jetpack' ); ?>
|
324 |
-
</p>
|
325 |
-
<p>
|
326 |
-
<a href="<?php echo esc_url( $url ); ?>" target="_blank" title="<?php esc_attr_e( 'Enable VaultPress Backups', 'jetpack' ); ?>" data-module="vaultpress" data-jptracks-name="nudge_click" data-jptracks-prop="jitm-vault" class="button button-jetpack launch jptracks"><?php esc_html_e( 'Enable VaultPress Backups', 'jetpack' ); ?></a>
|
327 |
-
</p>
|
328 |
-
</div>
|
329 |
-
<?php
|
330 |
-
//jitm is being viewed, track it
|
331 |
-
$jetpack = Jetpack::init();
|
332 |
-
$jetpack->stat( 'jitm', 'vaultpress-updates-viewed-' . JETPACK__VERSION );
|
333 |
-
$jetpack->do_stats( 'server_side' );
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* Display JITM in Comments screen prompting user to enable Akismet.
|
338 |
-
*
|
339 |
-
* @since 3.9.5
|
340 |
-
*/
|
341 |
-
function akismet_msg() {
|
342 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
343 |
-
$url = 'https://wordpress.com/plans/' . $normalized_site_url;
|
344 |
-
$jitm_stats_url = Jetpack::build_stats_url( array( 'x_jetpack-jitm' => 'akismet' ) );
|
345 |
-
?>
|
346 |
-
<div class="jp-jitm" data-stats_url="<?php echo esc_url( $jitm_stats_url ); ?>">
|
347 |
-
<a href="#" data-module="akismet" class="dismiss"><span class="genericon genericon-close"></span></a>
|
348 |
-
|
349 |
-
<div class="jp-emblem">
|
350 |
-
<?php echo self::get_jp_emblem(); ?>
|
351 |
-
</div>
|
352 |
-
<p class="msg">
|
353 |
-
<?php esc_html_e( "Spam affects your site's legitimacy, protect your site with Akismet.", 'jetpack' ); ?>
|
354 |
-
</p>
|
355 |
-
<p>
|
356 |
-
<a href="<?php echo esc_url( $url ); ?>" target="_blank" title="<?php esc_attr_e( 'Automate Spam Blocking', 'jetpack' ); ?>" data-module="akismet" data-jptracks-name="nudge_click" data-jptracks-prop="jitm-akismet" class="button button-jetpack launch jptracks"><?php esc_html_e( 'Automate Spam Blocking', 'jetpack' ); ?></a>
|
357 |
-
</p>
|
358 |
-
</div>
|
359 |
-
<?php
|
360 |
-
//jitm is being viewed, track it
|
361 |
-
$jetpack = Jetpack::init();
|
362 |
-
$jetpack->stat( 'jitm', 'akismet-viewed-' . JETPACK__VERSION );
|
363 |
-
$jetpack->do_stats( 'server_side' );
|
364 |
-
}
|
365 |
-
|
366 |
-
/**
|
367 |
-
* Display JITM after a post is published prompting user to enable Backups.
|
368 |
-
*
|
369 |
-
* @since 3.9.5
|
370 |
-
*/
|
371 |
-
function backups_after_publish_msg() {
|
372 |
-
$normalized_site_url = Jetpack::build_raw_urls( get_home_url() );
|
373 |
-
$url = 'https://wordpress.com/plans/' . $normalized_site_url;
|
374 |
-
$jitm_stats_url = Jetpack::build_stats_url( array( 'x_jetpack-jitm' => 'vaultpress' ) );
|
375 |
-
?>
|
376 |
-
<div class="jp-jitm" data-track="vaultpress-publish" data-stats_url="<?php echo esc_url( $jitm_stats_url ); ?>">
|
377 |
-
<a href="#" data-module="vaultpress" class="dismiss"><span class="genericon genericon-close"></span></a>
|
378 |
-
|
379 |
-
<div class="jp-emblem">
|
380 |
-
<?php echo self::get_jp_emblem(); ?>
|
381 |
-
</div>
|
382 |
-
<p class="msg">
|
383 |
-
<?php esc_html_e( "Great job! Now let's make sure your hard work is never lost, backup everything with VaultPress.", 'jetpack' ); ?>
|
384 |
-
</p>
|
385 |
-
<p>
|
386 |
-
<a href="<?php echo esc_url( $url ); ?>" target="_blank" title="<?php esc_attr_e( 'Enable Backups', 'jetpack' ); ?>" data-module="vaultpress" data-jptracks-name="nudge_click" data-jptracks-prop="jitm-vault-post" class="button button-jetpack launch jptracks"><?php esc_html_e( 'Enable Backups', 'jetpack' ); ?></a>
|
387 |
-
</p>
|
388 |
-
</div>
|
389 |
-
<?php
|
390 |
-
//jitm is being viewed, track it
|
391 |
-
$jetpack = Jetpack::init();
|
392 |
-
$jetpack->stat( 'jitm', 'vaultpress-publish-viewed-' . JETPACK__VERSION );
|
393 |
-
$jetpack->do_stats( 'server_side' );
|
394 |
-
}
|
395 |
-
|
396 |
-
/*
|
397 |
-
* Function to enqueue jitm css and js
|
398 |
-
*/
|
399 |
-
function jitm_enqueue_files( $hook ) {
|
400 |
-
|
401 |
-
$wp_styles = new WP_Styles();
|
402 |
-
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
403 |
-
wp_enqueue_style( 'jetpack-jitm-css', plugins_url( "css/jetpack-admin-jitm{$min}.css", JETPACK__PLUGIN_FILE ), false, JETPACK__VERSION . '-201243242' );
|
404 |
-
$wp_styles->add_data( 'jetpack-jitm-css', 'rtl', true );
|
405 |
-
|
406 |
-
//Build stats url for tracking manage button
|
407 |
-
$jitm_stats_url = Jetpack::build_stats_url( array( 'x_jetpack-jitm' => 'wordpresstools' ) );
|
408 |
-
|
409 |
-
// Enqueue javascript to handle jitm notice events
|
410 |
-
wp_enqueue_script( 'jetpack-jitm-js', plugins_url( '_inc/jetpack-jitm.js', JETPACK__PLUGIN_FILE ),
|
411 |
-
array( 'jquery' ), JETPACK__VERSION, true );
|
412 |
-
wp_localize_script(
|
413 |
-
'jetpack-jitm-js',
|
414 |
-
'jitmL10n',
|
415 |
-
array(
|
416 |
-
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
417 |
-
'jitm_nonce' => wp_create_nonce( 'jetpack-jitm-nonce' ),
|
418 |
-
'photon_msgs' => array(
|
419 |
-
'success' => esc_html__( 'Success! Photon is now actively optimizing and serving your images for free.', 'jetpack' ),
|
420 |
-
'fail' => esc_html__( 'We are sorry but unfortunately Photon did not activate.', 'jetpack' )
|
421 |
-
),
|
422 |
-
'manage_msgs' => array(
|
423 |
-
'success' => esc_html__( 'Success! WordPress.com tools are now active.', 'jetpack' ),
|
424 |
-
'fail' => esc_html__( 'We are sorry but unfortunately Manage did not activate.', 'jetpack' )
|
425 |
-
),
|
426 |
-
'stats_msgs' => array(
|
427 |
-
'success' => esc_html__( 'Success! Stats are now active.', 'jetpack' ),
|
428 |
-
'fail' => esc_html__( 'We are sorry but unfortunately Stats did not activate.', 'jetpack' )
|
429 |
-
),
|
430 |
-
'jitm_stats_url' => $jitm_stats_url
|
431 |
-
)
|
432 |
-
);
|
433 |
-
}
|
434 |
-
|
435 |
-
/**
|
436 |
-
* Check if a JITM was dismissed or not. Currently, dismissing one JITM will dismiss all of them.
|
437 |
-
*
|
438 |
-
* @since 3.8.2
|
439 |
-
*
|
440 |
-
* @return bool
|
441 |
-
*/
|
442 |
-
function is_jitm_dismissed() {
|
443 |
-
if ( is_null( self::$jetpack_hide_jitm ) ) {
|
444 |
-
|
445 |
-
// The option returns false when nothing was dismissed
|
446 |
-
self::$jetpack_hide_jitm = Jetpack_Options::get_option( 'hide_jitm' );
|
447 |
-
}
|
448 |
-
|
449 |
-
// so if it's not an array, it means no JITM was dismissed
|
450 |
-
return is_array( self::$jetpack_hide_jitm );
|
451 |
-
}
|
452 |
-
|
453 |
-
/**
|
454 |
-
* Return string containing the Jetpack logo.
|
455 |
-
*
|
456 |
-
* @since 3.9.0
|
457 |
-
*
|
458 |
-
* @return string
|
459 |
-
*/
|
460 |
-
function get_jp_emblem() {
|
461 |
-
return '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0" y="0" viewBox="0 0 172.9 172.9" enable-background="new 0 0 172.9 172.9" xml:space="preserve"> <path d="M86.4 0C38.7 0 0 38.7 0 86.4c0 47.7 38.7 86.4 86.4 86.4s86.4-38.7 86.4-86.4C172.9 38.7 134.2 0 86.4 0zM83.1 106.6l-27.1-6.9C49 98 45.7 90.1 49.3 84l33.8-58.5V106.6zM124.9 88.9l-33.8 58.5V66.3l27.1 6.9C125.1 74.9 128.4 82.8 124.9 88.9z" /></svg>';
|
462 |
-
}
|
463 |
-
}
|
464 |
-
/**
|
465 |
-
* Filter to turn off all just in time messages
|
466 |
-
*
|
467 |
-
* @since 3.7.0
|
468 |
-
*
|
469 |
-
* @param bool true Whether to show just in time messages.
|
470 |
-
*/
|
471 |
-
if ( apply_filters( 'jetpack_just_in_time_msgs', false ) ) {
|
472 |
-
Jetpack_JITM::init();
|
473 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-modules-list-table.php
DELETED
@@ -1,357 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! class_exists( 'WP_List_Table' ) )
|
4 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
5 |
-
|
6 |
-
class Jetpack_Modules_List_Table extends WP_List_Table {
|
7 |
-
|
8 |
-
function __construct() {
|
9 |
-
parent::__construct();
|
10 |
-
|
11 |
-
Jetpack::init();
|
12 |
-
|
13 |
-
// In WP 4.2 WP_List_Table will be sanitizing which values are __set()
|
14 |
-
global $wp_version;
|
15 |
-
if ( version_compare( $wp_version, '4.2-z', '>=' ) && $this->compat_fields && is_array( $this->compat_fields ) ) {
|
16 |
-
array_push( $this->compat_fields, 'all_items' );
|
17 |
-
}
|
18 |
-
|
19 |
-
$this->items = $this->all_items = Jetpack_Admin::init()->get_modules();
|
20 |
-
$this->items = $this->filter_displayed_table_items( $this->items );
|
21 |
-
/**
|
22 |
-
* Filters the list of modules available to be displayed in the Jetpack Settings screen.
|
23 |
-
*
|
24 |
-
* @since 3.0.0
|
25 |
-
*
|
26 |
-
* @param array $this->items Array of Jetpack modules.
|
27 |
-
*/
|
28 |
-
$this->items = apply_filters( 'jetpack_modules_list_table_items', $this->items );
|
29 |
-
$this->_column_headers = array( $this->get_columns(), array(), array(), 'name' );
|
30 |
-
$modal_info = isset( $_GET['info'] ) ? $_GET['info'] : false;
|
31 |
-
|
32 |
-
wp_register_script(
|
33 |
-
'models.jetpack-modules',
|
34 |
-
plugins_url( '_inc/jetpack-modules.models.js', JETPACK__PLUGIN_FILE ),
|
35 |
-
array( 'backbone', 'underscore' ),
|
36 |
-
JETPACK__VERSION
|
37 |
-
);
|
38 |
-
wp_register_script(
|
39 |
-
'views.jetpack-modules',
|
40 |
-
plugins_url( '_inc/jetpack-modules.views.js', JETPACK__PLUGIN_FILE ),
|
41 |
-
array( 'backbone', 'underscore', 'wp-util' ),
|
42 |
-
JETPACK__VERSION
|
43 |
-
);
|
44 |
-
wp_register_script(
|
45 |
-
'jetpack-modules-list-table',
|
46 |
-
plugins_url( '_inc/jetpack-modules.js', JETPACK__PLUGIN_FILE ),
|
47 |
-
array(
|
48 |
-
'views.jetpack-modules',
|
49 |
-
'models.jetpack-modules',
|
50 |
-
'jquery',
|
51 |
-
),
|
52 |
-
JETPACK__VERSION,
|
53 |
-
true
|
54 |
-
);
|
55 |
-
|
56 |
-
wp_localize_script( 'jetpack-modules-list-table', 'jetpackModulesData', array(
|
57 |
-
'modules' => Jetpack::get_translated_modules( $this->all_items ),
|
58 |
-
'i18n' => array(
|
59 |
-
'search_placeholder' => __( 'Search Modules…', 'jetpack' ),
|
60 |
-
),
|
61 |
-
'modalinfo' => $this->module_info_check( $modal_info, $this->all_items ),
|
62 |
-
'nonces' => array(
|
63 |
-
'bulk' => wp_create_nonce( 'bulk-jetpack_page_jetpack_modules' ),
|
64 |
-
),
|
65 |
-
'coreIconAvailable' => Jetpack::jetpack_site_icon_available_in_core(),
|
66 |
-
) );
|
67 |
-
|
68 |
-
wp_enqueue_script( 'jetpack-modules-list-table' );
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Filters the js_templates callback value.
|
72 |
-
*
|
73 |
-
* @since 3.6.0
|
74 |
-
*
|
75 |
-
* @param array array( $this, 'js_templates' ) js_templates callback.
|
76 |
-
*/
|
77 |
-
add_action( 'admin_footer', apply_filters( 'jetpack_modules_list_table_js_template_callback', array( $this, 'js_templates' ) ), 9 );
|
78 |
-
}
|
79 |
-
|
80 |
-
function js_templates() {
|
81 |
-
?>
|
82 |
-
<script type="text/html" id="tmpl-Jetpack_Modules_List_Table_Template">
|
83 |
-
<# var i = 0;
|
84 |
-
if ( data.items.length ) {
|
85 |
-
_.each( data.items, function( item, key, list ) {
|
86 |
-
if ( item === undefined ) return;
|
87 |
-
if ( jetpackModulesData.coreIconAvailable && 'site-icon' == item.module ) { #>
|
88 |
-
<tr class="jetpack-module deprecated <# if ( ++i % 2 ) { #> alternate<# } #>" id="site-icon-deprecated">
|
89 |
-
<th scope="row" class="check-column">
|
90 |
-
<input type="checkbox" name="modules[]" value="{{{ item.module }}}" disabled />
|
91 |
-
</th>
|
92 |
-
<td class='name column-name'>
|
93 |
-
<span class='info'>{{{ item.name }}}</span>
|
94 |
-
<div class="row-actions">
|
95 |
-
<span class="dep-msg"><?php _ex( 'WordPress now has Site Icon built in!', '"Site Icon" is the feature name.', 'jetpack' ); ?></span>
|
96 |
-
<span class='configure'><a href="<?php esc_html_e( admin_url( 'customize.php?autofocus[control]=site_icon' ), 'jetpack' ); ?>"><?php _e( 'Configure' , 'jetpack' ); ?></a></span>
|
97 |
-
</div>
|
98 |
-
</td>
|
99 |
-
</tr>
|
100 |
-
<# return; } #>
|
101 |
-
<tr class="jetpack-module <# if ( ++i % 2 ) { #> alternate<# } #><# if ( item.activated ) { #> active<# } #><# if ( ! item.available ) { #> unavailable<# } #>" id="{{{ item.module }}}">
|
102 |
-
<th scope="row" class="check-column">
|
103 |
-
<input type="checkbox" name="modules[]" value="{{{ item.module }}}" />
|
104 |
-
</th>
|
105 |
-
<td class='name column-name'>
|
106 |
-
<span class='info'><a href="#">{{{ item.name }}}</a></span>
|
107 |
-
<div class="row-actions">
|
108 |
-
<# if ( item.configurable ) { #>
|
109 |
-
<span class='configure'>{{{ item.configurable }}}</span>
|
110 |
-
<# } #>
|
111 |
-
<# if ( item.activated && 'vaultpress' !== item.module && item.available ) { #>
|
112 |
-
<span class='delete'><a href="<?php echo admin_url( 'admin.php' ); ?>?page=jetpack&action=deactivate&module={{{ item.module }}}&_wpnonce={{{ item.deactivate_nonce }}}"><?php _e( 'Deactivate', 'jetpack' ); ?></a></span>
|
113 |
-
<# } else if ( item.available ) { #>
|
114 |
-
<span class='activate'><a href="<?php echo admin_url( 'admin.php' ); ?>?page=jetpack&action=activate&module={{{ item.module }}}&_wpnonce={{{ item.activate_nonce }}}"><?php _e( 'Activate', 'jetpack' ); ?></a></span>
|
115 |
-
<# } #>
|
116 |
-
</div>
|
117 |
-
</td>
|
118 |
-
</tr>
|
119 |
-
<#
|
120 |
-
});
|
121 |
-
} else {
|
122 |
-
#>
|
123 |
-
<tr class="no-modules-found">
|
124 |
-
<td colspan="2"><?php esc_html_e( 'No Modules Found' , 'jetpack' ); ?></td>
|
125 |
-
</tr>
|
126 |
-
<#
|
127 |
-
}
|
128 |
-
#>
|
129 |
-
</script>
|
130 |
-
<?php
|
131 |
-
}
|
132 |
-
|
133 |
-
function get_views() {
|
134 |
-
$modules = Jetpack_Admin::init()->get_modules();
|
135 |
-
$array_of_module_tags = wp_list_pluck( $modules, 'module_tags' );
|
136 |
-
$module_tags = call_user_func_array( 'array_merge', $array_of_module_tags );
|
137 |
-
$module_tags_unique = array_count_values( $module_tags );
|
138 |
-
ksort( $module_tags_unique );
|
139 |
-
|
140 |
-
$format = '<a href="%3$s"%4$s data-title="%1$s">%1$s <span class="count">(%2$s)</span></a>';
|
141 |
-
$title = __( 'All', 'jetpack' );
|
142 |
-
$count = count( $modules );
|
143 |
-
$url = esc_url( remove_query_arg( 'module_tag' ) );
|
144 |
-
$current = empty( $_GET['module_tag'] ) ? ' class="current all"' : ' class="all"';
|
145 |
-
$views = array(
|
146 |
-
'all' => sprintf( $format, $title, $count, $url, $current ),
|
147 |
-
);
|
148 |
-
foreach ( $module_tags_unique as $title => $count ) {
|
149 |
-
if ( 'Jumpstart' == $title ) {
|
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 = '';
|
156 |
-
if ( ! empty( $_GET['module_tag'] ) && $title == $_GET['module_tag'] )
|
157 |
-
$current = ' class="current"';
|
158 |
-
$views[ $key ] = sprintf( $format, $display_title, $count, $url, $current );
|
159 |
-
}
|
160 |
-
return $views;
|
161 |
-
}
|
162 |
-
|
163 |
-
function views() {
|
164 |
-
$views = $this->get_views();
|
165 |
-
|
166 |
-
echo "<ul class='subsubsub'>\n";
|
167 |
-
foreach ( $views as $class => $view ) {
|
168 |
-
$views[ $class ] = "\t<li class='$class'>$view</li>";
|
169 |
-
}
|
170 |
-
echo implode( "\n", $views ) . "\n";
|
171 |
-
echo "</ul>";
|
172 |
-
}
|
173 |
-
|
174 |
-
function filter_displayed_table_items( $modules ) {
|
175 |
-
return array_filter( $modules, array( $this, 'is_module_displayed' ) );
|
176 |
-
}
|
177 |
-
|
178 |
-
static function is_module_available( $module ) {
|
179 |
-
if ( ! is_array( $module ) || empty( $module ) )
|
180 |
-
return false;
|
181 |
-
|
182 |
-
if ( Jetpack::is_development_mode() ) {
|
183 |
-
return ! ( $module['requires_connection'] );
|
184 |
-
} else {
|
185 |
-
return Jetpack::is_active();
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
static function is_module_displayed( $module ) {
|
190 |
-
// Handle module tag based filtering.
|
191 |
-
if ( ! empty( $_REQUEST['module_tag'] ) ) {
|
192 |
-
$module_tag = sanitize_text_field( $_REQUEST['module_tag'] );
|
193 |
-
if ( ! in_array( $module_tag, $module['module_tags'] ) )
|
194 |
-
return false;
|
195 |
-
}
|
196 |
-
|
197 |
-
// If nothing rejected it, include it!
|
198 |
-
return true;
|
199 |
-
}
|
200 |
-
|
201 |
-
static function sort_requires_connection_last( $module1, $module2 ) {
|
202 |
-
if ( $module1['requires_connection'] == $module2['requires_connection'] )
|
203 |
-
return 0;
|
204 |
-
if ( $module1['requires_connection'] )
|
205 |
-
return 1;
|
206 |
-
if ( $module2['requires_connection'] )
|
207 |
-
return -1;
|
208 |
-
|
209 |
-
return 0;
|
210 |
-
}
|
211 |
-
|
212 |
-
function get_columns() {
|
213 |
-
$columns = array(
|
214 |
-
'cb' => '<input type="checkbox" />',
|
215 |
-
'name' => __( 'Name', 'jetpack' ),
|
216 |
-
);
|
217 |
-
return $columns;
|
218 |
-
}
|
219 |
-
|
220 |
-
function get_bulk_actions() {
|
221 |
-
$actions = array(
|
222 |
-
'bulk-activate' => __( 'Activate', 'jetpack' ),
|
223 |
-
'bulk-deactivate' => __( 'Deactivate', 'jetpack' ),
|
224 |
-
);
|
225 |
-
return $actions;
|
226 |
-
}
|
227 |
-
|
228 |
-
function single_row( $item ) {
|
229 |
-
static $i = 0;
|
230 |
-
$row_class = ( ++$i % 2 ) ? ' alternate' : '';
|
231 |
-
|
232 |
-
if ( ! empty( $item['activated'] ) )
|
233 |
-
$row_class .= ' active';
|
234 |
-
|
235 |
-
if ( ! $this->is_module_available( $item ) )
|
236 |
-
$row_class .= ' unavailable';
|
237 |
-
|
238 |
-
echo '<tr class="jetpack-module' . esc_attr( $row_class ) . '" id="' . esc_attr( $item['module'] ) . '">';
|
239 |
-
$this->single_row_columns( $item );
|
240 |
-
echo '</tr>';
|
241 |
-
}
|
242 |
-
|
243 |
-
function get_table_classes() {
|
244 |
-
return array( 'table', 'table-bordered', 'wp-list-table', 'widefat', 'fixed', 'jetpack-modules' );
|
245 |
-
}
|
246 |
-
|
247 |
-
function column_cb( $item ) {
|
248 |
-
if ( ! $this->is_module_available( $item ) )
|
249 |
-
return '';
|
250 |
-
|
251 |
-
return sprintf( '<input type="checkbox" name="modules[]" value="%s" />', $item['module'] );
|
252 |
-
}
|
253 |
-
|
254 |
-
function column_icon( $item ) {
|
255 |
-
$badge_text = $free_text = '';
|
256 |
-
ob_start();
|
257 |
-
?>
|
258 |
-
<a href="#TB_inline?width=600&height=550&inlineId=more-info-module-settings-modal" class="thickbox">
|
259 |
-
<div class="module-image">
|
260 |
-
<p><span class="module-image-badge"><?php echo $badge_text; ?></span><span class="module-image-free" style="display: none"><?php echo $free_text; ?></span></p>
|
261 |
-
</div>
|
262 |
-
</a>
|
263 |
-
<?php
|
264 |
-
return ob_get_clean();
|
265 |
-
|
266 |
-
}
|
267 |
-
|
268 |
-
function column_name( $item ) {
|
269 |
-
$actions = array(
|
270 |
-
'info' => sprintf( '<a href="%s">%s</a>', esc_url( '#' ), esc_html__( 'Module Info', 'jetpack' ) ),
|
271 |
-
);
|
272 |
-
|
273 |
-
if ( ! empty( $item['configurable'] ) ) {
|
274 |
-
$actions['configure'] = $item['configurable'];
|
275 |
-
}
|
276 |
-
|
277 |
-
if ( empty( $item['activated'] ) && $this->is_module_available( $item ) ) {
|
278 |
-
$url = wp_nonce_url(
|
279 |
-
Jetpack::admin_url( array(
|
280 |
-
'page' => 'jetpack',
|
281 |
-
'action' => 'activate',
|
282 |
-
'module' => $item['module'],
|
283 |
-
) ),
|
284 |
-
'jetpack_activate-' . $item['module']
|
285 |
-
);
|
286 |
-
$actions['activate'] = sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html__( 'Activate', 'jetpack' ) );
|
287 |
-
} elseif ( ! empty( $item['activated'] ) ) {
|
288 |
-
$url = wp_nonce_url(
|
289 |
-
Jetpack::admin_url( array(
|
290 |
-
'page' => 'jetpack',
|
291 |
-
'action' => 'deactivate',
|
292 |
-
'module' => $item['module'],
|
293 |
-
) ),
|
294 |
-
'jetpack_deactivate-' . $item['module']
|
295 |
-
);
|
296 |
-
$actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html__( 'Deactivate', 'jetpack' ) );
|
297 |
-
}
|
298 |
-
|
299 |
-
return $this->row_actions( $actions ) . wptexturize( $item['name'] );
|
300 |
-
}
|
301 |
-
|
302 |
-
function column_description( $item ) {
|
303 |
-
ob_start();
|
304 |
-
/** This action is documented in class.jetpack-admin.php */
|
305 |
-
echo apply_filters( 'jetpack_short_module_description', $item['description'], $item['module'] );
|
306 |
-
/** This action is documented in class.jetpack-admin.php */
|
307 |
-
do_action( 'jetpack_learn_more_button_' . $item['module'] );
|
308 |
-
echo '<div id="more-info-' . $item['module'] . '" class="more-info">';
|
309 |
-
/** This action is documented in class.jetpack-admin.php */
|
310 |
-
do_action( 'jetpack_module_more_info_' . $item['module'] );
|
311 |
-
echo '</div>';
|
312 |
-
return ob_get_clean();
|
313 |
-
}
|
314 |
-
|
315 |
-
function column_module_tags( $item ) {
|
316 |
-
$module_tags = array();
|
317 |
-
foreach( $item['module_tags'] as $module_tag ) {
|
318 |
-
$module_tags[] = sprintf( '<a href="%3$s" data-title="%2$s">%1$s</a>', esc_html( $module_tag ), esc_attr( $module_tag ), esc_url( add_query_arg( 'module_tag', urlencode( $module_tag ) ) ) );
|
319 |
-
}
|
320 |
-
return implode( ', ', $module_tags );
|
321 |
-
}
|
322 |
-
|
323 |
-
function column_default( $item, $column_name ) {
|
324 |
-
switch ( $column_name ) {
|
325 |
-
case 'icon':
|
326 |
-
case 'name':
|
327 |
-
case 'description':
|
328 |
-
break;
|
329 |
-
default:
|
330 |
-
return print_r( $item, true );
|
331 |
-
}
|
332 |
-
}
|
333 |
-
|
334 |
-
//Check if the info parameter provided in the URL corresponds to an actual module
|
335 |
-
function module_info_check( $info = false, $modules ) {
|
336 |
-
if ( false == $info ) {
|
337 |
-
return false;
|
338 |
-
} else if ( array_key_exists( $info, $modules ) ) {
|
339 |
-
return $info;
|
340 |
-
}
|
341 |
-
}
|
342 |
-
|
343 |
-
/**
|
344 |
-
* Core switched their `display_tablenav()` method to protected, so we can't access it directly.
|
345 |
-
* Instead, let's include an access function to make it doable without errors!
|
346 |
-
*
|
347 |
-
* @see https://github.com/WordPress/WordPress/commit/d28f6344de97616de8ece543ed290c4ba2383622
|
348 |
-
*
|
349 |
-
* @param string $which
|
350 |
-
*
|
351 |
-
* @return mixed
|
352 |
-
*/
|
353 |
-
function unprotected_display_tablenav( $which = 'top' ) {
|
354 |
-
return $this->display_tablenav( $which );
|
355 |
-
}
|
356 |
-
|
357 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-network-sites-list-table.php
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if( ! class_exists( 'WP_List_Table' ) ) {
|
4 |
-
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
5 |
-
}
|
6 |
-
|
7 |
-
class Jetpack_Network_Sites_List_Table extends WP_List_Table {
|
8 |
-
|
9 |
-
|
10 |
-
public function get_columns() {
|
11 |
-
// site name, status, username connected under
|
12 |
-
$columns = array(
|
13 |
-
'cb' => '<input type="checkbox" />',
|
14 |
-
'blogname' => __( 'Site Name', 'jetpack' ),
|
15 |
-
'blog_path' => __( 'Path', 'jetpack' ),
|
16 |
-
'connected' => __( 'Connected', 'jetpack' ),
|
17 |
-
);
|
18 |
-
|
19 |
-
return $columns;
|
20 |
-
}
|
21 |
-
|
22 |
-
public function prepare_items() {
|
23 |
-
$jpms = Jetpack_Network::init();
|
24 |
-
|
25 |
-
// Deal with bulk actions if any were requested by the user
|
26 |
-
$this->process_bulk_action();
|
27 |
-
|
28 |
-
// Get sites
|
29 |
-
$sites = $jpms->wp_get_sites( array(
|
30 |
-
'exclude_blogs' => array( 1 ),
|
31 |
-
'archived' => false,
|
32 |
-
) );
|
33 |
-
|
34 |
-
// Setup pagination
|
35 |
-
$per_page = 25;
|
36 |
-
$current_page = $this->get_pagenum();
|
37 |
-
$total_items = count( $sites );
|
38 |
-
$sites = array_slice( $sites, ( ( $current_page-1 ) * $per_page ), $per_page );
|
39 |
-
$this->set_pagination_args( array(
|
40 |
-
'total_items' => $total_items,
|
41 |
-
'per_page' => $per_page
|
42 |
-
) );
|
43 |
-
|
44 |
-
$columns = $this->get_columns();
|
45 |
-
$hidden = array();
|
46 |
-
$sortable = array();
|
47 |
-
$this->_column_headers = array( $columns, $hidden, $sortable );
|
48 |
-
$this->items = $sites;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function column_blogname( $item ) {
|
52 |
-
// http://jpms/wp-admin/network/site-info.php?id=1
|
53 |
-
switch_to_blog( $item->blog_id );
|
54 |
-
$jp_url = admin_url( 'admin.php?page=jetpack' );
|
55 |
-
restore_current_blog();
|
56 |
-
|
57 |
-
$actions = array(
|
58 |
-
'edit' => '<a href="' . network_admin_url( 'site-info.php?id=' . $item->blog_id ) . '">' . __( 'Edit', 'jetpack' ) . '</a>',
|
59 |
-
'dashboard' => '<a href="' . get_admin_url( $item->blog_id, '', 'admin' ) . '">Dashboard</a>',
|
60 |
-
'view' => '<a href="' . get_site_url( $item->blog_id, '', 'admin' ) . '">View</a>',
|
61 |
-
'jetpack-' . $item->blog_id => '<a href="' . $jp_url . '">Jetpack</a>',
|
62 |
-
);
|
63 |
-
|
64 |
-
return sprintf('%1$s %2$s', '<strong>' . get_blog_option( $item->blog_id, 'blogname' ) . '</strong>', $this->row_actions($actions) );
|
65 |
-
}
|
66 |
-
|
67 |
-
public function column_blog_path( $item ) {
|
68 |
-
return
|
69 |
-
'<a href="' .
|
70 |
-
get_site_url( $item->blog_id, '', 'admin' ) .
|
71 |
-
'">' .
|
72 |
-
str_replace( array( 'http://', 'https://' ), '', get_site_url( $item->blog_id, '', 'admin' ) ) .
|
73 |
-
'</a>';
|
74 |
-
}
|
75 |
-
|
76 |
-
public function column_connected( $item ) {
|
77 |
-
$jpms = Jetpack_Network::init();
|
78 |
-
$jp = Jetpack::init();
|
79 |
-
|
80 |
-
switch_to_blog( $item->blog_id );
|
81 |
-
if( $jp->is_active() ) {
|
82 |
-
// Build url for disconnecting
|
83 |
-
$url = $jpms->get_url( array(
|
84 |
-
'name' => 'subsitedisconnect',
|
85 |
-
'site_id' => $item->blog_id,
|
86 |
-
|
87 |
-
) );
|
88 |
-
restore_current_blog();
|
89 |
-
return '<a href="' . $url . '">Disconnect</a>';
|
90 |
-
}
|
91 |
-
restore_current_blog();
|
92 |
-
|
93 |
-
// Build URL for connecting
|
94 |
-
$url = $jpms->get_url( array(
|
95 |
-
'name' => 'subsiteregister',
|
96 |
-
'site_id' => $item->blog_id,
|
97 |
-
) );
|
98 |
-
return '<a href="' . $url . '">Connect</a>';
|
99 |
-
}
|
100 |
-
|
101 |
-
public function get_bulk_actions() {
|
102 |
-
$actions = array(
|
103 |
-
'connect' => 'Connect',
|
104 |
-
'disconnect' => 'Disconnect'
|
105 |
-
);
|
106 |
-
|
107 |
-
return $actions;
|
108 |
-
}
|
109 |
-
|
110 |
-
function column_cb($item) {
|
111 |
-
return sprintf(
|
112 |
-
'<input type="checkbox" name="bulk[]" value="%s" />', $item->blog_id
|
113 |
-
);
|
114 |
-
}
|
115 |
-
|
116 |
-
public function process_bulk_action() {
|
117 |
-
if( !isset( $_POST['bulk'] ) || empty ( $_POST['bulk'] ) )
|
118 |
-
return; // Thou shall not pass! There is nothing to do
|
119 |
-
|
120 |
-
|
121 |
-
$jpms = Jetpack_Network::init();
|
122 |
-
|
123 |
-
$action = $this->current_action();
|
124 |
-
switch ( $action ) {
|
125 |
-
|
126 |
-
case 'connect':
|
127 |
-
foreach( $_POST['bulk'] as $k => $site ) {
|
128 |
-
$jpms->do_subsiteregister( $site );
|
129 |
-
}
|
130 |
-
break;
|
131 |
-
case 'disconnect':
|
132 |
-
foreach( $_POST['bulk'] as $k => $site ) {
|
133 |
-
$jpms->do_subsitedisconnect( $site );
|
134 |
-
}
|
135 |
-
break;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
} // end h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-network.php
DELETED
@@ -1,806 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Used to manage Jetpack installation on Multisite Network installs
|
5 |
-
*
|
6 |
-
* SINGLETON: To use call Jetpack_Network::init()
|
7 |
-
*
|
8 |
-
* DO NOT USE ANY STATIC METHODS IN THIS CLASS!!!!!!
|
9 |
-
*
|
10 |
-
* @since 2.9
|
11 |
-
*/
|
12 |
-
class Jetpack_Network {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Holds a static copy of Jetpack_Network for the singleton
|
16 |
-
*
|
17 |
-
* @since 2.9
|
18 |
-
* @var Jetpack_Network
|
19 |
-
*/
|
20 |
-
private static $instance = null;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Name of the network wide settings
|
24 |
-
*
|
25 |
-
* @since 2.9
|
26 |
-
* @var string
|
27 |
-
*/
|
28 |
-
private $settings_name = 'jetpack-network-settings';
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Defaults for settings found on the Jetpack > Settings page
|
32 |
-
*
|
33 |
-
* @since 2.9
|
34 |
-
* @var array
|
35 |
-
*/
|
36 |
-
private $setting_defaults = array(
|
37 |
-
'auto-connect' => 0,
|
38 |
-
'sub-site-connection-override' => 1,
|
39 |
-
//'manage_auto_activated_modules' => 0,
|
40 |
-
);
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Constructor
|
44 |
-
*
|
45 |
-
* @since 2.9
|
46 |
-
*/
|
47 |
-
private function __construct() {
|
48 |
-
require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); // For the is_plugin... check
|
49 |
-
require_once( JETPACK__PLUGIN_DIR . 'modules/protect/shared-functions.php' ); // For managing the global whitelist
|
50 |
-
/*
|
51 |
-
* Sanity check to ensure the install is Multisite and we
|
52 |
-
* are in Network Admin
|
53 |
-
*/
|
54 |
-
if ( is_multisite() && is_network_admin() ) {
|
55 |
-
add_action( 'network_admin_menu', array( $this, 'add_network_admin_menu' ) );
|
56 |
-
add_action( 'network_admin_edit_jetpack-network-settings', array( $this, 'save_network_settings_page' ), 10, 0 );
|
57 |
-
add_filter( 'admin_body_class', array( $this, 'body_class' ) );
|
58 |
-
|
59 |
-
if ( isset( $_GET['page'] ) && 'jetpack' == $_GET['page'] ) {
|
60 |
-
add_action( 'admin_init', array( $this, 'jetpack_sites_list' ) );
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
/*
|
65 |
-
* Things that should only run on multisite
|
66 |
-
*/
|
67 |
-
if ( is_multisite() && is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) {
|
68 |
-
add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) );
|
69 |
-
|
70 |
-
/*
|
71 |
-
* If admin wants to automagically register new sites set the hook here
|
72 |
-
*
|
73 |
-
* This is a hacky way because xmlrpc is not available on wpmu_new_blog
|
74 |
-
*/
|
75 |
-
if ( $this->get_option( 'auto-connect' ) == 1 ) {
|
76 |
-
add_action( 'wpmu_new_blog', array( $this, 'do_automatically_add_new_site' ) );
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
// Remove the toggles for 2.9, re-evaluate how they're done and added for a 3.0 release. They don't feel quite right yet.
|
81 |
-
// add_filter( 'jetpack_get_default_modules', array( $this, 'set_auto_activated_modules' ) );
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Sets which modules get activated by default on subsite connection.
|
86 |
-
* Modules can be set in Network Admin > Jetpack > Settings
|
87 |
-
*
|
88 |
-
* @since 2.9
|
89 |
-
*
|
90 |
-
* @param array $modules
|
91 |
-
*
|
92 |
-
* @return array
|
93 |
-
**/
|
94 |
-
public function set_auto_activated_modules( $modules ) {
|
95 |
-
return $modules;
|
96 |
-
|
97 |
-
/* Remove the toggles for 2.9, re-evaluate how they're done and added for a 3.0 release. They don't feel quite right yet.
|
98 |
-
if( 1 == $this->get_option( 'manage_auto_activated_modules' ) ) {
|
99 |
-
return (array) $this->get_option( 'modules' );
|
100 |
-
} else {
|
101 |
-
return $modules;
|
102 |
-
}
|
103 |
-
*/
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Registers new sites upon creation
|
108 |
-
*
|
109 |
-
* @since 2.9
|
110 |
-
* @uses wpmu_new_blog
|
111 |
-
*
|
112 |
-
* @param int $blog_id
|
113 |
-
**/
|
114 |
-
public function do_automatically_add_new_site( $blog_id ) {
|
115 |
-
$this->do_subsiteregister( $blog_id );
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Adds .network-admin class to the body tag
|
120 |
-
* Helps distinguish network admin JP styles from regular site JP styles
|
121 |
-
*
|
122 |
-
* @since 2.9
|
123 |
-
*/
|
124 |
-
public function body_class( $classes ) {
|
125 |
-
return trim( $classes ) . ' network-admin ';
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Provides access to an instance of Jetpack_Network
|
130 |
-
*
|
131 |
-
* This is how the Jetpack_Network object should *always* be accessed
|
132 |
-
*
|
133 |
-
* @since 2.9
|
134 |
-
* @return Jetpack_Network
|
135 |
-
*/
|
136 |
-
public static function init() {
|
137 |
-
if ( ! self::$instance || ! is_a( self::$instance, 'Jetpack_Network' ) ) {
|
138 |
-
self::$instance = new Jetpack_Network;
|
139 |
-
}
|
140 |
-
|
141 |
-
return self::$instance;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Registers the Multisite admin bar menu item shortcut.
|
146 |
-
* This shortcut helps users quickly and easily navigate to the Jetpack Network Admin
|
147 |
-
* menu from anywhere in their network.
|
148 |
-
*
|
149 |
-
* @since 2.9
|
150 |
-
*/
|
151 |
-
public function register_menubar() {
|
152 |
-
add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) );
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Runs when Jetpack is deactivated from the network admin plugins menu.
|
157 |
-
* Each individual site will need to have Jetpack::disconnect called on it.
|
158 |
-
* Site that had Jetpack individually enabled will not be disconnected as
|
159 |
-
* on Multisite individually activated plugins are still activated when
|
160 |
-
* a plugin is deactivated network wide.
|
161 |
-
*
|
162 |
-
* @since 2.9
|
163 |
-
**/
|
164 |
-
public function deactivate() {
|
165 |
-
// Only fire if in network admin
|
166 |
-
if ( ! is_network_admin() ) {
|
167 |
-
return;
|
168 |
-
}
|
169 |
-
|
170 |
-
$sites = $this->wp_get_sites();
|
171 |
-
|
172 |
-
foreach ( $sites as $s ) {
|
173 |
-
switch_to_blog( $s->blog_id );
|
174 |
-
$active_plugins = get_option( 'active_plugins' );
|
175 |
-
|
176 |
-
/*
|
177 |
-
* If this plugin was activated in the subsite individually
|
178 |
-
* we do not want to call disconnect. Plugins activated
|
179 |
-
* individually (before network activation) stay activated
|
180 |
-
* when the network deactivation occurs
|
181 |
-
*/
|
182 |
-
if ( ! in_array( 'jetpack/jetpack.php', $active_plugins ) ) {
|
183 |
-
Jetpack::disconnect();
|
184 |
-
}
|
185 |
-
}
|
186 |
-
restore_current_blog();
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Adds a link to the Jetpack Network Admin page in the network admin menu bar.
|
191 |
-
*
|
192 |
-
* @since 2.9
|
193 |
-
**/
|
194 |
-
public function add_to_menubar() {
|
195 |
-
global $wp_admin_bar;
|
196 |
-
// Don't show for logged out users or single site mode.
|
197 |
-
if ( ! is_user_logged_in() || ! is_multisite() ) {
|
198 |
-
return;
|
199 |
-
}
|
200 |
-
|
201 |
-
$wp_admin_bar->add_node( array(
|
202 |
-
'parent' => 'network-admin',
|
203 |
-
'id' => 'network-admin-jetpack',
|
204 |
-
'title' => __( 'Jetpack', 'jetpack' ),
|
205 |
-
'href' => $this->get_url( 'network_admin_page' ),
|
206 |
-
) );
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Returns various URL strings. Factory like
|
211 |
-
*
|
212 |
-
* $args can be a string or an array.
|
213 |
-
* If $args is an array there must be an element called name for the switch statement
|
214 |
-
*
|
215 |
-
* Currently supports:
|
216 |
-
* - subsiteregister: Pass array( 'name' => 'subsiteregister', 'site_id' => SITE_ID )
|
217 |
-
* - network_admin_page: Provides link to /wp-admin/network/JETPACK
|
218 |
-
* - subsitedisconnect: Pass array( 'name' => 'subsitedisconnect', 'site_id' => SITE_ID )
|
219 |
-
*
|
220 |
-
* @since 2.9
|
221 |
-
*
|
222 |
-
* @param Mixed $args
|
223 |
-
*
|
224 |
-
* @return String
|
225 |
-
**/
|
226 |
-
public function get_url( $args ) {
|
227 |
-
$url = null; // Default url value
|
228 |
-
|
229 |
-
if ( is_string( $args ) ) {
|
230 |
-
$name = $args;
|
231 |
-
} else {
|
232 |
-
$name = $args['name'];
|
233 |
-
}
|
234 |
-
|
235 |
-
switch ( $name ) {
|
236 |
-
case 'subsiteregister':
|
237 |
-
if ( ! isset( $args['site_id'] ) ) {
|
238 |
-
break; // If there is not a site id present we cannot go further
|
239 |
-
}
|
240 |
-
$url = network_admin_url(
|
241 |
-
'admin.php?page=jetpack&action=subsiteregister&site_id='
|
242 |
-
. $args['site_id']
|
243 |
-
);
|
244 |
-
break;
|
245 |
-
|
246 |
-
case 'network_admin_page':
|
247 |
-
$url = network_admin_url( 'admin.php?page=jetpack' );
|
248 |
-
break;
|
249 |
-
|
250 |
-
case 'subsitedisconnect':
|
251 |
-
if ( ! isset( $args['site_id'] ) ) {
|
252 |
-
break; // If there is not a site id present we cannot go further
|
253 |
-
}
|
254 |
-
$url = network_admin_url(
|
255 |
-
'admin.php?page=jetpack&action=subsitedisconnect&site_id='
|
256 |
-
. $args['site_id']
|
257 |
-
);
|
258 |
-
break;
|
259 |
-
}
|
260 |
-
|
261 |
-
return $url;
|
262 |
-
}
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Adds the Jetpack menu item to the Network Admin area
|
266 |
-
*
|
267 |
-
* @since 2.9
|
268 |
-
*/
|
269 |
-
public function add_network_admin_menu() {
|
270 |
-
add_menu_page( __( 'Jetpack', 'jetpack' ), __( 'Jetpack', 'jetpack' ), 'jetpack_network_admin_page', 'jetpack', array( $this, 'network_admin_page' ), 'div', 3 );
|
271 |
-
add_submenu_page( 'jetpack', __( 'Jetpack Sites', 'jetpack' ), __( 'Sites', 'jetpack' ), 'jetpack_network_sites_page', 'jetpack', array( $this, 'network_admin_page' ) );
|
272 |
-
add_submenu_page( 'jetpack', __( 'Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'jetpack_network_settings_page', 'jetpack-settings', array( $this, 'render_network_admin_settings_page' ) );
|
273 |
-
|
274 |
-
/**
|
275 |
-
* As jetpack_register_genericons is by default fired off a hook,
|
276 |
-
* the hook may have already fired by this point.
|
277 |
-
* So, let's just trigger it manually.
|
278 |
-
*/
|
279 |
-
require_once( JETPACK__PLUGIN_DIR . '_inc/genericons.php' );
|
280 |
-
jetpack_register_genericons();
|
281 |
-
|
282 |
-
if ( ! wp_style_is( 'jetpack-icons', 'registered' ) ) {
|
283 |
-
wp_register_style( 'jetpack-icons', plugins_url( 'css/jetpack-icons.min.css', JETPACK__PLUGIN_FILE ), false, JETPACK__VERSION );
|
284 |
-
}
|
285 |
-
|
286 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_menu_css' ) );
|
287 |
-
}
|
288 |
-
|
289 |
-
/**
|
290 |
-
* Adds JP menu icon
|
291 |
-
*
|
292 |
-
* @since 2.9
|
293 |
-
**/
|
294 |
-
function admin_menu_css() {
|
295 |
-
wp_enqueue_style( 'jetpack-icons' );
|
296 |
-
}
|
297 |
-
|
298 |
-
/**
|
299 |
-
* Provides functionality for the Jetpack > Sites page.
|
300 |
-
* Does not do the display!
|
301 |
-
*
|
302 |
-
* @since 2.9
|
303 |
-
*/
|
304 |
-
public function jetpack_sites_list() {
|
305 |
-
Jetpack::init();
|
306 |
-
|
307 |
-
if ( isset( $_GET['action'] ) ) {
|
308 |
-
switch ( $_GET['action'] ) {
|
309 |
-
case 'subsiteregister':
|
310 |
-
/*
|
311 |
-
* @todo check_admin_referer( 'jetpack-subsite-register' );
|
312 |
-
*/
|
313 |
-
Jetpack::log( 'subsiteregister' );
|
314 |
-
|
315 |
-
// If !$_GET['site_id'] stop registration and error
|
316 |
-
if ( ! isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) {
|
317 |
-
// Log error to state cookie for display later
|
318 |
-
/**
|
319 |
-
* @todo Make state messages show on Jetpack NA pages
|
320 |
-
**/
|
321 |
-
Jetpack::state( 'missing_site_id', 'Site ID must be provided to register a sub-site' );
|
322 |
-
break;
|
323 |
-
}
|
324 |
-
|
325 |
-
// Send data to register endpoint and retrieve shadow blog details
|
326 |
-
$result = $this->do_subsiteregister();
|
327 |
-
$url = $this->get_url( 'network_admin_page' );
|
328 |
-
|
329 |
-
if ( is_wp_error( $result ) ) {
|
330 |
-
$url = add_query_arg( 'action', 'connection_failed', $url );
|
331 |
-
} else {
|
332 |
-
$url = add_query_arg( 'action', 'connected', $url );
|
333 |
-
}
|
334 |
-
|
335 |
-
wp_safe_redirect( $url );
|
336 |
-
break;
|
337 |
-
|
338 |
-
case 'subsitedisconnect':
|
339 |
-
Jetpack::log( 'subsitedisconnect' );
|
340 |
-
|
341 |
-
if ( ! isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) {
|
342 |
-
Jetpack::state( 'missing_site_id', 'Site ID must be provided to disconnect a sub-site' );
|
343 |
-
break;
|
344 |
-
}
|
345 |
-
|
346 |
-
$this->do_subsitedisconnect();
|
347 |
-
break;
|
348 |
-
|
349 |
-
case 'connected':
|
350 |
-
case 'connection_failed':
|
351 |
-
add_action( 'jetpack_notices', array( $this, 'show_jetpack_notice' ) );
|
352 |
-
break;
|
353 |
-
}
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
public function show_jetpack_notice() {
|
358 |
-
if ( isset( $_GET['action'] ) && 'connected' == $_GET['action'] ) {
|
359 |
-
$notice = __( 'Site successfully connected.', 'jetpack' );
|
360 |
-
} else if ( isset( $_GET['action'] ) && 'connection_failed' == $_GET['action'] ) {
|
361 |
-
$notice = __( 'Site connection <strong>failed</strong>', 'jetpack' );
|
362 |
-
}
|
363 |
-
|
364 |
-
Jetpack::init()->load_view( 'admin/network-admin-alert.php', array( 'notice' => $notice ) );
|
365 |
-
}
|
366 |
-
|
367 |
-
/**
|
368 |
-
* Disconnect functionality for an individual site
|
369 |
-
*
|
370 |
-
* @since 2.9
|
371 |
-
* @see Jetpack_Network::jetpack_sites_list()
|
372 |
-
*/
|
373 |
-
public function do_subsitedisconnect( $site_id = null ) {
|
374 |
-
if ( ! current_user_can( 'jetpack_disconnect' ) ) {
|
375 |
-
return;
|
376 |
-
}
|
377 |
-
$site_id = ( is_null( $site_id ) ) ? $_GET['site_id'] : $site_id;
|
378 |
-
switch_to_blog( $site_id );
|
379 |
-
Jetpack::disconnect();
|
380 |
-
restore_current_blog();
|
381 |
-
}
|
382 |
-
|
383 |
-
/**
|
384 |
-
* Registers a subsite with the Jetpack servers
|
385 |
-
*
|
386 |
-
* @since 2.9
|
387 |
-
* @todo Break apart into easier to manage chunks that can be unit tested
|
388 |
-
* @see Jetpack_Network::jetpack_sites_list();
|
389 |
-
*/
|
390 |
-
public function do_subsiteregister( $site_id = null ) {
|
391 |
-
if ( ! current_user_can( 'jetpack_disconnect' ) ) {
|
392 |
-
return;
|
393 |
-
}
|
394 |
-
|
395 |
-
if ( Jetpack::is_development_mode() ) {
|
396 |
-
return;
|
397 |
-
}
|
398 |
-
|
399 |
-
$jp = Jetpack::init();
|
400 |
-
|
401 |
-
// Figure out what site we are working on
|
402 |
-
$site_id = ( is_null( $site_id ) ) ? $_GET['site_id'] : $site_id;
|
403 |
-
|
404 |
-
// Build secrets to sent to wpcom for verification
|
405 |
-
$secrets = $jp->generate_secrets();
|
406 |
-
|
407 |
-
// Remote query timeout limit
|
408 |
-
$timeout = $jp->get_remote_query_timeout_limit();
|
409 |
-
|
410 |
-
// The blog id on WordPress.com of the primary network site
|
411 |
-
$network_wpcom_blog_id = Jetpack_Options::get_option( 'id' );
|
412 |
-
|
413 |
-
/*
|
414 |
-
* Here we need to switch to the subsite
|
415 |
-
* For the registration process we really only hijack how it
|
416 |
-
* works for an individual site and pass in some extra data here
|
417 |
-
*/
|
418 |
-
switch_to_blog( $site_id );
|
419 |
-
|
420 |
-
// Save the secrets in the subsite so when the wpcom server does a pingback it
|
421 |
-
// will be able to validate the connection
|
422 |
-
Jetpack_Options::update_option( 'register',
|
423 |
-
$secrets[0] . ':' . $secrets[1] . ':' . $secrets[2]
|
424 |
-
);
|
425 |
-
|
426 |
-
// Gra info for gmt offset
|
427 |
-
$gmt_offset = get_option( 'gmt_offset' );
|
428 |
-
if ( ! $gmt_offset ) {
|
429 |
-
$gmt_offset = 0;
|
430 |
-
}
|
431 |
-
|
432 |
-
/*
|
433 |
-
* Get the stats_option option from the db.
|
434 |
-
* It looks like the server strips this out so maybe it is not necessary?
|
435 |
-
* Does it match the Jetpack site with the old stats plugin id?
|
436 |
-
*
|
437 |
-
* @todo Find out if sending the stats_id is necessary
|
438 |
-
*/
|
439 |
-
$stat_options = get_option( 'stats_options' );
|
440 |
-
$stat_id = $stat_options = isset( $stats_options['blog_id'] ) ? $stats_options['blog_id'] : null;
|
441 |
-
|
442 |
-
$args = array(
|
443 |
-
'method' => 'POST',
|
444 |
-
'body' => array(
|
445 |
-
'network_url' => $this->get_url( 'network_admin_page' ),
|
446 |
-
'network_wpcom_blog_id' => $network_wpcom_blog_id,
|
447 |
-
'siteurl' => site_url(),
|
448 |
-
'home' => home_url(),
|
449 |
-
'gmt_offset' => $gmt_offset,
|
450 |
-
'timezone_string' => (string) get_option( 'timezone_string' ),
|
451 |
-
'site_name' => (string) get_option( 'blogname' ),
|
452 |
-
'secret_1' => $secrets[0],
|
453 |
-
'secret_2' => $secrets[1],
|
454 |
-
'site_lang' => get_locale(),
|
455 |
-
'timeout' => $timeout,
|
456 |
-
'stats_id' => $stat_id, // Is this still required?
|
457 |
-
'user_id' => get_current_user_id(),
|
458 |
-
),
|
459 |
-
'headers' => array(
|
460 |
-
'Accept' => 'application/json',
|
461 |
-
),
|
462 |
-
'timeout' => $timeout,
|
463 |
-
);
|
464 |
-
|
465 |
-
// Attempt to retrieve shadow blog details
|
466 |
-
$response = Jetpack_Client::_wp_remote_request(
|
467 |
-
Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'subsiteregister' ) ), $args, true
|
468 |
-
);
|
469 |
-
|
470 |
-
/*
|
471 |
-
* $response should either be invalid or contain:
|
472 |
-
* - jetpack_id => id
|
473 |
-
* - jetpack_secret => blog_token
|
474 |
-
* - jetpack_public
|
475 |
-
*
|
476 |
-
* Store the wpcom site details
|
477 |
-
*/
|
478 |
-
$valid_response = $jp->validate_remote_register_response( $response );
|
479 |
-
|
480 |
-
if ( is_wp_error( $valid_response ) || ! $valid_response ) {
|
481 |
-
restore_current_blog();
|
482 |
-
return $valid_response;
|
483 |
-
}
|
484 |
-
|
485 |
-
// Grab the response values to work with
|
486 |
-
$code = wp_remote_retrieve_response_code( $response );
|
487 |
-
$entity = wp_remote_retrieve_body( $response );
|
488 |
-
if ( $entity ) {
|
489 |
-
$json = json_decode( $entity );
|
490 |
-
} else {
|
491 |
-
$json = false;
|
492 |
-
}
|
493 |
-
|
494 |
-
if ( empty( $json->jetpack_secret ) || ! is_string( $json->jetpack_secret ) ) {
|
495 |
-
restore_current_blog();
|
496 |
-
return new Jetpack_Error( 'jetpack_secret', '', $code );
|
497 |
-
}
|
498 |
-
|
499 |
-
if ( isset( $json->jetpack_public ) ) {
|
500 |
-
$jetpack_public = (int) $json->jetpack_public;
|
501 |
-
} else {
|
502 |
-
$jetpack_public = false;
|
503 |
-
}
|
504 |
-
|
505 |
-
Jetpack_Options::update_options( array(
|
506 |
-
'id' => (int) $json->jetpack_id,
|
507 |
-
'blog_token' => (string) $json->jetpack_secret,
|
508 |
-
'public' => $jetpack_public,
|
509 |
-
) );
|
510 |
-
|
511 |
-
/*
|
512 |
-
* Update the subsiteregister method on wpcom so that it also sends back the
|
513 |
-
* token in this same request
|
514 |
-
*/
|
515 |
-
$is_master_user = ! Jetpack::is_active();
|
516 |
-
Jetpack::update_user_token(
|
517 |
-
get_current_user_id(),
|
518 |
-
sprintf( '%s.%d', $json->token->secret, get_current_user_id() ),
|
519 |
-
$is_master_user
|
520 |
-
);
|
521 |
-
|
522 |
-
Jetpack::activate_default_modules();
|
523 |
-
|
524 |
-
restore_current_blog();
|
525 |
-
}
|
526 |
-
|
527 |
-
/**
|
528 |
-
* Handles the displaying of all sites on the network that are
|
529 |
-
* dis/connected to Jetpack
|
530 |
-
*
|
531 |
-
* @since 2.9
|
532 |
-
* @see Jetpack_Network::jetpack_sites_list()
|
533 |
-
*/
|
534 |
-
function network_admin_page() {
|
535 |
-
global $current_site;
|
536 |
-
$this->network_admin_page_header();
|
537 |
-
|
538 |
-
$jp = Jetpack::init();
|
539 |
-
|
540 |
-
// We should be, but ensure we are on the main blog
|
541 |
-
switch_to_blog( $current_site->blog_id );
|
542 |
-
$main_active = $jp->is_active();
|
543 |
-
restore_current_blog();
|
544 |
-
|
545 |
-
// If we are in dev mode, just show the notice and bail
|
546 |
-
if ( Jetpack::is_development_mode() ) {
|
547 |
-
Jetpack::show_development_mode_notice();
|
548 |
-
return;
|
549 |
-
}
|
550 |
-
|
551 |
-
/*
|
552 |
-
* Ensure the main blog is connected as all other subsite blog
|
553 |
-
* connections will feed off this one
|
554 |
-
*/
|
555 |
-
if ( ! $main_active ) {
|
556 |
-
$url = $this->get_url( array(
|
557 |
-
'name' => 'subsiteregister',
|
558 |
-
'site_id' => 1,
|
559 |
-
) );
|
560 |
-
$data = array( 'url' => $jp->build_connect_url() );
|
561 |
-
Jetpack::init()->load_view( 'admin/must-connect-main-blog.php', $data );
|
562 |
-
|
563 |
-
return;
|
564 |
-
}
|
565 |
-
|
566 |
-
require_once( 'class.jetpack-network-sites-list-table.php' );
|
567 |
-
$myListTable = new Jetpack_Network_Sites_List_Table();
|
568 |
-
echo '<div class="wrap"><h2>' . __( 'Sites', 'jetpack' ) . '</h2>';
|
569 |
-
echo '<form method="post">';
|
570 |
-
$myListTable->prepare_items();
|
571 |
-
$myListTable->display();
|
572 |
-
echo '</form></div>';
|
573 |
-
|
574 |
-
$this->network_admin_page_footer();
|
575 |
-
}
|
576 |
-
|
577 |
-
/**
|
578 |
-
* Stylized JP header formatting
|
579 |
-
*
|
580 |
-
* @since 2.9
|
581 |
-
*/
|
582 |
-
function network_admin_page_header() {
|
583 |
-
global $current_user;
|
584 |
-
|
585 |
-
$is_connected = Jetpack::is_active();
|
586 |
-
|
587 |
-
$data = array(
|
588 |
-
'is_connected' => $is_connected
|
589 |
-
);
|
590 |
-
Jetpack::init()->load_view( 'admin/network-admin-header.php', $data );
|
591 |
-
}
|
592 |
-
|
593 |
-
/**
|
594 |
-
* Stylized JP footer formatting
|
595 |
-
*
|
596 |
-
* @since 2.9
|
597 |
-
*/
|
598 |
-
function network_admin_page_footer() {
|
599 |
-
Jetpack::init()->load_view( 'admin/network-admin-footer.php' );
|
600 |
-
}
|
601 |
-
|
602 |
-
/**
|
603 |
-
* Fires when the Jetpack > Settings page is saved.
|
604 |
-
*
|
605 |
-
* @since 2.9
|
606 |
-
*/
|
607 |
-
public function save_network_settings_page() {
|
608 |
-
|
609 |
-
if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'jetpack-network-settings' ) ) {
|
610 |
-
// no nonce, push back to settings page
|
611 |
-
wp_safe_redirect(
|
612 |
-
add_query_arg(
|
613 |
-
array( 'page' => 'jetpack-settings' ),
|
614 |
-
network_admin_url( 'admin.php' )
|
615 |
-
)
|
616 |
-
);
|
617 |
-
exit();
|
618 |
-
}
|
619 |
-
|
620 |
-
// try to save the Protect whitelist before anything else, since that action can result in errors
|
621 |
-
$whitelist = str_replace( ' ', '', $_POST['global-whitelist'] );
|
622 |
-
$whitelist = explode( PHP_EOL, $whitelist );
|
623 |
-
$result = jetpack_protect_save_whitelist( $whitelist, $global = true );
|
624 |
-
if ( is_wp_error( $result ) ) {
|
625 |
-
wp_safe_redirect(
|
626 |
-
add_query_arg(
|
627 |
-
array( 'page' => 'jetpack-settings', 'error' => 'jetpack_protect_whitelist' ),
|
628 |
-
network_admin_url( 'admin.php' )
|
629 |
-
)
|
630 |
-
);
|
631 |
-
exit();
|
632 |
-
}
|
633 |
-
|
634 |
-
/*
|
635 |
-
* Fields
|
636 |
-
*
|
637 |
-
* auto-connect - Checkbox for global Jetpack connection
|
638 |
-
* sub-site-connection-override - Allow sub-site admins to (dis)reconnect with their own Jetpack account
|
639 |
-
*/
|
640 |
-
$auto_connect = 0;
|
641 |
-
if ( isset( $_POST['auto-connect'] ) ) {
|
642 |
-
$auto_connect = 1;
|
643 |
-
}
|
644 |
-
|
645 |
-
$sub_site_connection_override = 0;
|
646 |
-
if ( isset( $_POST['sub-site-connection-override'] ) ) {
|
647 |
-
$sub_site_connection_override = 1;
|
648 |
-
}
|
649 |
-
|
650 |
-
/* Remove the toggles for 2.9, re-evaluate how they're done and added for a 3.0 release. They don't feel quite right yet.
|
651 |
-
$manage_auto_activated_modules = 0;
|
652 |
-
if ( isset( $_POST['manage_auto_activated_modules'] ) ) {
|
653 |
-
$manage_auto_activated_modules = 1;
|
654 |
-
}
|
655 |
-
|
656 |
-
$modules = array();
|
657 |
-
if ( isset( $_POST['modules'] ) ) {
|
658 |
-
$modules = $_POST['modules'];
|
659 |
-
}
|
660 |
-
*/
|
661 |
-
|
662 |
-
$data = array(
|
663 |
-
'auto-connect' => $auto_connect,
|
664 |
-
'sub-site-connection-override' => $sub_site_connection_override,
|
665 |
-
//'manage_auto_activated_modules' => $manage_auto_activated_modules,
|
666 |
-
//'modules' => $modules,
|
667 |
-
);
|
668 |
-
|
669 |
-
update_site_option( $this->settings_name, $data );
|
670 |
-
wp_safe_redirect(
|
671 |
-
add_query_arg(
|
672 |
-
array( 'page' => 'jetpack-settings', 'updated' => 'true' ),
|
673 |
-
network_admin_url( 'admin.php' )
|
674 |
-
)
|
675 |
-
);
|
676 |
-
exit();
|
677 |
-
}
|
678 |
-
|
679 |
-
public function render_network_admin_settings_page() {
|
680 |
-
$this->network_admin_page_header();
|
681 |
-
$options = wp_parse_args( get_site_option( $this->settings_name ), $this->setting_defaults );
|
682 |
-
|
683 |
-
$modules = array();
|
684 |
-
$module_slugs = Jetpack::get_available_modules();
|
685 |
-
foreach ( $module_slugs as $slug ) {
|
686 |
-
$module = Jetpack::get_module( $slug );
|
687 |
-
$module['module'] = $slug;
|
688 |
-
$modules[] = $module;
|
689 |
-
}
|
690 |
-
|
691 |
-
usort( $modules, array( 'Jetpack', 'sort_modules' ) );
|
692 |
-
|
693 |
-
if ( ! isset( $options['modules'] ) ) {
|
694 |
-
$options['modules'] = $modules;
|
695 |
-
}
|
696 |
-
|
697 |
-
$data = array(
|
698 |
-
'modules' => $modules,
|
699 |
-
'options' => $options,
|
700 |
-
'jetpack_protect_whitelist' => jetpack_protect_format_whitelist(),
|
701 |
-
);
|
702 |
-
|
703 |
-
Jetpack::init()->load_view( 'admin/network-settings.php', $data );
|
704 |
-
$this->network_admin_page_footer();
|
705 |
-
}
|
706 |
-
|
707 |
-
/**
|
708 |
-
* Updates a site wide option
|
709 |
-
*
|
710 |
-
* @since 2.9
|
711 |
-
*
|
712 |
-
* @param string $key
|
713 |
-
* @param mixed $value
|
714 |
-
*
|
715 |
-
* @return boolean
|
716 |
-
**/
|
717 |
-
public function update_option( $key, $value ) {
|
718 |
-
$options = get_site_option( $this->settings_name, $this->setting_defaults );
|
719 |
-
$options[ $key ] = $value;
|
720 |
-
|
721 |
-
return update_site_option( $this->settings_name, $options );
|
722 |
-
}
|
723 |
-
|
724 |
-
/**
|
725 |
-
* Retrieves a site wide option
|
726 |
-
*
|
727 |
-
* @since 2.9
|
728 |
-
*
|
729 |
-
* @param string $name - Name of the option in the database
|
730 |
-
**/
|
731 |
-
public function get_option( $name ) {
|
732 |
-
$options = get_site_option( $this->settings_name, $this->setting_defaults );
|
733 |
-
$options = wp_parse_args( $options, $this->setting_defaults );
|
734 |
-
|
735 |
-
if ( ! isset( $options[ $name ] ) ) {
|
736 |
-
$options[ $name ] = null;
|
737 |
-
}
|
738 |
-
|
739 |
-
return $options[ $name ];
|
740 |
-
}
|
741 |
-
|
742 |
-
/**
|
743 |
-
* Return an array of sites on the specified network. If no network is specified,
|
744 |
-
* return all sites, regardless of network.
|
745 |
-
*
|
746 |
-
* @todo REMOVE THIS FUNCTION! This function is moving to core. Use that one in favor of this. WordPress::wp_get_sites(). http://codex.wordpress.org/Function_Reference/wp_get_sites NOTE, This returns an array instead of stdClass. Be sure to update class.network-sites-list-table.php
|
747 |
-
* @since 2.9
|
748 |
-
* @deprecated 2.4.5
|
749 |
-
*
|
750 |
-
* @param array|string $args Optional. Specify the status of the sites to return.
|
751 |
-
*
|
752 |
-
* @return array An array of site data
|
753 |
-
*/
|
754 |
-
public function wp_get_sites( $args = array() ) {
|
755 |
-
global $wpdb;
|
756 |
-
|
757 |
-
if ( wp_is_large_network() ) {
|
758 |
-
return;
|
759 |
-
}
|
760 |
-
|
761 |
-
$defaults = array( 'network_id' => $wpdb->siteid );
|
762 |
-
$args = wp_parse_args( $args, $defaults );
|
763 |
-
$query = "SELECT * FROM $wpdb->blogs WHERE 1=1 ";
|
764 |
-
|
765 |
-
if ( isset( $args['network_id'] ) && ( is_array( $args['network_id'] ) || is_numeric( $args['network_id'] ) ) ) {
|
766 |
-
$network_ids = array_map( 'intval', (array) $args['network_id'] );
|
767 |
-
$network_ids = implode( ',', $network_ids );
|
768 |
-
$query .= "AND site_id IN ($network_ids) ";
|
769 |
-
}
|
770 |
-
|
771 |
-
if ( isset( $args['public'] ) ) {
|
772 |
-
$query .= $wpdb->prepare( "AND public = %d ", $args['public'] );
|
773 |
-
}
|
774 |
-
|
775 |
-
if ( isset( $args['archived'] ) ) {
|
776 |
-
$query .= $wpdb->prepare( "AND archived = %d ", $args['archived'] );
|
777 |
-
}
|
778 |
-
|
779 |
-
if ( isset( $args['mature'] ) ) {
|
780 |
-
$query .= $wpdb->prepare( "AND mature = %d ", $args['mature'] );
|
781 |
-
}
|
782 |
-
|
783 |
-
if ( isset( $args['spam'] ) ) {
|
784 |
-
$query .= $wpdb->prepare( "AND spam = %d ", $args['spam'] );
|
785 |
-
}
|
786 |
-
|
787 |
-
if ( isset( $args['deleted'] ) ) {
|
788 |
-
$query .= $wpdb->prepare( "AND deleted = %d ", $args['deleted'] );
|
789 |
-
}
|
790 |
-
|
791 |
-
if ( isset( $args['exclude_blogs'] ) ) {
|
792 |
-
$query .= "AND blog_id NOT IN (" . implode( ',', $args['exclude_blogs'] ) . ")";
|
793 |
-
}
|
794 |
-
|
795 |
-
$key = 'wp_get_sites:' . md5( $query );
|
796 |
-
|
797 |
-
if ( ! $site_results = wp_cache_get( $key, 'site-id-cache' ) ) {
|
798 |
-
$site_results = (array) $wpdb->get_results( $query );
|
799 |
-
wp_cache_set( $key, $site_results, 'site-id-cache' );
|
800 |
-
}
|
801 |
-
|
802 |
-
return $site_results;
|
803 |
-
}
|
804 |
-
}
|
805 |
-
|
806 |
-
// end class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-options.php
DELETED
@@ -1,244 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Jetpack_Options {
|
4 |
-
|
5 |
-
private static $grouped_options = array(
|
6 |
-
'compact' => 'jetpack_options',
|
7 |
-
'private' => 'jetpack_private_options'
|
8 |
-
);
|
9 |
-
|
10 |
-
public static function get_option_names( $type = 'compact' ) {
|
11 |
-
switch ( $type ) {
|
12 |
-
case 'non-compact' :
|
13 |
-
case 'non_compact' :
|
14 |
-
return array(
|
15 |
-
'activated',
|
16 |
-
'active_modules',
|
17 |
-
'available_modules',
|
18 |
-
'do_activate',
|
19 |
-
'log',
|
20 |
-
'publicize',
|
21 |
-
'slideshow_background_color',
|
22 |
-
'widget_twitter',
|
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
|
30 |
-
'json_api_full_management', // (bool) Allow full management (eg. Activate, Upgrade plugins) of the site via the JSON API.
|
31 |
-
'sync_non_public_post_stati', // (bool) Allow synchronisation of posts and pages with non-public status.
|
32 |
-
'site_icon_url', // (string) url to the full site icon
|
33 |
-
'site_icon_id', // (int) Attachment id of the site icon file
|
34 |
-
'dismissed_manage_banner', // (bool) Dismiss Jetpack manage banner allows the user to dismiss the banner permanently
|
35 |
-
'restapi_stats_cache', // (array) Stats Cache data.
|
36 |
-
'unique_connection', // (array) A flag to determine a unique connection to wordpress.com two values "connected" and "disconnected" with values for how many times each has occured
|
37 |
-
'protect_whitelist' // (array) IP Address for the Protect module to ignore
|
38 |
-
);
|
39 |
-
|
40 |
-
case 'private' :
|
41 |
-
return array(
|
42 |
-
'register',
|
43 |
-
'blog_token', // (string) The Client Secret/Blog Token of this site.
|
44 |
-
'user_token', // (string) The User Token of this site. (deprecated)
|
45 |
-
'user_tokens' // (array) User Tokens for each user of this site who has connected to jetpack.wordpress.com.
|
46 |
-
);
|
47 |
-
}
|
48 |
-
|
49 |
-
return array(
|
50 |
-
'id', // (int) The Client ID/WP.com Blog ID of this site.
|
51 |
-
'publicize_connections', // (array) An array of Publicize connections from WordPress.com
|
52 |
-
'master_user', // (int) The local User ID of the user who connected this site to jetpack.wordpress.com.
|
53 |
-
'version', // (string) Used during upgrade procedure to auto-activate new modules. version:time
|
54 |
-
'old_version', // (string) Used to determine which modules are the most recently added. previous_version:time
|
55 |
-
'fallback_no_verify_ssl_certs', // (int) Flag for determining if this host must skip SSL Certificate verification due to misconfigured SSL.
|
56 |
-
'time_diff', // (int) Offset between Jetpack server's clocks and this server's clocks. Jetpack Server Time = time() + (int) Jetpack_Options::get_option( 'time_diff' )
|
57 |
-
'public', // (int|bool) If we think this site is public or not (1, 0), false if we haven't yet tried to figure it out.
|
58 |
-
'videopress', // (array) VideoPress options array.
|
59 |
-
'is_network_site', // (int|bool) If we think this site is a network or a single blog (1, 0), false if we haven't yet tried to figue it out.
|
60 |
-
'social_links', // (array) The specified links for each social networking site.
|
61 |
-
'identity_crisis_whitelist', // (array) An array of options, each having an array of the values whitelisted for it.
|
62 |
-
'gplus_authors', // (array) The Google+ authorship information for connected users.
|
63 |
-
'last_heartbeat', // (int) The timestamp of the last heartbeat that fired.
|
64 |
-
'last_security_report', // (int) The timestamp of the last security report that was run.
|
65 |
-
'sync_bulk_reindexing', // (bool) If a bulk reindex is currently underway.
|
66 |
-
'jumpstart', // (string) A flag for whether or not to show the Jump Start. Accepts: new_connection, jumpstart_activated, jetpack_action_taken, jumpstart_dismissed.
|
67 |
-
'hide_jitm' // (array) A list of just in time messages that we should not show because they have been dismissed by the user
|
68 |
-
);
|
69 |
-
}
|
70 |
-
|
71 |
-
public static function is_valid( $name, $group = null ) {
|
72 |
-
if ( is_array( $name ) ) {
|
73 |
-
$compact_names = array();
|
74 |
-
foreach ( array_keys( self::$grouped_options ) as $_group ) {
|
75 |
-
$compact_names = array_merge( $compact_names, self::get_option_names( $_group ) );
|
76 |
-
}
|
77 |
-
|
78 |
-
$result = array_diff( $name, self::get_option_names( 'non_compact' ), $compact_names );
|
79 |
-
|
80 |
-
return empty( $result );
|
81 |
-
}
|
82 |
-
|
83 |
-
if ( is_null( $group ) || 'non_compact' === $group ) {
|
84 |
-
if ( in_array( $name, self::get_option_names( $group ) ) ) {
|
85 |
-
return true;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
foreach ( array_keys( self::$grouped_options ) as $_group ) {
|
90 |
-
if ( is_null( $group ) || $group === $_group ) {
|
91 |
-
if ( in_array( $name, self::get_option_names( $_group ) ) ) {
|
92 |
-
return true;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
return false;
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate.
|
102 |
-
*
|
103 |
-
* @param string $name Option name
|
104 |
-
* @param mixed $default (optional)
|
105 |
-
*/
|
106 |
-
public static function get_option( $name, $default = false ) {
|
107 |
-
if ( self::is_valid( $name, 'non_compact' ) ) {
|
108 |
-
return get_option( "jetpack_$name", $default );
|
109 |
-
}
|
110 |
-
|
111 |
-
foreach ( array_keys( self::$grouped_options ) as $group ) {
|
112 |
-
if ( self::is_valid( $name, $group ) ) {
|
113 |
-
return self::get_grouped_option( $group, $name, $default );
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
trigger_error( sprintf( 'Invalid Jetpack option name: %s', $name ), E_USER_WARNING );
|
118 |
-
|
119 |
-
return $default;
|
120 |
-
}
|
121 |
-
|
122 |
-
private static function update_grouped_option( $group, $name, $value ) {
|
123 |
-
$options = get_option( self::$grouped_options[ $group ] );
|
124 |
-
if ( ! is_array( $options ) ) {
|
125 |
-
$options = array();
|
126 |
-
}
|
127 |
-
$options[ $name ] = $value;
|
128 |
-
|
129 |
-
return update_option( self::$grouped_options[ $group ], $options );
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Updates the single given option. Updates jetpack_options or jetpack_$name as appropriate.
|
134 |
-
*
|
135 |
-
* @param string $name Option name
|
136 |
-
* @param mixed $value Option value
|
137 |
-
* @param string $autoload If not compact option, allows specifying whether to autoload or not.
|
138 |
-
*/
|
139 |
-
public static function update_option( $name, $value, $autoload = null ) {
|
140 |
-
/**
|
141 |
-
* Fires before Jetpack updates a specific option.
|
142 |
-
*
|
143 |
-
* @since 3.0.0
|
144 |
-
*
|
145 |
-
* @param str $name The name of the option being updated.
|
146 |
-
* @param mixed $value The new value of the option.
|
147 |
-
*/
|
148 |
-
do_action( 'pre_update_jetpack_option_' . $name, $name, $value );
|
149 |
-
if ( self::is_valid( $name, 'non_compact' ) ) {
|
150 |
-
/**
|
151 |
-
* Allowing update_option to change autoload status only shipped in WordPress v4.2
|
152 |
-
* @link https://github.com/WordPress/WordPress/commit/305cf8b95
|
153 |
-
*/
|
154 |
-
if ( version_compare( $GLOBALS['wp_version'], '4.2', '>=' ) ) {
|
155 |
-
return update_option( "jetpack_$name", $value, $autoload );
|
156 |
-
}
|
157 |
-
return update_option( "jetpack_$name", $value );
|
158 |
-
}
|
159 |
-
|
160 |
-
foreach ( array_keys( self::$grouped_options ) as $group ) {
|
161 |
-
if ( self::is_valid( $name, $group ) ) {
|
162 |
-
return self::update_grouped_option( $group, $name, $value );
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
trigger_error( sprintf( 'Invalid Jetpack option name: %s', $name ), E_USER_WARNING );
|
167 |
-
|
168 |
-
return false;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Updates the multiple given options. Updates jetpack_options and/or jetpack_$name as appropriate.
|
173 |
-
*
|
174 |
-
* @param array $array array( option name => option value, ... )
|
175 |
-
*/
|
176 |
-
public static function update_options( $array ) {
|
177 |
-
$names = array_keys( $array );
|
178 |
-
|
179 |
-
foreach ( array_diff( $names, self::get_option_names(), self::get_option_names( 'non_compact' ), self::get_option_names( 'private' ) ) as $unknown_name ) {
|
180 |
-
trigger_error( sprintf( 'Invalid Jetpack option name: %s', $unknown_name ), E_USER_WARNING );
|
181 |
-
unset( $array[ $unknown_name ] );
|
182 |
-
}
|
183 |
-
|
184 |
-
foreach ( $names as $name ) {
|
185 |
-
self::update_option( $name, $array[ $name ] );
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Deletes the given option. May be passed multiple option names as an array.
|
191 |
-
* Updates jetpack_options and/or deletes jetpack_$name as appropriate.
|
192 |
-
*
|
193 |
-
* @param string|array $names
|
194 |
-
*/
|
195 |
-
public static function delete_option( $names ) {
|
196 |
-
$result = true;
|
197 |
-
$names = (array) $names;
|
198 |
-
|
199 |
-
if ( ! self::is_valid( $names ) ) {
|
200 |
-
trigger_error( sprintf( 'Invalid Jetpack option names: %s', print_r( $names, 1 ) ), E_USER_WARNING );
|
201 |
-
|
202 |
-
return false;
|
203 |
-
}
|
204 |
-
|
205 |
-
foreach ( array_intersect( $names, self::get_option_names( 'non_compact' ) ) as $name ) {
|
206 |
-
if ( ! delete_option( "jetpack_$name" ) ) {
|
207 |
-
$result = false;
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
foreach ( array_keys( self::$grouped_options ) as $group ) {
|
212 |
-
if ( ! self::delete_grouped_option( $group, $names ) ) {
|
213 |
-
$result = false;
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
return $result;
|
218 |
-
}
|
219 |
-
|
220 |
-
private static function get_grouped_option( $group, $name, $default ) {
|
221 |
-
$options = get_option( self::$grouped_options[ $group ] );
|
222 |
-
if ( is_array( $options ) && isset( $options[ $name ] ) ) {
|
223 |
-
return $options[ $name ];
|
224 |
-
}
|
225 |
-
|
226 |
-
return $default;
|
227 |
-
}
|
228 |
-
|
229 |
-
private static function delete_grouped_option( $group, $names ) {
|
230 |
-
$options = get_option( self::$grouped_options[ $group ], array() );
|
231 |
-
|
232 |
-
$to_delete = array_intersect( $names, self::get_option_names( $group ), array_keys( $options ) );
|
233 |
-
if ( $to_delete ) {
|
234 |
-
foreach ( $to_delete as $name ) {
|
235 |
-
unset( $options[ $name ] );
|
236 |
-
}
|
237 |
-
|
238 |
-
return update_option( self::$grouped_options[ $group ], $options );
|
239 |
-
}
|
240 |
-
|
241 |
-
return true;
|
242 |
-
}
|
243 |
-
|
244 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-post-images.php
CHANGED
@@ -15,18 +15,15 @@ class Jetpack_PostImages {
|
|
15 |
* If a slideshow is embedded within a post, then parse out the images involved and return them
|
16 |
*/
|
17 |
static function from_slideshow( $post_id, $width = 200, $height = 200 ) {
|
18 |
-
$images = array();
|
19 |
-
|
20 |
$post = get_post( $post_id );
|
21 |
-
if ( !empty( $post->post_password ) )
|
22 |
-
return $images;
|
23 |
|
24 |
-
if ( false ===
|
25 |
return false; // no slideshow - bail
|
26 |
-
}
|
27 |
|
28 |
$permalink = get_permalink( $post->ID );
|
29 |
|
|
|
|
|
30 |
// Mechanic: Somebody set us up the bomb
|
31 |
$old_post = $GLOBALS['post'];
|
32 |
$GLOBALS['post'] = $post;
|
@@ -82,31 +79,64 @@ class Jetpack_PostImages {
|
|
82 |
* If a gallery is detected, then get all the images from it.
|
83 |
*/
|
84 |
static function from_gallery( $post_id ) {
|
85 |
-
$images = array();
|
86 |
-
|
87 |
$post = get_post( $post_id );
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
$permalink = get_permalink( $post->ID );
|
93 |
|
94 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
-
foreach ( $
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
|
100 |
$raw_src = esc_url_raw( $raw_src ); // clean it
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
$images[] = array(
|
102 |
'type' => 'image',
|
103 |
'from' => 'gallery',
|
104 |
'src' => $raw_src,
|
105 |
-
'href' => $permalink,
|
106 |
);
|
107 |
}
|
108 |
}
|
109 |
|
|
|
|
|
|
|
|
|
110 |
return $images;
|
111 |
}
|
112 |
|
@@ -115,11 +145,6 @@ class Jetpack_PostImages {
|
|
115 |
* their dimensions are at or above a required minimum.
|
116 |
*/
|
117 |
static function from_attachment( $post_id, $width = 200, $height = 200 ) {
|
118 |
-
$images = array();
|
119 |
-
|
120 |
-
$post = get_post( $post_id );
|
121 |
-
if ( !empty( $post->post_password ) )
|
122 |
-
return $images;
|
123 |
|
124 |
$post_images = get_posts( array(
|
125 |
'post_parent' => $post_id, // Must be children of post
|
@@ -133,6 +158,8 @@ class Jetpack_PostImages {
|
|
133 |
|
134 |
$permalink = get_permalink( $post_id );
|
135 |
|
|
|
|
|
136 |
foreach ( $post_images as $post_image ) {
|
137 |
$meta = wp_get_attachment_metadata( $post_image->ID );
|
138 |
// Must be larger than 200x200
|
@@ -158,19 +185,13 @@ class Jetpack_PostImages {
|
|
158 |
* We can load up all the images found in the HTML source and then
|
159 |
* compare URLs to see if an image is attached AND inserted.
|
160 |
*/
|
161 |
-
$html_images =
|
|
|
162 |
$inserted_images = array();
|
163 |
|
164 |
foreach( $html_images as $html_image ) {
|
165 |
$src = parse_url( $html_image['src'] );
|
166 |
-
// strip off any query strings
|
167 |
-
if( ! empty( $src['scheme'] ) && ! empty( $src['host'] ) ) {
|
168 |
-
$inserted_images[] = $src['scheme'] . '://' . $src['host'] . $src['path'];
|
169 |
-
} elseif( ! empty( $src['host'] ) ) {
|
170 |
-
$inserted_images[] = set_url_scheme( 'http://' . $src['host'] . $src['path'] );
|
171 |
-
} else {
|
172 |
-
$inserted_images[] = site_url( '/' ) . $src['path'];
|
173 |
-
}
|
174 |
}
|
175 |
foreach( $images as $i => $image ) {
|
176 |
if ( !in_array( $image['src'], $inserted_images ) )
|
@@ -189,12 +210,9 @@ class Jetpack_PostImages {
|
|
189 |
static function from_thumbnail( $post_id, $width = 200, $height = 200 ) {
|
190 |
$images = array();
|
191 |
|
192 |
-
|
193 |
-
if ( !empty( $post->post_password ) )
|
194 |
-
return $images;
|
195 |
-
|
196 |
-
if ( !function_exists( 'get_post_thumbnail_id' ) )
|
197 |
return $images;
|
|
|
198 |
|
199 |
$thumb = get_post_thumbnail_id( $post_id );
|
200 |
|
@@ -207,79 +225,38 @@ class Jetpack_PostImages {
|
|
207 |
if ( !isset( $meta['height'] ) || $meta['height'] < $height )
|
208 |
return $images;
|
209 |
|
210 |
-
$
|
211 |
-
|
212 |
-
|
213 |
-
$too_big &&
|
214 |
-
(
|
215 |
-
( method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'photon' ) ) ||
|
216 |
-
( defined( 'WPCOM' ) && IS_WPCOM )
|
217 |
-
)
|
218 |
-
) {
|
219 |
-
$img_src = wp_get_attachment_image_src( $thumb, array( 1200, 1200 ) );
|
220 |
-
} else {
|
221 |
-
$img_src = wp_get_attachment_image_src( $thumb, 'full' );
|
222 |
-
}
|
223 |
-
|
224 |
-
$url = $img_src[0];
|
225 |
|
226 |
$images = array( array( // Other methods below all return an array of arrays
|
227 |
'type' => 'image',
|
228 |
'from' => 'thumbnail',
|
229 |
'src' => $url,
|
230 |
-
'src_width' => $
|
231 |
-
'src_height' => $
|
232 |
'href' => get_permalink( $thumb ),
|
233 |
) );
|
234 |
}
|
235 |
-
|
236 |
-
if ( empty( $images ) && ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
|
237 |
-
$meta_thumbnail = get_post_meta( $post_id, '_jetpack_post_thumbnail', true );
|
238 |
-
if ( ! empty( $meta_thumbnail ) ) {
|
239 |
-
if ( ! isset( $meta_thumbnail['width'] ) || $meta_thumbnail['width'] < $width ) {
|
240 |
-
return $images;
|
241 |
-
}
|
242 |
-
|
243 |
-
if ( ! isset( $meta_thumbnail['height'] ) || $meta_thumbnail['height'] < $height ) {
|
244 |
-
return $images;
|
245 |
-
}
|
246 |
-
|
247 |
-
$images = array( array( // Other methods below all return an array of arrays
|
248 |
-
'type' => 'image',
|
249 |
-
'from' => 'thumbnail',
|
250 |
-
'src' => $meta_thumbnail['URL'],
|
251 |
-
'src_width' => $meta_thumbnail['width'],
|
252 |
-
'src_height' => $meta_thumbnail['height'],
|
253 |
-
'href' => $meta_thumbnail['URL'],
|
254 |
-
) );
|
255 |
-
}
|
256 |
-
}
|
257 |
-
|
258 |
return $images;
|
259 |
}
|
260 |
|
261 |
/**
|
262 |
* Very raw -- just parse the HTML and pull out any/all img tags and return their src
|
263 |
-
* @param
|
264 |
* @return Array containing images
|
265 |
*/
|
266 |
-
static function from_html( $
|
267 |
$images = array();
|
268 |
|
269 |
-
if (
|
270 |
-
|
271 |
-
|
|
|
272 |
return $images;
|
273 |
-
|
274 |
-
$html = $post->post_content; // DO NOT apply the_content filters here, it will cause loops
|
275 |
-
} else {
|
276 |
-
$html = $html_or_id;
|
277 |
}
|
278 |
|
279 |
-
|
280 |
-
return $images;
|
281 |
-
|
282 |
-
preg_match_all( '!<img.*src=[\'"]([^"]+)[\'"].*/?>!iUs', $html, $matches );
|
283 |
if ( !empty( $matches[1] ) ) {
|
284 |
foreach ( $matches[1] as $match ) {
|
285 |
if ( stristr( $match, '/smilies/' ) )
|
@@ -303,23 +280,19 @@ class Jetpack_PostImages {
|
|
303 |
* @return Array containing details of the image, or empty array if none.
|
304 |
*/
|
305 |
static function from_blavatar( $post_id, $size = 96 ) {
|
|
|
|
|
|
|
306 |
|
307 |
$permalink = get_permalink( $post_id );
|
|
|
308 |
|
309 |
-
if (
|
310 |
-
$domain = blavatar_domain( $permalink );
|
311 |
-
|
312 |
-
if ( ! blavatar_exists( $domain ) ) {
|
313 |
-
return array();
|
314 |
-
}
|
315 |
-
|
316 |
-
$url = blavatar_url( $domain, 'img', $size );
|
317 |
-
} elseif ( function_exists( 'jetpack_has_site_icon' ) && jetpack_has_site_icon() ) {
|
318 |
-
$url = jetpack_site_icon_url( null, $size, $default = false );
|
319 |
-
} else {
|
320 |
return array();
|
321 |
}
|
322 |
|
|
|
|
|
323 |
return array( array(
|
324 |
'type' => 'image',
|
325 |
'from' => 'blavatar',
|
@@ -340,8 +313,8 @@ class Jetpack_PostImages {
|
|
340 |
$post = get_post( $post_id );
|
341 |
$permalink = get_permalink( $post_id );
|
342 |
|
343 |
-
if ( function_exists( '
|
344 |
-
$url =
|
345 |
if ( $url && is_array( $url ) ) {
|
346 |
$url = $url[0];
|
347 |
}
|
@@ -385,18 +358,8 @@ class Jetpack_PostImages {
|
|
385 |
*/
|
386 |
static function get_image( $post_id, $args = array() ) {
|
387 |
$image = '';
|
388 |
-
|
389 |
-
/**
|
390 |
-
* Fires before we find a single good image for a specific post.
|
391 |
-
*
|
392 |
-
* @since 2.2.0
|
393 |
-
*
|
394 |
-
* @param int $post_id Post ID.
|
395 |
-
*/
|
396 |
-
do_action( 'jetpack_postimages_pre_get_image', $post_id );
|
397 |
$media = self::get_images( $post_id, $args );
|
398 |
|
399 |
-
|
400 |
if ( is_array( $media ) ) {
|
401 |
foreach ( $media as $item ) {
|
402 |
if ( 'image' == $item['type'] ) {
|
@@ -406,15 +369,6 @@ class Jetpack_PostImages {
|
|
406 |
}
|
407 |
}
|
408 |
|
409 |
-
/**
|
410 |
-
* Fires after we find a single good image for a specific post.
|
411 |
-
*
|
412 |
-
* @since 2.2.0
|
413 |
-
*
|
414 |
-
* @param int $post_id Post ID.
|
415 |
-
*/
|
416 |
-
do_action( 'jetpack_postimages_post_get_image', $post_id );
|
417 |
-
|
418 |
return $image;
|
419 |
}
|
420 |
|
@@ -422,60 +376,35 @@ class Jetpack_PostImages {
|
|
422 |
* Get an array containing a collection of possible images for this post, stopping once we hit a method
|
423 |
* that returns something useful.
|
424 |
* @param int $post_id
|
425 |
-
* @param array $args Optional args,
|
426 |
* @return Array containing images that would be good for representing this post
|
427 |
*/
|
428 |
static function get_images( $post_id, $args = array() ) {
|
429 |
// Figure out which image to attach to this post.
|
430 |
$media = false;
|
431 |
|
432 |
-
/**
|
433 |
-
* Filters the array of images that would be good for a specific post.
|
434 |
-
* This filter is applied before options ($args) filter the original array.
|
435 |
-
*
|
436 |
-
* @since 2.0.0
|
437 |
-
*
|
438 |
-
* @param array $media Array of images that would be good for a specific post.
|
439 |
-
* @param int $post_id Post ID.
|
440 |
-
* @param array $args Array of options to get images.
|
441 |
-
*/
|
442 |
$media = apply_filters( 'jetpack_images_pre_get_images', $media, $post_id, $args );
|
443 |
if ( $media )
|
444 |
return $media;
|
445 |
|
446 |
$defaults = array(
|
447 |
-
'width' => 200,
|
448 |
'height' => 200, // Required minimum height (if possible to determine)
|
449 |
-
|
450 |
-
'fallback_to_avatars' => false,
|
451 |
-
'
|
452 |
-
'gravatar_default' => false, // Default image to use if we end up with no Gravatar
|
453 |
-
|
454 |
-
'from_thumbnail' => true, // Use these flags to specify which methods to use to find an image
|
455 |
-
'from_slideshow' => true,
|
456 |
-
'from_gallery' => true,
|
457 |
-
'from_attachment' => true,
|
458 |
-
'from_html' => true,
|
459 |
-
|
460 |
-
'html_content' => '' // HTML string to pass to from_html()
|
461 |
);
|
462 |
$args = wp_parse_args( $args, $defaults );
|
463 |
|
464 |
-
$media =
|
465 |
-
if (
|
466 |
-
$media = self::from_thumbnail( $post_id, $args['width'], $args['height'] );
|
467 |
-
if ( !$media && $args['from_slideshow'] )
|
468 |
$media = self::from_slideshow( $post_id, $args['width'], $args['height'] );
|
469 |
-
if ( !$media
|
470 |
$media = self::from_gallery( $post_id );
|
471 |
-
if ( !$media
|
472 |
$media = self::from_attachment( $post_id, $args['width'], $args['height'] );
|
473 |
-
if ( !$media
|
474 |
-
|
475 |
-
$media = self::from_html( $post_id ); // Use the post_id, which will load the content
|
476 |
-
else
|
477 |
-
$media = self::from_html( $args['html_content'] ); // If html_content is provided, use that
|
478 |
-
}
|
479 |
|
480 |
if ( !$media && $args['fallback_to_avatars'] ) {
|
481 |
$media = self::from_blavatar( $post_id, $args['avatar_size'] );
|
@@ -483,62 +412,6 @@ class Jetpack_PostImages {
|
|
483 |
$media = self::from_gravatar( $post_id, $args['avatar_size'], $args['gravatar_default'] );
|
484 |
}
|
485 |
|
486 |
-
/**
|
487 |
-
* Filters the array of images that would be good for a specific post.
|
488 |
-
* This filter is applied after options ($args) filter the original array.
|
489 |
-
*
|
490 |
-
* @since 2.0.0
|
491 |
-
*
|
492 |
-
* @param array $media Array of images that would be good for a specific post.
|
493 |
-
* @param int $post_id Post ID.
|
494 |
-
* @param array $args Array of options to get images.
|
495 |
-
*/
|
496 |
return apply_filters( 'jetpack_images_get_images', $media, $post_id, $args );
|
497 |
}
|
498 |
-
|
499 |
-
/**
|
500 |
-
* Takes an image URL and pixel dimensions then returns a URL for the
|
501 |
-
* resized and croped image.
|
502 |
-
*
|
503 |
-
* @param string $src
|
504 |
-
* @param int $dimension
|
505 |
-
* @return string Transformed image URL
|
506 |
-
*/
|
507 |
-
static function fit_image_url( $src, $width, $height ) {
|
508 |
-
$width = (int) $width;
|
509 |
-
$height = (int) $height;
|
510 |
-
|
511 |
-
// Umm...
|
512 |
-
if ( $width < 1 || $height < 1 ) {
|
513 |
-
return $src;
|
514 |
-
}
|
515 |
-
|
516 |
-
// See if we should bypass WordPress.com SaaS resizing
|
517 |
-
if ( has_filter( 'jetpack_images_fit_image_url_override' ) ) {
|
518 |
-
/**
|
519 |
-
* Filters the image URL used after dimensions are set by Photon.
|
520 |
-
*
|
521 |
-
* @since 3.3.0
|
522 |
-
*
|
523 |
-
* @param string $src Image URL.
|
524 |
-
* @param int $width Image width.
|
525 |
-
* @param int $width Image height.
|
526 |
-
*/
|
527 |
-
return apply_filters( 'jetpack_images_fit_image_url_override', $src, $width, $height );
|
528 |
-
}
|
529 |
-
|
530 |
-
// If WPCOM hosted image use native transformations
|
531 |
-
$img_host = parse_url( $src, PHP_URL_HOST );
|
532 |
-
if ( '.files.wordpress.com' == substr( $img_host, -20 ) ) {
|
533 |
-
return add_query_arg( array( 'w' => $width, 'h' => $height, 'crop' => 1 ), $src );
|
534 |
-
}
|
535 |
-
|
536 |
-
// Use Photon magic
|
537 |
-
if( function_exists( 'jetpack_photon_url' ) ) {
|
538 |
-
return jetpack_photon_url( $src, array( 'resize' => "$width,$height" ) );
|
539 |
-
}
|
540 |
-
|
541 |
-
// Arg... no way to resize image using WordPress.com infrastructure!
|
542 |
-
return $src;
|
543 |
-
}
|
544 |
}
|
15 |
* If a slideshow is embedded within a post, then parse out the images involved and return them
|
16 |
*/
|
17 |
static function from_slideshow( $post_id, $width = 200, $height = 200 ) {
|
|
|
|
|
18 |
$post = get_post( $post_id );
|
|
|
|
|
19 |
|
20 |
+
if ( false === strpos( $post->post_content, '[slideshow' ) )
|
21 |
return false; // no slideshow - bail
|
|
|
22 |
|
23 |
$permalink = get_permalink( $post->ID );
|
24 |
|
25 |
+
$images = array();
|
26 |
+
|
27 |
// Mechanic: Somebody set us up the bomb
|
28 |
$old_post = $GLOBALS['post'];
|
29 |
$GLOBALS['post'] = $post;
|
79 |
* If a gallery is detected, then get all the images from it.
|
80 |
*/
|
81 |
static function from_gallery( $post_id ) {
|
|
|
|
|
82 |
$post = get_post( $post_id );
|
83 |
+
|
84 |
+
if ( false === strpos( $post->post_content, '[gallery' ) )
|
85 |
+
return false; // no gallery - bail
|
86 |
|
87 |
$permalink = get_permalink( $post->ID );
|
88 |
|
89 |
+
$images = array();
|
90 |
+
|
91 |
+
// CATS: All your base are belong to us
|
92 |
+
$old_post = $GLOBALS['post'];
|
93 |
+
$GLOBALS['post'] = $post;
|
94 |
+
$old_shortcodes = $GLOBALS['shortcode_tags'];
|
95 |
+
$GLOBALS['shortcode_tags'] = array( 'gallery' => $old_shortcodes['gallery'] );
|
96 |
+
|
97 |
+
// Find all the galleries
|
98 |
+
preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $gallery_matches, PREG_SET_ORDER );
|
99 |
|
100 |
+
foreach ( $gallery_matches as $gallery_match ) {
|
101 |
+
$gallery = do_shortcode_tag( $gallery_match );
|
102 |
+
|
103 |
+
// Um... no images in the gallery - bail
|
104 |
+
if ( false === $pos = stripos( $gallery, '<img' ) )
|
105 |
+
continue;
|
106 |
+
|
107 |
+
preg_match_all( '/<img\s+[^>]*src=([\'"])([^\'"]*)\\1/', $gallery, $image_match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
108 |
+
|
109 |
+
$a_pos = 0;
|
110 |
+
foreach ( $image_match[2] as $src ) {
|
111 |
+
list( $raw_src ) = explode( '?', $src[0] ); // pull off any Query string (?w=250)
|
112 |
$raw_src = wp_specialchars_decode( $raw_src ); // rawify it
|
113 |
$raw_src = esc_url_raw( $raw_src ); // clean it
|
114 |
+
|
115 |
+
$a_pos = strrpos( substr( $gallery, 0, $src[1] ), '<a', $a_pos ); // is there surrounding <a>?
|
116 |
+
|
117 |
+
if ( false !== $a_pos && preg_match( '/<a\s+[^>]*href=([\'"])([^\'"]*)\\1/', $gallery, $href_match, 0, $a_pos ) ) {
|
118 |
+
$href = wp_specialchars_decode( $href_match[2] );
|
119 |
+
$href = esc_url_raw( $href );
|
120 |
+
} else {
|
121 |
+
// CATS: You have no chance to survive make your time
|
122 |
+
$href = $raw_src;
|
123 |
+
}
|
124 |
+
|
125 |
+
$a_pos = $src[1];
|
126 |
+
|
127 |
$images[] = array(
|
128 |
'type' => 'image',
|
129 |
'from' => 'gallery',
|
130 |
'src' => $raw_src,
|
131 |
+
'href' => $permalink, // $href,
|
132 |
);
|
133 |
}
|
134 |
}
|
135 |
|
136 |
+
// Captain: For great justice
|
137 |
+
$GLOBALS['shortcode_tags'] = $old_shortcodes;
|
138 |
+
$GLOBALS['post'] = $old_post;
|
139 |
+
|
140 |
return $images;
|
141 |
}
|
142 |
|
145 |
* their dimensions are at or above a required minimum.
|
146 |
*/
|
147 |
static function from_attachment( $post_id, $width = 200, $height = 200 ) {
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
$post_images = get_posts( array(
|
150 |
'post_parent' => $post_id, // Must be children of post
|
158 |
|
159 |
$permalink = get_permalink( $post_id );
|
160 |
|
161 |
+
$images = array();
|
162 |
+
|
163 |
foreach ( $post_images as $post_image ) {
|
164 |
$meta = wp_get_attachment_metadata( $post_image->ID );
|
165 |
// Must be larger than 200x200
|
185 |
* We can load up all the images found in the HTML source and then
|
186 |
* compare URLs to see if an image is attached AND inserted.
|
187 |
*/
|
188 |
+
$html_images = array();
|
189 |
+
$html_images = self::from_html( get_post( $post_id ) );
|
190 |
$inserted_images = array();
|
191 |
|
192 |
foreach( $html_images as $html_image ) {
|
193 |
$src = parse_url( $html_image['src'] );
|
194 |
+
$inserted_images[] = $src['scheme'] . '://' . $src['host'] . $src['path']; // strip off any query strings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
foreach( $images as $i => $image ) {
|
197 |
if ( !in_array( $image['src'], $inserted_images ) )
|
210 |
static function from_thumbnail( $post_id, $width = 200, $height = 200 ) {
|
211 |
$images = array();
|
212 |
|
213 |
+
if ( !function_exists( 'get_post_thumbnail_id' ) ) {
|
|
|
|
|
|
|
|
|
214 |
return $images;
|
215 |
+
}
|
216 |
|
217 |
$thumb = get_post_thumbnail_id( $post_id );
|
218 |
|
225 |
if ( !isset( $meta['height'] ) || $meta['height'] < $height )
|
226 |
return $images;
|
227 |
|
228 |
+
$url = wp_get_attachment_url( $thumb );
|
229 |
+
if ( stristr( $url, '?' ) )
|
230 |
+
$url = substr( $url, 0, strpos( $url, '?' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
$images = array( array( // Other methods below all return an array of arrays
|
233 |
'type' => 'image',
|
234 |
'from' => 'thumbnail',
|
235 |
'src' => $url,
|
236 |
+
'src_width' => $meta['width'],
|
237 |
+
'src_height' => $meta['height'],
|
238 |
'href' => get_permalink( $thumb ),
|
239 |
) );
|
240 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
return $images;
|
242 |
}
|
243 |
|
244 |
/**
|
245 |
* Very raw -- just parse the HTML and pull out any/all img tags and return their src
|
246 |
+
* @param str $html The HTML string to parse for images, or a post object
|
247 |
* @return Array containing images
|
248 |
*/
|
249 |
+
static function from_html( $html ) {
|
250 |
$images = array();
|
251 |
|
252 |
+
if ( is_object( $html ) ) {
|
253 |
+
if ( property_exists( $html, 'post_content' ) )
|
254 |
+
$html = apply_filters( 'the_content', $html->post_content );
|
255 |
+
else
|
256 |
return $images;
|
|
|
|
|
|
|
|
|
257 |
}
|
258 |
|
259 |
+
preg_match_all( '!<img.*src="([^"]+)".*/?>!iUs', $html, $matches );
|
|
|
|
|
|
|
260 |
if ( !empty( $matches[1] ) ) {
|
261 |
foreach ( $matches[1] as $match ) {
|
262 |
if ( stristr( $match, '/smilies/' ) )
|
280 |
* @return Array containing details of the image, or empty array if none.
|
281 |
*/
|
282 |
static function from_blavatar( $post_id, $size = 96 ) {
|
283 |
+
if ( !function_exists( 'blavatar_domain' ) || !function_exists( 'blavatar_exists' ) || !function_exists( 'blavatar_url' ) ) {
|
284 |
+
return array();
|
285 |
+
}
|
286 |
|
287 |
$permalink = get_permalink( $post_id );
|
288 |
+
$domain = blavatar_domain( $permalink );
|
289 |
|
290 |
+
if ( !blavatar_exists( $domain ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
return array();
|
292 |
}
|
293 |
|
294 |
+
$url = blavatar_url( $domain, 'img', $size );
|
295 |
+
|
296 |
return array( array(
|
297 |
'type' => 'image',
|
298 |
'from' => 'blavatar',
|
313 |
$post = get_post( $post_id );
|
314 |
$permalink = get_permalink( $post_id );
|
315 |
|
316 |
+
if ( function_exists( 'get_avatar_url' ) ) {
|
317 |
+
$url = get_avatar_url( $post->post_author, $size, $default, true );
|
318 |
if ( $url && is_array( $url ) ) {
|
319 |
$url = $url[0];
|
320 |
}
|
358 |
*/
|
359 |
static function get_image( $post_id, $args = array() ) {
|
360 |
$image = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
$media = self::get_images( $post_id, $args );
|
362 |
|
|
|
363 |
if ( is_array( $media ) ) {
|
364 |
foreach ( $media as $item ) {
|
365 |
if ( 'image' == $item['type'] ) {
|
369 |
}
|
370 |
}
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
return $image;
|
373 |
}
|
374 |
|
376 |
* Get an array containing a collection of possible images for this post, stopping once we hit a method
|
377 |
* that returns something useful.
|
378 |
* @param int $post_id
|
379 |
+
* @param array $args Optional args, curently only width and height required for images
|
380 |
* @return Array containing images that would be good for representing this post
|
381 |
*/
|
382 |
static function get_images( $post_id, $args = array() ) {
|
383 |
// Figure out which image to attach to this post.
|
384 |
$media = false;
|
385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
$media = apply_filters( 'jetpack_images_pre_get_images', $media, $post_id, $args );
|
387 |
if ( $media )
|
388 |
return $media;
|
389 |
|
390 |
$defaults = array(
|
391 |
+
'width' => 200, // Required minimum width (if possible to determine)
|
392 |
'height' => 200, // Required minimum height (if possible to determine)
|
393 |
+
'avatar_size' => 96,
|
394 |
+
'fallback_to_avatars' => false,
|
395 |
+
'gravatar_default' => false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
);
|
397 |
$args = wp_parse_args( $args, $defaults );
|
398 |
|
399 |
+
$media = self::from_thumbnail( $post_id, $args['width'], $args['height'] );
|
400 |
+
if ( !$media )
|
|
|
|
|
401 |
$media = self::from_slideshow( $post_id, $args['width'], $args['height'] );
|
402 |
+
if ( !$media )
|
403 |
$media = self::from_gallery( $post_id );
|
404 |
+
if ( !$media )
|
405 |
$media = self::from_attachment( $post_id, $args['width'], $args['height'] );
|
406 |
+
if ( !$media )
|
407 |
+
$media = self::from_html( get_post( $post_id ) );
|
|
|
|
|
|
|
|
|
408 |
|
409 |
if ( !$media && $args['fallback_to_avatars'] ) {
|
410 |
$media = self::from_blavatar( $post_id, $args['avatar_size'] );
|
412 |
$media = self::from_gravatar( $post_id, $args['avatar_size'], $args['gravatar_default'] );
|
413 |
}
|
414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
return apply_filters( 'jetpack_images_get_images', $media, $post_id, $args );
|
416 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
}
|
class.jetpack-signature.php
CHANGED
@@ -2,13 +2,12 @@
|
|
2 |
|
3 |
defined( 'JETPACK_SIGNATURE__HTTP_PORT' ) or define( 'JETPACK_SIGNATURE__HTTP_PORT' , 80 );
|
4 |
defined( 'JETPACK_SIGNATURE__HTTPS_PORT' ) or define( 'JETPACK_SIGNATURE__HTTPS_PORT', 443 );
|
5 |
-
defined( 'JETPACK__WPCOM_JSON_API_HOST' ) or define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' );
|
6 |
|
7 |
class Jetpack_Signature {
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
function
|
12 |
$secret = explode( '.', $access_token );
|
13 |
if ( 2 != count( $secret ) )
|
14 |
return;
|
@@ -57,7 +56,7 @@ class Jetpack_Signature {
|
|
57 |
}
|
58 |
}
|
59 |
|
60 |
-
$method = isset( $override['method'] ) ? $override['method'] : $_SERVER['REQUEST_METHOD'];
|
61 |
return $this->sign_request( $a['token'], $a['timestamp'], $a['nonce'], $a['body-hash'], $method, $url, $body, true );
|
62 |
}
|
63 |
|
@@ -100,7 +99,7 @@ class Jetpack_Signature {
|
|
100 |
return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' );
|
101 |
}
|
102 |
} else {
|
103 |
-
if ( $verify_body_hash && jetpack_sha1_base64( $body )
|
104 |
return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' );
|
105 |
}
|
106 |
}
|
@@ -110,10 +109,6 @@ class Jetpack_Signature {
|
|
110 |
return new Jetpack_Error( 'invalid_signature', sprintf( 'The required "%s" parameter is malformed.', 'url' ) );
|
111 |
}
|
112 |
|
113 |
-
if ( $parsed['host'] === JETPACK__WPCOM_JSON_API_HOST ) {
|
114 |
-
$parsed['host'] = 'public-api.wordpress.com';
|
115 |
-
}
|
116 |
-
|
117 |
if ( !empty( $parsed['port'] ) ) {
|
118 |
$port = $parsed['port'];
|
119 |
} else {
|
@@ -126,7 +121,7 @@ class Jetpack_Signature {
|
|
126 |
}
|
127 |
}
|
128 |
|
129 |
-
if ( !ctype_digit(
|
130 |
return new Jetpack_Error( 'invalid_signature', sprintf( 'The required "%s" parameter is malformed.', 'timestamp' ) );
|
131 |
}
|
132 |
|
2 |
|
3 |
defined( 'JETPACK_SIGNATURE__HTTP_PORT' ) or define( 'JETPACK_SIGNATURE__HTTP_PORT' , 80 );
|
4 |
defined( 'JETPACK_SIGNATURE__HTTPS_PORT' ) or define( 'JETPACK_SIGNATURE__HTTPS_PORT', 443 );
|
|
|
5 |
|
6 |
class Jetpack_Signature {
|
7 |
+
var $token;
|
8 |
+
var $secret;
|
9 |
|
10 |
+
function Jetpack_Signature( $access_token, $time_diff = 0 ) {
|
11 |
$secret = explode( '.', $access_token );
|
12 |
if ( 2 != count( $secret ) )
|
13 |
return;
|
56 |
}
|
57 |
}
|
58 |
|
59 |
+
$method = isset( $override['method'] ) ? $override['method'] : $_SERVER['REQUEST_METHOD'];
|
60 |
return $this->sign_request( $a['token'], $a['timestamp'], $a['nonce'], $a['body-hash'], $method, $url, $body, true );
|
61 |
}
|
62 |
|
99 |
return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' );
|
100 |
}
|
101 |
} else {
|
102 |
+
if ( $verify_body_hash && jetpack_sha1_base64( $body ) != $body_hash ) {
|
103 |
return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' );
|
104 |
}
|
105 |
}
|
109 |
return new Jetpack_Error( 'invalid_signature', sprintf( 'The required "%s" parameter is malformed.', 'url' ) );
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
112 |
if ( !empty( $parsed['port'] ) ) {
|
113 |
$port = $parsed['port'];
|
114 |
} else {
|
121 |
}
|
122 |
}
|
123 |
|
124 |
+
if ( !ctype_digit( $timestamp ) || 10 < strlen( $timestamp ) ) { // If Jetpack is around in 275 years, you can blame mdawaffe for the bug.
|
125 |
return new Jetpack_Error( 'invalid_signature', sprintf( 'The required "%s" parameter is malformed.', 'timestamp' ) );
|
126 |
}
|
127 |
|
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 (int) $results['results']['total'];
|
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-tracks.php
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Nosara Tracks for Jetpack
|
4 |
-
*/
|
5 |
-
|
6 |
-
require_once( dirname( __FILE__ ) . '/_inc/lib/tracks/client.php' );
|
7 |
-
|
8 |
-
class JetpackTracking {
|
9 |
-
static $product_name = 'jetpack';
|
10 |
-
|
11 |
-
static function track_jetpack_usage() {
|
12 |
-
if ( ! Jetpack::is_active() ) {
|
13 |
-
return;
|
14 |
-
}
|
15 |
-
|
16 |
-
// For tracking stuff via js/ajax
|
17 |
-
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_tracks_scripts' ) );
|
18 |
-
|
19 |
-
add_action( 'jetpack_pre_activate_module', array( __CLASS__, 'track_activate_module'), 1, 1 );
|
20 |
-
add_action( 'jetpack_pre_deactivate_module', array( __CLASS__, 'track_deactivate_module'), 1, 1 );
|
21 |
-
add_action( 'jetpack_user_authorized', array( __CLASS__, 'track_user_linked' ) );
|
22 |
-
}
|
23 |
-
|
24 |
-
static function enqueue_tracks_scripts() {
|
25 |
-
wp_enqueue_script( 'jptracks', plugins_url( '_inc/lib/tracks/tracks-ajax.js', JETPACK__PLUGIN_FILE ), array(), JETPACK__VERSION, true );
|
26 |
-
wp_localize_script( 'jptracks', 'jpTracksAJAX', array(
|
27 |
-
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
28 |
-
'jpTracksAJAX_nonce' => wp_create_nonce( 'jp-tracks-ajax-nonce' ),
|
29 |
-
) );
|
30 |
-
}
|
31 |
-
|
32 |
-
/* User has linked their account */
|
33 |
-
static function track_user_linked() {
|
34 |
-
$user_id = get_current_user_id();
|
35 |
-
$anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true );
|
36 |
-
|
37 |
-
if ( $anon_id ) {
|
38 |
-
self::record_user_event( '_aliasUser', array( 'anonId' => $anon_id ) );
|
39 |
-
delete_user_meta( $user_id, 'jetpack_tracks_anon_id' );
|
40 |
-
if ( ! headers_sent() ) {
|
41 |
-
setcookie( 'tk_ai', 'expired', time() - 1000 );
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
$wpcom_user_data = Jetpack::get_connected_user_data( $user_id );
|
46 |
-
update_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'] );
|
47 |
-
|
48 |
-
self::record_user_event( 'user_linked', array() );
|
49 |
-
}
|
50 |
-
|
51 |
-
/* Activated module */
|
52 |
-
static function track_activate_module( $module ) {
|
53 |
-
self::record_user_event( 'module_activated', array( 'module' => $module ) );
|
54 |
-
}
|
55 |
-
|
56 |
-
/* Deactivated module */
|
57 |
-
static function track_deactivate_module( $module ) {
|
58 |
-
self::record_user_event( 'module_deactivated', array( 'module' => $module ) );
|
59 |
-
}
|
60 |
-
|
61 |
-
static function record_user_event( $event_type, $data ) {
|
62 |
-
|
63 |
-
$user = wp_get_current_user();
|
64 |
-
$site_url = get_option( 'siteurl' );
|
65 |
-
|
66 |
-
$data['_via_ua'] = $_SERVER['HTTP_USER_AGENT'];
|
67 |
-
$data['_via_ip'] = $_SERVER['REMOTE_ADDR'];
|
68 |
-
$data['_lg'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
|
69 |
-
$data['blog_url'] = $site_url;
|
70 |
-
$data['blog_id'] = Jetpack_Options::get_option( 'id' );
|
71 |
-
|
72 |
-
// Top level events should not be namespaced
|
73 |
-
if ( '_aliasUser' != $event_type ) {
|
74 |
-
$event_type = self::$product_name . '_' . $event_type;
|
75 |
-
}
|
76 |
-
|
77 |
-
$data['jetpack_version'] = defined( 'JETPACK__VERSION' ) ? JETPACK__VERSION : '0';
|
78 |
-
|
79 |
-
jetpack_tracks_record_event( $user, $event_type, $data );
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
add_action( 'init', array( 'JetpackTracking', 'track_jetpack_usage' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-twitter-cards.php
DELETED
@@ -1,213 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/* Twitter Cards
|
4 |
-
*
|
5 |
-
* Hooks onto the Open Graph protocol and extends it by adding only the tags
|
6 |
-
* we need for twitter cards.
|
7 |
-
*
|
8 |
-
* @see /wp-content/blog-plugins/open-graph.php
|
9 |
-
* @see https://dev.twitter.com/cards/overview
|
10 |
-
*/
|
11 |
-
class Jetpack_Twitter_Cards {
|
12 |
-
|
13 |
-
static function twitter_cards_tags( $og_tags ) {
|
14 |
-
global $post;
|
15 |
-
|
16 |
-
if ( post_password_required() ) {
|
17 |
-
return $og_tags;
|
18 |
-
}
|
19 |
-
|
20 |
-
/** This action is documented in class.jetpack.php */
|
21 |
-
if ( apply_filters( 'jetpack_disable_twitter_cards', false ) ) {
|
22 |
-
return $og_tags;
|
23 |
-
}
|
24 |
-
|
25 |
-
/*
|
26 |
-
* These tags apply to any page (home, archives, etc)
|
27 |
-
*/
|
28 |
-
|
29 |
-
$site_tag = self::site_tag();
|
30 |
-
/** This action is documented in modules/sharedaddy/sharing-sources.php */
|
31 |
-
$site_tag = apply_filters( 'jetpack_sharing_twitter_via', $site_tag, ( is_singular() ? $post->ID : null ) );
|
32 |
-
/** This action is documented in modules/sharedaddy/sharing-sources.php */
|
33 |
-
$site_tag = apply_filters( 'jetpack_twitter_cards_site_tag', $site_tag, $og_tags );
|
34 |
-
if ( ! empty( $site_tag ) ) {
|
35 |
-
$og_tags['twitter:site'] = self::sanitize_twitter_user( $site_tag );
|
36 |
-
}
|
37 |
-
|
38 |
-
if ( ! is_singular() || ! empty( $og_tags['twitter:card'] ) ) {
|
39 |
-
return $og_tags;
|
40 |
-
}
|
41 |
-
|
42 |
-
/*
|
43 |
-
* The following tags only apply to single pages.
|
44 |
-
*/
|
45 |
-
|
46 |
-
$card_type = 'summary';
|
47 |
-
|
48 |
-
// Try to give priority to featured images
|
49 |
-
if ( class_exists('Jetpack_PostImages') ) {
|
50 |
-
$featured = Jetpack_PostImages::from_thumbnail( $post->ID, 240, 240 );
|
51 |
-
if ( !empty( $featured ) && count( $featured ) > 0 ) {
|
52 |
-
if ( (int) $featured[0]['src_width'] >= 280 && (int) $featured[0]['src_height'] >= 150 ) {
|
53 |
-
$card_type = 'summary_large_image';
|
54 |
-
$og_tags['twitter:image'] = esc_url( add_query_arg( 'w', 640, $featured[0]['src'] ) );
|
55 |
-
} else {
|
56 |
-
$og_tags['twitter:image'] = esc_url( add_query_arg( 'w', 240, $featured[0]['src'] ) );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
// Only proceed with media analysis if a featured image has not superseded it already.
|
62 |
-
if ( empty( $og_tags['twitter:image'] ) && empty( $og_tags['twitter:image:src'] ) ) {
|
63 |
-
if ( ! class_exists( 'Jetpack_Media_Summary' ) && defined('IS_WPCOM') && IS_WPCOM ) {
|
64 |
-
include( WP_CONTENT_DIR . '/lib/class.wpcom-media-summary.php' );
|
65 |
-
}
|
66 |
-
|
67 |
-
// Test again, class should already be auto-loaded in Jetpack.
|
68 |
-
// If not, skip extra media analysis and stick with a summary card
|
69 |
-
if ( class_exists( 'Jetpack_Media_Summary' ) ) {
|
70 |
-
$extract = Jetpack_Media_Summary::get( $post->ID );
|
71 |
-
|
72 |
-
if ( 'gallery' == $extract['type'] ) {
|
73 |
-
list( $og_tags, $card_type ) = self::twitter_cards_define_type_based_on_image_count( $og_tags, $extract );
|
74 |
-
} elseif ( 'video' == $extract['type'] ) {
|
75 |
-
// Leave as summary, but with large pict of poster frame (we know those comply to Twitter's size requirements)
|
76 |
-
$card_type = 'summary_large_image';
|
77 |
-
$og_tags['twitter:image'] = esc_url( add_query_arg( 'w', 640, $extract['image'] ) );
|
78 |
-
} else {
|
79 |
-
list( $og_tags, $card_type ) = self::twitter_cards_define_type_based_on_image_count( $og_tags, $extract );
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
$og_tags['twitter:card'] = $card_type;
|
85 |
-
|
86 |
-
// If we have information on the author/creator, then include that as well
|
87 |
-
if ( ! empty( $post ) && ! empty( $post->post_author ) ) {
|
88 |
-
/** This action is documented in modules/sharedaddy/sharing-sources.php */
|
89 |
-
$handle = apply_filters( 'jetpack_sharing_twitter_via', '', $post->ID );
|
90 |
-
if ( ! empty( $handle ) && 'wordpressdotcom' != $handle && 'jetpack' != $handle ) {
|
91 |
-
$og_tags['twitter:creator'] = self::sanitize_twitter_user( $handle );
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
// Make sure we have a description for Twitter, their validator isn't happy without some content (single space not valid).
|
96 |
-
if ( ! isset( $og_tags['og:description'] ) || '' == trim( $og_tags['og:description'] ) || __('Visit the post for more.', 'jetpack') == $og_tags['og:description'] ) { // empty( trim( $og_tags['og:description'] ) ) isn't valid php
|
97 |
-
$has_creator = ( ! empty($og_tags['twitter:creator']) && '@wordpressdotcom' != $og_tags['twitter:creator'] ) ? true : false;
|
98 |
-
if ( ! empty( $extract ) && 'video' == $extract['type'] ) { // use $extract['type'] since $card_type is 'summary' for video posts
|
99 |
-
$og_tags['twitter:description'] = ( $has_creator ) ? sprintf( __('Video post by %s.', 'jetpack'), $og_tags['twitter:creator'] ) : __('Video post.', 'jetpack');
|
100 |
-
} else {
|
101 |
-
$og_tags['twitter:description'] = ( $has_creator ) ? sprintf( __('Post by %s.', 'jetpack'), $og_tags['twitter:creator'] ) : __('Visit the post for more.', 'jetpack');
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
return $og_tags;
|
106 |
-
}
|
107 |
-
|
108 |
-
static function sanitize_twitter_user( $str ) {
|
109 |
-
return '@' . preg_replace( '/^@/', '', $str );
|
110 |
-
}
|
111 |
-
|
112 |
-
static function prioritize_creator_over_default_site( $site_tag, $og_tags = array() ) {
|
113 |
-
if ( ! empty( $og_tags['twitter:creator'] ) && in_array( $site_tag, array( '@wordpressdotcom', '@jetpack' ) ) ) {
|
114 |
-
$site_tag = $og_tags['twitter:creator'];
|
115 |
-
}
|
116 |
-
return $site_tag;
|
117 |
-
}
|
118 |
-
|
119 |
-
static function twitter_cards_define_type_based_on_image_count( $og_tags, $extract ) {
|
120 |
-
$card_type = 'summary';
|
121 |
-
$img_count = $extract['count']['image'];
|
122 |
-
|
123 |
-
if ( empty( $img_count ) ) {
|
124 |
-
|
125 |
-
// No images, use Blavatar as a thumbnail for the summary type.
|
126 |
-
if ( function_exists('blavatar_domain') ) {
|
127 |
-
$blavatar_domain = blavatar_domain( site_url() );
|
128 |
-
if ( blavatar_exists( $blavatar_domain ) ) {
|
129 |
-
$og_tags['twitter:image'] = blavatar_url( $blavatar_domain, 'img', 240 );
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
// Second fall back, Site Logo
|
134 |
-
if ( empty( $og_tags['twitter:image'] ) && ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) ) {
|
135 |
-
$og_tags['twitter:image'] = jetpack_get_site_logo( 'url' );
|
136 |
-
}
|
137 |
-
|
138 |
-
// Third fall back, Site Icon
|
139 |
-
if ( empty( $og_tags['twitter:image'] ) && ( function_exists( 'jetpack_has_site_icon' ) && jetpack_has_site_icon() ) ) {
|
140 |
-
$og_tags['twitter:image'] = jetpack_site_icon_url( null, '240' );
|
141 |
-
}
|
142 |
-
|
143 |
-
// Not falling back on Gravatar, because there's no way to know if we end up with an auto-generated one.
|
144 |
-
|
145 |
-
} elseif ( $img_count && ( 'image' == $extract['type'] || 'gallery' == $extract['type'] ) ) {
|
146 |
-
// Test for $extract['type'] to limit to image and gallery, so we don't send a potential fallback image like a Gravatar as a photo post.
|
147 |
-
$card_type = 'summary_large_image';
|
148 |
-
$og_tags['twitter:image'] = esc_url( add_query_arg( 'w', 1400, ( empty( $extract['images'] ) ) ? $extract['image'] : $extract['images'][0]['url'] ) );
|
149 |
-
}
|
150 |
-
|
151 |
-
return array( $og_tags, $card_type );
|
152 |
-
}
|
153 |
-
|
154 |
-
static function twitter_cards_output( $og_tag ) {
|
155 |
-
return ( false !== strpos( $og_tag, 'twitter:' ) ) ? preg_replace( '/property="([^"]+)"/', 'name="\1"', $og_tag ) : $og_tag;
|
156 |
-
}
|
157 |
-
|
158 |
-
static function settings_init() {
|
159 |
-
add_settings_section( 'jetpack-twitter-cards-settings', 'Twitter Cards', '__return_false', 'sharing' );
|
160 |
-
add_settings_field(
|
161 |
-
'jetpack-twitter-cards-site-tag',
|
162 |
-
__( 'Twitter Site Tag', 'jetpack' ),
|
163 |
-
array( __CLASS__, 'settings_field' ),
|
164 |
-
'sharing',
|
165 |
-
'jetpack-twitter-cards-settings',
|
166 |
-
array(
|
167 |
-
'label_for' => 'jetpack-twitter-cards-site-tag',
|
168 |
-
)
|
169 |
-
);
|
170 |
-
}
|
171 |
-
|
172 |
-
static function sharing_global_options() {
|
173 |
-
do_settings_fields( 'sharing', 'jetpack-twitter-cards-settings' );
|
174 |
-
}
|
175 |
-
|
176 |
-
static function site_tag() {
|
177 |
-
$site_tag = get_option( 'jetpack-twitter-cards-site-tag' );
|
178 |
-
if ( empty( $site_tag ) ) {
|
179 |
-
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
180 |
-
return 'wordpressdotcom';
|
181 |
-
} else {
|
182 |
-
return;
|
183 |
-
}
|
184 |
-
}
|
185 |
-
return $site_tag;
|
186 |
-
}
|
187 |
-
|
188 |
-
static function settings_field() {
|
189 |
-
wp_nonce_field( 'jetpack-twitter-cards-settings', 'jetpack_twitter_cards_nonce', false );
|
190 |
-
?>
|
191 |
-
<input type="text" id="jetpack-twitter-cards-site-tag" class="regular-text" name="jetpack-twitter-cards-site-tag" value="<?php echo esc_attr( get_option( 'jetpack-twitter-cards-site-tag' ) ); ?>" />
|
192 |
-
<p class="description" style="width: auto;"><?php esc_html_e( 'The Twitter username of the owner of this site\'s domain.', 'jetpack' ); ?></p>
|
193 |
-
<?php
|
194 |
-
}
|
195 |
-
|
196 |
-
static function settings_validate() {
|
197 |
-
if ( wp_verify_nonce( $_POST['jetpack_twitter_cards_nonce'], 'jetpack-twitter-cards-settings' ) ) {
|
198 |
-
update_option( 'jetpack-twitter-cards-site-tag', trim( ltrim( strip_tags( $_POST['jetpack-twitter-cards-site-tag'] ), '@' ) ) );
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
static function init() {
|
203 |
-
add_filter( 'jetpack_open_graph_tags', array( __CLASS__, 'twitter_cards_tags' ) );
|
204 |
-
add_filter( 'jetpack_open_graph_output', array( __CLASS__, 'twitter_cards_output' ) );
|
205 |
-
add_filter( 'jetpack_twitter_cards_site_tag', array( __CLASS__, 'site_tag' ), -99 );
|
206 |
-
add_filter( 'jetpack_twitter_cards_site_tag', array( __CLASS__, 'prioritize_creator_over_default_site' ), 99, 2 );
|
207 |
-
add_action( 'admin_init', array( __CLASS__, 'settings_init' ) );
|
208 |
-
add_action( 'sharing_global_options', array( __CLASS__, 'sharing_global_options' ) );
|
209 |
-
add_action( 'sharing_admin_update', array( __CLASS__, 'settings_validate' ) );
|
210 |
-
}
|
211 |
-
}
|
212 |
-
|
213 |
-
Jetpack_Twitter_Cards::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.jetpack-user-agent.php
CHANGED
@@ -10,10 +10,6 @@ function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
|
|
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 |
|
@@ -64,11 +60,11 @@ function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
|
|
64 |
|
65 |
class Jetpack_User_Agent_Info {
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
|
73 |
private $_platform = null; //Stores the device platform name
|
74 |
const PLATFORM_WINDOWS = 'windows';
|
@@ -82,9 +78,8 @@ class Jetpack_User_Agent_Info {
|
|
82 |
const PLATFORM_J2ME_MIDP = 'j2me_midp';
|
83 |
const PLATFORM_ANDROID = 'android';
|
84 |
const PLATFORM_ANDROID_TABLET = 'android_tablet';
|
85 |
-
const PLATFORM_FIREFOX_OS = 'firefoxOS';
|
86 |
|
87 |
-
|
88 |
'nokia', 'blackberry', 'philips', 'samsung', 'sanyo', 'sony', 'panasonic', 'webos',
|
89 |
'ericsson', 'alcatel', 'palm',
|
90 |
'windows ce', 'opera mini', 'series60', 'series40',
|
@@ -100,7 +95,7 @@ class Jetpack_User_Agent_Info {
|
|
100 |
);
|
101 |
|
102 |
//The constructor. Initializes default variables.
|
103 |
-
function
|
104 |
{
|
105 |
if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
106 |
$this->useragent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
@@ -144,8 +139,6 @@ class Jetpack_User_Agent_Info {
|
|
144 |
return 'webos';
|
145 |
elseif ( $this->is_S60_OSSBrowser() )
|
146 |
return 'series60';
|
147 |
-
elseif ( $this->is_firefox_os() )
|
148 |
-
return 'firefoxOS';
|
149 |
elseif ( $this->is_firefox_mobile() )
|
150 |
return 'firefox_mobile';
|
151 |
elseif ( $this->is_MaemoTablet() )
|
@@ -168,8 +161,6 @@ class Jetpack_User_Agent_Info {
|
|
168 |
return 'iphone-unknown';
|
169 |
elseif ( $this->is_ipad( 'ipad-not-safari' ) )
|
170 |
return 'ipad-unknown';
|
171 |
-
elseif ( $this->is_Nintendo_3DS() )
|
172 |
-
return 'nintendo-3ds';
|
173 |
else {
|
174 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
175 |
$dumb_agents = $this->dumb_agents;
|
@@ -237,9 +228,6 @@ class Jetpack_User_Agent_Info {
|
|
237 |
elseif ( $this->is_J2ME_platform() ) {
|
238 |
$this->_platform = self::PLATFORM_J2ME_MIDP;
|
239 |
}
|
240 |
-
elseif ( $this->is_firefox_os() ) {
|
241 |
-
$this->_platform = self::PLATFORM_FIREFOX_OS;
|
242 |
-
}
|
243 |
else
|
244 |
$this->_platform = false;
|
245 |
|
@@ -309,12 +297,6 @@ class Jetpack_User_Agent_Info {
|
|
309 |
$this->isTierRichCss = false;
|
310 |
$this->isTierGenericMobile = false;
|
311 |
}
|
312 |
-
elseif ( $this->is_firefox_os() ) {
|
313 |
-
$this->matched_agent = 'firefoxOS';
|
314 |
-
$this->isTierIphone = true;
|
315 |
-
$this->isTierRichCss = false;
|
316 |
-
$this->isTierGenericMobile = false;
|
317 |
-
}
|
318 |
elseif ( $this->is_firefox_mobile() ) {
|
319 |
$this->matched_agent = 'fennec';
|
320 |
$this->isTierIphone = true;
|
@@ -345,12 +327,6 @@ class Jetpack_User_Agent_Info {
|
|
345 |
$this->isTierRichCss = false;
|
346 |
$this->isTierGenericMobile = false;
|
347 |
}
|
348 |
-
elseif ( $this->is_Nintendo_3DS() ) {
|
349 |
-
$this->matched_agent = 'nintendo-3ds';
|
350 |
-
$this->isTierIphone = true;
|
351 |
-
$this->isTierRichCss = false;
|
352 |
-
$this->isTierGenericMobile = false;
|
353 |
-
}
|
354 |
else {
|
355 |
$this->isTierIphone = false;
|
356 |
}
|
@@ -401,7 +377,7 @@ class Jetpack_User_Agent_Info {
|
|
401 |
|
402 |
// Detects if the user is using a tablet.
|
403 |
// props Corey Gilmore, BGR.com
|
404 |
-
|
405 |
return ( 0 // never true, but makes it easier to manage our list of tablet conditions
|
406 |
|| self::is_ipad()
|
407 |
|| self::is_android_tablet()
|
@@ -411,14 +387,14 @@ class Jetpack_User_Agent_Info {
|
|
411 |
|| self::is_TouchPad()
|
412 |
);
|
413 |
}
|
414 |
-
|
415 |
/*
|
416 |
* Detects if the current UA is the default iPhone or iPod Touch Browser.
|
417 |
*
|
418 |
* DEPRECATED: use is_iphone_or_ipod
|
419 |
*
|
420 |
*/
|
421 |
-
|
422 |
|
423 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
424 |
return false;
|
@@ -445,7 +421,7 @@ class Jetpack_User_Agent_Info {
|
|
445 |
* Otherwise those browsers will be 'catched' by the iphone string.
|
446 |
*
|
447 |
*/
|
448 |
-
|
449 |
|
450 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
451 |
return false;
|
@@ -462,61 +438,61 @@ class Jetpack_User_Agent_Info {
|
|
462 |
return $is_iphone;
|
463 |
}
|
464 |
|
465 |
-
|
466 |
/*
|
467 |
* Detects if the current UA is Chrome for iOS
|
468 |
*
|
469 |
* The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum>.
|
470 |
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
|
471 |
*/
|
472 |
-
|
473 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
474 |
return false;
|
475 |
-
|
476 |
if ( self::is_iphone_or_ipod( 'iphone-safari' ) === false ) return false;
|
477 |
-
|
478 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
479 |
-
|
480 |
if ( strpos( $ua, 'crios/' ) !== false )
|
481 |
return true;
|
482 |
else
|
483 |
return false;
|
484 |
}
|
485 |
-
|
486 |
-
|
487 |
/*
|
488 |
* Detects if the current UA is Twitter for iPhone
|
489 |
-
*
|
490 |
* Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone
|
491 |
* Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
|
492 |
-
*
|
493 |
*/
|
494 |
-
|
495 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
496 |
return false;
|
497 |
-
|
498 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
499 |
|
500 |
if ( strpos( $ua, 'ipad' ) !== false )
|
501 |
return false;
|
502 |
-
|
503 |
if ( strpos( $ua, 'twitter for iphone' ) !== false )
|
504 |
return true;
|
505 |
else
|
506 |
return false;
|
507 |
}
|
508 |
-
|
509 |
/*
|
510 |
* Detects if the current UA is Twitter for iPad
|
511 |
-
*
|
512 |
* Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad
|
513 |
* Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
|
514 |
-
*
|
515 |
*/
|
516 |
-
|
517 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
518 |
return false;
|
519 |
-
|
520 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
521 |
|
522 |
if ( strpos( $ua, 'twitter for ipad' ) !== false )
|
@@ -526,7 +502,7 @@ class Jetpack_User_Agent_Info {
|
|
526 |
else
|
527 |
return false;
|
528 |
}
|
529 |
-
|
530 |
|
531 |
/*
|
532 |
* Detects if the current UA is Facebook for iPhone
|
@@ -534,7 +510,7 @@ class Jetpack_User_Agent_Info {
|
|
534 |
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0]
|
535 |
* - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US]
|
536 |
*/
|
537 |
-
|
538 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
539 |
return false;
|
540 |
|
@@ -559,7 +535,7 @@ class Jetpack_User_Agent_Info {
|
|
559 |
* - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]
|
560 |
* - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US]
|
561 |
*/
|
562 |
-
|
563 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
564 |
return false;
|
565 |
|
@@ -577,7 +553,7 @@ class Jetpack_User_Agent_Info {
|
|
577 |
/*
|
578 |
* Detects if the current UA is WordPress for iOS
|
579 |
*/
|
580 |
-
|
581 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
582 |
return false;
|
583 |
|
@@ -597,7 +573,7 @@ class Jetpack_User_Agent_Info {
|
|
597 |
* Otherwise those browsers will be 'catched' by the ipad string.
|
598 |
*
|
599 |
*/
|
600 |
-
|
601 |
|
602 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
603 |
return false;
|
@@ -622,7 +598,7 @@ class Jetpack_User_Agent_Info {
|
|
622 |
* Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1
|
623 |
* Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1
|
624 |
*/
|
625 |
-
|
626 |
|
627 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
628 |
return false;
|
@@ -636,26 +612,6 @@ class Jetpack_User_Agent_Info {
|
|
636 |
}
|
637 |
|
638 |
|
639 |
-
/*
|
640 |
-
* Detects if the current browser is FirefoxOS Native browser
|
641 |
-
*
|
642 |
-
* Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0
|
643 |
-
*
|
644 |
-
*/
|
645 |
-
static function is_firefox_os( ) {
|
646 |
-
|
647 |
-
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
648 |
-
return false;
|
649 |
-
|
650 |
-
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
651 |
-
|
652 |
-
if ( strpos( $ua, 'mozilla' ) !== false && strpos( $ua, 'mobile' ) !== false && strpos( $ua, 'gecko' ) !== false && strpos( $ua, 'firefox' ) !== false)
|
653 |
-
return true;
|
654 |
-
else
|
655 |
-
return false;
|
656 |
-
}
|
657 |
-
|
658 |
-
|
659 |
/*
|
660 |
* Detects if the current browser is Opera Mobile
|
661 |
*
|
@@ -666,9 +622,8 @@ class Jetpack_User_Agent_Info {
|
|
666 |
* The rendering engine is on Opera's server.)
|
667 |
*
|
668 |
* Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00"
|
669 |
-
* Opera/9.50 (Nintendo DSi; Opera/507; U; en-US)
|
670 |
*/
|
671 |
-
|
672 |
|
673 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
674 |
return false;
|
@@ -677,8 +632,6 @@ class Jetpack_User_Agent_Info {
|
|
677 |
|
678 |
if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false )
|
679 |
return true;
|
680 |
-
elseif ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'nintendo dsi' ) !== false )
|
681 |
-
return true;
|
682 |
else
|
683 |
return false;
|
684 |
}
|
@@ -696,7 +649,7 @@ class Jetpack_User_Agent_Info {
|
|
696 |
* Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54
|
697 |
*
|
698 |
*/
|
699 |
-
|
700 |
|
701 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
702 |
return false;
|
@@ -713,7 +666,7 @@ class Jetpack_User_Agent_Info {
|
|
713 |
* Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc)
|
714 |
* Used to send users on dumb devices to m.wor
|
715 |
*/
|
716 |
-
|
717 |
|
718 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
719 |
return false;
|
@@ -737,7 +690,7 @@ class Jetpack_User_Agent_Info {
|
|
737 |
* Opera Mini 5 Beta: Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.15650/756; U; en) Presto/2.2.0
|
738 |
* Opera Mini 8: Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)
|
739 |
*/
|
740 |
-
|
741 |
_deprecated_function( __FUNCTION__, 'always', 'is_opera_mini() or is_opera_mobile()' );
|
742 |
|
743 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
@@ -759,7 +712,7 @@ class Jetpack_User_Agent_Info {
|
|
759 |
* Detects if the current browser is a Windows Phone 7 device.
|
760 |
* ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)
|
761 |
*/
|
762 |
-
|
763 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
764 |
return false;
|
765 |
|
@@ -779,10 +732,10 @@ class Jetpack_User_Agent_Info {
|
|
779 |
* Detects if the current browser is a Windows Phone 8 device.
|
780 |
* ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device> [;<Operator>])
|
781 |
*/
|
782 |
-
|
783 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
784 |
return false;
|
785 |
-
|
786 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
787 |
if ( strpos( $ua, 'windows phone 8' ) === false ) {
|
788 |
return false;
|
@@ -790,8 +743,8 @@ class Jetpack_User_Agent_Info {
|
|
790 |
return true;
|
791 |
}
|
792 |
}
|
793 |
-
|
794 |
-
|
795 |
/*
|
796 |
* Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad.
|
797 |
*
|
@@ -799,7 +752,7 @@ class Jetpack_User_Agent_Info {
|
|
799 |
* ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1
|
800 |
*
|
801 |
*/
|
802 |
-
|
803 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
804 |
return false;
|
805 |
|
@@ -822,7 +775,7 @@ class Jetpack_User_Agent_Info {
|
|
822 |
* TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0
|
823 |
*
|
824 |
*/
|
825 |
-
|
826 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
827 |
return false;
|
828 |
|
@@ -848,7 +801,7 @@ class Jetpack_User_Agent_Info {
|
|
848 |
* Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344
|
849 |
*
|
850 |
*/
|
851 |
-
|
852 |
|
853 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
854 |
return false;
|
@@ -878,7 +831,7 @@ class Jetpack_User_Agent_Info {
|
|
878 |
* Detects if the device platform is the Symbian Series 60.
|
879 |
*
|
880 |
*/
|
881 |
-
|
882 |
|
883 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
884 |
return false;
|
@@ -911,7 +864,7 @@ class Jetpack_User_Agent_Info {
|
|
911 |
* This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
|
912 |
*
|
913 |
*/
|
914 |
-
|
915 |
|
916 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
917 |
return false;
|
@@ -926,7 +879,7 @@ class Jetpack_User_Agent_Info {
|
|
926 |
return false;
|
927 |
}
|
928 |
|
929 |
-
|
930 |
|
931 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
932 |
return false;
|
@@ -946,7 +899,7 @@ class Jetpack_User_Agent_Info {
|
|
946 |
/*
|
947 |
* Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.
|
948 |
*/
|
949 |
-
|
950 |
|
951 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
952 |
return false;
|
@@ -969,7 +922,7 @@ class Jetpack_User_Agent_Info {
|
|
969 |
/*
|
970 |
* Detects if the current UA is a MeeGo device (Nokia Smartphone).
|
971 |
*/
|
972 |
-
|
973 |
|
974 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
975 |
return false;
|
@@ -990,7 +943,7 @@ class Jetpack_User_Agent_Info {
|
|
990 |
/*
|
991 |
is_webkit() can be used to check the User Agent for an webkit generic browser
|
992 |
*/
|
993 |
-
|
994 |
|
995 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
996 |
return false;
|
@@ -1009,7 +962,7 @@ class Jetpack_User_Agent_Info {
|
|
1009 |
* Detects if the current browser is the Native Android browser.
|
1010 |
* @return boolean true if the browser is Android otherwise false
|
1011 |
*/
|
1012 |
-
|
1013 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1014 |
return false;
|
1015 |
|
@@ -1032,7 +985,7 @@ class Jetpack_User_Agent_Info {
|
|
1032 |
*
|
1033 |
* @return boolean true if the browser is Android and not 'mobile' otherwise false
|
1034 |
*/
|
1035 |
-
|
1036 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1037 |
return false;
|
1038 |
|
@@ -1059,7 +1012,7 @@ class Jetpack_User_Agent_Info {
|
|
1059 |
*
|
1060 |
* @return boolean true if the browser is Kindle Fire Native browser otherwise false
|
1061 |
*/
|
1062 |
-
|
1063 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1064 |
return false;
|
1065 |
|
@@ -1080,7 +1033,7 @@ class Jetpack_User_Agent_Info {
|
|
1080 |
*
|
1081 |
* @return boolean true if the browser is Kindle monochrome Native browser otherwise false
|
1082 |
*/
|
1083 |
-
|
1084 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1085 |
return false;
|
1086 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
@@ -1093,7 +1046,7 @@ class Jetpack_User_Agent_Info {
|
|
1093 |
|
1094 |
|
1095 |
// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
|
1096 |
-
|
1097 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1098 |
return false;
|
1099 |
|
@@ -1106,10 +1059,10 @@ class Jetpack_User_Agent_Info {
|
|
1106 |
}
|
1107 |
|
1108 |
// Detect if user agent is the WordPress.com Windows 8 app.
|
1109 |
-
|
1110 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1111 |
return false;
|
1112 |
-
|
1113 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1114 |
$pos = strpos( $agent, 'wp-windows8' );
|
1115 |
if ( $pos !== false )
|
@@ -1117,15 +1070,15 @@ class Jetpack_User_Agent_Info {
|
|
1117 |
else
|
1118 |
return false;
|
1119 |
}
|
1120 |
-
|
1121 |
-
|
1122 |
/*
|
1123 |
* is_blackberry_tablet() can be used to check the User Agent for a RIM blackberry tablet
|
1124 |
* The user agent of the BlackBerry® Tablet OS follows a format similar to the following:
|
1125 |
* Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+
|
1126 |
*
|
1127 |
*/
|
1128 |
-
|
1129 |
|
1130 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1131 |
return false;
|
@@ -1146,13 +1099,13 @@ class Jetpack_User_Agent_Info {
|
|
1146 |
is_blackbeberry() can be used to check the User Agent for a blackberry device
|
1147 |
Note that opera mini on BB matches this rule.
|
1148 |
*/
|
1149 |
-
|
1150 |
|
1151 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1152 |
return false;
|
1153 |
|
1154 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1155 |
-
|
1156 |
$pos_blackberry = strpos( $agent, 'blackberry' );
|
1157 |
if ( $pos_blackberry !== false ) {
|
1158 |
if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() )
|
@@ -1167,7 +1120,7 @@ class Jetpack_User_Agent_Info {
|
|
1167 |
/*
|
1168 |
is_blackberry_10() can be used to check the User Agent for a BlackBerry 10 device.
|
1169 |
*/
|
1170 |
-
|
1171 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1172 |
return ( strpos( $agent, 'bb10' ) !== false ) && ( strpos( $agent, 'mobile' ) !== false );
|
1173 |
}
|
@@ -1188,52 +1141,50 @@ class Jetpack_User_Agent_Info {
|
|
1188 |
* @return string Version of the BB OS.
|
1189 |
* If version is not found, get_blackbeberry_OS_version will return boolean false.
|
1190 |
*/
|
1191 |
-
|
1192 |
|
1193 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1194 |
return false;
|
1195 |
|
1196 |
-
if ( self::is_blackberry_10() )
|
1197 |
return 'blackberry-10';
|
1198 |
-
|
1199 |
-
|
1200 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1201 |
|
1202 |
$pos_blackberry = stripos( $agent, 'blackberry' );
|
1203 |
if ( $pos_blackberry === false ) {
|
1204 |
-
//
|
1205 |
return false;
|
1206 |
}
|
1207 |
|
1208 |
-
//
|
1209 |
-
//
|
1210 |
-
//
|
1211 |
-
//
|
1212 |
$pos_webkit = stripos( $agent, 'webkit' );
|
1213 |
if ( $pos_webkit !== false ) {
|
1214 |
-
//
|
1215 |
$pos_torch = stripos( $agent, 'BlackBerry 9800' );
|
1216 |
if ( $pos_torch !== false ) {
|
1217 |
-
return 'blackberry-torch'; //
|
1218 |
} else {
|
1219 |
-
//
|
1220 |
if ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) {
|
1221 |
$version = $matches[1];
|
1222 |
$version_num = explode( '.', $version );
|
1223 |
-
if
|
1224 |
-
return 'blackberry-6'; //
|
1225 |
-
|
1226 |
-
|
1227 |
-
}
|
1228 |
} else {
|
1229 |
-
//
|
1230 |
-
return 'blackberry-6'; //
|
1231 |
}
|
1232 |
}
|
1233 |
}
|
1234 |
|
1235 |
-
//
|
1236 |
-
//
|
1237 |
if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
|
1238 |
$version = $matches[1];
|
1239 |
} else {
|
@@ -1242,9 +1193,8 @@ class Jetpack_User_Agent_Info {
|
|
1242 |
|
1243 |
$version_num = explode( '.', $version );
|
1244 |
|
1245 |
-
if
|
1246 |
return false;
|
1247 |
-
}
|
1248 |
if ( $version_num[0] == 5 ) {
|
1249 |
return 'blackberry-5';
|
1250 |
} elseif ( $version_num[0] == 4 && $version_num[1] == 7 ) {
|
@@ -1257,6 +1207,7 @@ class Jetpack_User_Agent_Info {
|
|
1257 |
return false;
|
1258 |
}
|
1259 |
|
|
|
1260 |
}
|
1261 |
|
1262 |
/**
|
@@ -1272,21 +1223,19 @@ class Jetpack_User_Agent_Info {
|
|
1272 |
* @return string Type of the BB browser.
|
1273 |
* If browser's version is not found, detect_blackbeberry_browser_version will return boolean false.
|
1274 |
*/
|
1275 |
-
|
1276 |
|
1277 |
-
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1278 |
-
|
1279 |
-
}
|
1280 |
|
1281 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1282 |
|
1283 |
-
if ( self::is_blackberry_10() )
|
1284 |
return 'blackberry-10';
|
1285 |
-
|
1286 |
-
|
1287 |
$pos_blackberry = strpos( $agent, 'blackberry' );
|
1288 |
if ( $pos_blackberry === false ) {
|
1289 |
-
//
|
1290 |
return false;
|
1291 |
}
|
1292 |
|
@@ -1298,14 +1247,13 @@ class Jetpack_User_Agent_Info {
|
|
1298 |
if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
|
1299 |
$version = $matches[1];
|
1300 |
} else {
|
1301 |
-
return false; //
|
1302 |
}
|
1303 |
|
1304 |
$version_num = explode( '.', $version );
|
1305 |
|
1306 |
-
if
|
1307 |
-
|
1308 |
-
}
|
1309 |
|
1310 |
if ( $version_num[0] == 5 ) {
|
1311 |
return 'blackberry-5';
|
@@ -1314,15 +1262,15 @@ class Jetpack_User_Agent_Info {
|
|
1314 |
} elseif ( $version_num[0] == 4 && $version_num[1] == 6 ) {
|
1315 |
return 'blackberry-4.6';
|
1316 |
} else {
|
1317 |
-
//
|
1318 |
return false;
|
1319 |
}
|
1320 |
}
|
1321 |
-
|
1322 |
}
|
1323 |
|
1324 |
-
//
|
1325 |
-
|
1326 |
|
1327 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1328 |
return false;
|
@@ -1346,70 +1294,38 @@ class Jetpack_User_Agent_Info {
|
|
1346 |
return false;
|
1347 |
}
|
1348 |
|
1349 |
-
/*
|
1350 |
-
* Detects if the current browser is Nintendo 3DS handheld.
|
1351 |
-
*
|
1352 |
-
* example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US
|
1353 |
-
* can differ in language, version and region
|
1354 |
-
*/
|
1355 |
-
static function is_Nintendo_3DS() {
|
1356 |
-
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
1357 |
-
return false;
|
1358 |
-
}
|
1359 |
-
|
1360 |
-
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1361 |
-
if ( strpos( $ua, 'nintendo 3ds' ) !== false ) {
|
1362 |
-
return true;
|
1363 |
-
}
|
1364 |
-
return false;
|
1365 |
-
}
|
1366 |
-
|
1367 |
-
/**
|
1368 |
-
* Was the current request made by a known bot?
|
1369 |
-
*
|
1370 |
-
* @return boolean
|
1371 |
-
*/
|
1372 |
static function is_bot() {
|
1373 |
-
static $is_bot =
|
1374 |
-
|
1375 |
-
if ( is_null( $is_bot ) ) {
|
1376 |
-
$is_bot = Jetpack_User_Agent_Info::is_bot_user_agent( $_SERVER['HTTP_USER_AGENT'] );
|
1377 |
-
}
|
1378 |
|
1379 |
-
|
1380 |
-
|
1381 |
|
1382 |
-
|
1383 |
-
|
1384 |
-
* If you want an is_bot check for the current request's UA, use is_bot() instead of passing a user-agent to this method.
|
1385 |
-
*
|
1386 |
-
* @param $ua (string) A user-agent string
|
1387 |
-
* @return boolean
|
1388 |
-
*/
|
1389 |
-
static function is_bot_user_agent( $ua = null ) {
|
1390 |
|
1391 |
-
|
1392 |
-
|
|
|
|
|
|
|
1393 |
|
1394 |
-
|
1395 |
-
'alexa', 'altavista', 'ask jeeves', 'attentio', 'baiduspider', 'bingbot', 'chtml generic', 'crawler', 'fastmobilecrawl',
|
1396 |
-
'feedfetcher-google', 'firefly', 'froogle', 'gigabot', 'googlebot', 'googlebot-mobile', 'heritrix', 'ia_archiver', 'irlbot',
|
1397 |
-
'iescholar', 'infoseek', 'jumpbot', 'lycos', 'mediapartners', 'mediobot', 'motionbot', 'msnbot', 'mshots', 'openbot',
|
1398 |
-
'pss-webkit-request', 'pythumbnail', 'scooter', 'slurp', 'snapbot', 'spider', 'taptubot', 'technoratisnoop',
|
1399 |
-
'teoma', 'twiceler', 'yahooseeker', 'yahooysmcm', 'yammybot', 'ahrefsbot', 'pingdom.com_bot', 'kraken', 'yandexbot',
|
1400 |
-
'twitterbot', 'tweetmemebot', 'openhosebot', 'queryseekerspider', 'linkdexbot', 'grokkit-crawler',
|
1401 |
-
'livelapbot', 'germcrawler', 'domaintunocrawler', 'grapeshotcrawler', 'cloudflare-alwaysonline',
|
1402 |
-
);
|
1403 |
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1407 |
}
|
1408 |
}
|
1409 |
|
1410 |
-
return
|
1411 |
}
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
}
|
10 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) || strpos( strtolower( $_SERVER['HTTP_USER_AGENT'] ), 'ipad' ) )
|
11 |
return false;
|
12 |
|
|
|
|
|
|
|
|
|
13 |
if( $ua_info->is_android_tablet() && $ua_info->is_kindle_touch() === false )
|
14 |
return false;
|
15 |
|
60 |
|
61 |
class Jetpack_User_Agent_Info {
|
62 |
|
63 |
+
var $useragent;
|
64 |
+
var $matched_agent;
|
65 |
+
var $isTierIphone; //Stores whether is the iPhone tier of devices.
|
66 |
+
var $isTierRichCss; //Stores whether the device can probably support Rich CSS, but JavaScript (jQuery) support is not assumed.
|
67 |
+
var $isTierGenericMobile; //Stores whether it is another mobile device, which cannot be assumed to support CSS or JS (eg, older BlackBerry, RAZR)
|
68 |
|
69 |
private $_platform = null; //Stores the device platform name
|
70 |
const PLATFORM_WINDOWS = 'windows';
|
78 |
const PLATFORM_J2ME_MIDP = 'j2me_midp';
|
79 |
const PLATFORM_ANDROID = 'android';
|
80 |
const PLATFORM_ANDROID_TABLET = 'android_tablet';
|
|
|
81 |
|
82 |
+
var $dumb_agents = array(
|
83 |
'nokia', 'blackberry', 'philips', 'samsung', 'sanyo', 'sony', 'panasonic', 'webos',
|
84 |
'ericsson', 'alcatel', 'palm',
|
85 |
'windows ce', 'opera mini', 'series60', 'series40',
|
95 |
);
|
96 |
|
97 |
//The constructor. Initializes default variables.
|
98 |
+
function Jetpack_User_Agent_Info()
|
99 |
{
|
100 |
if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
101 |
$this->useragent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
139 |
return 'webos';
|
140 |
elseif ( $this->is_S60_OSSBrowser() )
|
141 |
return 'series60';
|
|
|
|
|
142 |
elseif ( $this->is_firefox_mobile() )
|
143 |
return 'firefox_mobile';
|
144 |
elseif ( $this->is_MaemoTablet() )
|
161 |
return 'iphone-unknown';
|
162 |
elseif ( $this->is_ipad( 'ipad-not-safari' ) )
|
163 |
return 'ipad-unknown';
|
|
|
|
|
164 |
else {
|
165 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
166 |
$dumb_agents = $this->dumb_agents;
|
228 |
elseif ( $this->is_J2ME_platform() ) {
|
229 |
$this->_platform = self::PLATFORM_J2ME_MIDP;
|
230 |
}
|
|
|
|
|
|
|
231 |
else
|
232 |
$this->_platform = false;
|
233 |
|
297 |
$this->isTierRichCss = false;
|
298 |
$this->isTierGenericMobile = false;
|
299 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
elseif ( $this->is_firefox_mobile() ) {
|
301 |
$this->matched_agent = 'fennec';
|
302 |
$this->isTierIphone = true;
|
327 |
$this->isTierRichCss = false;
|
328 |
$this->isTierGenericMobile = false;
|
329 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
else {
|
331 |
$this->isTierIphone = false;
|
332 |
}
|
377 |
|
378 |
// Detects if the user is using a tablet.
|
379 |
// props Corey Gilmore, BGR.com
|
380 |
+
function is_tablet() {
|
381 |
return ( 0 // never true, but makes it easier to manage our list of tablet conditions
|
382 |
|| self::is_ipad()
|
383 |
|| self::is_android_tablet()
|
387 |
|| self::is_TouchPad()
|
388 |
);
|
389 |
}
|
390 |
+
|
391 |
/*
|
392 |
* Detects if the current UA is the default iPhone or iPod Touch Browser.
|
393 |
*
|
394 |
* DEPRECATED: use is_iphone_or_ipod
|
395 |
*
|
396 |
*/
|
397 |
+
function is_iphoneOrIpod(){
|
398 |
|
399 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
400 |
return false;
|
421 |
* Otherwise those browsers will be 'catched' by the iphone string.
|
422 |
*
|
423 |
*/
|
424 |
+
function is_iphone_or_ipod( $type = 'iphone-any' ) {
|
425 |
|
426 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
427 |
return false;
|
438 |
return $is_iphone;
|
439 |
}
|
440 |
|
441 |
+
|
442 |
/*
|
443 |
* Detects if the current UA is Chrome for iOS
|
444 |
*
|
445 |
* The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/<ChromeRevision> instead of Version/<VersionNum>.
|
446 |
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3
|
447 |
*/
|
448 |
+
function is_chrome_for_iOS( ) {
|
449 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
450 |
return false;
|
451 |
+
|
452 |
if ( self::is_iphone_or_ipod( 'iphone-safari' ) === false ) return false;
|
453 |
+
|
454 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
455 |
+
|
456 |
if ( strpos( $ua, 'crios/' ) !== false )
|
457 |
return true;
|
458 |
else
|
459 |
return false;
|
460 |
}
|
461 |
+
|
462 |
+
|
463 |
/*
|
464 |
* Detects if the current UA is Twitter for iPhone
|
465 |
+
*
|
466 |
* Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone
|
467 |
* Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
|
468 |
+
*
|
469 |
*/
|
470 |
+
function is_twitter_for_iphone( ) {
|
471 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
472 |
return false;
|
473 |
+
|
474 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
475 |
|
476 |
if ( strpos( $ua, 'ipad' ) !== false )
|
477 |
return false;
|
478 |
+
|
479 |
if ( strpos( $ua, 'twitter for iphone' ) !== false )
|
480 |
return true;
|
481 |
else
|
482 |
return false;
|
483 |
}
|
484 |
+
|
485 |
/*
|
486 |
* Detects if the current UA is Twitter for iPad
|
487 |
+
*
|
488 |
* Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad
|
489 |
* Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone
|
490 |
+
*
|
491 |
*/
|
492 |
+
function is_twitter_for_ipad( ) {
|
493 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
494 |
return false;
|
495 |
+
|
496 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
497 |
|
498 |
if ( strpos( $ua, 'twitter for ipad' ) !== false )
|
502 |
else
|
503 |
return false;
|
504 |
}
|
505 |
+
|
506 |
|
507 |
/*
|
508 |
* Detects if the current UA is Facebook for iPhone
|
510 |
* - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0]
|
511 |
* - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US]
|
512 |
*/
|
513 |
+
function is_facebook_for_iphone( ) {
|
514 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
515 |
return false;
|
516 |
|
535 |
* - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0]
|
536 |
* - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US]
|
537 |
*/
|
538 |
+
function is_facebook_for_ipad( ) {
|
539 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
540 |
return false;
|
541 |
|
553 |
/*
|
554 |
* Detects if the current UA is WordPress for iOS
|
555 |
*/
|
556 |
+
function is_wordpress_for_ios( ) {
|
557 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
558 |
return false;
|
559 |
|
573 |
* Otherwise those browsers will be 'catched' by the ipad string.
|
574 |
*
|
575 |
*/
|
576 |
+
function is_ipad( $type = 'ipad-any' ) {
|
577 |
|
578 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
579 |
return false;
|
598 |
* Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1
|
599 |
* Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1
|
600 |
*/
|
601 |
+
function is_firefox_mobile( ) {
|
602 |
|
603 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
604 |
return false;
|
612 |
}
|
613 |
|
614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
615 |
/*
|
616 |
* Detects if the current browser is Opera Mobile
|
617 |
*
|
622 |
* The rendering engine is on Opera's server.)
|
623 |
*
|
624 |
* Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00"
|
|
|
625 |
*/
|
626 |
+
function is_opera_mobile( ) {
|
627 |
|
628 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
629 |
return false;
|
632 |
|
633 |
if ( strpos( $ua, 'opera' ) !== false && strpos( $ua, 'mobi' ) !== false )
|
634 |
return true;
|
|
|
|
|
635 |
else
|
636 |
return false;
|
637 |
}
|
649 |
* Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54
|
650 |
*
|
651 |
*/
|
652 |
+
function is_opera_mini( ) {
|
653 |
|
654 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
655 |
return false;
|
666 |
* Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc)
|
667 |
* Used to send users on dumb devices to m.wor
|
668 |
*/
|
669 |
+
function is_opera_mini_dumb( ) {
|
670 |
|
671 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
672 |
return false;
|
690 |
* Opera Mini 5 Beta: Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.15650/756; U; en) Presto/2.2.0
|
691 |
* Opera Mini 8: Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)
|
692 |
*/
|
693 |
+
function is_OperaMobile() {
|
694 |
_deprecated_function( __FUNCTION__, 'always', 'is_opera_mini() or is_opera_mobile()' );
|
695 |
|
696 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
712 |
* Detects if the current browser is a Windows Phone 7 device.
|
713 |
* ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910)
|
714 |
*/
|
715 |
+
function is_WindowsPhone7() {
|
716 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
717 |
return false;
|
718 |
|
732 |
* Detects if the current browser is a Windows Phone 8 device.
|
733 |
* ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; <Manufacturer>; <Device> [;<Operator>])
|
734 |
*/
|
735 |
+
function is_windows_phone_8() {
|
736 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
737 |
return false;
|
738 |
+
|
739 |
$ua = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
740 |
if ( strpos( $ua, 'windows phone 8' ) === false ) {
|
741 |
return false;
|
743 |
return true;
|
744 |
}
|
745 |
}
|
746 |
+
|
747 |
+
|
748 |
/*
|
749 |
* Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad.
|
750 |
*
|
752 |
* ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1
|
753 |
*
|
754 |
*/
|
755 |
+
function is_PalmWebOS() {
|
756 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
757 |
return false;
|
758 |
|
775 |
* TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0
|
776 |
*
|
777 |
*/
|
778 |
+
function is_TouchPad() {
|
779 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
780 |
return false;
|
781 |
|
801 |
* Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344
|
802 |
*
|
803 |
*/
|
804 |
+
function is_S60_OSSBrowser() {
|
805 |
|
806 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
807 |
return false;
|
831 |
* Detects if the device platform is the Symbian Series 60.
|
832 |
*
|
833 |
*/
|
834 |
+
function is_symbian_platform() {
|
835 |
|
836 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
837 |
return false;
|
864 |
* This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'.
|
865 |
*
|
866 |
*/
|
867 |
+
function is_symbian_s40_platform() {
|
868 |
|
869 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
870 |
return false;
|
879 |
return false;
|
880 |
}
|
881 |
|
882 |
+
function is_J2ME_platform() {
|
883 |
|
884 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
885 |
return false;
|
899 |
/*
|
900 |
* Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets.
|
901 |
*/
|
902 |
+
function is_MaemoTablet() {
|
903 |
|
904 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
905 |
return false;
|
922 |
/*
|
923 |
* Detects if the current UA is a MeeGo device (Nokia Smartphone).
|
924 |
*/
|
925 |
+
function is_MeeGo() {
|
926 |
|
927 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
928 |
return false;
|
943 |
/*
|
944 |
is_webkit() can be used to check the User Agent for an webkit generic browser
|
945 |
*/
|
946 |
+
function is_webkit() {
|
947 |
|
948 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
949 |
return false;
|
962 |
* Detects if the current browser is the Native Android browser.
|
963 |
* @return boolean true if the browser is Android otherwise false
|
964 |
*/
|
965 |
+
function is_android() {
|
966 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
967 |
return false;
|
968 |
|
985 |
*
|
986 |
* @return boolean true if the browser is Android and not 'mobile' otherwise false
|
987 |
*/
|
988 |
+
function is_android_tablet( ) {
|
989 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
990 |
return false;
|
991 |
|
1012 |
*
|
1013 |
* @return boolean true if the browser is Kindle Fire Native browser otherwise false
|
1014 |
*/
|
1015 |
+
function is_kindle_fire( ) {
|
1016 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1017 |
return false;
|
1018 |
|
1033 |
*
|
1034 |
* @return boolean true if the browser is Kindle monochrome Native browser otherwise false
|
1035 |
*/
|
1036 |
+
function is_kindle_touch( ) {
|
1037 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1038 |
return false;
|
1039 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1046 |
|
1047 |
|
1048 |
// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
|
1049 |
+
function is_windows8_auth( ) {
|
1050 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1051 |
return false;
|
1052 |
|
1059 |
}
|
1060 |
|
1061 |
// Detect if user agent is the WordPress.com Windows 8 app.
|
1062 |
+
function is_wordpress_for_win8( ) {
|
1063 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1064 |
return false;
|
1065 |
+
|
1066 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1067 |
$pos = strpos( $agent, 'wp-windows8' );
|
1068 |
if ( $pos !== false )
|
1070 |
else
|
1071 |
return false;
|
1072 |
}
|
1073 |
+
|
1074 |
+
|
1075 |
/*
|
1076 |
* is_blackberry_tablet() can be used to check the User Agent for a RIM blackberry tablet
|
1077 |
* The user agent of the BlackBerry® Tablet OS follows a format similar to the following:
|
1078 |
* Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+
|
1079 |
*
|
1080 |
*/
|
1081 |
+
function is_blackberry_tablet() {
|
1082 |
|
1083 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1084 |
return false;
|
1099 |
is_blackbeberry() can be used to check the User Agent for a blackberry device
|
1100 |
Note that opera mini on BB matches this rule.
|
1101 |
*/
|
1102 |
+
function is_blackbeberry() {
|
1103 |
|
1104 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1105 |
return false;
|
1106 |
|
1107 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1108 |
+
|
1109 |
$pos_blackberry = strpos( $agent, 'blackberry' );
|
1110 |
if ( $pos_blackberry !== false ) {
|
1111 |
if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() )
|
1120 |
/*
|
1121 |
is_blackberry_10() can be used to check the User Agent for a BlackBerry 10 device.
|
1122 |
*/
|
1123 |
+
function is_blackberry_10() {
|
1124 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1125 |
return ( strpos( $agent, 'bb10' ) !== false ) && ( strpos( $agent, 'mobile' ) !== false );
|
1126 |
}
|
1141 |
* @return string Version of the BB OS.
|
1142 |
* If version is not found, get_blackbeberry_OS_version will return boolean false.
|
1143 |
*/
|
1144 |
+
function get_blackbeberry_OS_version() {
|
1145 |
|
1146 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1147 |
return false;
|
1148 |
|
1149 |
+
if ( self::is_blackberry_10() )
|
1150 |
return 'blackberry-10';
|
1151 |
+
|
|
|
1152 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1153 |
|
1154 |
$pos_blackberry = stripos( $agent, 'blackberry' );
|
1155 |
if ( $pos_blackberry === false ) {
|
1156 |
+
//not a blackberry device
|
1157 |
return false;
|
1158 |
}
|
1159 |
|
1160 |
+
//blackberry devices OS 6.0 or higher
|
1161 |
+
//Mozilla/5.0 (BlackBerry; U; BlackBerry 9670; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+
|
1162 |
+
//Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+
|
1163 |
+
//Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0 Mobile Safari/534.11+
|
1164 |
$pos_webkit = stripos( $agent, 'webkit' );
|
1165 |
if ( $pos_webkit !== false ) {
|
1166 |
+
//detected blackberry webkit browser
|
1167 |
$pos_torch = stripos( $agent, 'BlackBerry 9800' );
|
1168 |
if ( $pos_torch !== false ) {
|
1169 |
+
return 'blackberry-torch'; //match the torch first edition. the 2nd edition should use the OS7 and doesn't need any special rule
|
1170 |
} else {
|
1171 |
+
//detecting the BB OS version for devices running OS 6.0 or higher
|
1172 |
if ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) {
|
1173 |
$version = $matches[1];
|
1174 |
$version_num = explode( '.', $version );
|
1175 |
+
if( is_array( $version_num ) === false || count( $version_num ) <= 1 )
|
1176 |
+
return 'blackberry-6'; //not a BB device that match our rule.
|
1177 |
+
else
|
1178 |
+
return 'blackberry-'.$version_num[0];
|
|
|
1179 |
} else {
|
1180 |
+
//if doesn't match returns the minimun version with a webkit browser. we should never fall here.
|
1181 |
+
return 'blackberry-6'; //not a BB device that match our rule.
|
1182 |
}
|
1183 |
}
|
1184 |
}
|
1185 |
|
1186 |
+
//blackberry devices <= 5.XX
|
1187 |
+
//BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179
|
1188 |
if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
|
1189 |
$version = $matches[1];
|
1190 |
} else {
|
1193 |
|
1194 |
$version_num = explode( '.', $version );
|
1195 |
|
1196 |
+
if( is_array( $version_num ) === false || count( $version_num ) <= 1 )
|
1197 |
return false;
|
|
|
1198 |
if ( $version_num[0] == 5 ) {
|
1199 |
return 'blackberry-5';
|
1200 |
} elseif ( $version_num[0] == 4 && $version_num[1] == 7 ) {
|
1207 |
return false;
|
1208 |
}
|
1209 |
|
1210 |
+
return false;
|
1211 |
}
|
1212 |
|
1213 |
/**
|
1223 |
* @return string Type of the BB browser.
|
1224 |
* If browser's version is not found, detect_blackbeberry_browser_version will return boolean false.
|
1225 |
*/
|
1226 |
+
function detect_blackberry_browser_version() {
|
1227 |
|
1228 |
+
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1229 |
+
return false;
|
|
|
1230 |
|
1231 |
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
1232 |
|
1233 |
+
if ( self::is_blackberry_10() )
|
1234 |
return 'blackberry-10';
|
1235 |
+
|
|
|
1236 |
$pos_blackberry = strpos( $agent, 'blackberry' );
|
1237 |
if ( $pos_blackberry === false ) {
|
1238 |
+
//not a blackberry device
|
1239 |
return false;
|
1240 |
}
|
1241 |
|
1247 |
if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
|
1248 |
$version = $matches[1];
|
1249 |
} else {
|
1250 |
+
return false; //not a BB device that match our rule.
|
1251 |
}
|
1252 |
|
1253 |
$version_num = explode( '.', $version );
|
1254 |
|
1255 |
+
if( is_array( $version_num ) === false || count( $version_num ) <= 1 )
|
1256 |
+
return false;
|
|
|
1257 |
|
1258 |
if ( $version_num[0] == 5 ) {
|
1259 |
return 'blackberry-5';
|
1262 |
} elseif ( $version_num[0] == 4 && $version_num[1] == 6 ) {
|
1263 |
return 'blackberry-4.6';
|
1264 |
} else {
|
1265 |
+
//A very old BB device is found or this is a BB device that doesn't match our rules.
|
1266 |
return false;
|
1267 |
}
|
1268 |
}
|
1269 |
+
return false;
|
1270 |
}
|
1271 |
|
1272 |
+
//Checks if a visitor is coming from one of the WordPress mobile apps
|
1273 |
+
function is_mobile_app() {
|
1274 |
|
1275 |
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
|
1276 |
return false;
|
1294 |
return false;
|
1295 |
}
|
1296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
static function is_bot() {
|
1298 |
+
static $is_bot = false;
|
1299 |
+
static $first_run = true;
|
|
|
|
|
|
|
1300 |
|
1301 |
+
if ( $first_run ) {
|
1302 |
+
$first_run = false;
|
1303 |
|
1304 |
+
/*
|
1305 |
+
$bot_ips = array( );
|
|
|
|
|
|
|
|
|
|
|
|
|
1306 |
|
1307 |
+
foreach ( $bot_ips as $bot_ip ) {
|
1308 |
+
if ( $_SERVER['REMOTE_ADDR'] == $bot_ip )
|
1309 |
+
$is_bot = true;
|
1310 |
+
}
|
1311 |
+
*/
|
1312 |
|
1313 |
+
$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1314 |
|
1315 |
+
$bot_agents = array(
|
1316 |
+
'alexa', 'altavista', 'ask jeeves', 'attentio', 'baiduspider', 'bingbot', 'chtml generic', 'crawler', 'fastmobilecrawl',
|
1317 |
+
'feedfetcher-google', 'firefly', 'froogle', 'gigabot', 'googlebot', 'googlebot-mobile', 'heritrix', 'ia_archiver', 'irlbot',
|
1318 |
+
'infoseek', 'jumpbot', 'lycos', 'mediapartners', 'mediobot', 'motionbot', 'msnbot', 'mshots', 'openbot',
|
1319 |
+
'pythumbnail', 'scooter', 'slurp', 'snapbot', 'spider', 'surphace scout', 'taptubot', 'technoratisnoop',
|
1320 |
+
'teoma', 'twiceler', 'yahooseeker', 'yahooysmcm', 'yammybot',
|
1321 |
+
);
|
1322 |
+
|
1323 |
+
foreach ( $bot_agents as $bot_agent ) {
|
1324 |
+
if ( false !== strpos( $agent, $bot_agent ) )
|
1325 |
+
$is_bot = true;
|
1326 |
}
|
1327 |
}
|
1328 |
|
1329 |
+
return $is_bot;
|
1330 |
}
|
|
|
|
|
|
|
1331 |
}
|
class.jetpack-xmlrpc-server.php
CHANGED
@@ -7,7 +7,7 @@ class Jetpack_XMLRPC_Server {
|
|
7 |
/**
|
8 |
* The current error object
|
9 |
*/
|
10 |
-
|
11 |
|
12 |
/**
|
13 |
* Whitelist of the XML-RPC methods available to the Jetpack Server. If the
|
@@ -30,38 +30,17 @@ class Jetpack_XMLRPC_Server {
|
|
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 |
) );
|
38 |
|
39 |
if ( isset( $core_methods['metaWeblog.editPost'] ) ) {
|
40 |
$jetpack_methods['metaWeblog.newMediaObject'] = $core_methods['metaWeblog.newMediaObject'];
|
41 |
$jetpack_methods['jetpack.updateAttachmentParent'] = array( $this, 'update_attachment_parent' );
|
42 |
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Filters the XML-RPC methods available to Jetpack for authenticated users.
|
46 |
-
*
|
47 |
-
* @since 1.1.0
|
48 |
-
*
|
49 |
-
* @param array $jetpack_methods XML-RPC methods available to the Jetpack Server.
|
50 |
-
* @param array $core_methods Available core XML-RPC methods.
|
51 |
-
* @param WP_User $user Information about a given WordPress user.
|
52 |
-
*/
|
53 |
-
$jetpack_methods = apply_filters( 'jetpack_xmlrpc_methods', $jetpack_methods, $core_methods, $user );
|
54 |
}
|
55 |
|
56 |
-
|
57 |
-
* Filters the XML-RPC methods available to Jetpack for unauthenticated users.
|
58 |
-
*
|
59 |
-
* @since 3.0.0
|
60 |
-
*
|
61 |
-
* @param array $jetpack_methods XML-RPC methods available to the Jetpack Server.
|
62 |
-
* @param array $core_methods Available core XML-RPC methods.
|
63 |
-
*/
|
64 |
-
return apply_filters( 'jetpack_xmlrpc_unauthenticated_methods', $jetpack_methods, $core_methods );
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -100,24 +79,24 @@ class Jetpack_XMLRPC_Server {
|
|
100 |
return $this->error( new Jetpack_Error( 'verify_secret_1_malformed', sprintf( 'The required "%s" parameter is malformed.', 'secret_1' ), 400 ) );
|
101 |
}
|
102 |
|
103 |
-
$secrets =
|
104 |
if ( !$secrets || is_wp_error( $secrets ) ) {
|
105 |
-
|
106 |
return $this->error( new Jetpack_Error( 'verify_secrets_missing', 'Verification took too long', 400 ) );
|
107 |
}
|
108 |
|
109 |
@list( $secret_1, $secret_2, $secret_eol ) = explode( ':', $secrets );
|
110 |
if ( empty( $secret_1 ) || empty( $secret_2 ) || empty( $secret_eol ) || $secret_eol < time() ) {
|
111 |
-
|
112 |
return $this->error( new Jetpack_Error( 'verify_secrets_missing', 'Verification took too long', 400 ) );
|
113 |
}
|
114 |
|
115 |
-
if (
|
116 |
-
|
117 |
return $this->error( new Jetpack_Error( 'verify_secrets_mismatch', 'Secret mismatch', 400 ) );
|
118 |
}
|
119 |
|
120 |
-
|
121 |
|
122 |
return $secret_2;
|
123 |
}
|
@@ -128,7 +107,6 @@ class Jetpack_XMLRPC_Server {
|
|
128 |
* @return WP_User|IXR_Error
|
129 |
*/
|
130 |
function login() {
|
131 |
-
Jetpack::init()->require_jetpack_authentication();
|
132 |
$user = wp_authenticate( 'username', 'password' );
|
133 |
if ( is_wp_error( $user ) ) {
|
134 |
if ( 'authentication_failed' == $user->get_error_code() ) { // Generic error could mean most anything.
|
@@ -179,7 +157,7 @@ class Jetpack_XMLRPC_Server {
|
|
179 |
function test_connection() {
|
180 |
return JETPACK__VERSION;
|
181 |
}
|
182 |
-
|
183 |
function test_api_user_code( $args ) {
|
184 |
$client_id = (int) $args[0];
|
185 |
$user_id = (int) $args[1];
|
@@ -202,7 +180,7 @@ class Jetpack_XMLRPC_Server {
|
|
202 |
error_log( "VERIFY: $verify" );
|
203 |
*/
|
204 |
|
205 |
-
$jetpack_token = Jetpack_Data::get_access_token(
|
206 |
|
207 |
$api_user_code = get_user_meta( $user_id, "jetpack_json_api_$client_id", true );
|
208 |
if ( !$api_user_code ) {
|
@@ -223,27 +201,6 @@ class Jetpack_XMLRPC_Server {
|
|
223 |
return $user_id;
|
224 |
}
|
225 |
|
226 |
-
/**
|
227 |
-
* Disconnect this blog from the connected wordpress.com account
|
228 |
-
* @return boolean
|
229 |
-
*/
|
230 |
-
function disconnect_blog() {
|
231 |
-
Jetpack::log( 'disconnect' );
|
232 |
-
Jetpack::disconnect();
|
233 |
-
|
234 |
-
return true;
|
235 |
-
}
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Unlink a user from WordPress.com
|
239 |
-
*
|
240 |
-
* This will fail if called by the Master User.
|
241 |
-
*/
|
242 |
-
function unlink_user() {
|
243 |
-
Jetpack::log( 'unlink' );
|
244 |
-
return Jetpack::unlink_user();
|
245 |
-
}
|
246 |
-
|
247 |
/**
|
248 |
* Returns what features are available. Uses the slug of the module files.
|
249 |
*
|
@@ -321,7 +278,7 @@ class Jetpack_XMLRPC_Server {
|
|
321 |
|
322 |
return $sync_data;
|
323 |
}
|
324 |
-
|
325 |
function update_attachment_parent( $args ) {
|
326 |
$attachment_id = (int) $args[0];
|
327 |
$parent_id = (int) $args[1];
|
@@ -339,8 +296,8 @@ class Jetpack_XMLRPC_Server {
|
|
339 |
$method = (string) $json_api_args[0];
|
340 |
$url = (string) $json_api_args[1];
|
341 |
$post_body = is_null( $json_api_args[2] ) ? null : (string) $json_api_args[2];
|
|
|
342 |
$user_details = (array) $json_api_args[4];
|
343 |
-
$locale = (string) $json_api_args[5];
|
344 |
|
345 |
if ( !$verify_api_user_args ) {
|
346 |
$user_id = 0;
|
@@ -364,32 +321,12 @@ class Jetpack_XMLRPC_Server {
|
|
364 |
error_log( "METHOD: $method" );
|
365 |
error_log( "URL: $url" );
|
366 |
error_log( "POST BODY: $post_body" );
|
|
|
367 |
error_log( "VERIFY_ARGS: " . print_r( $verify_api_user_args, 1 ) );
|
368 |
error_log( "VERIFIED USER_ID: " . (int) $user_id );
|
369 |
error_log( "-- end json api via jetpack debugging -- " );
|
370 |
*/
|
371 |
|
372 |
-
if ( 'en' !== $locale ) {
|
373 |
-
// .org mo files are named slightly different from .com, and all we have is this the locale -- try to guess them.
|
374 |
-
$new_locale = $locale;
|
375 |
-
if ( strpos( $locale, '-' ) !== false ) {
|
376 |
-
$pieces = explode( '-', $locale );
|
377 |
-
$new_locale = $locale_pieces[0];
|
378 |
-
$new_locale .= ( ! empty( $locale_pieces[1] ) ) ? '_' . strtoupper( $locale_pieces[1] ) : '';
|
379 |
-
} else {
|
380 |
-
// .com might pass 'fr' because thats what our language files are named as, where core seems
|
381 |
-
// to do fr_FR - so try that if we don't think we can load the file.
|
382 |
-
if ( ! file_exists( WP_LANG_DIR . '/' . $locale . '.mo' ) ) {
|
383 |
-
$new_locale = $locale . '_' . strtoupper( $locale );
|
384 |
-
}
|
385 |
-
}
|
386 |
-
|
387 |
-
if ( file_exists( WP_LANG_DIR . '/' . $new_locale . '.mo' ) ) {
|
388 |
-
unload_textdomain( 'default' );
|
389 |
-
load_textdomain( 'default', WP_LANG_DIR . '/' . $new_locale . '.mo' );
|
390 |
-
}
|
391 |
-
}
|
392 |
-
|
393 |
$old_user = wp_get_current_user();
|
394 |
wp_set_current_user( $user_id );
|
395 |
|
@@ -404,10 +341,10 @@ class Jetpack_XMLRPC_Server {
|
|
404 |
// needed?
|
405 |
require_once ABSPATH . 'wp-admin/includes/admin.php';
|
406 |
|
407 |
-
require_once
|
408 |
$api = WPCOM_JSON_API::init( $method, $url, $post_body );
|
409 |
$api->token_details['user'] = $user_details;
|
410 |
-
require_once
|
411 |
|
412 |
$display_errors = ini_set( 'display_errors', 0 );
|
413 |
ob_start();
|
7 |
/**
|
8 |
* The current error object
|
9 |
*/
|
10 |
+
var $error = null;
|
11 |
|
12 |
/**
|
13 |
* Whitelist of the XML-RPC methods available to the Jetpack Server. If the
|
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 |
) );
|
36 |
|
37 |
if ( isset( $core_methods['metaWeblog.editPost'] ) ) {
|
38 |
$jetpack_methods['metaWeblog.newMediaObject'] = $core_methods['metaWeblog.newMediaObject'];
|
39 |
$jetpack_methods['jetpack.updateAttachmentParent'] = array( $this, 'update_attachment_parent' );
|
40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
+
return apply_filters( 'jetpack_xmlrpc_methods', $jetpack_methods, $core_methods, $user );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
/**
|
79 |
return $this->error( new Jetpack_Error( 'verify_secret_1_malformed', sprintf( 'The required "%s" parameter is malformed.', 'secret_1' ), 400 ) );
|
80 |
}
|
81 |
|
82 |
+
$secrets = Jetpack::get_option( $action );
|
83 |
if ( !$secrets || is_wp_error( $secrets ) ) {
|
84 |
+
Jetpack::delete_option( $action );
|
85 |
return $this->error( new Jetpack_Error( 'verify_secrets_missing', 'Verification took too long', 400 ) );
|
86 |
}
|
87 |
|
88 |
@list( $secret_1, $secret_2, $secret_eol ) = explode( ':', $secrets );
|
89 |
if ( empty( $secret_1 ) || empty( $secret_2 ) || empty( $secret_eol ) || $secret_eol < time() ) {
|
90 |
+
Jetpack::delete_option( $action );
|
91 |
return $this->error( new Jetpack_Error( 'verify_secrets_missing', 'Verification took too long', 400 ) );
|
92 |
}
|
93 |
|
94 |
+
if ( $verify_secret !== $secret_1 ) {
|
95 |
+
Jetpack::delete_option( $action );
|
96 |
return $this->error( new Jetpack_Error( 'verify_secrets_mismatch', 'Secret mismatch', 400 ) );
|
97 |
}
|
98 |
|
99 |
+
Jetpack::delete_option( $action );
|
100 |
|
101 |
return $secret_2;
|
102 |
}
|
107 |
* @return WP_User|IXR_Error
|
108 |
*/
|
109 |
function login() {
|
|
|
110 |
$user = wp_authenticate( 'username', 'password' );
|
111 |
if ( is_wp_error( $user ) ) {
|
112 |
if ( 'authentication_failed' == $user->get_error_code() ) { // Generic error could mean most anything.
|
157 |
function test_connection() {
|
158 |
return JETPACK__VERSION;
|
159 |
}
|
160 |
+
|
161 |
function test_api_user_code( $args ) {
|
162 |
$client_id = (int) $args[0];
|
163 |
$user_id = (int) $args[1];
|
180 |
error_log( "VERIFY: $verify" );
|
181 |
*/
|
182 |
|
183 |
+
$jetpack_token = Jetpack_Data::get_access_token( 1 );
|
184 |
|
185 |
$api_user_code = get_user_meta( $user_id, "jetpack_json_api_$client_id", true );
|
186 |
if ( !$api_user_code ) {
|
201 |
return $user_id;
|
202 |
}
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
/**
|
205 |
* Returns what features are available. Uses the slug of the module files.
|
206 |
*
|
278 |
|
279 |
return $sync_data;
|
280 |
}
|
281 |
+
|
282 |
function update_attachment_parent( $args ) {
|
283 |
$attachment_id = (int) $args[0];
|
284 |
$parent_id = (int) $args[1];
|
296 |
$method = (string) $json_api_args[0];
|
297 |
$url = (string) $json_api_args[1];
|
298 |
$post_body = is_null( $json_api_args[2] ) ? null : (string) $json_api_args[2];
|
299 |
+
$my_id = (int) $json_api_args[3];
|
300 |
$user_details = (array) $json_api_args[4];
|
|
|
301 |
|
302 |
if ( !$verify_api_user_args ) {
|
303 |
$user_id = 0;
|
321 |
error_log( "METHOD: $method" );
|
322 |
error_log( "URL: $url" );
|
323 |
error_log( "POST BODY: $post_body" );
|
324 |
+
error_log( "MY JETPACK ID: $my_id" );
|
325 |
error_log( "VERIFY_ARGS: " . print_r( $verify_api_user_args, 1 ) );
|
326 |
error_log( "VERIFIED USER_ID: " . (int) $user_id );
|
327 |
error_log( "-- end json api via jetpack debugging -- " );
|
328 |
*/
|
329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
$old_user = wp_get_current_user();
|
331 |
wp_set_current_user( $user_id );
|
332 |
|
341 |
// needed?
|
342 |
require_once ABSPATH . 'wp-admin/includes/admin.php';
|
343 |
|
344 |
+
require_once dirname( __FILE__ ) . '/class.json-api.php';
|
345 |
$api = WPCOM_JSON_API::init( $method, $url, $post_body );
|
346 |
$api->token_details['user'] = $user_details;
|
347 |
+
require_once dirname( __FILE__ ) . '/class.json-api-endpoints.php';
|
348 |
|
349 |
$display_errors = ini_set( 'display_errors', 0 );
|
350 |
ob_start();
|
class.jetpack.php
DELETED
@@ -1,7094 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
Options:
|
5 |
-
jetpack_options (array)
|
6 |
-
An array of options.
|
7 |
-
@see Jetpack_Options::get_option_names()
|
8 |
-
|
9 |
-
jetpack_register (string)
|
10 |
-
Temporary verification secrets.
|
11 |
-
|
12 |
-
jetpack_activated (int)
|
13 |
-
1: the plugin was activated normally
|
14 |
-
2: the plugin was activated on this site because of a network-wide activation
|
15 |
-
3: the plugin was auto-installed
|
16 |
-
4: the plugin was manually disconnected (but is still installed)
|
17 |
-
|
18 |
-
jetpack_active_modules (array)
|
19 |
-
Array of active module slugs.
|
20 |
-
|
21 |
-
jetpack_do_activate (bool)
|
22 |
-
Flag for "activating" the plugin on sites where the activation hook never fired (auto-installs)
|
23 |
-
*/
|
24 |
-
|
25 |
-
class Jetpack {
|
26 |
-
public $xmlrpc_server = null;
|
27 |
-
|
28 |
-
private $xmlrpc_verification = null;
|
29 |
-
|
30 |
-
public $HTTP_RAW_POST_DATA = null; // copy of $GLOBALS['HTTP_RAW_POST_DATA']
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @var array The handles of styles that are concatenated into jetpack.css
|
34 |
-
*/
|
35 |
-
public $concatenated_style_handles = array(
|
36 |
-
'jetpack-carousel',
|
37 |
-
'grunion.css',
|
38 |
-
'the-neverending-homepage',
|
39 |
-
'jetpack_likes',
|
40 |
-
'jetpack_related-posts',
|
41 |
-
'sharedaddy',
|
42 |
-
'jetpack-slideshow',
|
43 |
-
'presentations',
|
44 |
-
'jetpack-subscriptions',
|
45 |
-
'tiled-gallery',
|
46 |
-
'widget-conditions',
|
47 |
-
'jetpack_display_posts_widget',
|
48 |
-
'gravatar-profile-widget',
|
49 |
-
'widget-grid-and-list',
|
50 |
-
'jetpack-widgets',
|
51 |
-
'goodreads-widget',
|
52 |
-
'jetpack_social_media_icons_widget',
|
53 |
-
);
|
54 |
-
|
55 |
-
public $plugins_to_deactivate = array(
|
56 |
-
'stats' => array( 'stats/stats.php', 'WordPress.com Stats' ),
|
57 |
-
'shortlinks' => array( 'stats/stats.php', 'WordPress.com Stats' ),
|
58 |
-
'sharedaddy' => array( 'sharedaddy/sharedaddy.php', 'Sharedaddy' ),
|
59 |
-
'twitter-widget' => array( 'wickett-twitter-widget/wickett-twitter-widget.php', 'Wickett Twitter Widget' ),
|
60 |
-
'after-the-deadline' => array( 'after-the-deadline/after-the-deadline.php', 'After The Deadline' ),
|
61 |
-
'contact-form' => array( 'grunion-contact-form/grunion-contact-form.php', 'Grunion Contact Form' ),
|
62 |
-
'contact-form' => array( 'mullet/mullet-contact-form.php', 'Mullet Contact Form' ),
|
63 |
-
'custom-css' => array( 'safecss/safecss.php', 'WordPress.com Custom CSS' ),
|
64 |
-
'random-redirect' => array( 'random-redirect/random-redirect.php', 'Random Redirect' ),
|
65 |
-
'videopress' => array( 'video/video.php', 'VideoPress' ),
|
66 |
-
'widget-visibility' => array( 'jetpack-widget-visibility/widget-visibility.php', 'Jetpack Widget Visibility' ),
|
67 |
-
'widget-visibility' => array( 'widget-visibility-without-jetpack/widget-visibility-without-jetpack.php', 'Widget Visibility Without Jetpack' ),
|
68 |
-
'sharedaddy' => array( 'jetpack-sharing/sharedaddy.php', 'Jetpack Sharing' ),
|
69 |
-
'omnisearch' => array( 'jetpack-omnisearch/omnisearch.php', 'Jetpack Omnisearch' ),
|
70 |
-
'gravatar-hovercards' => array( 'jetpack-gravatar-hovercards/gravatar-hovercards.php', 'Jetpack Gravatar Hovercards' ),
|
71 |
-
'latex' => array( 'wp-latex/wp-latex.php', 'WP LaTeX' )
|
72 |
-
);
|
73 |
-
|
74 |
-
public $capability_translations = array(
|
75 |
-
'administrator' => 'manage_options',
|
76 |
-
'editor' => 'edit_others_posts',
|
77 |
-
'author' => 'publish_posts',
|
78 |
-
'contributor' => 'edit_posts',
|
79 |
-
'subscriber' => 'read',
|
80 |
-
);
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Map of modules that have conflicts with plugins and should not be auto-activated
|
84 |
-
* if the plugins are active. Used by filter_default_modules
|
85 |
-
*
|
86 |
-
* Plugin Authors: If you'd like to prevent a single module from auto-activating,
|
87 |
-
* change `module-slug` and add this to your plugin:
|
88 |
-
*
|
89 |
-
* add_filter( 'jetpack_get_default_modules', 'my_jetpack_get_default_modules' );
|
90 |
-
* function my_jetpack_get_default_modules( $modules ) {
|
91 |
-
* return array_diff( $modules, array( 'module-slug' ) );
|
92 |
-
* }
|
93 |
-
*
|
94 |
-
* @var array
|
95 |
-
*/
|
96 |
-
private $conflicting_plugins = array(
|
97 |
-
'comments' => array(
|
98 |
-
'Intense Debate' => 'intensedebate/intensedebate.php',
|
99 |
-
'Disqus' => 'disqus-comment-system/disqus.php',
|
100 |
-
'Livefyre' => 'livefyre-comments/livefyre.php',
|
101 |
-
'Comments Evolved for WordPress' => 'gplus-comments/comments-evolved.php',
|
102 |
-
'Google+ Comments' => 'google-plus-comments/google-plus-comments.php',
|
103 |
-
'WP-SpamShield Anti-Spam' => 'wp-spamshield/wp-spamshield.php',
|
104 |
-
),
|
105 |
-
'contact-form' => array(
|
106 |
-
'Contact Form 7' => 'contact-form-7/wp-contact-form-7.php',
|
107 |
-
'Gravity Forms' => 'gravityforms/gravityforms.php',
|
108 |
-
'Contact Form Plugin' => 'contact-form-plugin/contact_form.php',
|
109 |
-
'Easy Contact Forms' => 'easy-contact-forms/easy-contact-forms.php',
|
110 |
-
'Fast Secure Contact Form' => 'si-contact-form/si-contact-form.php',
|
111 |
-
),
|
112 |
-
'minileven' => array(
|
113 |
-
'WPtouch' => 'wptouch/wptouch.php',
|
114 |
-
),
|
115 |
-
'latex' => array(
|
116 |
-
'LaTeX for WordPress' => 'latex/latex.php',
|
117 |
-
'Youngwhans Simple Latex' => 'youngwhans-simple-latex/yw-latex.php',
|
118 |
-
'Easy WP LaTeX' => 'easy-wp-latex-lite/easy-wp-latex-lite.php',
|
119 |
-
'MathJax-LaTeX' => 'mathjax-latex/mathjax-latex.php',
|
120 |
-
'Enable Latex' => 'enable-latex/enable-latex.php',
|
121 |
-
'WP QuickLaTeX' => 'wp-quicklatex/wp-quicklatex.php',
|
122 |
-
),
|
123 |
-
'protect' => array(
|
124 |
-
'Limit Login Attempts' => 'limit-login-attempts/limit-login-attempts.php',
|
125 |
-
'Captcha' => 'captcha/captcha.php',
|
126 |
-
'Brute Force Login Protection' => 'brute-force-login-protection/brute-force-login-protection.php',
|
127 |
-
'Login Security Solution' => 'login-security-solution/login-security-solution.php',
|
128 |
-
'WPSecureOps Brute Force Protect' => 'wpsecureops-bruteforce-protect/wpsecureops-bruteforce-protect.php',
|
129 |
-
'BulletProof Security' => 'bulletproof-security/bulletproof-security.php',
|
130 |
-
'SiteGuard WP Plugin' => 'siteguard/siteguard.php',
|
131 |
-
'Security-protection' => 'security-protection/security-protection.php',
|
132 |
-
'Login Security' => 'login-security/login-security.php',
|
133 |
-
'Botnet Attack Blocker' => 'botnet-attack-blocker/botnet-attack-blocker.php',
|
134 |
-
'Wordfence Security' => 'wordfence/wordfence.php',
|
135 |
-
'All In One WP Security & Firewall' => 'all-in-one-wp-security-and-firewall/wp-security.php',
|
136 |
-
'iThemes Security' => 'better-wp-security/better-wp-security.php',
|
137 |
-
),
|
138 |
-
'random-redirect' => array(
|
139 |
-
'Random Redirect 2' => 'random-redirect-2/random-redirect.php',
|
140 |
-
),
|
141 |
-
'related-posts' => array(
|
142 |
-
'YARPP' => 'yet-another-related-posts-plugin/yarpp.php',
|
143 |
-
'WordPress Related Posts' => 'wordpress-23-related-posts-plugin/wp_related_posts.php',
|
144 |
-
'nrelate Related Content' => 'nrelate-related-content/nrelate-related.php',
|
145 |
-
'Contextual Related Posts' => 'contextual-related-posts/contextual-related-posts.php',
|
146 |
-
'Related Posts for WordPress' => 'microkids-related-posts/microkids-related-posts.php',
|
147 |
-
'outbrain' => 'outbrain/outbrain.php',
|
148 |
-
'Shareaholic' => 'shareaholic/shareaholic.php',
|
149 |
-
'Sexybookmarks' => 'sexybookmarks/shareaholic.php',
|
150 |
-
),
|
151 |
-
'sharedaddy' => array(
|
152 |
-
'AddThis' => 'addthis/addthis_social_widget.php',
|
153 |
-
'Add To Any' => 'add-to-any/add-to-any.php',
|
154 |
-
'ShareThis' => 'share-this/sharethis.php',
|
155 |
-
'Shareaholic' => 'shareaholic/shareaholic.php',
|
156 |
-
),
|
157 |
-
'verification-tools' => array(
|
158 |
-
'WordPress SEO by Yoast' => 'wordpress-seo/wp-seo.php',
|
159 |
-
'WordPress SEO Premium by Yoast' => 'wordpress-seo-premium/wp-seo-premium.php',
|
160 |
-
'All in One SEO Pack' => 'all-in-one-seo-pack/all_in_one_seo_pack.php',
|
161 |
-
),
|
162 |
-
'widget-visibility' => array(
|
163 |
-
'Widget Logic' => 'widget-logic/widget_logic.php',
|
164 |
-
'Dynamic Widgets' => 'dynamic-widgets/dynamic-widgets.php',
|
165 |
-
),
|
166 |
-
'sitemaps' => array(
|
167 |
-
'Google XML Sitemaps' => 'google-sitemap-generator/sitemap.php',
|
168 |
-
'Better WordPress Google XML Sitemaps' => 'bwp-google-xml-sitemaps/bwp-simple-gxs.php',
|
169 |
-
'Google XML Sitemaps for qTranslate' => 'google-xml-sitemaps-v3-for-qtranslate/sitemap.php',
|
170 |
-
'XML Sitemap & Google News feeds' => 'xml-sitemap-feed/xml-sitemap.php',
|
171 |
-
'Google Sitemap by BestWebSoft' => 'google-sitemap-plugin/google-sitemap-plugin.php',
|
172 |
-
'WordPress SEO by Yoast' => 'wordpress-seo/wp-seo.php',
|
173 |
-
'WordPress SEO Premium by Yoast' => 'wordpress-seo-premium/wp-seo-premium.php',
|
174 |
-
'All in One SEO Pack' => 'all-in-one-seo-pack/all_in_one_seo_pack.php',
|
175 |
-
'Sitemap' => 'sitemap/sitemap.php',
|
176 |
-
'Simple Wp Sitemap' => 'simple-wp-sitemap/simple-wp-sitemap.php',
|
177 |
-
'Simple Sitemap' => 'simple-sitemap/simple-sitemap.php',
|
178 |
-
'XML Sitemaps' => 'xml-sitemaps/xml-sitemaps.php',
|
179 |
-
'MSM Sitemaps' => 'msm-sitemap/msm-sitemap.php',
|
180 |
-
),
|
181 |
-
);
|
182 |
-
|
183 |
-
/**
|
184 |
-
* Plugins for which we turn off our Facebook OG Tags implementation.
|
185 |
-
*
|
186 |
-
* Note: WordPress SEO by Yoast and WordPress SEO Premium by Yoast automatically deactivate
|
187 |
-
* Jetpack's Open Graph tags via filter when their Social Meta modules are active.
|
188 |
-
*
|
189 |
-
* Plugin authors: If you'd like to prevent Jetpack's Open Graph tag generation in your plugin, you can do so via this filter:
|
190 |
-
* add_filter( 'jetpack_enable_open_graph', '__return_false' );
|
191 |
-
*/
|
192 |
-
private $open_graph_conflicting_plugins = array(
|
193 |
-
'2-click-socialmedia-buttons/2-click-socialmedia-buttons.php',
|
194 |
-
// 2 Click Social Media Buttons
|
195 |
-
'add-link-to-facebook/add-link-to-facebook.php', // Add Link to Facebook
|
196 |
-
'add-meta-tags/add-meta-tags.php', // Add Meta Tags
|
197 |
-
'easy-facebook-share-thumbnails/esft.php', // Easy Facebook Share Thumbnail
|
198 |
-
'facebook/facebook.php', // Facebook (official plugin)
|
199 |
-
'facebook-awd/AWD_facebook.php', // Facebook AWD All in one
|
200 |
-
'facebook-featured-image-and-open-graph-meta-tags/fb-featured-image.php',
|
201 |
-
// Facebook Featured Image & OG Meta Tags
|
202 |
-
'facebook-meta-tags/facebook-metatags.php', // Facebook Meta Tags
|
203 |
-
'wonderm00ns-simple-facebook-open-graph-tags/wonderm00n-open-graph.php',
|
204 |
-
// Facebook Open Graph Meta Tags for WordPress
|
205 |
-
'facebook-revised-open-graph-meta-tag/index.php', // Facebook Revised Open Graph Meta Tag
|
206 |
-
'facebook-thumb-fixer/_facebook-thumb-fixer.php', // Facebook Thumb Fixer
|
207 |
-
'facebook-and-digg-thumbnail-generator/facebook-and-digg-thumbnail-generator.php',
|
208 |
-
// Fedmich's Facebook Open Graph Meta
|
209 |
-
'header-footer/plugin.php', // Header and Footer
|
210 |
-
'network-publisher/networkpub.php', // Network Publisher
|
211 |
-
'nextgen-facebook/nextgen-facebook.php', // NextGEN Facebook OG
|
212 |
-
'social-networks-auto-poster-facebook-twitter-g/NextScripts_SNAP.php',
|
213 |
-
// NextScripts SNAP
|
214 |
-
'opengraph/opengraph.php', // Open Graph
|
215 |
-
'open-graph-protocol-framework/open-graph-protocol-framework.php',
|
216 |
-
// Open Graph Protocol Framework
|
217 |
-
'seo-facebook-comments/seofacebook.php', // SEO Facebook Comments
|
218 |
-
'seo-ultimate/seo-ultimate.php', // SEO Ultimate
|
219 |
-
'sexybookmarks/sexy-bookmarks.php', // Shareaholic
|
220 |
-
'shareaholic/sexy-bookmarks.php', // Shareaholic
|
221 |
-
'sharepress/sharepress.php', // SharePress
|
222 |
-
'simple-facebook-connect/sfc.php', // Simple Facebook Connect
|
223 |
-
'social-discussions/social-discussions.php', // Social Discussions
|
224 |
-
'social-sharing-toolkit/social_sharing_toolkit.php', // Social Sharing Toolkit
|
225 |
-
'socialize/socialize.php', // Socialize
|
226 |
-
'only-tweet-like-share-and-google-1/tweet-like-plusone.php',
|
227 |
-
// Tweet, Like, Google +1 and Share
|
228 |
-
'wordbooker/wordbooker.php', // Wordbooker
|
229 |
-
'wpsso/wpsso.php', // WordPress Social Sharing Optimization
|
230 |
-
'wp-caregiver/wp-caregiver.php', // WP Caregiver
|
231 |
-
'wp-facebook-like-send-open-graph-meta/wp-facebook-like-send-open-graph-meta.php',
|
232 |
-
// WP Facebook Like Send & Open Graph Meta
|
233 |
-
'wp-facebook-open-graph-protocol/wp-facebook-ogp.php', // WP Facebook Open Graph protocol
|
234 |
-
'wp-ogp/wp-ogp.php', // WP-OGP
|
235 |
-
'zoltonorg-social-plugin/zosp.php', // Zolton.org Social Plugin
|
236 |
-
'wp-fb-share-like-button/wp_fb_share-like_widget.php' // WP Facebook Like Button
|
237 |
-
);
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Plugins for which we turn off our Twitter Cards Tags implementation.
|
241 |
-
*/
|
242 |
-
private $twitter_cards_conflicting_plugins = array(
|
243 |
-
// 'twitter/twitter.php', // The official one handles this on its own.
|
244 |
-
// // https://github.com/twitter/wordpress/blob/master/src/Twitter/WordPress/Cards/Compatibility.php
|
245 |
-
'eewee-twitter-card/index.php', // Eewee Twitter Card
|
246 |
-
'ig-twitter-cards/ig-twitter-cards.php', // IG:Twitter Cards
|
247 |
-
'jm-twitter-cards/jm-twitter-cards.php', // JM Twitter Cards
|
248 |
-
'kevinjohn-gallagher-pure-web-brilliants-social-graph-twitter-cards-extention/kevinjohn_gallagher___social_graph_twitter_output.php',
|
249 |
-
// Pure Web Brilliant's Social Graph Twitter Cards Extension
|
250 |
-
'twitter-cards/twitter-cards.php', // Twitter Cards
|
251 |
-
'twitter-cards-meta/twitter-cards-meta.php', // Twitter Cards Meta
|
252 |
-
'wp-twitter-cards/twitter_cards.php', // WP Twitter Cards
|
253 |
-
);
|
254 |
-
|
255 |
-
/**
|
256 |
-
* Message to display in admin_notice
|
257 |
-
* @var string
|
258 |
-
*/
|
259 |
-
public $message = '';
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Error to display in admin_notice
|
263 |
-
* @var string
|
264 |
-
*/
|
265 |
-
public $error = '';
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Modules that need more privacy description.
|
269 |
-
* @var string
|
270 |
-
*/
|
271 |
-
public $privacy_checks = '';
|
272 |
-
|
273 |
-
/**
|
274 |
-
* Stats to record once the page loads
|
275 |
-
*
|
276 |
-
* @var array
|
277 |
-
*/
|
278 |
-
public $stats = array();
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Allows us to build a temporary security report
|
282 |
-
*
|
283 |
-
* @var array
|
284 |
-
*/
|
285 |
-
static $security_report = array();
|
286 |
-
|
287 |
-
/**
|
288 |
-
* Jetpack_Sync object
|
289 |
-
*/
|
290 |
-
public $sync;
|
291 |
-
|
292 |
-
/**
|
293 |
-
* Verified data for JSON authorization request
|
294 |
-
*/
|
295 |
-
public $json_api_authorization_request = array();
|
296 |
-
|
297 |
-
/**
|
298 |
-
* Holds the singleton instance of this class
|
299 |
-
* @since 2.3.3
|
300 |
-
* @var Jetpack
|
301 |
-
*/
|
302 |
-
static $instance = false;
|
303 |
-
|
304 |
-
/**
|
305 |
-
* Singleton
|
306 |
-
* @static
|
307 |
-
*/
|
308 |
-
public static function init() {
|
309 |
-
if ( ! self::$instance ) {
|
310 |
-
if ( did_action( 'plugins_loaded' ) )
|
311 |
-
self::plugin_textdomain();
|
312 |
-
else
|
313 |
-
add_action( 'plugins_loaded', array( __CLASS__, 'plugin_textdomain' ), 99 );
|
314 |
-
|
315 |
-
self::$instance = new Jetpack;
|
316 |
-
|
317 |
-
self::$instance->plugin_upgrade();
|
318 |
-
|
319 |
-
add_action( 'init', array( __CLASS__, 'perform_security_reporting' ) );
|
320 |
-
|
321 |
-
}
|
322 |
-
|
323 |
-
return self::$instance;
|
324 |
-
}
|
325 |
-
|
326 |
-
/**
|
327 |
-
* Must never be called statically
|
328 |
-
*/
|
329 |
-
function plugin_upgrade() {
|
330 |
-
if ( Jetpack::is_active() ) {
|
331 |
-
list( $version ) = explode( ':', Jetpack_Options::get_option( 'version' ) );
|
332 |
-
if ( JETPACK__VERSION != $version ) {
|
333 |
-
|
334 |
-
// Check which active modules actually exist and remove others from active_modules list
|
335 |
-
$unfiltered_modules = Jetpack::get_active_modules();
|
336 |
-
$modules = array_filter( $unfiltered_modules, array( 'Jetpack', 'is_module' ) );
|
337 |
-
if ( array_diff( $unfiltered_modules, $modules ) ) {
|
338 |
-
Jetpack_Options::update_option( 'active_modules', $modules );
|
339 |
-
}
|
340 |
-
|
341 |
-
add_action( 'init', array( __CLASS__, 'activate_new_modules' ) );
|
342 |
-
/**
|
343 |
-
* Fires when synchronizing all registered options and constants.
|
344 |
-
*
|
345 |
-
* @since 3.3.0
|
346 |
-
*/
|
347 |
-
do_action( 'jetpack_sync_all_registered_options' );
|
348 |
-
}
|
349 |
-
}
|
350 |
-
}
|
351 |
-
|
352 |
-
static function activate_manage( ) {
|
353 |
-
|
354 |
-
if ( did_action( 'init' ) || current_filter() == 'init' ) {
|
355 |
-
self::activate_module( 'manage', false, false );
|
356 |
-
} else if ( ! has_action( 'init' , array( __CLASS__, 'activate_manage' ) ) ) {
|
357 |
-
add_action( 'init', array( __CLASS__, 'activate_manage' ) );
|
358 |
-
}
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Constructor. Initializes WordPress hooks
|
364 |
-
*/
|
365 |
-
private function __construct() {
|
366 |
-
/*
|
367 |
-
* Check for and alert any deprecated hooks
|
368 |
-
*/
|
369 |
-
add_action( 'init', array( $this, 'deprecated_hooks' ) );
|
370 |
-
|
371 |
-
/*
|
372 |
-
* Do things that should run even in the network admin
|
373 |
-
* here, before we potentially fail out.
|
374 |
-
*/
|
375 |
-
add_filter( 'jetpack_require_lib_dir', array( $this, 'require_lib_dir' ) );
|
376 |
-
|
377 |
-
/**
|
378 |
-
* We need sync object even in Multisite mode
|
379 |
-
*/
|
380 |
-
$this->sync = new Jetpack_Sync;
|
381 |
-
|
382 |
-
/**
|
383 |
-
* Trigger a wp_version sync when updating WP versions
|
384 |
-
**/
|
385 |
-
add_action( 'upgrader_process_complete', array( 'Jetpack', 'update_get_wp_version' ), 10, 2 );
|
386 |
-
$this->sync->mock_option( 'wp_version', array( 'Jetpack', 'get_wp_version' ) );
|
387 |
-
|
388 |
-
add_action( 'init', array( $this, 'sync_update_data') );
|
389 |
-
add_action( 'init', array( $this, 'sync_theme_data' ) );
|
390 |
-
|
391 |
-
/*
|
392 |
-
* Load things that should only be in Network Admin.
|
393 |
-
*
|
394 |
-
* For now blow away everything else until a more full
|
395 |
-
* understanding of what is needed at the network level is
|
396 |
-
* available
|
397 |
-
*/
|
398 |
-
if( is_multisite() ) {
|
399 |
-
Jetpack_Network::init();
|
400 |
-
|
401 |
-
// Only sync this info if we are on a multi site
|
402 |
-
// @since 3.7
|
403 |
-
$this->sync->mock_option( 'network_name', array( 'Jetpack', 'network_name' ) );
|
404 |
-
$this->sync->mock_option( 'network_allow_new_registrations', array( 'Jetpack', 'network_allow_new_registrations' ) );
|
405 |
-
$this->sync->mock_option( 'network_add_new_users', array( 'Jetpack', 'network_add_new_users' ) );
|
406 |
-
$this->sync->mock_option( 'network_site_upload_space', array( 'Jetpack', 'network_site_upload_space' ) );
|
407 |
-
$this->sync->mock_option( 'network_upload_file_types', array( 'Jetpack', 'network_upload_file_types' ) );
|
408 |
-
$this->sync->mock_option( 'network_enable_administration_menus', array( 'Jetpack', 'network_enable_administration_menus' ) );
|
409 |
-
|
410 |
-
if( is_network_admin() ) {
|
411 |
-
// Sync network site data if it is updated or not.
|
412 |
-
add_action( 'update_wpmu_options', array( $this, 'update_jetpack_network_settings' ) );
|
413 |
-
return; // End here to prevent single site actions from firing
|
414 |
-
}
|
415 |
-
}
|
416 |
-
|
417 |
-
|
418 |
-
$theme_slug = get_option( 'stylesheet' );
|
419 |
-
|
420 |
-
|
421 |
-
// Modules should do Jetpack_Sync::sync_options( __FILE__, $option, ... ); instead
|
422 |
-
// We access the "internal" method here only because the Jetpack object isn't instantiated yet
|
423 |
-
$this->sync->options(
|
424 |
-
JETPACK__PLUGIN_DIR . 'jetpack.php',
|
425 |
-
'home',
|
426 |
-
'siteurl',
|
427 |
-
'blogname',
|
428 |
-
'gmt_offset',
|
429 |
-
'timezone_string',
|
430 |
-
'security_report',
|
431 |
-
'stylesheet',
|
432 |
-
"theme_mods_{$theme_slug}",
|
433 |
-
'jetpack_sync_non_public_post_stati',
|
434 |
-
'jetpack_options',
|
435 |
-
'site_icon', // (int) - ID of core's Site Icon attachment ID
|
436 |
-
'default_post_format',
|
437 |
-
'default_category',
|
438 |
-
'large_size_w',
|
439 |
-
'large_size_h',
|
440 |
-
'thumbnail_size_w',
|
441 |
-
'thumbnail_size_h',
|
442 |
-
'medium_size_w',
|
443 |
-
'medium_size_h',
|
444 |
-
'thumbnail_crop',
|
445 |
-
'image_default_link_type'
|
446 |
-
);
|
447 |
-
|
448 |
-
foreach( Jetpack_Options::get_option_names( 'non-compact' ) as $option ) {
|
449 |
-
$this->sync->options( __FILE__, 'jetpack_' . $option );
|
450 |
-
}
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Sometimes you want to sync data to .com without adding options to .org sites.
|
454 |
-
* The mock option allows you to do just that.
|
455 |
-
*/
|
456 |
-
$this->sync->mock_option( 'is_main_network', array( $this, 'is_main_network_option' ) );
|
457 |
-
$this->sync->mock_option( 'is_multi_site', array( $this, 'is_multisite' ) );
|
458 |
-
$this->sync->mock_option( 'main_network_site', array( $this, 'jetpack_main_network_site_option' ) );
|
459 |
-
$this->sync->mock_option( 'single_user_site', array( 'Jetpack', 'is_single_user_site' ) );
|
460 |
-
$this->sync->mock_option( 'stat_data', array( $this, 'get_stat_data' ) );
|
461 |
-
|
462 |
-
$this->sync->mock_option( 'has_file_system_write_access', array( 'Jetpack', 'file_system_write_access' ) );
|
463 |
-
$this->sync->mock_option( 'is_version_controlled', array( 'Jetpack', 'is_version_controlled' ) );
|
464 |
-
$this->sync->mock_option( 'max_upload_size', 'wp_max_upload_size' );
|
465 |
-
$this->sync->mock_option( 'content_width', array( 'Jetpack', 'get_content_width' ) );
|
466 |
-
|
467 |
-
/**
|
468 |
-
* Trigger an update to the main_network_site when we update the blogname of a site.
|
469 |
-
*
|
470 |
-
*/
|
471 |
-
add_action( 'update_option_siteurl', array( $this, 'update_jetpack_main_network_site_option' ) );
|
472 |
-
|
473 |
-
add_action( 'update_option', array( $this, 'log_settings_change' ), 10, 3 );
|
474 |
-
|
475 |
-
// Update the settings everytime the we register a new user to the site or we delete a user.
|
476 |
-
add_action( 'user_register', array( $this, 'is_single_user_site_invalidate' ) );
|
477 |
-
add_action( 'deleted_user', array( $this, 'is_single_user_site_invalidate' ) );
|
478 |
-
|
479 |
-
// Unlink user before deleting the user from .com
|
480 |
-
add_action( 'deleted_user', array( $this, 'unlink_user' ), 10, 1 );
|
481 |
-
add_action( 'remove_user_from_blog', array( $this, 'unlink_user' ), 10, 1 );
|
482 |
-
|
483 |
-
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST && isset( $_GET['for'] ) && 'jetpack' == $_GET['for'] ) {
|
484 |
-
@ini_set( 'display_errors', false ); // Display errors can cause the XML to be not well formed.
|
485 |
-
|
486 |
-
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-xmlrpc-server.php';
|
487 |
-
$this->xmlrpc_server = new Jetpack_XMLRPC_Server();
|
488 |
-
|
489 |
-
$this->require_jetpack_authentication();
|
490 |
-
|
491 |
-
if ( Jetpack::is_active() ) {
|
492 |
-
// Hack to preserve $HTTP_RAW_POST_DATA
|
493 |
-
add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
|
494 |
-
|
495 |
-
$signed = $this->verify_xml_rpc_signature();
|
496 |
-
if ( $signed && ! is_wp_error( $signed ) ) {
|
497 |
-
// The actual API methods.
|
498 |
-
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
|
499 |
-
} else {
|
500 |
-
add_filter( 'xmlrpc_methods', '__return_empty_array' );
|
501 |
-
}
|
502 |
-
} else {
|
503 |
-
// The bootstrap API methods.
|
504 |
-
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
|
505 |
-
}
|
506 |
-
|
507 |
-
// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
|
508 |
-
add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
|
509 |
-
} elseif ( is_admin() && isset( $_POST['action'] ) && 'jetpack_upload_file' == $_POST['action'] ) {
|
510 |
-
$this->require_jetpack_authentication();
|
511 |
-
$this->add_remote_request_handlers();
|
512 |
-
} else {
|
513 |
-
if ( Jetpack::is_active() ) {
|
514 |
-
add_action( 'login_form_jetpack_json_api_authorization', array( &$this, 'login_form_json_api_authorization' ) );
|
515 |
-
add_filter( 'xmlrpc_methods', array( $this, 'public_xmlrpc_methods' ) );
|
516 |
-
}
|
517 |
-
}
|
518 |
-
|
519 |
-
if ( Jetpack::is_active() ) {
|
520 |
-
Jetpack_Heartbeat::init();
|
521 |
-
}
|
522 |
-
|
523 |
-
add_action( 'jetpack_clean_nonces', array( 'Jetpack', 'clean_nonces' ) );
|
524 |
-
if ( ! wp_next_scheduled( 'jetpack_clean_nonces' ) ) {
|
525 |
-
wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' );
|
526 |
-
}
|
527 |
-
|
528 |
-
add_filter( 'xmlrpc_blog_options', array( $this, 'xmlrpc_options' ) );
|
529 |
-
|
530 |
-
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
531 |
-
add_action( 'admin_init', array( $this, 'dismiss_jetpack_notice' ) );
|
532 |
-
|
533 |
-
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
|
534 |
-
|
535 |
-
add_action( 'wp_dashboard_setup', array( $this, 'wp_dashboard_setup' ) );
|
536 |
-
// Filter the dashboard meta box order to swap the new one in in place of the old one.
|
537 |
-
add_filter( 'get_user_option_meta-box-order_dashboard', array( $this, 'get_user_option_meta_box_order_dashboard' ) );
|
538 |
-
|
539 |
-
add_action( 'wp_ajax_jetpack-sync-reindex-trigger', array( $this, 'sync_reindex_trigger' ) );
|
540 |
-
add_action( 'wp_ajax_jetpack-sync-reindex-status', array( $this, 'sync_reindex_status' ) );
|
541 |
-
|
542 |
-
// Jump Start AJAX callback function
|
543 |
-
add_action( 'wp_ajax_jetpack_jumpstart_ajax', array( $this, 'jetpack_jumpstart_ajax_callback' ) );
|
544 |
-
add_action( 'update_option', array( $this, 'jumpstart_has_updated_module_option' ) );
|
545 |
-
|
546 |
-
// Identity Crisis AJAX callback function
|
547 |
-
add_action( 'wp_ajax_jetpack_resolve_identity_crisis', array( $this, 'resolve_identity_crisis_ajax_callback' ) );
|
548 |
-
|
549 |
-
// JITM AJAX callback function
|
550 |
-
add_action( 'wp_ajax_jitm_ajax', array( $this, 'jetpack_jitm_ajax_callback' ) );
|
551 |
-
|
552 |
-
add_action( 'wp_ajax_jetpack_admin_ajax', array( $this, 'jetpack_admin_ajax_callback' ) );
|
553 |
-
add_action( 'wp_ajax_jetpack_admin_ajax_refresh', array( $this, 'jetpack_admin_ajax_refresh_data' ) );
|
554 |
-
|
555 |
-
// Universal ajax callback for all tracking events triggered via js
|
556 |
-
add_action( 'wp_ajax_jetpack_tracks', array( $this, 'jetpack_admin_ajax_tracks_callback' ) );
|
557 |
-
|
558 |
-
add_action( 'wp_loaded', array( $this, 'register_assets' ) );
|
559 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'devicepx' ) );
|
560 |
-
add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) );
|
561 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'devicepx' ) );
|
562 |
-
|
563 |
-
add_action( 'jetpack_activate_module', array( $this, 'activate_module_actions' ) );
|
564 |
-
|
565 |
-
add_action( 'plugins_loaded', array( $this, 'extra_oembed_providers' ), 100 );
|
566 |
-
|
567 |
-
add_action( 'jetpack_notices', array( $this, 'show_development_mode_notice' ) );
|
568 |
-
|
569 |
-
/**
|
570 |
-
* These actions run checks to load additional files.
|
571 |
-
* They check for external files or plugins, so they need to run as late as possible.
|
572 |
-
*/
|
573 |
-
add_action( 'wp_head', array( $this, 'check_open_graph' ), 1 );
|
574 |
-
add_action( 'plugins_loaded', array( $this, 'check_twitter_tags' ), 999 );
|
575 |
-
add_action( 'plugins_loaded', array( $this, 'check_rest_api_compat' ), 1000 );
|
576 |
-
|
577 |
-
add_filter( 'plugins_url', array( 'Jetpack', 'maybe_min_asset' ), 1, 3 );
|
578 |
-
add_filter( 'style_loader_tag', array( 'Jetpack', 'maybe_inline_style' ), 10, 2 );
|
579 |
-
|
580 |
-
add_filter( 'map_meta_cap', array( $this, 'jetpack_custom_caps' ), 1, 4 );
|
581 |
-
|
582 |
-
add_filter( 'jetpack_get_default_modules', array( $this, 'filter_default_modules' ) );
|
583 |
-
add_filter( 'jetpack_get_default_modules', array( $this, 'handle_deprecated_modules' ), 99 );
|
584 |
-
|
585 |
-
// A filter to control all just in time messages
|
586 |
-
add_filter( 'jetpack_just_in_time_msgs', '__return_true' );
|
587 |
-
|
588 |
-
/**
|
589 |
-
* This is the hack to concatinate all css files into one.
|
590 |
-
* For description and reasoning see the implode_frontend_css method
|
591 |
-
*
|
592 |
-
* Super late priority so we catch all the registered styles
|
593 |
-
*/
|
594 |
-
if( !is_admin() ) {
|
595 |
-
add_action( 'wp_print_styles', array( $this, 'implode_frontend_css' ), -1 ); // Run first
|
596 |
-
add_action( 'wp_print_footer_scripts', array( $this, 'implode_frontend_css' ), -1 ); // Run first to trigger before `print_late_styles`
|
597 |
-
}
|
598 |
-
|
599 |
-
// Sync Core Icon: Detect changes in Core's Site Icon and make it syncable.
|
600 |
-
add_action( 'add_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
601 |
-
add_action( 'update_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
602 |
-
add_action( 'delete_option_site_icon', array( $this, 'jetpack_sync_core_icon' ) );
|
603 |
-
add_action( 'jetpack_heartbeat', array( $this, 'jetpack_sync_core_icon' ) );
|
604 |
-
|
605 |
-
}
|
606 |
-
|
607 |
-
/*
|
608 |
-
* Make sure any site icon added to core can get
|
609 |
-
* synced back to dotcom, so we can display it there.
|
610 |
-
*/
|
611 |
-
function jetpack_sync_core_icon() {
|
612 |
-
if ( function_exists( 'get_site_icon_url' ) ) {
|
613 |
-
$url = get_site_icon_url();
|
614 |
-
} else {
|
615 |
-
return;
|
616 |
-
}
|
617 |
-
|
618 |
-
require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
|
619 |
-
// If there's a core icon, maybe update the option. If not, fall back to Jetpack's.
|
620 |
-
if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
|
621 |
-
// This is the option that is synced with dotcom
|
622 |
-
Jetpack_Options::update_option( 'site_icon_url', $url );
|
623 |
-
} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
|
624 |
-
Jetpack_Options::delete_option( 'site_icon_url' );
|
625 |
-
}
|
626 |
-
}
|
627 |
-
|
628 |
-
function jetpack_admin_ajax_tracks_callback() {
|
629 |
-
// Check for nonce
|
630 |
-
if ( ! isset( $_REQUEST['tracksNonce'] ) || ! wp_verify_nonce( $_REQUEST['tracksNonce'], 'jp-tracks-ajax-nonce' ) ) {
|
631 |
-
wp_die( 'Permissions check failed.' );
|
632 |
-
}
|
633 |
-
|
634 |
-
if ( ! isset( $_REQUEST['tracksEventName'] ) || ! isset( $_REQUEST['tracksEventType'] ) ) {
|
635 |
-
wp_die( 'No valid event name or type.' );
|
636 |
-
}
|
637 |
-
|
638 |
-
$tracks_data = array();
|
639 |
-
if ( 'click' === $_REQUEST['tracksEventType'] && isset( $_REQUEST['tracksEventProp'] ) ) {
|
640 |
-
$tracks_data = array( 'clicked' => $_REQUEST['tracksEventProp'] );
|
641 |
-
}
|
642 |
-
|
643 |
-
JetpackTracking::record_user_event( $_REQUEST['tracksEventName'], $tracks_data );
|
644 |
-
wp_send_json_success();
|
645 |
-
wp_die();
|
646 |
-
}
|
647 |
-
|
648 |
-
function jetpack_admin_ajax_callback() {
|
649 |
-
// Check for nonce
|
650 |
-
if ( ! isset( $_REQUEST['adminNonce'] ) || ! wp_verify_nonce( $_REQUEST['adminNonce'], 'jetpack-admin-nonce' ) || ! current_user_can( 'jetpack_manage_modules' ) ) {
|
651 |
-
wp_die( 'permissions check failed' );
|
652 |
-
}
|
653 |
-
|
654 |
-
if ( isset( $_REQUEST['toggleModule'] ) && 'nux-toggle-module' == $_REQUEST['toggleModule'] ) {
|
655 |
-
$slug = $_REQUEST['thisModuleSlug'];
|
656 |
-
|
657 |
-
if ( ! in_array( $slug, Jetpack::get_available_modules() ) ) {
|
658 |
-
wp_die( 'That is not a Jetpack module slug' );
|
659 |
-
}
|
660 |
-
|
661 |
-
if ( Jetpack::is_module_active( $slug ) ) {
|
662 |
-
Jetpack::deactivate_module( $slug );
|
663 |
-
} else {
|
664 |
-
Jetpack::activate_module( $slug, false, false );
|
665 |
-
}
|
666 |
-
|
667 |
-
$modules = Jetpack_Admin::init()->get_modules();
|
668 |
-
echo json_encode( $modules[ $slug ] );
|
669 |
-
|
670 |
-
exit;
|
671 |
-
}
|
672 |
-
|
673 |
-
wp_die();
|
674 |
-
}
|
675 |
-
|
676 |
-
/*
|
677 |
-
* Sometimes we need to refresh the data,
|
678 |
-
* especially if the page is visited via a 'history'
|
679 |
-
* event like back/forward
|
680 |
-
*/
|
681 |
-
function jetpack_admin_ajax_refresh_data() {
|
682 |
-
// Check for nonce
|
683 |
-
if ( ! isset( $_REQUEST['adminNonce'] ) || ! wp_verify_nonce( $_REQUEST['adminNonce'], 'jetpack-admin-nonce' ) ) {
|
684 |
-
wp_die( 'permissions check failed' );
|
685 |
-
}
|
686 |
-
|
687 |
-
if ( isset( $_REQUEST['refreshData'] ) && 'refresh' == $_REQUEST['refreshData'] ) {
|
688 |
-
$modules = Jetpack_Admin::init()->get_modules();
|
689 |
-
echo json_encode( $modules );
|
690 |
-
exit;
|
691 |
-
}
|
692 |
-
|
693 |
-
wp_die();
|
694 |
-
}
|
695 |
-
|
696 |
-
/**
|
697 |
-
* The callback for the Jump Start ajax requests.
|
698 |
-
*/
|
699 |
-
function jetpack_jumpstart_ajax_callback() {
|
700 |
-
// Check for nonce
|
701 |
-
if ( ! isset( $_REQUEST['jumpstartNonce'] ) || ! wp_verify_nonce( $_REQUEST['jumpstartNonce'], 'jetpack-jumpstart-nonce' ) )
|
702 |
-
wp_die( 'permissions check failed' );
|
703 |
-
|
704 |
-
if ( isset( $_REQUEST['jumpStartActivate'] ) && 'jump-start-activate' == $_REQUEST['jumpStartActivate'] ) {
|
705 |
-
// Update the jumpstart option
|
706 |
-
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
707 |
-
Jetpack_Options::update_option( 'jumpstart', 'jumpstart_activated' );
|
708 |
-
}
|
709 |
-
|
710 |
-
// Loops through the requested "Jump Start" modules, and activates them.
|
711 |
-
// Custom 'no_message' state, so that no message will be shown on reload.
|
712 |
-
$modules = $_REQUEST['jumpstartModSlug'];
|
713 |
-
$module_slugs = array();
|
714 |
-
foreach( $modules as $module => $value ) {
|
715 |
-
$module_slugs[] = $value['module_slug'];
|
716 |
-
}
|
717 |
-
|
718 |
-
// Check for possible conflicting plugins
|
719 |
-
$module_slugs_filtered = $this->filter_default_modules( $module_slugs );
|
720 |
-
|
721 |
-
foreach ( $module_slugs_filtered as $module_slug ) {
|
722 |
-
Jetpack::log( 'activate', $module_slug );
|
723 |
-
Jetpack::activate_module( $module_slug, false, false );
|
724 |
-
Jetpack::state( 'message', 'no_message' );
|
725 |
-
}
|
726 |
-
|
727 |
-
// Set the default sharing buttons and set to display on posts if none have been set.
|
728 |
-
$sharing_services = get_option( 'sharing-services' );
|
729 |
-
$sharing_options = get_option( 'sharing-options' );
|
730 |
-
if ( empty( $sharing_services['visible'] ) ) {
|
731 |
-
// Default buttons to set
|
732 |
-
$visible = array(
|
733 |
-
'twitter',
|
734 |
-
'facebook',
|
735 |
-
'google-plus-1',
|
736 |
-
);
|
737 |
-
$hidden = array();
|
738 |
-
|
739 |
-
// Set some sharing settings
|
740 |
-
$sharing = new Sharing_Service();
|
741 |
-
$sharing_options['global'] = array(
|
742 |
-
'button_style' => 'icon',
|
743 |
-
'sharing_label' => $sharing->default_sharing_label,
|
744 |
-
'open_links' => 'same',
|
745 |
-
'show' => array( 'post' ),
|
746 |
-
'custom' => isset( $sharing_options['global']['custom'] ) ? $sharing_options['global']['custom'] : array()
|
747 |
-
);
|
748 |
-
|
749 |
-
update_option( 'sharing-options', $sharing_options );
|
750 |
-
|
751 |
-
// Send a success response so that we can display an error message.
|
752 |
-
$success = update_option( 'sharing-services', array( 'visible' => $visible, 'hidden' => $hidden ) );
|
753 |
-
echo json_encode( $success );
|
754 |
-
exit;
|
755 |
-
}
|
756 |
-
|
757 |
-
} elseif ( isset( $_REQUEST['disableJumpStart'] ) && true == $_REQUEST['disableJumpStart'] ) {
|
758 |
-
// If dismissed, flag the jumpstart option as such.
|
759 |
-
// Send a success response so that we can display an error message.
|
760 |
-
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
761 |
-
$success = Jetpack_Options::update_option( 'jumpstart', 'jumpstart_dismissed' );
|
762 |
-
echo json_encode( $success );
|
763 |
-
exit;
|
764 |
-
}
|
765 |
-
|
766 |
-
} elseif ( isset( $_REQUEST['jumpStartDeactivate'] ) && 'jump-start-deactivate' == $_REQUEST['jumpStartDeactivate'] ) {
|
767 |
-
|
768 |
-
// FOR TESTING ONLY
|
769 |
-
// @todo remove
|
770 |
-
$modules = (array) $_REQUEST['jumpstartModSlug'];
|
771 |
-
foreach( $modules as $module => $value ) {
|
772 |
-
if ( !in_array( $value['module_slug'], Jetpack::get_default_modules() ) ) {
|
773 |
-
Jetpack::log( 'deactivate', $value['module_slug'] );
|
774 |
-
Jetpack::deactivate_module( $value['module_slug'] );
|
775 |
-
Jetpack::state( 'message', 'no_message' );
|
776 |
-
} else {
|
777 |
-
Jetpack::log( 'activate', $value['module_slug'] );
|
778 |
-
Jetpack::activate_module( $value['module_slug'], false, false );
|
779 |
-
Jetpack::state( 'message', 'no_message' );
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
Jetpack_Options::update_option( 'jumpstart', 'new_connection' );
|
784 |
-
echo "reload the page";
|
785 |
-
}
|
786 |
-
|
787 |
-
wp_die();
|
788 |
-
}
|
789 |
-
|
790 |
-
/**
|
791 |
-
* The callback for the JITM ajax requests.
|
792 |
-
*/
|
793 |
-
function jetpack_jitm_ajax_callback() {
|
794 |
-
// Check for nonce
|
795 |
-
if ( ! isset( $_REQUEST['jitmNonce'] ) || ! wp_verify_nonce( $_REQUEST['jitmNonce'], 'jetpack-jitm-nonce' ) ) {
|
796 |
-
wp_die( 'Module activation failed due to lack of appropriate permissions' );
|
797 |
-
}
|
798 |
-
if ( isset( $_REQUEST['jitmActionToTake'] ) && 'activate' == $_REQUEST['jitmActionToTake'] ) {
|
799 |
-
$module_slug = $_REQUEST['jitmModule'];
|
800 |
-
Jetpack::log( 'activate', $module_slug );
|
801 |
-
Jetpack::activate_module( $module_slug, false, false );
|
802 |
-
Jetpack::state( 'message', 'no_message' );
|
803 |
-
|
804 |
-
//A Jetpack module is being activated through a JITM, track it
|
805 |
-
$this->stat( 'jitm', $module_slug.'-activated-' . JETPACK__VERSION );
|
806 |
-
$this->do_stats( 'server_side' );
|
807 |
-
|
808 |
-
wp_send_json_success();
|
809 |
-
}
|
810 |
-
if ( isset( $_REQUEST['jitmActionToTake'] ) && 'dismiss' == $_REQUEST['jitmActionToTake'] ) {
|
811 |
-
// get the hide_jitm options array
|
812 |
-
$jetpack_hide_jitm = Jetpack_Options::get_option( 'hide_jitm' );
|
813 |
-
$module_slug = $_REQUEST['jitmModule'];
|
814 |
-
|
815 |
-
if( ! $jetpack_hide_jitm ) {
|
816 |
-
$jetpack_hide_jitm = array(
|
817 |
-
$module_slug => 'hide'
|
818 |
-
);
|
819 |
-
} else {
|
820 |
-
$jetpack_hide_jitm[$module_slug] = 'hide';
|
821 |
-
}
|
822 |
-
|
823 |
-
Jetpack_Options::update_option( 'hide_jitm', $jetpack_hide_jitm );
|
824 |
-
|
825 |
-
//jitm is being dismissed forever, track it
|
826 |
-
$this->stat( 'jitm', $module_slug.'-dismissed-' . JETPACK__VERSION );
|
827 |
-
$this->do_stats( 'server_side' );
|
828 |
-
|
829 |
-
wp_send_json_success();
|
830 |
-
}
|
831 |
-
if ( isset( $_REQUEST['jitmActionToTake'] ) && 'launch' == $_REQUEST['jitmActionToTake'] ) {
|
832 |
-
$module_slug = $_REQUEST['jitmModule'];
|
833 |
-
|
834 |
-
// User went to WordPress.com, track this
|
835 |
-
$this->stat( 'jitm', $module_slug.'-wordpress-tools-' . JETPACK__VERSION );
|
836 |
-
$this->do_stats( 'server_side' );
|
837 |
-
|
838 |
-
wp_send_json_success();
|
839 |
-
}
|
840 |
-
if ( isset( $_REQUEST['jitmActionToTake'] ) && 'viewed' == $_REQUEST['jitmActionToTake'] ) {
|
841 |
-
$track = $_REQUEST['jitmModule'];
|
842 |
-
|
843 |
-
// User is viewing JITM, track it.
|
844 |
-
$this->stat( 'jitm', $track . '-viewed-' . JETPACK__VERSION );
|
845 |
-
$this->do_stats( 'server_side' );
|
846 |
-
|
847 |
-
wp_send_json_success();
|
848 |
-
}
|
849 |
-
}
|
850 |
-
|
851 |
-
/**
|
852 |
-
* If there are any stats that need to be pushed, but haven't been, push them now.
|
853 |
-
*/
|
854 |
-
function __destruct() {
|
855 |
-
if ( ! empty( $this->stats ) ) {
|
856 |
-
$this->do_stats( 'server_side' );
|
857 |
-
}
|
858 |
-
}
|
859 |
-
|
860 |
-
function jetpack_custom_caps( $caps, $cap, $user_id, $args ) {
|
861 |
-
switch( $cap ) {
|
862 |
-
case 'jetpack_connect' :
|
863 |
-
case 'jetpack_reconnect' :
|
864 |
-
if ( Jetpack::is_development_mode() ) {
|
865 |
-
$caps = array( 'do_not_allow' );
|
866 |
-
break;
|
867 |
-
}
|
868 |
-
/**
|
869 |
-
* Pass through. If it's not development mode, these should match disconnect.
|
870 |
-
* Let users disconnect if it's development mode, just in case things glitch.
|
871 |
-
*/
|
872 |
-
case 'jetpack_disconnect' :
|
873 |
-
/**
|
874 |
-
* In multisite, can individual site admins manage their own connection?
|
875 |
-
*
|
876 |
-
* Ideally, this should be extracted out to a separate filter in the Jetpack_Network class.
|
877 |
-
*/
|
878 |
-
if ( is_multisite() && ! is_super_admin() && is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) {
|
879 |
-
if ( ! Jetpack_Network::init()->get_option( 'sub-site-connection-override' ) ) {
|
880 |
-
/**
|
881 |
-
* We need to update the option name -- it's terribly unclear which
|
882 |
-
* direction the override goes.
|
883 |
-
*
|
884 |
-
* @todo: Update the option name to `sub-sites-can-manage-own-connections`
|
885 |
-
*/
|
886 |
-
$caps = array( 'do_not_allow' );
|
887 |
-
break;
|
888 |
-
}
|
889 |
-
}
|
890 |
-
|
891 |
-
$caps = array( 'manage_options' );
|
892 |
-
break;
|
893 |
-
case 'jetpack_manage_modules' :
|
894 |
-
case 'jetpack_activate_modules' :
|
895 |
-
case 'jetpack_deactivate_modules' :
|
896 |
-
$caps = array( 'manage_options' );
|
897 |
-
break;
|
898 |
-
case 'jetpack_configure_modules' :
|
899 |
-
$caps = array( 'manage_options' );
|
900 |
-
break;
|
901 |
-
case 'jetpack_network_admin_page':
|
902 |
-
case 'jetpack_network_settings_page':
|
903 |
-
$caps = array( 'manage_network_plugins' );
|
904 |
-
break;
|
905 |
-
case 'jetpack_network_sites_page':
|
906 |
-
$caps = array( 'manage_sites' );
|
907 |
-
break;
|
908 |
-
case 'jetpack_admin_page' :
|
909 |
-
if ( Jetpack::is_development_mode() ) {
|
910 |
-
$caps = array( 'manage_options' );
|
911 |
-
break;
|
912 |
-
}
|
913 |
-
|
914 |
-
// Don't ever show to subscribers, but allow access to the page if they're trying to unlink.
|
915 |
-
if ( ! current_user_can( 'edit_posts' ) ) {
|
916 |
-
if ( isset( $_GET['redirect'] ) && 'sub-unlink' == $_GET['redirect'] ) {
|
917 |
-
// We need this in order to unlink the user.
|
918 |
-
$this->admin_page_load();
|
919 |
-
}
|
920 |
-
if ( ! wp_verify_nonce( 'jetpack-unlink' ) ) {
|
921 |
-
$caps = array( 'do_not_allow' );
|
922 |
-
break;
|
923 |
-
}
|
924 |
-
}
|
925 |
-
|
926 |
-
if ( ! self::is_active() && ! current_user_can( 'jetpack_connect' ) ) {
|
927 |
-
$caps = array( 'do_not_allow' );
|
928 |
-
break;
|
929 |
-
}
|
930 |
-
/**
|
931 |
-
* Pass through. If it's not development mode, these should match the admin page.
|
932 |
-
* Let users disconnect if it's development mode, just in case things glitch.
|
933 |
-
*/
|
934 |
-
case 'jetpack_connect_user' :
|
935 |
-
if ( Jetpack::is_development_mode() ) {
|
936 |
-
$caps = array( 'do_not_allow' );
|
937 |
-
break;
|
938 |
-
}
|
939 |
-
$caps = array( 'read' );
|
940 |
-
break;
|
941 |
-
}
|
942 |
-
return $caps;
|
943 |
-
}
|
944 |
-
|
945 |
-
function require_jetpack_authentication() {
|
946 |
-
// Don't let anyone authenticate
|
947 |
-
$_COOKIE = array();
|
948 |
-
remove_all_filters( 'authenticate' );
|
949 |
-
|
950 |
-
/**
|
951 |
-
* For the moment, remove Limit Login Attempts if its xmlrpc for Jetpack.
|
952 |
-
* If Limit Login Attempts is installed as a mu-plugin, it can occasionally
|
953 |
-
* generate false-positives.
|
954 |
-
*/
|
955 |
-
remove_filter( 'wp_login_failed', 'limit_login_failed' );
|
956 |
-
|
957 |
-
if ( Jetpack::is_active() ) {
|
958 |
-
// Allow Jetpack authentication
|
959 |
-
add_filter( 'authenticate', array( $this, 'authenticate_jetpack' ), 10, 3 );
|
960 |
-
}
|
961 |
-
}
|
962 |
-
|
963 |
-
/**
|
964 |
-
* Load language files
|
965 |
-
*/
|
966 |
-
public static function plugin_textdomain() {
|
967 |
-
// Note to self, the third argument must not be hardcoded, to account for relocated folders.
|
968 |
-
load_plugin_textdomain( 'jetpack', false, dirname( plugin_basename( JETPACK__PLUGIN_FILE ) ) . '/languages/' );
|
969 |
-
}
|
970 |
-
|
971 |
-
/**
|
972 |
-
* Register assets for use in various modules and the Jetpack admin page.
|
973 |
-
*
|
974 |
-
* @uses wp_script_is, wp_register_script, plugins_url
|
975 |
-
* @action wp_loaded
|
976 |
-
* @return null
|
977 |
-
*/
|
978 |
-
public function register_assets() {
|
979 |
-
if ( ! wp_script_is( 'spin', 'registered' ) ) {
|
980 |
-
wp_register_script( 'spin', plugins_url( '_inc/spin.js', JETPACK__PLUGIN_FILE ), false, '1.3' );
|
981 |
-
}
|
982 |
-
|
983 |
-
if ( ! wp_script_is( 'jquery.spin', 'registered' ) ) {
|
984 |
-
wp_register_script( 'jquery.spin', plugins_url( '_inc/jquery.spin.js', JETPACK__PLUGIN_FILE ) , array( 'jquery', 'spin' ), '1.3' );
|
985 |
-
}
|
986 |
-
|
987 |
-
if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) ) {
|
988 |
-
wp_register_script( 'jetpack-gallery-settings', plugins_url( '_inc/gallery-settings.js', JETPACK__PLUGIN_FILE ), array( 'media-views' ), '20121225' );
|
989 |
-
}
|
990 |
-
|
991 |
-
if ( ! wp_script_is( 'jetpack-twitter-timeline', 'registered' ) ) {
|
992 |
-
wp_register_script( 'jetpack-twitter-timeline', plugins_url( '_inc/twitter-timeline.js', JETPACK__PLUGIN_FILE ) , array( 'jquery' ), '3.10', true );
|
993 |
-
}
|
994 |
-
|
995 |
-
if ( ! wp_script_is( 'jetpack-facebook-embed', 'registered' ) ) {
|
996 |
-
wp_register_script( 'jetpack-facebook-embed', plugins_url( '_inc/facebook-embed.js', __FILE__ ), array( 'jquery' ), null, true );
|
997 |
-
|
998 |
-
/** This filter is documented in modules/sharedaddy/sharing-sources.php */
|
999 |
-
$fb_app_id = apply_filters( 'jetpack_sharing_facebook_app_id', '249643311490' );
|
1000 |
-
if ( ! is_numeric( $fb_app_id ) ) {
|
1001 |
-
$fb_app_id = '';
|
1002 |
-
}
|
1003 |
-
wp_localize_script(
|
1004 |
-
'jetpack-facebook-embed',
|
1005 |
-
'jpfbembed',
|
1006 |
-
array(
|
1007 |
-
'appid' => $fb_app_id,
|
1008 |
-
'locale' => $this->get_locale(),
|
1009 |
-
)
|
1010 |
-
);
|
1011 |
-
}
|
1012 |
-
|
1013 |
-
/**
|
1014 |
-
* As jetpack_register_genericons is by default fired off a hook,
|
1015 |
-
* the hook may have already fired by this point.
|
1016 |
-
* So, let's just trigger it manually.
|
1017 |
-
*/
|
1018 |
-
require_once( JETPACK__PLUGIN_DIR . '_inc/genericons.php' );
|
1019 |
-
jetpack_register_genericons();
|
1020 |
-
|
1021 |
-
if ( ! wp_style_is( 'jetpack-icons', 'registered' ) )
|
1022 |
-
wp_register_style( 'jetpack-icons', plugins_url( 'css/jetpack-icons.min.css', JETPACK__PLUGIN_FILE ), false, JETPACK__VERSION );
|
1023 |
-
}
|
1024 |
-
|
1025 |
-
/**
|
1026 |
-
* Guess locale from language code.
|
1027 |
-
*
|
1028 |
-
* @param string $lang Language code.
|
1029 |
-
* @return string|bool
|
1030 |
-
*/
|
1031 |
-
function guess_locale_from_lang( $lang ) {
|
1032 |
-
if ( 'en' === $lang || 'en_US' === $lang || ! $lang ) {
|
1033 |
-
return 'en_US';
|
1034 |
-
}
|
1035 |
-
|
1036 |
-
if ( ! class_exists( 'GP_Locales' ) ) {
|
1037 |
-
if ( ! defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) || ! file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) {
|
1038 |
-
return false;
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
require JETPACK__GLOTPRESS_LOCALES_PATH;
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
|
1045 |
-
// WP.com: get_locale() returns 'it'
|
1046 |
-
$locale = GP_Locales::by_slug( $lang );
|
1047 |
-
} else {
|
1048 |
-
// Jetpack: get_locale() returns 'it_IT';
|
1049 |
-
$locale = GP_Locales::by_field( 'facebook_locale', $lang );
|
1050 |
-
}
|
1051 |
-
|
1052 |
-
if ( ! $locale ) {
|
1053 |
-
return false;
|
1054 |
-
}
|
1055 |
-
|
1056 |
-
if ( empty( $locale->facebook_locale ) ) {
|
1057 |
-
if ( empty( $locale->wp_locale ) ) {
|
1058 |
-
return false;
|
1059 |
-
} else {
|
1060 |
-
// Facebook SDK is smart enough to fall back to en_US if a
|
1061 |
-
// locale isn't supported. Since supported Facebook locales
|
1062 |
-
// can fall out of sync, we'll attempt to use the known
|
1063 |
-
// wp_locale value and rely on said fallback.
|
1064 |
-
return $locale->wp_locale;
|
1065 |
-
}
|
1066 |
-
}
|
1067 |
-
|
1068 |
-
return $locale->facebook_locale;
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
/**
|
1072 |
-
* Get the locale.
|
1073 |
-
*
|
1074 |
-
* @return string|bool
|
1075 |
-
*/
|
1076 |
-
function get_locale() {
|
1077 |
-
$locale = $this->guess_locale_from_lang( get_locale() );
|
1078 |
-
|
1079 |
-
if ( ! $locale ) {
|
1080 |
-
$locale = 'en_US';
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
return $locale;
|
1084 |
-
}
|
1085 |
-
|
1086 |
-
/**
|
1087 |
-
* Device Pixels support
|
1088 |
-
* This improves the resolution of gravatars and wordpress.com uploads on hi-res and zoomed browsers.
|
1089 |
-
*/
|
1090 |
-
function devicepx() {
|
1091 |
-
if ( Jetpack::is_active() ) {
|
1092 |
-
wp_enqueue_script( 'devicepx', set_url_scheme( 'http://s0.wp.com/wp-content/js/devicepx-jetpack.js' ), array(), gmdate( 'oW' ), true );
|
1093 |
-
}
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
/*
|
1097 |
-
* Returns the location of Jetpack's lib directory. This filter is applied
|
1098 |
-
* in require_lib().
|
1099 |
-
*
|
1100 |
-
* @filter require_lib_dir
|
1101 |
-
*/
|
1102 |
-
function require_lib_dir() {
|
1103 |
-
return JETPACK__PLUGIN_DIR . '_inc/lib';
|
1104 |
-
}
|
1105 |
-
|
1106 |
-
/**
|
1107 |
-
* Return the network_site_url so that .com knows what network this site is a part of.
|
1108 |
-
* @param bool $option
|
1109 |
-
* @return string
|
1110 |
-
*/
|
1111 |
-
public function jetpack_main_network_site_option( $option ) {
|
1112 |
-
return network_site_url();
|
1113 |
-
}
|
1114 |
-
/**
|
1115 |
-
* Network Name.
|
1116 |
-
*/
|
1117 |
-
static function network_name( $option = null ) {
|
1118 |
-
global $current_site;
|
1119 |
-
return $current_site->site_name;
|
1120 |
-
}
|
1121 |
-
/**
|
1122 |
-
* Does the network allow new user and site registrations.
|
1123 |
-
* @return string
|
1124 |
-
*/
|
1125 |
-
static function network_allow_new_registrations( $option = null ) {
|
1126 |
-
return ( in_array( get_site_option( 'registration' ), array('none', 'user', 'blog', 'all' ) ) ? get_site_option( 'registration') : 'none' );
|
1127 |
-
}
|
1128 |
-
/**
|
1129 |
-
* Does the network allow admins to add new users.
|
1130 |
-
* @return boolian
|
1131 |
-
*/
|
1132 |
-
static function network_add_new_users( $option = null ) {
|
1133 |
-
return (bool) get_site_option( 'add_new_users' );
|
1134 |
-
}
|
1135 |
-
/**
|
1136 |
-
* File upload psace left per site in MB.
|
1137 |
-
* -1 means NO LIMIT.
|
1138 |
-
* @return number
|
1139 |
-
*/
|
1140 |
-
static function network_site_upload_space( $option = null ) {
|
1141 |
-
// value in MB
|
1142 |
-
return ( get_site_option( 'upload_space_check_disabled' ) ? -1 : get_space_allowed() );
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
/**
|
1146 |
-
* Network allowed file types.
|
1147 |
-
* @return string
|
1148 |
-
*/
|
1149 |
-
static function network_upload_file_types( $option = null ) {
|
1150 |
-
return get_site_option( 'upload_filetypes', 'jpg jpeg png gif' );
|
1151 |
-
}
|
1152 |
-
|
1153 |
-
/**
|
1154 |
-
* Maximum file upload size set by the network.
|
1155 |
-
* @return number
|
1156 |
-
*/
|
1157 |
-
static function network_max_upload_file_size( $option = null ) {
|
1158 |
-
// value in KB
|
1159 |
-
return get_site_option( 'fileupload_maxk', 300 );
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
/**
|
1163 |
-
* Lets us know if a site allows admins to manage the network.
|
1164 |
-
* @return array
|
1165 |
-
*/
|
1166 |
-
static function network_enable_administration_menus( $option = null ) {
|
1167 |
-
return get_site_option( 'menu_items' );
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
/**
|
1171 |
-
* Return whether we are dealing with a multi network setup or not.
|
1172 |
-
* The reason we are type casting this is because we want to avoid the situation where
|
1173 |
-
* the result is false since when is_main_network_option return false it cases
|
1174 |
-
* the rest the get_option( 'jetpack_is_multi_network' ); to return the value that is set in the
|
1175 |
-
* database which could be set to anything as opposed to what this function returns.
|
1176 |
-
* @param bool $option
|
1177 |
-
*
|
1178 |
-
* @return boolean
|
1179 |
-
*/
|
1180 |
-
public function is_main_network_option( $option ) {
|
1181 |
-
// return '1' or ''
|
1182 |
-
return (string) (bool) Jetpack::is_multi_network();
|
1183 |
-
}
|
1184 |
-
|
1185 |
-
/**
|
1186 |
-
* Return true if we are with multi-site or multi-network false if we are dealing with single site.
|
1187 |
-
*
|
1188 |
-
* @param string $option
|
1189 |
-
* @return boolean
|
1190 |
-
*/
|
1191 |
-
public function is_multisite( $option ) {
|
1192 |
-
return (string) (bool) is_multisite();
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
/**
|
1196 |
-
* Implemented since there is no core is multi network function
|
1197 |
-
* Right now there is no way to tell if we which network is the dominant network on the system
|
1198 |
-
*
|
1199 |
-
* @since 3.3
|
1200 |
-
* @return boolean
|
1201 |
-
*/
|
1202 |
-
public static function is_multi_network() {
|
1203 |
-
global $wpdb;
|
1204 |
-
|
1205 |
-
// if we don't have a multi site setup no need to do any more
|
1206 |
-
if ( ! is_multisite() ) {
|
1207 |
-
return false;
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
$num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" );
|
1211 |
-
if ( $num_sites > 1 ) {
|
1212 |
-
return true;
|
1213 |
-
} else {
|
1214 |
-
return false;
|
1215 |
-
}
|
1216 |
-
}
|
1217 |
-
|
1218 |
-
/**
|
1219 |
-
* Trigger an update to the main_network_site when we update the siteurl of a site.
|
1220 |
-
* @return null
|
1221 |
-
*/
|
1222 |
-
function update_jetpack_main_network_site_option() {
|
1223 |
-
// do_action( 'add_option_$option', '$option', '$value-of-the-option' );
|
1224 |
-
/**
|
1225 |
-
* Fires when the site URL is updated.
|
1226 |
-
* Determines if the site is the main site of a Mulitiste network.
|
1227 |
-
*
|
1228 |
-
* @since 3.3.0
|
1229 |
-
*
|
1230 |
-
* @param string jetpack_main_network_site.
|
1231 |
-
* @param string network_site_url() Site URL for the "main" site of the current Multisite network.
|
1232 |
-
*/
|
1233 |
-
do_action( 'add_option_jetpack_main_network_site', 'jetpack_main_network_site', network_site_url() );
|
1234 |
-
/**
|
1235 |
-
* Fires when the site URL is updated.
|
1236 |
-
* Determines if the is part of a multi network.
|
1237 |
-
*
|
1238 |
-
* @since 3.3.0
|
1239 |
-
*
|
1240 |
-
* @param string jetpack_is_main_network.
|
1241 |
-
* @param bool Jetpack::is_multi_network() Is the site part of a multi network.
|
1242 |
-
*/
|
1243 |
-
do_action( 'add_option_jetpack_is_main_network', 'jetpack_is_main_network', (string) (bool) Jetpack::is_multi_network() );
|
1244 |
-
/**
|
1245 |
-
* Fires when the site URL is updated.
|
1246 |
-
* Determines if the site is part of a multisite network.
|
1247 |
-
*
|
1248 |
-
* @since 3.4.0
|
1249 |
-
*
|
1250 |
-
* @param string jetpack_is_multi_site.
|
1251 |
-
* @param bool is_multisite() Is the site part of a mutlisite network.
|
1252 |
-
*/
|
1253 |
-
do_action( 'add_option_jetpack_is_multi_site', 'jetpack_is_multi_site', (string) (bool) is_multisite() );
|
1254 |
-
}
|
1255 |
-
/**
|
1256 |
-
* Triggered after a user updates the network settings via Network Settings Admin Page
|
1257 |
-
*
|
1258 |
-
*/
|
1259 |
-
function update_jetpack_network_settings() {
|
1260 |
-
// Only sync this info for the main network site.
|
1261 |
-
do_action( 'add_option_jetpack_network_name', 'jetpack_network_name', Jetpack::network_name() );
|
1262 |
-
do_action( 'add_option_jetpack_network_allow_new_registrations', 'jetpack_network_allow_new_registrations', Jetpack::network_allow_new_registrations() );
|
1263 |
-
do_action( 'add_option_jetpack_network_add_new_users', 'jetpack_network_add_new_users', Jetpack::network_add_new_users() );
|
1264 |
-
do_action( 'add_option_jetpack_network_site_upload_space', 'jetpack_network_site_upload_space', Jetpack::network_site_upload_space() );
|
1265 |
-
do_action( 'add_option_jetpack_network_upload_file_types', 'jetpack_network_upload_file_types', Jetpack::network_upload_file_types() );
|
1266 |
-
do_action( 'add_option_jetpack_network_enable_administration_menus', 'jetpack_network_enable_administration_menus', Jetpack::network_enable_administration_menus() );
|
1267 |
-
|
1268 |
-
}
|
1269 |
-
|
1270 |
-
/**
|
1271 |
-
* Get back if the current site is single user site.
|
1272 |
-
*
|
1273 |
-
* @return bool
|
1274 |
-
*/
|
1275 |
-
public static function is_single_user_site() {
|
1276 |
-
|
1277 |
-
$user_query = new WP_User_Query( array(
|
1278 |
-
'blog_id' => get_current_blog_id(),
|
1279 |
-
'fields' => 'ID',
|
1280 |
-
'number' => 2
|
1281 |
-
) );
|
1282 |
-
return 1 === (int) $user_query->get_total();
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
/**
|
1286 |
-
* Returns true if the site has file write access false otherwise.
|
1287 |
-
* @return string ( '1' | '0' )
|
1288 |
-
**/
|
1289 |
-
public static function file_system_write_access() {
|
1290 |
-
if ( ! function_exists( 'get_filesystem_method' ) ) {
|
1291 |
-
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
require_once( ABSPATH . 'wp-admin/includes/template.php' );
|
1295 |
-
|
1296 |
-
$filesystem_method = get_filesystem_method();
|
1297 |
-
if ( $filesystem_method === 'direct' ) {
|
1298 |
-
return 1;
|
1299 |
-
}
|
1300 |
-
|
1301 |
-
ob_start();
|
1302 |
-
$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
|
1303 |
-
ob_end_clean();
|
1304 |
-
if ( $filesystem_credentials_are_stored ) {
|
1305 |
-
return 1;
|
1306 |
-
}
|
1307 |
-
return 0;
|
1308 |
-
}
|
1309 |
-
|
1310 |
-
/**
|
1311 |
-
* Finds out if a site is using a version control system.
|
1312 |
-
* @return string ( '1' | '0' )
|
1313 |
-
**/
|
1314 |
-
public static function is_version_controlled() {
|
1315 |
-
|
1316 |
-
if ( !class_exists( 'WP_Automatic_Updater' ) ) {
|
1317 |
-
require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
1318 |
-
}
|
1319 |
-
$updater = new WP_Automatic_Updater();
|
1320 |
-
$is_version_controlled = strval( $updater->is_vcs_checkout( $context = ABSPATH ) );
|
1321 |
-
// transients should not be empty
|
1322 |
-
if ( empty( $is_version_controlled ) ) {
|
1323 |
-
$is_version_controlled = '0';
|
1324 |
-
}
|
1325 |
-
return $is_version_controlled;
|
1326 |
-
}
|
1327 |
-
|
1328 |
-
/**
|
1329 |
-
* Determines whether the current theme supports featured images or not.
|
1330 |
-
* @return string ( '1' | '0' )
|
1331 |
-
*/
|
1332 |
-
public static function featured_images_enabled() {
|
1333 |
-
return current_theme_supports( 'post-thumbnails' ) ? '1' : '0';
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
/*
|
1337 |
-
* Sync back wp_version
|
1338 |
-
*/
|
1339 |
-
public static function get_wp_version() {
|
1340 |
-
global $wp_version;
|
1341 |
-
return $wp_version;
|
1342 |
-
}
|
1343 |
-
|
1344 |
-
/**
|
1345 |
-
* Keeps wp_version in sync with .com when WordPress core updates
|
1346 |
-
**/
|
1347 |
-
public static function update_get_wp_version( $update, $meta_data ) {
|
1348 |
-
if ( 'update' === $meta_data['action'] && 'core' === $meta_data['type'] ) {
|
1349 |
-
/** This action is documented in wp-includes/option.php */
|
1350 |
-
/**
|
1351 |
-
* This triggers the sync for the jetpack version
|
1352 |
-
* See Jetpack_Sync options method for more info.
|
1353 |
-
*/
|
1354 |
-
do_action( 'add_option_jetpack_wp_version', 'jetpack_wp_version', (string) Jetpack::get_wp_version() );
|
1355 |
-
}
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
/**
|
1359 |
-
* Triggers a sync of update counts and update details
|
1360 |
-
*/
|
1361 |
-
function sync_update_data() {
|
1362 |
-
// Anytime WordPress saves update data, we'll want to sync update data
|
1363 |
-
add_action( 'set_site_transient_update_plugins', array( 'Jetpack', 'refresh_update_data' ) );
|
1364 |
-
add_action( 'set_site_transient_update_themes', array( 'Jetpack', 'refresh_update_data' ) );
|
1365 |
-
add_action( 'set_site_transient_update_core', array( 'Jetpack', 'refresh_update_data' ) );
|
1366 |
-
// Anytime a connection to jetpack is made, sync the update data
|
1367 |
-
add_action( 'jetpack_site_registered', array( 'Jetpack', 'refresh_update_data' ) );
|
1368 |
-
// Anytime the Jetpack Version changes, sync the the update data
|
1369 |
-
add_action( 'updating_jetpack_version', array( 'Jetpack', 'refresh_update_data' ) );
|
1370 |
-
|
1371 |
-
if ( current_user_can( 'update_core' ) && current_user_can( 'update_plugins' ) && current_user_can( 'update_themes' ) ) {
|
1372 |
-
$this->sync->mock_option( 'updates', array( 'Jetpack', 'get_updates' ) );
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
$this->sync->mock_option( 'update_details', array( 'Jetpack', 'get_update_details' ) );
|
1376 |
-
}
|
1377 |
-
|
1378 |
-
/**
|
1379 |
-
* Triggers a sync of information specific to the current theme.
|
1380 |
-
*/
|
1381 |
-
function sync_theme_data() {
|
1382 |
-
add_action( 'switch_theme', array( 'Jetpack', 'refresh_theme_data' ) );
|
1383 |
-
$this->sync->mock_option( 'featured_images_enabled', array( 'Jetpack', 'featured_images_enabled' ) );
|
1384 |
-
}
|
1385 |
-
|
1386 |
-
/**
|
1387 |
-
* jetpack_updates is saved in the following schema:
|
1388 |
-
*
|
1389 |
-
* array (
|
1390 |
-
* 'plugins' => (int) Number of plugin updates available.
|
1391 |
-
* 'themes' => (int) Number of theme updates available.
|
1392 |
-
* 'wordpress' => (int) Number of WordPress core updates available.
|
1393 |
-
* 'translations' => (int) Number of translation updates available.
|
1394 |
-
* 'total' => (int) Total of all available updates.
|
1395 |
-
* 'wp_update_version' => (string) The latest available version of WordPress, only present if a WordPress update is needed.
|
1396 |
-
* )
|
1397 |
-
* @return array
|
1398 |
-
*/
|
1399 |
-
public static function get_updates() {
|
1400 |
-
$update_data = wp_get_update_data();
|
1401 |
-
|
1402 |
-
// Stores the individual update counts as well as the total count.
|
1403 |
-
if ( isset( $update_data['counts'] ) ) {
|
1404 |
-
$updates = $update_data['counts'];
|
1405 |
-
}
|
1406 |
-
|
1407 |
-
// If we need to update WordPress core, let's find the latest version number.
|
1408 |
-
if ( ! empty( $updates['wordpress'] ) ) {
|
1409 |
-
$cur = get_preferred_from_update_core();
|
1410 |
-
if ( isset( $cur->response ) && 'upgrade' === $cur->response ) {
|
1411 |
-
$updates['wp_update_version'] = $cur->current;
|
1412 |
-
}
|
1413 |
-
}
|
1414 |
-
return isset( $updates ) ? $updates : array();
|
1415 |
-
}
|
1416 |
-
|
1417 |
-
public static function get_update_details() {
|
1418 |
-
$update_details = array(
|
1419 |
-
'update_core' => get_site_transient( 'update_core' ),
|
1420 |
-
'update_plugins' => get_site_transient( 'update_plugins' ),
|
1421 |
-
'update_themes' => get_site_transient( 'update_themes' ),
|
1422 |
-
);
|
1423 |
-
return $update_details;
|
1424 |
-
}
|
1425 |
-
|
1426 |
-
public static function refresh_update_data() {
|
1427 |
-
if ( current_user_can( 'update_core' ) && current_user_can( 'update_plugins' ) && current_user_can( 'update_themes' ) ) {
|
1428 |
-
/**
|
1429 |
-
* Fires whenever the amount of updates needed for a site changes.
|
1430 |
-
* Syncs an array that includes the number of theme, plugin, and core updates available, as well as the latest core version available.
|
1431 |
-
*
|
1432 |
-
* @since 3.7.0
|
1433 |
-
*
|
1434 |
-
* @param string jetpack_updates
|
1435 |
-
* @param array Update counts calculated by Jetpack::get_updates
|
1436 |
-
*/
|
1437 |
-
do_action( 'add_option_jetpack_updates', 'jetpack_updates', Jetpack::get_updates() );
|
1438 |
-
}
|
1439 |
-
/**
|
1440 |
-
* Fires whenever the amount of updates needed for a site changes.
|
1441 |
-
* Syncs an array of core, theme, and plugin data, and which of each is out of date
|
1442 |
-
*
|
1443 |
-
* @since 3.7.0
|
1444 |
-
*
|
1445 |
-
* @param string jetpack_update_details
|
1446 |
-
* @param array Update details calculated by Jetpack::get_update_details
|
1447 |
-
*/
|
1448 |
-
do_action( 'add_option_jetpack_update_details', 'jetpack_update_details', Jetpack::get_update_details() );
|
1449 |
-
}
|
1450 |
-
|
1451 |
-
public static function refresh_theme_data() {
|
1452 |
-
/**
|
1453 |
-
* Fires whenever a theme change is made.
|
1454 |
-
*
|
1455 |
-
* @since 3.8.1
|
1456 |
-
*
|
1457 |
-
* @param string featured_images_enabled
|
1458 |
-
* @param boolean Whether featured images are enabled or not
|
1459 |
-
*/
|
1460 |
-
do_action( 'add_option_jetpack_featured_images_enabled', 'jetpack_featured_images_enabled', Jetpack::featured_images_enabled() );
|
1461 |
-
}
|
1462 |
-
|
1463 |
-
/**
|
1464 |
-
* Invalides the transient as well as triggers the update of the mock option.
|
1465 |
-
*
|
1466 |
-
* @return null
|
1467 |
-
*/
|
1468 |
-
function is_single_user_site_invalidate() {
|
1469 |
-
/**
|
1470 |
-
* Fires when a user is added or removed from a site.
|
1471 |
-
* Determines if the site is a single user site.
|
1472 |
-
*
|
1473 |
-
* @since 3.4.0
|
1474 |
-
*
|
1475 |
-
* @param string jetpack_single_user_site.
|
1476 |
-
* @param bool Jetpack::is_single_user_site() Is the current site a single user site.
|
1477 |
-
*/
|
1478 |
-
do_action( 'update_option_jetpack_single_user_site', 'jetpack_single_user_site', (bool) Jetpack::is_single_user_site() );
|
1479 |
-
}
|
1480 |
-
|
1481 |
-
/**
|
1482 |
-
* Is Jetpack active?
|
1483 |
-
*/
|
1484 |
-
public static function is_active() {
|
1485 |
-
return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
|
1486 |
-
}
|
1487 |
-
|
1488 |
-
/**
|
1489 |
-
* Is Jetpack in development (offline) mode?
|
1490 |
-
*/
|
1491 |
-
public static function is_development_mode() {
|
1492 |
-
$development_mode = false;
|
1493 |
-
|
1494 |
-
if ( defined( 'JETPACK_DEV_DEBUG' ) ) {
|
1495 |
-
$development_mode = JETPACK_DEV_DEBUG;
|
1496 |
-
}
|
1497 |
-
|
1498 |
-
elseif ( site_url() && false === strpos( site_url(), '.' ) ) {
|
1499 |
-
$development_mode = true;
|
1500 |
-
}
|
1501 |
-
/**
|
1502 |
-
* Filters Jetpack's development mode.
|
1503 |
-
*
|
1504 |
-
* @see http://jetpack.com/support/development-mode/
|
1505 |
-
*
|
1506 |
-
* @since 2.2.1
|
1507 |
-
*
|
1508 |
-
* @param bool $development_mode Is Jetpack's development mode active.
|
1509 |
-
*/
|
1510 |
-
return apply_filters( 'jetpack_development_mode', $development_mode );
|
1511 |
-
}
|
1512 |
-
|
1513 |
-
/**
|
1514 |
-
* Get Jetpack development mode notice text and notice class.
|
1515 |
-
*
|
1516 |
-
* Mirrors the checks made in Jetpack::is_development_mode
|
1517 |
-
*
|
1518 |
-
*/
|
1519 |
-
public static function show_development_mode_notice() {
|
1520 |
-
if ( Jetpack::is_development_mode() ) {
|
1521 |
-
if ( defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG ) {
|
1522 |
-
$notice = sprintf(
|
1523 |
-
/* translators: %s is a URL */
|
1524 |
-
__( 'In <a href="%s" target="_blank">Development Mode</a>, via the JETPACK_DEV_DEBUG constant being defined in wp-config.php or elsewhere.', 'jetpack' ),
|
1525 |
-
'http://jetpack.com/support/development-mode/'
|
1526 |
-
);
|
1527 |
-
} elseif ( site_url() && false === strpos( site_url(), '.' ) ) {
|
1528 |
-
$notice = sprintf(
|
1529 |
-
/* translators: %s is a URL */
|
1530 |
-
__( 'In <a href="%s" target="_blank">Development Mode</a>, via site URL lacking a dot (e.g. http://localhost).', 'jetpack' ),
|
1531 |
-
'http://jetpack.com/support/development-mode/'
|
1532 |
-
);
|
1533 |
-
} else {
|
1534 |
-
$notice = sprintf(
|
1535 |
-
/* translators: %s is a URL */
|
1536 |
-
__( 'In <a href="%s" target="_blank">Development Mode</a>, via the jetpack_development_mode filter.', 'jetpack' ),
|
1537 |
-
'http://jetpack.com/support/development-mode/'
|
1538 |
-
);
|
1539 |
-
}
|
1540 |
-
|
1541 |
-
echo '<div class="updated" style="border-color: #f0821e;"><p>' . $notice . '</p></div>';
|
1542 |
-
}
|
1543 |
-
|
1544 |
-
// Throw up a notice if using a development version and as for feedback.
|
1545 |
-
if ( Jetpack::is_development_version() ) {
|
1546 |
-
/* translators: %s is a URL */
|
1547 |
-
$notice = sprintf( __( 'You are currently running a development version of Jetpack. <a href="%s" target="_blank">Submit your feedback</a>', 'jetpack' ), 'https://jetpack.com/contact-support/beta-group/' );
|
1548 |
-
|
1549 |
-
echo '<div class="updated" style="border-color: #f0821e;"><p>' . $notice . '</p></div>';
|
1550 |
-
}
|
1551 |
-
// Throw up a notice if using staging mode
|
1552 |
-
if ( Jetpack::is_staging_site() ) {
|
1553 |
-
/* translators: %s is a URL */
|
1554 |
-
$notice = sprintf( __( 'You are running Jetpack on a <a href="%s" target="_blank">staging server</a>.', 'jetpack' ), 'https://jetpack.com/support/staging-sites/' );
|
1555 |
-
|
1556 |
-
echo '<div class="updated" style="border-color: #f0821e;"><p>' . $notice . '</p></div>';
|
1557 |
-
}
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
/**
|
1561 |
-
* Whether Jetpack's version maps to a public release, or a development version.
|
1562 |
-
*/
|
1563 |
-
public static function is_development_version() {
|
1564 |
-
return ! preg_match( '/^\d+(\.\d+)+$/', JETPACK__VERSION );
|
1565 |
-
}
|
1566 |
-
|
1567 |
-
/**
|
1568 |
-
* Is a given user (or the current user if none is specified) linked to a WordPress.com user?
|
1569 |
-
*/
|
1570 |
-
public static function is_user_connected( $user_id = false ) {
|
1571 |
-
$user_id = false === $user_id ? get_current_user_id() : absint( $user_id );
|
1572 |
-
if ( ! $user_id ) {
|
1573 |
-
return false;
|
1574 |
-
}
|
1575 |
-
return (bool) Jetpack_Data::get_access_token( $user_id );
|
1576 |
-
}
|
1577 |
-
|
1578 |
-
/**
|
1579 |
-
* Get the wpcom user data of the current|specified connected user.
|
1580 |
-
*/
|
1581 |
-
public static function get_connected_user_data( $user_id = null ) {
|
1582 |
-
if ( ! $user_id ) {
|
1583 |
-
$user_id = get_current_user_id();
|
1584 |
-
}
|
1585 |
-
Jetpack::load_xml_rpc_client();
|
1586 |
-
$xml = new Jetpack_IXR_Client( array(
|
1587 |
-
'user_id' => $user_id,
|
1588 |
-
) );
|
1589 |
-
$xml->query( 'wpcom.getUser' );
|
1590 |
-
if ( ! $xml->isError() ) {
|
1591 |
-
return $xml->getResponse();
|
1592 |
-
}
|
1593 |
-
return false;
|
1594 |
-
}
|
1595 |
-
|
1596 |
-
/**
|
1597 |
-
* Get the wpcom email of the current|specified connected user.
|
1598 |
-
*/
|
1599 |
-
public static function get_connected_user_email( $user_id = null ) {
|
1600 |
-
if ( ! $user_id ) {
|
1601 |
-
$user_id = get_current_user_id();
|
1602 |
-
}
|
1603 |
-
Jetpack::load_xml_rpc_client();
|
1604 |
-
$xml = new Jetpack_IXR_Client( array(
|
1605 |
-
'user_id' => $user_id,
|
1606 |
-
) );
|
1607 |
-
$xml->query( 'wpcom.getUserEmail' );
|
1608 |
-
if ( ! $xml->isError() ) {
|
1609 |
-
return $xml->getResponse();
|
1610 |
-
}
|
1611 |
-
return false;
|
1612 |
-
}
|
1613 |
-
|
1614 |
-
/**
|
1615 |
-
* Get the wpcom email of the master user.
|
1616 |
-
*/
|
1617 |
-
public static function get_master_user_email() {
|
1618 |
-
$master_user_id = Jetpack_Options::get_option( 'master_user' );
|
1619 |
-
if ( $master_user_id ) {
|
1620 |
-
return self::get_connected_user_email( $master_user_id );
|
1621 |
-
}
|
1622 |
-
return '';
|
1623 |
-
}
|
1624 |
-
|
1625 |
-
function current_user_is_connection_owner() {
|
1626 |
-
$user_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
|
1627 |
-
return $user_token && is_object( $user_token ) && isset( $user_token->external_user_id ) && get_current_user_id() === $user_token->external_user_id;
|
1628 |
-
}
|
1629 |
-
|
1630 |
-
/**
|
1631 |
-
* Add any extra oEmbed providers that we know about and use on wpcom for feature parity.
|
1632 |
-
*/
|
1633 |
-
function extra_oembed_providers() {
|
1634 |
-
// Cloudup: https://dev.cloudup.com/#oembed
|
1635 |
-
wp_oembed_add_provider( 'https://cloudup.com/*' , 'https://cloudup.com/oembed' );
|
1636 |
-
wp_oembed_add_provider( 'https://me.sh/*', 'https://me.sh/oembed?format=json' );
|
1637 |
-
wp_oembed_add_provider( '#https?://(www\.)?gfycat\.com/.*#i', 'https://api.gfycat.com/v1/oembed', true );
|
1638 |
-
wp_oembed_add_provider( '#https?://[^.]+\.(wistia\.com|wi\.st)/(medias|embed)/.*#', 'https://fast.wistia.com/oembed', true );
|
1639 |
-
wp_oembed_add_provider( '#https?://sketchfab\.com/.*#i', 'https://sketchfab.com/oembed', true );
|
1640 |
-
}
|
1641 |
-
|
1642 |
-
/**
|
1643 |
-
* Synchronize connected user role changes
|
1644 |
-
*/
|
1645 |
-
function user_role_change( $user_id ) {
|
1646 |
-
if ( Jetpack::is_active() && Jetpack::is_user_connected( $user_id ) ) {
|
1647 |
-
$current_user_id = get_current_user_id();
|
1648 |
-
wp_set_current_user( $user_id );
|
1649 |
-
$role = $this->translate_current_user_to_role();
|
1650 |
-
$signed_role = $this->sign_role( $role );
|
1651 |
-
wp_set_current_user( $current_user_id );
|
1652 |
-
|
1653 |
-
$master_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
|
1654 |
-
$master_user_id = absint( $master_token->external_user_id );
|
1655 |
-
|
1656 |
-
if ( ! $master_user_id )
|
1657 |
-
return; // this shouldn't happen
|
1658 |
-
|
1659 |
-
Jetpack::xmlrpc_async_call( 'jetpack.updateRole', $user_id, $signed_role );
|
1660 |
-
//@todo retry on failure
|
1661 |
-
|
1662 |
-
//try to choose a new master if we're demoting the current one
|
1663 |
-
if ( $user_id == $master_user_id && 'administrator' != $role ) {
|
1664 |
-
$query = new WP_User_Query(
|
1665 |
-
array(
|
1666 |
-
'fields' => array( 'id' ),
|
1667 |
-
'role' => 'administrator',
|
1668 |
-
'orderby' => 'id',
|
1669 |
-
'exclude' => array( $master_user_id ),
|
1670 |
-
)
|
1671 |
-
);
|
1672 |
-
$new_master = false;
|
1673 |
-
foreach ( $query->results as $result ) {
|
1674 |
-
$uid = absint( $result->id );
|
1675 |
-
if ( $uid && Jetpack::is_user_connected( $uid ) ) {
|
1676 |
-
$new_master = $uid;
|
1677 |
-
break;
|
1678 |
-
}
|
1679 |
-
}
|
1680 |
-
|
1681 |
-
if ( $new_master ) {
|
1682 |
-
Jetpack_Options::update_option( 'master_user', $new_master );
|
1683 |
-
}
|
1684 |
-
// else disconnect..?
|
1685 |
-
}
|
1686 |
-
}
|
1687 |
-
}
|
1688 |
-
|
1689 |
-
/**
|
1690 |
-
* Loads the currently active modules.
|
1691 |
-
*/
|
1692 |
-
public static function load_modules() {
|
1693 |
-
if ( ! self::is_active() && !self::is_development_mode() ) {
|
1694 |
-
if ( ! is_multisite() || ! get_site_option( 'jetpack_protect_active' ) ) {
|
1695 |
-
return;
|
1696 |
-
}
|
1697 |
-
}
|
1698 |
-
|
1699 |
-
$version = Jetpack_Options::get_option( 'version' );
|
1700 |
-
if ( ! $version ) {
|
1701 |
-
$version = $old_version = JETPACK__VERSION . ':' . time();
|
1702 |
-
/** This action is documented in class.jetpack.php */
|
1703 |
-
do_action( 'updating_jetpack_version', $version, false );
|
1704 |
-
Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
|
1705 |
-
}
|
1706 |
-
list( $version ) = explode( ':', $version );
|
1707 |
-
|
1708 |
-
$modules = array_filter( Jetpack::get_active_modules(), array( 'Jetpack', 'is_module' ) );
|
1709 |
-
|
1710 |
-
$modules_data = array();
|
1711 |
-
|
1712 |
-
// Don't load modules that have had "Major" changes since the stored version until they have been deactivated/reactivated through the lint check.
|
1713 |
-
if ( version_compare( $version, JETPACK__VERSION, '<' ) ) {
|
1714 |
-
$updated_modules = array();
|
1715 |
-
foreach ( $modules as $module ) {
|
1716 |
-
$modules_data[ $module ] = Jetpack::get_module( $module );
|
1717 |
-
if ( ! isset( $modules_data[ $module ]['changed'] ) ) {
|
1718 |
-
continue;
|
1719 |
-
}
|
1720 |
-
|
1721 |
-
if ( version_compare( $modules_data[ $module ]['changed'], $version, '<=' ) ) {
|
1722 |
-
continue;
|
1723 |
-
}
|
1724 |
-
|
1725 |
-
$updated_modules[] = $module;
|
1726 |
-
}
|
1727 |
-
|
1728 |
-
$modules = array_diff( $modules, $updated_modules );
|
1729 |
-
}
|
1730 |
-
|
1731 |
-
$is_development_mode = Jetpack::is_development_mode();
|
1732 |
-
|
1733 |
-
foreach ( $modules as $index => $module ) {
|
1734 |
-
// If we're in dev mode, disable modules requiring a connection
|
1735 |
-
if ( $is_development_mode ) {
|
1736 |
-
// Prime the pump if we need to
|
1737 |
-
if ( empty( $modules_data[ $module ] ) ) {
|
1738 |
-
$modules_data[ $module ] = Jetpack::get_module( $module );
|
1739 |
-
}
|
1740 |
-
// If the module requires a connection, but we're in local mode, don't include it.
|
1741 |
-
if ( $modules_data[ $module ]['requires_connection'] ) {
|
1742 |
-
continue;
|
1743 |
-
}
|
1744 |
-
}
|
1745 |
-
|
1746 |
-
if ( did_action( 'jetpack_module_loaded_' . $module ) ) {
|
1747 |
-
continue;
|
1748 |
-
}
|
1749 |
-
|
1750 |
-
if ( ! @include( Jetpack::get_module_path( $module ) ) ) {
|
1751 |
-
unset( $modules[ $index ] );
|
1752 |
-
Jetpack_Options::update_option( 'active_modules', array_values( $modules ) );
|
1753 |
-
continue;
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
/**
|
1757 |
-
* Fires when a specific module is loaded.
|
1758 |
-
* The dynamic part of the hook, $module, is the module slug.
|
1759 |
-
*
|
1760 |
-
* @since 1.1.0
|
1761 |
-
*/
|
1762 |
-
do_action( 'jetpack_module_loaded_' . $module );
|
1763 |
-
}
|
1764 |
-
|
1765 |
-
/**
|
1766 |
-
* Fires when all the modules are loaded.
|
1767 |
-
*
|
1768 |
-
* @since 1.1.0
|
1769 |
-
*/
|
1770 |
-
do_action( 'jetpack_modules_loaded' );
|
1771 |
-
|
1772 |
-
// Load module-specific code that is needed even when a module isn't active. Loaded here because code contained therein may need actions such as setup_theme.
|
1773 |
-
if ( Jetpack::is_active() || Jetpack::is_development_mode() )
|
1774 |
-
require_once( JETPACK__PLUGIN_DIR . 'modules/module-extras.php' );
|
1775 |
-
}
|
1776 |
-
|
1777 |
-
/**
|
1778 |
-
* Check if Jetpack's REST API compat file should be included
|
1779 |
-
* @action plugins_loaded
|
1780 |
-
* @return null
|
1781 |
-
*/
|
1782 |
-
public function check_rest_api_compat() {
|
1783 |
-
/**
|
1784 |
-
* Filters the list of REST API compat files to be included.
|
1785 |
-
*
|
1786 |
-
* @since 2.2.5
|
1787 |
-
*
|
1788 |
-
* @param array $args Array of REST API compat files to include.
|
1789 |
-
*/
|
1790 |
-
$_jetpack_rest_api_compat_includes = apply_filters( 'jetpack_rest_api_compat', array() );
|
1791 |
-
|
1792 |
-
if ( function_exists( 'bbpress' ) )
|
1793 |
-
$_jetpack_rest_api_compat_includes[] = JETPACK__PLUGIN_DIR . 'class.jetpack-bbpress-json-api-compat.php';
|
1794 |
-
|
1795 |
-
foreach ( $_jetpack_rest_api_compat_includes as $_jetpack_rest_api_compat_include )
|
1796 |
-
require_once $_jetpack_rest_api_compat_include;
|
1797 |
-
}
|
1798 |
-
|
1799 |
-
/**
|
1800 |
-
* Gets all plugins currently active in values, regardless of whether they're
|
1801 |
-
* traditionally activated or network activated.
|
1802 |
-
*
|
1803 |
-
* @todo Store the result in core's object cache maybe?
|
1804 |
-
*/
|
1805 |
-
public static function get_active_plugins() {
|
1806 |
-
$active_plugins = (array) get_option( 'active_plugins', array() );
|
1807 |
-
|
1808 |
-
if ( is_multisite() ) {
|
1809 |
-
// Due to legacy code, active_sitewide_plugins stores them in the keys,
|
1810 |
-
// whereas active_plugins stores them in the values.
|
1811 |
-
$network_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );
|
1812 |
-
if ( $network_plugins ) {
|
1813 |
-
$active_plugins = array_merge( $active_plugins, $network_plugins );
|
1814 |
-
}
|
1815 |
-
}
|
1816 |
-
|
1817 |
-
sort( $active_plugins );
|
1818 |
-
|
1819 |
-
return array_unique( $active_plugins );
|
1820 |
-
}
|
1821 |
-
|
1822 |
-
/**
|
1823 |
-
* Gets and parses additional plugin data to send with the heartbeat data
|
1824 |
-
*
|
1825 |
-
* @since 3.8.1
|
1826 |
-
*
|
1827 |
-
* @return array Array of plugin data
|
1828 |
-
*/
|
1829 |
-
public static function get_parsed_plugin_data() {
|
1830 |
-
if ( ! function_exists( 'get_plugins' ) ) {
|
1831 |
-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
1832 |
-
}
|
1833 |
-
$all_plugins = get_plugins();
|
1834 |
-
$active_plugins = Jetpack::get_active_plugins();
|
1835 |
-
|
1836 |
-
$plugins = array();
|
1837 |
-
foreach ( $all_plugins as $path => $plugin_data ) {
|
1838 |
-
$plugins[ $path ] = array(
|
1839 |
-
'is_active' => in_array( $path, $active_plugins ),
|
1840 |
-
'file' => $path,
|
1841 |
-
'name' => $plugin_data['Name'],
|
1842 |
-
'version' => $plugin_data['Version'],
|
1843 |
-
'author' => $plugin_data['Author'],
|
1844 |
-
);
|
1845 |
-
}
|
1846 |
-
|
1847 |
-
return $plugins;
|
1848 |
-
}
|
1849 |
-
|
1850 |
-
/**
|
1851 |
-
* Gets and parses theme data to send with the heartbeat data
|
1852 |
-
*
|
1853 |
-
* @since 3.8.1
|
1854 |
-
*
|
1855 |
-
* @return array Array of theme data
|
1856 |
-
*/
|
1857 |
-
public static function get_parsed_theme_data() {
|
1858 |
-
$all_themes = wp_get_themes( array( 'allowed' => true ) );
|
1859 |
-
$header_keys = array( 'Name', 'Author', 'Version', 'ThemeURI', 'AuthorURI', 'Status', 'Tags' );
|
1860 |
-
|
1861 |
-
$themes = array();
|
1862 |
-
foreach ( $all_themes as $slug => $theme_data ) {
|
1863 |
-
$theme_headers = array();
|
1864 |
-
foreach ( $header_keys as $header_key ) {
|
1865 |
-
$theme_headers[ $header_key ] = $theme_data->get( $header_key );
|
1866 |
-
}
|
1867 |
-
|
1868 |
-
$themes[ $slug ] = array(
|
1869 |
-
'is_active_theme' => $slug == wp_get_theme()->get_template(),
|
1870 |
-
'slug' => $slug,
|
1871 |
-
'theme_root' => $theme_data->get_theme_root_uri(),
|
1872 |
-
'parent' => $theme_data->parent(),
|
1873 |
-
'headers' => $theme_headers
|
1874 |
-
);
|
1875 |
-
}
|
1876 |
-
|
1877 |
-
return $themes;
|
1878 |
-
}
|
1879 |
-
|
1880 |
-
/**
|
1881 |
-
* Checks whether a specific plugin is active.
|
1882 |
-
*
|
1883 |
-
* We don't want to store these in a static variable, in case
|
1884 |
-
* there are switch_to_blog() calls involved.
|
1885 |
-
*/
|
1886 |
-
public static function is_plugin_active( $plugin = 'jetpack/jetpack.php' ) {
|
1887 |
-
return in_array( $plugin, self::get_active_plugins() );
|
1888 |
-
}
|
1889 |
-
|
1890 |
-
/**
|
1891 |
-
* Check if Jetpack's Open Graph tags should be used.
|
1892 |
-
* If certain plugins are active, Jetpack's og tags are suppressed.
|
1893 |
-
*
|
1894 |
-
* @uses Jetpack::get_active_modules, add_filter, get_option, apply_filters
|
1895 |
-
* @action plugins_loaded
|
1896 |
-
* @return null
|
1897 |
-
*/
|
1898 |
-
public function check_open_graph() {
|
1899 |
-
if ( in_array( 'publicize', Jetpack::get_active_modules() ) || in_array( 'sharedaddy', Jetpack::get_active_modules() ) ) {
|
1900 |
-
add_filter( 'jetpack_enable_open_graph', '__return_true', 0 );
|
1901 |
-
}
|
1902 |
-
|
1903 |
-
$active_plugins = self::get_active_plugins();
|
1904 |
-
|
1905 |
-
if ( ! empty( $active_plugins ) ) {
|
1906 |
-
foreach ( $this->open_graph_conflicting_plugins as $plugin ) {
|
1907 |
-
if ( in_array( $plugin, $active_plugins ) ) {
|
1908 |
-
add_filter( 'jetpack_enable_open_graph', '__return_false', 99 );
|
1909 |
-
break;
|
1910 |
-
}
|
1911 |
-
}
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
/**
|
1915 |
-
* Allow the addition of Open Graph Meta Tags to all pages.
|
1916 |
-
*
|
1917 |
-
* @since 2.0.3
|
1918 |
-
*
|
1919 |
-
* @param bool false Should Open Graph Meta tags be added. Default to false.
|
1920 |
-
*/
|
1921 |
-
if ( apply_filters( 'jetpack_enable_open_graph', false ) ) {
|
1922 |
-
require_once JETPACK__PLUGIN_DIR . 'functions.opengraph.php';
|
1923 |
-
}
|
1924 |
-
}
|
1925 |
-
|
1926 |
-
/**
|
1927 |
-
* Check if Jetpack's Twitter tags should be used.
|
1928 |
-
* If certain plugins are active, Jetpack's twitter tags are suppressed.
|
1929 |
-
*
|
1930 |
-
* @uses Jetpack::get_active_modules, add_filter, get_option, apply_filters
|
1931 |
-
* @action plugins_loaded
|
1932 |
-
* @return null
|
1933 |
-
*/
|
1934 |
-
public function check_twitter_tags() {
|
1935 |
-
|
1936 |
-
$active_plugins = self::get_active_plugins();
|
1937 |
-
|
1938 |
-
if ( ! empty( $active_plugins ) ) {
|
1939 |
-
foreach ( $this->twitter_cards_conflicting_plugins as $plugin ) {
|
1940 |
-
if ( in_array( $plugin, $active_plugins ) ) {
|
1941 |
-
add_filter( 'jetpack_disable_twitter_cards', '__return_true', 99 );
|
1942 |
-
break;
|
1943 |
-
}
|
1944 |
-
}
|
1945 |
-
}
|
1946 |
-
|
1947 |
-
/**
|
1948 |
-
* Allow Twitter Card Meta tags to be disabled.
|
1949 |
-
*
|
1950 |
-
* @since 2.6.0
|
1951 |
-
*
|
1952 |
-
* @param bool true Should Twitter Card Meta tags be disabled. Default to true.
|
1953 |
-
*/
|
1954 |
-
if ( apply_filters( 'jetpack_disable_twitter_cards', true ) ) {
|
1955 |
-
require_once JETPACK__PLUGIN_DIR . 'class.jetpack-twitter-cards.php';
|
1956 |
-
}
|
1957 |
-
}
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
/*
|
1963 |
-
*
|
1964 |
-
* Jetpack Security Reports
|
1965 |
-
*
|
1966 |
-
* Allowed types: login_form, backup, file_scanning, spam
|
1967 |
-
*
|
1968 |
-
* 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)
|
1969 |
-
*
|
1970 |
-
* 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)
|
1971 |
-
*
|
1972 |
-
*
|
1973 |
-
* Example code to submit a security report:
|
1974 |
-
*
|
1975 |
-
* function akismet_submit_jetpack_security_report() {
|
1976 |
-
* Jetpack::submit_security_report( 'spam', __FILE__, $args = array( 'blocked' => 138284, status => 'ok' ) );
|
1977 |
-
* }
|
1978 |
-
* add_action( 'jetpack_security_report', 'akismet_submit_jetpack_security_report' );
|
1979 |
-
*
|
1980 |
-
*/
|
1981 |
-
|
1982 |
-
|
1983 |
-
/**
|
1984 |
-
* Calls for security report submissions.
|
1985 |
-
*
|
1986 |
-
* @return null
|
1987 |
-
*/
|
1988 |
-
public static function perform_security_reporting() {
|
1989 |
-
$no_check_needed = get_site_transient( 'security_report_performed_recently' );
|
1990 |
-
|
1991 |
-
if ( $no_check_needed ) {
|
1992 |
-
return;
|
1993 |
-
}
|
1994 |
-
|
1995 |
-
/**
|
1996 |
-
* Fires before a security report is created.
|
1997 |
-
*
|
1998 |
-
* @since 3.4.0
|
1999 |
-
*/
|
2000 |
-
do_action( 'jetpack_security_report' );
|
2001 |
-
|
2002 |
-
Jetpack_Options::update_option( 'security_report', self::$security_report );
|
2003 |
-
set_site_transient( 'security_report_performed_recently', 1, 15 * MINUTE_IN_SECONDS );
|
2004 |
-
}
|
2005 |
-
|
2006 |
-
/**
|
2007 |
-
* Allows plugins to submit security reports.
|
2008 |
-
*
|
2009 |
-
* @param string $type Report type (login_form, backup, file_scanning, spam)
|
2010 |
-
* @param string $plugin_file Plugin __FILE__, so that we can pull plugin data
|
2011 |
-
* @param array $args See definitions above
|
2012 |
-
*/
|
2013 |
-
public static function submit_security_report( $type = '', $plugin_file = '', $args = array() ) {
|
2014 |
-
|
2015 |
-
if( !doing_action( 'jetpack_security_report' ) ) {
|
2016 |
-
return new WP_Error( 'not_collecting_report', 'Not currently collecting security reports. Please use the jetpack_security_report hook.' );
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
if( !is_string( $type ) || !is_string( $plugin_file ) ) {
|
2020 |
-
return new WP_Error( 'invalid_security_report', 'Invalid Security Report' );
|
2021 |
-
}
|
2022 |
-
|
2023 |
-
if( !function_exists( 'get_plugin_data' ) ) {
|
2024 |
-
include( ABSPATH . 'wp-admin/includes/plugin.php' );
|
2025 |
-
}
|
2026 |
-
|
2027 |
-
//Get rid of any non-allowed args
|
2028 |
-
$args = array_intersect_key( $args, array_flip( array( 'blocked', 'last', 'next', 'status', 'message' ) ) );
|
2029 |
-
|
2030 |
-
$plugin = get_plugin_data( $plugin_file );
|
2031 |
-
|
2032 |
-
if ( !$plugin['Name'] ) {
|
2033 |
-
return new WP_Error( 'security_report_missing_plugin_name', 'Invalid Plugin File Provided' );
|
2034 |
-
}
|
2035 |
-
|
2036 |
-
// Sanitize everything to make sure we're not syncing something wonky
|
2037 |
-
$type = sanitize_key( $type );
|
2038 |
-
|
2039 |
-
$args['plugin'] = $plugin;
|
2040 |
-
|
2041 |
-
// Cast blocked, last and next as integers.
|
2042 |
-
// Last and next should be in unix timestamp format
|
2043 |
-
if ( isset( $args['blocked'] ) ) {
|
2044 |
-
$args['blocked'] = (int) $args['blocked'];
|
2045 |
-
}
|
2046 |
-
if ( isset( $args['last'] ) ) {
|
2047 |
-
$args['last'] = (int) $args['last'];
|
2048 |
-
}
|
2049 |
-
if ( isset( $args['next'] ) ) {
|
2050 |
-
$args['next'] = (int) $args['next'];
|
2051 |
-
}
|
2052 |
-
if ( !in_array( $args['status'], array( 'ok', 'warning', 'error' ) ) ) {
|
2053 |
-
$args['status'] = 'ok';
|
2054 |
-
}
|
2055 |
-
if ( isset( $args['message'] ) ) {
|
2056 |
-
|
2057 |
-
if( $args['status'] == 'ok' ) {
|
2058 |
-
unset( $args['message'] );
|
2059 |
-
}
|
2060 |
-
|
2061 |
-
$allowed_html = array(
|
2062 |
-
'a' => array(
|
2063 |
-
'href' => array(),
|
2064 |
-
'title' => array()
|
2065 |
-
),
|
2066 |
-
'em' => array(),
|
2067 |
-
'strong' => array(),
|
2068 |
-
);
|
2069 |
-
|
2070 |
-
$args['message'] = wp_kses( $args['message'], $allowed_html );
|
2071 |
-
}
|
2072 |
-
|
2073 |
-
$plugin_name = $plugin[ 'Name' ];
|
2074 |
-
|
2075 |
-
self::$security_report[ $type ][ $plugin_name ] = $args;
|
2076 |
-
}
|
2077 |
-
|
2078 |
-
/**
|
2079 |
-
* Collects a new report if needed, then returns it.
|
2080 |
-
*/
|
2081 |
-
public function get_security_report() {
|
2082 |
-
self::perform_security_reporting();
|
2083 |
-
return Jetpack_Options::get_option( 'security_report' );
|
2084 |
-
}
|
2085 |
-
|
2086 |
-
|
2087 |
-
/* Jetpack Options API */
|
2088 |
-
|
2089 |
-
public static function get_option_names( $type = 'compact' ) {
|
2090 |
-
return Jetpack_Options::get_option_names( $type );
|
2091 |
-
}
|
2092 |
-
|
2093 |
-
/**
|
2094 |
-
* Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate.
|
2095 |
-
*
|
2096 |
-
* @param string $name Option name
|
2097 |
-
* @param mixed $default (optional)
|
2098 |
-
*/
|
2099 |
-
public static function get_option( $name, $default = false ) {
|
2100 |
-
return Jetpack_Options::get_option( $name, $default );
|
2101 |
-
}
|
2102 |
-
|
2103 |
-
/**
|
2104 |
-
* Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action
|
2105 |
-
* Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted
|
2106 |
-
* $name must be a registered option name.
|
2107 |
-
*/
|
2108 |
-
public static function create_nonce( $name ) {
|
2109 |
-
$secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 );
|
2110 |
-
|
2111 |
-
Jetpack_Options::update_option( $name, $secret );
|
2112 |
-
@list( $secret_1, $secret_2, $eol ) = explode( ':', Jetpack_Options::get_option( $name ) );
|
2113 |
-
if ( empty( $secret_1 ) || empty( $secret_2 ) || $eol < time() )
|
2114 |
-
return new Jetpack_Error( 'missing_secrets' );
|
2115 |
-
|
2116 |
-
return array(
|
2117 |
-
'secret_1' => $secret_1,
|
2118 |
-
'secret_2' => $secret_2,
|
2119 |
-
'eol' => $eol,
|
2120 |
-
);
|
2121 |
-
}
|
2122 |
-
|
2123 |
-
/**
|
2124 |
-
* Updates the single given option. Updates jetpack_options or jetpack_$name as appropriate.
|
2125 |
-
*
|
2126 |
-
* @deprecated 3.4 use Jetpack_Options::update_option() instead.
|
2127 |
-
* @param string $name Option name
|
2128 |
-
* @param mixed $value Option value
|
2129 |
-
*/
|
2130 |
-
public static function update_option( $name, $value ) {
|
2131 |
-
_deprecated_function( __METHOD__, 'jetpack-3.4', 'Jetpack_Options::update_option()' );
|
2132 |
-
return Jetpack_Options::update_option( $name, $value );
|
2133 |
-
}
|
2134 |
-
|
2135 |
-
/**
|
2136 |
-
* Updates the multiple given options. Updates jetpack_options and/or jetpack_$name as appropriate.
|
2137 |
-
*
|
2138 |
-
* @deprecated 3.4 use Jetpack_Options::update_options() instead.
|
2139 |
-
* @param array $array array( option name => option value, ... )
|
2140 |
-
*/
|
2141 |
-
public static function update_options( $array ) {
|
2142 |
-
_deprecated_function( __METHOD__, 'jetpack-3.4', 'Jetpack_Options::update_options()' );
|
2143 |
-
return Jetpack_Options::update_options( $array );
|
2144 |
-
}
|
2145 |
-
|
2146 |
-
/**
|
2147 |
-
* Deletes the given option. May be passed multiple option names as an array.
|
2148 |
-
* Updates jetpack_options and/or deletes jetpack_$name as appropriate.
|
2149 |
-
*
|
2150 |
-
* @deprecated 3.4 use Jetpack_Options::delete_option() instead.
|
2151 |
-
* @param string|array $names
|
2152 |
-
*/
|
2153 |
-
public static function delete_option( $names ) {
|
2154 |
-
_deprecated_function( __METHOD__, 'jetpack-3.4', 'Jetpack_Options::delete_option()' );
|
2155 |
-
return Jetpack_Options::delete_option( $names );
|
2156 |
-
}
|
2157 |
-
|
2158 |
-
/**
|
2159 |
-
* Enters a user token into the user_tokens option
|
2160 |
-
*
|
2161 |
-
* @param int $user_id
|
2162 |
-
* @param string $token
|
2163 |
-
* return bool
|
2164 |
-
*/
|
2165 |
-
public static function update_user_token( $user_id, $token, $is_master_user ) {
|
2166 |
-
// not designed for concurrent updates
|
2167 |
-
$user_tokens = Jetpack_Options::get_option( 'user_tokens' );
|
2168 |
-
if ( ! is_array( $user_tokens ) )
|
2169 |
-
$user_tokens = array();
|
2170 |
-
$user_tokens[$user_id] = $token;
|
2171 |
-
if ( $is_master_user ) {
|
2172 |
-
$master_user = $user_id;
|
2173 |
-
$options = compact( 'user_tokens', 'master_user' );
|
2174 |
-
} else {
|
2175 |
-
$options = compact( 'user_tokens' );
|
2176 |
-
}
|
2177 |
-
return Jetpack_Options::update_options( $options );
|
2178 |
-
}
|
2179 |
-
|
2180 |
-
/**
|
2181 |
-
* Returns an array of all PHP files in the specified absolute path.
|
2182 |
-
* Equivalent to glob( "$absolute_path/*.php" ).
|
2183 |
-
*
|
2184 |
-
* @param string $absolute_path The absolute path of the directory to search.
|
2185 |
-
* @return array Array of absolute paths to the PHP files.
|
2186 |
-
*/
|
2187 |
-
public static function glob_php( $absolute_path ) {
|
2188 |
-
if ( function_exists( 'glob' ) ) {
|
2189 |
-
return glob( "$absolute_path/*.php" );
|
2190 |
-
}
|
2191 |
-
|
2192 |
-
$absolute_path = untrailingslashit( $absolute_path );
|
2193 |
-
$files = array();
|
2194 |
-
if ( ! $dir = @opendir( $absolute_path ) ) {
|
2195 |
-
return $files;
|
2196 |
-
}
|
2197 |
-
|
2198 |
-
while ( false !== $file = readdir( $dir ) ) {
|
2199 |
-
if ( '.' == substr( $file, 0, 1 ) || '.php' != substr( $file, -4 ) ) {
|
2200 |
-
continue;
|
2201 |
-
}
|
2202 |
-
|
2203 |
-
$file = "$absolute_path/$file";
|
2204 |
-
|
2205 |
-
if ( ! is_file( $file ) ) {
|
2206 |
-
continue;
|
2207 |
-
}
|
2208 |
-
|
2209 |
-
$files[] = $file;
|
2210 |
-
}
|
2211 |
-
|
2212 |
-
closedir( $dir );
|
2213 |
-
|
2214 |
-
return $files;
|
2215 |
-
}
|
2216 |
-
|
2217 |
-
public static function activate_new_modules( $redirect = false ) {
|
2218 |
-
if ( ! Jetpack::is_active() && ! Jetpack::is_development_mode() ) {
|
2219 |
-
return;
|
2220 |
-
}
|
2221 |
-
|
2222 |
-
$jetpack_old_version = Jetpack_Options::get_option( 'version' ); // [sic]
|
2223 |
-
if ( ! $jetpack_old_version ) {
|
2224 |
-
$jetpack_old_version = $version = $old_version = '1.1:' . time();
|
2225 |
-
/** This action is documented in class.jetpack.php */
|
2226 |
-
do_action( 'updating_jetpack_version', $version, false );
|
2227 |
-
Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
|
2228 |
-
}
|
2229 |
-
|
2230 |
-
list( $jetpack_version ) = explode( ':', $jetpack_old_version ); // [sic]
|
2231 |
-
|
2232 |
-
if ( version_compare( JETPACK__VERSION, $jetpack_version, '<=' ) ) {
|
2233 |
-
return;
|
2234 |
-
}
|
2235 |
-
|
2236 |
-
$active_modules = Jetpack::get_active_modules();
|
2237 |
-
$reactivate_modules = array();
|
2238 |
-
foreach ( $active_modules as $active_module ) {
|
2239 |
-
$module = Jetpack::get_module( $active_module );
|
2240 |
-
if ( ! isset( $module['changed'] ) ) {
|
2241 |
-
continue;
|
2242 |
-
}
|
2243 |
-
|
2244 |
-
if ( version_compare( $module['changed'], $jetpack_version, '<=' ) ) {
|
2245 |
-
continue;
|
2246 |
-
}
|
2247 |
-
|
2248 |
-
$reactivate_modules[] = $active_module;
|
2249 |
-
Jetpack::deactivate_module( $active_module );
|
2250 |
-
}
|
2251 |
-
|
2252 |
-
$new_version = JETPACK__VERSION . ':' . time();
|
2253 |
-
/** This action is documented in class.jetpack.php */
|
2254 |
-
do_action( 'updating_jetpack_version', $new_version, $jetpack_old_version );
|
2255 |
-
Jetpack_Options::update_options(
|
2256 |
-
array(
|
2257 |
-
'version' => $new_version,
|
2258 |
-
'old_version' => $jetpack_old_version,
|
2259 |
-
)
|
2260 |
-
);
|
2261 |
-
|
2262 |
-
Jetpack::state( 'message', 'modules_activated' );
|
2263 |
-
Jetpack::activate_default_modules( $jetpack_version, JETPACK__VERSION, $reactivate_modules );
|
2264 |
-
|
2265 |
-
if ( $redirect ) {
|
2266 |
-
$page = 'jetpack'; // make sure we redirect to either settings or the jetpack page
|
2267 |
-
if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'jetpack', 'jetpack_modules' ) ) ) {
|
2268 |
-
$page = $_GET['page'];
|
2269 |
-
}
|
2270 |
-
|
2271 |
-
wp_safe_redirect( Jetpack::admin_url( 'page=' . $page ) );
|
2272 |
-
exit;
|
2273 |
-
}
|
2274 |
-
}
|
2275 |
-
|
2276 |
-
/**
|
2277 |
-
* List available Jetpack modules. Simply lists .php files in /modules/.
|
2278 |
-
* Make sure to tuck away module "library" files in a sub-directory.
|
2279 |
-
*/
|
2280 |
-
public static function get_available_modules( $min_version = false, $max_version = false ) {
|
2281 |
-
static $modules = null;
|
2282 |
-
|
2283 |
-
if ( ! isset( $modules ) ) {
|
2284 |
-
$available_modules_option = Jetpack_Options::get_option( 'available_modules', array() );
|
2285 |
-
// Use the cache if we're on the front-end and it's available...
|
2286 |
-
if ( ! is_admin() && ! empty( $available_modules_option[ JETPACK__VERSION ] ) ) {
|
2287 |
-
$modules = $available_modules_option[ JETPACK__VERSION ];
|
2288 |
-
} else {
|
2289 |
-
$files = Jetpack::glob_php( JETPACK__PLUGIN_DIR . 'modules' );
|
2290 |
-
|
2291 |
-
$modules = array();
|
2292 |
-
|
2293 |
-
foreach ( $files as $file ) {
|
2294 |
-
if ( ! $headers = Jetpack::get_module( $file ) ) {
|
2295 |
-
continue;
|
2296 |
-
}
|
2297 |
-
|
2298 |
-
$modules[ Jetpack::get_module_slug( $file ) ] = $headers['introduced'];
|
2299 |
-
}
|
2300 |
-
|
2301 |
-
Jetpack_Options::update_option( 'available_modules', array(
|
2302 |
-
JETPACK__VERSION => $modules,
|
2303 |
-
) );
|
2304 |
-
}
|
2305 |
-
}
|
2306 |
-
|
2307 |
-
/**
|
2308 |
-
* Filters the array of modules available to be activated.
|
2309 |
-
*
|
2310 |
-
* @since 2.4.0
|
2311 |
-
*
|
2312 |
-
* @param array $modules Array of available modules.
|
2313 |
-
* @param string $min_version Minimum version number required to use modules.
|
2314 |
-
* @param string $max_version Maximum version number required to use modules.
|
2315 |
-
*/
|
2316 |
-
$mods = apply_filters( 'jetpack_get_available_modules', $modules, $min_version, $max_version );
|
2317 |
-
|
2318 |
-
if ( ! $min_version && ! $max_version ) {
|
2319 |
-
return array_keys( $mods );
|
2320 |
-
}
|
2321 |
-
|
2322 |
-
$r = array();
|
2323 |
-
foreach ( $mods as $slug => $introduced ) {
|
2324 |
-
if ( $min_version && version_compare( $min_version, $introduced, '>=' ) ) {
|
2325 |
-
continue;
|
2326 |
-
}
|
2327 |
-
|
2328 |
-
if ( $max_version && version_compare( $max_version, $introduced, '<' ) ) {
|
2329 |
-
continue;
|
2330 |
-
}
|
2331 |
-
|
2332 |
-
$r[] = $slug;
|
2333 |
-
}
|
2334 |
-
|
2335 |
-
return $r;
|
2336 |
-
}
|
2337 |
-
|
2338 |
-
/**
|
2339 |
-
* Default modules loaded on activation.
|
2340 |
-
*/
|
2341 |
-
public static function get_default_modules( $min_version = false, $max_version = false ) {
|
2342 |
-
$return = array();
|
2343 |
-
|
2344 |
-
foreach ( Jetpack::get_available_modules( $min_version, $max_version ) as $module ) {
|
2345 |
-
$module_data = Jetpack::get_module( $module );
|
2346 |
-
|
2347 |
-
switch ( strtolower( $module_data['auto_activate'] ) ) {
|
2348 |
-
case 'yes' :
|
2349 |
-
$return[] = $module;
|
2350 |
-
break;
|
2351 |
-
case 'public' :
|
2352 |
-
if ( Jetpack_Options::get_option( 'public' ) ) {
|
2353 |
-
$return[] = $module;
|
2354 |
-
}
|
2355 |
-
break;
|
2356 |
-
case 'no' :
|
2357 |
-
default :
|
2358 |
-
break;
|
2359 |
-
}
|
2360 |
-
}
|
2361 |
-
/**
|
2362 |
-
* Filters the array of default modules.
|
2363 |
-
*
|
2364 |
-
* @since 2.5.0
|
2365 |
-
*
|
2366 |
-
* @param array $return Array of default modules.
|
2367 |
-
* @param string $min_version Minimum version number required to use modules.
|
2368 |
-
* @param string $max_version Maximum version number required to use modules.
|
2369 |
-
*/
|
2370 |
-
return apply_filters( 'jetpack_get_default_modules', $return, $min_version, $max_version );
|
2371 |
-
}
|
2372 |
-
|
2373 |
-
/**
|
2374 |
-
* Checks activated modules during auto-activation to determine
|
2375 |
-
* if any of those modules are being deprecated. If so, close
|
2376 |
-
* them out, and add any replacement modules.
|
2377 |
-
*
|
2378 |
-
* Runs at priority 99 by default.
|
2379 |
-
*
|
2380 |
-
* This is run late, so that it can still activate a module if
|
2381 |
-
* the new module is a replacement for another that the user
|
2382 |
-
* currently has active, even if something at the normal priority
|
2383 |
-
* would kibosh everything.
|
2384 |
-
*
|
2385 |
-
* @since 2.6
|
2386 |
-
* @uses jetpack_get_default_modules filter
|
2387 |
-
* @param array $modules
|
2388 |
-
* @return array
|
2389 |
-
*/
|
2390 |
-
function handle_deprecated_modules( $modules ) {
|
2391 |
-
$deprecated_modules = array(
|
2392 |
-
'debug' => null, // Closed out and moved to ./class.jetpack-debugger.php
|
2393 |
-
'wpcc' => 'sso', // Closed out in 2.6 -- SSO provides the same functionality.
|
2394 |
-
'gplus-authorship' => null, // Closed out in 3.2 -- Google dropped support.
|
2395 |
-
);
|
2396 |
-
|
2397 |
-
// Don't activate SSO if they never completed activating WPCC.
|
2398 |
-
if ( Jetpack::is_module_active( 'wpcc' ) ) {
|
2399 |
-
$wpcc_options = Jetpack_Options::get_option( 'wpcc_options' );
|
2400 |
-
if ( empty( $wpcc_options ) || empty( $wpcc_options['client_id'] ) || empty( $wpcc_options['client_id'] ) ) {
|
2401 |
-
$deprecated_modules['wpcc'] = null;
|
2402 |
-
}
|
2403 |
-
}
|
2404 |
-
|
2405 |
-
foreach ( $deprecated_modules as $module => $replacement ) {
|
2406 |
-
if ( Jetpack::is_module_active( $module ) ) {
|
2407 |
-
self::deactivate_module( $module );
|
2408 |
-
if ( $replacement ) {
|
2409 |
-
$modules[] = $replacement;
|
2410 |
-
}
|
2411 |
-
}
|
2412 |
-
}
|
2413 |
-
|
2414 |
-
return array_unique( $modules );
|
2415 |
-
}
|
2416 |
-
|
2417 |
-
/**
|
2418 |
-
* Checks activated plugins during auto-activation to determine
|
2419 |
-
* if any of those plugins are in the list with a corresponding module
|
2420 |
-
* that is not compatible with the plugin. The module will not be allowed
|
2421 |
-
* to auto-activate.
|
2422 |
-
*
|
2423 |
-
* @since 2.6
|
2424 |
-
* @uses jetpack_get_default_modules filter
|
2425 |
-
* @param array $modules
|
2426 |
-
* @return array
|
2427 |
-
*/
|
2428 |
-
function filter_default_modules( $modules ) {
|
2429 |
-
|
2430 |
-
$active_plugins = self::get_active_plugins();
|
2431 |
-
|
2432 |
-
if ( ! empty( $active_plugins ) ) {
|
2433 |
-
|
2434 |
-
// For each module we'd like to auto-activate...
|
2435 |
-
foreach ( $modules as $key => $module ) {
|
2436 |
-
// If there are potential conflicts for it...
|
2437 |
-
if ( ! empty( $this->conflicting_plugins[ $module ] ) ) {
|
2438 |
-
// For each potential conflict...
|
2439 |
-
foreach ( $this->conflicting_plugins[ $module ] as $title => $plugin ) {
|
2440 |
-
// If that conflicting plugin is active...
|
2441 |
-
if ( in_array( $plugin, $active_plugins ) ) {
|
2442 |
-
// Remove that item from being auto-activated.
|
2443 |
-
unset( $modules[ $key ] );
|
2444 |
-
}
|
2445 |
-
}
|
2446 |
-
}
|
2447 |
-
}
|
2448 |
-
}
|
2449 |
-
|
2450 |
-
return $modules;
|
2451 |
-
}
|
2452 |
-
|
2453 |
-
/**
|
2454 |
-
* Extract a module's slug from its full path.
|
2455 |
-
*/
|
2456 |
-
public static function get_module_slug( $file ) {
|
2457 |
-
return str_replace( '.php', '', basename( $file ) );
|
2458 |
-
}
|
2459 |
-
|
2460 |
-
/**
|
2461 |
-
* Generate a module's path from its slug.
|
2462 |
-
*/
|
2463 |
-
public static function get_module_path( $slug ) {
|
2464 |
-
return JETPACK__PLUGIN_DIR . "modules/$slug.php";
|
2465 |
-
}
|
2466 |
-
|
2467 |
-
/**
|
2468 |
-
* Load module data from module file. Headers differ from WordPress
|
2469 |
-
* plugin headers to avoid them being identified as standalone
|
2470 |
-
* plugins on the WordPress plugins page.
|
2471 |
-
*/
|
2472 |
-
public static function get_module( $module ) {
|
2473 |
-
$headers = array(
|
2474 |
-
'name' => 'Module Name',
|
2475 |
-
'description' => 'Module Description',
|
2476 |
-
'jumpstart_desc' => 'Jumpstart Description',
|
2477 |
-
'sort' => 'Sort Order',
|
2478 |
-
'recommendation_order' => 'Recommendation Order',
|
2479 |
-
'introduced' => 'First Introduced',
|
2480 |
-
'changed' => 'Major Changes In',
|
2481 |
-
'deactivate' => 'Deactivate',
|
2482 |
-
'free' => 'Free',
|
2483 |
-
'requires_connection' => 'Requires Connection',
|
2484 |
-
'auto_activate' => 'Auto Activate',
|
2485 |
-
'module_tags' => 'Module Tags',
|
2486 |
-
'feature' => 'Feature',
|
2487 |
-
'additional_search_queries' => 'Additional Search Queries',
|
2488 |
-
);
|
2489 |
-
|
2490 |
-
$file = Jetpack::get_module_path( Jetpack::get_module_slug( $module ) );
|
2491 |
-
|
2492 |
-
$mod = Jetpack::get_file_data( $file, $headers );
|
2493 |
-
if ( empty( $mod['name'] ) ) {
|
2494 |
-
return false;
|
2495 |
-
}
|
2496 |
-
|
2497 |
-
$mod['sort'] = empty( $mod['sort'] ) ? 10 : (int) $mod['sort'];
|
2498 |
-
$mod['recommendation_order'] = empty( $mod['recommendation_order'] ) ? 20 : (int) $mod['recommendation_order'];
|
2499 |
-
$mod['deactivate'] = empty( $mod['deactivate'] );
|
2500 |
-
$mod['free'] = empty( $mod['free'] );
|
2501 |
-
$mod['requires_connection'] = ( ! empty( $mod['requires_connection'] ) && 'No' == $mod['requires_connection'] ) ? false : true;
|
2502 |
-
|
2503 |
-
if ( empty( $mod['auto_activate'] ) || ! in_array( strtolower( $mod['auto_activate'] ), array( 'yes', 'no', 'public' ) ) ) {
|
2504 |
-
$mod['auto_activate'] = 'No';
|
2505 |
-
} else {
|
2506 |
-
$mod['auto_activate'] = (string) $mod['auto_activate'];
|
2507 |
-
}
|
2508 |
-
|
2509 |
-
if ( $mod['module_tags'] ) {
|
2510 |
-
$mod['module_tags'] = explode( ',', $mod['module_tags'] );
|
2511 |
-
$mod['module_tags'] = array_map( 'trim', $mod['module_tags'] );
|
2512 |
-
$mod['module_tags'] = array_map( array( __CLASS__, 'translate_module_tag' ), $mod['module_tags'] );
|
2513 |
-
} else {
|
2514 |
-
$mod['module_tags'] = array( self::translate_module_tag( 'Other' ) );
|
2515 |
-
}
|
2516 |
-
|
2517 |
-
if ( $mod['feature'] ) {
|
2518 |
-
$mod['feature'] = explode( ',', $mod['feature'] );
|
2519 |
-
$mod['feature'] = array_map( 'trim', $mod['feature'] );
|
2520 |
-
} else {
|
2521 |
-
$mod['feature'] = array( self::translate_module_tag( 'Other' ) );
|
2522 |
-
}
|
2523 |
-
|
2524 |
-
/**
|
2525 |
-
* Filters the feature array on a module.
|
2526 |
-
*
|
2527 |
-
* This filter allows you to control where each module is filtered: Recommended,
|
2528 |
-
* Jumpstart, and the default "Other" listing.
|
2529 |
-
*
|
2530 |
-
* @since 3.5.0
|
2531 |
-
*
|
2532 |
-
* @param array $mod['feature'] The areas to feature this module:
|
2533 |
-
* 'Jumpstart' adds to the "Jumpstart" option to activate many modules at once.
|
2534 |
-
* 'Recommended' shows on the main Jetpack admin screen.
|
2535 |
-
* 'Other' should be the default if no other value is in the array.
|
2536 |
-
* @param string $module The slug of the module, e.g. sharedaddy.
|
2537 |
-
* @param array $mod All the currently assembled module data.
|
2538 |
-
*/
|
2539 |
-
$mod['feature'] = apply_filters( 'jetpack_module_feature', $mod['feature'], $module, $mod );
|
2540 |
-
|
2541 |
-
/**
|
2542 |
-
* Filter the returned data about a module.
|
2543 |
-
*
|
2544 |
-
* This filter allows overriding any info about Jetpack modules. It is dangerous,
|
2545 |
-
* so please be careful.
|
2546 |
-
*
|
2547 |
-
* @since 3.6.0
|
2548 |
-
*
|
2549 |
-
* @param array $mod The details of the requested module.
|
2550 |
-
* @param string $module The slug of the module, e.g. sharedaddy
|
2551 |
-
* @param string $file The path to the module source file.
|
2552 |
-
*/
|
2553 |
-
return apply_filters( 'jetpack_get_module', $mod, $module, $file );
|
2554 |
-
}
|
2555 |
-
|
2556 |
-
/**
|
2557 |
-
* Like core's get_file_data implementation, but caches the result.
|
2558 |
-
*/
|
2559 |
-
public static function get_file_data( $file, $headers ) {
|
2560 |
-
//Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated
|
2561 |
-
$file_name = basename( $file );
|
2562 |
-
$file_data_option = Jetpack_Options::get_option( 'file_data', array() );
|
2563 |
-
$key = md5( $file_name . serialize( $headers ) );
|
2564 |
-
$refresh_cache = is_admin() && isset( $_GET['page'] ) && 'jetpack' === substr( $_GET['page'], 0, 7 );
|
2565 |
-
|
2566 |
-
// If we don't need to refresh the cache, and already have the value, short-circuit!
|
2567 |
-
if ( ! $refresh_cache && isset( $file_data_option[ JETPACK__VERSION ][ $key ] ) ) {
|
2568 |
-
return $file_data_option[ JETPACK__VERSION ][ $key ];
|
2569 |
-
}
|
2570 |
-
|
2571 |
-
$data = get_file_data( $file, $headers );
|
2572 |
-
|
2573 |
-
// Strip out any old Jetpack versions that are cluttering the option.
|
2574 |
-
$file_data_option = array_intersect_key( (array) $file_data_option, array( JETPACK__VERSION => null ) );
|
2575 |
-
$file_data_option[ JETPACK__VERSION ][ $key ] = $data;
|
2576 |
-
Jetpack_Options::update_option( 'file_data', $file_data_option );
|
2577 |
-
|
2578 |
-
return $data;
|
2579 |
-
}
|
2580 |
-
|
2581 |
-
/**
|
2582 |
-
* Return translated module tag.
|
2583 |
-
*
|
2584 |
-
* @param string $tag Tag as it appears in each module heading.
|
2585 |
-
*
|
2586 |
-
* @return mixed
|
2587 |
-
*/
|
2588 |
-
public static function translate_module_tag( $tag ) {
|
2589 |
-
return jetpack_get_module_i18n_tag( $tag );
|
2590 |
-
}
|
2591 |
-
|
2592 |
-
/**
|
2593 |
-
* Return module name translation. Uses matching string created in modules/module-headings.php.
|
2594 |
-
*
|
2595 |
-
* @since 3.9.2
|
2596 |
-
*
|
2597 |
-
* @param array $modules
|
2598 |
-
*
|
2599 |
-
* @return string|void
|
2600 |
-
*/
|
2601 |
-
public static function get_translated_modules( $modules ) {
|
2602 |
-
foreach ( $modules as $index => $module ) {
|
2603 |
-
$i18n_module = jetpack_get_module_i18n( $module['module'] );
|
2604 |
-
if ( isset( $module['name'] ) ) {
|
2605 |
-
$modules[ $index ]['name'] = $i18n_module['name'];
|
2606 |
-
}
|
2607 |
-
if ( isset( $module['description'] ) ) {
|
2608 |
-
$modules[ $index ]['description'] = $i18n_module['description'];
|
2609 |
-
$modules[ $index ]['short_description'] = $i18n_module['description'];
|
2610 |
-
}
|
2611 |
-
}
|
2612 |
-
return $modules;
|
2613 |
-
}
|
2614 |
-
|
2615 |
-
/**
|
2616 |
-
* Get a list of activated modules as an array of module slugs.
|
2617 |
-
*/
|
2618 |
-
public static function get_active_modules() {
|
2619 |
-
$active = Jetpack_Options::get_option( 'active_modules' );
|
2620 |
-
if ( ! is_array( $active ) )
|
2621 |
-
$active = array();
|
2622 |
-
if ( is_admin() && ( class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' ) ) ) {
|
2623 |
-
$active[] = 'vaultpress';
|
2624 |
-
} else {
|
2625 |
-
$active = array_diff( $active, array( 'vaultpress' ) );
|
2626 |
-
}
|
2627 |
-
|
2628 |
-
//If protect is active on the main site of a multisite, it should be active on all sites.
|
2629 |
-
if ( ! in_array( 'protect', $active ) && is_multisite() && get_site_option( 'jetpack_protect_active' ) ) {
|
2630 |
-
$active[] = 'protect';
|
2631 |
-
}
|
2632 |
-
|
2633 |
-
return array_unique( $active );
|
2634 |
-
}
|
2635 |
-
|
2636 |
-
/**
|
2637 |
-
* Check whether or not a Jetpack module is active.
|
2638 |
-
*
|
2639 |
-
* @param string $module The slug of a Jetpack module.
|
2640 |
-
* @return bool
|
2641 |
-
*
|
2642 |
-
* @static
|
2643 |
-
*/
|
2644 |
-
public static function is_module_active( $module ) {
|
2645 |
-
return in_array( $module, self::get_active_modules() );
|
2646 |
-
}
|
2647 |
-
|
2648 |
-
public static function is_module( $module ) {
|
2649 |
-
return ! empty( $module ) && ! validate_file( $module, Jetpack::get_available_modules() );
|
2650 |
-
}
|
2651 |
-
|
2652 |
-
/**
|
2653 |
-
* Catches PHP errors. Must be used in conjunction with output buffering.
|
2654 |
-
*
|
2655 |
-
* @param bool $catch True to start catching, False to stop.
|
2656 |
-
*
|
2657 |
-
* @static
|
2658 |
-
*/
|
2659 |
-
public static function catch_errors( $catch ) {
|
2660 |
-
static $display_errors, $error_reporting;
|
2661 |
-
|
2662 |
-
if ( $catch ) {
|
2663 |
-
$display_errors = @ini_set( 'display_errors', 1 );
|
2664 |
-
$error_reporting = @error_reporting( E_ALL );
|
2665 |
-
add_action( 'shutdown', array( 'Jetpack', 'catch_errors_on_shutdown' ), 0 );
|
2666 |
-
} else {
|
2667 |
-
@ini_set( 'display_errors', $display_errors );
|
2668 |
-
@error_reporting( $error_reporting );
|
2669 |
-
remove_action( 'shutdown', array( 'Jetpack', 'catch_errors_on_shutdown' ), 0 );
|
2670 |
-
}
|
2671 |
-
}
|
2672 |
-
|
2673 |
-
/**
|
2674 |
-
* Saves any generated PHP errors in ::state( 'php_errors', {errors} )
|
2675 |
-
*/
|
2676 |
-
public static function catch_errors_on_shutdown() {
|
2677 |
-
Jetpack::state( 'php_errors', ob_get_clean() );
|
2678 |
-
}
|
2679 |
-
|
2680 |
-
public static function activate_default_modules( $min_version = false, $max_version = false, $other_modules = array() ) {
|
2681 |
-
$jetpack = Jetpack::init();
|
2682 |
-
|
2683 |
-
$modules = Jetpack::get_default_modules( $min_version, $max_version );
|
2684 |
-
$modules = array_merge( $other_modules, $modules );
|
2685 |
-
|
2686 |
-
// Look for standalone plugins and disable if active.
|
2687 |
-
|
2688 |
-
$to_deactivate = array();
|
2689 |
-
foreach ( $modules as $module ) {
|
2690 |
-
if ( isset( $jetpack->plugins_to_deactivate[$module] ) ) {
|
2691 |
-
$to_deactivate[$module] = $jetpack->plugins_to_deactivate[$module];
|
2692 |
-
}
|
2693 |
-
}
|
2694 |
-
|
2695 |
-
$deactivated = array();
|
2696 |
-
foreach ( $to_deactivate as $module => $deactivate_me ) {
|
2697 |
-
list( $probable_file, $probable_title ) = $deactivate_me;
|
2698 |
-
if ( Jetpack_Client_Server::deactivate_plugin( $probable_file, $probable_title ) ) {
|
2699 |
-
$deactivated[] = $module;
|
2700 |
-
}
|
2701 |
-
}
|
2702 |
-
|
2703 |
-
if ( $deactivated ) {
|
2704 |
-
Jetpack::state( 'deactivated_plugins', join( ',', $deactivated ) );
|
2705 |
-
|
2706 |
-
$url = add_query_arg(
|
2707 |
-
array(
|
2708 |
-
'action' => 'activate_default_modules',
|
2709 |
-
'_wpnonce' => wp_create_nonce( 'activate_default_modules' ),
|
2710 |
-
),
|
2711 |
-
add_query_arg( compact( 'min_version', 'max_version', 'other_modules' ), Jetpack::admin_url( 'page=jetpack' ) )
|
2712 |
-
);
|
2713 |
-
wp_safe_redirect( $url );
|
2714 |
-
exit;
|
2715 |
-
}
|
2716 |
-
|
2717 |
-
/**
|
2718 |
-
* Fires before default modules are activated.
|
2719 |
-
*
|
2720 |
-
* @since 1.9.0
|
2721 |
-
*
|
2722 |
-
* @param string $min_version Minimum version number required to use modules.
|
2723 |
-
* @param string $max_version Maximum version number required to use modules.
|
2724 |
-
* @param array $other_modules Array of other modules to activate alongside the default modules.
|
2725 |
-
*/
|
2726 |
-
do_action( 'jetpack_before_activate_default_modules', $min_version, $max_version, $other_modules );
|
2727 |
-
|
2728 |
-
// Check each module for fatal errors, a la wp-admin/plugins.php::activate before activating
|
2729 |
-
Jetpack::restate();
|
2730 |
-
Jetpack::catch_errors( true );
|
2731 |
-
|
2732 |
-
$active = Jetpack::get_active_modules();
|
2733 |
-
|
2734 |
-
foreach ( $modules as $module ) {
|
2735 |
-
if ( did_action( "jetpack_module_loaded_$module" ) ) {
|
2736 |
-
$active[] = $module;
|
2737 |
-
Jetpack_Options::update_option( 'active_modules', array_unique( $active ) );
|
2738 |
-
continue;
|
2739 |
-
}
|
2740 |
-
|
2741 |
-
if ( in_array( $module, $active ) ) {
|
2742 |
-
$module_info = Jetpack::get_module( $module );
|
2743 |
-
if ( ! $module_info['deactivate'] ) {
|
2744 |
-
$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
|
2745 |
-
if ( $active_state = Jetpack::state( $state ) ) {
|
2746 |
-
$active_state = explode( ',', $active_state );
|
2747 |
-
} else {
|
2748 |
-
$active_state = array();
|
2749 |
-
}
|
2750 |
-
$active_state[] = $module;
|
2751 |
-
Jetpack::state( $state, implode( ',', $active_state ) );
|
2752 |
-
}
|
2753 |
-
continue;
|
2754 |
-
}
|
2755 |
-
|
2756 |
-
$file = Jetpack::get_module_path( $module );
|
2757 |
-
if ( ! file_exists( $file ) ) {
|
2758 |
-
continue;
|
2759 |
-
}
|
2760 |
-
|
2761 |
-
// we'll override this later if the plugin can be included without fatal error
|
2762 |
-
wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) );
|
2763 |
-
Jetpack::state( 'error', 'module_activation_failed' );
|
2764 |
-
Jetpack::state( 'module', $module );
|
2765 |
-
ob_start();
|
2766 |
-
require $file;
|
2767 |
-
/**
|
2768 |
-
* Fires when a specific module is activated.
|
2769 |
-
*
|
2770 |
-
* @since 1.9.0
|
2771 |
-
*
|
2772 |
-
* @param string $module Module slug.
|
2773 |
-
*/
|
2774 |
-
do_action( 'jetpack_activate_module', $module );
|
2775 |
-
$active[] = $module;
|
2776 |
-
$state = in_array( $module, $other_modules ) ? 'reactivated_modules' : 'activated_modules';
|
2777 |
-
if ( $active_state = Jetpack::state( $state ) ) {
|
2778 |
-
$active_state = explode( ',', $active_state );
|
2779 |
-
} else {
|
2780 |
-
$active_state = array();
|
2781 |
-
}
|
2782 |
-
$active_state[] = $module;
|
2783 |
-
Jetpack::state( $state, implode( ',', $active_state ) );
|
2784 |
-
Jetpack_Options::update_option( 'active_modules', array_unique( $active ) );
|
2785 |
-
ob_end_clean();
|
2786 |
-
}
|
2787 |
-
Jetpack::state( 'error', false );
|
2788 |
-
Jetpack::state( 'module', false );
|
2789 |
-
Jetpack::catch_errors( false );
|
2790 |
-
/**
|
2791 |
-
* Fires when default modules are activated.
|
2792 |
-
*
|
2793 |
-
* @since 1.9.0
|
2794 |
-
*
|
2795 |
-
* @param string $min_version Minimum version number required to use modules.
|
2796 |
-
* @param string $max_version Maximum version number required to use modules.
|
2797 |
-
* @param array $other_modules Array of other modules to activate alongside the default modules.
|
2798 |
-
*/
|
2799 |
-
do_action( 'jetpack_activate_default_modules', $min_version, $max_version, $other_modules );
|
2800 |
-
}
|
2801 |
-
|
2802 |
-
public static function activate_module( $module, $exit = true, $redirect = true ) {
|
2803 |
-
/**
|
2804 |
-
* Fires before a module is activated.
|
2805 |
-
*
|
2806 |
-
* @since 2.6.0
|
2807 |
-
*
|
2808 |
-
* @param string $module Module slug.
|
2809 |
-
* @param bool $exit Should we exit after the module has been activated. Default to true.
|
2810 |
-
* @param bool $redirect Should the user be redirected after module activation? Default to true.
|
2811 |
-
*/
|
2812 |
-
do_action( 'jetpack_pre_activate_module', $module, $exit, $redirect );
|
2813 |
-
|
2814 |
-
$jetpack = Jetpack::init();
|
2815 |
-
|
2816 |
-
if ( ! strlen( $module ) )
|
2817 |
-
return false;
|
2818 |
-
|
2819 |
-
if ( ! Jetpack::is_module( $module ) )
|
2820 |
-
return false;
|
2821 |
-
|
2822 |
-
// If it's already active, then don't do it again
|
2823 |
-
$active = Jetpack::get_active_modules();
|
2824 |
-
foreach ( $active as $act ) {
|
2825 |
-
if ( $act == $module )
|
2826 |
-
return true;
|
2827 |
-
}
|
2828 |
-
|
2829 |
-
$module_data = Jetpack::get_module( $module );
|
2830 |
-
|
2831 |
-
if ( ! Jetpack::is_active() ) {
|
2832 |
-
if ( !Jetpack::is_development_mode() )
|
2833 |
-
return false;
|
2834 |
-
|
2835 |
-
// If we're not connected but in development mode, make sure the module doesn't require a connection
|
2836 |
-
if ( Jetpack::is_development_mode() && $module_data['requires_connection'] )
|
2837 |
-
return false;
|
2838 |
-
}
|
2839 |
-
|
2840 |
-
// Check and see if the old plugin is active
|
2841 |
-
if ( isset( $jetpack->plugins_to_deactivate[ $module ] ) ) {
|
2842 |
-
// Deactivate the old plugin
|
2843 |
-
if ( Jetpack_Client_Server::deactivate_plugin( $jetpack->plugins_to_deactivate[ $module ][0], $jetpack->plugins_to_deactivate[ $module ][1] ) ) {
|
2844 |
-
// If we deactivated the old plugin, remembere that with ::state() and redirect back to this page to activate the module
|
2845 |
-
// We can't activate the module on this page load since the newly deactivated old plugin is still loaded on this page load.
|
2846 |
-
Jetpack::state( 'deactivated_plugins', $module );
|
2847 |
-
wp_safe_redirect( add_query_arg( 'jetpack_restate', 1 ) );
|
2848 |
-
exit;
|
2849 |
-
}
|
2850 |
-
}
|
2851 |
-
|
2852 |
-
// Check the file for fatal errors, a la wp-admin/plugins.php::activate
|
2853 |
-
Jetpack::state( 'module', $module );
|
2854 |
-
Jetpack::state( 'error', 'module_activation_failed' ); // we'll override this later if the plugin can be included without fatal error
|
2855 |
-
|
2856 |
-
Jetpack::catch_errors( true );
|
2857 |
-
ob_start();
|
2858 |
-
require Jetpack::get_module_path( $module );
|
2859 |
-
/** This action is documented in class.jetpack.php */
|
2860 |
-
do_action( 'jetpack_activate_module', $module );
|
2861 |
-
$active[] = $module;
|
2862 |
-
Jetpack_Options::update_option( 'active_modules', array_unique( $active ) );
|
2863 |
-
Jetpack::state( 'error', false ); // the override
|
2864 |
-
Jetpack::state( 'message', 'module_activated' );
|
2865 |
-
Jetpack::state( 'module', $module );
|
2866 |
-
ob_end_clean();
|
2867 |
-
Jetpack::catch_errors( false );
|
2868 |
-
|
2869 |
-
// A flag for Jump Start so it's not shown again. Only set if it hasn't been yet.
|
2870 |
-
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
2871 |
-
Jetpack_Options::update_option( 'jumpstart', 'jetpack_action_taken' );
|
2872 |
-
|
2873 |
-
//Jump start is being dismissed send data to MC Stats
|
2874 |
-
$jetpack->stat( 'jumpstart', 'manual,'.$module );
|
2875 |
-
|
2876 |
-
$jetpack->do_stats( 'server_side' );
|
2877 |
-
}
|
2878 |
-
|
2879 |
-
if ( $redirect ) {
|
2880 |
-
wp_safe_redirect( Jetpack::admin_url( 'page=jetpack' ) );
|
2881 |
-
}
|
2882 |
-
if ( $exit ) {
|
2883 |
-
exit;
|
2884 |
-
}
|
2885 |
-
}
|
2886 |
-
|
2887 |
-
function activate_module_actions( $module ) {
|
2888 |
-
/**
|
2889 |
-
* Fires when a module is activated.
|
2890 |
-
* The dynamic part of the filter, $module, is the module slug.
|
2891 |
-
*
|
2892 |
-
* @since 1.9.0
|
2893 |
-
*
|
2894 |
-
* @param string $module Module slug.
|
2895 |
-
*/
|
2896 |
-
do_action( "jetpack_activate_module_$module", $module );
|
2897 |
-
|
2898 |
-
$this->sync->sync_all_module_options( $module );
|
2899 |
-
}
|
2900 |
-
|
2901 |
-
public static function deactivate_module( $module ) {
|
2902 |
-
/**
|
2903 |
-
* Fires when a module is deactivated.
|
2904 |
-
*
|
2905 |
-
* @since 1.9.0
|
2906 |
-
*
|
2907 |
-
* @param string $module Module slug.
|
2908 |
-
*/
|
2909 |
-
do_action( 'jetpack_pre_deactivate_module', $module );
|
2910 |
-
|
2911 |
-
$jetpack = Jetpack::init();
|
2912 |
-
|
2913 |
-
$active = Jetpack::get_active_modules();
|
2914 |
-
$new = array_filter( array_diff( $active, (array) $module ) );
|
2915 |
-
|
2916 |
-
/**
|
2917 |
-
* Fires when a module is deactivated.
|
2918 |
-
* The dynamic part of the filter, $module, is the module slug.
|
2919 |
-
*
|
2920 |
-
* @since 1.9.0
|
2921 |
-
*
|
2922 |
-
* @param string $module Module slug.
|
2923 |
-
*/
|
2924 |
-
do_action( "jetpack_deactivate_module_$module", $module );
|
2925 |
-
|
2926 |
-
// A flag for Jump Start so it's not shown again.
|
2927 |
-
if ( 'new_connection' === Jetpack_Options::get_option( 'jumpstart' ) ) {
|
2928 |
-
Jetpack_Options::update_option( 'jumpstart', 'jetpack_action_taken' );
|
2929 |
-
|
2930 |
-
//Jump start is being dismissed send data to MC Stats
|
2931 |
-
$jetpack->stat( 'jumpstart', 'manual,deactivated-'.$module );
|
2932 |
-
|
2933 |
-
$jetpack->do_stats( 'server_side' );
|
2934 |
-
}
|
2935 |
-
|
2936 |
-
return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) );
|
2937 |
-
}
|
2938 |
-
|
2939 |
-
public static function enable_module_configurable( $module ) {
|
2940 |
-
$module = Jetpack::get_module_slug( $module );
|
2941 |
-
add_filter( 'jetpack_module_configurable_' . $module, '__return_true' );
|
2942 |
-
}
|
2943 |
-
|
2944 |
-
public static function module_configuration_url( $module ) {
|
2945 |
-
$module = Jetpack::get_module_slug( $module );
|
2946 |
-
return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) );
|
2947 |
-
}
|
2948 |
-
|
2949 |
-
public static function module_configuration_load( $module, $method ) {
|
2950 |
-
$module = Jetpack::get_module_slug( $module );
|
2951 |
-
add_action( 'jetpack_module_configuration_load_' . $module, $method );
|
2952 |
-
}
|
2953 |
-
|
2954 |
-
public static function module_configuration_head( $module, $method ) {
|
2955 |
-
$module = Jetpack::get_module_slug( $module );
|
2956 |
-
add_action( 'jetpack_module_configuration_head_' . $module, $method );
|
2957 |
-
}
|
2958 |
-
|
2959 |
-
public static function module_configuration_screen( $module, $method ) {
|
2960 |
-
$module = Jetpack::get_module_slug( $module );
|
2961 |
-
add_action( 'jetpack_module_configuration_screen_' . $module, $method );
|
2962 |
-
}
|
2963 |
-
|
2964 |
-
public static function module_configuration_activation_screen( $module, $method ) {
|
2965 |
-
$module = Jetpack::get_module_slug( $module );
|
2966 |
-
add_action( 'display_activate_module_setting_' . $module, $method );
|
2967 |
-
}
|
2968 |
-
|
2969 |
-
/* Installation */
|
2970 |
-
|
2971 |
-
public static function bail_on_activation( $message, $deactivate = true ) {
|
2972 |
-
?>
|
2973 |
-
<!doctype html>
|
2974 |
-
<html>
|
2975 |
-
<head>
|
2976 |
-
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
2977 |
-
<style>
|
2978 |
-
* {
|
2979 |
-
text-align: center;
|
2980 |
-
margin: 0;
|
2981 |
-
padding: 0;
|
2982 |
-
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
2983 |
-
}
|
2984 |
-
p {
|
2985 |
-
margin-top: 1em;
|
2986 |
-
font-size: 18px;
|
2987 |
-
}
|
2988 |
-
</style>
|
2989 |
-
<body>
|
2990 |
-
<p><?php echo esc_html( $message ); ?></p>
|
2991 |
-
</body>
|
2992 |
-
</html>
|
2993 |
-
<?php
|
2994 |
-
if ( $deactivate ) {
|
2995 |
-
$plugins = get_option( 'active_plugins' );
|
2996 |
-
$jetpack = plugin_basename( JETPACK__PLUGIN_DIR . 'jetpack.php' );
|
2997 |
-
$update = false;
|
2998 |
-
foreach ( $plugins as $i => $plugin ) {
|
2999 |
-
if ( $plugin === $jetpack ) {
|
3000 |
-
$plugins[$i] = false;
|
3001 |
-
$update = true;
|
3002 |
-
}
|
3003 |
-
}
|
3004 |
-
|
3005 |
-
if ( $update ) {
|
3006 |
-
update_option( 'active_plugins', array_filter( $plugins ) );
|
3007 |
-
}
|
3008 |
-
}
|
3009 |
-
exit;
|
3010 |
-
}
|
3011 |
-
|
3012 |
-
/**
|
3013 |
-
* Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook()
|
3014 |
-
* @static
|
3015 |
-
*/
|
3016 |
-
public static function plugin_activation( $network_wide ) {
|
3017 |
-
Jetpack_Options::update_option( 'activated', 1 );
|
3018 |
-
|
3019 |
-
if ( version_compare( $GLOBALS['wp_version'], JETPACK__MINIMUM_WP_VERSION, '<' ) ) {
|
3020 |
-
Jetpack::bail_on_activation( sprintf( __( 'Jetpack requires WordPress version %s or later.', 'jetpack' ), JETPACK__MINIMUM_WP_VERSION ) );
|
3021 |
-
}
|
3022 |
-
|
3023 |
-
if ( $network_wide )
|
3024 |
-
Jetpack::state( 'network_nag', true );
|
3025 |
-
|
3026 |
-
Jetpack::plugin_initialize();
|
3027 |
-
}
|
3028 |
-
/**
|
3029 |
-
* Runs before bumping version numbers up to a new version
|
3030 |
-
* @param (string) $version Version:timestamp
|
3031 |
-
* @param (string) $old_version Old Version:timestamp or false if not set yet.
|
3032 |
-
* @return null [description]
|
3033 |
-
*/
|
3034 |
-
public static function do_version_bump( $version, $old_version ) {
|
3035 |
-
|
3036 |
-
if ( ! $old_version ) { // For new sites
|
3037 |
-
// Setting up jetpack manage
|
3038 |
-
Jetpack::activate_manage();
|
3039 |
-
}
|
3040 |
-
}
|
3041 |
-
|
3042 |
-
/**
|
3043 |
-
* Sets the internal version number and activation state.
|
3044 |
-
* @static
|
3045 |
-
*/
|
3046 |
-
public static function plugin_initialize() {
|
3047 |
-
if ( ! Jetpack_Options::get_option( 'activated' ) ) {
|
3048 |
-
Jetpack_Options::update_option( 'activated', 2 );
|
3049 |
-
}
|
3050 |
-
|
3051 |
-
if ( ! Jetpack_Options::get_option( 'version' ) ) {
|
3052 |
-
$version = $old_version = JETPACK__VERSION . ':' . time();
|
3053 |
-
/** This action is documented in class.jetpack.php */
|
3054 |
-
do_action( 'updating_jetpack_version', $version, false );
|
3055 |
-
Jetpack_Options::update_options( compact( 'version', 'old_version' ) );
|
3056 |
-
}
|
3057 |
-
|
3058 |
-
Jetpack::load_modules();
|
3059 |
-
|
3060 |
-
Jetpack_Options::delete_option( 'do_activate' );
|
3061 |
-
}
|
3062 |
-
|
3063 |
-
/**
|
3064 |
-
* Removes all connection options
|
3065 |
-
* @static
|
3066 |
-
*/
|
3067 |
-
public static function plugin_deactivation( ) {
|
3068 |
-
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
3069 |
-
if( is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) {
|
3070 |
-
Jetpack_Network::init()->deactivate();
|
3071 |
-
} else {
|
3072 |
-
Jetpack::disconnect( false );
|
3073 |
-
//Jetpack_Heartbeat::init()->deactivate();
|
3074 |
-
}
|
3075 |
-
}
|
3076 |
-
|
3077 |
-
/**
|
3078 |
-
* Disconnects from the Jetpack servers.
|
3079 |
-
* Forgets all connection details and tells the Jetpack servers to do the same.
|
3080 |
-
* @static
|
3081 |
-
*/
|
3082 |
-
public static function disconnect( $update_activated_state = true ) {
|
3083 |
-
wp_clear_scheduled_hook( 'jetpack_clean_nonces' );
|
3084 |
-
Jetpack::clean_nonces( true );
|
3085 |
-
|
3086 |
-
Jetpack::load_xml_rpc_client();
|
3087 |
-
$xml = new Jetpack_IXR_Client();
|
3088 |
-
$xml->query( 'jetpack.deregister' );
|
3089 |
-
|
3090 |
-
Jetpack_Options::delete_option(
|
3091 |
-
array(
|
3092 |
-
'register',
|
3093 |
-
'blog_token',
|
3094 |
-
'user_token',
|
3095 |
-
'user_tokens',
|
3096 |
-
'master_user',
|
3097 |
-
'time_diff',
|
3098 |
-
'fallback_no_verify_ssl_certs',
|
3099 |
-
)
|
3100 |
-
);
|
3101 |
-
|
3102 |
-
if ( $update_activated_state ) {
|
3103 |
-
Jetpack_Options::update_option( 'activated', 4 );
|
3104 |
-
}
|
3105 |
-
|
3106 |
-
$jetpack_unique_connection = Jetpack_Options::get_option( 'unique_connection' );
|
3107 |
-
// Check then record unique disconnection if site has never been disconnected previously
|
3108 |
-
if ( -1 == $jetpack_unique_connection['disconnected'] ) {
|
3109 |
-
$jetpack_unique_connection['disconnected'] = 1;
|
3110 |
-
}
|
3111 |
-
else {
|
3112 |
-
if ( 0 == $jetpack_unique_connection['disconnected'] ) {
|
3113 |
-
//track unique disconnect
|
3114 |
-
$jetpack = Jetpack::init();
|
3115 |
-
|
3116 |
-
$jetpack->stat( 'connections', 'unique-disconnect' );
|
3117 |
-
$jetpack->do_stats( 'server_side' );
|
3118 |
-
}
|
3119 |
-
// increment number of times disconnected
|
3120 |
-
$jetpack_unique_connection['disconnected'] += 1;
|
3121 |
-
}
|
3122 |
-
|
3123 |
-
Jetpack_Options::update_option( 'unique_connection', $jetpack_unique_connection );
|
3124 |
-
|
3125 |
-
// Disable the Heartbeat cron
|
3126 |
-
Jetpack_Heartbeat::init()->deactivate();
|
3127 |
-
}
|
3128 |
-
|
3129 |
-
/**
|
3130 |
-
* Unlinks the current user from the linked WordPress.com user
|
3131 |
-
*/
|
3132 |
-
public static function unlink_user( $user_id = null ) {
|
3133 |
-
if ( ! $tokens = Jetpack_Options::get_option( 'user_tokens' ) )
|
3134 |
-
return false;
|
3135 |
-
|
3136 |
-
$user_id = empty( $user_id ) ? get_current_user_id() : intval( $user_id );
|
3137 |
-
|
3138 |
-
if ( Jetpack_Options::get_option( 'master_user' ) == $user_id )
|
3139 |
-
return false;
|
3140 |
-
|
3141 |
-
if ( ! isset( $tokens[ $user_id ] ) )
|
3142 |
-
return false;
|
3143 |
-
|
3144 |
-
Jetpack::load_xml_rpc_client();
|
3145 |
-
$xml = new Jetpack_IXR_Client( compact( 'user_id' ) );
|
3146 |
-
$xml->query( 'jetpack.unlink_user', $user_id );
|
3147 |
-
|
3148 |
-
unset( $tokens[ $user_id ] );
|
3149 |
-
|
3150 |
-
Jetpack_Options::update_option( 'user_tokens', $tokens );
|
3151 |
-
|
3152 |
-
return true;
|
3153 |
-
}
|
3154 |
-
|
3155 |
-
/**
|
3156 |
-
* Attempts Jetpack registration. If it fail, a state flag is set: @see ::admin_page_load()
|
3157 |
-
*/
|
3158 |
-
public static function try_registration() {
|
3159 |
-
// Let's get some testing in beta versions and such.
|
3160 |
-
if ( self::is_development_version() && defined( 'PHP_URL_HOST' ) ) {
|
3161 |
-
// Before attempting to connect, let's make sure that the domains are viable.
|
3162 |
-
$domains_to_check = array_unique( array(
|
3163 |
-
'siteurl' => parse_url( get_site_url(), PHP_URL_HOST ),
|
3164 |
-
'homeurl' => parse_url( get_home_url(), PHP_URL_HOST ),
|
3165 |
-
) );
|
3166 |
-
foreach ( $domains_to_check as $domain ) {
|
3167 |
-
$result = Jetpack_Data::is_usable_domain( $domain );
|
3168 |
-
if ( is_wp_error( $result ) ) {
|
3169 |
-
return $result;
|
3170 |
-
}
|
3171 |
-
}
|
3172 |
-
}
|
3173 |
-
|
3174 |
-
$result = Jetpack::register();
|
3175 |
-
|
3176 |
-
// If there was an error with registration and the site was not registered, record this so we can show a message.
|
3177 |
-
if ( ! $result || is_wp_error( $result ) ) {
|
3178 |
-
return $result;
|
3179 |
-
} else {
|
3180 |
-
return true;
|
3181 |
-
}
|
3182 |
-
}
|
3183 |
-
|
3184 |
-
/**
|
3185 |
-
* Tracking an internal event log. Try not to put too much chaff in here.
|
3186 |
-
*
|
3187 |
-
* [Everyone Loves a Log!](https://www.youtube.com/watch?v=2C7mNr5WMjA)
|
3188 |
-
*/
|
3189 |
-
public static function log( $code, $data = null ) {
|
3190 |
-
// only grab the latest 200 entries
|
3191 |
-
$log = array_slice( Jetpack_Options::get_option( 'log', array() ), -199, 199 );
|
3192 |
-
|
3193 |
-
// Append our event to the log
|
3194 |
-
$log_entry = array(
|
3195 |
-
'time' => time(),
|
3196 |
-
'user_id' => get_current_user_id(),
|
3197 |
-
'blog_id' => Jetpack_Options::get_option( 'id' ),
|
3198 |
-
'code' => $code,
|
3199 |
-
);
|
3200 |
-
// Don't bother storing it unless we've got some.
|
3201 |
-
if ( ! is_null( $data ) ) {
|
3202 |
-
$log_entry['data'] = $data;
|
3203 |
-
}
|
3204 |
-
$log[] = $log_entry;
|
3205 |
-
|
3206 |
-
// Try add_option first, to make sure it's not autoloaded.
|
3207 |
-
// @todo: Add an add_option method to Jetpack_Options
|
3208 |
-
if ( ! add_option( 'jetpack_log', $log, null, 'no' ) ) {
|
3209 |
-
Jetpack_Options::update_option( 'log', $log );
|
3210 |
-
}
|
3211 |
-
|
3212 |
-
/**
|
3213 |
-
* Fires when Jetpack logs an internal event.
|
3214 |
-
*
|
3215 |
-
* @since 3.0.0
|
3216 |
-
*
|
3217 |
-
* @param array $log_entry {
|
3218 |
-
* Array of details about the log entry.
|
3219 |
-
*
|
3220 |
-
* @param string time Time of the event.
|
3221 |
-
* @param int user_id ID of the user who trigerred the event.
|
3222 |
-
* @param int blog_id Jetpack Blog ID.
|
3223 |
-
* @param string code Unique name for the event.
|
3224 |
-
* @param string data Data about the event.
|
3225 |
-
* }
|
3226 |
-
*/
|
3227 |
-
do_action( 'jetpack_log_entry', $log_entry );
|
3228 |
-
}
|
3229 |
-
|
3230 |
-
/**
|
3231 |
-
* Get the internal event log.
|
3232 |
-
*
|
3233 |
-
* @param $event (string) - only return the specific log events
|
3234 |
-
* @param $num (int) - get specific number of latest results, limited to 200
|
3235 |
-
*
|
3236 |
-
* @return array of log events || WP_Error for invalid params
|
3237 |
-
*/
|
3238 |
-
public static function get_log( $event = false, $num = false ) {
|
3239 |
-
if ( $event && ! is_string( $event ) ) {
|
3240 |
-
return new WP_Error( __( 'First param must be string or empty', 'jetpack' ) );
|
3241 |
-
}
|
3242 |
-
|
3243 |
-
if ( $num && ! is_numeric( $num ) ) {
|
3244 |
-
return new WP_Error( __( 'Second param must be numeric or empty', 'jetpack' ) );
|
3245 |
-
}
|
3246 |
-
|
3247 |
-
$entire_log = Jetpack_Options::get_option( 'log', array() );
|
3248 |
-
|
3249 |
-
// If nothing set - act as it did before, otherwise let's start customizing the output
|
3250 |
-
if ( ! $num && ! $event ) {
|
3251 |
-
return $entire_log;
|
3252 |
-
} else {
|
3253 |
-
$entire_log = array_reverse( $entire_log );
|
3254 |
-
}
|
3255 |
-
|
3256 |
-
$custom_log_output = array();
|
3257 |
-
|
3258 |
-
if ( $event ) {
|
3259 |
-
foreach ( $entire_log as $log_event ) {
|
3260 |
-
if ( $event == $log_event[ 'code' ] ) {
|
3261 |
-
$custom_log_output[] = $log_event;
|
3262 |
-
}
|
3263 |
-
}
|
3264 |
-
} else {
|
3265 |
-
$custom_log_output = $entire_log;
|
3266 |
-
}
|
3267 |
-
|
3268 |
-
if ( $num ) {
|
3269 |
-
$custom_log_output = array_slice( $custom_log_output, 0, $num );
|
3270 |
-
}
|
3271 |
-
|
3272 |
-
return $custom_log_output;
|
3273 |
-
}
|
3274 |
-
|
3275 |
-
/**
|
3276 |
-
* Log modification of important settings.
|
3277 |
-
*/
|
3278 |
-
public static function log_settings_change( $option, $old_value, $value ) {
|
3279 |
-
switch( $option ) {
|
3280 |
-
case 'jetpack_sync_non_public_post_stati':
|
3281 |
-
self::log( $option, $value );
|
3282 |
-
break;
|
3283 |
-
}
|
3284 |
-
}
|
3285 |
-
|
3286 |
-
/**
|
3287 |
-
* Return stat data for WPCOM sync
|
3288 |
-
*/
|
3289 |
-
function get_stat_data() {
|
3290 |
-
$heartbeat_data = Jetpack_Heartbeat::generate_stats_array();
|
3291 |
-
$additional_data = $this->get_additional_stat_data();
|
3292 |
-
|
3293 |
-
return json_encode( array_merge( $heartbeat_data, $additional_data ) );
|
3294 |
-
}
|
3295 |
-
|
3296 |
-
/**
|
3297 |
-
* Get additional stat data to sync to WPCOM
|
3298 |
-
*/
|
3299 |
-
function get_additional_stat_data( $prefix = '' ) {
|
3300 |
-
$return["{$prefix}themes"] = Jetpack::get_parsed_theme_data();
|
3301 |
-
$return["{$prefix}plugins-extra"] = Jetpack::get_parsed_plugin_data();
|
3302 |
-
$return["{$prefix}users"] = count_users();
|
3303 |
-
$return["{$prefix}site-count"] = 0;
|
3304 |
-
if ( function_exists( 'get_blog_count' ) ) {
|
3305 |
-
$return["{$prefix}site-count"] = get_blog_count();
|
3306 |
-
}
|
3307 |
-
return $return;
|
3308 |
-
}
|
3309 |
-
|
3310 |
-
/* Admin Pages */
|
3311 |
-
|
3312 |
-
function admin_init() {
|
3313 |
-
// If the plugin is not connected, display a connect message.
|
3314 |
-
if (
|
3315 |
-
// the plugin was auto-activated and needs its candy
|
3316 |
-
Jetpack_Options::get_option( 'do_activate' )
|
3317 |
-
||
|
3318 |
-
// the plugin is active, but was never activated. Probably came from a site-wide network activation
|
3319 |
-
! Jetpack_Options::get_option( 'activated' )
|
3320 |
-
) {
|
3321 |
-
Jetpack::plugin_initialize();
|
3322 |
-
}
|
3323 |
-
|
3324 |
-
if ( ! Jetpack::is_active() && ! Jetpack::is_development_mode() ) {
|
3325 |
-
if ( 4 != Jetpack_Options::get_option( 'activated' ) ) {
|
3326 |
-
// Show connect notice on dashboard and plugins pages
|
3327 |
-
add_action( 'load-index.php', array( $this, 'prepare_connect_notice' ) );
|
3328 |
-
add_action( 'load-plugins.php', array( $this, 'prepare_connect_notice' ) );
|
3329 |
-
}
|
3330 |
-
} elseif ( false === Jetpack_Options::get_option( 'fallback_no_verify_ssl_certs' ) ) {
|
3331 |
-
// Upgrade: 1.1 -> 1.1.1
|
3332 |
-
// Check and see if host can verify the Jetpack servers' SSL certificate
|
3333 |
-
$args = array();
|
3334 |
-
Jetpack_Client::_wp_remote_request(
|
3335 |
-
Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'test' ) ),
|
3336 |
-
$args,
|
3337 |
-
true
|
3338 |
-
);
|
3339 |
-
} else {
|
3340 |
-
// Show the notice on the Dashboard only for now
|
3341 |
-
|
3342 |
-
add_action( 'load-index.php', array( $this, 'prepare_manage_jetpack_notice' ) );
|
3343 |
-
|
3344 |
-
// Identity crisis notices
|
3345 |
-
add_action( 'jetpack_notices', array( $this, 'alert_identity_crisis' ) );
|
3346 |
-
}
|
3347 |
-
|
3348 |
-
// If the plugin has just been disconnected from WP.com, show the survey notice
|
3349 |
-
if ( isset( $_GET['disconnected'] ) && 'true' === $_GET['disconnected'] ) {
|
3350 |
-
add_action( 'jetpack_notices', array( $this, 'disconnect_survey_notice' ) );
|
3351 |
-
}
|
3352 |
-
|
3353 |
-
if ( current_user_can( 'manage_options' ) && 'ALWAYS' == JETPACK_CLIENT__HTTPS && ! self::permit_ssl() ) {
|
3354 |
-
add_action( 'admin_notices', array( $this, 'alert_required_ssl_fail' ) );
|
3355 |
-
}
|
3356 |
-
|
3357 |
-
add_action( 'load-plugins.php', array( $this, 'intercept_plugin_error_scrape_init' ) );
|
3358 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_menu_css' ) );
|
3359 |
-
add_filter( 'plugin_action_links_' . plugin_basename( JETPACK__PLUGIN_DIR . 'jetpack.php' ), array( $this, 'plugin_action_links' ) );
|
3360 |
-
|
3361 |
-
if ( Jetpack::is_active() || Jetpack::is_development_mode() ) {
|
3362 |
-
// Artificially throw errors in certain whitelisted cases during plugin activation
|
3363 |
-
add_action( 'activate_plugin', array( $this, 'throw_error_on_activate_plugin' ) );
|
3364 |
-
|
3365 |
-
// Kick off synchronization of user role when it changes
|
3366 |
-
add_action( 'set_user_role', array( $this, 'user_role_change' ) );
|
3367 |
-
}
|
3368 |
-
|
3369 |
-
// Jetpack Manage Activation Screen from .com
|
3370 |
-
Jetpack::module_configuration_activation_screen( 'manage', array( $this, 'manage_activate_screen' ) );
|
3371 |
-
}
|
3372 |
-
|
3373 |
-
function admin_body_class( $admin_body_class = '' ) {
|
3374 |
-
$classes = explode( ' ', trim( $admin_body_class ) );
|
3375 |
-
|
3376 |
-
$classes[] = self::is_active() ? 'jetpack-connected' : 'jetpack-disconnected';
|
3377 |
-
|
3378 |
-
$admin_body_class = implode( ' ', array_unique( $classes ) );
|
3379 |
-
return " $admin_body_class ";
|
3380 |
-
}
|
3381 |
-
|
3382 |
-
static function add_jetpack_pagestyles( $admin_body_class = '' ) {
|
3383 |
-
return $admin_body_class . ' jetpack-pagestyles ';
|
3384 |
-
}
|
3385 |
-
|
3386 |
-
function prepare_connect_notice() {
|
3387 |
-
add_action( 'admin_print_styles', array( $this, 'admin_banner_styles' ) );
|
3388 |
-
|
3389 |
-
add_action( 'admin_notices', array( $this, 'admin_connect_notice' ) );
|
3390 |
-
|
3391 |
-
if ( Jetpack::state( 'network_nag' ) )
|
3392 |
-
add_action( 'network_admin_notices', array( $this, 'network_connect_notice' ) );
|
3393 |
-
}
|
3394 |
-
/**
|
3395 |
-
* Call this function if you want the Big Jetpack Manage Notice to show up.
|
3396 |
-
*
|
3397 |
-
* @return null
|
3398 |
-
*/
|
3399 |
-
function prepare_manage_jetpack_notice() {
|
3400 |
-
|
3401 |
-
add_action( 'admin_print_styles', array( $this, 'admin_banner_styles' ) );
|
3402 |
-
add_action( 'admin_notices', array( $this, 'admin_jetpack_manage_notice' ) );
|
3403 |
-
}
|
3404 |
-
|
3405 |
-
function manage_activate_screen() {
|
3406 |
-
include ( JETPACK__PLUGIN_DIR . 'modules/manage/activate-admin.php' );
|
3407 |
-
}
|
3408 |
-
/**
|
3409 |
-
* Sometimes a plugin can activate without causing errors, but it will cause errors on the next page load.
|
3410 |
-
* This function artificially throws errors for such cases (whitelisted).
|
3411 |
-
*
|
3412 |
-
* @param string $plugin The activated plugin.
|
3413 |
-
*/
|
3414 |
-
function throw_error_on_activate_plugin( $plugin ) {
|
3415 |
-
$active_modules = Jetpack::get_active_modules();
|
3416 |
-
|
3417 |
-
// The Shortlinks module and the Stats plugin conflict, but won't cause errors on activation because of some function_exists() checks.
|
3418 |
-
if ( function_exists( 'stats_get_api_key' ) && in_array( 'shortlinks', $active_modules ) ) {
|
3419 |
-
$throw = false;
|
3420 |
-
|
3421 |
-
// Try and make sure it really was the stats plugin
|
3422 |
-
if ( ! class_exists( 'ReflectionFunction' ) ) {
|
3423 |
-
if ( 'stats.php' == basename( $plugin ) ) {
|
3424 |
-
$throw = true;
|
3425 |
-
}
|
3426 |
-
} else {
|
3427 |
-
$reflection = new ReflectionFunction( 'stats_get_api_key' );
|
3428 |
-
if ( basename( $plugin ) == basename( $reflection->getFileName() ) ) {
|
3429 |
-
$throw = true;
|
3430 |
-
}
|
3431 |
-
}
|
3432 |
-
|
3433 |
-
if ( $throw ) {
|
3434 |
-
trigger_error( sprintf( __( 'Jetpack contains the most recent version of the old “%1$s” plugin.', 'jetpack' ), 'WordPress.com Stats' ), E_USER_ERROR );
|
3435 |
-
}
|
3436 |
-
}
|
3437 |
-
}
|
3438 |
-
|
3439 |
-
function intercept_plugin_error_scrape_init() {
|
3440 |
-
add_action( 'check_admin_referer', array( $this, 'intercept_plugin_error_scrape' ), 10, 2 );
|
3441 |
-
}
|
3442 |
-
|
3443 |
-
function intercept_plugin_error_scrape( $action, $result ) {
|
3444 |
-
if ( ! $result ) {
|
3445 |
-
return;
|
3446 |
-
}
|
3447 |
-
|
3448 |
-
foreach ( $this->plugins_to_deactivate as $deactivate_me ) {
|
3449 |
-
if ( "plugin-activation-error_{$deactivate_me[0]}" == $action ) {
|
3450 |
-
Jetpack::bail_on_activation( sprintf( __( 'Jetpack contains the most recent version of the old “%1$s” plugin.', 'jetpack' ), $deactivate_me[1] ), false );
|
3451 |
-
}
|
3452 |
-
}
|
3453 |
-
}
|
3454 |
-
|
3455 |
-
function add_remote_request_handlers() {
|
3456 |
-
add_action( 'wp_ajax_nopriv_jetpack_upload_file', array( $this, 'remote_request_handlers' ) );
|
3457 |
-
}
|
3458 |
-
|
3459 |
-
function remote_request_handlers() {
|
3460 |
-
switch ( current_filter() ) {
|
3461 |
-
case 'wp_ajax_nopriv_jetpack_upload_file' :
|
3462 |
-
$response = $this->upload_handler();
|
3463 |
-
break;
|
3464 |
-
default :
|
3465 |
-
$response = new Jetpack_Error( 'unknown_handler', 'Unknown Handler', 400 );
|
3466 |
-
break;
|
3467 |
-
}
|
3468 |
-
|
3469 |
-
if ( ! $response ) {
|
3470 |
-
$response = new Jetpack_Error( 'unknown_error', 'Unknown Error', 400 );
|
3471 |
-
}
|
3472 |
-
|
3473 |
-
if ( is_wp_error( $response ) ) {
|
3474 |
-
$status_code = $response->get_error_data();
|
3475 |
-
$error = $response->get_error_code();
|
3476 |
-
$error_description = $response->get_error_message();
|
3477 |
-
|
3478 |
-
if ( ! is_int( $status_code ) ) {
|
3479 |
-
$status_code = 400;
|
3480 |
-
}
|
3481 |
-
|
3482 |
-
status_header( $status_code );
|
3483 |
-
die( json_encode( (object) compact( 'error', 'error_description' ) ) );
|
3484 |
-
}
|
3485 |
-
|
3486 |
-
status_header( 200 );
|
3487 |
-
if ( true === $response ) {
|
3488 |
-
exit;
|
3489 |
-
}
|
3490 |
-
|
3491 |
-
die( json_encode( (object) $response ) );
|
3492 |
-
}
|
3493 |
-
|
3494 |
-
function upload_handler() {
|
3495 |
-
if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
|
3496 |
-
return new Jetpack_Error( 405, get_status_header_desc( 405 ), 405 );
|
3497 |
-
}
|
3498 |
-
|
3499 |
-
$user = wp_authenticate( '', '' );
|
3500 |
-
if ( ! $user || is_wp_error( $user ) ) {
|
3501 |
-
return new Jetpack_Error( 403, get_status_header_desc( 403 ), 403 );
|
3502 |
-
}
|
3503 |
-
|
3504 |
-
wp_set_current_user( $user->ID );
|
3505 |
-
|
3506 |
-
if ( ! current_user_can( 'upload_files' ) ) {
|
3507 |
-
return new Jetpack_Error( 'cannot_upload_files', 'User does not have permission to upload files', 403 );
|
3508 |
-
}
|
3509 |
-
|
3510 |
-
if ( empty( $_FILES ) ) {
|
3511 |
-
return new Jetpack_Error( 'no_files_uploaded', 'No files were uploaded: nothing to process', 400 );
|
3512 |
-
}
|
3513 |
-
|
3514 |
-
foreach ( array_keys( $_FILES ) as $files_key ) {
|
3515 |
-
if ( ! isset( $_POST["_jetpack_file_hmac_{$files_key}"] ) ) {
|
3516 |
-
return new Jetpack_Error( 'missing_hmac', 'An HMAC for one or more files is missing', 400 );
|
3517 |
-
}
|
3518 |
-
}
|
3519 |
-
|
3520 |
-
$media_keys = array_keys( $_FILES['media'] );
|
3521 |
-
|
3522 |
-
$token = Jetpack_Data::get_access_token( get_current_user_id() );
|
3523 |
-
if ( ! $token || is_wp_error( $token ) ) {
|
3524 |
-
return new Jetpack_Error( 'unknown_token', 'Unknown Jetpack token', 403 );
|
3525 |
-
}
|
3526 |
-
|
3527 |
-
$uploaded_files = array();
|
3528 |
-
$global_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null;
|
3529 |
-
unset( $GLOBALS['post'] );
|
3530 |
-
foreach ( $_FILES['media']['name'] as $index => $name ) {
|
3531 |
-
$file = array();
|
3532 |
-
foreach ( $media_keys as $media_key ) {
|
3533 |
-
$file[$media_key] = $_FILES['media'][$media_key][$index];
|
3534 |
-
}
|
3535 |
-
|
3536 |
-
list( $hmac_provided, $salt ) = explode( ':', $_POST['_jetpack_file_hmac_media'][$index] );
|
3537 |
-
|
3538 |
-
$hmac_file = hash_hmac_file( 'sha1', $file['tmp_name'], $salt . $token->secret );
|
3539 |
-
if ( $hmac_provided !== $hmac_file ) {
|
3540 |
-
$uploaded_files[$index] = (object) array( 'error' => 'invalid_hmac', 'error_description' => 'The corresponding HMAC for this file does not match' );
|
3541 |
-
continue;
|
3542 |
-
}
|
3543 |
-
|
3544 |
-
$_FILES['.jetpack.upload.'] = $file;
|
3545 |
-
$post_id = isset( $_POST['post_id'][$index] ) ? absint( $_POST['post_id'][$index] ) : 0;
|
3546 |
-
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
3547 |
-
$post_id = 0;
|
3548 |
-
}
|
3549 |
-
$attachment_id = media_handle_upload(
|
3550 |
-
'.jetpack.upload.',
|
3551 |
-
$post_id,
|
3552 |
-
array(),
|
3553 |
-
array(
|
3554 |
-
'action' => 'jetpack_upload_file',
|
3555 |
-
)
|
3556 |
-
);
|
3557 |
-
|
3558 |
-
if ( ! $attachment_id ) {
|
3559 |
-
$uploaded_files[$index] = (object) array( 'error' => 'unknown', 'error_description' => 'An unknown problem occurred processing the upload on the Jetpack site' );
|
3560 |
-
} elseif ( is_wp_error( $attachment_id ) ) {
|
3561 |
-
$uploaded_files[$index] = (object) array( 'error' => 'attachment_' . $attachment_id->get_error_code(), 'error_description' => $attachment_id->get_error_message() );
|
3562 |
-
} else {
|
3563 |
-
$attachment = get_post( $attachment_id );
|
3564 |
-
$uploaded_files[$index] = (object) array(
|
3565 |
-
'id' => (string) $attachment_id,
|
3566 |
-
'file' => $attachment->post_title,
|
3567 |
-
'url' => wp_get_attachment_url( $attachment_id ),
|
3568 |
-
'type' => $attachment->post_mime_type,
|
3569 |
-
'meta' => wp_get_attachment_metadata( $attachment_id ),
|
3570 |
-
);
|
3571 |
-
}
|
3572 |
-
}
|
3573 |
-
if ( ! is_null( $global_post ) ) {
|
3574 |
-
$GLOBALS['post'] = $global_post;
|
3575 |
-
}
|
3576 |
-
|
3577 |
-
return $uploaded_files;
|
3578 |
-
}
|
3579 |
-
|
3580 |
-
/**
|
3581 |
-
* Add help to the Jetpack page
|
3582 |
-
*
|
3583 |
-
* @since Jetpack (1.2.3)
|
3584 |
-
* @return false if not the Jetpack page
|
3585 |
-
*/
|
3586 |
-
function admin_help() {
|
3587 |
-
$current_screen = get_current_screen();
|
3588 |
-
|
3589 |
-
// Overview
|
3590 |
-
$current_screen->add_help_tab(
|
3591 |
-
array(
|
3592 |
-
'id' => 'home',
|
3593 |
-
'title' => __( 'Home', 'jetpack' ),
|
3594 |
-
'content' =>
|
3595 |
-
'<p><strong>' . __( 'Jetpack by WordPress.com', 'jetpack' ) . '</strong></p>' .
|
3596 |
-
'<p>' . __( 'Jetpack supercharges your self-hosted WordPress site with the awesome cloud power of WordPress.com.', 'jetpack' ) . '</p>' .
|
3597 |
-
'<p>' . __( 'On this page, you are able to view the modules available within Jetpack, learn more about them, and activate or deactivate them as needed.', 'jetpack' ) . '</p>',
|
3598 |
-
)
|
3599 |
-
);
|
3600 |
-
|
3601 |
-
// Screen Content
|
3602 |
-
if ( current_user_can( 'manage_options' ) ) {
|
3603 |
-
$current_screen->add_help_tab(
|
3604 |
-
array(
|
3605 |
-
'id' => 'settings',
|
3606 |
-
'title' => __( 'Settings', 'jetpack' ),
|
3607 |
-
'content' =>
|
3608 |
-
'<p><strong>' . __( 'Jetpack by WordPress.com', 'jetpack' ) . '</strong></p>' .
|
3609 |
-
'<p>' . __( 'You can activate or deactivate individual Jetpack modules to suit your needs.', 'jetpack' ) . '</p>' .
|
3610 |
-
'<ol>' .
|
3611 |
-
'<li>' . __( 'Each module has an Activate or Deactivate link so you can toggle one individually.', 'jetpack' ) . '</li>' .
|
3612 |
-
'<li>' . __( 'Using the checkboxes next to each module, you can select multiple modules to toggle via the Bulk Actions menu at the top of the list.', 'jetpack' ) . '</li>' .
|
3613 |
-
'</ol>' .
|
3614 |
-
'<p>' . __( 'Using the tools on the right, you can search for specific modules, filter by module categories or which are active, or change the sorting order.', 'jetpack' ) . '</p>'
|
3615 |
-
)
|
3616 |
-
);
|
3617 |
-
}
|
3618 |
-
|
3619 |
-
// Help Sidebar
|
3620 |
-
$current_screen->set_help_sidebar(
|
3621 |
-
'<p><strong>' . __( 'For more information:', 'jetpack' ) . '</strong></p>' .
|
3622 |
-
'<p><a href="http://jetpack.com/faq/" target="_blank">' . __( 'Jetpack FAQ', 'jetpack' ) . '</a></p>' .
|
3623 |
-
'<p><a href="http://jetpack.com/support/" target="_blank">' . __( 'Jetpack Support', 'jetpack' ) . '</a></p>' .
|
3624 |
-
'<p><a href="' . Jetpack::admin_url( array( 'page' => 'jetpack-debugger' ) ) .'">' . __( 'Jetpack Debugging Center', 'jetpack' ) . '</a></p>'
|
3625 |
-
);
|
3626 |
-
}
|
3627 |
-
|
3628 |
-
function admin_menu_css() {
|
3629 |
-
wp_enqueue_style( 'jetpack-icons' );
|
3630 |
-
}
|
3631 |
-
|
3632 |
-
function admin_menu_order() {
|
3633 |
-
return true;
|
3634 |
-
}
|
3635 |
-
|
3636 |
-
function jetpack_menu_order( $menu_order ) {
|
3637 |
-
$jp_menu_order = array();
|
3638 |
-
|
3639 |
-
foreach ( $menu_order as $index => $item ) {
|
3640 |
-
if ( $item != 'jetpack' ) {
|
3641 |
-
$jp_menu_order[] = $item;
|
3642 |
-
}
|
3643 |
-
|
3644 |
-
if ( $index == 0 ) {
|
3645 |
-
$jp_menu_order[] = 'jetpack';
|
3646 |
-
}
|
3647 |
-
}
|
3648 |
-
|
3649 |
-
return $jp_menu_order;
|
3650 |
-
}
|
3651 |
-
|
3652 |
-
function admin_head() {
|
3653 |
-
if ( isset( $_GET['configure'] ) && Jetpack::is_module( $_GET['configure'] ) && current_user_can( 'manage_options' ) )
|
3654 |
-
/** This action is documented in class.jetpack-admin-page.php */
|
3655 |
-
do_action( 'jetpack_module_configuration_head_' . $_GET['configure'] );
|
3656 |
-
}
|
3657 |
-
|
3658 |
-
function admin_banner_styles() {
|
3659 |
-
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
3660 |
-
|
3661 |
-
wp_enqueue_style( 'jetpack', plugins_url( "css/jetpack-banners{$min}.css", JETPACK__PLUGIN_FILE ), false, JETPACK__VERSION . '-20121016' );
|
3662 |
-
wp_style_add_data( 'jetpack', 'rtl', 'replace' );
|
3663 |
-
wp_style_add_data( 'jetpack', 'suffix', $min );
|
3664 |
-
}
|
3665 |
-
|
3666 |
-
function admin_scripts() {
|
3667 |
-
wp_enqueue_script( 'jetpack-js', plugins_url( '_inc/jp.js', JETPACK__PLUGIN_FILE ), array( 'jquery', 'wp-util' ), JETPACK__VERSION . '-20121111' );
|
3668 |
-
wp_localize_script(
|
3669 |
-
'jetpack-js',
|
3670 |
-
'jetpackL10n',
|
3671 |
-
array(
|
3672 |
-
'ays_disconnect' => "This will deactivate all Jetpack modules.\nAre you sure you want to disconnect?",
|
3673 |
-
'ays_unlink' => "This will prevent user-specific modules such as Publicize, Notifications and Post By Email from working.\nAre you sure you want to unlink?",
|
3674 |
-
'ays_dismiss' => "This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?",
|
3675 |
-
)
|
3676 |
-
);
|
3677 |
-
add_action( 'admin_footer', array( $this, 'do_stats' ) );
|
3678 |
-
}
|
3679 |
-
|
3680 |
-
function plugin_action_links( $actions ) {
|
3681 |
-
|
3682 |
-
$jetpack_home = array( 'jetpack-home' => sprintf( '<a href="%s">%s</a>', Jetpack::admin_url( 'page=jetpack' ), __( 'Jetpack', 'jetpack' ) ) );
|
3683 |
-
|
3684 |
-
if( current_user_can( 'jetpack_manage_modules' ) && ( Jetpack::is_active() || Jetpack::is_development_mode() ) ) {
|
3685 |
-
return array_merge(
|
3686 |
-
$jetpack_home,
|
3687 |
-
array( 'settings' => sprintf( '<a href="%s">%s</a>', Jetpack::admin_url( 'page=jetpack_modules' ), __( 'Settings', 'jetpack' ) ) ),
|
3688 |
-
array( 'support' => sprintf( '<a href="%s">%s</a>', Jetpack::admin_url( 'page=jetpack-debugger '), __( 'Support', 'jetpack' ) ) ),
|
3689 |
-
$actions
|
3690 |
-
);
|
3691 |
-
}
|
3692 |
-
|
3693 |
-
return array_merge( $jetpack_home, $actions );
|
3694 |
-
}
|
3695 |
-
|
3696 |
-
function admin_connect_notice() {
|
3697 |
-
// Don't show the connect notice anywhere but the plugins.php after activating
|
3698 |
-
$current = get_current_screen();
|
3699 |
-
if ( 'plugins' !== $current->parent_base )
|
3700 |
-
return;
|
3701 |
-
|
3702 |
-
if ( ! current_user_can( 'jetpack_connect' ) )
|
3703 |
-
return;
|
3704 |
-
|
3705 |
-
$dismiss_and_deactivate_url = wp_nonce_url( Jetpack::admin_url( '?page=jetpack&jetpack-notice=dismiss' ), 'jetpack-deactivate' );
|
3706 |
-
?>
|
3707 |
-
<div id="message" class="updated jetpack-message jp-banner" style="display:block !important;">
|
3708 |
-
<a class="jp-banner__dismiss" href="<?php echo esc_url( $dismiss_and_deactivate_url ); ?>" title="<?php esc_attr_e( 'Dismiss this notice and deactivate Jetpack.', 'jetpack' ); ?>"></a>
|
3709 |
-
<?php if ( in_array( Jetpack_Options::get_option( 'activated' ) , array( 1, 2, 3 ) ) ) : ?>
|
3710 |
-
<div class="jp-banner__content is-connection">
|
3711 |
-
<h2><?php _e( 'Your Jetpack is almost ready!', 'jetpack' ); ?></h2>
|
3712 |
-
<p><?php _e( 'Connect now to enable features like Stats, Likes, and Social Sharing.', 'jetpack' ); ?></p>
|
3713 |
-
</div>
|
3714 |
-
<div class="jp-banner__action-container is-connection">
|
3715 |
-
<a href="<?php echo $this->build_connect_url( false, false, 'banner' ) ?>" class="jp-banner__button" id="wpcom-connect"><?php _e( 'Connect to WordPress.com', 'jetpack' ); ?></a>
|
3716 |
-
</div>
|
3717 |
-
<?php else : ?>
|
3718 |
-
<div class="jp-banner__content">
|
3719 |
-
<h2><?php _e( 'Jetpack is installed!', 'jetpack' ) ?></h2>
|
3720 |
-
<p><?php _e( 'It\'s ready to bring awesome, WordPress.com cloud-powered features to your site.', 'jetpack' ) ?></p>
|
3721 |
-
</div>
|
3722 |
-
<div class="jp-banner__action-container">
|
3723 |
-
<a href="<?php echo Jetpack::admin_url() ?>" class="jp-banner__button" id="wpcom-connect"><?php _e( 'Learn More', 'jetpack' ); ?></a>
|
3724 |
-
</div>
|
3725 |
-
<?php endif; ?>
|
3726 |
-
</div>
|
3727 |
-
|
3728 |
-
<?php
|
3729 |
-
}
|
3730 |
-
|
3731 |
-
/**
|
3732 |
-
* This is the first banner
|
3733 |
-
* It should be visible only to user that can update the option
|
3734 |
-
* Are not connected
|
3735 |
-
*
|
3736 |
-
* @return null
|
3737 |
-
*/
|
3738 |
-
function admin_jetpack_manage_notice() {
|
3739 |
-
$screen = get_current_screen();
|
3740 |
-
|
3741 |
-
// Don't show the connect notice on the jetpack settings page.
|
3742 |
-
if ( ! in_array( $screen->base, array( 'dashboard' ) ) || $screen->is_network || $screen->action )
|
3743 |
-
return;
|
3744 |
-
|
3745 |
-
// Only show it if don't have the managment option set.
|
3746 |
-
// And not dismissed it already.
|
3747 |
-
if ( ! $this->can_display_jetpack_manage_notice() || Jet
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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