| Name | Size | Mode | Actions |
|---|---|---|---|
| assets/ | - | 0777 | rm |
| Platform/ | - | 0777 | rm |
| private/ | - | 0755 | rm |
| Solo/ | - | 0755 | rm |
| templates/ | - | 0777 | rm |
| .htaccess | 166 | 0644 | editdlrm |
| AkeebaBackupWP.php | 27615 | 0644 | editdlrm |
| AkeebaBackupWPUpdater.php | 17294 | 0644 | editdlrm |
| boot_webapp.php | 2091 | 0644 | editdlrm |
| defines.php | 1118 | 0644 | editdlrm |
| installation_detected.php | 2380 | 0644 | editdlrm |
| integration.php | 10035 | 0644 | editdlrm |
| web.config | 185 | 0644 | editdlrm |
| wpinstall.php | 3591 | 0644 | editdlrm |
/home/suroeste/public_html/wp-content/plugins/akeebabackupwp/helpers/AkeebaBackupWP.php (27615B)
The Akeeba Backup plugin failed to activate because the database server did not allow the database tables to be installed or updated. You will need to contact our support.
{$e->getCode()} — {$e->getMessage()}
{$e->getTraceAsString()}
HTML;
die;
}
update_option('akeebabackupwp_plugin_dir', self::$dirName);
// Copy the mu-plugins in the correct folder
$mu_folder = ABSPATH . 'wp-content/mu-plugins';
if (defined('WPMU_PLUGIN_DIR') && WPMU_PLUGIN_DIR)
{
$mu_folder = WPMU_PLUGIN_DIR;
}
if (!is_dir($mu_folder))
{
mkdir($mu_folder, 0755, true);
}
@copy(
WP_PLUGIN_DIR . '/' . self::$dirName . '/helpers/assets/mu-plugins/akeeba-backup-coreupdate.php',
$mu_folder . '/akeeba-backup-coreupdate.php'
);
}
// Register the uninstallation hook
register_uninstall_hook(self::$absoluteFileName, ['AkeebaBackupWP', 'uninstall']);
}
/**
* Plugin deactivation hook handler.
*
* This precedes (but does not necessarily imply) uninstallation. A deactivated plugin can be reactivated at any
* time. This used solely to clean up temporary data, such as WP-CRON hooks.
*
* @return void
* @since 7.8.0
*/
public static function onDeactivate(): void
{
// Unregister the CRON handler
$timestamp = wp_next_scheduled('abwp_cron_scheduling');
if ($timestamp)
{
wp_unschedule_event($timestamp, 'abwp_cron_scheduling');
}
}
/**
* Uninstallation hook
*
* Removes database tables if they exist and performs any post-uninstallation work required.
*
* @return void
*/
public static function uninstall(): void
{
$container = self::loadAkeebaBackupContainer();
if ($container)
{
$dbInstaller = new Installer($container);
$dbInstaller->removeSchema();
}
// Delete the must-use plugin files
$mu_folder = ABSPATH . 'wp-content/mu-plugins';
if (defined('WPMU_PLUGIN_DIR') && WPMU_PLUGIN_DIR)
{
$mu_folder = WPMU_PLUGIN_DIR;
}
@unlink($mu_folder . '/akeeba-backup-coreupdate.php');
}
/**
* Create the administrator menu for Akeeba Backup
*/
public static function adminMenu(): void
{
if (is_multisite())
{
return;
}
$container = self::loadAkeebaBackupContainer();
if (!$container)
{
return;
}
if ($container->appConfig->get('under_tools', 0) == 1)
{
add_management_page(
'Akeeba Backup', 'Akeeba Backup', 'edit_others_posts',
self::$absoluteFileName, ['AkeebaBackupWP', 'bootApplication']
);
}
else
{
add_menu_page(
'Akeeba Backup', 'Akeeba Backup', 'edit_others_posts',
self::$absoluteFileName, ['AkeebaBackupWP', 'bootApplication'],
plugins_url('app/media/logo/abwp-24-white.png', self::$absoluteFileName)
);
}
}
/**
* Create the blog network administrator menu for Akeeba Backup
*/
public static function networkAdminMenu(): void
{
if (!is_multisite())
{
return;
}
add_menu_page(
'Akeeba Backup', 'Akeeba Backup', 'manage_options',
self::$absoluteFileName, ['AkeebaBackupWP', 'bootApplication'],
plugins_url('app/media/logo/abwp-24-white.png', self::$absoluteFileName)
);
}
/**
* Boots the Akeeba Backup application
*
* @param string $bootstrapFile The name of the application bootstrap file to use.
*/
public static function bootApplication(string $bootstrapFile = 'boot_webapp.php'): void
{
$bootstrapFile = $bootstrapFile ?: 'boot_webapp.php';
if (self::$wrongPHP)
{
echo sprintf(
'Akeeba Backup for WordPress requires PHP %s or later. Your site is currently using PHP %s',
self::$minimumPHP,
PHP_VERSION
);
return;
}
$strapFile = dirname(self::$absoluteFileName) . '/helpers/' . $bootstrapFile;
if (!file_exists($strapFile))
{
die("Oops! Cannot initialize Akeeba Backup. Cannot locate the file $strapFile");
}
$container = self::loadAkeebaBackupContainer();
if (!$container)
{
return;
}
include_once $strapFile;
}
/**
* Enqueues a Javascript file for loading
*
* @param string $url The URL of the Javascript file to load
*/
public static function enqueueScript(string $url): void
{
$parts = explode('?', $url);
$url = $parts[0];
if (in_array($url, self::$loadedScripts))
{
return;
}
self::$loadedScripts[] = $url;
$handle = 'akjs' . md5($url);
wp_enqueue_script($handle, $url, [], self::getMediaVersion(), false);
}
/**
* Enqueues an inline Javascript script
*
* @param string $content The script contents
*/
public static function enqueueInlineScript(string $content): void
{
/**
* WordPress only adds inline scripts as "extra data" of an already queued script file. Since we want to add our
* inline scripts **after** our script files we find the handle of the last script file we queued and add the
* inline script to it.
*
* This means that this method will only really work correctly if it's called AFTER the last self::enqueueScript
* call.
*/
$url = end(self::$loadedScripts);
$handle = 'akjs' . md5($url);
wp_add_inline_script($handle, $content);
}
/**
* Enqueues a CSS file for loading
*
* @param string $url The URL of the CSS file to load
*/
public static function enqueueStyle(string $url): void
{
if (!defined('AKEEBABACKUP_VERSION'))
{
@include_once dirname(self::$absoluteFileName) . '/app/version.php';
}
$handle = 'akcss' . md5($url);
wp_enqueue_style($handle, $url, [], self::getMediaVersion());
}
/**
* Runs when the authentication cookie is being cleared (user logs out)
*
* @return void
*/
public static function onUserLogout(): void
{
// Remove the user meta which are used in our fake session handler
$userId = get_current_user_id();
$allMeta = get_user_meta($userId);
foreach ($allMeta ?: [] as $key => $value)
{
if (strpos($key, 'AkeebaSession_') !== 0)
{
continue;
}
delete_user_meta($userId, $key);
}
}
/**
* Returns the backup profile that should be used on Manual WordPress update.
*
* Returns NULL if we don't want to take a backup
*
* @return int|null
*/
public static function getProfileManualCoreUpdate(): ?int
{
if (is_null(self::$appConfig))
{
self::loadAppConfig();
}
$isPro = defined('AKEEBABACKUP_PRO') ? AKEEBABACKUP_PRO : 0;
if (!$isPro)
{
return null;
}
// If the option has been set, and it's false, let's stop. Otherwise, continue (enabled by default)
if (!(self::$appConfig['options']['backuponupdate_core_manual'] ?? false))
{
return null;
}
// Default backup profile is 1
$profile = self::$appConfig['options']['backuponupdate_core_manual_profile'] ?? 1;
if ($profile <= 0)
{
return null;
}
return (int) $profile;
}
/**
* Includes all the required pieces to load Akeeba Backup from within a standard WordPress page
*
* @return \Solo\Container|null
*/
public static function loadAkeebaBackupContainer()
{
if (self::$container)
{
return self::$container;
}
// Load the basics
self::$dirName = self::getPluginSlug();
defined('AKEEBASOLO') || define('AKEEBASOLO', 1);
if (!file_exists(__DIR__ . '/../helpers/integration.php'))
{
return null;
}
/** @var \Solo\Container $container */
self::$container = require __DIR__ . '/../helpers/integration.php';
self::$container = self::$container ?: null;
if (!self::$container)
{
return null;
}
// Since the Platform is already loaded at this point, we can tell it to use the correct key file
Factory::getSecureSettings()->setKeyFilename(
rtrim(
(defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : (rtrim(ABSPATH, '/') . '/wp-content')),
'/'
) . '/akeebabackup_secretkey.php'
);
// Get all info saved inside the configuration
self::$container->appConfig->loadConfiguration();
self::$container->basePath = realpath(__DIR__ . '/../app/Solo');
if (!@is_dir(self::$container->basePath))
{
self::$container->basePath = WP_PLUGIN_DIR . '/akeebabackupwp/app/Solo';
}
// Make sure post-upgrade code has executed before doing anything else!
try
{
/** @var Main $mainModel */
$mainModel = self::$container->mvcFactory->makeTempModel('Main');
$mainModel->postUpgradeActions(true);
}
catch (Throwable $e)
{
// The post-upgrade code failed. All bets are off!
}
return self::$container;
}
/**
* Issues a redirection to the 'installation' folder if such a folder is present and seems to contain a copy of
* ANGIE. This prevents some webmasters used to the Stone Ages from unzipping a backup archive and not running the
* installer, then complain very loudly that Akeeba Backup doesn't work when the only thing doesn't working is their
* common sense.
*
* In simple terms, this static method fixes stupid.
*/
public static function redirectIfInstallationPresent()
{
$installDir = rtrim(ABSPATH, '/\\') . '/installation';
$installIndex = rtrim(ABSPATH, '/\\') . '/installation/index.php';
if (!@is_dir($installDir) && !is_file($installIndex))
{
return;
}
$indexContents = @file_get_contents($installIndex);
if ($indexContents === false)
{
return;
}
if (!preg_match('#\s*\*\s*ANGIE\s#', $indexContents) || (strpos($indexContents, '_AKEEBA') === false))
{
return;
}
ob_end_clean();
ob_start();
try
{
// Required by the integration.php file
defined('AKEEBASOLO') || define('AKEEBASOLO', 1);
// Creates the application container, required for translations to work
/** @var Container $container */
$container = require 'integration.php';
// This tells AWF to consider the 'solo' app as the default
$app = Awf\Application\Application::getInstance($container->application->getName());
// Tell the app to load the translation strings
$app->initialise();
// Load the message page
require __DIR__ . '/installation_detected.php';
// Show the message page
ob_end_flush();
}
catch (Exception $e)
{
// If something broke we show a low-tech, abbreviated page
ob_end_clean();
echo <<< HTML
Please click here to run the restoration script. Do remember to delete the
installation directory after you are done restoring your site to prevent this page from appearing
again.