* Paths are relative to the plugin's tests/Fixtures/divi directory. */ defined('WP_CLI') && WP_CLI || exit; use ET\Builder\Packages\Conversion\Conversion; $args = $args ?? []; if (count($args) !== 2) { WP_CLI::error('Usage: divi-convert-fixture.php '); } if (! class_exists(Conversion::class)) { WP_CLI::error('Divi 5 is not active.'); } $dir = dirname(__DIR__) . '/Fixtures/divi/'; $source = file_get_contents($dir . $args[0]); if ($source === false) { WP_CLI::error('Cannot read ' . $dir . $args[0]); } $converted = Conversion::maybeConvertContent(trim($source)); if (! str_contains($converted, '' . $converted . ''; if (file_put_contents($dir . $args[1], $markup) === false) { WP_CLI::error('Cannot write ' . $dir . $args[1]); } WP_CLI::success(sprintf('%s: %d bytes', $args[1], strlen($markup)));