| Server IP : 8.134.250.228 / Your IP : 216.73.217.39 Web Server : Apache System : Linux iZ7xv33p9e9ivk7yhmj7ibZ 5.10.134-18.al8.x86_64 #1 SMP Fri Dec 13 16:56:53 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/www.gobluemade.com/wp-content/plugins/wpforms-lite/src/Migrations/ |
Upload File : |
<?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;
}
}