| @@ -2,10 +2,10 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: ElasticPress |
| 4 | 4 | * Plugin URI: https://github.com/10up/ElasticPress |
| 5 | 5 | * Description: A fast and flexible search and query engine for WordPress. |
| 6 | - * Version: 5.0.0 | |
| 7 | - * Requires at least: 6.0 | |
| 6 | + * Version: 5.3.5 | |
| 7 | + * Requires at least: 6.2 | |
| 8 | 8 | * Requires PHP: 7.4 |
| 9 | 9 | * Author: 10up |
| 10 | 10 | * Author URI: https://10up.com |
| 11 | 11 | * License: GPL v2 or later |
| @@ -10,8 +10,9 @@ | ||
| 10 | 10 | * Author URI: https://10up.com |
| 11 | 11 | * License: GPL v2 or later |
| 12 | 12 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 | 13 | * Text Domain: elasticpress |
| 14 | + * Domain Path: /lang | |
| 14 | 15 | * |
| 15 | 16 | * This program derives work from Alley Interactive's SearchPress |
| 16 | 17 | * and Automattic's VIP search plugin: |
| 17 | 18 | * |
| @@ -22,9 +23,9 @@ | ||
| 22 | 23 | */ |
| 23 | 24 | |
| 24 | 25 | namespace ElasticPress; |
| 25 | 26 | |
| 26 | -use \WP_CLI; | |
| 27 | +use WP_CLI; | |
| 27 | 28 | |
| 28 | 29 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | 30 | exit; // Exit if accessed directly. |
| 30 | 31 | } |
| @@ -31,9 +32,9 @@ | ||
| 31 | 32 | |
| 32 | 33 | define( 'EP_URL', plugin_dir_url( __FILE__ ) ); |
| 33 | 34 | define( 'EP_PATH', plugin_dir_path( __FILE__ ) ); |
| 34 | 35 | define( 'EP_FILE', plugin_basename( __FILE__ ) ); |
| 35 | -define( 'EP_VERSION', '5.0.0' ); | |
| 36 | +define( 'EP_VERSION', '5.3.5' ); | |
| 36 | 37 | |
| 37 | 38 | define( 'EP_PHP_VERSION_MIN', '7.4' ); |
| 38 | 39 | |
| 39 | 40 | if ( ! version_compare( phpversion(), EP_PHP_VERSION_MIN, '>=' ) ) { |
| @@ -38,9 +39,9 @@ | ||
| 38 | 39 | |
| 39 | 40 | if ( ! version_compare( phpversion(), EP_PHP_VERSION_MIN, '>=' ) ) { |
| 40 | 41 | add_action( |
| 41 | 42 | 'admin_notices', |
| 42 | - function() { | |
| 43 | + function () { | |
| 43 | 44 | ?> |
| 44 | 45 | <div class="notice notice-error"> |
| 45 | 46 | <p> |
| 46 | 47 | <?php |
| @@ -70,9 +71,9 @@ | ||
| 70 | 71 | * |
| 71 | 72 | * @since 2.6 |
| 72 | 73 | */ |
| 73 | 74 | spl_autoload_register( |
| 74 | - function( $class ) { | |
| 75 | + function ( $class_name ) { | |
| 75 | 76 | // project-specific namespace prefix. |
| 76 | 77 | $prefix = 'ElasticPress\\'; |
| 77 | 78 | |
| 78 | 79 | // base directory for the namespace prefix. |
| @@ -80,13 +81,13 @@ | ||
| 80 | 81 | |
| 81 | 82 | // does the class use the namespace prefix? |
| 82 | 83 | $len = strlen( $prefix ); |
| 83 | 84 | |
| 84 | - if ( strncmp( $prefix, $class, $len ) !== 0 ) { | |
| 85 | + if ( strncmp( $prefix, $class_name, $len ) !== 0 ) { | |
| 85 | 86 | return; |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | - $relative_class = substr( $class, $len ); | |
| 89 | + $relative_class = substr( $class_name, $len ); | |
| 89 | 90 | |
| 90 | 91 | $file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php'; |
| 91 | 92 | |
| 92 | 93 | // if the file exists, require it. |
| @@ -104,9 +105,9 @@ | ||
| 104 | 105 | * We don't check minor releases so if your ES version if 7.10.1, we consider that 7.10 in our comparison. |
| 105 | 106 | * |
| 106 | 107 | * @since 2.2 |
| 107 | 108 | */ |
| 108 | -define( 'EP_ES_VERSION_MAX', '7.10' ); | |
| 109 | +define( 'EP_ES_VERSION_MAX', '9.999' ); | |
| 109 | 110 | define( 'EP_ES_VERSION_MIN', '5.2' ); |
| 110 | 111 | |
| 111 | 112 | require_once __DIR__ . '/includes/compat.php'; |
| 112 | 113 | require_once __DIR__ . '/includes/utils.php'; |
| @@ -189,8 +190,12 @@ | ||
| 189 | 190 | new Feature\Documents\Documents() |
| 190 | 191 | ); |
| 191 | 192 | |
| 192 | 193 | Features::factory()->register_feature( |
| 194 | + new Feature\AcfRepeater\AcfRepeater() | |
| 195 | + ); | |
| 196 | + | |
| 197 | + Features::factory()->register_feature( | |
| 193 | 198 | new Feature\Comments\Comments() |
| 194 | 199 | ); |
| 195 | 200 | |
| 196 | 201 | Features::factory()->register_feature( |
| @@ -214,9 +219,12 @@ | ||
| 214 | 219 | */ |
| 215 | 220 | $query_logger = apply_filters( 'ep_query_logger', new \ElasticPress\QueryLogger() ); |
| 216 | 221 | get_container()->set( '\ElasticPress\QueryLogger', $query_logger, true ); |
| 217 | 222 | |
| 223 | + get_container()->set( '\ElasticPress\AdminBar', new \ElasticPress\AdminBar(), true ); | |
| 218 | 224 | get_container()->set( '\ElasticPress\BlockTemplateUtils', new \ElasticPress\BlockTemplateUtils(), true ); |
| 225 | + get_container()->set( '\ElasticPress\ElasticPressIo', new \ElasticPress\ElasticPressIo() ); | |
| 226 | + get_container()->set( '\ElasticPress\ElementorUtils', new \ElasticPress\ElementorUtils(), true ); | |
| 219 | 227 | } |
| 220 | 228 | add_action( 'plugins_loaded', __NAMESPACE__ . '\register_indexable_posts' ); |
| 221 | 229 | |
| 222 | 230 | /** |
| @@ -274,10 +282,8 @@ | ||
| 274 | 282 | * |
| 275 | 283 | * @since 2.2 |
| 276 | 284 | */ |
| 277 | 285 | function setup_misc() { |
| 278 | - load_plugin_textdomain( 'elasticpress', false, basename( __DIR__ ) . '/lang' ); // Load any available translations first. | |
| 279 | - | |
| 280 | 286 | if ( is_user_logged_in() && ! defined( 'WP_EP_DEBUG' ) ) { |
| 281 | 287 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 282 | 288 | define( 'WP_EP_DEBUG', is_plugin_active( 'debug-bar-elasticpress/debug-bar-elasticpress.php' ) ); |
| 283 | 289 | } |
| @@ -282,8 +288,18 @@ | ||
| 282 | 288 | define( 'WP_EP_DEBUG', is_plugin_active( 'debug-bar-elasticpress/debug-bar-elasticpress.php' ) ); |
| 283 | 289 | } |
| 284 | 290 | } |
| 285 | 291 | add_action( 'plugins_loaded', __NAMESPACE__ . '\setup_misc' ); |
| 292 | + | |
| 293 | +/** | |
| 294 | + * Load text domain | |
| 295 | + * | |
| 296 | + * @since 5.1.4 | |
| 297 | + */ | |
| 298 | +function i18n() { | |
| 299 | + load_plugin_textdomain( 'elasticpress', false, basename( __DIR__ ) . '/lang' ); | |
| 300 | +} | |
| 301 | +add_action( 'init', __NAMESPACE__ . '\i18n' ); | |
| 286 | 302 | |
| 287 | 303 | /** |
| 288 | 304 | * Set up role(s) with EP capability |
| 289 | 305 | */ |