Skip to content

ProgressPlanner/altolith-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

738 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Altolith Deploy

Tests PHP Version WordPress Version License

Export WordPress sites as static HTML or WordPress Playground blueprint bundles

Altolith Deploy enables you to export WordPress sites to static HTML files or create WordPress Playground blueprints, all stored locally on your server's filesystem.

✨ Key Features

πŸ“¦ Static Site Export

  • Convert dynamic WordPress to static HTML
  • Export to local filesystem
  • Complete site archiving with all assets
  • Cache-optimized static pages

πŸš€ WordPress Playground Integration

  • Create Playground blueprint bundles
  • Blueprint-based site export (98% storage reduction)
  • SQLite database support
  • No cloud hosting required

πŸ”„ Export Formats

  • Static HTML - Complete static website export
  • Blueprint Bundle - WordPress Playground blueprint format
  • Archive - ZIP files for easy transfer

🎯 Quick Start

Requirements

  • WordPress 6.4+
  • PHP 7.4+ (PHP 8.1+ recommended)
  • Writable wp-content/altolith-exports directory

Installation

  1. Install the Plugin

    cd wp-content/plugins
    git clone https://github.com/aristath/altolith-deploy.git
  2. Install Dependencies

    cd altolith-deploy
    composer install
    npm install
    npm run build
  3. Activate the Plugin

    • Go to WordPress Admin β†’ Plugins
    • Activate "Altolith Deploy"
  4. Configure Export Settings

    • Go to Settings β†’ Altolith Export
    • Configure export options as needed

πŸ“– Usage

Creating an Export

  1. Navigate to Altolith Export in the WordPress admin
  2. Click Create New Export
  3. Select export type (Static HTML or Blueprint)
  4. Configure export options
  5. Click Start Export

Accessing Exports

Exports are stored in wp-content/altolith-exports/ directory. Each export is contained in its own subdirectory with:

  • Static HTML files
  • Assets (images, CSS, JS)
  • Database exports (if applicable)
  • Blueprint files (for Playground exports)

Downloading Exports

Exports can be downloaded as ZIP archives directly from the WordPress admin interface.

🌐 WordPress Playground Compatibility

This plugin is designed to work universally across all WordPress environments, including WordPress Playground (browser-based WASM environment).

Universal Architecture

The plugin uses a universal implementation approach - no environment detection, no conditional code paths. All features work identically in traditional hosting and WordPress Playground.

Key Compatibility Features

  • Universal Temp Directory: Uses wp-content/uploads/altolith-temp instead of system temp directory
  • Universal Path Validation: Works without realpath() in WASM environments
  • Configurable Post Limits: Prevents timeouts on large sites (default: 10,000 posts)
  • Browser-Based Generation: Static site generation runs in browser to avoid PHP timeouts
  • WordPress.org API: Browser-based asset detection using CORS proxy
  • Memory Protection: IndexedDB caching prevents browser memory exhaustion

Limitations

  • Temporary Storage: Files in wp-content/uploads/altolith-temp are cleaned up after 1 hour
  • Post Limits: Default limit of 10,000 posts/pages for URL discovery
  • WordPress.org API: Detection happens browser-side using CORS proxy or direct API calls

Technical Implementation

The following utilities ensure Playground compatibility:

  • TempDirectoryManager (includes/Utilities/TempDirectoryManager.php) - Universal temp file handling
  • PathValidator (includes/Utilities/PathValidator.php) - WASM-compatible path validation
  • FileManager (includes/Utilities/FileManager.php) - File operations with persistence tracking
  • IndexedDB Cache (assets/src/utils/staticSiteCache.js) - Browser-side caching for static site generation

πŸ›  Development

Build Commands

# Development build
npm run build:dev

# Production build
npm run build

# Watch mode
npm start

# Run tests
npm run test:js
composer test

# Linting
npm run lint:js
composer lint

File Structure

altolith-deploy/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ src/          # Source JavaScript/React files
β”‚   β”‚   β”œβ”€β”€ export/   # Export workflow (step-based executor system)
β”‚   β”‚   β”œβ”€β”€ providers/# Provider implementations
β”‚   β”‚   β”œβ”€β”€ components/# Shared React components
β”‚   β”‚   β”œβ”€β”€ hooks/    # Custom React hooks
β”‚   β”‚   └── utils/    # Utility functions
β”‚   └── build/        # Compiled assets
β”œβ”€β”€ includes/
β”‚   β”œβ”€β”€ REST/         # REST API controllers
β”‚   β”œβ”€β”€ Services/     # Core services
β”‚   └── Utilities/    # Helper utilities
β”œβ”€β”€ tests/            # PHP and JavaScript tests
└── webpack.config.js # Build configuration

πŸ”§ REST API

The plugin provides REST API endpoints (namespace: altolith/deploy):

Settings

  • GET /wp-json/altolith/deploy/settings - Get plugin settings
  • POST /wp-json/altolith/deploy/settings - Update settings

Export Operations

  • POST /wp-json/altolith/deploy/export - Start export workflow
  • GET /wp-json/altolith/deploy/export/status - Get export status
  • POST /wp-json/altolith/deploy/export/steps/{stepId} - Execute workflow step
  • POST /wp-json/altolith/deploy/export/cancel - Cancel running export
  • POST /wp-json/altolith/deploy/export/createArchive - Create WordPress archive
  • POST /wp-json/altolith/deploy/export/generateBlueprintBundle - Generate blueprint bundle

Provider Configuration

  • GET/POST/DELETE /wp-json/altolith/deploy/providers/{providerId}/config - Manage provider config
  • POST /wp-json/altolith/deploy/providers/{providerId}/test - Test provider connection

URL Discovery

  • POST /wp-json/altolith/deploy/url-discovery/discover - Discover site URLs
  • GET /wp-json/altolith/deploy/url-discovery/posts - Get posts for URL discovery
  • GET /wp-json/altolith/deploy/url-discovery/terms - Get terms for URL discovery
  • GET /wp-json/altolith/deploy/url-discovery/authors - Get authors for URL discovery

Assets

  • GET /wp-json/altolith/deploy/assets/manifest - Get assets manifest

Local Storage

  • POST /wp-json/altolith/deploy/local-storage/upload - Upload file to local storage
  • GET /wp-json/altolith/deploy/local-storage/download - Download file from local storage
  • DELETE /wp-json/altolith/deploy/local-storage/delete - Delete file from local storage
  • GET /wp-json/altolith/deploy/local-storage/list - List files in local storage

Note: The export workflow uses a step-based executor system with dependency resolution. Steps register themselves via WordPress hooks and declare their data dependencies. All workflow state is stored client-side in IndexedDB, not on the server.

πŸ§ͺ Testing

PHP Tests

composer test

JavaScript Tests

npm run test:js

# With coverage
npm run test:js:coverage

# Watch mode
npm run test:js:watch

πŸ” Troubleshooting

Export Directory Not Writable

Ensure the export directory has proper permissions:

chmod 755 wp-content/altolith-exports

Memory Limit Issues

For large sites, increase PHP memory limit in wp-config.php:

define( 'WP_MEMORY_LIMIT', '512M' );

Timeout Issues

Increase PHP max execution time in php.ini or .htaccess:

max_execution_time = 300

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.

πŸ™ Credits

Built with:

πŸ“§ Support

For issues and questions:

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors