If your goal is automated plugin activation you don’t have to do it via SQL. You could, of course, but why not use functionality that comes with WordPress?
As I mentioned in my comment, the data has been serialized so you just have to
- unserialize the data,
- add your plugin,
- re-serialize the data,
- and update the option.
Here is a code snippet for that:
$active_plugins = unserialize(get_option('active_plugins'));
if ($active_plugins && is_array($active_plugins)) {
$active_plugins[] = 'PLUGIN-DIR/PLUGIN-FILE.php'; // as in 'akismet/akismet.php'
update_option('active_plugins', serialize($active_plugins));
} else {
// something went wrong...
}
Related Posts:
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How To Activate Plugins via Code?
- Activate a plugin through PHPMyAdmin or FTP?
- How to check if a theme is active?
- Pluggable function and activation check?
- Automatically install wordpress plugin at theme activation
- Show a confirm message before plug-in activation
- Function to activate WordPress theme inside a plugin
- Activate Plugin which is in subfolder?
- explanation for activate_plugin function in wordpress core
- Remote plugin activation hook
- Force plugin to fail activation
- WordPress register_activation_hook table creation not working
- Multisite: Activate plugin for subsites only?
- The plugin generated x characters of unexpected output, $wpdb not defined
- Correct way to use register_activation_hook
- Cannot run the code after I activate the plugin
- wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn’t creating any tables on plugin activation
- Unable to activate wordpress importer after installing it
- How to include plugin without activation?
- Auto add content such as pages upon plugin activation?
- Detect when any plugin is activated or deactivated
- How to automate wordpress plugin activate and deactivate by php logic?
- Default Plugin Settings Not Writing to Database
- Plugin won’t activate – cannot declare class (already in use)
- Plugin Deactivate Self on Activation Errors
- How to activate plugins for my WordPress sites from a remote server
- register_activation_hook with include file [closed]
- Prevent a plugin from being automatically activated
- Is any information available in PHP files in WP about plugin activation history?
- Activated plugin is stored as an object, rather than as a path
- Own plugin corrups plugin-activation
- How to check if tables in WordPress still exists after activations
- How to block plugin activations with no known user or coming from unknown IP address range?
- Run plugins only on certain pages
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Force file download on plugin activation
- WordPress user account activation
- Multiple instance of data in plugin custom database table on plugin activation
- Why this function not working for install database on plugin activation
- register_activation_hook in oop approach
- How to create multiple database tables on plugin activation?
- Run function on plugin activation before plugin is loaded
- A question about register_activation hook
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- register_activation_hook() not working as expected
- Sub Plugin deactivation when Parent Plugin deactivate
- Advanced WordPress plugin activation detection
- Apparent errer when installing plugin
- My plugin does not install correctly if a previous version is still installed
- Is there existing plugins to “Click-to-Launch” embedded Flash / SWF content?
- Activation flow of a plugin in a multisite environment
- How to run flush_rewrite_rules on activation after i register my custom post type using WordPress Boilerplate Plugin
- How to check for already existing plugin versions on activation? and prevent errors
- how to enable/activate a plugin per Cpanel
- My WordPress activation hook isn’t working
- Cannot modify header information – headers already sent during plugin activation
- Error Copying Directory On Plugin Activation
- WordPress hook source
- API calls on plugin activation or init?
- Different plugins activated online and offline
- Problems with installing and deleting plugins
- Plugin De/Activation Not Firing On MultiSite install
- Custom Table doesn’t create on plugin activation
- Activate plugins by a theme’s functions.php?
- Is it possible to send user new password after they clicking on forgot password in word press
- why i cannot see some plugins while they are enabled on network admin page?
- Install theme as part of a plugin
- A better way to override plugin’s JS files?
- Get info (url) from already enqueued styles
- Show the “ratingValue” and “ratingCount” values of KK Star Ratings Plugin
- bulk post_content update
- What are WordPress installation percentages by version?
- Show a confirmation message on plugin deactivation
- How extend shortcode default values for a plugin?
- How to edit Image layout in single product page in woocommerce on wordpress?
- Can a manually uploaded plugin be made to track updates from the WordPress.org plugin directory?
- WP Post Template – Templates in own folder
- How to update post’s content on post publish?
- Create a table with wordpress plugin boilerplate
- Embed plugin into Custom Page Template
- Retrieving links and names of images from a NextGEN gallery [closed]
- Getting taxonomy images to display on single-post with their terms
- Where to populate custom terms in custom taxonomy in plugin?
- Is changing post from category in a large blog a good practice?
- Contact Form 7 – Show image on successful send? [closed]
- Widget where it can make changes to the container
- W3 Total Cache plugin chronic message
- How to prevent plugin, theme installation failures on WordPress?
- Get all image in media Gallery with alt/title?
- WP Function does not trigger on Webhook API Call
- How to add specific script to WordPress webpage that will working with user input and databases
- Displaying different content depending on variable
- After reading 3 story by user ask for subscription popup
- Create Biographies
- Which One Is Better For Managing Add Ons For Extensible Plugin?
- WP REST API Access-Control-Allow-Origin response is cached
- Get Core Functionality from Within a (Secondary) Plugin File
- Single dash converted to double dash
- How to create separate shop pages in woocommerce for each product category [closed]