Edit File by line
/home/zeestwma/ajeebong.../wp-conte.../plugins/code-sni.../php
File: deactivation-notice.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* File loaded when the plugin cannot be activated.
[2] Fix | Delete
*
[3] Fix | Delete
* All code in this file should be compatible with PHP 5.2 or later.
[4] Fix | Delete
*
[5] Fix | Delete
* @package Code_Snippets
[6] Fix | Delete
*
[7] Fix | Delete
* @noinspection PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection
[8] Fix | Delete
*
[9] Fix | Delete
* phpcs:disable Modernize.FunctionCalls.Dirname.FileConstant
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
if ( ! defined( 'ABSPATH' ) || function_exists( 'code_snippets_deactivation_notice' ) ) {
[13] Fix | Delete
return;
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
/**
[17] Fix | Delete
* Deactivate the plugin and display a notice informing the user that this has happened.
[18] Fix | Delete
*
[19] Fix | Delete
* @return void
[20] Fix | Delete
*
[21] Fix | Delete
* @since 3.3.0
[22] Fix | Delete
*/
[23] Fix | Delete
function code_snippets_deactivation_notice() {
[24] Fix | Delete
$plugins = array();
[25] Fix | Delete
$required_php_version = '7.4';
[26] Fix | Delete
[27] Fix | Delete
if ( version_compare( phpversion(), $required_php_version, '<' ) ) {
[28] Fix | Delete
echo '<div class="error fade"><p><strong>';
[29] Fix | Delete
// translators: %s: required PHP version number.
[30] Fix | Delete
echo esc_html( sprintf( __( 'Code Snippets requires PHP %s or later.', 'code-snippets' ), $required_php_version ) );
[31] Fix | Delete
echo '</strong><br>';
[32] Fix | Delete
[33] Fix | Delete
$update_url = function_exists( 'wp_get_default_update_php_url' ) ?
[34] Fix | Delete
wp_get_default_update_php_url() :
[35] Fix | Delete
'https://wordpress.org/support/update-php/';
[36] Fix | Delete
[37] Fix | Delete
// translators: %s: Update PHP URL.
[38] Fix | Delete
$text = __( 'Please <a href="%s">upgrade your server to the latest version of PHP</a> to continue using Code Snippets.', 'code-snippets' );
[39] Fix | Delete
[40] Fix | Delete
echo wp_kses( sprintf( $text, $update_url ), array( 'a' => array( 'href' => array() ) ) );
[41] Fix | Delete
echo '</p></div>';
[42] Fix | Delete
[43] Fix | Delete
$plugins[] = plugin_basename( dirname( dirname( __FILE__ ) ) . '/code-snippets.php' );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
if ( defined( 'CODE_SNIPPETS_FILE' ) ) {
[47] Fix | Delete
echo '<div class="error fade"><p>';
[48] Fix | Delete
esc_html_e( 'Another version of Code Snippets appears to be installed. Deactivating this version.', 'code-snippets' );
[49] Fix | Delete
echo '</p></div>';
[50] Fix | Delete
[51] Fix | Delete
$plugins[] = 'code-snippets/code-snippets.php';
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
if ( $plugins ) {
[55] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[56] Fix | Delete
deactivate_plugins( array_unique( $plugins ) );
[57] Fix | Delete
}
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
add_action( 'admin_notices', 'code_snippets_deactivation_notice' );
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function