PATH:
home
/
ediuae
/
petalwellnessspa.com
/
wp-content
/
plugins
/
simply-schedule-appointments
/
includes
<?php /** * Run SSA logic with WP_CLI. */ class SSA_Cli_Commands { /** * Import a SSA export file. * * ## OPTIONS * * <file> * : The absolute path to the export file to be imported. * * ## EXAMPLES * * wp ssa import https://test-site.ssa.rocks/wp-content/uploads/ssa/export/ssa-export-2021-09-14T13-28-31.json * * @when after_wp_load */ public function import( $args, $assoc_args ) { $path = isset( $args[0] ) ? $args[0] : null; if ( empty( $path ) ) { WP_CLI::error( __( 'Please provide a valid file path or URL.', 'simply-schedule-appointments' ) ); } $is_url = filter_var( $path, FILTER_VALIDATE_URL ); if ( $is_url ) { $import_content = wp_safe_remote_get( $path ); if ( is_wp_error( $import_content ) ) { WP_CLI::error( __( 'There was an error retrieving the file.', 'simply-schedule-appointments' ) ); } $json = wp_remote_retrieve_body( $import_content ); } else { if ( ! file_exists( $path ) ) { WP_CLI::error( __( 'Could not find the file.', 'simply-schedule-appointments' ) ); } if ( ! is_readable( $path ) ) { WP_CLI::error( __( 'Could not read the file.', 'simply-schedule-appointments' ) ); } $json = file_get_contents( $path ); if ( empty( $json ) ) { WP_CLI::error( __( 'The file is empty.', 'simply-schedule-appointments' ) ); } } WP_CLI::log( __( 'Importing...', 'simply-schedule-appointments' ) ); // verify if JSON data is valid. $decoded = json_decode( $json, true ); if ( ! is_object( $decoded ) && ! is_array( $decoded ) ) { WP_CLI::error( __( 'Invalid data format.', 'simply-schedule-appointments' ) ); } if ( json_last_error() !== JSON_ERROR_NONE ) { WP_CLI::error( __( 'Invalid data format.', 'simply-schedule-appointments' ) ); } $import = ssa()->support_status->import_data( $decoded ); // if any error happens while trying to import appointment type data, return. if ( is_wp_error( $import ) ) { WP_CLI::error( $import->get_error_messages() ); } // everything was successfully imported. WP_CLI::success( __( 'Data successfully imported!', 'simply-schedule-appointments' ) ); } } $instance = new SSA_Cli_Commands(); WP_CLI::add_command( 'ssa', $instance );
[-] class-settings.php
[edit]
[-] class-hooks.php
[edit]
[-] class-availability-query.php
[edit]
[-] class-appointment-model.php
[edit]
[-] class-beaver-builder.php
[edit]
[-] class-web-meetings.php
[edit]
[-] class-availability-model.php
[edit]
[-] class-recipient-admin.php
[edit]
[-] class-recipient-customer.php
[edit]
[-] class-constants.php
[edit]
[-] class-async-action-model.php
[edit]
[-] class-support.php
[edit]
[-] class-google-calendar-client.php
[edit]
[+]
..
[-] class-capabilities.php
[edit]
[-] class-encryption.php
[edit]
[-] class-availability-cache-invalidation.php
[edit]
[-] class-calendar-events-settings.php
[edit]
[-] class-settings-global.php
[edit]
[-] class-translation.php
[edit]
[-] class-cli.php
[edit]
[-] class-missing.php
[edit]
[-] class-action-scheduler.php
[edit]
[-] class-templates-api.php
[edit]
[-] class-blackout-dates.php
[edit]
[-] class-calendar-events-object.php
[edit]
[-] class-divi.php
[edit]
[-] class-templates.php
[edit]
[-] class-wp-admin.php
[edit]
[-] class-appointment-factory.php
[edit]
[-] class-scheduling-max-per-day.php
[edit]
[-] class-notifications-api.php
[edit]
[-] class-shortcodes.php
[edit]
[-] class-validation.php
[edit]
[-] class-resource-group-object-factory.php
[edit]
[-] class-payment-object.php
[edit]
[-] class-locale.php
[edit]
[-] class-ics-exporter.php
[edit]
[-] class-filesystem.php
[edit]
[-] class-recipient-shared.php
[edit]
[-] class-availability-schedule.php
[edit]
[-] class-block-upcoming-appointments.php
[edit]
[-] class-elementor.php
[edit]
[-] class-appointment-meta-model.php
[edit]
[-] class-revision-meta-model.php
[edit]
[+]
divi
[-] class-notifications.php
[edit]
[-] class-upgrade.php
[edit]
[-] class-utils.php
[edit]
[-] class-availability-functions.php
[edit]
[-] class-external-calendar-api.php
[edit]
[-] class-csv-exporter.php
[edit]
[-] class-external-google-calendar-api.php
[edit]
[-] class-twig-extension.php
[edit]
[-] class-bootstrap.php
[edit]
[-] class-notices.php
[edit]
[-] class-availability-schedule-factory.php
[edit]
[-] class-blackout-dates-settings.php
[edit]
[-] class-support-status.php
[edit]
[-] class-block-booking.php
[edit]
[-] class-advanced-scheduling-availability.php
[edit]
[-] class-exception.php
[edit]
[-] class-styles-settings.php
[edit]
[-] class-forms.php
[edit]
[-] class-recipient-staff.php
[edit]
[+]
beaver-builder
[-] class-users.php
[edit]
[-] class-sequence-factory.php
[edit]
[+]
third-party
[-] class-locales.php
[edit]
[-] class-db-model.php
[edit]
[-] class-db.php
[edit]
[-] class-availability-default.php
[edit]
[-] class-staff-settings.php
[edit]
[-] class-notification-model.php
[edit]
[-] class-settings-installed.php
[edit]
[-] class-appointment-object.php
[edit]
[-] class-notices-api.php
[edit]
[-] class-translation-settings.php
[edit]
[-] class-support-status-api.php
[edit]
[-] class-notices-data.php
[edit]
[-] class-appointment-type-object.php
[edit]
[-] class-appointment-type-object-factory.php
[edit]
[-] class-availability-block-factory.php
[edit]
[-] class-recipient.php
[edit]
[-] class-revision-model.php
[edit]
[-] class-customers.php
[edit]
[-] class-settings-api.php
[edit]
[-] class-cache.php
[edit]
[-] class-availability-detective-case.php
[edit]
[-] class-styles.php
[edit]
[-] class-capacity-settings.php
[edit]
[-] class-gcal-exporter.php
[edit]
[-] class-advanced-scheduling-settings.php
[edit]
[-] class-appointment-type-model.php
[edit]
[-] class-notifications-settings.php
[edit]
[-] class-period.php
[edit]
[-] class-external-api.php
[edit]
[-] class-error-notices.php
[edit]
[-] class-availability-cache.php
[edit]
[-] class-developer-settings.php
[edit]
[-] class-dashboard-upcoming-appointments-widget.php
[edit]
[-] class-availability-external-model.php
[edit]
[-] class-availability-block.php
[edit]
[-] class-customer-information.php
[edit]
[+]
elementor
[-] class-appointment-type-label-model.php
[edit]
[-] class-embed-booking-app-api.php
[edit]
[+]
lib
[-] class-sequence.php
[edit]
[-] class-debug.php
[edit]
[-] class-appointment-types-db.php
[edit]