Completed
Push — merge/infinite-scroll-20160302 ( bee69d )
by
unknown
09:01
created

jetpack.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * Plugin Name: Jetpack by WordPress.com
5
 * Plugin URI: http://jetpack.me
6
 * Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.
7
 * Author: Automattic
8
 * Version: 3.9.2
9
 * Author URI: http://jetpack.me
10
 * License: GPL2+
11
 * Text Domain: jetpack
12
 * Domain Path: /languages/
13
 */
14
15
define( 'JETPACK__MINIMUM_WP_VERSION', '4.3' );
16
17
define( 'JETPACK__VERSION',            '3.9.2' );
18
define( 'JETPACK_MASTER_USER',         true );
19
define( 'JETPACK__API_VERSION',        1 );
20
define( 'JETPACK__PLUGIN_DIR',         plugin_dir_path( __FILE__ ) );
21
define( 'JETPACK__PLUGIN_FILE',        __FILE__ );
22
23
defined( 'JETPACK_CLIENT__AUTH_LOCATION' )   or define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );
24
defined( 'JETPACK_CLIENT__HTTPS' )           or define( 'JETPACK_CLIENT__HTTPS', 'AUTO' );
25
defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) or define( 'JETPACK__GLOTPRESS_LOCALES_PATH', JETPACK__PLUGIN_DIR . 'locales.php' );
26
defined( 'JETPACK__API_BASE' )               or define( 'JETPACK__API_BASE', 'https://jetpack.wordpress.com/jetpack.' );
0 ignored issues
show
Comprehensibility Best Practice introduced by
Using logical operators such as or instead of || is generally not recommended.

PHP has two types of connecting operators (logical operators, and boolean operators):

  Logical Operators Boolean Operator
AND - meaning and &&
OR - meaning or ||

The difference between these is the order in which they are executed. In most cases, you would want to use a boolean operator like &&, or ||.

Let’s take a look at a few examples:

// Logical operators have lower precedence:
$f = false or true;

// is executed like this:
($f = false) or true;


// Boolean operators have higher precedence:
$f = false || true;

// is executed like this:
$f = (false || true);

Logical Operators are used for Control-Flow

One case where you explicitly want to use logical operators is for control-flow such as this:

$x === 5
    or die('$x must be 5.');

// Instead of
if ($x !== 5) {
    die('$x must be 5.');
}

Since die introduces problems of its own, f.e. it makes our code hardly testable, and prevents any kind of more sophisticated error handling; you probably do not want to use this in real-world code. Unfortunately, logical operators cannot be combined with throw at this point:

// The following is currently a parse error.
$x === 5
    or throw new RuntimeException('$x must be 5.');

These limitations lead to logical operators rarely being of use in current PHP code.

Loading history...
27
defined( 'JETPACK_PROTECT__API_HOST' )       or define( 'JETPACK_PROTECT__API_HOST', 'https://api.bruteprotect.com/' );
28
defined( 'JETPACK__WPCOM_JSON_API_HOST' )    or define( 'JETPACK__WPCOM_JSON_API_HOST', 'public-api.wordpress.com' );
29
30
// @todo: Abstract out the admin functions, and only include them if is_admin()
31
// @todo: Only include things like class.jetpack-sync.php if we're connected.
32
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack.php'               );
33
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-network.php'       );
34
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client.php'        );
35
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-data.php'          );
36
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php' );
37
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-sync.php'          );
38
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-options.php'       );
39
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php'    );
40
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php'   );
41
require_once( JETPACK__PLUGIN_DIR . 'class.media-extractor.php'       );
42
require_once( JETPACK__PLUGIN_DIR . 'class.media-summary.php'         );
43
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-error.php'         );
44
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-debugger.php'      );
45
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php'     );
46
require_once( JETPACK__PLUGIN_DIR . 'class.photon.php'                );
47
require_once( JETPACK__PLUGIN_DIR . 'functions.photon.php'            );
48
require_once( JETPACK__PLUGIN_DIR . 'functions.compat.php'            );
49
require_once( JETPACK__PLUGIN_DIR . 'functions.gallery.php'           );
50
require_once( JETPACK__PLUGIN_DIR . 'require-lib.php'                 );
51
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-autoupdate.php'    );
52
require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-tracks.php'        );
53
require_once( JETPACK__PLUGIN_DIR . 'modules/module-headings.php');
54
55
if ( is_admin() ) {
56
	require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'     );
57
	require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-jitm.php'      );
58
}
59
60
// Play nice with http://wp-cli.org/
61
if ( defined( 'WP_CLI' ) && WP_CLI ) {
62
	require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-cli.php'       );
63
}
64
65
register_activation_hook( __FILE__, array( 'Jetpack', 'plugin_activation' ) );
66
register_deactivation_hook( __FILE__, array( 'Jetpack', 'plugin_deactivation' ) );
67
add_action( 'updating_jetpack_version', array( 'Jetpack', 'do_version_bump' ), 10, 2 );
68
add_action( 'init', array( 'Jetpack', 'init' ) );
69
add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 );
70
add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) );
71
add_filter( 'is_jetpack_site', '__return_true' );
72
73
/**
74
 * Add an easy way to photon-ize a URL that is safe to call even if Jetpack isn't active.
75
 *
76
 * See: http://jetpack.me/2013/07/11/photon-and-themes/
77
 */
78
if ( Jetpack::is_module_active( 'photon' ) ) {
79
	add_filter( 'jetpack_photon_url', 'jetpack_photon_url', 10, 3 );
80
}
81
82
/*
83
if ( is_admin() && ! Jetpack::check_identity_crisis() ) {
84
	Jetpack_Sync::sync_options( __FILE__, 'db_version', 'jetpack_active_modules', 'active_plugins' );
85
}
86
*/
87
88
require_once( JETPACK__PLUGIN_DIR . '3rd-party/3rd-party.php' );
89