How to add a secondary button to a settings page with a custom action?

It’s not clear to me what the “test” button is for, which I guess could make a difference, but, in general, I have found that to make two buttons work independently on the same options page, the easiest thing is to place them within two separately defined forms, even if the two buttons are going to be placed side by side.

The simplest method is just to create a “mini-form” for the “special” button, and, if need be use a little CSS to place the second button before or above, etc., the “primary” button. So, depending on what else is going on where you are placing the button, if you really need and want the test button to appear first, you could float it to the left. Also, you should note that, though you can style the button produced by “submit_button” using optional parameters (“type,” “attribute” – see Codex), you aren’t obligated to use it with the Settings API: You can produce the same button, and then add whatever selectors or element-styles, with the regular old button html that submit_button() produces.

So, mainly to illustrate:

echo '<form method="post" action="options.php">';

settings_fields('myplugin_settings');

do_settings_sections('myplugin');

echo '<p>';

submit_button(null, 'primary', 'submit', false);

echo '</form>';

echo '
    <form method="post" name="test-button">

         <span id="test-button">

              <input id="test-settings" type="submit" value="Test Settings" class="button" >

         </span>

    </form>
';