| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * Plugin Name: Jetpack by WordPress.com |
| 5 | 5 | * Plugin URI: http://jetpack.com |
| 6 | 6 | * Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users. |
| 7 | 7 | * Author: Automattic |
| 8 | - * Version: 4.3.5 | |
| 8 | + * Version: 4.4.5 | |
| 9 | 9 | * Author URI: http://jetpack.com |
| 10 | 10 | * License: GPL2+ |
| 11 | 11 | * Text Domain: jetpack |
| 12 | 12 | * Domain Path: /languages/ |
| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | define( 'JETPACK__MINIMUM_WP_VERSION', '4.5' ); |
| 16 | 16 | |
| 17 | -define( 'JETPACK__VERSION', '4.3.5' ); | |
| 17 | +define( 'JETPACK__VERSION', '4.4.5' ); | |
| 18 | 18 | define( 'JETPACK_MASTER_USER', true ); |
| 19 | 19 | define( 'JETPACK__API_VERSION', 1 ); |
| 20 | 20 | define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 21 | 21 | define( 'JETPACK__PLUGIN_FILE', __FILE__ ); |
| @@ -26,9 +26,34 @@ | ||
| 26 | 26 | defined( 'JETPACK__API_BASE' ) or define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' ); |
| 27 | 27 | defined( 'JETPACK_PROTECT__API_HOST' ) or define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' ); |
| 28 | 28 | defined( 'JETPACK__WPCOM_JSON_API_HOST' ) or define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' ); |
| 29 | 29 | |
| 30 | +add_filter( 'rest_url_prefix', 'jetpack_index_permalinks_rest_api_url', 999 ); | |
| 30 | 31 | /** |
| 32 | + * Fix the REST API URL for sites using index permalinks | |
| 33 | + * | |
| 34 | + * @todo Remove when 4.7 is minimum version | |
| 35 | + * @see https://core.trac.wordpress.org/ticket/38182 | |
| 36 | + * @see https://github.com/Automattic/jetpack/issues/5216 | |
| 37 | + * @author kraftbj | |
| 38 | + * | |
| 39 | + * @param string $prefix REST API endpoint URL base prefix. | |
| 40 | + * | |
| 41 | + * @return string | |
| 42 | + */ | |
| 43 | +function jetpack_index_permalinks_rest_api_url( $prefix ){ | |
| 44 | + global $wp_rewrite, $wp_version; | |
| 45 | + if ( version_compare( $wp_version, '4.7-alpha-38790', '<' ) | |
| 46 | + && isset( $wp_rewrite ) && $wp_rewrite instanceof WP_Rewrite | |
| 47 | + && method_exists( $wp_rewrite, 'using_index_permalinks' ) | |
| 48 | + && $wp_rewrite->using_index_permalinks() ) { | |
| 49 | + $prefix = $wp_rewrite->index . '/' . $prefix; | |
| 50 | + } | |
| 51 | + | |
| 52 | + return $prefix; | |
| 53 | +} | |
| 54 | + | |
| 55 | +/** | |
| 31 | 56 | * Returns the location of Jetpack's lib directory. This filter is applied |
| 32 | 57 | * in require_lib(). |
| 33 | 58 | * |
| 34 | 59 | * @since 4.0.2 |
| @@ -63,8 +88,11 @@ | ||
| 63 | 88 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php' ); |
| 64 | 89 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-tracks.php' ); |
| 65 | 90 | require_once( JETPACK__PLUGIN_DIR . 'class.frame-nonce-preview.php' ); |
| 66 | 91 | require_once( JETPACK__PLUGIN_DIR . 'modules/module-headings.php'); |
| 92 | +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-constants.php'); | |
| 93 | +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-idc.php' ); | |
| 94 | +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-connection-banner.php' ); | |
| 67 | 95 | |
| 68 | 96 | if ( is_admin() ) { |
| 69 | 97 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' ); |
| 70 | 98 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-jitm.php' ); |
| @@ -94,14 +122,8 @@ | ||
| 94 | 122 | */ |
| 95 | 123 | if ( Jetpack::is_module_active( 'photon' ) ) { |
| 96 | 124 | add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 ); |
| 97 | 125 | } |
| 98 | - | |
| 99 | -/* | |
| 100 | -if ( is_admin() && ! Jetpack::check_identity_crisis() ) { | |
| 101 | - Jetpack_Sync::sync_options( __FILE__, 'db_version', 'jetpack_active_modules', 'active_plugins' ); | |
| 102 | -} | |
| 103 | -*/ | |
| 104 | 126 | |
| 105 | 127 | require_once( JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php' ); |
| 106 | 128 | |
| 107 | 129 | Jetpack::init(); |