![]() Server : LiteSpeed System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : claqxcrl ( 523) PHP Version : 8.1.32 Disable Function : NONE Directory : /home/claqxcrl/www/wp-content/plugins/extendify/app/Launch/Controllers/ |
<?php /** * WooCommerce Controller */ namespace Extendify\Launch\Controllers; defined('ABSPATH') || die('No direct access.'); use Extendify\Launch\Services\WooCommerceImporter; /** * The controller for interacting with WooCommerce to import temporary data. */ class WooCommerceController { /** * Import the temporary products. * * @return \WP_REST_Response */ public static function importTemporaryProducts() { if (count(get_posts(['post_type' => 'product']))) { return new \WP_REST_Response(['success' => true]); } $results = WooCommerceImporter::import(); if (is_wp_error($results)) { return new \WP_REST_Response([ 'success' => false, 'message' => $results->get_error_message(), ]); } update_option('extendify_wc_import_results', $results); return new \WP_REST_Response(['success' => true]); } }