As the sun rises and the forest mist clears, and the clouds return and the caves darken, these changes of light and shadow are the morning and evening in the mountains. Wildflowers bloom with their subtle fragrance, fine trees flourish with their dense shade, the wind and frost are pure and clean, and the water recedes to reveal the rocks—these are the four seasons in the mountains. Going out in the morning and returning in the evening, the scenery of the four seasons is different, and the joy is endless.至于负者歌于途,行者休于树,前者呼,后者应,伛偻提携,往来而不绝者,滁人游也。临溪而渔,溪深而鱼肥,酿泉为酒,泉香而酒洌,山肴野蔌,杂然而前陈者,太守宴也。宴酣之乐,非丝非竹,射者中,弈者胜,觥筹交错,起坐而喧哗者,众宾欢也。苍颜白发,颓然乎其间者,太守醉也。
<?php
/**
* Plugin Name: Hostinger Smart Auto Updates
* Plugin URI: https://www.hostinger.com
* Description: Faster and more secure updates for your themes, plugins, and core files. Managed entirely by Hostinger.
* Version: 1.0.7
* Author: Hostinger
* Author URI: https://www.hostinger.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: hostinger-auto-updates
* Domain Path: /languages
* Requires at least: 5.0
* Requires PHP: 7.4
* Network: true
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Disable automatic updates
*/
add_filter( 'automatic_updater_disabled', '__return_true' ); // Core updates
add_filter( 'auto_update_theme', '__return_false' ); // Theme updates
add_filter( 'auto_update_plugin', '__return_false' ); // Plugin updates
/**
* Use Hostinger's proxy services for WordPress.org API and download requests.
*
* @param mixed $response_override Response to replace with.
* @param array $args HTTP request arguments.
* @param string $url Request URL.
* @return mixed
*/
if ( ! function_exists( 'hostinger_use_proxy_services' ) ) {
function hostinger_use_proxy_services( $response_override, $args, $url ) {
$proxy_domains = [
'api.wordpress.org' => 'wpapi.hostinger.io',
'downloads.wordpress.org' => 'wpdownloads.hostinger.io',
];
foreach ( $proxy_domains as $original_domain => $proxy_domain ) {
if ( strpos( $url, $original_domain ) !== false ) {
$proxy_url = str_replace( $original_domain, $proxy_domain, $url );
$response = wp_remote_request( $proxy_url, $args );
return $response;
}
}
return $response_override;
}
}
add_filter( 'pre_http_request', 'hostinger_use_proxy_services', 10, 3 );
/**
* Modify the default auto-update tests.
*
* @param array $tests The array of site status tests.
* @return array Modified array of site status tests.
*/
if ( ! function_exists( 'hostinger_change_default_autoupdates_test' ) ) {
function hostinger_change_default_autoupdates_test( $tests ) {
// Remove default auto-update tests
unset( $tests['async']['background_updates'] );
unset( $tests['direct']['plugin_theme_auto_updates'] );
// Add a new test to indicate Hostinger manages updates
$tests['direct']['hostinger_plugin_theme_auto_updates'] = [
'label' => __( 'Auto-updates managed by Hostinger' ),
'test' => function () {
$result = [
'label' => __( 'Automatic updates managed by Hostinger' ),
'status' => 'good',
'badge' => [
'label' => __( 'Security' ),
'color' => 'blue',
],
'description' => __( 'Automatic updates ensure your site is always running the latest and most secure versions of WordPress, plugins, and themes.' ),
'actions' => '',
'test' => 'hostinger_managed_updates',
];
return $result;
},
];
return $tests;
}
}
add_filter( 'site_status_tests', 'hostinger_change_default_autoupdates_test' );