| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: SQLite Object Cache |
| 4 | - * Version: 1.3.1 | |
| 4 | + * Version: 1.6.2 | |
| 5 | 5 | * Plugin URI: https://github.com/OllieJones/sqlite-object-cache |
| 6 | 6 | * Description: A persistent object cache backend powered by SQLite3. |
| 7 | 7 | * Author: Oliver Jones |
| 8 | 8 | * Author URI: https://github.com/OllieJones/ |
| @@ -7,12 +7,13 @@ | ||
| 7 | 7 | * Author: Oliver Jones |
| 8 | 8 | * Author URI: https://github.com/OllieJones/ |
| 9 | 9 | * Requires at least: 5.5 |
| 10 | 10 | * Requires PHP: 5.6 |
| 11 | - * Tested up to: 6.2 | |
| 12 | - * | |
| 11 | + * Tested up to: 7.0 | |
| 13 | 12 | * Text Domain: sqlite-object-cache |
| 14 | 13 | * Domain Path: /languages/ |
| 14 | + * License: GPLv2 or later | |
| 15 | + * License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| 15 | 16 | * |
| 16 | 17 | * @package SQLiteObjectCache |
| 17 | 18 | * @author Oliver Jones |
| 18 | 19 | * @since 0.1.0 |
| @@ -18,18 +19,24 @@ | ||
| 18 | 19 | * @since 0.1.0 |
| 19 | 20 | */ |
| 20 | 21 | |
| 21 | 22 | if ( ! defined( 'ABSPATH' ) ) { |
| 22 | - exit; | |
| 23 | + exit; | |
| 23 | 24 | } |
| 24 | 25 | |
| 25 | 26 | require_once 'includes/class-sqlite-object-cache.php'; |
| 26 | -if ( is_admin() ) { | |
| 27 | - require_once 'includes/class-sqlite-object-cache-settings.php'; | |
| 28 | - require_once 'includes/lib/class-sqlite-object-cache-admin-api.php'; | |
| 29 | - require_once 'includes/lib/class-sqlite-object-cache-statistics.php'; | |
| 30 | - require_once 'includes/lib/class-sqlite-backup-exclusion.php'; | |
| 27 | +/* wp-cli interface activation */ | |
| 28 | +if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
| 29 | + require_once( plugin_dir_path( __FILE__ ) . 'includes/cli.php' ); | |
| 31 | 30 | } |
| 31 | + | |
| 32 | +if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { | |
| 33 | + require_once 'includes/class-sqlite-object-cache-settings.php'; | |
| 34 | + require_once 'includes/lib/class-sqlite-object-cache-statistics.php'; | |
| 35 | + require_once 'includes/lib/class-sqlite-backup-exclusion.php'; | |
| 36 | + require_once 'includes/lib/class-file.php'; | |
| 37 | + require_once 'includes/lib/class-sqlite-object-cache-opcache.php'; | |
| 38 | +} | |
| 32 | 39 | /** |
| 33 | 40 | * Returns the main instance of SQLite_Object_Cache to prevent the need to use globals. |
| 34 | 41 | * |
| 35 | 42 | * @return object SQLite_Object_Cache |
| @@ -35,14 +42,14 @@ | ||
| 35 | 42 | * @return object SQLite_Object_Cache |
| 36 | 43 | * @since 1.0.0 |
| 37 | 44 | */ |
| 38 | 45 | function sqlite_object_cache() { |
| 39 | - $instance = new SQLite_Object_Cache( __FILE__, '1.3.1' ); | |
| 46 | + $instance = new SQLite_Object_Cache( __FILE__, '1.6.2' ); | |
| 40 | 47 | |
| 41 | - if ( is_admin() ) { | |
| 42 | - $instance->settings = new SQLite_Object_Cache_Settings( $instance ); | |
| 43 | - } | |
| 48 | + if ( is_admin() ) { | |
| 49 | + $instance->settings = new SQLite_Object_Cache_Settings( $instance, plugin_basename( __FILE__ )); | |
| 50 | + } | |
| 44 | 51 | |
| 45 | - return $instance; | |
| 52 | + return $instance; | |
| 46 | 53 | } |
| 47 | 54 | |
| 48 | 55 | sqlite_object_cache(); |