AddSubmenuPage
Add submenu page enabling edits on all scheduled submission exports
-
Method
- __construct public
-
Construct submenu page using FormSettingsStorage
ParamFormSettingsStorage $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
ReturnAddSubmenuPage
Method
- getLogger public
- Provide the logger, fallback to empty logger
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
Paramtype $typesReturntype
Method
- formExportSettings public
-
Append Export Schedule option repeater to Scheduled Exports section
Paramarray $settingsReturnarray
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)
Paramint $formIdReturnarray
Method
- getFormIds protected
- Get indexed array of form Ids
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
ParamStorageInterface $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.
Paramstring $interval
Method
- makeSubmissionAggregate protected
-
Return filtered SubmissionAggregate
ParamSubmissionFilter $submissionFilterReturnSubmissionAggregate
Method
- generateFormattedOutput protected
-
Select method for generating output, return array of filenames
Paramstring $formatParamSubmissionAggregate $submissionAggregateReturnarray 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.
ParamSubmissionAggregate $submissionsCollectionReturnarray
Method
- deliverOutput protected
-
Select delivery method to deliver attachments
Paramstring $deliveryParamScheduledExportParameters $scheduledExportParametersParamarray $attachmentNamesParamarray $fileInfos Array of filenames for attachment
Method
- deliverEmail protected
-
Deliver specified files via email
ParamScheduledExportParameters $scheduledExportParametersParamarray $fileInfos
Method
- getFromEmailAddress protected
-
Provide a 'from' email address for email
Currently defaults to admin email
Returnstring
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] $wpErrorReturnvoid
Method
- convertExportParametersToSubmissionFilter protected
-
Given export request and interval, generate submission filter parameters
ParamScheduledExportParameters $scheduledExportParametersParamstring $intervalReturnSubmissionFilter
Method
- setLogger public
-
Set the logger
Returnself
Method
- getLogger public
- Provide the logger, fallback to empty logger
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
Paramstring $nameReturnvoid
Method
- __set public
-
Magic method setter for properties
Paramstring $nameParammixed $valueReturnVoid
Method
- __toString public
- @inheritDoc Method
- getLevel public
-
Get PSR log level
Returnstring
Method
- setLevel public
-
Set PSR log level
Paramstring $level PSR log level
ReturnLogEntry
Method
- getSummary public
-
Get log summary
Returnstring
Method
- setSummary public
-
Set log summary
Paramstring $summary Log summary
ReturnLogEntry
Method
- getTimestamp public
-
Get timestamp in epoch format
Returnint
Method
- setTimestamp public
-
Set timestamp in epoch format
Paraminteger $timestamp Timestamp in epoch format
ReturnLogEntry
Method
- getLogPoint public
-
Get situation under which entry happened
Returnstring
Method
- setLogPoint public
-
Set situation under which entry happened
Paramstring $logPoint Situation under which entry happened
ReturnLogEntry
Method
- getSupportingData public
-
Get supporting data
Returnstring
Method
- setSupportingData public
-
Set supporting data
Paramstring $supportingData
ReturnLogEntry
Method
- getExpiration public
-
Get used for cleanup of records in DB
Returninteger
Method
- setExpiration public
-
Set used for cleanup of records in DB
Paraminteger $expiration Used for cleanup of records in DB
ReturnLogEntry
LogLevel
Class that extends standard log levels with custom log levels
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
ReturnNfLogger
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
DownloadDebugLog
-
Method
- __construct public
- Method
- getDebugJson public
-
Get debug log as JSON string
Returnstring
Method
- getDebugLog protected
-
Get collection of log entries for the plugin
Returnarray
Method
- constructJsonString protected
-
Construct JSON string from debug log
Returnstring
Method
- constructLineItem protected
-
Construct a stringed line item as JSON for easy reading
Unpack double encoded supportingData
ParamLogEntry $logEntryReturnstring
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
ParamNfLogHandler $handlerParamstring $logLevelReturnvoid
WordPressSettingsElementBuilder
Builds HTML elements to match WP settings
-
Method
- formElement public
-
Markup form opening and close elements
Paramstring $endpointParambool $closeReturnstring
Method
- generateSelectMarkup public
-
Generate Select markup
Paramstring $elementIdParamstring $optionsMarkupReturnstring
Method
- generateOptions public
-
Generate options markup from FormSettings' defined options
Paramarray $optionsParammixed $selectedValueReturnstring
Method
- textboxElement public
-
Mark up a textbox element
Paramstring $labelParamstring $dataIdParammixed $valueParamstring $divStyleParamstring $inputStyleReturnstring
Method
- buttonElement public
-
Mark up a button element
Paramstring $idParamtype $labelReturnstring
Method
- hiddenElement public
-
Mark up a hidden input element
Paramstring $dataIdParammixed $valueReturnstring
Method
- generateFormTable public
-
Generate open/close elements on form table
Paramboolean $close TRUE to close previously opened form elementReturnstring
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
Returnarray
Method
- getLogEntriesByLevel public
-
Get log entries by log level
Paramstring $requested The requested level to fetchReturnarray
Method
- getCallerLogEntries public
-
Get log entries by caller
Paramstring $identifier The target log pointReturnarray
Method
- getLogEntriesByParam protected
-
Base method for getting log entries from the table
Paramstring $key the column to narrow our results byParammixed $value the value(s) to apply in our searchReturnarray
Method
- $logEntryArray
- Method
- deletePluginLogEntries public
- @inheritDoc Method
- buildLogEntry protected
-
Construct log entry object from log request
Param$messageParamarray $contextReturnLogEntry
Method
- maybeAddTable protected
-
Add our table if necessary
Returnvoid
Method
- tableExists protected
-
Verify our table exists
Returnboolean
Method
- storeLogEntry protected
-
Store entry in our table
ParamLogEntry $logEntryReturnvoid
Method
- setPluginPrefix public
- @inheritDoc
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
Paramstring|\Stringable $messageParamarray $contextReturnLogEntry
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
ParamLogEntry $logEntryReturnvoid
Method
- getPluginLogEntries public
- @inheritDoc Method
- deletePluginLogEntries public
- @inheritDoc Method
- setPluginPrefix public
- @inheritDoc
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.
-
Method
- __construct public
-
Constructor.
The child class should call this constructor from its own constructor to override the default $args.
Since3.1.0
Paramarray|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.
Since4.0.0
Paramstring $name Property to get.Returnmixed Property.
Method
- __set public
-
Make private properties settable for backward compatibility.
Since4.0.0
Paramstring $name Property to check if set.Parammixed $value Property value.Returnmixed Newly-set property.
Method
- __isset public
-
Make private properties checkable for backward compatibility.
Since4.0.0
Paramstring $name Property to check if set.Returnbool Whether the property is a back-compat property and it is set.
Method
- __unset public
-
Make private properties un-settable for backward compatibility.
Since4.0.0
Paramstring $name Property to unset.
Method
- __call public
-
Make private/protected methods readable for backward compatibility.
Since4.0.0
Paramstring $name Method to call.Paramarray $arguments Arguments to pass when calling.Returnmixed|bool Return value of the callback, false otherwise.
Method
- ajax_user_can public
-
Checks the current user's permissions
Since3.1.0 @abstract
Method
- prepare_items public
-
Prepares the list of items for displaying.
@uses WP_List_Table::set_pagination_args()
Since3.1.0 @abstract
Method
- set_pagination_args protected
-
An internal method that sets all the necessary pagination arguments
Since3.1.0
Paramarray|string $args Array or string of arguments with information about the pagination.
Method
- get_pagination_arg public
-
Access the pagination args.
Since3.1.0
Paramstring $key Pagination argument to retrieve. Common values include 'total_items', 'total_pages', 'per_page', or 'infinite_scroll'.Returnint Number of items that correspond to the given pagination argument.
Method
- has_items public
-
Whether the table has items to display or not
Since3.1.0
Returnbool
Method
- no_items public
-
Message to be displayed when there are no items
Since3.1.0
Method
- search_box public
-
Displays the search box.
Since3.1.0
Paramstring $text The 'submit' button label.Paramstring $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'`
Since3.1.0
Returnarray
Method
- views public
-
Displays the list of views available on this table.
Since3.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', ] ]
Since3.1.0Since5.6.0 A bulk action can now contain an array of options in order to create an optgroup.
Returnarray
Method
- bulk_actions protected
-
Displays the bulk actions dropdown.
Since3.1.0
Paramstring $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.
Since3.1.0
Returnstring|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.
Since3.1.0
Paramstring[] $actions An array of action links.Parambool $always_visible Whether the actions should be always visible.Returnstring The HTML for the row actions.
Method
- months_dropdown protected
-
Displays a dropdown for filtering items in the list table by month.
Since3.1.0
@global wpdb $wpdb WordPress database abstraction object. @global WP_Locale $wp_locale WordPress date and time locale object.
Paramstring $post_type The post type.
Method
- view_switcher protected
-
Displays a view switcher.
Since3.1.0
Paramstring $current_mode
Method
- comments_bubble protected
-
Displays a comment count bubble.
Since3.1.0
Paramint $post_id The post ID.Paramint $pending_comments Number of pending comments.
Method
- get_pagenum public
-
Gets the current page number.
Since3.1.0
Returnint
Method
- get_items_per_page protected
-
Gets the number of items to display on a single page.
Since3.1.0
Paramstring $option User option name.Paramint $default_value Optional. The number of items to display. Default 20.Returnint
Method
- pagination protected
-
Displays the pagination.
Since3.1.0
Paramstring $which
Method
- get_columns public
-
Gets a list of columns.
The format is: - `'internal-name' => 'Title'`
Since3.1.0 @abstract
Returnarray
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.
Since3.1.0
Returnarray
Method
- get_default_primary_column_name protected
-
Gets the name of the default primary column.
Since4.3.0
Returnstring 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().
Since4.4.0
Returnstring Name of the default primary column.
Method
- get_primary_column_name protected
-
Gets the name of the primary column.
Since4.3.0
Returnstring The name of the primary column.
Method
- get_column_info protected
-
Gets a list of all, hidden, and sortable columns, with filter applied.
Since3.1.0
Returnarray
Method
- get_column_count public
-
Returns the number of visible columns.
Since3.1.0
Returnint
Method
- print_column_headers public
-
Prints column headers, accounting for hidden and sortable columns.
Since3.1.0
Parambool $with_id Whether to set the ID attribute or not
Method
- display public
-
Displays the table.
Since3.1.0
Method
- get_table_classes protected
-
Gets a list of CSS classes for the WP_List_Table table tag.
Since3.1.0
Returnstring[] Array of CSS classes for the table tag.
Method
- display_tablenav protected
-
Generates the table navigation above or below the table
Since3.1.0Paramstring $which
Method
- extra_tablenav protected
-
Extra controls to be displayed between bulk actions and pagination.
Since3.1.0
Paramstring $which
Method
- display_rows_or_placeholder public
-
Generates the tbody element for the list table.
Since3.1.0
Method
- display_rows public
-
Generates the table rows.
Since3.1.0
Method
- single_row public
-
Generates content for a single row of the table.
Since3.1.0
Paramobject|array $item The current item
Method
- column_default protected
-
Paramobject|array $itemParamstring $column_name
Method
- column_cb protected
-
Paramobject|array $item
Method
- single_row_columns protected
-
Generates the columns for a single row of the table.
Since3.1.0
Paramobject|array $item The current item.
Method
- handle_row_actions protected
-
Generates and display row actions links for the list table.
Since4.3.0
Paramobject|array $item The item being acted upon.Paramstring $column_name Current column name.Paramstring $primary Primary column name.Returnstring 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)
Since3.1.0
Method
- _js_vars public
-
Sends required variables to JavaScript land.
Since3.1.0
WpListTable
-
Method
- getLogger public
-
Provide a logger with desired log handlers
ReturnNfLogger
Method
- getDebugLogHandler public
-
Construct the desired log handler for debug level logs
ReturnNfLogHandler
Method
- getWarningHandler public
-
Construct the desired log handler for warning level logs
ReturnNfLogHandler
WpListTable
-
Method
- log public
-
Handle the log data in some fashion
Typical uses include storing data in log file or in DB
Paramstring|\Stringable $keyParamarray $contextReturnvoid
Method
- getPluginLogEntries public
-
Return indexed array of all log entries for a given plugin
Returnarray LogEntry[]
Method
- deletePluginLogEntries public
-
Delete all plugin entries for a given plugin
Returnvoid
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
Paramstring $prefixReturnvoid
WpListTable
-
Method
- pushLogHandler public
-
Push a log handler onto the stack of handlers
ParamLogHandler $handlerParamstring $logLevelReturnvoid
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 nonceParamWP_REST_Request $requestReturnvoid
AbstractLogger
InvalidArgumentException
LogLevel
Describes log levels.
LogLevel
-
Method
- setLogger public
-
Sets a logger instance on the object.
ParamLoggerInterface $logger
Returnvoid
LogLevel
-
Method
- setLogger public
-
Sets a logger.
ParamLoggerInterface $logger
LogLevel
-
Method
- emergency public
-
System is unusable.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
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.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- critical public
-
Critical conditions.
Example: Application component unavailable, unexpected exception.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- error public
-
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
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.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- notice public
-
Normal but significant events.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- info public
-
Interesting events.
Example: User logs in, SQL logs.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- debug public
-
Detailed debug information.
Paramstring|\Stringable $messageParammixed[] $context
Returnvoid
Method
- log public
-
Logs with an arbitrary level.
Parammixed $levelParamstring|\Stringable $messageParammixed[] $context
Returnvoid
Throws\Psr\Log\InvalidArgumentException
LogLevel
-
Method
- emergency public
-
System is unusable.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
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.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- critical public
-
Critical conditions.
Example: Application component unavailable, unexpected exception.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- error public
-
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
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.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- notice public
-
Normal but significant events.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- info public
-
Interesting events.
Example: User logs in, SQL logs.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- debug public
-
Detailed debug information.
Paramstring|\Stringable $messageParamarray $context
Returnvoid
Method
- log public
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.
Parammixed $levelParamstring|\Stringable $messageParamarray $context
Returnvoid
Throws\Psr\Log\InvalidArgumentException
Foo
-
Method
- __construct public
- Method
- doSomething public
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
Returnstring
Method
- getFormat public
-
Get output format
Returnstring
Method
- getInterval public
-
Get interval between exports
Returnstring
Method
- getMaxCount public
-
Get max number of submissions per export
Returnint
Method
- getFormId public
-
Get form Id
Returnint
Method
- getEmailTo public
-
Get Email `To` addresses string - comma delimited
Returnstring
Method
- getEmailFrom public
-
Get Email `From` address
Returnstring
Method
- getEmailReplyTo public
-
Get Email `Reply To` address
Returnstring
Method
- getEmailSubject public
-
Get Email `Subject`
Returnstring
Method
- getStartingTimestamp public
-
Get starting timestamp
Returnstring Datetime in local timezone per WP settings
Method
- setEmailTo public
-
Set Email `To` addresses - comma delimited
Paramstring $incomingReturnScheduledExportParameters
Method
- setEmailFrom public
-
Set Email `From` address
Paramstring $incomingReturnScheduledExportParameters
Method
- setEmailReplyTo public
-
Set Email `Reply To` address
Paramstring $incomingReturnScheduledExportParameters
Method
- setEmailSubject public
-
Set Email `Subject`
Paramstring $incomingReturnScheduledExportParameters
Method
- setFormId public
-
Set form Id
Paramint $incomingReturnScheduledExportParameters
Method
- setDelivery public
-
Set delivery method
Paramstring $incomingReturnScheduledExportParameters
Method
- setFormat public
-
Set output format
Paramstring $incomingReturnScheduledExportParameters
Method
- setInterval public
-
Set interval between exports
Paramstring $incomingReturnScheduledExportParameters
Method
- setMaxCount public
-
Set max number of submissions per export
Paramint $incomingReturnScheduledExportParameters
Method
- setStartingTimestamp public
-
Set starting timestamp
Paramstring $incoming
ReturnScheduledExportParameters
Method
- toArray public
-
Convert instance to associative array
Returnarray
Static Method
- fromArray public
- Method
- __get public
-
Magic method to return property
Paramstring $nameReturnmixed
Method
- __set public
-
Paramstring $nameParammixed $valueReturnScheduledExportParameters
AddNewSubmissionExportScheduleMarkup
Constructs markup for Add New Submission Export Schedule
-
Method
- handle public
-
Paramint $indexParamScheduledExportParameters $scheduledExportParameters
Method
- createForm protected
-
Generate markup for form output
Returnstring
Method
- generateFormOpen protected
-
Open form with wrapper, header, and handle
Returnstring
Method
- generateFormSelectionOutput protected
- Method
- generateIntervalMarkup protected
-
Generate Export Interval markup
Returnstring
Method
- generateFormatMarkup protected
-
Generate Export Format markup
Returnstring
Method
- generateDeliveryMarkup protected
-
Generate Export Delivery markup
Returnstring
Method
- generateFormClose protected
-
Generate form close with hidden values and closing tags
Returnstring
ElementBuilder
Builds HTML elements
-
Method
- divWrapper public
-
Generate markup for outer box element; bool for closing tag
Parambool $closeReturnstring
Method
- formElement public
-
Markup form opening and close elements
Paramstring $endpointParambool $closeReturnstring
Method
- togglePanelButton public
-
Paramstring $text Toggle button textReturnstring
Method
- accordionHandle public
-
Generate accordion handle markup
Paramstring $text Accordion handle textParammixed $formId Form IdReturnstring
Method
- generateSelectMarkup public
-
Generate Select markup
Paramstring $elementIdParamstring $labelParamstring $optionsMarkupReturnstring
Method
- generateOptions public
-
Generate options markup from FormSettings' defined options
Paramarray $optionsParammixed $selectedValueReturnstring
Method
- textboxElement public
-
Mark up a textbox element
Paramstring $labelParamstring $dataIdParammixed $valueParamstring $divStyleParamstring $inputStyleReturnstring
Method
- buttonElement public
-
Mark up a button element
Paramstring $idParamtype $labelReturnstring
Method
- hiddenElement public
-
Mark up a hidden input element
Paramstring $dataIdParammixed $valueReturnstring
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
Returnvoid
Method
- generateFormMarkup protected
-
Generate markup for a form's scheduled exports
Paramstring $formIdParamarray $scheduledExportsByFormReturnstring
Method
- generateFormTitleMarkup protected
-
Generate form title with link to form
Paramstring $formIdReturnstring
Method
- generateEditLinkMarkup protected
-
Generate href link to edit form
Paramstring $formidReturnstring
Method
- getBaseFormEditUrl protected
-
Construct base URL for form edit
Returnstring
Method
- get_columns /** @inheritDoc */
- Method
- column_default /** @inheritDoc */
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
Returnstring
Method
- generateFormOpen protected
-
Open form with wrapper, header, and handle
Returnstring
Method
- generateExistingScheduleDescription protected
-
Generate form heading
Returnstring
Method
- generateFormTable protected
- Method
- generateDailyMarkup protected
-
Return markup for daily schedule
Returnstring
Method
- generateWeeklyMarkup protected
-
Return markup for weekly schedule
Returnstring
Method
- formatDate protected
-
Return formatted string of date
Paramint $timestamp Unix timestampReturnstring
Method
- generateWeekdayOptions protected
-
Return markup for Day of Week selection
Returnstring
Method
- generateDailyTimeOptions protected
-
Return markup of daily time select options
Returnstring
Method
- generateWeeklyTimeOptions protected
-
Return markup of weekly time select options
Returnstring
Method
- getTimeSlots protected
-
Return array of time slot options
Returnarray
Method
- generateFormClose protected
-
Generate form close with hidden values and closing tags
Returnstring
Method
- setLogger public
-
Set the logger
ReturnModifyExportTimingMarkup
Method
- getLogger public
- Provide the logger, fallback to empty logger
ScheduledExportUiMarkup
Constructs markup for dashboard page scheduled export markup
-
Method
- handle public
-
Paramint $indexParamScheduledExportParameters $scheduledExportParameters
Method
- createForm protected
-
Generate markup for form output
Returnstring
Method
- generateFormOpen protected
-
Open form with wrapper, header, and handle
Returnstring
Method
- generateIntervalMarkup protected
-
Generate Export Interval markup
Returnstring
Method
- generateFormatMarkup protected
-
Generate Export Format markup
Returnstring
Method
- generateDeliveryMarkup protected
-
Generate Export Delivery markup
Returnstring
Method
- generateFormClose protected
-
Generate form close with hidden values and closing tags
Returnstring
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
Paramarray $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
Returnvoid
Method
- calculateNextDayOfWeek protected
-
Calculate timestamp for next weekly export
Paramint $dayOfWeek Integer day of week (1-7)Paramstring $timeString Parseable time stringReturnint Unix timestamp
Method
- calculateNextTimeOfDay protected
-
Calculate timestamp of next daily export
Paramstring $timeStringParamint $next Time offset in seconds until next dayReturnint Unix timestamp
Method
- setLogger public
-
Set the logger
ReturnModifyCronTiming
Method
- getLogger public
- Provide the logger, fallback to empty logger
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
Paramstring $contentParamstring $filename
Method
- setUploadDirectory public
-
Set upload directory
If not set, then default value is used
Paramstring $dirReturn$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
Paramstring $filename
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
ParamScheduledExportParameters $scheduledExportParametersParamint $index
Method
- addOrUpdateParameters protected
-
Set export parameters in correct index position
ParamScheduledExportParameters $scheduledExportParametersParamint $index
Method
- retrieveCurrentFormSettings protected
-
Retrieve scheduled export settings for given form Id
Paramint $formId
TemplateBuilder
Build output template script
-
Method
- handle public
- Method
- constructTemplate protected
-
Construct action settings template
Returnvoid
Method
- scriptOpen protected
-
Generate opening script tag
Paramstring $idReturnstring
Method
- addMenuHandle protected
-
Add menu handle
Returnstring
Method
- addSelectBox protected
-
Add markup for select box
Paramstring $labelParamstring $optionKeyParamstring $styleReturnstring
Method
- addTextbox protected
-
Add markup for textbox
Paramstring $labelParamstring $optionKeyParamstring $styleReturnstring
Method
- addDisabledTextbox protected
-
Add markup for disabled textbox
Paramstring $labelParamstring $optionKeyParamstring $styleReturnstring
Method
- addHiddenTextbox protected
-
Add markup for hidden textbox
Paramstring $labelParamstring $optionKeyParamstring $styleReturnstring
Method
- scriptClose protected
-
Add markup to close the script
Returnstring
TemplateBuilder
-
Method
- getExportRequests public
-
Return all export requests across all forms
Returnarray 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
Paramstring $intervalReturnarray
Method
- getExportSettingsByForm public
-
Get indexed array of scheduled export parameters by form Id
Paramint $formId
Method
- setExportSettings public
-
Set export settings for a given form id
Given form Id and indexed array of scheduled export parameters
Paramint $formIdParamarray $scheduledExportParametersArray
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 loggerReturnvoid
Method
- registerEndpoint public
- Register endpoints for triggering updates to schedules or timing Method
- addPluginSettingsGroup public
-
Add configured settings group to the NF groups
Paramarray $groupsReturnarray
Method
- addPluginSettings public
-
Add configured plugin settings to the plugin group
Paramarray $settingsReturnarray
Method
- Configure public
-
Return configured data
Paramstring $filename Filename without extensionParamstring $type File type - 'php' or 'json'Returnmixed
Method
- updateExportSchedule public
-
Callback method for scheduled-exports endpoint
ParamWP_REST_Request $request
Method
- updateCronDateTime public
-
Callback method for submission-export-datetime endpoint
ParamWP_REST_Request $request
Method
- adminNotices public
-
Function to register any admin notices we need to show.
Param$notices (Array) The list of admin notices.Returnarray The updated list of admin notices.
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
Paraminteger $epochTimeReturninteger
Method
- setHourlyTimestamp public
-
Set the timestamp for the next scheduled hourly cron job
Paramint $timestamp
Method
- setDailyTimestamp public
-
Set the timestamp for the next scheduled daily cron job
Paramint $timestamp
Method
- setWeeklyTimestamp public
-
Set the timestamp for the next scheduled daily cron job
Paramint $timestamp
Method
- getNextScheduled public
-
Return the next scheduled job for a given interval, 0 if not scheduled
Paramstring $intervalReturnint Unix timestamp
FormSettingsStorage
Provide Scheduled Export Settings as stored in Form Settings
-
Method
- getExportRequests public
- @inheritDoc Method
- constructScheduledExportParameterCollection protected
-
Construct indexed array ScheduledExportParameter objects
Paramstring $formIdParamarray $exportSettingsReturnarray Keys 'formExportRequests', 'supportingData'
Method
- getByInterval public
- @inheritDoc Method
- getExportSettingsByForm public
-
Get indexed array of scheduled export parameters by form Id
Paramint $formId
Method
- setExportSettings public
-
Set export settings for a given form id
Given form Id and indexed array of scheduled export parameters
Paramint $formIdParamScheduledExportParameters[] $scheduledExportParametersArray
Method
- cacheOnDelivery protected
-
Rebuild the cache so every other Ninja_Forms() call gets the updated data
Paramint $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.
Paramint $formIdReturnarray
Method
- getFormIds protected
- Get indexed array of form Ids Method
- setLogger public
-
Set the logger
ReturnFormSettingsStorage
Method
- getLogger public
- Provide the logger, fallback to empty logger
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
Paramarray $paramsReturnModifyCronTiming
$params
-
Method
- __construct public
-
Pass test parameters into mocked object
Paramarray $paramsReturnvoid
Method
- callCalculateNextTimeOfDay public
-
Call the protected method calculateNextTimeOfDay() and return value
Returnvoid
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
Seehttps://github.com/Saturday-Drive/ninja-forms-scheduled-exports/issues/2
Method
- mockTestedClass protected
-
Return tested class with exposed methods and test params
Paramarray $paramsReturnModifyExportTimingMarkup
$params
-
Method
- __construct public
-
Pass test parameters into mocked object
Paramarray $paramsReturnvoid
Method
- callFormatDate public
-
Call the protected method formatDate() and return value
Returnvoid
ScheduledExportParametersTest
-
Method
- ensureConstructionFromEmptyArray public
-
Ensure values constructed from empty array
@test
Returnvoid
-
Method
- ensureNewConstruction public
-
Ensure values constructed from 'new' command
@test
Returnvoid
Method
- ensureValidFromArrayConstruction public
-
Ensure values constructed from expected data
@test
Returnvoid
Method
- ensureInvalidFromArrayConstruction public
-
Ensure values constructed from incorrect data
@test
Returnvoid
Method
- ensureIntegerValuesAsString public
-
Ensure integer value of string converts to integer
@test
Returnvoid
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.
Returnvoid
Method
- defineAbspath protected
-
Set ABSPATH to the Wordpress directory
Returnvoid
Method
- UnitShims protected
-
Include WP shims not handled by Brain Monkey
Returnvoid
Method
- shimNinjaForms protected
-
Shim basic Ninja_Forms() functionality to enable unit testing
Returnvoid
Method
- configureGetOption public
-
Mock get_option and update_option with global array variable
Paramarray $incomingOptionsReturnvoid
Method
- configure public
-
Return a configuration array
Paramstring $configurationNameParamstring $extensionReturnarray
PluginTestCase
-
Method
- add_shortcode <?php
PluginTestCase
-
Method
- esc_html__ <?php
PluginTestCase
-
Method
- get_option
- Method
- update_option
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$idReturnNF_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' ) );
Returnstring
Method
- dispatcher public
- Method
- eos public
- Method
- session public
- Method
- request public
- Method
- background_process public
- Method
- get_setting public
-
Get a setting
Paramstring $keyParambool|false $defaultReturnbool
Method
- get_settings public
-
Get all the settings
Returnarray
Method
- update_setting public
-
Update a setting
Paramstring $keyParammixed $valueParambool|false $defer_update Defer the database update of all settings
Method
- update_settings public
-
Save settings to database
Paramarray $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 */
Ninja_Forms
-
Method
- plugins_url <?php
- Method
- is_ssl
Ninja_Forms
-
Method
- __
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 {Linkhttps://www.php.net/manual/en/language.pseudo-types.php#language.types.callback 'callback'} type are valid.
Also see the {Linkhttps://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.
PackageWordPressSubpackagePluginSince1.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. */
VerifyTestStructureTest
-
Method
- ensureTestSuiteRuns public
- @test