PHP 8.2.31
Preview: Upgrade187.php Size: 1.35 KB
/proc/self/root/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/wpforms-lite/src/Migrations/Upgrade187.php

<?php

namespace WPForms\Migrations;

use WPForms\Admin\Builder\TemplatesCache;
use WPForms\Tasks\Actions\StripeLinkSubscriptionsTask;

/**
 * Class upgrade for 1.8.7 release.
 *
 * @since 1.8.7
 *
 * @noinspection PhpUnused
 */
class Upgrade187 extends UpgradeBase {

	/**
	 * Run upgrade.
	 *
	 * @since 1.8.7
	 *
	 * @return bool|null
	 */
	public function run() {

		$sync_result  = $this->update_templates_cache() && $this->maybe_create_logs_table();
		$async_result = $this->run_async( StripeLinkSubscriptionsTask::class );

		return $async_result === null ? null : $sync_result && $async_result;
	}

	/**
	 * Update templates' cache.
	 *
	 * @since 1.8.7
	 *
	 * @return bool
	 */
	private function update_templates_cache(): bool {

		$templates_cache = new TemplatesCache();

		$templates_cache->init();
		$templates_cache->update();

		return true;
	}

	/**
	 * Maybe create logs' table.
	 * Previously, logs' table was created dynamically on the first access to the Tools->Logs admin page.
	 * As from 1.8.7, we create it only once during the activation of the plugin.
	 * So, the table may not exist, and we must maybe create it during migration to 1.8.7.
	 *
	 * @since 1.8.7
	 *
	 * @return bool
	 */
	private function maybe_create_logs_table(): bool {

		$log = wpforms()->obj( 'log' );

		if ( ! $log ) {
			return false;
		}

		$log->create_table();

		return true;
	}
}

Directory Contents

Dirs: 1 × Files: 18

Name Size Perms Modified Actions
Tasks DIR
- drwxr-xr-x 2026-06-04 03:43:03
Edit Download
12.04 KB lrw-r--r-- 2026-03-19 16:20:18
Edit Download
992 B lrw-r--r-- 2025-12-11 20:10:08
Edit Download
1.37 KB lrw-r--r-- 2024-09-26 15:36:36
Edit Download
911 B lrw-r--r-- 2024-11-07 17:15:50
Edit Download
333 B lrw-r--r-- 2025-08-11 13:38:06
Edit Download
2.74 KB lrw-r--r-- 2025-12-11 20:10:08
Edit Download
707 B lrw-r--r-- 2024-09-26 15:36:36
Edit Download
1.24 KB lrw-r--r-- 2024-09-26 15:36:36
Edit Download
2.67 KB lrw-r--r-- 2024-09-26 15:36:36
Edit Download
1.21 KB lrw-r--r-- 2022-09-29 15:18:52
Edit Download
3.10 KB lrw-r--r-- 2025-12-11 20:10:08
Edit Download
769 B lrw-r--r-- 2023-08-10 15:19:36
Edit Download
909 B lrw-r--r-- 2023-09-28 15:44:58
Edit Download
395 B lrw-r--r-- 2024-01-16 17:57:58
Edit Download
1.35 KB lrw-r--r-- 2024-09-26 15:36:36
Edit Download
863 B lrw-r--r-- 2022-06-30 15:09:42
Edit Download
562 B lrw-r--r-- 2022-08-18 14:59:52
Edit Download
3.43 KB lrw-r--r-- 2025-04-24 14:53:30
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).