wp-host
Version:
Automated WordPress hosting deployment tool for bulk site creation with MySQL database management
120 lines • 3.74 kB
TypeScript
import { Config, SiteConfig, DeploymentResult } from './types';
export declare class WordPressManager {
private config;
private readonly WORDPRESS_DOWNLOAD_URL;
private wpCliCommand;
constructor(config: Config);
/**
* Download and install WordPress for all sites
*/
installAllSites(autoCleanDirectories?: boolean): Promise<DeploymentResult[]>;
/**
* Install WordPress for a single site
*/
installWordPressSite(site: SiteConfig, autoCleanDirectories?: boolean): Promise<DeploymentResult>;
/**
* Safely clean directory, handling special files like .user.ini
*/
private safeCleanDirectory;
/**
* Prepare directory for WordPress installation
*/
prepareDirectory(targetDir: string, allowCleanup?: boolean | 'auto'): Promise<void>;
/**
* Download WordPress from wordpress.org
*/
downloadWordPress(targetDir: string): Promise<string>;
/**
* Extract WordPress ZIP file
*/
extractWordPress(zipPath: string, targetDir: string): Promise<void>;
/**
* Generate site URL based on directory path and domain inference
*/
private generateSiteUrl;
/**
* Complete WordPress installation by directly setting up the database and admin user
*/
completeWordPressInstallation(site: SiteConfig, siteUrl: string): Promise<void>;
/**
* Create essential WordPress database tables
*/
private createWordPressTables;
/**
* Create WordPress admin user using WordPress's native installation process
*/
private createWordPressAdmin;
/**
* Verify WordPress installation
*/
verifyInstallation(targetDir: string): Promise<boolean>;
/**
* Check WordPress installation status for a site
*/
checkInstallation(site: SiteConfig): Promise<{
exists: boolean;
isWordPress: boolean;
version?: string;
hasConfig: boolean;
}>;
/**
* Generate WordPress installation report
*/
generateReport(): Promise<void>;
/**
* Clean up WordPress installations
* WARNING: This will delete all WordPress files!
*/
cleanupAllInstallations(): Promise<void>;
/**
* Get installation summary
*/
getSummary(results: DeploymentResult[]): {
total: number;
successful: number;
failed: number;
skipped: number;
};
/**
* Create wp-config.php file with proper database settings and site URL
*/
private createWordPressConfig;
/**
* Set proper WordPress file permissions
*/
private setWordPressPermissions;
/**
* Set directory permissions to 755 recursively
*/
private setDirectoryPermissions;
/**
* Set file permissions to 644 recursively
*/
private setFilePermissions;
/**
* Set special permissions for important WordPress files
*/
private setSpecialFilePermissions;
/**
* Update permalink structure for all sites using WP-CLI
*/
updateAllPermalinks(newStructure?: string): Promise<DeploymentResult[]>;
/**
* Update permalink structure for a single site using WP-CLI
*/
updateSitePermalinks(site: SiteConfig, newStructure?: string): Promise<DeploymentResult>;
/**
* Run WordPress's native installation process with proper database handling
*/
private installWordPressWithWPCLI;
private ensureWPCLIInstalled;
/**
* Run WordPress's native installation process
*/
private runWordPressInstallation;
/**
* Generate WordPress-compatible password hash using WordPress's own functions
*/
private generateWordPressPasswordHash;
}
//# sourceMappingURL=wordpress-manager.d.ts.map