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
- Should I use wpdb prepare?
- Post meta vs separate database tables
- How to create an API for my plugin?
- Update Option Stored in Multi-Dimensional Array
- Is there a limit on making calls to WordPress.org API’s?
- $wpdb->insert_id
- Writing a plugin that notify my friends of new post that mentions(@) them
- 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
- Formatting of curly brackets array from WP database to get more readable output
- How to modify post content before writing to database?
- Hello dolly type plugin that allows people to add their own
- Really simple query giving error in SQL syntax
- Build dynamic page from cURL (HTML page) response with plugin
- wp_enqueue_style built in styles
- Database for development
- 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?
- What for the tables ending with the meta used in database of wordpress?
- $wpdb -> Batch insert from XML File?
- How to Download and install plugin database remotely
- Get a custom table to an array
- How to insert data to a database table when the field is not yet created?
- Subscribe to author?
- I’m designing a plugin to create database indexes. Suggestions?
- creating custom function to log actions in plugin
- How should I store a log for my plugin
- Help With MySQL to WPDB Query Conversion
- Why does wp_remote_post returns an empty body response on certain endpoints?
- How to perform a heavy and long process in cron jobs?
- Update results, Before deleting the related category [closed]
- woocommerce_checkout_order_processed hook executing function twice
- What to hook into to check a value before a post is published?
- dbDelta not installing database
- Is it necessary to do validation again when retrieving data from database?
- Adding columns to core tables
- How to query custom db table?
- Delete data from database using row action
- WPDB: Update table
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- Issue running db create table query from static method
- $wpdb->prepare with LIKE and sprintf
- How to optimize multiple insert into wordpress database
- $wpdb->update() always need a second try
- Using AND and bracket grouping in SQL not working
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Proper Prepare Statement for ALTER TABLE and using AFTER
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- Save temporary registration data
- How to relate the Category to user?
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Get API auth_token token to renew weekly
- Error code when migrate
- Why User_login key doesn’t work with wp_update_user()
- How to store sensitive user data (passwords)
- Adding Amchart Interface to WordPress API
- WordPress Query doesn’t return the correct value
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Generate Static Page to Show Search Results/Detail for API
- User avatar-ACF fields
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- Hiding WordPress REST endpoints from public viewing using Basic Authentication
- WordPress doesn’t create table on plugin activation
- Insert Data into Database
- How do WordPress plugins work with oAuth2 APIs?
- pull data from wordpress database
- Dedicated server and WPDB Class : huge slow-down of the website
- How to implement pagination into a wpdb->result query?
- API WordPress is Limited? Return False
- How to filter get_adjacent_post()?
- Tie specific functions to options-update for limiting API requests
- $wpdb how can i save my postmeta table before querying it
- add_rewrite_rule not working
- Post data in wp-admin to external database
- How do I query posts and have their related taxonomies returned in the results?
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- How to create a database table in WordPress using PHP
- Can I log the searches that are returning 404 in the DB?
- Making a user platform reachable by a qr code on a pin-back-button [closed]