Hongmu Notes
Home Program Notes wordpress

wordpress

How to make WordPress fly? I used SQLite to defeat Redis

How to make WordPress fly? I used SQLite to defeat Redis Program Notes Summary of pitfalls wordpress

My website runs on WordPress + Zibi theme. Zibi knows everything about this thing - login, membership, download permissions, QQ login, reply visibility...it is packed with functions, and the database needs to be checked dozens of times every time it is refreshed. So I wanted to simply transform it. The code has been put in place. https://github.com/1810216796/wordpress-sqlite-cach…
👁 92
After installing Redis on WordPress, setting a password prevented Redis from connecting; as a result, Redis could not be accessed: `SELECT` Failed: NOAUTH – Authentication required.

After installing Redis on WordPress, setting a password prevented Redis from connecting; as a result, Redis could not be accessed: `SELECT` Failed: NOAUTH – Authentication required. Program Notes Summary of pitfalls wordpress

This is the most widely used article online – it can solve 80% of Redis-related issues! What should you do if the Redis Object Cache plugin fails to connect after you have changed the Redis password in WordPress? Of course, the remaining 20% of cases require making adjustments directly in the wp-config.php file! Solution: Previously, I added Redis-related code to the object-cache.php file of the Redis plugin...
👁 603
A single database record for WordPress operations

A single database record for WordPress operations Program Notes wordpress

I'm documenting my code – its primary function is to handle WordPress database connections and operations. Since I might need this again in the future, I've decided to record it here; this way, when I need to use it next time, I can simply copy and paste it. As it turns out, taking notes can really save some time! First code snippet: "`php // Include the WordPress core file: require_once(dirname(__FILE__));" `
👁 173
WordPress to EmpireCMS data migration – Category migration code

WordPress to EmpireCMS data migration – Category migration code Program Notes wordpress

config.php🔒 Hidden content: Members can view: <?php define('DB_NAME', 'root'); define('DB_USER', 'root'); define('DB_PASSWORD', 'RspC7M8seHywXZBW'); define('DB_HOST', 'loc...');
👁 240
WordPress `update_post_meta` function

WordPress `update_post_meta` function Program Notes wordpress

`update_post_meta()` is a WordPress function used to update custom fields for posts or pages; it is also known as "metadata." Its function prototype is as follows: `update_post_meta(int $post_id, string $meta_key, mixed $meta_value, mixed $prev...)`
👁 198
`get_post_meta` function for WordPress

`get_post_meta` function for WordPress Program Notes wordpress

`get_post_meta()` is a WordPress function used to retrieve custom fields for posts or pages; it is also known as "metadata." Its function prototype is as follows: `get_post_meta(int $post_id, string $key = '',bool $single = false)参数说明:$post_id:...)`
👁 310
WordPress `wp_cache_flush` function

WordPress `wp_cache_flush` function Program Notes wordpress

`wp_cache_flush()` is an built-in WordPress function used to clear all data from the cache. Its function prototype is as follows: `wp_cache_flush()`. When this function is called, all data within the WordPress caching system is deleted, including data stored by `wp_cache_set()` and other types of cached data. `wp_c...`
👁 343
How to view all WP-Cache cached content in WordPress?

How to view all WP-Cache cached content in WordPress? Program Notes wordpress

In WordPress, you can use the `wp_cache_set()` function to store data in the cache; however, WordPress does not provide a direct way to view all cached data. Nevertheless, you can achieve this by using a WordPress plugin or by writing custom code. Here are some methods for your reference: Using plugins – Some WordPress caching plugins, such as WP-O...
👁 349
WordPress `wp_cache_set` function

WordPress `wp_cache_set` function Program Notes wordpress

`wp_cache_set()` is an built-in WordPress function used to store data in the cache. Its function prototype is as follows: `wp_cache_set($key, $data, $group = '', $expire = 0)`. Parameter descriptions: - `$key`: The key name for the data to be stored; typically a string. - `$data`: The data to be stored; can be...
👁 174
WordPress plugin development: Creating corresponding data tables

WordPress plugin development: Creating corresponding data tables Program Notes wordpress

Here is a simple WordPress plugin example that will create the corresponding database table when enabled: Create a folder named `my-database-plugin` and within it, create a file named `my-database-plugin.php`. Add the following code to the `my-database-plugin.php` file: <?...
👁 157
1 2 3