# extendify/3.1.5/app/AutoLaunch/Controllers/WooCommerceController.php

Extendify, version 3.1.5. 44 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.5/code/app/AutoLaunch/Controllers/WooCommerceController.php
- Raw: https://pluginprobe.com/plugins/extendify/3.1.5/raw/app/AutoLaunch/Controllers/WooCommerceController.php
- Modified: 2026-03-19T19:35:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.1.5/code/app/AutoLaunch/Controllers/WooCommerceController.php#L10-L20`.

```php
<?php

/**
 * WooCommerce  Controller
 */

namespace Extendify\AutoLaunch\Controllers;

defined('ABSPATH') || die('No direct access.');

use Extendify\AutoLaunch\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]);
    }
}

```
