Edit File by line
/home/barbar84/www/wp-conte.../plugins/nginx-he...
File: nginx-helper.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin Name: Nginx Helper
[2] Fix | Delete
* Plugin URI: https://rtcamp.com/nginx-helper/
[3] Fix | Delete
* Description: Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also does few more things.
[4] Fix | Delete
* Version: 2.2.2
[5] Fix | Delete
* Author: rtCamp
[6] Fix | Delete
* Author URI: https://rtcamp.com
[7] Fix | Delete
* Text Domain: nginx-helper
[8] Fix | Delete
* Domain Path: /languages
[9] Fix | Delete
* Requires at least: 3.0
[10] Fix | Delete
* Tested up to: 5.4
[11] Fix | Delete
*
[12] Fix | Delete
* @link https://rtcamp.com/nginx-helper/
[13] Fix | Delete
* @since 2.0.0
[14] Fix | Delete
* @package nginx-helper
[15] Fix | Delete
*/
[16] Fix | Delete
[17] Fix | Delete
// If this file is called directly, abort.
[18] Fix | Delete
if ( ! defined( 'WPINC' ) ) {
[19] Fix | Delete
die;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Base URL of plugin
[24] Fix | Delete
*/
[25] Fix | Delete
if ( ! defined( 'NGINX_HELPER_BASEURL' ) ) {
[26] Fix | Delete
define( 'NGINX_HELPER_BASEURL', plugin_dir_url( __FILE__ ) );
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* Base Name of plugin
[31] Fix | Delete
*/
[32] Fix | Delete
if ( ! defined( 'NGINX_HELPER_BASENAME' ) ) {
[33] Fix | Delete
define( 'NGINX_HELPER_BASENAME', plugin_basename( __FILE__ ) );
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Base PATH of plugin
[38] Fix | Delete
*/
[39] Fix | Delete
if ( ! defined( 'NGINX_HELPER_BASEPATH' ) ) {
[40] Fix | Delete
define( 'NGINX_HELPER_BASEPATH', plugin_dir_path( __FILE__ ) );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* The code that runs during plugin activation.
[45] Fix | Delete
* This action is documented in includes/class-nginx-helper-activator.php
[46] Fix | Delete
*/
[47] Fix | Delete
function activate_nginx_helper() {
[48] Fix | Delete
require_once NGINX_HELPER_BASEPATH . 'includes/class-nginx-helper-activator.php';
[49] Fix | Delete
Nginx_Helper_Activator::activate();
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
/**
[53] Fix | Delete
* The code that runs during plugin deactivation.
[54] Fix | Delete
* This action is documented in includes/class-nginx-helper-deactivator.php
[55] Fix | Delete
*/
[56] Fix | Delete
function deactivate_nginx_helper() {
[57] Fix | Delete
require_once NGINX_HELPER_BASEPATH . 'includes/class-nginx-helper-deactivator.php';
[58] Fix | Delete
Nginx_Helper_Deactivator::deactivate();
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
register_activation_hook( __FILE__, 'activate_nginx_helper' );
[62] Fix | Delete
register_deactivation_hook( __FILE__, 'deactivate_nginx_helper' );
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* The core plugin class that is used to define internationalization,
[66] Fix | Delete
* admin-specific hooks, and public-facing site hooks.
[67] Fix | Delete
*/
[68] Fix | Delete
require NGINX_HELPER_BASEPATH . 'includes/class-nginx-helper.php';
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* Begins execution of the plugin.
[72] Fix | Delete
*
[73] Fix | Delete
* Since everything within the plugin is registered via hooks,
[74] Fix | Delete
* then kicking off the plugin from this point in the file does
[75] Fix | Delete
* not affect the page life cycle.
[76] Fix | Delete
*
[77] Fix | Delete
* @since 2.0.0
[78] Fix | Delete
*/
[79] Fix | Delete
function run_nginx_helper() {
[80] Fix | Delete
[81] Fix | Delete
global $nginx_helper;
[82] Fix | Delete
[83] Fix | Delete
$nginx_helper = new Nginx_Helper();
[84] Fix | Delete
$nginx_helper->run();
[85] Fix | Delete
[86] Fix | Delete
// Load WP-CLI command.
[87] Fix | Delete
if ( defined( 'WP_CLI' ) && WP_CLI ) {
[88] Fix | Delete
[89] Fix | Delete
require_once NGINX_HELPER_BASEPATH . 'class-nginx-helper-wp-cli-command.php';
[90] Fix | Delete
\WP_CLI::add_command( 'nginx-helper', 'Nginx_Helper_WP_CLI_Command' );
[91] Fix | Delete
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
}
[95] Fix | Delete
run_nginx_helper();
[96] Fix | Delete
[97] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function