| @@ -9,11 +9,11 @@ | ||
| 9 | 9 | * @wordpress-plugin |
| 10 | 10 | * Plugin Name: Polylang |
| 11 | 11 | * Plugin URI: https://polylang.pro |
| 12 | 12 | * Description: Adds multilingual capability to WordPress |
| 13 | - * Version: 3.8.7 | |
| 14 | - * Requires at least: 6.5 | |
| 15 | - * Requires PHP: 7.4 | |
| 13 | + * Version: 3.7.1 | |
| 14 | + * Requires at least: 6.2 | |
| 15 | + * Requires PHP: 7.2 | |
| 16 | 16 | * Author: WP SYNTEX |
| 17 | 17 | * Author URI: https://polylang.pro |
| 18 | 18 | * Text Domain: polylang |
| 19 | 19 | * License: GPL v3 or later |
| @@ -19,9 +19,9 @@ | ||
| 19 | 19 | * License: GPL v3 or later |
| 20 | 20 | * License URI: https://www.gnu.org/licenses/gpl-3.0.txt |
| 21 | 21 | * |
| 22 | 22 | * Copyright 2011-2019 Frédéric Demarle |
| 23 | - * Copyright 2019-2026 WP SYNTEX | |
| 23 | + * Copyright 2019-2025 WP SYNTEX | |
| 24 | 24 | * |
| 25 | 25 | * This program is free software: you can redistribute it and/or modify |
| 26 | 26 | * it under the terms of the GNU General Public License as published by |
| 27 | 27 | * the Free Software Foundation, either version 3 of the License, or |
| @@ -35,15 +35,16 @@ | ||
| 35 | 35 | * You should have received a copy of the GNU General Public License |
| 36 | 36 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | -defined( 'ABSPATH' ) || exit; | |
| 39 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 40 | + exit; // Don't access directly. | |
| 41 | +} | |
| 40 | 42 | |
| 41 | 43 | if ( defined( 'POLYLANG_VERSION' ) ) { |
| 42 | 44 | // The user is attempting to activate a second plugin instance, typically Polylang and Polylang Pro. |
| 43 | 45 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 44 | 46 | require_once ABSPATH . 'wp-includes/pluggable.php'; |
| 45 | - | |
| 46 | 47 | if ( is_plugin_active( plugin_basename( __FILE__ ) ) ) { |
| 47 | 48 | deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate this plugin. |
| 48 | 49 | // WP does not allow us to send a custom meaningful message, so just tell the plugin has been deactivated. |
| 49 | 50 | wp_safe_redirect( add_query_arg( 'deactivate', 'true', remove_query_arg( 'activate' ) ) ); |
| @@ -48,47 +49,29 @@ | ||
| 48 | 49 | // WP does not allow us to send a custom meaningful message, so just tell the plugin has been deactivated. |
| 49 | 50 | wp_safe_redirect( add_query_arg( 'deactivate', 'true', remove_query_arg( 'activate' ) ) ); |
| 50 | 51 | exit; |
| 51 | 52 | } |
| 52 | - return; | |
| 53 | -} | |
| 53 | +} else { | |
| 54 | + // Go on loading the plugin | |
| 55 | + define( 'POLYLANG_VERSION', '3.7.1' ); | |
| 56 | + define( 'PLL_MIN_WP_VERSION', '6.2' ); | |
| 57 | + define( 'PLL_MIN_PHP_VERSION', '7.2' ); | |
| 54 | 58 | |
| 55 | -// Go on loading the plugin. | |
| 56 | -define( 'POLYLANG_VERSION', '3.8.7' ); | |
| 57 | -define( 'PLL_MIN_WP_VERSION', '6.5' ); | |
| 58 | -define( 'PLL_MIN_PHP_VERSION', '7.4' ); | |
| 59 | + define( 'POLYLANG_FILE', __FILE__ ); | |
| 60 | + define( 'POLYLANG_DIR', __DIR__ ); | |
| 59 | 61 | |
| 60 | -define( 'POLYLANG_FILE', __FILE__ ); | |
| 61 | -define( 'POLYLANG_DIR', __DIR__ ); | |
| 62 | + // Whether we are using Polylang or Polylang Pro, get the filename of the plugin in use. | |
| 63 | + if ( ! defined( 'POLYLANG_ROOT_FILE' ) ) { | |
| 64 | + define( 'POLYLANG_ROOT_FILE', __FILE__ ); | |
| 65 | + } | |
| 62 | 66 | |
| 63 | -// Whether we are using Polylang or Polylang Pro, get the filename of the plugin in use. | |
| 64 | -if ( ! defined( 'POLYLANG_ROOT_FILE' ) ) { | |
| 65 | - define( 'POLYLANG_ROOT_FILE', __FILE__ ); | |
| 66 | -} | |
| 67 | + if ( ! defined( 'POLYLANG_BASENAME' ) ) { | |
| 68 | + define( 'POLYLANG_BASENAME', plugin_basename( __FILE__ ) ); // Plugin name as known by WP. | |
| 69 | + require __DIR__ . '/vendor/autoload.php'; | |
| 70 | + } | |
| 67 | 71 | |
| 68 | -if ( ! defined( 'POLYLANG_BASENAME' ) ) { | |
| 69 | - define( 'POLYLANG_BASENAME', plugin_basename( __FILE__ ) ); // Plugin name as known by WP. | |
| 70 | - require __DIR__ . '/vendor/autoload.php'; | |
| 71 | -} | |
| 72 | + define( 'POLYLANG', ucwords( str_replace( '-', ' ', dirname( POLYLANG_BASENAME ) ) ) ); | |
| 72 | 73 | |
| 73 | -define( 'POLYLANG', ucwords( str_replace( '-', ' ', dirname( POLYLANG_BASENAME ) ) ) ); | |
| 74 | - | |
| 75 | -if ( ! empty( $_GET['deactivate-polylang'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 76 | - return; | |
| 74 | + if ( empty( $_GET['deactivate-polylang'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification | |
| 75 | + new Polylang(); | |
| 76 | + } | |
| 77 | 77 | } |
| 78 | - | |
| 79 | -require POLYLANG_DIR . '/src/constant-functions.php'; | |
| 80 | -if ( ! PLL_Usable::can_activate() ) { | |
| 81 | - // WP version or php version is too old. | |
| 82 | - return; | |
| 83 | -} | |
| 84 | - | |
| 85 | -define( 'POLYLANG_ACTIVE', true ); | |
| 86 | - | |
| 87 | -if ( PLL_Deactivate::is_deactivation() ) { | |
| 88 | - // Stopping here if we are going to deactivate the plugin (avoids breaking rewrite rules). | |
| 89 | - PLL_Deactivate::add_hooks(); | |
| 90 | - return; | |
| 91 | -} | |
| 92 | - | |
| 93 | -PLL_Activate::add_hooks(); | |
| 94 | -new Polylang(); | |