Is your plugin intended for use by others, or is it only going to be used on servers you control? If the latter, then there might be a few ways to achieve what you want. For instance, the Sync extension. With that, I think you could use a mutex or semaphore to set a flag, which you could then use in your read/write functions.
If you already have memcache available, then that might be a lightweight way to do the same thing, without needing to install a new extension.
Failing that, you might be able to use a db table lock, but that seems really heavy-handed, and I’d worry about the impact on database performance.
Related Posts:
- Is it mandatory to use $wpdb->prefix in custom tables
- Actions or filters fired when data is saved in a custom table
- Custom Plugin Database relations
- Activation hook not creating table
- How to create database table, add data, update and delete using wpdb via plugins?
- Using WPDB to output raw XML fails because of wp-blog-header.php
- Adding custom end points, No error line
- wpdb->prepare and mysql UPDATE – how is it done?
- $wpdb->update Issue
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Update database record in plugin
- WordPress plugin tables become corrupt
- Programmatically creating posts based on external JSON feed (asynchronously)
- multiple record insert creating many duplicate records
- Difference Between Filter and Action Hooks?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- Should I use wpdb prepare?
- Post meta vs separate database tables
- How to create an API for my plugin?
- How to store username and password to API in wordpress option DB?
- Update Option Stored in Multi-Dimensional Array
- Is there a limit on making calls to WordPress.org API’s?
- Default table collation on plugin activation?
- $wpdb->insert_id
- Using a database view = evil incarnate?
- Using filters and actions for plugin API?
- Check for success of $wpdb->update() correctly
- Writing a plugin that notify my friends of new post that mentions(@) them
- Getting wrong relationship value in $args in wp_Query?
- Not sure the best way to save custom plugin data
- The ideal place for storing persistent PHP objects
- What is the correct way for plugins to create tables with special charset/collation considerations?
- permalinks with get variables
- What is the added “complexity” of custom tables?
- Plugin development with unit tests
- How is the data stored in the database?
- Formatting of curly brackets array from WP database to get more readable output
- How to modify post content before writing to database?
- $wpdb->insert is changing a value
- Retrieving custom fields with $wpdb->get_results
- Hello dolly type plugin that allows people to add their own
- Really simple query giving error in SQL syntax
- Sample — test — data for large WordPress install
- Build dynamic page from cURL (HTML page) response with plugin
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- why creating tables using $wpdb is not being executed while installing plugins?
- How to use mysql IN statement with wpdb update method?
- How to override a function call in functions.php?
- wp_enqueue_style built in styles
- How to store data for posts/pages built with drag-n-drop builder?
- Database for development
- Using $wpdb object in a widget
- Is there a naming convention for database tables created by a plugin?
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Saving data from block editor to the database
- What for the tables ending with the meta used in database of wordpress?
- Creating table with plugin is not working
- $wpdb -> Batch insert from XML File?
- Does WordPress’s HTTP API use any caching?
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- How to Download and install plugin database remotely
- Get a custom table to an array
- Update/insert only a column of database table
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- How to insert data to a database table when the field is not yet created?
- Where to store the name of a custom table?
- Subscribe to author?
- include wp-blog-header not working on MAMP
- I’m designing a plugin to create database indexes. Suggestions?
- creating custom function to log actions in plugin
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- SQL query for custom taxonomy slugs
- Example Dashboard Widget, Cancel not working
- Issue regarding $wpdb->prepare()
- How should I store a log for my plugin
- Error on inserting a form value to database
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Help With MySQL to WPDB Query Conversion
- Strange issue saving custom field data for a WooCommerce order
- Amending REST API function without deactivate/activate plugin every time changes is made
- how to search users by ajax live search
- Why does wp_remote_post returns an empty body response on certain endpoints?
- How to perform a heavy and long process in cron jobs?
- Form doesnt save to database
- Intermittent database errors when accessing WordPress database
- Sending post request with wp_remote_post not working correctly
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Update results, Before deleting the related category [closed]
- Storing data in wordpress database from ajax call from different website
- Store a default value for a transient on plugin activation
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- woocommerce_checkout_order_processed hook executing function twice
- Plugin Development for registered users
- What to hook into to check a value before a post is published?
- Optimising a big WordPress site
- dbDelta SQL Query Not Working