73 lines
3.3 KiB
PHP
73 lines
3.3 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Telemetry disabler (by ROBOTSTXT)
|
|
* Plugin URI: https://www.robotstxt.software/plugins/robotstxt-telemetry/
|
|
* Update URI: https://www.robotstxt.software/plugins/robotstxt-telemetry/
|
|
* Description: Reduces the telemetry WordPress sends out and logs every outbound HTTP request, so your site shares less and you can see everything.
|
|
* Version: 1.1.4
|
|
* Author: ROBOTSTXT
|
|
* Author URI: https://www.robotstxt.software/
|
|
* Text Domain: robotstxt-telemetry
|
|
* Domain Path: /languages
|
|
* Requires at least: 4.0
|
|
* Requires PHP: 5.6
|
|
* Tested up to: 7.1
|
|
* Network: true
|
|
* License: GPL-3.0-or-later
|
|
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
|
*
|
|
* @package RobotstxtTelemetry
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
define( 'ROBOTSTXT_TELEMETRY_VERSION', '1.1.4' );
|
|
define( 'ROBOTSTXT_TELEMETRY_DB_VERSION', '1.1.0' );
|
|
define( 'ROBOTSTXT_TELEMETRY_PLUGIN_FILE', __FILE__ );
|
|
define( 'ROBOTSTXT_TELEMETRY_PLUGIN_DIR', __DIR__ );
|
|
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-network.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-endpoints.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-db.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-logger.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-admin.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-manager-notice.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-wordpress-api.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-plugin-profiles.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-plugin-guards.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-analysis.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry-analysis-api-wordpress-org.php';
|
|
require_once ROBOTSTXT_TELEMETRY_PLUGIN_DIR . '/includes/class-robotstxt-telemetry.php';
|
|
|
|
register_activation_hook( __FILE__, array( 'Robotstxt_Telemetry_DB', 'activate' ) );
|
|
register_deactivation_hook( __FILE__, array( 'Robotstxt_Telemetry', 'deactivate' ) );
|
|
|
|
if ( ! function_exists( 'wp_json_encode' ) ) {
|
|
/**
|
|
* Encode a JSON string (compatibility shim for WordPress 4.0).
|
|
*
|
|
* @param mixed $data Data to encode.
|
|
* @param int $options JSON encode flags.
|
|
* @return string|false
|
|
*/
|
|
function wp_json_encode( $data, $options = 0 ) {
|
|
return json_encode( $data, $options ); // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode -- Native call is the purpose of this compatibility shim for WordPress 4.0.
|
|
}
|
|
}
|
|
|
|
if ( ! function_exists( 'wp_parse_url' ) ) {
|
|
/**
|
|
* Parse a URL (compatibility shim for WordPress 4.0 - 4.3).
|
|
*
|
|
* @param string $url The URL to parse.
|
|
* @param int $component The specific component to retrieve.
|
|
* @return mixed
|
|
*/
|
|
function wp_parse_url( $url, $component = -1 ) {
|
|
return parse_url( $url, $component ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- Native call is the purpose of this compatibility shim for WordPress 4.0 - 4.3.
|
|
}
|
|
}
|
|
|
|
Robotstxt_Telemetry::init();
|