What is the best way to process options in a WordPress plugin?

Viewed 21

I have created a WordPress plugin based around site optimization. The plugin has a lot of options and depending on which options are checked, it enables a function (or code).

Currently, I am processing the options like this:

update_option('new_plugin_options',implode("\n",$_POST['options_full']));

$options_full = get_option( 'new_plugin_options');

if ( strpos($options_full, 'setting_name') === false ) {} else {
  //code
}

I read that strpos is the least resource-intensive way to match items, so I decided to go that route. However, I'm not convinced this is the optimal way, as we are dealing with 60+ options/functions/codes that need to run.

Is there a faster/better way?

0 Answers
Related