wp manager error fixed

This commit is contained in:
unknown
2023-08-26 14:52:20 +05:00
parent f7c26806e5
commit eb6e32e220
3 changed files with 16 additions and 10 deletions

View File

@@ -1963,6 +1963,17 @@ $parameters = array(
wpobj = WPSites.objects.get(pk=self.data['WPid']) wpobj = WPSites.objects.get(pk=self.data['WPid'])
#get wp version
path_to_wordpress = wpobj.path
command = f"wp --path='{path_to_wordpress}' core version --skip-plugins --skip-themes"
Wp_version = ProcessUtilities.outputExecutioner(command, wpobj.owner.externalApp)
old_wp_version = Wp_version.rstrip('\n')
logging.writeToFile("Old site wp version:%s"% old_wp_version)
### Create secure folder ### Create secure folder
ACLManager.CreateSecureDir() ACLManager.CreateSecureDir()
tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', str(randint(1000, 9999))) tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', str(randint(1000, 9999)))
@@ -2049,7 +2060,7 @@ $parameters = array(
StagingPath = f'/home/{website.domain}/public_html' StagingPath = f'/home/{website.domain}/public_html'
command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp core download --path={StagingPath}' command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp core download --path={StagingPath} --version={old_wp_version}'
if ProcessUtilities.executioner(command, website.externalApp) == 0: if ProcessUtilities.executioner(command, website.externalApp) == 0:
raise BaseException('Failed to download wp core. [404]') raise BaseException('Failed to download wp core. [404]')

View File

@@ -1782,13 +1782,13 @@ var PluginsList = [];
function AddPluginToArray(cBox, name) { function AddPluginToArray(cBox, name) {
if (cBox.checked) { if (cBox.checked) {
PluginsList.push(name); PluginsList.push(name);
alert(PluginsList); // alert(PluginsList);
} else { } else {
const index = PluginsList.indexOf(name); const index = PluginsList.indexOf(name);
if (index > -1) { if (index > -1) {
PluginsList.splice(index, 1); PluginsList.splice(index, 1);
} }
alert(PluginsList); // alert(PluginsList);
} }
} }
@@ -1797,13 +1797,13 @@ var ThemesList = [];
function AddThemeToArray(cBox, name) { function AddThemeToArray(cBox, name) {
if (cBox.checked) { if (cBox.checked) {
ThemesList.push(name); ThemesList.push(name);
alert(ThemesList); // alert(ThemesList);
} else { } else {
const index = ThemesList.indexOf(name); const index = ThemesList.indexOf(name);
if (index > -1) { if (index > -1) {
ThemesList.splice(index, 1); ThemesList.splice(index, 1);
} }
alert(ThemesList); // alert(ThemesList);
} }
} }

View File

@@ -1850,11 +1850,6 @@ class WebsiteManager:
else: else:
return ACLManager.loadError() return ACLManager.loadError()
background = ApplicationInstaller('CreateStagingNow', extraArgs) background = ApplicationInstaller('CreateStagingNow', extraArgs)
background.start() background.start()