Function
Admin screens, reports and tools functions
On this page
- rpress_extensions_page()
- rpress_add_ons_get_feed()
- rpress_fetch_items()
- rpress_process_actions()
- rp_addon_activation_notice()
- check_extensions_update()
- rpress_admin_assets()
- rpress_register_dashboard_widgets()
- rpress_dashboard_sales_widget()
- rpress_load_dashboard_sales_widget()
- rpress_dashboard_at_a_glance_widget()
- rpress_export_earnings()
- rpress_export_payment_history()
- rpress_export_all_customers()
- rpress_export_all_fooditems_history()
- rpress_admin_home_page()
- rpress_export_import()
- rpress_process_settings_export()
- rpress_process_settings_import()
- rpress_register_batch_importers()
- rpress_register_payments_batch_import()
- rpress_include_payments_batch_import_processer()
- rpress_register_customers_batch_import()
- rpress_include_customers_batch_import_processer()
- rpress_register_fooditems_batch_import()
- rpress_include_fooditems_batch_import_processer()
- rpress_do_ajax_import_file_upload()
- rpress_do_ajax_import()
- rpress_update_order_status()
- rpress_order_status_supports_transactions()
- rpress_is_order_status_transaction()
- rpress_update_order_status_with_meta()
- rpress_get_order_status()
- rpress_migrate_out_for_delivery_status()
- rpress_trash_order()
- rpress_is_order_trashable()
- rpress_restore_order()
- rpress_is_order_restorable()
- rpress_delete_order()
- rp_render_action_buttons()
- rpress_update_payment_details()
- rpress_trigger_purchase_delete()
- rpress_trigger_trash_order()
- rpress_trigger_restore_order()
- rpress_trigger_destroy_order()
- rpress_ajax_store_payment_note()
- rpress_trigger_payment_note_deletion()
- rpress_ajax_delete_payment_note()
- rpress_orders_list_table_process_bulk_actions()
- rpress_trigger_refresh_pending_count()
- rpress_payments_contextual_help()
- rpress_payment_history_page()
- rpress_view_order_details_title()
- rpress_override_edit_post_for_payment_link()
- rpress_plugin_action_links()
- rpress_plugin_row_meta()
- rpress_reporting_contextual_help()
- rpress_process_batch_export_fooditem()
- rpress_export_all_customers()
- rpress_export_all_fooditems_history()
- rpress_register_batch_exporters()
- rpress_register_payments_batch_export()
- rpress_include_payments_batch_processer()
- rpress_register_customers_batch_export()
- rpress_include_customers_batch_processer()
- rpress_register_fooditems_batch_export()
- rpress_include_fooditems_batch_processer()
- rpress_register_file_fooditems_batch_export()
- rpress_include_file_fooditems_batch_processer()
- rpress_register_sales_export_batch_export()
- rpress_include_sales_export_batch_processer()
- rpress_register_earnings_report_batch_export()
- rpress_include_earnings_report_batch_processer()
- rpress_register_reports_intelligence_batch_export()
- rpress_include_reports_intelligence_batch_processer()
- rpress_register_api_requests_batch_export()
- rpress_include_api_requests_batch_processer()
- rpress_is_allowed_export_class()
- rpress_do_ajax_export()
- rpress_reports_graph()
- rpress_reports_graph_of_fooditem()
- rpress_reports_graph_controls()
- rpress_get_report_dates()
- rpress_parse_report_dates()
- rpress_reports_refresh_button()
- rpress_run_refresh_reports_transients()
- rpress_reports_metric_card()
- rpress_reports_trend_svg()
- rpress_reports_svg_points()
- rpress_reports_menu_rows()
- rpress_reports_named_amount_rows()
- rpress_reports_sum_key()
- rpress_reports_single_trend_svg()
- rpress_reports_service_rows()
- rpress_reports_payment_rows()
- rpress_reports_bar_list()
- rpress_reports_count_bar_list()
- rpress_reports_status_timeline()
- rpress_reports_rush_heatmap()
- rpress_reports_risk_period_rows()
- rpress_reports_sales_heatmap()
- rpress_reports_page()
- rpress_reports_intelligence_filters()
- rpress_reports_tab_coming_next()
- rpress_reports_default_views()
- rpress_get_reporting_view()
- rpress_reports_tab_reports()
- rpress_report_views()
- rpress_reports_fooditems_table()
- rpress_reports_fooditem_details()
- rpress_reports_gateways_table()
- rpress_reports_earnings()
- rpress_reports_categories()
- rpress_reports_addons()
- rpress_reports_taxes()
- rpress_estimated_monthly_stats()
- rpress_reports_tab_customers()
- rpress_reports_tab_export()
- rpress_reports_export_cards()
- rpress_reports_render_export_card()
- rpress_reports_export_period_label()
- rpress_reports_export_filter_label()
- rpress_reports_tab_menu()
- rpress_reports_tab_orders_risk()
- rpress_reports_tab_overview()
- rpress_reports_tab_payments_recovery()
- rpress_reports_tab_sales()
- rpress_reports_tab_taxes_intelligence()
- rpress_media_button()
- rpress_admin_footer_for_thickbox()
- rpress_tools_page()
- rpress_get_tools_tabs()
- rpress_map_legacy_tools_tab()
- rpress_tools_health_check_display()
- rpress_tools_get_health_checks()
- rpress_tools_get_status_label()
- rpress_tools_banned_emails_display()
- rpress_tools_recount_stats_display()
- rpress_tools_clear_doing_upgrade_display()
- rpress_tools_menu_utilities_display()
- rpress_tools_order_utilities_display()
- rpress_tools_count_fooditems_missing_meta()
- rpress_tools_count_fooditems_missing_thumbnail()
- rpress_tools_count_fooditems_missing_terms()
- rpress_tools_betas_display()
- rpress_tools_customer_access_guidance_display()
- rpress_get_beta_enabled_extensions()
- rpress_extension_has_beta_support()
- rpress_tools_enabled_betas_save()
- rpress_tools_enabled_betas_sanitize_value()
- rpress_tools_banned_emails_save()
- rpress_tools_clear_upgrade_notice()
- rpress_tools_import_export_display()
- rpress_tools_import_export_process_export()
- rpress_tools_import_export_process_import()
- rpress_settings_render_config_io()
- rpress_menu_export_page()
- rpress_menu_export_inline_assets()
- rpress_menu_csv_importer_form()
- rpress_tools_debug_log_display()
- rpress_handle_submit_debug_log()
- rpress_tools_diagnostics_display()
- rpress_tools_get_diagnostics_summary()
- rpress_tools_sysinfo_display()
- rpress_tools_sysinfo_get()
- rpress_tools_sysinfo_fooditem()
- rpress_register_batch_recount_store_earnings_tool()
- rpress_include_recount_store_earnings_tool_batch_processer()
- rpress_register_batch_recount_fooditem_tool()
- rpress_include_recount_fooditem_tool_batch_processer()
- rpress_register_batch_recount_all_tool()
- rpress_include_recount_all_tool_batch_processer()
- rpress_register_batch_reset_tool()
- rpress_include_reset_tool_batch_processer()
- rpress_register_batch_customer_recount_tool()
- rpress_include_customer_recount_tool_batch_processer()
- rpress_change_fooditems_upload_dir()
- rpress_create_protection_files()
- rpress_htaccess_exists()
- rpress_scan_folders()
- rpress_get_htaccess_rules()
- wp_is_writable()
Functions behind the admin screens: reports, tools, import and export, and list tables.
182 functions. Each entry shows the signature, parameters, return value and where it is defined. Functions marked internal are hook callbacks, screen renderers and other plumbing that extensions normally do not call.
rpress_extensions_page()#
Renders the Extensions & Apps admin page.
Builds the page markup in an output buffer and echoes it. Includes the All, Active and Inactive status filter chips and the extension grid.
rpress_extensions_page()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/add-ons.php, line 21.
rpress_add_ons_get_feed()#
Outputs the extension cards from the cached extensions feed.
Reads the restropress_add_ons_feed transient, falling back to rpress_fetch_items(). Filters by the status query argument (all, active, inactive) using class_exists() on each item's class name, then echoes the card grid or an empty-state message.
rpress_add_ons_get_feed()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/add-ons.php, line 73.
rpress_fetch_items()#
Fetches the extensions list from the RestroPress server and caches it for one hour.
Requests the restropress-server REST endpoint on restropress.com and decodes the JSON body. On success the decoded result is stored in the restropress_add_ons_feed transient for 3600 seconds. SSL verification can be toggled with the rpress_remote_request_verify_ssl filter.
rpress_fetch_items()
Returns array|object|string: Decoded feed on success, an empty array if the response body is empty, or an HTML error notice string if the request fails.
Example
$items = get_transient( 'restropress_add_ons_feed' );
if ( ! $items ) {
$items = rpress_fetch_items();
}
Note: On a failed request it returns an HTML error string, not an array. Callers should check is_array().
Defined in includes/admin/add-ons.php, line 213.
rpress_process_actions()#
Dispatches the rpress-action request argument to a matching rpress_ action hook.
In the admin for logged-in users, reads rpress-action from $_POST and then $_GET, sanitizes it with sanitize_key(), and fires do_action( 'rpress_' . $action ) with the sanitized request array as the only argument.
rpress_process_actions()
Note: Does nothing outside wp-admin or for logged-out users. Nonce and capability checks are left to the callbacks hooked to each action.
Internal. Defined in includes/admin/admin-actions.php, line 20.
rp_addon_activation_notice()#
Prints an admin error notice when an active extension has an empty or invalid license.
Loads the extensions feed, and for each extension whose class exists, reads the {text_domain}_license_status option. If any is missing or invalid, echoes an error notice pointing to the Extensions page.
rp_addon_activation_notice()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/admin-actions.php, line 44.
check_extensions_update()#
Registers each installed RestroPress extension with the license and update checker.
Runs only in wp-admin, WP-Cron or WP-CLI. Compares installed plugins against the extensions feed (by text domain) and against the author names magnigenie, magnigeeks and restropress, builds name/version data for each, and instantiates RestroPress_License for them.
check_extensions_update()
Note: The function name has no rpress_ prefix.
Internal. Defined in includes/admin/admin-actions.php, line 75.
rpress_admin_assets()#
Returns the shared RP_Admin_Assets instance.
Creates the RP_Admin_Assets object on first call and returns the same instance afterwards.
rpress_admin_assets()
Returns RP_Admin_Assets: The admin assets singleton.
Example
$assets = rpress_admin_assets();
Defined in includes/admin/class-rp-admin-assets.php, line 2338.
rpress_register_dashboard_widgets()#
Registers the RestroPress Sales Summary dashboard widget.
Adds the rpress_dashboard_sales widget when the current user has the capability returned by the rpress_dashboard_stats_cap filter, which defaults to view_shop_reports.
rpress_register_dashboard_widgets()
Internal. Defined in includes/admin/dashboard-widgets.php, line 20.
rpress_dashboard_sales_widget()#
Outputs the loading placeholder for the Sales Summary dashboard widget.
Echoes a loading image. The widget body is filled in afterwards by rpress_load_dashboard_sales_widget().
rpress_dashboard_sales_widget( )
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/dashboard-widgets.php, line 37.
rpress_load_dashboard_sales_widget()#
Outputs the Sales Summary dashboard widget content for an AJAX request.
Stops with die() if the user lacks the capability from the rpress_dashboard_stats_cap filter (default view_shop_reports). Otherwise uses RPRESS_Payment_Stats to print earnings and sales for this month, last month, today and in total.
rpress_load_dashboard_sales_widget( )
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/dashboard-widgets.php, line 46.
rpress_dashboard_at_a_glance_widget()#
Adds the menu item count to the At a Glance dashboard widget.
Counts published fooditem posts and appends a link (or plain text when the user cannot edit_products) to the items array.
rpress_dashboard_at_a_glance_widget( $items )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$items | array | Required | Existing At a Glance entries. |
Returns array: The entries with the menu item count appended when at least one menu item is published.
Internal. Defined in includes/admin/dashboard-widgets.php, line 202.
rpress_export_earnings()#
Starts the earnings CSV export.
Loads the earnings export class and calls export() on a new RPRESS_Earnings_Export object.
rpress_export_earnings()
Note: The export class streams a download and ends the request.
Internal. Defined in includes/admin/export-functions.php, line 22.
rpress_export_payment_history()#
Starts the order history CSV export.
Loads the payments export class and calls export() on a new RPRESS_Payments_Export object.
rpress_export_payment_history()
Note: The export class streams a download and ends the request.
Internal. Defined in includes/admin/export-functions.php, line 35.
rpress_export_all_customers()#
Starts the customers CSV export.
Loads the customers export class and calls export() on a new RPRESS_Customers_Export object.
rpress_export_all_customers()
Note: The export class streams a download and ends the request. A second function with the same name is defined in the reporting export actions file.
Internal. Defined in includes/admin/export-functions.php, line 50.
rpress_export_all_fooditems_history()#
Starts the menu items CSV export.
Loads the menu item history export class and calls export() on a new RPRESS_Fooditem_History_Export object.
rpress_export_all_fooditems_history()
Note: The export class streams a download and ends the request. A second function with the same name is defined in the reporting export actions file.
Internal. Defined in includes/admin/export-functions.php, line 62.
rpress_admin_home_page()#
Renders the RestroPress setup and launch hub page.
Loads the RPress_Onboarding class if needed and calls its render() method.
rpress_admin_home_page()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/home/rpress-home.php, line 15.
rpress_export_import()#
Renders the Import / Export Settings screen notice.
Prints a message directing users to the Reports page, Export tab, for exporting shop data.
rpress_export_import()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/import-export.php, line 13.
rpress_process_settings_export()#
Downloads the plugin settings as a JSON file.
Requires a valid rpress_export_nonce and the manage_shop_settings capability, else returns silently. Collects the rpress_general, rpress_gateways, rpress_emails, rpress_styles, rpress_taxes, rpress_extensions and rpress_misc options, sends them as a JSON attachment named rpress-settings-export-{m-d-Y}.json and calls exit.
rpress_process_settings_export()
Note: Sends headers and ends the request on success.
Internal. Defined in includes/admin/import-export.php, line 74.
rpress_process_settings_import()#
Imports plugin settings from an uploaded JSON file.
Requires a valid rpress_import_nonce and the manage_shop_settings capability, else returns silently. Reads the uploaded import_file, decodes it and overwrites the rpress_general, rpress_gateways, rpress_emails, rpress_styles, rpress_taxes, rpress_extensions and rpress_misc options, then redirects to the tools export/import page and exits.
rpress_process_settings_import()
Note: Overwrites existing settings without a merge. Ends the request with a redirect.
Internal. Defined in includes/admin/import-export.php, line 106.
rpress_register_batch_importers()#
Fires the hook that lets extensions register batch importers.
In the admin, fires do_action( 'rpress_register_batch_importer' ).
rpress_register_batch_importers()
Internal. Defined in includes/admin/import/import-actions.php, line 19.
rpress_register_payments_batch_import()#
Registers the loader for the orders batch importer class.
Hooks rpress_include_payments_batch_import_processer() to rpress_batch_import_class_include.
rpress_register_payments_batch_import()
Internal. Defined in includes/admin/import/import-actions.php, line 30.
rpress_include_payments_batch_import_processer()#
Loads the orders batch import class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Payments_Import.
rpress_include_payments_batch_import_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch import class being requested. |
Internal. Defined in includes/admin/import/import-actions.php, line 41.
rpress_register_customers_batch_import()#
Registers the loader for the customers batch importer class.
Hooks rpress_include_customers_batch_import_processer() to rpress_batch_import_class_include.
rpress_register_customers_batch_import()
Internal. Defined in includes/admin/import/import-actions.php, line 51.
rpress_include_customers_batch_import_processer()#
Loads the customers batch import class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Customers_Import.
rpress_include_customers_batch_import_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch import class being requested. |
Internal. Defined in includes/admin/import/import-actions.php, line 62.
rpress_register_fooditems_batch_import()#
Registers the loader for the menu items batch importer class.
Hooks rpress_include_fooditems_batch_import_processer() to rpress_batch_import_class_include.
rpress_register_fooditems_batch_import()
Internal. Defined in includes/admin/import/import-actions.php, line 72.
rpress_include_fooditems_batch_import_processer()#
Loads the menu items batch import class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_FoodItems_Import.
rpress_include_fooditems_batch_import_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch import class being requested. |
Internal. Defined in includes/admin/import/import-actions.php, line 83.
rpress_do_ajax_import_file_upload()#
Handles the AJAX upload of a CSV file for a batch import.
Verifies the rpress_ajax_import nonce, checks the file is a CSV MIME type, saves it with wp_handle_upload(), fires rpress_batch_import_class_include and instantiates the requested import class. Responds with wp_send_json_error() on failure and with the upload details on success.
rpress_do_ajax_import_file_upload()
Note: AJAX handler. Ends the request with a JSON response.
Internal. Defined in includes/admin/import/import-functions.php, line 20.
rpress_do_ajax_import()#
Processes one step of a batch import over AJAX.
Verifies the rpress_ajax_import nonce, loads the requested import class, checks can_import(), applies the posted field mapping and runs process_step(). Responds with the next step, percentage and column data, an error if no data was found, or a completion message.
rpress_do_ajax_import()
Note: AJAX handler. Ends the request with a JSON response.
Internal. Defined in includes/admin/import/import-functions.php, line 92.
rpress_update_order_status()#
Changes an order's status and reports whether it succeeded.
Wrapper around rpress_update_order_status_with_meta() with no extra metadata. Fires rpress_update_order_status with the payment ID and new status when the status changes. Setting completed also sets the payment status to publish.
rpress_update_order_status( $payment_id = 0, $new_status = 'completed', $expected_status = null )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | 0 | Order (payment) ID. |
$new_status | string | 'completed' | New order status, for example pending, accepted, processing, ready, transit, cancelled or completed. |
$expected_status | string|null | null | If set, the update only happens when the current order status matches this value. |
Returns bool: True if the status was saved or was already the requested value; false on a stale expected status, a missing ID or a storage error.
Example
$updated = rpress_update_order_status( 123, 'ready' );
if ( ! $updated ) {
error_log( 'Order 123 status was not changed.' );
}
Note: WP_Error results from the underlying function are collapsed to false. This function does not check user capabilities.
Defined in includes/admin/orders/actions.php, line 19.
rpress_order_status_supports_transactions()#
Checks whether order status updates can use an InnoDB transaction.
Checks once per request that the posts and postmeta tables both use InnoDB. The result is passed through the rpress_order_status_use_transaction filter, which can force either path.
rpress_order_status_supports_transactions()
Returns bool: True when a locked transaction should be used.
Internal. Defined in includes/admin/orders/actions.php, line 34.
rpress_is_order_status_transaction()#
Checks whether an order status save is currently in progress.
Reads the internal rpress_order_status_saving global that is set while order status meta is being written. With a payment ID it checks that order; with 0 it checks whether any order is being saved.
rpress_is_order_status_transaction( $payment_id = 0 )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | 0 | Order ID, or 0 to check for any order in progress. |
Returns bool: True if a status save is in progress.
Note: Intended for hook callbacks that need to detect writes made by the status updater.
Internal. Defined in includes/admin/orders/actions.php, line 59.
rpress_update_order_status_with_meta()#
Saves an order status and related meta together, then fires the status hooks.
Uses a short InnoDB transaction with a row lock on the order when supported, otherwise a non-transactional path. Only these meta keys are accepted in $order_meta: dinein_order_current_time, dinein_order_take_time, rp_order_cancel_reason, _rpress_payment_gateway, _rpress_kds_completed_by, _rpress_kds_completed_at. Hooks run after commit: rpress_update_order_status fires with the payment ID and new status, and completed also sets the payment status to publish.
rpress_update_order_status_with_meta( $payment_id, $new_status, $expected_status = null, $order_meta = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
$new_status | string | Required | New order status, sanitized with sanitize_key(). |
$expected_status | string|null | null | If set, the update only runs when the current order status matches. |
$order_meta | array | array() | Extra meta to save with the status as key => scalar value pairs. Only the allowed keys are accepted. |
Returns bool|WP_Error: True if saved or already current; false for a stale expected status, an invalid ID or status, a missing order or a nested call for the same order; WP_Error for invalid meta keys or non-scalar values and for storage failures.
Example
$result = rpress_update_order_status_with_meta( 123, 'cancelled', 'pending', array(
'rp_order_cancel_reason' => 'Out of stock',
) );
if ( is_wp_error( $result ) ) {
error_log( $result->get_error_message() );
}
Note: Refuses to start while another transaction is active. Does not check user capabilities.
Defined in includes/admin/orders/actions.php, line 74.
rpress_get_order_status()#
Returns the stored order status for an order.
Reads the _order_status meta, defaulting to pending when empty. The retired out_for_delivery value is returned as transit. The result is filtered through rp_get_order_status.
rpress_get_order_status( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns string|null: The order status slug, or null when $payment_id is empty.
Example
$status = rpress_get_order_status( 123 );
if ( 'ready' === $status ) {
// The order is ready for pickup or dispatch.
}
Note: This is the fulfilment status, separate from the payment status.
Defined in includes/admin/orders/actions.php, line 196.
rpress_migrate_out_for_delivery_status()#
Rewrites stored out_for_delivery order statuses to transit once.
Runs a single update on the postmeta table for _order_status and records completion in the rpress_ofd_status_migrated option so it does not run again.
rpress_migrate_out_for_delivery_status()
Internal. Defined in includes/admin/orders/actions.php, line 217.
rpress_trash_order()#
Moves an order to the trash.
Returns false when rpress_is_order_trashable() says no. Otherwise calls wp_trash_post() and stores the previous status in the _pre_trash_status meta so the order can be restored.
rpress_trash_order( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns bool: True if the order was trashed, false otherwise.
Example
if ( rpress_is_order_trashable( 123 ) ) {
rpress_trash_order( 123 );
}
Note: Does not check user capabilities.
Defined in includes/admin/orders/actions.php, line 239.
rpress_is_order_trashable()#
Checks whether an order can be moved to the trash.
An order is trashable unless its status is in the list returned by the rpress_non_trashable_statuses filter (default: trash). The final result passes through the rpress_is_order_trashable filter with the payment object.
rpress_is_order_trashable( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns bool: True if the order can be trashed; false if the order does not exist or is not trashable.
Defined in includes/admin/orders/actions.php, line 267.
rpress_restore_order()#
Restores a trashed order.
Returns false unless the order is currently in the trash and has a saved _pre_trash_status meta value. Sets the post status to processing with wp_update_post().
rpress_restore_order( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns bool: True if the order was restored, false otherwise.
Note: The restored post status is always processing, not the status stored in _pre_trash_status. Does not check user capabilities.
Defined in includes/admin/orders/actions.php, line 289.
rpress_is_order_restorable()#
Checks whether an order can be restored from the trash.
An order is restorable when its status is trash. The result passes through the rpress_is_order_restorable filter with the payment object.
rpress_is_order_restorable( $payment_id )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | Required | Order (payment) ID. |
Returns bool: True if the order exists and is in the trash.
Defined in includes/admin/orders/actions.php, line 320.
rpress_delete_order()#
Permanently deletes an order and its related data.
Undoes the purchase, reverses earnings and customer totals when the order was trashed, removes the order from the customer record, deletes the status meta and the post, and deletes sale logs for the order. Fires rpress_payment_delete before and rpress_payment_deleted after.
rpress_delete_order( $payment_id = 0, $update_customer = true, $delete_fooditem_logs = false )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_id | int | 0 | Order (payment) ID. |
$update_customer | bool | true | Whether to update the customer's purchase count and lifetime value. |
$delete_fooditem_logs | bool | false | Whether to also delete file download logs for the order. |
Note: Permanent. Does not check user capabilities. The docblock says it returns 1 or false, but the function returns nothing.
Defined in includes/admin/orders/actions.php, line 339.
rp_render_action_buttons()#
Builds HTML for order action buttons used in list tables.
Loops through the action definitions and returns an anchor element for each entry that has action and name keys. Group entries are skipped.
rp_render_action_buttons( $actions )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$actions | array | Required | Action definitions. |
Returns string: HTML for the action buttons, or an empty string.
Internal. Defined in includes/admin/orders/actions.php, line 403.
rpress_update_payment_details()#
Saves the order edit form submitted from the order details screen.
Checks the rpress_update_payment_details_nonce and the edit_shop_payments capability. Updates service type, time and date meta, order items, add-ons, totals, customer, date and status, adds notes, saves the payment, updates the order status when changed, fires rpress_update_edited_purchase and rpress_updated_edited_purchase, then redirects with a payment-updated message and exits.
rpress_update_payment_details( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Submitted form data, including rpress_payment_id. |
Note: Admin action handler. Ends the request with a redirect.
Internal. Defined in includes/admin/payments/actions.php, line 20.
rpress_trigger_purchase_delete()#
Deletes an order from an admin action link.
Verifies the rpress_payment_nonce and the delete_shop_payments capability, calls rpress_delete_purchase(), redirects to the order history with a payment_deleted message and ends the request. Does nothing when the nonce is invalid.
rpress_trigger_purchase_delete( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data with _wpnonce and purchase_id. |
Note: Admin action handler.
Internal. Defined in includes/admin/payments/actions.php, line 296.
rpress_trigger_trash_order()#
Trashes an order from an admin action link.
Verifies the rpress_payment_nonce and the delete_shop_payments capability, then calls rpress_trash_order().
rpress_trigger_trash_order( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data with _wpnonce and purchase_id. |
Note: Admin action handler. It builds a redirect URL but does not redirect.
Internal. Defined in includes/admin/payments/actions.php, line 316.
rpress_trigger_restore_order()#
Restores a trashed order from an admin action link.
Verifies the rpress_payment_nonce and the delete_shop_payments capability, then calls rpress_restore_order().
rpress_trigger_restore_order( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data with _wpnonce and purchase_id. |
Note: Admin action handler. It builds a redirect URL but does not redirect.
Internal. Defined in includes/admin/payments/actions.php, line 330.
rpress_trigger_destroy_order()#
Permanently deletes an order from an admin action link.
Verifies the rpress_payment_nonce and the delete_shop_payments capability, then calls rpress_delete_order().
rpress_trigger_destroy_order( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data with _wpnonce and purchase_id. |
Note: Admin action handler. It builds a redirect URL but does not redirect.
Internal. Defined in includes/admin/payments/actions.php, line 351.
rpress_ajax_store_payment_note()#
Adds an order note over AJAX.
Checks the rpress-payment-note nonce and the edit_shop_payments capability, stores the note with rpress_insert_payment_note() and outputs the note HTML. Ends with die( '-1' ) when the order ID or note is empty.
rpress_ajax_store_payment_note()
Note: AJAX handler. Echoes output and ends the request.
Internal. Defined in includes/admin/payments/actions.php, line 367.
rpress_trigger_payment_note_deletion()#
Deletes an order note from an admin action link.
Verifies the nonce for the note and the edit_shop_payments capability, deletes the note with rpress_delete_payment_note() and redirects to the order details screen.
rpress_trigger_payment_note_deletion( $data )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data with _wpnonce, note_id and payment_id. |
Note: Admin action handler.
Internal. Defined in includes/admin/payments/actions.php, line 406.
rpress_ajax_delete_payment_note()#
Deletes an order note over AJAX.
Checks the rpress-payment-note nonce and the edit_shop_payments capability, then deletes the note. Outputs 1 on success and -1 on failure and ends the request.
rpress_ajax_delete_payment_note()
Note: AJAX handler. Echoes output and ends the request.
Internal. Defined in includes/admin/payments/actions.php, line 423.
rpress_orders_list_table_process_bulk_actions()#
Runs bulk actions chosen on the Orders list table.
Applies to the rpress-payment-history page only. Checks the bulk nonce and the capability (delete_shop_payments for delete actions, edit_shop_payments otherwise), then loops over the selected orders. Supports trash, restore, delete, payment status changes, order status changes and resending receipts. Fires rpress_payments_table_do_bulk_action for each order and redirects back.
rpress_orders_list_table_process_bulk_actions()
Note: Admin handler. Ends the request with a redirect.
Internal. Defined in includes/admin/payments/actions.php, line 444.
rpress_trigger_refresh_pending_count()#
Recalculates the pending orders count from an admin action link.
Requires the refresh_pending_count rpress-action, a valid rpress_refresh_pending_count_nonce and the edit_shop_payments capability. Calls rpress_recount_pending_orders_count() and redirects with a pending_count_refreshed message.
rpress_trigger_refresh_pending_count()
Note: Admin handler. Ends the request with a redirect.
Internal. Defined in includes/admin/payments/actions.php, line 579.
rpress_payments_contextual_help()#
Fires the Orders screen contextual help hook.
On the restropress_page_rpress-payment-history screen, fires rpress_payments_contextual_help with the screen object.
rpress_payments_contextual_help()
Internal. Defined in includes/admin/payments/contextual-help.php, line 20.
rpress_payment_history_page()#
Renders the Orders admin page.
Chooses between the order details view, the live orders view and the orders list table based on the view query argument and the live_orders_default_view option, then outputs the page.
rpress_payment_history_page()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/payments/payments-history.php, line 22.
rpress_view_order_details_title()#
Filters the admin page title for order detail screens.
On the order history screen, prefixes the title with View Order Details or Edit Payment depending on the rpress-action query argument.
rpress_view_order_details_title( $admin_title, $title )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$admin_title | string | Required | Current admin title. |
$title | string | Required | Page title (replaced by the function). |
Returns string: The adjusted admin title.
Internal. Defined in includes/admin/payments/payments-history.php, line 424.
rpress_override_edit_post_for_payment_link()#
Rewrites edit links for orders to the order details screen.
For rpress_payment posts, returns the admin.php?page=rpress-payment-history&view=view-order-details URL for the post.
rpress_override_edit_post_for_payment_link( $url, $post_id = 0, $context = null )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$url | string | Required | Original edit link. |
$post_id | int | 0 | Post ID. |
$context | string|null | null | Link context. |
Returns string: The order details URL for order posts, otherwise the original URL.
Internal. Defined in includes/admin/payments/payments-history.php, line 453.
rpress_plugin_action_links()#
Adds a General Settings link to the plugin row actions.
Prepends a link to the rpress-settings page when the plugin file matches restro-press/restro-press.php.
rpress_plugin_action_links( $links, $file )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$links | array | Required | Existing action links. |
$file | string | Required | Plugin file being processed. |
Returns array: The action links.
Internal. Defined in includes/admin/plugins.php, line 22.
rpress_plugin_row_meta()#
Adds Extensions and Documentation links to the plugin row meta.
Appends links to restropress.com/extensions and docs.restropress.com when the plugin file matches restropress/restro-press.php.
rpress_plugin_row_meta( $input, $file )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | array | Required | Existing meta links. |
$file | string | Required | Plugin file being processed. |
Returns array: The meta links.
Internal. Defined in includes/admin/plugins.php, line 38.
rpress_reporting_contextual_help()#
Fires the Reports screen contextual help hook.
On the restropress_page_rpress-reports screen, fires rpress_reports_contextual_help with the screen object.
rpress_reporting_contextual_help()
Internal. Defined in includes/admin/reporting/contextual-help.php, line 20.
rpress_process_batch_export_fooditem()#
Downloads the file produced by a batch export.
Verifies the rpress-batch-export nonce, fires rpress_batch_export_class_include, validates the class with rpress_is_allowed_export_class() and calls export() on a new instance.
rpress_process_batch_export_fooditem()
Note: Admin handler. Ends the request with wp_die() on failure.
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 19.
rpress_export_all_customers()#
Starts the customers CSV export.
Loads the customers export class and calls export() on a new RPRESS_Customers_Export object.
rpress_export_all_customers()
Note: The export class streams a download and ends the request. A second function with the same name is defined in the admin export functions file.
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 42.
rpress_export_all_fooditems_history()#
Starts the menu items CSV export.
Loads the menu item history export class and calls export() on a new RPRESS_RestroPress_History_Export object.
rpress_export_all_fooditems_history()
Note: The export class streams a download and ends the request. A second function with the same name is defined in the admin export functions file and uses a different class.
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 54.
rpress_register_batch_exporters()#
Fires the hook that lets extensions register batch exporters.
In the admin, fires do_action( 'rpress_register_batch_exporter' ).
rpress_register_batch_exporters()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 66.
rpress_register_payments_batch_export()#
Registers the loader for the orders batch exporter class.
Hooks rpress_include_payments_batch_processer() to rpress_batch_export_class_include.
rpress_register_payments_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 76.
rpress_include_payments_batch_processer()#
Loads the orders batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Payments_Export.
rpress_include_payments_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 87.
rpress_register_customers_batch_export()#
Registers the loader for the customers batch exporter class.
Hooks rpress_include_customers_batch_processer() to rpress_batch_export_class_include.
rpress_register_customers_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 96.
rpress_include_customers_batch_processer()#
Loads the customers batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Customers_Export.
rpress_include_customers_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 107.
rpress_register_fooditems_batch_export()#
Registers the loader for the menu items batch exporter class.
Hooks rpress_include_fooditems_batch_processer() to rpress_batch_export_class_include.
rpress_register_fooditems_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 117.
rpress_include_fooditems_batch_processer()#
Loads the menu items batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_RestroPress_Export.
rpress_include_fooditems_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 128.
rpress_register_file_fooditems_batch_export()#
Registers the loader for the file orders batch exporter class.
Hooks rpress_include_file_fooditems_batch_processer() to rpress_batch_export_class_include.
rpress_register_file_fooditems_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 137.
rpress_include_file_fooditems_batch_processer()#
Loads the file orders batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_File_Orders_Export.
rpress_include_file_fooditems_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 148.
rpress_register_sales_export_batch_export()#
Registers the loader for the sales batch exporter class.
Hooks rpress_include_sales_export_batch_processer() to rpress_batch_export_class_include.
rpress_register_sales_export_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 158.
rpress_include_sales_export_batch_processer()#
Loads the sales batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Sales_Export.
rpress_include_sales_export_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 169.
rpress_register_earnings_report_batch_export()#
Registers the loader for the earnings report batch exporter class.
Hooks rpress_include_earnings_report_batch_processer() to rpress_batch_export_class_include.
rpress_register_earnings_report_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 179.
rpress_include_earnings_report_batch_processer()#
Loads the earnings report batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Earnings_Report_Export.
rpress_include_earnings_report_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 190.
rpress_register_reports_intelligence_batch_export()#
Registers the loader for the reports intelligence batch exporter class.
Hooks rpress_include_reports_intelligence_batch_processer() to rpress_batch_export_class_include.
rpress_register_reports_intelligence_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 200.
rpress_include_reports_intelligence_batch_processer()#
Loads the reports intelligence batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_Report_Intelligence_Export.
rpress_include_reports_intelligence_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 211.
rpress_register_api_requests_batch_export()#
Registers the loader for the API requests batch exporter class.
Hooks rpress_include_api_requests_batch_processer() to rpress_batch_export_class_include.
rpress_register_api_requests_batch_export()
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 221.
rpress_include_api_requests_batch_processer()#
Loads the API requests batch export class file when it is requested.
Requires the class file only when $class is RPRESS_Batch_API_Requests_Export.
rpress_include_api_requests_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Name of the batch export class being requested. |
Internal. Defined in includes/admin/reporting/export/export-actions.php, line 232.
rpress_is_allowed_export_class()#
Checks whether a class name is a permitted batch export class.
Returns true only when the class exists, is a subclass of RPRESS_Batch_Export and the current user passes the capability check. That check is current_user_can( 'export_shop_reports' ), filterable through rpress_export_capability.
rpress_is_allowed_export_class( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name to check. |
Returns bool: True if the class may be run as a batch export.
Example
if ( rpress_is_allowed_export_class( 'RPRESS_Batch_Payments_Export' ) ) {
// Safe to run this batch export for the current user.
}
Note: Call it after the class file has been loaded through the rpress_batch_export_class_include action, otherwise class_exists() fails.
Defined in includes/admin/reporting/export/export-functions.php, line 31.
rpress_do_ajax_export()#
Processes one step of a batch export over AJAX.
Verifies the rpress_ajax_export nonce, loads and validates the export class, runs process_step() and echoes a JSON response with the next step and percentage, an error, a completion message or the download URL when finished.
rpress_do_ajax_export()
Note: AJAX handler. Echoes output and ends the request.
Internal. Defined in includes/admin/reporting/export/export-functions.php, line 47.
rpress_reports_graph()#
Outputs the earnings and sales graph for the selected report period.
Reads the date range from rpress_get_report_dates(), gets sales and earnings from RPRESS()->payment_stats and prints the graph. The exclude_taxes query argument controls whether taxes are included.
rpress_reports_graph()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/graphing.php, line 20.
rpress_reports_graph_of_fooditem()#
Outputs the earnings and sales graph for one menu item.
Uses the same date range logic as rpress_reports_graph() but limits the stats to the given menu item.
rpress_reports_graph_of_fooditem($fooditem_id = 0)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$fooditem_id | int | 0 | Menu item (fooditem) post ID. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/graphing.php, line 382.
rpress_reports_graph_controls()#
Outputs the report date range filter controls.
Prints the range selector, with options filterable through rpress_report_date_options, the custom date fields and the tax toggle.
rpress_reports_graph_controls()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/graphing.php, line 614.
rpress_get_report_dates()#
Builds the date parameters used to filter report graphs.
Reads range, year, month and day values from the query string, with rpress_get_report_dates_default_range filtering the default range (last_30_days), and resolves named ranges such as this_month or last_quarter into start and end values.
rpress_get_report_dates()
Returns array: Date parameters including range, year, year_end, m_start, m_end, day and day_end.
Example
$dates = rpress_get_report_dates();
$range = $dates['range'];
Note: Reads from $_GET, so it reflects the current admin request.
Defined in includes/admin/reporting/graphing.php, line 716.
rpress_parse_report_dates()#
Redirects to the reports page with the resolved date parameters.
Builds a reports URL carrying the resolved dates, view, fooditem-id and exclude_taxes values from the request, redirects with wp_safe_redirect() and ends the request.
rpress_parse_report_dates($data)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data (unused). |
Note: Admin handler. Ends the request with a redirect.
Internal. Defined in includes/admin/reporting/graphing.php, line 867.
rpress_reports_refresh_button()#
Outputs the Refresh Reports button.
Echoes a nonce-protected link that fires the refresh_reports_transients action.
rpress_reports_refresh_button()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/graphing.php, line 882.
rpress_run_refresh_reports_transients()#
Clears the cached report statistics.
Checks the rpress-refresh-reports nonce, then deletes the transients rpress_stats_earnings, rpress_stats_sales, rpress_estimated_monthly_stats, rpress_earnings_total and the hashed this-month and today earnings transients.
rpress_run_refresh_reports_transients($data)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$data | array | Required | Request data containing _wpnonce. |
Internal. Defined in includes/admin/reporting/graphing.php, line 899.
rpress_reports_metric_card()#
Outputs one metric card for the reports screens.
Prints a card with a label, value, change indicator and icon.
rpress_reports_metric_card( $label, $value, $delta, $icon, $tone )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$label | string | Required | Card label. |
$value | string | Required | Formatted value to show. |
$delta | mixed | Required | Change versus the previous period, as produced by the reports intelligence class. |
$icon | string | Required | Icon name. |
$tone | string | Required | Visual tone of the card. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 24.
rpress_reports_trend_svg()#
Outputs a compact two-series SVG trend chart.
Plucks the two keys from the trend rows and draws them as lines using rpress_reports_svg_points().
rpress_reports_trend_svg( $trend, $primary_key, $secondary_key )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$trend | array | Required | Trend rows. |
$primary_key | string | Required | Key of the primary series. |
$secondary_key | string | Required | Key of the secondary series. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 49.
rpress_reports_svg_points()#
Converts a list of values into SVG polyline points.
Scales the values to the given height and spreads them across the width. Returns an empty string for an empty list.
rpress_reports_svg_points( $values, $width, $height )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$values | array | Required | Numeric values. |
$width | int | Required | SVG width. |
$height | int | Required | SVG height. |
Returns string: Space-separated x,y pairs for a polyline points attribute.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 71.
rpress_reports_menu_rows()#
Converts menu item rows into the label and value shape used by report bar lists.
Skips rows without a name. If nothing remains, returns one placeholder row with a value of 0.
rpress_reports_menu_rows( $items, $value_key )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$items | array | Required | Item rows with a name key. |
$value_key | string | Required | Key holding the numeric value in each row. |
Returns array: Rows with label and value keys.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 103.
rpress_reports_named_amount_rows()#
Converts named net sales rows into the label and value shape used by report bar lists.
Uses the name and net_sales keys of each row. If the input is empty, returns one placeholder row with a value of 0.
rpress_reports_named_amount_rows( $items )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$items | array | Required | Rows with name and net_sales keys. |
Returns array: Rows with label and value keys.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 128.
rpress_reports_sum_key()#
Adds up a numeric key across rows.
Missing keys count as 0.
rpress_reports_sum_key( $rows, $key )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$rows | array | Required | Rows to sum. |
$key | string | Required | Key to add up. |
Returns float: The sum.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 151.
rpress_reports_single_trend_svg()#
Outputs a single-line SVG trend chart.
Draws the values as one line using rpress_reports_svg_points().
rpress_reports_single_trend_svg( $values )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$values | array | Required | Numeric values. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 167.
rpress_reports_service_rows()#
Builds bar list rows from sales totals by service type.
Labels delivery, pickup and dine-in totals and formats any other key as a title.
rpress_reports_service_rows( $service_sales )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$service_sales | array | Required | Totals keyed by service type. |
Returns array: Rows with label and value keys.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 184.
rpress_reports_payment_rows()#
Builds bar list rows from totals by payment method.
Uses each gateway's admin_label when available. Returns one placeholder row with a value of 0 when there are no totals.
rpress_reports_payment_rows( $payment_totals )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_totals | array | Required | Totals keyed by gateway ID. |
Returns array: Rows with label and value keys.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 208.
rpress_reports_bar_list()#
Outputs a bar list from label and value rows.
Each bar width is the row value as a percentage of the total, capped at 100.
rpress_reports_bar_list( $rows, $total )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$rows | array | Required | Rows with label and value keys. |
$total | float | Required | Total used to calculate percentages. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 232.
rpress_reports_count_bar_list()#
Outputs a bar list for count-based rows.
Each bar width is the row count as a percentage of the total, capped at 100. A total below 1 is treated as 1.
rpress_reports_count_bar_list( $rows, $total )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$rows | array | Required | Rows with label and value keys. |
$total | int | Required | Total used to calculate percentages. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 259.
rpress_reports_status_timeline()#
Outputs stacked status bars for each period in a trend.
Each bar shows orders split into completed, late, cancelled, refunded and failed segments.
rpress_reports_status_timeline( $trend )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$trend | array | Required | Trend rows with orders, completed, late, cancelled, refunded and failed keys. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 285.
rpress_reports_rush_heatmap()#
Outputs a weekday and hour heatmap of order counts.
Counts orders by the weekday and hour of their post time.
rpress_reports_rush_heatmap( $payment_ids )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_ids | array | Required | Order IDs. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 333.
rpress_reports_risk_period_rows()#
Builds weekly risk table rows from daily trend data.
Groups the trend into chunks of 7 days and calculates late, cancel, refund and failed rates as a percentage of orders, with the largest driver named. Rows are returned newest first.
rpress_reports_risk_period_rows( $trend )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$trend | array | Required | Trend rows keyed by date. |
Returns array: Rows with period, orders, late_rate, cancel_rate, refund_rate, failed_rate and driver keys.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 385.
rpress_reports_sales_heatmap()#
Outputs an hourly sales heatmap.
Adds up the _rpress_payment_total of published orders by hour of their post time.
rpress_reports_sales_heatmap( $payment_ids )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$payment_ids | array | Required | Order IDs. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/report-helpers.php, line 435.
rpress_reports_page()#
Renders the Reports admin page.
Reads the active tab from the tab query argument (default overview), prints the tab navigation and filters, then fires rpress_reports_page_top, rpress_reports_tab_{tab} and rpress_reports_page_bottom.
rpress_reports_page()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 45.
rpress_reports_intelligence_filters()#
Outputs the shared filter form for the intelligence reports.
Prints the date range, service type, payment status and order status filters.
rpress_reports_intelligence_filters( $active_tab, $filters )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$active_tab | string | Required | Active report tab. |
$filters | array | Required | Current filter values. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 103.
rpress_reports_tab_coming_next()#
Outputs a placeholder for a report tab that is not available yet.
Prints a notice for the given tab.
rpress_reports_tab_coming_next( $tab )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$tab | string | Required | Tab key. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 172.
rpress_reports_default_views()#
Returns the report views available on the Reports page.
Returns earnings, categories, addons, menu items, gateways and taxes views, filtered through rpress_report_views.
rpress_reports_default_views()
Returns array: View slugs mapped to labels.
Example
add_filter( 'rpress_report_views', function ( $views ) {
$views['my_report'] = __( 'My Report', 'my-plugin' );
return $views;
} );
Defined in includes/admin/reporting/reports.php, line 192.
rpress_get_reporting_view()#
Returns the current report view from the view query argument.
Falls back to $default when view is missing or is not one of the registered views. The result is filtered through rpress_get_reporting_view.
rpress_get_reporting_view( $default = 'earnings' )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$default | string | 'earnings' | View slug to use when the request has none. |
Returns string: The view slug.
Defined in includes/admin/reporting/reports.php, line 215.
rpress_reports_tab_reports()#
Fires the action for the currently selected report view.
Requires the view_shop_reports capability, else wp_die() with a 403. Fires rpress_reports_view_{view}.
rpress_reports_tab_reports()
Internal. Defined in includes/admin/reporting/reports.php, line 229.
rpress_report_views()#
Outputs the report view dropdown.
Returns without output unless the user has view_shop_reports. Fires rpress_report_view_actions_after after the dropdown.
rpress_report_views()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 246.
rpress_reports_fooditems_table()#
Outputs the menu items report table.
Requires view_shop_reports. Returns without output when a fooditem-id is in the request, since the detail view is shown instead.
rpress_reports_fooditems_table()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 275.
rpress_reports_fooditem_details()#
Outputs the detailed report for one menu item.
Requires view_shop_reports and a fooditem-id query argument. Calls rpress_reports_graph_of_fooditem() with it.
rpress_reports_fooditem_details()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 293.
rpress_reports_gateways_table()#
Outputs the payment methods report table.
Requires view_shop_reports, then displays an RPRESS_Gateawy_Reports_Table.
rpress_reports_gateways_table()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 320.
rpress_reports_earnings()#
Outputs the earnings report view.
Requires view_shop_reports, then prints the date controls and the graph from rpress_reports_graph().
rpress_reports_earnings()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 336.
rpress_reports_categories()#
Outputs the earnings by category report.
Requires view_shop_reports, then displays an RPRESS_Categories_Reports_Table and its script.
rpress_reports_categories()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 353.
rpress_reports_addons()#
Outputs the earnings by add-on report.
Requires view_shop_reports, then displays an RPRESS_Addons_Reports_Table and its script.
rpress_reports_addons()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 402.
rpress_reports_taxes()#
Outputs the tax report view.
Requires view_shop_reports. Uses the year query argument, defaulting to the current year.
rpress_reports_taxes()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/reports.php, line 452.
rpress_estimated_monthly_stats()#
Estimates earnings and sales for the whole current month.
Takes this month's totals so far, divides by the current day of the month and multiplies by the days in the month. The result is cached in the rpress_estimated_monthly_stats transient (plus the tax flag) for 24 hours.
rpress_estimated_monthly_stats( $include_taxes = true )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$include_taxes | bool | true | Whether earnings include taxes. |
Returns array: Array with earnings and sales keys.
Example
$estimate = rpress_estimated_monthly_stats();
$projected_earnings = $estimate['earnings'];
$projected_orders = $estimate['sales'];
Note: Cleared by the Refresh Reports action.
Defined in includes/admin/reporting/reports.php, line 491.
rpress_reports_tab_customers()#
Renders the Customers report tab.
Requires view_shop_reports, else wp_die() with a 403. Builds the data with RPRESS_Reports_Intelligence::build_customers() and prints metric cards and tables.
rpress_reports_tab_customers()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/customers.php, line 18.
rpress_reports_tab_export()#
Renders the Export report tab.
Returns without output unless the user has view_shop_reports. Prints one card per entry from rpress_reports_export_cards().
rpress_reports_tab_export()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/export.php, line 18.
rpress_reports_export_cards()#
Returns the export cards shown on the Export report tab.
Each card has a title, description, icon, class, type and format. The list is filtered through rpress_reports_export_cards.
rpress_reports_export_cards()
Returns array: Card definitions keyed by card ID.
Example
add_filter( 'rpress_reports_export_cards', function ( $cards ) {
$cards['my-export'] = array(
'title' => __( 'My Export', 'my-plugin' ),
'description' => __( 'Custom export.', 'my-plugin' ),
'icon' => 'chart-line',
'class' => 'My_Batch_Export',
'type' => 'my-export',
'format' => __( 'CSV', 'my-plugin' ),
);
return $cards;
} );
Defined in includes/admin/reporting/tabs/export.php, line 60.
rpress_reports_render_export_card()#
Outputs one export card.
Renders the card details and its export form. Cards using RPRESS_Batch_Report_Intelligence_Export also carry the current report filters.
rpress_reports_render_export_card( $card_id, $card, $filters )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$card_id | string | Required | Card ID. |
$card | array | Required | Card definition. |
$filters | array | Required | Current report filters. |
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/export.php, line 124.
rpress_reports_export_period_label()#
Builds the period label shown on the Reports export cards.
Combines the label of the selected range from RPRESS_Reports_Intelligence::get_range_options() (or 'Selected Period' if unknown) with the formatted start and end dates, separated by ' | '.
rpress_reports_export_period_label( $filters )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$filters | array | Required | Current report filters. Uses the range, start and end keys; start and end must be strtotime()-parsable dates. |
Returns string: Text such as 'Range label | start date - end date'.
Note: Reads the range, start and end keys without isset() checks.
Internal. Defined in includes/admin/reporting/tabs/export.php, line 176.
rpress_reports_export_filter_label()#
Builds the filter summary shown on the Reports export cards.
Joins the service type, payment status and order status labels with ' | '. Each falls back to 'All services', 'All payments' or 'All statuses' when the filter is empty or unknown.
rpress_reports_export_filter_label( $filters )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$filters | array | Required | Current report filters. Uses the service_type, payment_status and order_status keys. |
Returns string: The three labels joined by ' | '.
Internal. Defined in includes/admin/reporting/tabs/export.php, line 191.
rpress_reports_tab_menu()#
Renders the Menu report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_menu() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_menu()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/menu.php, line 18.
rpress_reports_tab_orders_risk()#
Renders the Orders & Risk report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_overview() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_orders_risk()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/orders-risk.php, line 18.
rpress_reports_tab_overview()#
Renders the Overview report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_overview() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_overview()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/overview.php, line 18.
rpress_reports_tab_payments_recovery()#
Renders the Payments & Recovery report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_payments_recovery() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_payments_recovery()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/payments-recovery.php, line 18.
rpress_reports_tab_sales()#
Renders the Sales report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_overview() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_sales()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/sales.php, line 18.
rpress_reports_tab_taxes_intelligence()#
Renders the Taxes report tab on the Reports screen.
Builds its data with RPRESS_Reports_Intelligence::build_taxes() for the current filters and prints the KPI cards and tables. Requires the view_shop_reports capability and ends the request with a 403 wp_die() screen otherwise.
rpress_reports_tab_taxes_intelligence()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/reporting/tabs/taxes.php, line 18.
rpress_media_button()#
Prints the button that opens the menu item shortcode dialog above the post editor.
Hooked to media_buttons at priority 11. Only prints on the post.php, page.php, post-new.php and post-edit.php screens, and not when editing a fooditem post. The button opens the thickbox printed by rpress_admin_footer_for_thickbox().
rpress_media_button()
Note: Echoes the button markup (passed through wp_kses_data()) instead of returning it, despite the original docblock.
Internal. Defined in includes/admin/thickbox.php, line 19.
rpress_admin_footer_for_thickbox()#
Prints the script and hidden dialog used by the editor's menu item insert button.
Hooked to admin_footer. On post and page edit screens (not fooditem), prints JavaScript that inserts a [purchase_link] shortcode into the editor, plus the hidden choose-fooditem dialog markup.
rpress_admin_footer_for_thickbox()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/thickbox.php, line 41.
rpress_tools_page()#
Renders the RestroPress Tools admin page and its tabs.
Reads the tab query argument (default general), maps legacy slugs with rpress_map_legacy_tools_tab(), prints the tab navigation from rpress_get_tools_tabs() and fires the dynamic rpress_tools_tab_{tab} action to render the panel.
rpress_tools_page()
Note: Echoes output. Registered as the callback of the Tools submenu, which requires manage_shop_settings.
Internal. Defined in includes/admin/tools.php, line 25.
rpress_get_tools_tabs()#
Returns the tabs shown on the Tools page, keyed by slug.
Core tabs are health_check, data_repair, menu_utilities, order_utilities, customer_access and diagnostics; betas is added when rpress_get_beta_enabled_extensions() is not empty. The result passes through the rpress_tools_tabs filter.
rpress_get_tools_tabs()
Returns array: Tab labels keyed by tab slug.
Example
add_filter( 'rpress_tools_tabs', function ( $tabs ) {
$tabs['my_tools'] = __( 'My Tools', 'my-plugin' );
return $tabs;
} );
add_action( 'rpress_tools_tab_my_tools', function () {
echo '<p>Hello</p>';
} );
Note: To add a tab, use the rpress_tools_tabs filter and render it on the rpress_tools_tab_{slug} action.
Defined in includes/admin/tools.php, line 66.
rpress_map_legacy_tools_tab()#
Maps an older Tools tab slug to its current tab slug.
Translates general, system_info, debug_log, advanced and api_keys to health_check, diagnostics, diagnostics, data_repair and customer_access. Any other slug is returned unchanged.
rpress_map_legacy_tools_tab($tab)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$tab | string | Required | Tools tab slug. |
Returns string: The current tab slug.
Internal. Defined in includes/admin/tools.php, line 92.
rpress_tools_health_check_display()#
Renders the restaurant health check panel on the Tools page.
Reads rpress_tools_get_health_checks() and prints each check with its status, message and action link, plus a count of checks that need attention. Does nothing without manage_shop_settings.
rpress_tools_health_check_display()
Note: Echoes output instead of returning it. Hooked to rpress_tools_tab_health_check.
Internal. Defined in includes/admin/tools.php, line 111.
rpress_tools_get_health_checks()#
Returns the list of restaurant setup health checks.
Checks that the menu, checkout, confirmation and failed order pages exist, that a service mode and store hours are set, that a payment gateway is enabled and that pretty permalinks are on. The list passes through the rpress_tools_health_checks filter.
rpress_tools_get_health_checks()
Returns array: List of checks. Each has the keys label, status ('good' or 'warning'), message, action (link text) and url.
Example
add_filter( 'rpress_tools_health_checks', function ( $checks ) {
$checks[] = array(
'label' => __( 'My check', 'my-plugin' ),
'status' => 'good',
'message' => __( 'All fine.', 'my-plugin' ),
'action' => __( 'Open', 'my-plugin' ),
'url' => admin_url(),
);
return $checks;
} );
Defined in includes/admin/tools.php, line 178.
rpress_tools_get_status_label()#
Returns the readable label for a health check status slug.
Maps good, warning and critical to Good, Needs attention and Critical. Unknown values are returned unchanged.
rpress_tools_get_status_label($status)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$status | string | Required | Status slug. |
Returns string: Translated label, or the input when unknown.
Defined in includes/admin/tools.php, line 266.
rpress_tools_banned_emails_display()#
Renders the blocked emails and domains form on the Tools page.
Prints a textarea pre-filled from rpress_get_banned_emails() and a nonce-protected form that posts the save_banned_emails action. Fires rpress_tools_banned_emails_before, rpress_tools_banned_emails_after and rpress_tools_after. Does nothing without manage_shop_settings.
rpress_tools_banned_emails_display()
Note: Echoes output. Hooked to rpress_tools_tab_customer_access.
Internal. Defined in includes/admin/tools.php, line 282.
rpress_tools_recount_stats_display()#
Renders the repair stats tools on the Tools page.
Prints the controls that start the batch recount and reset processors. Fires rpress_tools_recount_stats_before. Does nothing without manage_shop_settings.
rpress_tools_recount_stats_display()
Note: Echoes output. Hooked to rpress_tools_tab_data_repair.
Internal. Defined in includes/admin/tools.php, line 320.
rpress_tools_clear_doing_upgrade_display()#
Renders the clear incomplete upgrade notice panel on the Tools page.
Only prints when the rpress_doing_upgrade option exists and the user has manage_shop_settings. Fires rpress_tools_clear_doing_upgrade_before.
rpress_tools_clear_doing_upgrade_display()
Note: Echoes output. Hooked to rpress_tools_tab_data_repair.
Internal. Defined in includes/admin/tools.php, line 410.
rpress_tools_menu_utilities_display()#
Renders the menu readiness utilities panel on the Tools page.
Shows counts of published menu items missing a price, an image or a food-category term, and the number of add-on groups (addon_category terms). Does nothing without manage_shop_settings.
rpress_tools_menu_utilities_display()
Note: Echoes output. Hooked to rpress_tools_tab_menu_utilities.
Internal. Defined in includes/admin/tools.php, line 444.
rpress_tools_order_utilities_display()#
Renders the order data utilities panel on the Tools page.
Shows pending, failed and refunded order counts from rpress_count_payments() with a link to the order history. Does nothing without manage_shop_settings.
rpress_tools_order_utilities_display()
Note: Echoes output. Hooked to rpress_tools_tab_order_utilities.
Internal. Defined in includes/admin/tools.php, line 516.
rpress_tools_count_fooditems_missing_meta()#
Counts published menu items whose given post meta is missing or empty.
Runs a WP_Query over published fooditem posts, matching items where the meta key does not exist or equals an empty string.
rpress_tools_count_fooditems_missing_meta($meta_key)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$meta_key | string | Required | Post meta key to test, for example rpress_price. |
Returns int: Number of matching menu items.
Example
$missing_prices = rpress_tools_count_fooditems_missing_meta( 'rpress_price' );
Defined in includes/admin/tools.php, line 581.
rpress_tools_count_fooditems_missing_thumbnail()#
Counts published menu items that have no featured image.
Calls rpress_tools_count_fooditems_missing_meta() with _thumbnail_id.
rpress_tools_count_fooditems_missing_thumbnail()
Returns int: Number of menu items without a featured image.
Defined in includes/admin/tools.php, line 611.
rpress_tools_count_fooditems_missing_terms()#
Counts published menu items that have no term in a taxonomy.
Loads the IDs of all published fooditem posts and counts those for which has_term( '', $taxonomy, $post_id ) is false.
rpress_tools_count_fooditems_missing_terms($taxonomy)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$taxonomy | string | Required | Taxonomy name, for example food-category. |
Returns int: Number of menu items with no term.
Example
$uncategorized = rpress_tools_count_fooditems_missing_terms( 'food-category' );
Defined in includes/admin/tools.php, line 624.
rpress_tools_betas_display()#
Renders the beta versions opt-in form on the Tools page.
Lists extensions from rpress_get_beta_enabled_extensions() with checkboxes. Does nothing without manage_shop_settings or when no extension supports betas. Fires rpress_tools_betas_before.
rpress_tools_betas_display()
Note: Echoes output. Hooked to rpress_tools_tab_betas.
Internal. Defined in includes/admin/tools.php, line 648.
rpress_tools_customer_access_guidance_display()#
Renders the customer and API access links panel on the Tools page.
Prints links to the Developer API settings and the user's profile page (application passwords). Does nothing without manage_shop_settings.
rpress_tools_customer_access_guidance_display()
Note: Echoes output. Hooked to rpress_tools_tab_customer_access at priority 5.
Internal. Defined in includes/admin/tools.php, line 698.
rpress_get_beta_enabled_extensions()#
Returns the extensions that offer beta versions.
Returns an empty array unless extensions add entries through the rpress_beta_enabled_extensions filter.
rpress_get_beta_enabled_extensions()
Returns array: Extension names keyed by extension slug.
Example
add_filter( 'rpress_beta_enabled_extensions', function ( $extensions ) {
$extensions['my-extension'] = 'My Extension';
return $extensions;
} );
Defined in includes/admin/tools.php, line 725.
rpress_extension_has_beta_support()#
Checks whether a beta opt-in is stored for an extension slug.
Looks for the slug as a key in the enabled_betas setting. Only the key is tested, not the stored value.
rpress_extension_has_beta_support($slug)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$slug | string | Required | Extension slug. |
Returns bool: True when the slug is a key in enabled_betas, false otherwise.
Example
if ( rpress_extension_has_beta_support( 'my-extension' ) ) {
// Offer the beta update channel.
}
Defined in includes/admin/tools.php, line 736.
rpress_tools_enabled_betas_save()#
Saves the beta opt-in selections from the Tools page.
Verifies the rpress_save_betas_nonce nonce and manage_shop_settings, then stores the posted enabled_betas values as booleans in the enabled_betas setting, or deletes the setting when none are posted.
rpress_tools_enabled_betas_save()
Note: Hooked to rpress_save_enabled_betas. Returns silently when the nonce or capability check fails.
Internal. Defined in includes/admin/tools.php, line 751.
rpress_tools_enabled_betas_sanitize_value()#
Converts a beta opt-in value to a boolean.
Uses filter_var() with FILTER_VALIDATE_BOOLEAN.
rpress_tools_enabled_betas_sanitize_value($value)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$value | mixed | Required | Value being sent in. |
Returns bool: True for values PHP treats as true (such as '1', 'on', 'yes'), false otherwise.
Internal. Defined in includes/admin/tools.php, line 777.
rpress_tools_banned_emails_save()#
Saves the blocked emails list posted from the Tools page.
Verifies the rpress_banned_emails_nonce nonce and manage_shop_settings, splits the textarea into lines, keeps entries that are valid emails or start with '@' or '.', and stores them in the banned_emails setting. An empty submission stores an empty string.
rpress_tools_banned_emails_save()
Note: Hooked to rpress_save_banned_emails. Returns silently when the nonce or capability check fails.
Internal. Defined in includes/admin/tools.php, line 787.
rpress_tools_clear_upgrade_notice()#
Deletes the incomplete upgrade flag so the upgrade notice disappears.
Verifies the rpress_clear_upgrades_nonce nonce and manage_shop_settings, then runs delete_option( 'rpress_doing_upgrade' ).
rpress_tools_clear_upgrade_notice()
Note: Hooked to rpress_clear_doing_upgrade. Returns silently when the nonce or capability check fails.
Internal. Defined in includes/admin/tools.php, line 817.
rpress_tools_import_export_display()#
Renders the legacy Import/Export tab that points to the new locations.
Prints links to the menu import and export screens, the reports export and the settings import/export. Fires rpress_tools_import_export_before and rpress_tools_import_export_after. Does nothing without manage_shop_settings.
rpress_tools_import_export_display()
Note: Echoes output. Only reachable by a direct ?tab=import_export URL.
Internal. Defined in includes/admin/tools.php, line 834.
rpress_tools_import_export_process_export()#
Sends the RestroPress settings and tax rates as a downloaded JSON file.
Verifies the rpress_export_nonce nonce and manage_shop_settings, then outputs the rpress_settings and rpress_tax_rates options as JSON with a download header and exits. The file name passes through the rpress_settings_export_filename filter.
rpress_tools_import_export_process_export()
Note: Hooked to rpress_export_settings. Ends the request with exit after sending the file.
Internal. Defined in includes/admin/tools.php, line 866.
rpress_tools_import_export_process_import()#
Imports RestroPress settings from an uploaded JSON file.
Verifies the rpress_import_nonce nonce and manage_shop_settings, requires a .json upload that decodes to a non-empty array, then replaces the rpress_settings option and, when present, rpress_tax_rates. Redirects back with rpress-message=settings-imported and exits.
rpress_tools_import_export_process_import()
Note: Hooked to rpress_import_settings. Overwrites the whole settings option. Calls wp_die() with a 400 status for invalid files.
Internal. Defined in includes/admin/tools.php, line 897.
rpress_settings_render_config_io()#
Renders the settings export and import forms on the Settings > Misc screen.
Hooked to rpress_settings_after_form_misc_main. Prints an export form and an upload form that post the export_settings and import_settings actions with their nonces. Does nothing without manage_shop_settings.
rpress_settings_render_config_io()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/tools.php, line 946.
rpress_menu_export_page()#
Renders the Menu Items > Export screen.
Prints the menu catalog CSV export form, which the shared batch export script processes, then calls rpress_menu_export_inline_assets(). Requires the export_shop_reports capability and calls wp_die() without it.
rpress_menu_export_page()
Note: Echoes output. Registered as the callback of the Export submenu under Menu Items.
Internal. Defined in includes/admin/tools.php, line 996.
rpress_menu_export_inline_assets()#
Prints the inline styles used by the Menu Items export screen.
Called at the end of rpress_menu_export_page().
rpress_menu_export_inline_assets()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/tools.php, line 1217.
rpress_menu_csv_importer_form()#
Renders the CSV menu importer form with its column mapping table.
Prints an upload form for the RPRESS_Batch_FoodItems_Import batch importer, followed by a table that maps menu fields (name, price, categories, add-ons, SKU and others) to CSV columns. Returns without output unless the user has edit_products.
rpress_menu_csv_importer_form()
Note: Echoes output. Used inside the onboarding and Menu Items import screens.
Internal. Defined in includes/admin/tools.php, line 1274.
rpress_tools_debug_log_display()#
Renders the debug log viewer on the Tools page.
Prints the contents of the global $rpress_logs log file with download, clear and copy buttons. Does nothing without manage_shop_settings or when rpress_is_debug_mode() is false.
rpress_tools_debug_log_display()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/tools.php, line 1383.
rpress_handle_submit_debug_log()#
Handles the download and clear actions of the debug log form.
Requires manage_shop_settings and checks the rpress-debug-log-action nonce. Download sends the posted log text as rpress-debug-log.txt and exits; clear empties the log file and redirects to the Diagnostics tab.
rpress_handle_submit_debug_log()
Note: Hooked to rpress_submit_debug_log.
Internal. Defined in includes/admin/tools.php, line 1417.
rpress_tools_diagnostics_display()#
Renders the Diagnostics tab of the Tools page.
Prints the support summary table from rpress_tools_get_diagnostics_summary(), then the full system report and, when rpress_is_debug_mode() is true, the debug log. Does nothing without manage_shop_settings.
rpress_tools_diagnostics_display()
Note: Echoes output. Hooked to rpress_tools_tab_diagnostics.
Internal. Defined in includes/admin/tools.php, line 1445.
rpress_tools_get_diagnostics_summary()#
Returns the support summary rows shown on the Diagnostics tab.
Collects values such as the RestroPress version, WordPress and PHP versions, configured pages, enabled gateways, service mode and uploads path. The list passes through the rpress_tools_diagnostics_summary filter.
rpress_tools_get_diagnostics_summary()
Returns array: List of rows, each with label, value and note.
Example
add_filter( 'rpress_tools_diagnostics_summary', function ( $rows ) {
$rows[] = array(
'label' => __( 'My Extension', 'my-plugin' ),
'value' => '1.0.0',
'note' => __( 'Useful for support.', 'my-plugin' ),
);
return $rows;
} );
Defined in includes/admin/tools.php, line 1499.
rpress_tools_sysinfo_display()#
Renders the full system report box on the Diagnostics tab.
Prints a read-only textarea filled by rpress_tools_sysinfo_get() with download and copy buttons. Does nothing without manage_shop_settings.
rpress_tools_sysinfo_display()
Note: Echoes output instead of returning it.
Internal. Defined in includes/admin/tools.php, line 1587.
rpress_tools_sysinfo_get()#
Builds the system information report as plain text.
Gathers site, host, browser, WordPress, RestroPress, pages, gateways, taxes, plugins, web server, PHP and session details. The text passes through rpress_sysinfo_after_* filters, for example rpress_sysinfo_after_rpress_config and rpress_sysinfo_after_php_ext, so extensions can append sections.
rpress_tools_sysinfo_get()
Returns string: The report, ending with '### End System Info ###'.
Example
add_filter( 'rpress_sysinfo_after_rpress_config', function ( $report ) {
$report .= "\n" . 'My Extension: active';
return $report;
} );
$report = rpress_tools_sysinfo_get();
Defined in includes/admin/tools.php, line 1619.
rpress_tools_sysinfo_fooditem()#
Sends the posted system information as a downloaded text file.
Requires manage_shop_settings, then outputs the rpress-sysinfo POST value as rpress-system-info.txt and ends the request with rpress_die().
rpress_tools_sysinfo_fooditem()
Note: Hooked to rpress_fooditem_sysinfo. Does not verify a nonce; the name refers to the system info file, not a menu item.
Internal. Defined in includes/admin/tools.php, line 1851.
rpress_register_batch_recount_store_earnings_tool()#
Registers the loader for the store earnings recount batch processor.
Adds rpress_include_recount_store_earnings_tool_batch_processer to the rpress_batch_export_class_include action. Itself runs on rpress_register_batch_exporter.
rpress_register_batch_recount_store_earnings_tool()
Internal. Defined in includes/admin/tools/tools-actions.php, line 18.
rpress_include_recount_store_earnings_tool_batch_processer()#
Loads the batch processor class file when RPRESS_Tools_Recount_Store_Earnings is requested.
Requires the file for RPRESS_Tools_Recount_Store_Earnings only when $class matches that name; other class names are ignored. Hooked to rpress_batch_export_class_include.
rpress_include_recount_store_earnings_tool_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name requested by the batch exporter. |
Internal. Defined in includes/admin/tools/tools-actions.php, line 29.
rpress_register_batch_recount_fooditem_tool()#
Registers the loader for the menu item stats recount batch processor.
Adds rpress_include_recount_fooditem_tool_batch_processer to the rpress_batch_export_class_include action. Itself runs on rpress_register_batch_exporter.
rpress_register_batch_recount_fooditem_tool()
Internal. Defined in includes/admin/tools/tools-actions.php, line 38.
rpress_include_recount_fooditem_tool_batch_processer()#
Loads the batch processor class file when RPRESS_Tools_Recount_Download_Stats is requested.
Requires the file for RPRESS_Tools_Recount_Download_Stats only when $class matches that name; other class names are ignored. Hooked to rpress_batch_export_class_include.
rpress_include_recount_fooditem_tool_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name requested by the batch exporter. |
Internal. Defined in includes/admin/tools/tools-actions.php, line 49.
rpress_register_batch_recount_all_tool()#
Registers the loader for the recount all stats batch processor.
Adds rpress_include_recount_all_tool_batch_processer to the rpress_batch_export_class_include action. Itself runs on rpress_register_batch_exporter.
rpress_register_batch_recount_all_tool()
Internal. Defined in includes/admin/tools/tools-actions.php, line 58.
rpress_include_recount_all_tool_batch_processer()#
Loads the batch processor class file when RPRESS_Tools_Recount_All_Stats is requested.
Requires the file for RPRESS_Tools_Recount_All_Stats only when $class matches that name; other class names are ignored. Hooked to rpress_batch_export_class_include.
rpress_include_recount_all_tool_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name requested by the batch exporter. |
Internal. Defined in includes/admin/tools/tools-actions.php, line 69.
rpress_register_batch_reset_tool()#
Registers the loader for the reset stats batch processor.
Adds rpress_include_reset_tool_batch_processer to the rpress_batch_export_class_include action. Itself runs on rpress_register_batch_exporter.
rpress_register_batch_reset_tool()
Internal. Defined in includes/admin/tools/tools-actions.php, line 78.
rpress_include_reset_tool_batch_processer()#
Loads the batch processor class file when RPRESS_Tools_Reset_Stats is requested.
Requires the file for RPRESS_Tools_Reset_Stats only when $class matches that name; other class names are ignored. Hooked to rpress_batch_export_class_include.
rpress_include_reset_tool_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name requested by the batch exporter. |
Internal. Defined in includes/admin/tools/tools-actions.php, line 89.
rpress_register_batch_customer_recount_tool()#
Registers the loader for the customer stats recount batch processor.
Adds rpress_include_customer_recount_tool_batch_processer to the rpress_batch_export_class_include action. Itself runs on rpress_register_batch_exporter.
rpress_register_batch_customer_recount_tool()
Internal. Defined in includes/admin/tools/tools-actions.php, line 98.
rpress_include_customer_recount_tool_batch_processer()#
Loads the batch processor class file when RPRESS_Tools_Recount_Customer_Stats is requested.
Requires the file for RPRESS_Tools_Recount_Customer_Stats only when $class matches that name; other class names are ignored. Hooked to rpress_batch_export_class_include.
rpress_include_customer_recount_tool_batch_processer( $class )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$class | string | Required | Class name requested by the batch exporter. |
Internal. Defined in includes/admin/tools/tools-actions.php, line 109.
rpress_change_fooditems_upload_dir()#
Redirects media uploads for menu items into the protected RestroPress upload folder.
Hooked to admin_init at priority 999. During async-upload.php or media-upload.php requests whose post_id belongs to a fooditem post, calls rpress_create_protection_files( true ) and adds the upload_dir filter rpress_set_upload_dir.
rpress_change_fooditems_upload_dir()
Internal. Defined in includes/admin/upload-functions.php, line 26.
rpress_create_protection_files()#
Creates the .htaccess and index.php protection files in the RestroPress uploads folder.
Creates the folder if needed, writes or updates its .htaccess using rpress_get_htaccess_rules(), adds index.php files to the folder and its direct subfolders, then sets the rpress_check_protection_files transient for one day. Skipped while the transient exists unless forced.
rpress_create_protection_files( $force = false, $method = false )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$force | bool | false | Run even if the transient is still set. |
$method | string|false | false | Download method passed to rpress_get_htaccess_rules(); when empty the configured method is used. |
Example
rpress_create_protection_files( true );
Note: Also runs on every admin_init. The original docblock says monthly, but the code re-checks daily.
Defined in includes/admin/upload-functions.php, line 47.
rpress_htaccess_exists()#
Checks whether the uploads/rpress folder has an .htaccess file.
Looks for .htaccess inside the path returned by rpress_get_upload_dir().
rpress_htaccess_exists()
Returns bool: True when the file exists.
Defined in includes/admin/upload-functions.php, line 87.
rpress_scan_folders()#
Lists the subfolders of a path, defaulting to this directory.
Scans the given path with scandir() and returns each directory found with a trailing slash. When $path is empty it uses the directory of the file that defines the function.
rpress_scan_folders( $path = '', $return = array() )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | '' | Directory to scan. Empty uses the directory of the defining file. |
$return | array | array() | Folder list to append to. |
Returns array: Folder paths, each with a trailing slash.
Note: The recursive call's result is discarded, so only the direct subfolders of $path are returned, not deeper levels.
Defined in includes/admin/upload-functions.php, line 97.
rpress_get_htaccess_rules()#
Returns the .htaccess rules for the RestroPress uploads folder.
With the redirect method the rules only disable directory listing. Any other method also denies direct access except for jpg, jpeg, png, gif, mp3 and ogg files. The file types pass through rpress_protected_directory_allowed_filetypes and the final rules through rpress_protected_directory_htaccess_rules.
rpress_get_htaccess_rules( $method = false )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$method | string|false | false | Download method. When empty, rpress_get_file_fooditem_method() is used. |
Returns string: The .htaccess contents.
Example
$rules = rpress_get_htaccess_rules( 'redirect' );
Defined in includes/admin/upload-functions.php, line 119.
wp_is_writable()#
Checks whether a path is writable, as a fallback for older WordPress.
Defined only when WordPress has not already defined it. On Windows it calls win_is_writable(), otherwise is_writable().
wp_is_writable( $path )
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | string | Required | Path to check. |
Returns bool: True when the path is writable.
Note: Declared inside an if ( ! function_exists() ) block.
Internal. Defined in includes/admin/upload-functions.php, line 157.
