When developing plugins where should you store values that might not strictly be settings? For instance I'm writing a plugin which is going to be periodically pulling stuff from Twitter, so I'd like to keep a hold of when the plugin was last run and maybe some Ids relevant to Twitter that sort of thing. 

I know there is the settings array which you use for user defined values, should I also use it for other stuff that the user can't change, or is there a more sensible place to stick those?
You could create a Record which will give you a custom table to store your twitter related settings and update them as needed but I think that your use case is still simple enough that you could leave them in the settings array and then use the Plugins Service to update those settings.

This is how I would do it if I chose to use defineSettings()



// MyPlugin.php
public function defineSettings()
{
   return array(
        // ...
        'twitterApiKey' =&gt; array(AttributeType::String, 'default' =&gt; '5omeRand0mstriNg'),
        'twitterUsername' =&gt; array(AttributeType::String, 'default' =&gt; 'someone'),
    );
}


// MyService.php
public function saveTwitterSettings(array $settings=array())
{
    $plugin = craft()-&gt;plugins-&gt;getPlugin('myplugin');
    $savedSettings = $plugin-&gt;getSettings()-&gt;getAttributes();
    $newSettingsRow = array_merge($savedSettings, $settings);

    return craft()-&gt;plugins-&gt;savePluginSettings($plugin, $newSettingsRow);
}




Feel free to follow up with questions/comments if you have any.

@selvinortiz