<?php
/**
* File loaded when the plugin cannot be activated.
*
* All code in this file should be compatible with PHP 5.2 or later.
*
* @package Code_Snippets
*
* @noinspection PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection
*
* phpcs:disable Modernize.FunctionCalls.Dirname.FileConstant
*/
if ( ! defined( 'ABSPATH' ) || function_exists( 'code_snippets_deactivation_notice' ) ) {
return;
}
/**
* Deactivate the plugin and display a notice informing the user that this has happened.
*
* @return void
*
* @since 3.3.0
*/
function code_snippets_deactivation_notice() {
$plugins = array();
$required_php_version = '7.4';
if ( version_compare( phpversion(), $required_php_version, '<' ) ) {
echo '<div class="error fade"><p><strong>';
// translators: %s: required PHP version number.
echo esc_html( sprintf( __( 'Code Snippets requires PHP %s or later.', 'code-snippets' ), $required_php_version ) );
echo '</strong><br>';
$update_url = function_exists( 'wp_get_default_update_php_url' ) ?
wp_get_default_update_php_url() :
'https://wordpress.org/support/update-php/';
// translators: %s: Update PHP URL.
$text = __( 'Please <a href="%s">upgrade your server to the latest version of PHP</a> to continue using Code Snippets.', 'code-snippets' );
echo wp_kses( sprintf( $text, $update_url ), array( 'a' => array( 'href' => array() ) ) );
echo '</p></div>';
$plugins[] = plugin_basename( dirname( dirname( __FILE__ ) ) . '/code-snippets.php' );
}
if ( defined( 'CODE_SNIPPETS_FILE' ) ) {
echo '<div class="error fade"><p>';
esc_html_e( 'Another version of Code Snippets appears to be installed. Deactivating this version.', 'code-snippets' );
echo '</p></div>';
$plugins[] = 'code-snippets/code-snippets.php';
}
if ( $plugins ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
deactivate_plugins( array_unique( $plugins ) );
}
}
add_action( 'admin_notices', 'code_snippets_deactivation_notice' );
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| admin-menus/ | 2026-07-30 21:37 | 28.18 KB | 76129f60960:kunden | dxwrx-r--r | |
| cloud/ | 2026-07-30 21:37 | 41.72 KB | 76129f60960:kunden | dxwrx-r--r | |
| evaluation/ | 2026-07-30 21:37 | 9.05 KB | 76129f60960:kunden | dxwrx-r--r | |
| export/ | 2026-07-30 21:37 | 11.41 KB | 76129f60960:kunden | dxwrx-r--r | |
| flat-files/ | 2026-07-30 21:37 | 24.48 KB | 76129f60960:kunden | dxwrx-r--r | |
| front-end/ | 2026-07-30 21:37 | 15.83 KB | 76129f60960:kunden | dxwrx-r--r | |
| migration/ | 2026-07-30 21:37 | 25.78 KB | 76129f60960:kunden | dxwrx-r--r | |
| rest-api/ | 2026-07-30 21:37 | 22.67 KB | 76129f60960:kunden | dxwrx-r--r | |
| settings/ | 2026-07-30 21:37 | 41.32 KB | 76129f60960:kunden | dxwrx-r--r | |
| views/ | 2026-07-30 21:37 | 18.36 KB | 76129f60960:kunden | dxwrx-r--r | |
| class-admin.php | 2026-07-30 21:37 | 12 KB | 76129f60960:kunden | -xw-x----- | |
| class-contextual-help.php | 2026-07-30 21:37 | 6.46 KB | 76129f60960:kunden | -xw-x----- | |
| class-data-item.php | 2026-07-30 21:37 | 6.56 KB | 76129f60960:kunden | -xw-x----- | |
| class-db.php | 2026-07-30 21:37 | 10.12 KB | 76129f60960:kunden | -xw-x----- | |
| class-licensing.php | 2026-07-30 21:37 | 314 B | 76129f60960:kunden | -xw-x----- | |
| class-list-table.php | 2026-07-30 21:37 | 43.83 KB | 76129f60960:kunden | -xw-x----- | |
| class-plugin.php | 2026-07-30 21:37 | 11.08 KB | 76129f60960:kunden | -xw-x----- | |
| class-snippet.php | 2026-07-30 21:37 | 13.88 KB | 76129f60960:kunden | -xw-x----- | |
| class-upgrade.php | 2026-07-30 21:37 | 6.55 KB | 76129f60960:kunden | -xw-x----- | |
| class-validator.php | 2026-07-30 21:37 | 7.02 KB | 76129f60960:kunden | -xw-x----- | |
| class-welcome-api.php | 2026-07-30 21:37 | 9.53 KB | 76129f60960:kunden | -xw-x----- | |
| deactivation-notice.php | 2026-07-30 21:37 | 1.94 KB | 76129f60960:kunden | -xw-x----- | |
| editor.php | 2026-07-30 21:37 | 3.48 KB | 76129f60960:kunden | -xw-x----- | |
| load.php | 2026-07-30 21:37 | 2.16 KB | 76129f60960:kunden | -xw-x----- | |
| snippet-ops.php | 2026-07-30 21:37 | 20.99 KB | 76129f60960:kunden | -xw-x----- | |
| strings.php | 2026-07-30 21:37 | 1.8 KB | 76129f60960:kunden | -xw-x----- | |
| uninstall.php | 2026-07-30 21:37 | 2.54 KB | 76129f60960:kunden | -xw-x----- | |