Purpose
Mobile App Mgr > App Features lists every feature an app can use after install, its state, and what it still needs. mam-main owns the page; each MAM plugin registers its own features through this filter, so the content lives in the plugin and mam-main renders it. The page has an Overview tab and one tab per plugin that registered features.
This is a different contract from mam_wizard_app_bases, which builds the navigation at install. Features here are per plugin, post-install and repeatable.
Signature
add_filter( 'mam_feature_wizards', function ( array $features ) {
$features['gd-claim-listing'] = array(
'label' => __( 'Claim Listing', 'my-textdomain' ),
'description' => __( 'Lets business owners claim their listing in the app.', 'my-textdomain' ),
'plugin' => 'mam-geodirectory',
'plugin_label' => __( 'GeoDirectory', 'my-textdomain' ),
'admin_page' => 'mam-geodirectory',
'order' => 10,
'complexity' => 'high',
'shows_when' => __( 'Shows on listings that are not yet claimed.', 'my-textdomain' ),
'deps' => array(
array( 'label' => 'GeoDirectory Claim Listings', 'met' => fn() => defined( 'GEODIR_CLAIM_VERSION' ), 'install_url' => '' ),
),
'status' => 'my_gd_claim_status', // callable, returns state + missing[] + done[]
'confirm' => array(
array( 'key' => 'store_products', 'label' => __( 'I created the matching store products', 'my-textdomain' ) ),
),
'setup' => array( 'type' => 'wizard', 'wizard' => 'My_GD_Claim_Wizard' ),
'test' => array( 'label' => __( 'Check payments', 'my-textdomain' ), 'callback' => 'my_gd_claim_test' ),
);
return $features;
} );
The filter starts as an empty array. Register on plugins_loaded or earlier. mam-main reads the registry after init and caches it for the request.
The key is the feature slug: globally unique, kebab-case, prefixed by area (gd-, bd-, push-, …).
Keys
| Key | Type | Required | Meaning |
|---|---|---|---|
label |
string | yes | Row title. |
description |
string | yes | One plain sentence: what the feature does for the app. |
plugin |
string | yes | Owning plugin slug. This is the tab key (&tab=<plugin>). |
plugin_label |
string | yes | Tab label. mam-main’s own tab is “App Platform”. |
admin_page |
string | no | Your admin ?page= slug. The App Features headline button shows there. |
admin_tab |
string | no | For an add-on that lives as a tab on another plugin’s page (for example wc_delivery on mam-woocommerce-settings): the tab query value. The headline button on that tab then opens your plugin’s App Features tab. Without it, the first feature for the page with no admin_tab owns the button. |
order |
int | no | Sort within the tab. Default 50. |
complexity |
low / med / high |
no | Shown as a small tag (Quick / Some steps / Involved). |
shows_when |
string | no | Plain sentence on where or when it appears in the app. |
when |
tsl / after_publish |
no | The feature waits on publishing. Until Tiny Screen Labs creates the app in the stores (the site has a bundle ID), the row shows a grey “Set up by TSL at publish” (tsl) or “After publish” (after_publish) badge, its status check is skipped, it has no Set up or test button and it is left out of the counts. Once the app exists, the row’s normal status check runs. Filter mam_feature_wizards_app_created overrides the bundle ID check. |
optional |
bool | no | true for an extra most apps never turn on (text messages through Twilio, for example). Until it is set up the row shows a grey “Optional” badge instead of “Needs setup”, hides its test and confirm controls, sorts below the other rows and stays off the Overview list. The status API is unchanged: the state is still needs_setup. |
group |
string | no | Heading for a set of rows on the plugin’s tab (for example “For listing owners”). Rows that share the label render together under it; give them consecutive order values. |
group_note |
string | no | One line shown once under the group heading, for what the whole group needs first. Links are allowed. |
deps |
array of {label, met, install_url?, get_url?, get_label?} |
no | met is a bool or a callable. Any unmet dep makes the state not_available and status is not called. install_url is the wp-admin screen that installs it (“Install” link). get_url is an optional outside page to buy or download it, such as a vendor membership, opened in a new tab and labelled get_label (default “Get it”). |
status |
callable | yes | Returns array( 'state' => ..., 'missing' => string[], 'done' => string[] ). |
confirm |
array of {key, label} |
no | Things you cannot detect; the admin ticks them on the page. |
setup |
{type: 'wizard', wizard: <class>} or {type: 'url', url} |
no | Target of the Set up button. |
howto |
URL string or callable returning HTML | no | Opened from How to use, mainly for ready_defaults rows. |
test |
{label, callback} |
no | The callback returns array( 'ok' => bool, 'message' => string ). Run from the row and from wizard steps. |
An entry missing a required key, or with a status that is not callable, is dropped and logged (mamdebug tag feature_wizards). A status callback that throws is shown as needs setup with a pointer to the debug log.
States
| State | Set by | Shown as |
|---|---|---|
not_available |
The registry, from deps |
What to install |
needs_setup |
Your status, or the registry when a confirm key is unticked |
The missing[] list |
ready_defaults |
Your status |
Grey check, How to use |
configured |
Your status |
Green check |
confirmed |
The registry | Green check |
When an entry has confirm keys: all ticked upgrades configured to confirmed; any unticked shows needs_setup with the unticked labels added to missing.
The registry is rebuilt after a test runs, so an entry may compute its confirm list from stored state (mam-main’s Google Maps key offers its confirm box only when the last test found an app-restricted key).
Writing a setup wizard
Wizards use the existing mam_wizard_classes shell (?page=mam-setup-wizard&wizard=<class>). Register your class there as well as in setup. The class needs:
public $wizard_class_name = 'My_GD_Claim_Wizard';
public $wizard_slug = 'my_gd_claim_wizard'; // option names only, not a page
public $wizard_steps = array( /* step => array( name, title, view|render ) */ );
public $always_available = true; // re-runnable
public $hide_wizard_in_header = true; // no "Wizard" headline button
public $auto_launch = false; // never hijack a page
public $return_page = 'mam-app-features&tab=mam-geodirectory';
- The Set up button opens the wizard with
resume=yes, so it always starts at step one, even after a finish. - Finish is a link with
skip-mam-wizard=1; it lands onreturn_page. - Move between steps with
current-step=<step>links. Do not usestep-completein a step: its redirect runs after headers are sent. - A wizard writes only the fields it shows. Never re-save a whole settings screen. Save through your own nonce’d
wp_ajax_handler that checksmanage_options, and reuse existing save and upload code. - Where the feature needs an app button turned on, the last step turns it on with
mam_set_tab_bar_button_visible()or the role-button helpers, behind a clear checkbox ticked by default.
The page’s script (mamFeatureWizards: ajaxUrl, nonce) loads on App Features and on wizard screens of registered features. Inside a step, a button.mam-fw-test[data-slug] runs that feature’s test and writes the result into the nearest .mam-fw-test-result.
Functions
All are global functions in mam-main. Guard with function_exists.
| Function | Returns |
|---|---|
mam_feature_wizards_get(): array |
Normalized, sorted entries, slug => entry. |
mam_feature_wizards_status( string $slug ): array |
state, missing[], done[], deps[] (unmet: label, install_url, get_url, get_label), confirm[] (key, label, ticked). Cached per request. |
mam_feature_wizards_counts( string $plugin = '' ): array |
{ready, total}. Ready = ready_defaults + configured + confirmed; total leaves out not_available. |
mam_feature_confirmed( string $slug, string $key ): bool |
The admin ticked that confirm key. Stored in option mam_feature_wizards_confirmed[slug][key] = {user_id, time}. |
mam_tab_bar_button_visible( string $button_key, string $role = 'mam-all' ): bool |
Any screen of the role shows this listing tab bar button (visible === 'on'). |
mam_set_tab_bar_button_visible( string $button_key, bool $on, string $role = 'mam-all', string $screen_id = '' ): bool |
Changes only that button’s visible flag. See below. |
mam_role_has_button_type( string $role, string $type ): bool |
The role holds a navigation or left-menu button of that content type. |
mam_role_has_button_source( string $role, string $type, string $source = '', string $title = '' ): bool |
Same, and the button points at that source (form id, tag, list) and, when given, has that exact title. |
mam_home_stack_has_section( string $type, string $role = 'mam-all' ): bool |
The role’s home screen stack holds a section of that type (mam-hs-section-type). No fallback to mam-all. |
mam_feature_add_role_button( string $role, string $location, string $type, string $source, string $title, string $icon = '', string $key = '' ): bool |
For a wizard step the admin confirmed: adds a main or left button of that type and source to the role, unless one is already there. Saves through mam_app_settings_set_button (default icon, appended, locked nav respected). A re-run adds nothing while the button is there. If the admin repointed it, a new button is added under a fresh id; an existing button is never overwritten. True when the role has the button afterwards. |
mam_feature_add_home_section( string $type, string $role = 'mam-all', array $settings = array() ): bool |
For a wizard step the admin confirmed: appends a home screen section of that type (ahead of a trailing bottom tab bar) unless the role’s stack already has one. Never removes or reorders. $settings are stored mam-hs-* keys. True when the stack holds it afterwards. |
mam_notification_channel_on( string $slug, string $channel = 'any' ): bool |
The notification type will send on that channel (email, push, sms, or any), by the same test the dispatcher makes: the channel’s saved tick in Notifications Manager, or, while it was never saved, the type’s default_on. |
mam_sms_is_configured(): bool |
mam-main’s Twilio transport has an account SID, token and sender. |
Tab bar helpers
Listing tab bar buttons are stored per screen (button id) in {prefix}mam_app_settings_tab_bar_settings, as button key => {id, title, visible}. The helpers read and write through mam_app_settings_get_tab_bar_settings / mam_app_settings_set_tab_bar_settings, so acct_code scoping and the container navigation lock apply. “The role’s screens” are its main and left buttons from mam_app_settings_get_buttons.
mam_set_tab_bar_button_visible():
- Without
$screen_id, it flips the flag on every screen of the role whose settings already list the button. It never guesses which screens a button belongs on, so it returns false when no screen lists it. - With
$screen_id, it changes that screen only, and turning a button on that the screen never saved adds the entry with the title the content class offers. - Off removes
visible, which is what an unticked App Settings checkbox saves. Every other key round-trips unchanged. - Returns true when at least one screen now matches and no write failed (a locked navigation refuses the write).
Admin AJAX
These are admin endpoints, not app endpoints. Both check manage_options and the mam_feature_wizards nonce (POST nonce).
| Action | POST | Response data |
|---|---|---|
mam_feature_wizards_confirm |
slug, key, checked (1/0) |
slug, state, html (the re-rendered row), counts |
mam_feature_wizards_test |
slug |
the same, plus ok, message |
mam-main’s own features
| Slug | Status | Test |
|---|---|---|
push-notifications |
iOS: bundle id, team id, key id set and the .p8 in the push key store. Android: Firebase project id set and the service account JSON in the key store. Both = configured. | A push to the current admin’s own device tokens (mam_app_ios_pn_token / mam_app_android_pn_token user meta) through MAM_PushDispatcher. |
google-maps-key |
tsl-google-api-key set and the last test of that same key passed. |
One Geocoding API request from the server. A key with application restrictions cannot pass by design; the row then asks for a confirm tick. |
Payment rail status
Features that take payment check the rail through a filter, never through the rail plugin’s options or classes.
| Filter | Answers | Keys |
|---|---|---|
mam_stripe_rail_status |
MAM Stripe Manager 26.45+ | loaded, test_mode, keys_ok, keys_source (mam or woocommerce), getpaid_gateway, webhook_ok, connect_return_ok, enrollment_form_ok |
mam_iap_rail_status |
MAM In App Purchase 26.45+ | loaded, getpaid_gateway, ios_secret_ok, android_key_ok, legal_ok, missing[] |
Call with apply_filters( 'mam_stripe_rail_status', null ). A null result means the rail plugin is not running, so list it in deps. Store-side setup (App Store and Play products, agreements, the Stripe Dashboard) cannot be checked from the site; ask the admin to confirm it with a confirm tick.
Metadata
| Field | Value |
|---|---|
| Article type | Hook Reference |
| Plugin slug | mam-main |
| Applies to plugin version | 26.45.12+ (beta) |
| Category | Extending MAM Suite |
| Hook type | filter |
| Audience | PHP developer / integrator |
| Last verified | 2026-11-04 |
