diff --git a/README.md b/README.md
index 9b4588d..6bf138a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Author: Oliver Jones
**Contributors:** OllieJones \
**Tags:** cache, object cache, sqlite, performance, apcu \
**Requires at least:** 5.5 \
-**Requires PHP:** 5.6 \
+**Requires PHP:** 7.0 \
**Tested up to:** 7.0 \
Version: 1.6.4 \
**Stable tag:** 1.6.4 \
@@ -92,11 +92,14 @@ The plugin offers a few optional settings for your `wp-config.php` file. Do not
* WP_SQLITE_OBJECT_CACHE_JOURNAL_MODE. This is the [SQLite journal mode](https://www.sqlite.org/pragma.html#pragma_journal_mode). Default: ‘WAL’. Possible values DELETE | TRUNCATE | PERSIST | MEMORY | WAL | WAL2 | NONE. (Not all SQLite3 implementations handle WAL2.)
* WP_SQLITE_OBJECT_CACHE_APCU. If true enables cache acceleration with APCu RAM. This setting can be updated from the plugin's Settings page.
* WP_SQLITE_OBJECT_CACHE_CHECKPOINT_FREQ. How often, probabilistically, to force checkpointing SQLite3. Make this number smaller on busy sites if your WAL file gets too long. Default 2000.
-* WP_CACHE_KEY_SALT. Set this to a hard-to-guess random value to make your cache keys harder to guess. This setting works for other cache plugins as well.
+* WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS. An array of cache group names that should not be persisted to SQLite (memory-only cache). These are merged with any groups already marked as non-persistent. Example: `define( 'WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS', ['my-group', 'another-group'] );`
+* WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS. An array of cache group names that will be persisted to SQLite but survive `wp_cache_flush()`. These are merged with any groups already marked as unflushable. Example: `define( 'WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS', ['my-group', 'another-group'] );`
+* WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY. The WordPress capability required to access the plugin's settings page and flush controls. Default: `manage_options`. Example: `define( 'WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY', 'manage_network_options' );`
+* WP_CACHE_KEY_SALT. Set this to a hard-to-guess random value to make your cache keys harder to guess. This setting works for other cache plugins as well.
Configuring the cache key salt
-When multiple sites share the same server hardware and software, they can sometimes share the same cache data. Setting `WP_CACHE_KEY_SALT` to a hard-to-guess random value for each site makes it much harder for one site to get another site's data. This works for other cache plugins too. Notice that this `WP_CACHE_KEY_SALT` value must be set, in your site's `wp-config.php` file, before activating any cache plugin, including page caches and persistent object caches.
+When multiple sites share the same server hardware and software, they can sometimes share the same cache data. Setting `WP_CACHE_KEY_SALT` to a hard-to-guess random value for each site makes it much harder for one site to get another site's data. This works for other cache plugins too. Notice that this `WP_CACHE_KEY_SALT` value must be set, in your site's `wp-config.php` file, before activating any cache plugin, including page caches and persistent object caches.
To set the value put a line like this in `wp-config.php`.
@@ -144,11 +147,11 @@ Notice that this setting controls the size of the data in the cache. That is the
### What is APCu?
-[APCu](https://www.php.net/manual/en/book.apcu.php) is php extension offering an in-memory storage medium. You can configure this plugin to use it to speed up cache lookups.
+[APCu](https://www.php.net/manual/en/book.apcu.php) is php extension offering an in-memory storage medium. You can configure this plugin to use it to speed up cache lookups.
### On my server the APCu shared memory cache is too small. How can I make it bigger?
-On most operating systems the size of the APCu cache is, as installed, 32MiB. If you need to increase this size you can add a line to your `php.ini` file mentioning the [apc.shm_size](https://www.php.net/manual/en/apcu.configuration.php#ini.apcu.shm-size) configuration option. For example, the line `apc.shm_size = 64M` sets the size to 64MiB. Please consult your operating system or hosting provider documetation for information on how to do this.
+On most operating systems the size of the APCu cache is, as installed, 32MiB. If you need to increase this size you can add a line to your `php.ini` file mentioning the [apc.shm_size](https://www.php.net/manual/en/apcu.configuration.php#ini.apcu.shm-size) configuration option. For example, the line `apc.shm_size = 64M` sets the size to 64MiB. Please consult your operating system or hosting provider documetation for information on how to do this.
Notice that sometimes multiple WordPress installations that run on the same server share the same APCu cache, so provide enough space for them all. And keep in mind that this plugin only uses APCu to accelerate its operations, so the consequences of setting its size too small are not great.
@@ -254,7 +257,7 @@ causes your object cache data to go into the `/tmp` folder in a file named `mysi
### Can this plugin use SQLite memory-mapped I/O?
-**Yes**. You can use your OS's memory map feature to access and share cache data with [SQLite Memory-Mapped I/O](https://www.sqlite.org/mmap.html). On some server configurations this allows multiple php processes to share cached data more quickly. In the plugin this is disabled by default. You can enable it by telling the plugin how many MiB to use for memory mapping. For example, this wp-config setting tells the plugin to use 32MiB.
+**Yes**. You can use your OS's memory map feature to access and share cache data with [SQLite Memory-Mapped I/O](https://www.sqlite.org/mmap.html). On some server configurations this allows multiple php processes to share cached data more quickly. In the plugin this is disabled by default. You can enable it by telling the plugin how many MiB to use for memory mapping. For example, this wp-config setting tells the plugin to use 32MiB.
`define( 'WP_SQLITE_OBJECT_CACHE_MMAP_SIZE', 32 );`
@@ -374,4 +377,4 @@ A race condition caused expired cache entries to be copied to APCu incorrectly s
## Upgrade Notice
-Correct a race condition upon cache item expiration. Improve SQLite3 checkpointing to reduce the probability of huge WAL files. Add a health check for OPcache (not APCu) exhaustion. Make db files group writeable.
+Correct a race condition upon cache item expiration. Improve SQLite3 checkpointing to reduce the probability of huge WAL files. Add a health check for OPcache (not APCu) exhaustion. Make db files group writeable.
\ No newline at end of file
diff --git a/assets/drop-in/object-cache.php b/assets/drop-in/object-cache.php
index 120f339..9a9105f 100644
--- a/assets/drop-in/object-cache.php
+++ b/assets/drop-in/object-cache.php
@@ -9,7 +9,7 @@
* Author URI: https://plumislandmedia.net
* License: GPLv2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
- * Requires PHP: 5.6
+ * Requires PHP: 7.0
* Tested up to: 7.0
* Stable tag: 1.6.4
*
@@ -193,17 +193,7 @@ class WP_Object_Cache {
*
* @var array
*/
- public $ignored_groups = array(
- 'counts',
- 'plugins',
- 'themes',
- );
- /**
- * List of groups and their types.
- *
- * @var array
- */
- public $group_type = array();
+ public $ignored_groups = array();
/**
* Prefix used for global groups.
*
@@ -215,25 +205,7 @@ class WP_Object_Cache {
*
* @var array
*/
- protected $global_groups = array(
- 'blog-details',
- 'blog-id-cache',
- 'blog-lookup',
- 'global-posts',
- 'networks',
- 'rss',
- 'sites',
- 'site-details',
- 'site-lookup',
- 'site-options',
- 'site-transient',
- 'users',
- 'useremail',
- 'userlogins',
- 'usermeta',
- 'user_meta',
- 'userslugs',
- );
+ protected $global_groups = array();
/**
* @var array One-level associative array $name=>$value
@@ -500,7 +472,6 @@ public function __construct() {
$this->start_hrtime = hrtime( true );
$this->start_time = time();
global $table_prefix;
- $this->cache_group_types();
/* The environment. */
$apc = defined( 'WP_SQLITE_OBJECT_CACHE_APCU' ) && WP_SQLITE_OBJECT_CACHE_APCU;
@@ -550,6 +521,14 @@ public function __construct() {
: self::MMAP_SIZE;
$this->mmap_size = (int) $this->mmap_size * 1024 * 1024;
+ if ( defined( 'WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS' ) && is_array( WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS ) ) {
+ $this->add_non_persistent_groups( WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS );
+ }
+
+ if ( defined( 'WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS' ) && is_array( WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS ) ) {
+ $this->add_unflushable_groups( WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS );
+ }
+
$this->multisite = is_multisite();
$this->blog_prefix = $this->multisite ? get_current_blog_id() . ':' : '';
$this->cache_table_name = self::OBJECT_CACHE_TABLE;
@@ -760,24 +739,6 @@ private function actual_open_connection() {
$this->open_time = hrtime( true ) - $start;
}
- /**
- * Set group type array
- *
- * @return void
- */
- protected function cache_group_types() {
- foreach ( $this->global_groups as $group ) {
- $this->group_type[ $group ] = 'global';
- }
-
- foreach ( $this->unflushable_groups as $group ) {
- $this->group_type[ $group ] = 'unflushable';
- }
-
- foreach ( $this->ignored_groups as $group ) {
- $this->group_type[ $group ] = 'ignored';
- }
- }
/**
* Do the necessary Data Definition Language work, for the cache table and flags table
@@ -1305,25 +1266,6 @@ public function sqlite_get_version() {
return $this->sqlite_version;
}
- /**
- * Sets the list of groups not to be cached by Redis.
- *
- * @param array $groups List of groups that are to be ignored.
- */
- public function add_non_persistent_groups( $groups ) {
- /**
- * Filters list of groups to be added to {@see self::$ignored_groups}
- *
- * @param string[] $groups List of groups to be ignored.
- *
- * @since 2.1.7
- */
- $groups = apply_filters( 'sqlite_object_cache_add_non_persistent_groups', (array) $groups );
-
- $this->ignored_groups = array_unique( array_merge( $this->ignored_groups, $groups ) );
- $this->cache_group_types();
- }
-
/**
* Makes private properties readable for backward compatibility.
*
@@ -1839,8 +1781,9 @@ public function set_multiple( array &$data, $group = '', $expire = 0 ) {
*/
public function get_multiple( $input_keys, $group = 'default', $force = false ) {
$values = array();
- if ( count( $input_keys ) <= 1 || $force ) {
- /* Send the degenerate get_multiple calls, and forced calls, to plain old get. That logic is simpler. */
+ if ( count( $input_keys ) <= 1 || $force || $this->is_ignored_group( $group ) ) {
+ /* Send the degenerate get_multiple calls, and forced calls, to plain old get. That logic is simpler.
+ * Also use the simple path for ignored groups, since they are never stored in SQLite. */
foreach ( $input_keys as $key ) {
$values[ $key ] = $this->get( $key, $group, $force );
}
@@ -2081,6 +2024,14 @@ public function get( $key, $group = 'default', $force = false, &$found = null )
return is_object( $this->cache[ $name ] ) ? clone( $this->cache[ $name ] ) : $this->cache[ $name ];
}
+ if ( $this->is_ignored_group( $group ) ) {
+ /* Ignored groups are never stored in SQLite; skip the persistent cache lookup. */
+ $found = false;
+ ++ $this->cache_misses;
+ ++ $this->get_depth;
+
+ return false;
+ }
if ( $this->cache_item_exists( $name ) ) {
$found = true;
++ $this->cache_hits;
@@ -2205,7 +2156,10 @@ public function delete( $key, $group = 'default', $deprecated = false ) {
$name = $this->normalize_name( $key, $group );
unset ( $this->cache[ $name ] );
- $this->delete_by_name( $name );
+
+ if ( ! $this->is_ignored_group( $group ) ) {
+ $this->delete_by_name( $name );
+ }
return true;
}
@@ -2366,7 +2320,9 @@ public function incr( $key, $offset = 1, $group = 'default' ) {
if ( $this->cache[ $name ] < 0 ) {
$this->cache[ $name ] = 0;
}
- $this->put_by_name( $name, $this->cache[ $name ], 0 );
+ if ( ! $this->is_ignored_group( $group ) ) {
+ $this->put_by_name( $name, $this->cache[ $name ], 0 );
+ }
return $this->cache[ $name ];
}
@@ -2418,7 +2374,7 @@ public function flush( $vacuum = false ) {
if ( $selective && is_array( $this->unflushable_groups ) && count( $this->unflushable_groups ) > 0 ) {
$clauses = array();
- foreach ( $this->unflushable_groups as $unflushable_group ) {
+ foreach ( array_keys( $this->unflushable_groups ) as $unflushable_group ) {
$unflushable_group = sanitize_key( $unflushable_group );
$clauses [] = "(name NOT LIKE '$unflushable_group|%')";
}
@@ -2510,8 +2466,7 @@ public function flush_group( $group ) {
public function add_unflushable_groups( $groups ) {
$groups = (array) $groups;
- $this->unflushable_groups = array_unique( array_merge( $this->unflushable_groups, $groups ) );
- $this->cache_group_types();
+ $this->unflushable_groups = array_merge( $this->unflushable_groups, array_fill_keys( $groups, true ) );
}
/**
@@ -2524,10 +2479,36 @@ public function add_unflushable_groups( $groups ) {
public function add_global_groups( $groups ) {
$groups = (array) $groups;
- $groups = array_fill_keys( $groups, true );
- $this->global_groups = array_merge( $this->global_groups, $groups );
+ $this->global_groups = array_merge( $this->global_groups, array_fill_keys( $groups, true ) );
+ }
+
+ /**
+ * Sets the list of groups not to be cached by SQLite
+ *
+ * @param array $groups List of groups that are to be ignored.
+ */
+ public function add_non_persistent_groups( $groups ) {
+ /**
+ * Filters list of groups to be added to {@see self::$ignored_groups}
+ *
+ * @param string[] $groups List of groups to be ignored.
+ *
+ * @since 2.1.7
+ */
+ $groups = apply_filters( 'sqlite_object_cache_add_non_persistent_groups', (array) $groups );
- $this->cache_group_types();
+ $this->ignored_groups = array_merge( $this->ignored_groups, array_fill_keys( $groups, true ) );
+ }
+
+ /**
+ * Checks if the given group is in the ignored (non-persistent) groups list.
+ *
+ * @param string $group Name of the group to check.
+ *
+ * @return bool
+ */
+ protected function is_ignored_group( $group ) {
+ return isset( $this->ignored_groups[ $group ?: 'default' ] );
}
/**
@@ -2597,39 +2578,6 @@ public function get_cache_type() {
return $this->apcu_active ? 'APCu|SQLite' : 'SQLite';
}
- /**
- * Checks if the given group is part the ignored group array
- *
- * @param string $group Name of the group to check, pre-sanitized.
- *
- * @return bool
- */
- protected function is_ignored_group( $group ) {
- return $this->is_group_of_type( $group, 'ignored' );
- }
-
- /**
- * Checks the type of the given group
- *
- * @param string $group Name of the group to check, pre-sanitized.
- * @param string $type Type of the group to check.
- *
- * @return bool
- */
- private function is_group_of_type( $group, $type ) {
- return isset( $this->group_type[ $group ] ) && $this->group_type[ $group ] === $type;
- }
-
- /**
- * Checks if the given group is part the global group array
- *
- * @param string $group Name of the group to check, pre-sanitized.
- *
- * @return bool
- */
- protected function is_global_group( $group ) {
- return $this->is_group_of_type( $group, 'global' );
- }
/**
* Get the names of the SQLite files.
diff --git a/includes/class-sqlite-object-cache-settings.php b/includes/class-sqlite-object-cache-settings.php
index d52dd69..dfcd2a1 100644
--- a/includes/class-sqlite-object-cache-settings.php
+++ b/includes/class-sqlite-object-cache-settings.php
@@ -457,7 +457,7 @@ private function menu_settings() {
'parent_slug' => 'options-general.php',
'page_title' => __( 'SQLite Persistent Object Cache', 'sqlite-object-cache' ),
'menu_title' => __( 'Object Cache', 'sqlite-object-cache' ),
- 'capability' => 'manage_options',
+ 'capability' => SQLite_Object_Cache::get_manager_capability(),
'menu_slug' => $this->parent->_token . '_settings',
'function' => array( $this, 'settings_page' ),
'icon_url' => '',
diff --git a/includes/class-sqlite-object-cache.php b/includes/class-sqlite-object-cache.php
index 724f219..7ef44eb 100644
--- a/includes/class-sqlite-object-cache.php
+++ b/includes/class-sqlite-object-cache.php
@@ -183,7 +183,7 @@ public function __construct( $file = '', $version = '1.6.4' ) {
if ( array_key_exists ('adminbarflush', $option ) && 'on' === $option['adminbarflush'] ) {
add_action( 'init', array( $this, 'handle_admin_bar_flush' ) );
add_action ( 'init', function() {
- if ( ! ( is_multisite() && ! is_main_site() ) && current_user_can( 'manage_options') ) {
+ if ( ! ( is_multisite() && ! is_main_site() ) && current_user_can( self::get_manager_capability() ) ) {
add_action( 'admin_bar_menu', array( $this, 'admin_bar_flush_button' ), 100 );
add_action( 'admin_notices', array( $this, 'maybe_show_flush_notice' ) );
}
@@ -191,6 +191,21 @@ public function __construct( $file = '', $version = '1.6.4' ) {
}
}
+ /**
+ * Get the capability required to manage this plugin.
+ *
+ * @return string Capability string.
+ */
+ public static function get_manager_capability() {
+ if ( defined( 'WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY' )
+ && is_string( WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY )
+ && '' !== WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY
+ ) {
+ return WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY;
+ }
+ return 'manage_options';
+ }
+
/**
* WP_Cron task to clean cache entries.
*
@@ -341,7 +356,6 @@ public function test_filesystem_writing() {
*
* @return bool
* @author Till Krüss
- *
*/
public function initialize_filesystem( $url, $silent = false ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
@@ -534,10 +548,10 @@ public function delete_all_transients_from_db() {
// Multisite stores site transients in the sitemeta table.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
$wpdb->query(
- $wpdb->prepare(
- "DELETE FROM {$wpdb->sitemeta} WHERE a.meta_key LIKE %s",
- $wpdb->esc_like( '_site_transient_' ) . '%'
- )
+ $wpdb->prepare(
+ "DELETE FROM {$wpdb->sitemeta} WHERE meta_key LIKE %s",
+ $wpdb->esc_like( '_site_transient_' ) . '%'
+ )
);
}
@@ -590,7 +604,7 @@ public function sync_apcu_global_to_option( $unconditional = true ) {
$updated_flag = array_key_exists( 'use_apcu_updated', $option );
$use_apcu = array_key_exists( 'use_apcu', $option ) && 'on' === $option['use_apcu'] ? 'on' : 'off';
if ( $updated_flag ) {
- unset ( $option['use_apcu_updated'] );
+ unset( $option['use_apcu_updated'] );
$option_dirty = true;
}
$target_use_apcu = $this->apcu_is_activated() ? 'on' : 'off';
@@ -602,7 +616,7 @@ public function sync_apcu_global_to_option( $unconditional = true ) {
$option_dirty = true;
}
if ( $option_dirty ) {
- if ( method_exists( $wp_object_cache, 'apcu-clear_cache' ) ) {
+ if ( method_exists( $wp_object_cache, 'apcu_clear_cache' ) ) {
$wp_object_cache->apcu_clear_cache();
}
update_option( $this->_token . '_settings', $option, true );
@@ -623,7 +637,7 @@ public function admin_bar_flush_button( $wp_admin_bar ) {
return;
}
- if ( ! current_user_can( 'manage_options' ) ) {
+ if ( ! current_user_can( self::get_manager_capability() ) ) {
return;
}
@@ -666,7 +680,7 @@ public function handle_admin_bar_flush() {
return;
}
- if ( ! current_user_can( 'manage_options' ) ) {
+ if ( ! current_user_can( self::get_manager_capability() ) ) {
wp_die( esc_html__( 'You do not have permission to flush the object cache.', 'sqlite-object-cache' ) );
}
diff --git a/readme.txt b/readme.txt
index f953071..d5b83bf 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,7 +3,7 @@ Author: Oliver Jones
Contributors: OllieJones
Tags: cache, object cache, sqlite, performance, apcu
Requires at least: 5.5
-Requires PHP: 5.6
+Requires PHP: 7.0
Tested up to: 7.0
Version: 1.6.4
Stable tag: 1.6.4
@@ -91,11 +91,14 @@ The plugin offers a few optional settings for your `wp-config.php` file. Do not
* WP_SQLITE_OBJECT_CACHE_JOURNAL_MODE. This is the [SQLite journal mode](https://www.sqlite.org/pragma.html#pragma_journal_mode). Default: ‘WAL’. Possible values DELETE | TRUNCATE | PERSIST | MEMORY | WAL | WAL2 | NONE. (Not all SQLite3 implementations handle WAL2.)
* WP_SQLITE_OBJECT_CACHE_APCU. If true enables cache acceleration with APCu RAM. This setting can be updated from the plugin's Settings page.
* WP_SQLITE_OBJECT_CACHE_CHECKPOINT_FREQ. How often, probabilistically, to force checkpointing SQLite3. Make this number smaller on busy sites if your WAL file gets too long. Default 2000.
-* WP_CACHE_KEY_SALT. Set this to a hard-to-guess random value to make your cache keys harder to guess. This setting works for other cache plugins as well.
+* WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS. An array of cache group names that should not be persisted to SQLite (memory-only cache). These are merged with any groups already marked as non-persistent. Example: `define( 'WP_SQLITE_OBJECT_CACHE_IGNORED_GROUPS', ['my-group', 'another-group'] );`
+* WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS. An array of cache group names that will be persisted to SQLite but survive `wp_cache_flush()`. These are merged with any groups already marked as unflushable. Example: `define( 'WP_SQLITE_OBJECT_CACHE_UNFLUSHABLE_GROUPS', ['my-group', 'another-group'] );`
+* WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY. The WordPress capability required to access the plugin's settings page and flush controls. Default: `manage_options`. Example: `define( 'WP_SQLITE_OBJECT_CACHE_MANAGER_CAPABILITY', 'manage_network_options' );`
+* WP_CACHE_KEY_SALT. Set this to a hard-to-guess random value to make your cache keys harder to guess. This setting works for other cache plugins as well.
Configuring the cache key salt
-When multiple sites share the same server hardware and software, they can sometimes share the same cache data. Setting `WP_CACHE_KEY_SALT` to a hard-to-guess random value for each site makes it much harder for one site to get another site's data. This works for other cache plugins too. Notice that this `WP_CACHE_KEY_SALT` value must be set, in your site's `wp-config.php` file, before activating any cache plugin, including page caches and persistent object caches.
+When multiple sites share the same server hardware and software, they can sometimes share the same cache data. Setting `WP_CACHE_KEY_SALT` to a hard-to-guess random value for each site makes it much harder for one site to get another site's data. This works for other cache plugins too. Notice that this `WP_CACHE_KEY_SALT` value must be set, in your site's `wp-config.php` file, before activating any cache plugin, including page caches and persistent object caches.
To set the value put a line like this in `wp-config.php`.
@@ -143,11 +146,11 @@ Notice that this setting controls the size of the data in the cache. That is the
= What is APCu? =
-[APCu](https://www.php.net/manual/en/book.apcu.php) is php extension offering an in-memory storage medium. You can configure this plugin to use it to speed up cache lookups.
+[APCu](https://www.php.net/manual/en/book.apcu.php) is php extension offering an in-memory storage medium. You can configure this plugin to use it to speed up cache lookups.
= On my server the APCu shared memory cache is too small. How can I make it bigger? =
-On most operating systems the size of the APCu cache is, as installed, 32MiB. If you need to increase this size you can add a line to your `php.ini` file mentioning the [apc.shm_size](https://www.php.net/manual/en/apcu.configuration.php#ini.apcu.shm-size) configuration option. For example, the line `apc.shm_size = 64M` sets the size to 64MiB. Please consult your operating system or hosting provider documetation for information on how to do this.
+On most operating systems the size of the APCu cache is, as installed, 32MiB. If you need to increase this size you can add a line to your `php.ini` file mentioning the [apc.shm_size](https://www.php.net/manual/en/apcu.configuration.php#ini.apcu.shm-size) configuration option. For example, the line `apc.shm_size = 64M` sets the size to 64MiB. Please consult your operating system or hosting provider documetation for information on how to do this.
Notice that sometimes multiple WordPress installations that run on the same server share the same APCu cache, so provide enough space for them all. And keep in mind that this plugin only uses APCu to accelerate its operations, so the consequences of setting its size too small are not great.
@@ -253,7 +256,7 @@ causes your object cache data to go into the `/tmp` folder in a file named `mysi
= Can this plugin use SQLite memory-mapped I/O?
-**Yes**. You can use your OS's memory map feature to access and share cache data with [SQLite Memory-Mapped I/O](https://www.sqlite.org/mmap.html). On some server configurations this allows multiple php processes to share cached data more quickly. In the plugin this is disabled by default. You can enable it by telling the plugin how many MiB to use for memory mapping. For example, this wp-config setting tells the plugin to use 32MiB.
+**Yes**. You can use your OS's memory map feature to access and share cache data with [SQLite Memory-Mapped I/O](https://www.sqlite.org/mmap.html). On some server configurations this allows multiple php processes to share cached data more quickly. In the plugin this is disabled by default. You can enable it by telling the plugin how many MiB to use for memory mapping. For example, this wp-config setting tells the plugin to use 32MiB.
`define( 'WP_SQLITE_OBJECT_CACHE_MMAP_SIZE', 32 );`
diff --git a/sqlite-object-cache.php b/sqlite-object-cache.php
index fe3dd57..ef0a4b3 100644
--- a/sqlite-object-cache.php
+++ b/sqlite-object-cache.php
@@ -7,7 +7,7 @@
* Author: Oliver Jones
* Author URI: https://github.com/OllieJones/
* Requires at least: 5.5
- * Requires PHP: 5.6
+ * Requires PHP: 7.0
* Tested up to: 7.0
* Text Domain: sqlite-object-cache
* Domain Path: /languages/