Last Updated: Aug. 17, 2022 at 03:58pm UTC
Class

AddSubmenuPage

Add submenu page enabling edits on all scheduled submission exports

Method
__construct public
Construct submenu page using FormSettingsStorage
Param
FormSettingsStorage $formSettingsStorage
Method
registerSubmenu public
Register submenu page
Method
outputMarkup public
Output markup for submenu page
Calls class that generates output for the UI for changing the date/time of daily and weekly exports.
Class class that generates output to list all existing scheduled exports, grouped by form, with links to those forms' builder.
Method
setLogger public
Set the logger
Return
AddSubmenuPage
Method
getLogger public
Provide the logger, fallback to empty logger
Class

FormSettings

Register settings with Ninja Forms Provides options via static methods for consistent settings data

Method
__construct public
Add Export Scheduling settings as form settings
Static Method
constructIntervalOptions public
Static Method
constructFormatOptions public
Static Method
constructDeliveryOptions public
Method
formSettingsTypes public
Add Scheduled Exports form setting type
Param
type $types
Return
type
Method
formExportSettings public
Append Export Schedule option repeater to Scheduled Exports section
Param
array $settings
Return
array
Method
builderTemplates public
Add templates for HTML output
Static Method
addExtendedFormats public
Static Method
addExtendedDelivery public
Method
getExportSettings protected
Get form export settings as currently stored in NF Settings (not permanent location)
Param
int $formId
Return
array
Method
getFormIds protected
Get indexed array of form Ids
Class

SubmissionExportScheduler

Register and fire submission export actions on a WP Cron schedule

Method
__construct public
Ensure Cron hooks are linked and internal methods attached to those hooks
Param
StorageInterface $scheduledExportParametersStorage
Method
nfSubExportHourly public
Export on Hourly Interval
Method
nfSubExportDaily public
Export on Daily Interval
Method
nfSubExportWeekly public
Export on Weekly Interval
Method
nfSubExport public
Perform requested scheduled submission exports Requests retrieved by ScheduledExportSettingsStorage class.
Param
string $interval
Method
makeSubmissionAggregate protected
Return filtered SubmissionAggregate
Param
SubmissionFilter $submissionFilter
Return
SubmissionAggregate
Method
generateFormattedOutput protected
Select method for generating output, return array of filenames
Param
string $format
Param
SubmissionAggregate $submissionAggregate
Return
array Keyed on `attachmentNames`, `fileInfos`
Method
generateCsvOutput protected
Generate output as a CSV file, returning filename as indexed array Single file is generated for a collection of CSVs; returned as an indexed array of a single element to maintain common return structure with other output methods (PDF, for example) that must generate a separate file for each submission.
Param
SubmissionAggregate $submissionsCollection
Return
array
Method
deliverOutput protected
Select delivery method to deliver attachments
Param
string $delivery
Param
ScheduledExportParameters $scheduledExportParameters
Param
array $attachmentNames
Param
array $fileInfos Array of filenames for attachment
Method
deliverEmail protected
Deliver specified files via email
Param
ScheduledExportParameters $scheduledExportParameters
Param
array $fileInfos
Method
getFromEmailAddress protected
Provide a 'from' email address for email Currently defaults to admin email
Return
string
Method
handleWpMailFailure public
Logs a wp_mail failure do_action is called when wp_mail fails; this catches it and logs the failure
Param
[type] $wpError
Return
void
Method
convertExportParametersToSubmissionFilter protected
Given export request and interval, generate submission filter parameters
Param
ScheduledExportParameters $scheduledExportParameters
Param
string $interval
Return
SubmissionFilter
Method
setLogger public
Set the logger
Return
self
Method
getLogger public
Provide the logger, fallback to empty logger
Class

LogEntry

Static Method
fromArray public
Static Method
fromString public
Method
toArray public
Constructs an array representation of an object
Returns all properties; if properties are not set, then values defined by setter method ensures required values are set. Undefined properties are returned as stored in object. This enables passing of undefined properties, enabling extension of object.
Method
__get public
Magic method getter for properties
Param
string $name
Return
void
Method
__set public
Magic method setter for properties

Param
string $name
Param
mixed $value
Return
Void
Method
__toString public
@inheritDoc
Method
getLevel public
Get PSR log level
Return
string
Method
setLevel public
Set PSR log level
Param
string $level PSR log level
Return
LogEntry
Method
getSummary public
Get log summary
Return
string
Method
setSummary public
Set log summary
Param
string $summary Log summary
Return
LogEntry
Method
getTimestamp public
Get timestamp in epoch format
Return
int
Method
setTimestamp public
Set timestamp in epoch format
Param
integer $timestamp Timestamp in epoch format
Return
LogEntry
Method
getLogPoint public
Get situation under which entry happened
Return
string
Method
setLogPoint public
Set situation under which entry happened
Param
string $logPoint Situation under which entry happened
Return
LogEntry
Method
getSupportingData public
Get supporting data
Return
string
Method
setSupportingData public
Set supporting data
Param
string $supportingData
Return
LogEntry
Method
getExpiration public
Get used for cleanup of records in DB
Return
integer
Method
setExpiration public
Set used for cleanup of records in DB
Param
integer $expiration Used for cleanup of records in DB
Return
LogEntry
Class

LogLevel

Class that extends standard log levels with custom log levels

Class

LoggerFactory

Method
__construct public
Method
getLogger public
@inheritDoc
Method
getDebugLogHandler public
@inheritDoc
Method
getWarningHandler public
@inheritDoc
Method
createDebugLogRoutes public
@inheritDoc
Method
constructLogger protected
Construct common logger
Return
NfLogger
Class

DateTimeConverter

Converts timestamps between formats, cognizant of WordPress settings
This class is aware of the WordPress timezone settings and can convert stringed times into integer timestamps and vice-versa, relieving all other classes of this responsibility.

Static Method
localizeDateTimeStringIntoEpoch public
Static Method
localizeEpochIntoString public
Static Method
getWpTimezoneSetting public
Class

DownloadDebugLog

Method
__construct public
Method
getDebugJson public
Get debug log as JSON string
Return
string
Method
getDebugLog protected
Get collection of log entries for the plugin
Return
array
Method
constructJsonString protected
Construct JSON string from debug log
Return
string
Method
constructLineItem protected
Construct a stringed line item as JSON for easy reading Unpack double encoded supportingData
Param
LogEntry $logEntry
Return
string
Class

Logger

Logs data

Method
log public
Record log using available handler at that level @inheritDoc
Method
pushLogHandler public
Assigns a single handler to a given log level @inheritDoc
Param
NfLogHandler $handler
Param
string $logLevel
Return
void
Class

WordPressSettingsElementBuilder

Builds HTML elements to match WP settings

Method
formElement public
Markup form opening and close elements
Param
string $endpoint
Param
bool $close
Return
string
Method
generateSelectMarkup public
Generate Select markup
Param
string $elementId
Param
string $optionsMarkup
Return
string
Method
generateOptions public
Generate options markup from FormSettings' defined options
Param
array $options
Param
mixed $selectedValue
Return
string
Method
textboxElement public
Mark up a textbox element
Param
string $label
Param
string $dataId
Param
mixed $value
Param
string $divStyle
Param
string $inputStyle
Return
string
Method
buttonElement public
Mark up a button element
Param
string $id
Param
type $label
Return
string
Method
hiddenElement public
Mark up a hidden input element
Param
string $dataId
Param
mixed $value
Return
string
Method
generateFormTable public
Generate open/close elements on form table
Param
boolean $close TRUE to close previously opened form element
Return
string
Class

TableLogHandler

Stores record as a DB entry Some of these may be expected to expire

Method
log public
@inheritDoc
Method
getPluginLogEntries public
@inheritDoc
Method
getAllLogEntries public
Get every log entry in the table
Return
array
Method
getLogEntriesByLevel public
Get log entries by log level
Param
string $requested The requested level to fetch
Return
array
Method
getCallerLogEntries public
Get log entries by caller
Param
string $identifier The target log point
Return
array
Method
getLogEntriesByParam protected
Base method for getting log entries from the table
Param
string $key the column to narrow our results by
Param
mixed $value the value(s) to apply in our search
Return
array
Method
$logEntryArray
Method
deletePluginLogEntries public
@inheritDoc
Method
buildLogEntry protected
Construct log entry object from log request
Param
$message
Param
array $context
Return
LogEntry
Method
maybeAddTable protected
Add our table if necessary
Return
void
Method
tableExists protected
Verify our table exists
Return
boolean
Method
storeLogEntry protected
Store entry in our table
Param
LogEntry $logEntry
Return
void
Method
setPluginPrefix public
@inheritDoc
Class

TransientLogHandler

Stores temporary record as WP transients Temporary logs are expected to expire

Method
log public
@inheritDoc
Method
buildLogEntry protected
Construct log entry object from log request
Param
string|\Stringable $message
Param
array $context
Return
LogEntry
Method
storeLogEntryAsTransient protected
Store entry as WP transient
Removes 'expiration' and 'logKey' values from entry because they are only needed for setting expiration, not actual diagnostics
Param
LogEntry $logEntry
Return
void
Method
getPluginLogEntries public
@inheritDoc
Method
deletePluginLogEntries public
@inheritDoc
Method
setPluginPrefix public
@inheritDoc
Class

WpListTable

Base class for displaying a list of items in an ajaxified HTML table.
This is a copy of WordPress core's WP_List_Table at v 6.0. It is copied here because the base class is marked as private and not intended for external use.

Since
3.1.0

Method
__construct public
Constructor.
The child class should call this constructor from its own constructor to override the default $args.
Since
3.1.0
Param
array|string $args { Array or string of arguments.
@type string $plural Plural value used for labels and the objects being listed. This affects things such as CSS class-names and nonces used in the list table, e.g. 'posts'. Default empty. @type string $singular Singular label for an object being listed, e.g. 'post'. Default empty @type bool $ajax Whether the list table supports Ajax. This includes loading and sorting data, for example. If true, the class will call the _js_vars() method in the footer to provide variables to any scripts handling Ajax events. Default false. @type string $screen String containing the hook name used to determine the current screen. If left null, the current screen will be automatically set. Default null. }
Method
__get public
Make private properties readable for backward compatibility.
Since
4.0.0
Param
string $name Property to get.
Return
mixed Property.
Method
__set public
Make private properties settable for backward compatibility.
Since
4.0.0
Param
string $name Property to check if set.
Param
mixed $value Property value.
Return
mixed Newly-set property.
Method
__isset public
Make private properties checkable for backward compatibility.
Since
4.0.0
Param
string $name Property to check if set.
Return
bool Whether the property is a back-compat property and it is set.
Method
__unset public
Make private properties un-settable for backward compatibility.
Since
4.0.0
Param
string $name Property to unset.
Method
__call public
Make private/protected methods readable for backward compatibility.
Since
4.0.0
Param
string $name Method to call.
Param
array $arguments Arguments to pass when calling.
Return
mixed|bool Return value of the callback, false otherwise.
Method
ajax_user_can public
Checks the current user's permissions
Since
3.1.0 @abstract
Method
prepare_items public
Prepares the list of items for displaying.
@uses WP_List_Table::set_pagination_args()
Since
3.1.0 @abstract
Method
set_pagination_args protected
An internal method that sets all the necessary pagination arguments
Since
3.1.0
Param
array|string $args Array or string of arguments with information about the pagination.
Method
get_pagination_arg public
Access the pagination args.
Since
3.1.0
Param
string $key Pagination argument to retrieve. Common values include 'total_items', 'total_pages', 'per_page', or 'infinite_scroll'.
Return
int Number of items that correspond to the given pagination argument.
Method
has_items public
Whether the table has items to display or not
Since
3.1.0
Return
bool
Method
no_items public
Message to be displayed when there are no items
Since
3.1.0
Method
search_box public
Displays the search box.
Since
3.1.0
Param
string $text The 'submit' button label.
Param
string $input_id ID attribute value for the search input field.
Method
get_views protected
Gets the list of views available on this table.
The format is an associative array: - `'id' => 'link'`
Since
3.1.0
Return
array
Method
views public
Displays the list of views available on this table.
Since
3.1.0
Method
get_bulk_actions protected
Retrieves the list of bulk actions available for this table.
The format is an associative array where each element represents either a top level option value and label, or an array representing an optgroup and its options.
For a standard option, the array element key is the field value and the array element value is the field label.
For an optgroup, the array element key is the label and the array element value is an associative array of options as above.
Example:
[ 'edit' => 'Edit', 'delete' => 'Delete', 'Change State' => [ 'feature' => 'Featured', 'sale' => 'On Sale', ] ]
Since
3.1.0
Since
5.6.0 A bulk action can now contain an array of options in order to create an optgroup.
Return
array
Method
bulk_actions protected
Displays the bulk actions dropdown.
Since
3.1.0
Param
string $which The location of the bulk actions: 'top' or 'bottom'. This is designated as optional for backward compatibility.
Method
current_action public
Gets the current action selected from the bulk actions dropdown.
Since
3.1.0
Return
string|false The action name. False if no action was selected.
Method
row_actions protected
Generates the required HTML for a list of row action links.
Since
3.1.0
Param
string[] $actions An array of action links.
Param
bool $always_visible Whether the actions should be always visible.
Return
string The HTML for the row actions.
Method
months_dropdown protected
Displays a dropdown for filtering items in the list table by month.
Since
3.1.0
@global wpdb $wpdb WordPress database abstraction object. @global WP_Locale $wp_locale WordPress date and time locale object.
Param
string $post_type The post type.
Method
view_switcher protected
Displays a view switcher.
Since
3.1.0
Param
string $current_mode
Method
comments_bubble protected
Displays a comment count bubble.
Since
3.1.0
Param
int $post_id The post ID.
Param
int $pending_comments Number of pending comments.
Method
get_pagenum public
Gets the current page number.
Since
3.1.0
Return
int
Method
get_items_per_page protected
Gets the number of items to display on a single page.
Since
3.1.0
Param
string $option User option name.
Param
int $default_value Optional. The number of items to display. Default 20.
Return
int
Method
pagination protected
Displays the pagination.
Since
3.1.0
Param
string $which
Method
get_columns public
Gets a list of columns.
The format is: - `'internal-name' => 'Title'`
Since
3.1.0 @abstract
Return
array
Method
get_sortable_columns protected
Gets a list of sortable columns.
The format is: - `'internal-name' => 'orderby'` - `'internal-name' => array( 'orderby', 'asc' )` - The second element sets the initial sorting order. - `'internal-name' => array( 'orderby', true )` - The second element makes the initial order descending.
Since
3.1.0
Return
array
Method
get_default_primary_column_name protected
Gets the name of the default primary column.
Since
4.3.0
Return
string Name of the default primary column, in this case, an empty string.
Method
get_primary_column public
Public wrapper for WP_List_Table::get_default_primary_column_name().
Since
4.4.0
Return
string Name of the default primary column.
Method
get_primary_column_name protected
Gets the name of the primary column.
Since
4.3.0
Return
string The name of the primary column.
Method
get_column_info protected
Gets a list of all, hidden, and sortable columns, with filter applied.
Since
3.1.0
Return
array
Method
get_column_count public
Returns the number of visible columns.
Since
3.1.0
Return
int
Method
print_column_headers public
Prints column headers, accounting for hidden and sortable columns.
Since
3.1.0
Param
bool $with_id Whether to set the ID attribute or not
Method
display public
Displays the table.
Since
3.1.0
Method
get_table_classes protected
Gets a list of CSS classes for the WP_List_Table table tag.
Since
3.1.0
Return
string[] Array of CSS classes for the table tag.
Method
display_tablenav protected
Generates the table navigation above or below the table
Since
3.1.0
Param
string $which
Method
extra_tablenav protected
Extra controls to be displayed between bulk actions and pagination.
Since
3.1.0
Param
string $which
Method
display_rows_or_placeholder public
Generates the tbody element for the list table.
Since
3.1.0
Method
display_rows public
Generates the table rows.
Since
3.1.0
Method
single_row public
Generates content for a single row of the table.
Since
3.1.0
Param
object|array $item The current item
Method
column_default protected
Param
object|array $item
Param
string $column_name
Method
column_cb protected
Param
object|array $item
Method
single_row_columns protected
Generates the columns for a single row of the table.
Since
3.1.0
Param
object|array $item The current item.
Method
handle_row_actions protected
Generates and display row actions links for the list table.
Since
4.3.0
Param
object|array $item The item being acted upon.
Param
string $column_name Current column name.
Param
string $primary Primary column name.
Return
string The row actions HTML, or an empty string if the current column is not the primary column.
Method
ajax_response public
Handles an incoming ajax request (called from admin-ajax.php)
Since
3.1.0
Method
_js_vars public
Sends required variables to JavaScript land.
Since
3.1.0
Class

WpListTable

Method
getLogger public
Provide a logger with desired log handlers
Return
NfLogger
Method
getDebugLogHandler public
Construct the desired log handler for debug level logs
Return
NfLogHandler
Method
getWarningHandler public
Construct the desired log handler for warning level logs
Return
NfLogHandler
Class

WpListTable

Method
log public
Handle the log data in some fashion Typical uses include storing data in log file or in DB
Param
string|\Stringable $key
Param
array $context
Return
void
Method
getPluginLogEntries public
Return indexed array of all log entries for a given plugin
Return
array LogEntry[]
Method
deletePluginLogEntries public
Delete all plugin entries for a given plugin
Return
void
Method
setPluginPrefix public
Set plugin prefix
Handlers must have a method to retrieve stored entries by plugin; setting this key enables easy identification by each handler
Param
string $prefix
Return
void
Class

WpListTable

Method
pushLogHandler public
Push a log handler onto the stack of handlers
Param
LogHandler $handler
Param
string $logLevel
Return
void
Class

DebugLog

Method
__construct public
Method
registerRoutes /** * Register REST API routes for the debug log */
Method
getDebugLogEntries public
Method
deleteAllDiagnostics public
Method
getDebugLogEntriesPermissionCallback public
Verify user is permitted to download diagnostics
Authorization handled using WP nonce
Param
WP_REST_Request $request
Return
void
Class

AbstractLogger

Class

InvalidArgumentException

Class

LogLevel

Describes log levels.

Class

LogLevel

Method
setLogger public
Sets a logger instance on the object.
Param
LoggerInterface $logger
Return
void
Class

LogLevel

Method
setLogger public
Sets a logger.
Param
LoggerInterface $logger
Class

LogLevel

Method
emergency public
System is unusable.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
alert public
Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
critical public
Critical conditions.
Example: Application component unavailable, unexpected exception.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
error public
Runtime errors that do not require immediate action but should typically be logged and monitored.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
warning public
Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
notice public
Normal but significant events.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
info public
Interesting events.
Example: User logs in, SQL logs.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
debug public
Detailed debug information.
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Method
log public
Logs with an arbitrary level.
Param
mixed $level
Param
string|\Stringable $message
Param
mixed[] $context
Return
void
Throws
\Psr\Log\InvalidArgumentException
Class

LogLevel

Method
emergency public
System is unusable.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
alert public
Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
critical public
Critical conditions.
Example: Application component unavailable, unexpected exception.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
error public
Runtime errors that do not require immediate action but should typically be logged and monitored.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
warning public
Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
notice public
Normal but significant events.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
info public
Interesting events.
Example: User logs in, SQL logs.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
debug public
Detailed debug information.
Param
string|\Stringable $message
Param
array $context
Return
void
Method
log public
Class

NullLogger

This Logger can be used to avoid conditional log calls.
Logging should always be optional, and if no logger is provided to your library creating a NullLogger instance to have something to throw logs at is a good way to avoid littering your code with `if ($this->logger) { }` blocks.

Method
log public
Logs with an arbitrary level.
Param
mixed $level
Param
string|\Stringable $message
Param
array $context
Return
void
Throws
\Psr\Log\InvalidArgumentException
Class

Foo

Method
__construct public
Method
doSomething public
Class

ScheduledExportParameters

Entity to pass form export settings parameters
Provides a guarantee that any requested or required parameters have a known default value and type
Note that the `ExportSettings` configuration matches closely this object's field structure; this is because this object is the primary method to pass those form settings.

Method
getDelivery public
Get delivery method
Return
string
Method
getFormat public
Get output format
Return
string
Method
getInterval public
Get interval between exports
Return
string
Method
getMaxCount public
Get max number of submissions per export
Return
int
Method
getFormId public
Get form Id
Return
int
Method
getEmailTo public
Get Email `To` addresses string - comma delimited
Return
string
Method
getEmailFrom public
Get Email `From` address
Return
string
Method
getEmailReplyTo public
Get Email `Reply To` address
Return
string
Method
getEmailSubject public
Get Email `Subject`
Return
string
Method
getStartingTimestamp public
Get starting timestamp
Return
string Datetime in local timezone per WP settings
Method
setEmailTo public
Set Email `To` addresses - comma delimited
Param
string $incoming
Return
ScheduledExportParameters
Method
setEmailFrom public
Set Email `From` address
Param
string $incoming
Return
ScheduledExportParameters
Method
setEmailReplyTo public
Set Email `Reply To` address
Param
string $incoming
Return
ScheduledExportParameters
Method
setEmailSubject public
Set Email `Subject`
Param
string $incoming
Return
ScheduledExportParameters
Method
setFormId public
Set form Id
Param
int $incoming
Return
ScheduledExportParameters
Method
setDelivery public
Set delivery method
Param
string $incoming
Return
ScheduledExportParameters
Method
setFormat public
Set output format
Param
string $incoming
Return
ScheduledExportParameters
Method
setInterval public
Set interval between exports
Param
string $incoming
Return
ScheduledExportParameters
Method
setMaxCount public
Set max number of submissions per export
Param
int $incoming
Return
ScheduledExportParameters
Method
setStartingTimestamp public
Set starting timestamp
Param
string $incoming
Return
ScheduledExportParameters
Method
toArray public
Convert instance to associative array
Return
array
Static Method
fromArray public
Method
__get public
Magic method to return property
Param
string $name
Return
mixed
Method
__set public
Param
string $name
Param
mixed $value
Return
ScheduledExportParameters
Class

AddNewSubmissionExportScheduleMarkup

Constructs markup for Add New Submission Export Schedule

Method
handle public
Param
int $index
Param
ScheduledExportParameters $scheduledExportParameters
Method
createForm protected
Generate markup for form output
Return
string
Method
generateFormOpen protected
Open form with wrapper, header, and handle
Return
string
Method
generateFormSelectionOutput protected
Method
generateIntervalMarkup protected
Generate Export Interval markup
Return
string
Method
generateFormatMarkup protected
Generate Export Format markup
Return
string
Method
generateDeliveryMarkup protected
Generate Export Delivery markup
Return
string
Method
generateFormClose protected
Generate form close with hidden values and closing tags
Return
string
Class

ElementBuilder

Builds HTML elements

Method
divWrapper public
Generate markup for outer box element; bool for closing tag
Param
bool $close
Return
string
Method
formElement public
Markup form opening and close elements
Param
string $endpoint
Param
bool $close
Return
string
Method
togglePanelButton public
Param
string $text Toggle button text
Return
string
Method
accordionHandle public
Generate accordion handle markup
Param
string $text Accordion handle text
Param
mixed $formId Form Id
Return
string
Method
generateSelectMarkup public
Generate Select markup
Param
string $elementId
Param
string $label
Param
string $optionsMarkup
Return
string
Method
generateOptions public
Generate options markup from FormSettings' defined options
Param
array $options
Param
mixed $selectedValue
Return
string
Method
textboxElement public
Mark up a textbox element
Param
string $label
Param
string $dataId
Param
mixed $value
Param
string $divStyle
Param
string $inputStyle
Return
string
Method
buttonElement public
Mark up a button element
Param
string $id
Param
type $label
Return
string
Method
hiddenElement public
Mark up a hidden input element
Param
string $dataId
Param
mixed $value
Return
string
Class

ExistingExportTableMarkup

Generate markup of existing scheduled exports as list table

Method
setExistingExports public
Generate markup for modifying export date and times
Method
prepare_items /** @inheritDoc */
Method
generateLineItems protected
Generates the line items for the table
Return
void
Method
generateFormMarkup protected
Generate markup for a form's scheduled exports
Param
string $formId
Param
array $scheduledExportsByForm
Return
string
Method
generateFormTitleMarkup protected
Generate form title with link to form
Param
string $formId
Return
string
Method
generateEditLinkMarkup protected
Generate href link to edit form
Param
string $formid
Return
string
Method
getBaseFormEditUrl protected
Construct base URL for form edit
Return
string
Method
get_columns /** @inheritDoc */
Method
column_default /** @inheritDoc */
Class

ModifyExportTimingMarkup

Generate markup for modifying export date and times

Method
handle public
Generate markup for modifying export date and times
Method
generateMenuPageHeader protected
Method
createForm protected
Generate markup for form output
Return
string
Method
generateFormOpen protected
Open form with wrapper, header, and handle
Return
string
Method
generateExistingScheduleDescription protected
Generate form heading
Return
string
Method
generateFormTable protected
Method
generateDailyMarkup protected
Return markup for daily schedule
Return
string
Method
generateWeeklyMarkup protected
Return markup for weekly schedule
Return
string
Method
formatDate protected
Return formatted string of date
Param
int $timestamp Unix timestamp
Return
string
Method
generateWeekdayOptions protected
Return markup for Day of Week selection
Return
string
Method
generateDailyTimeOptions protected
Return markup of daily time select options
Return
string
Method
generateWeeklyTimeOptions protected
Return markup of weekly time select options
Return
string
Method
getTimeSlots protected
Return array of time slot options
Return
array
Method
generateFormClose protected
Generate form close with hidden values and closing tags
Return
string
Method
setLogger public
Set the logger
Return
ModifyExportTimingMarkup
Method
getLogger public
Provide the logger, fallback to empty logger
Class

ScheduledExportUiMarkup

Constructs markup for dashboard page scheduled export markup

Method
handle public
Param
int $index
Param
ScheduledExportParameters $scheduledExportParameters
Method
createForm protected
Generate markup for form output
Return
string
Method
generateFormOpen protected
Open form with wrapper, header, and handle
Return
string
Method
generateIntervalMarkup protected
Generate Export Interval markup
Return
string
Method
generateFormatMarkup protected
Generate Export Format markup
Return
string
Method
generateDeliveryMarkup protected
Generate Export Delivery markup
Return
string
Method
generateFormClose protected
Generate form close with hidden values and closing tags
Return
string
Class

ModifyCronTiming

Modify Cron timing from dashboard request

Method
__construct public
Initialize Cron storage upon construct
Method
handle public
Modify Cron timing from dashboard request associative array
Param
array $array Keyed array dailytime, weeklytime, hourlytime,dayofweek,timezonestring
Method
setExternallyDependentProperties protected
Set properties used throughout object
Isolate the setting of properties dependent on external conditions, isolating these to enable unit testing
Return
void
Method
calculateNextDayOfWeek protected
Calculate timestamp for next weekly export
Param
int $dayOfWeek Integer day of week (1-7)
Param
string $timeString Parseable time string
Return
int Unix timestamp
Method
calculateNextTimeOfDay protected
Calculate timestamp of next daily export
Param
string $timeString
Param
int $next Time offset in seconds until next day
Return
int Unix timestamp
Method
setLogger public
Set the logger
Return
ModifyCronTiming
Method
getLogger public
Provide the logger, fallback to empty logger
Class

SubmissionCsvUploadsDelivery

Upload CSV file to a specified location Default location is WP Uploads directory

Method
__construct public
Set default values for CSV upload to Uploads directory
Method
handle public
Write the contents of a csv string to a file
Param
string $content
Param
string $filename
Method
setUploadDirectory public
Set upload directory If not set, then default value is used
Param
string $dir
Return
$this
Method
setDefaults protected
Set default properties
Method
writeTempFile protected
Write contents to temporary file location
Method
renameFile protected
Rename temp file to permanent file name
Param
string $filename
Class

SubmissionExportUpdater

Updates form settings for a given ScheduledExportParameter and index

Method
__construct public
Initialize form settings storage upon construct
Method
handle public
Update form settings for a given ScheduledExportParameter and index
Param
ScheduledExportParameters $scheduledExportParameters
Param
int $index
Method
addOrUpdateParameters protected
Set export parameters in correct index position
Param
ScheduledExportParameters $scheduledExportParameters
Param
int $index
Method
retrieveCurrentFormSettings protected
Retrieve scheduled export settings for given form Id
Param
int $formId
Class

TemplateBuilder

Build output template script

Method
handle public
Method
constructTemplate protected
Construct action settings template
Return
void
Method
scriptOpen protected
Generate opening script tag
Param
string $id
Return
string
Method
addMenuHandle protected
Add menu handle
Return
string
Method
addSelectBox protected
Add markup for select box
Param
string $label
Param
string $optionKey
Param
string $style
Return
string
Method
addTextbox protected
Add markup for textbox
Param
string $label
Param
string $optionKey
Param
string $style
Return
string
Method
addDisabledTextbox protected
Add markup for disabled textbox
Param
string $label
Param
string $optionKey
Param
string $style
Return
string
Method
addHiddenTextbox protected
Add markup for hidden textbox
Param
string $label
Param
string $optionKey
Param
string $style
Return
string
Method
scriptClose protected
Add markup to close the script
Return
string
Class

TemplateBuilder

Method
getExportRequests public
Return all export requests across all forms
Return
array NinjaForms\NfScheduledExports\Entities\ScheduledExportParameters keyed on forms, then indexed for multiple export schedules per form
Method
getByInterval public
Return all ScheduledExportParameters for a given interval Array keyed on interval, sub-key is indexed array
Param
string $interval
Return
array
Method
getExportSettingsByForm public
Get indexed array of scheduled export parameters by form Id
Param
int $formId
Method
setExportSettings public
Set export settings for a given form id Given form Id and indexed array of scheduled export parameters
Param
int $formId
Param
array $scheduledExportParametersArray
Class

NinjaFormsScheduledExports


Main class that controls plugin functionality

Method
__construct public
Initialize form settings for scheduled actions with admin page output
Method
set_timezone_missing_notice public
Display an error message if timezone is not set in general options
Method
initializeLogger public
Initializes debug logger for injection
Method
injectLogger protected
Method
setupAdmin public
Setup admin classes for Ninja Forms and WordPress Hooked into `init`
Method
registerSettingsScript public
Register settings script for settings page
Contains script for calling REST routes of debug logger
Return
void
Method
registerEndpoint public
Register endpoints for triggering updates to schedules or timing
Method
addPluginSettingsGroup public
Add configured settings group to the NF groups
Param
array $groups
Return
array
Method
addPluginSettings public
Add configured plugin settings to the plugin group
Param
array $settings
Return
array
Method
Configure public
Return configured data
Param
string $filename Filename without extension
Param
string $type File type - 'php' or 'json'
Return
mixed
Method
updateExportSchedule public
Callback method for scheduled-exports endpoint
Param
WP_REST_Request $request
Method
updateCronDateTime public
Callback method for submission-export-datetime endpoint
Param
WP_REST_Request $request
Method
adminNotices public
Function to register any admin notices we need to show.
Param
$notices (Array) The list of admin notices.
Return
array The updated list of admin notices.
Class

CronStorage

Manage the retrieval and storage of Cron job information

Method
scheduleEvents public
Link a hook to a named interval at a given start time
Method
setDefaultSchedule public
Set a default cron job if one does not already exist
Method
topOfHourTimestamp protected
Return timestamp for top of the next hour
Param
integer $epochTime
Return
integer
Method
setHourlyTimestamp public
Set the timestamp for the next scheduled hourly cron job
Param
int $timestamp
Method
setDailyTimestamp public
Set the timestamp for the next scheduled daily cron job
Param
int $timestamp
Method
setWeeklyTimestamp public
Set the timestamp for the next scheduled daily cron job
Param
int $timestamp
Method
getNextScheduled public
Return the next scheduled job for a given interval, 0 if not scheduled
Param
string $interval
Return
int Unix timestamp
Class

FormSettingsStorage

Provide Scheduled Export Settings as stored in Form Settings

Method
getExportRequests public
@inheritDoc
Method
constructScheduledExportParameterCollection protected
Construct indexed array ScheduledExportParameter objects
Param
string $formId
Param
array $exportSettings
Return
array Keys 'formExportRequests', 'supportingData'
Method
getByInterval public
@inheritDoc
Method
getExportSettingsByForm public
Get indexed array of scheduled export parameters by form Id
Param
int $formId
Method
setExportSettings public
Set export settings for a given form id Given form Id and indexed array of scheduled export parameters
Param
int $formId
Param
ScheduledExportParameters[] $scheduledExportParametersArray
Method
cacheOnDelivery protected
Rebuild the cache so every other Ninja_Forms() call gets the updated data
Param
int $formId
Method
getExportSettings protected
Get form export settings stored as a form Setting Each form can have multiple ExportSettings, each of which specifies an interval, format, and delivery method at the minimum. May include email addresses and additional data required for any given export.
Param
int $formId
Return
array
Method
getFormIds protected
Get indexed array of form Ids
Method
setLogger public
Set the logger
Return
FormSettingsStorage
Method
getLogger public
Provide the logger, fallback to empty logger
Class

ModifyCronTimingTest

Method
ensureScheduleSetsOnSameDay public
Ensure schedule sets time on current day when current time has not passed
@test
Method
ensureScheduleBumpsToNextDay public
Ensure schedule moves to following day when scheduled time has passed today
@test
Method
ensureFailsafeWhenNoTimezoneSet public
Ensure schedule defaults to GMT when no timezone is set
@test
Method
mockTestedClass protected
Return tested class with exposed methods and test params
Param
array $params
Return
ModifyCronTiming
Class

$params

Method
__construct public
Pass test parameters into mocked object
Param
array $params
Return
void
Method
callCalculateNextTimeOfDay public
Call the protected method calculateNextTimeOfDay() and return value
Return
void
Class

ModifyExportTimingMarkupTest

Method
ensureExpectedOperation public
Ensure expected operation
Passes a valid Unix timestamp and valid timezone string, expects the correct string time @test
Method
ensureEmptyTimezoneSuccess public
Ensure empty timezone does not cause failure Before resolution of issue #2, this test fails @test
See
https://github.com/Saturday-Drive/ninja-forms-scheduled-exports/issues/2
Method
mockTestedClass protected
Return tested class with exposed methods and test params
Param
array $params
Return
ModifyExportTimingMarkup
Class

$params

Method
__construct public
Pass test parameters into mocked object
Param
array $params
Return
void
Method
callFormatDate public
Call the protected method formatDate() and return value
Return
void
Class

ScheduledExportParametersTest

Method
ensureConstructionFromEmptyArray public
Ensure values constructed from empty array @test
Return
void
Class

Method
ensureNewConstruction public
Ensure values constructed from 'new' command @test
Return
void
Method
ensureValidFromArrayConstruction public
Ensure values constructed from expected data @test
Return
void
Method
ensureInvalidFromArrayConstruction public
Ensure values constructed from incorrect data @test
Return
void
Method
ensureIntegerValuesAsString public
Ensure integer value of string converts to integer @test
Return
void
Class

PluginTestCase

Method
setUpUnitTestMockEnvironment public
Sets up a mock environment for unit tests Adds just enough function shims to do unit testing in specific areas. Unit tests must not rely upon any of the shimmed functions, which are present only to prevent construction errors from missing function dependencies.
Return
void
Method
defineAbspath protected
Set ABSPATH to the Wordpress directory
Return
void
Method
UnitShims protected
Include WP shims not handled by Brain Monkey
Return
void
Method
shimNinjaForms protected
Shim basic Ninja_Forms() functionality to enable unit testing
Return
void
Method
configureGetOption public
Mock get_option and update_option with global array variable
Param
array $incomingOptions
Return
void
Method
configure public
Return a configuration array
Param
string $configurationName
Param
string $extension
Return
array
Class

PluginTestCase

Method
add_shortcode <?php
Class

PluginTestCase

Method
esc_html__ <?php
Class

PluginTestCase

Method
get_option
Method
update_option
Class

Ninja_Forms

This is a shim for Ninja Forms; it does not function, but it provides the named functionality such that unit tests for classes that call Ninja_Forms() on construct can be instantiated without errors. The unit tests calling this instance MUST NOT use any Ninja_Forms() functionality as the results cannot be trusted. Such integration tests will require an environment in which a true Ninja_Forms() class can operate.

Static Method
instance public
Method
form public
Form Model Factory Wrapper
Param
$id
Return
NF_Abstracts_ModelFactory
Method
logger public
Logger Class Wrapper
Example Use: Ninja_Forms()->logger()->log( 'debug', "Hello, {name}!", array( 'name' => 'world' ) ); Ninja_Forms()->logger()->debug( "Hello, {name}!", array( 'name' => 'world' ) );
Return
string
Method
dispatcher public
Method
eos public
Method
session public
Method
request public
Method
background_process public
Method
get_setting public
Get a setting
Param
string $key
Param
bool|false $default
Return
bool
Method
get_settings public
Get all the settings
Return
array
Method
update_setting public
Update a setting
Param
string $key
Param
mixed $value
Param
bool|false $defer_update Defer the database update of all settings
Method
update_settings public
Save settings to database
Param
array $settings
Static Method
template public
Static Method
config public
Method
Ninja_Forms /** * The main function responsible for returning The Highlander Ninja_Forms * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * Example: <?php $nf = Ninja_Forms(); ?> * * @since 2.7 * @return Ninja_Forms Highlander Instance */
Class

Ninja_Forms

Method
plugins_url <?php
Method
is_ssl
Class

Ninja_Forms

Method
__
Class

Ninja_Forms

Method
remove_all_filters /** * Remove all of the hooks from a filter. * * @since 2.7.0 * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param string $tag The filter to remove hooks from. * @param int|false $priority Optional. The priority number to remove. Default false. * @return true True when finished. */
The plugin API is located in this file, which allows for creating actions and filters and hooking functions, and methods. The functions or methods will then be run when the action or filter is called.
The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways.
Any of the syntaxes explained in the PHP documentation for the {
Link
https://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {
Link
https://developer.wordpress.org/plugins/ Plugin API} for more information and examples on how to use a lot of these functions.
This file should have no external dependencies.
Package
WordPress
Subpackage
Plugin
Since
1.5.0
Method
current_action /** * Retrieve the name of the current action. * * @since 3.9.0 * * @return string Hook name of the current action. */
Method
remove_all_actions /** * Remove all of the hooks from an action. * * @since 2.7.0 * * @param string $tag The action to remove hooks from. * @param int|false $priority The priority number to remove them from. Default false. * @return true True when finished. */
Method
plugin_basename /** * Gets the basename of a plugin. * * This method extracts the name of a plugin from its filename. * * @since 1.5.0 * * @global array $wp_plugin_paths * * @param string $file The filename of plugin. * @return string The name of a plugin. */
Method
wp_register_plugin_realpath /** * Register a plugin's real path. * * This is used in plugin_basename() to resolve symlinked paths. * * @since 3.9.0 * * @see wp_normalize_path() * * @global array $wp_plugin_paths * * @param string $file Known path to the file. * @return bool Whether the path was able to be registered. */
Method
plugin_dir_path /** * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the filesystem path of the directory that contains the plugin. */
Method
plugin_dir_url /** * Get the URL directory path (with trailing slash) for the plugin __FILE__ passed in. * * @since 2.8.0 * * @param string $file The filename of the plugin (__FILE__). * @return string the URL path of the directory that contains the plugin. */
Method
register_activation_hook /** * Set the activation hook for a plugin. * * When a plugin is activated, the action 'activate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'activate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'activate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'activate_PLUGIN' action. */
Method
register_deactivation_hook /** * Set the deactivation hook for a plugin. * * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is * called. In the name of this hook, PLUGINNAME is replaced with the name * of the plugin, including the optional subdirectory. For example, when the * plugin is located in wp-content/plugins/sampleplugin/sample.php, then * the name of this hook will become 'deactivate_sampleplugin/sample.php'. * * When the plugin consists of only one file and is (as by default) located at * wp-content/plugins/sample.php the name of this hook will be * 'deactivate_sample.php'. * * @since 2.0.0 * * @param string $file The filename of the plugin including the path. * @param callable $function The function hooked to the 'deactivate_PLUGIN' action. */
Method
register_uninstall_hook /** * Set the uninstallation hook for a plugin. * * Registers the uninstall hook that will be called when the user clicks on the * uninstall link that calls for the plugin to uninstall itself. The link won't * be active unless the plugin hooks into the action. * * The plugin should not run arbitrary code outside of functions, when * registering the uninstall hook. In order to run using the hook, the plugin * will have to be included, which means that any code laying outside of a * function will be run during the uninstallation process. The plugin should not * hinder the uninstallation process. * * If the plugin can not be written without running code within the plugin, then * the plugin should create a file named 'uninstall.php' in the base plugin * folder. This file will be called, if it exists, during the uninstallation process * bypassing the uninstall hook. The plugin, when using the 'uninstall.php' * should always check for the 'WP_UNINSTALL_PLUGIN' constant, before * executing. * * @since 2.7.0 * * @param string $file Plugin file. * @param callable $callback The callback to run when the hook is called. Must be * a static method or function. */
Method
_wp_call_all_hook /** * Call the 'all' hook, which will process the functions hooked into it. * * The 'all' hook passes all of the arguments or parameters that were used for * the hook, which this function was called for. * * This function is used internally for apply_filters(), do_action(), and * do_action_ref_array() and is not meant to be used from outside those * functions. This function does not check for the existence of the all hook, so * it will fail unless the all hook exists prior to this function call. * * @since 2.5.0 * @access private * * @global WP_Hook[] $wp_filter Stores all of the filters and actions. * * @param array $args The collected parameters from the hook that was called. */
Method
_wp_filter_build_unique_id /** * Build Unique ID for storage and retrieval. * * The old way to serialize the callback caused issues and this function is the * solution. It works by checking for objects and creating a new property in * the class to keep track of the object and new objects of the same class that * need to be added. * * It also allows for the removal of actions and filters for objects after they * change class properties. It is possible to include the property $wp_filter_id * in your class and set it to "null" or a number to bypass the workaround. * However this will prevent you from adding new classes and any new classes * will overwrite the previous hook by the same class. * * Functions and static method callbacks are just returned as strings and * shouldn't have any speed penalty. * * @link https://core.trac.wordpress.org/ticket/3875 * * @since 2.2.3 * @since 5.3.0 Removed workarounds for spl_object_hash(). * `$tag` and `$priority` are no longer used, * and the function always returns a string. * @access private * * @param string $tag Unused. The name of the filter to build ID for. * @param callable $function The function to generate ID for. * @param int $priority Unused. The order in which the functions * associated with a particular action are executed. * @return string Unique function ID for usage as array key. */
Class

VerifyTestStructureTest

Method
ensureTestSuiteRuns public
@test