10 Commits

12 changed files with 22556 additions and 82 deletions

42
.distignore Normal file
View File

@ -0,0 +1,42 @@
# Directories
/.git
/.github
/.vscode
/.idea
/bin
/node_modules
/tests
/build
# Root Files
.distignore
.editorconfig
.eslintignore
.eslintrc*
.gitignore
.stylelintrc*
phpunit.xml
tsconfig.json
webpack.config.js
*.log
jest.config.js
# Development Files
*.map
*.ts
!*.d.ts
.travis.yml
.phpcs.xml.dist
composer.json
composer.lock
package.json
package-lock.json
phpcs.xml
README.md
CONTRIBUTING.md
*.zip
*.tar.gz
# System Files
.DS_Store
Thumbs.db

34
.eslintrc.js Normal file
View File

@ -0,0 +1,34 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
// Customize rules as needed
'no-console': ['warn', { allow: ['warn', 'error'] }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
// Add WordPress-specific rules here if needed
},
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
};

127
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,127 @@
name: Release WordPress Plugin
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, curl
tools: composer, wp-cli
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install PHP dependencies
run: composer install --no-dev --optimize-autoloader
- name: Install Node dependencies
run: npm ci
- name: Verify version matches
run: |
WP_VERSION=$(grep -m 1 "Version: " wp-multisite-waas.php | awk -F' ' '{print $2}')
README_VERSION=$(grep -m 1 "Stable tag: " readme.txt | awk -F' ' '{print $3}')
PKG_VERSION=$(node -p "require('./package.json').version")
if [ "$WP_VERSION" != "${{ env.VERSION }}" ] || [ "$README_VERSION" != "${{ env.VERSION }}" ] || [ "$PKG_VERSION" != "${{ env.VERSION }}" ]; then
echo "Error: Version mismatch detected!"
echo "Tag version: ${{ env.VERSION }}"
echo "Plugin version: $WP_VERSION"
echo "readme.txt version: $README_VERSION"
echo "package.json version: $PKG_VERSION"
exit 1
fi
echo "All version numbers match: ${{ env.VERSION }}"
- name: Choose build method
id: build_method
run: |
# Check if we have TypeScript files
if ls assets/js/*.ts &> /dev/null; then
echo "USE_MODERN_BUILD=true" >> $GITHUB_ENV
echo "Using modern build process with TypeScript"
else
echo "USE_MODERN_BUILD=false" >> $GITHUB_ENV
echo "Using compatibility build process"
fi
- name: Modern Build - Generate translation files
if: env.USE_MODERN_BUILD == 'true'
run: npm run translations
- name: Modern Build - Process CSS and JS
if: env.USE_MODERN_BUILD == 'true'
run: |
npm run css
npm run js
- name: Modern Build - Create ZIP file
if: env.USE_MODERN_BUILD == 'true'
run: npm run zip
- name: Compatibility Build - Run build process
if: env.USE_MODERN_BUILD == 'false'
run: npm run build:compat
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
build/wp-multisite-waas-${{ env.VERSION }}.zip
wp-multisite-waas.zip
name: WP Multisite WaaS ${{ env.VERSION }}
draft: false
prerelease: false
body: |
# WP Multisite WaaS ${{ env.VERSION }}
## What's Changed
For a complete list of changes, please refer to the [changelog](https://github.com/wpallstars/wp-multisite-waas/blob/main/readme.txt).
## Installation
1. Download the ZIP file from this release
2. Upload and activate the plugin in your WordPress Network installation
3. Follow the setup wizard to configure the plugin
## Notes
- Compatible with WordPress 5.3+
- Requires PHP 7.4.30+
- Always backup your site before upgrading
- name: Send notification on success
if: success()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: releases
SLACK_COLOR: good
SLACK_MESSAGE: "🚀 WP Multisite WaaS ${{ env.VERSION }} has been released! https://github.com/wpallstars/wp-multisite-waas/releases"
SLACK_TITLE: New Release
SLACK_USERNAME: GitHub
SLACK_ICON_EMOJI: ":github:"

45
.stylelintrc.js Normal file
View File

@ -0,0 +1,45 @@
module.exports = {
extends: [
'stylelint-config-standard-scss',
],
rules: {
// WordPress-specific CSS rules
'selector-class-pattern': null, // Allow WordPress class naming convention
'no-descending-specificity': null,
'at-rule-no-unknown': [
true,
{
ignoreAtRules: [
'extend',
'at-root',
'debug',
'warn',
'error',
'if',
'else',
'for',
'each',
'while',
'mixin',
'include',
'content',
'return',
'function',
'tailwind',
'apply',
'responsive',
'variants',
'screen',
],
},
],
// Other customizations
'string-quotes': 'single',
'declaration-block-trailing-semicolon': 'always',
},
ignoreFiles: [
'dist/**/*.css',
'node_modules/**/*',
'vendor/**/*',
],
};

53
BUILD-README.md Normal file
View File

@ -0,0 +1,53 @@
# Build Process Documentation
This document outlines the different build approaches available in the WP Multisite WaaS plugin and how to use them.
## Modern Build Process
The modern build process uses TypeScript, SASS, and modern JavaScript tooling to compile and optimize assets.
### Commands
- `npm run build` - Main build command that runs clean, translations, CSS, and JS processing
- `npm run css` - Compiles SASS to CSS and minifies it
- `npm run js` - Compiles TypeScript to JavaScript and minifies it
- `npm run translations` - Generates translation files
- `npm run lint` - Runs linting for PHP, JS, and CSS
- `npm run test` - Runs Jest tests
- `npm run prepare-release` - Runs build, lint, and test for release preparation
- `npm run zip` - Creates a ZIP file for distribution
### When to use
Use this build process during active development when working with TypeScript files and modern tooling.
## Compatibility Build Process
The compatibility build process is simpler and uses more basic tools like uglify-js and cleancss for direct minification without compilation steps.
### Commands
- `npm run build:compat` - Main compatibility build command
- `npm run build:dev:compat` - Development version of the compatibility build
- `npm run uglify` - Minifies JavaScript files
- `npm run cleancss:compat` - Minifies CSS files
- `npm run makepot` - Generates translation files
- `npm run archive` - Creates a ZIP file using composer
### When to use
Use this build process when working with the plugin-check branch or when you need a simpler build process without TypeScript compilation.
## GitHub Actions Workflow
The GitHub Actions workflow is designed to automatically detect which build process to use based on the presence of TypeScript files. If TypeScript files are detected, it uses the modern build process; otherwise, it falls back to the compatibility build process.
## Merging branches
When merging branches that use different build approaches:
1. Keep both sets of build scripts in package.json
2. The GitHub Actions workflow will automatically detect and use the appropriate build process
3. For local development, choose the build process that matches your current work
This dual approach ensures compatibility with both the modern toolchain and the simpler plugin-check approach.

243
README.md Normal file
View File

@ -0,0 +1,243 @@
# WP Multisite WaaS
<p align="center">
<img src="https://raw.githubusercontent.com/wpallstars/wp-multisite-waas/main/assets/images/logo.png" alt="WP Multisite WaaS Logo" width="300">
</p>
<p align="center">
<strong>The Complete Network Solution for transforming your WordPress Multisite into a Website as a Service (WaaS) platform.</strong>
</p>
<p align="center">
<a href="http://www.gnu.org/licenses/gpl-2.0.html"><img src="https://img.shields.io/badge/License-GPL%20v2-blue.svg" alt="License: GPL v2"></a>
<a href="https://wordpress.org/"><img src="https://img.shields.io/badge/WordPress-6.7.1%20Tested-green.svg" alt="WordPress: 6.7.1 Tested"></a>
<a href="https://php.net/"><img src="https://img.shields.io/badge/PHP-7.4.30%2B-purple.svg" alt="PHP: 7.4.30+"></a>
<a href="https://github.com/superdav42/wp-multisite-waas/releases"><img src="https://img.shields.io/github/v/release/superdav42/wp-multisite-waas" alt="Latest Release"></a>
</p>
## 🌟 Overview
**WP Multisite WaaS** helps you transform your WordPress Multisite installation into a powerful Website as a Service (WaaS) platform. This plugin enables you to offer website creation, hosting, and management services to your customers through a streamlined interface.
This plugin was formerly known as WP Ultimo and is now community maintained.
## ✨ Key Features
- **Site Creation** - Allow customers to create their own sites in your network
- **Domain Mapping** - Support for custom domains with automated DNS verification
- **Payment Processing** - Integrations with popular payment gateways like Stripe and PayPal
- **Plan Management** - Create and manage subscription plans with different features and limitations
- **Template Sites** - Easily clone and use template sites for new customer websites
- **Customer Dashboard** - Provide a professional management interface for your customers
- **White Labeling** - Brand the platform as your own
- **Hosting Integrations** - Connect with popular hosting control panels like cPanel, RunCloud, and more
## 📋 Requirements
- WordPress Multisite 5.3 or higher
- PHP 7.4.30 or higher
- MySQL 5.6 or higher
- HTTPS enabled (recommended for secure checkout)
## 🔧 Installation
There are two recommended ways to install WP Multisite WaaS:
### Method 1: Using the pre-packaged release (Recommended)
1. Download the latest release ZIP from the [Releases page](https://github.com/superdav42/wp-multisite-waas/releases)
2. Log in to your WordPress Network Admin dashboard
3. Navigate to Plugins > Add New > Upload Plugin
4. Choose the downloaded ZIP file and click "Install Now"
5. Network Activate the plugin through the 'Plugins' menu in WordPress
6. Follow the step-by-step Wizard to set the plugin up
### Method 2: Using Git and Composer (For developers)
This method requires command-line access to your server and familiarity with Git and Composer.
1. Clone the repository to your plugins directory:
```bash
cd wp-content/plugins/
git clone https://github.com/superdav42/wp-multisite-waas.git
cd wp-multisite-waas
```
2. Install the required dependencies using Composer:
```bash
composer install
```
3. Network Activate the plugin in your WordPress Network Admin dashboard
4. Follow the setup wizard to complete the installation
## 🔍 Common Installation Issues
<details>
<summary><strong>"Failed opening required [...]/vendor/autoload_packages.php"</strong></summary>
<p>This error occurs when the required vendor files are missing. This typically happens when:</p>
<ul>
<li>You've downloaded the repository directly from GitHub without using a release package</li>
<li>The composer dependencies haven't been installed</li>
</ul>
<p><strong>Solution:</strong> Use the pre-packaged release from the <a href="https://github.com/superdav42/wp-multisite-waas/releases">Releases page</a> or run <code>composer install</code> in the plugin directory.</p>
</details>
<details>
<summary><strong>"Cannot declare class ComposerAutoloaderInitWPUltimoDependencies, because the name is already in use"</strong></summary>
<p>This error usually occurs when updating from an older version of WP Ultimo or when multiple versions of the plugin are installed.</p>
<p><strong>Solution:</strong> Deactivate and remove any older versions of WP Ultimo or WP Multisite WaaS before activating the new version.</p>
</details>
<details>
<summary><strong>"Class 'WP_Ultimo\Database\Sites\Site_Query' not found"</strong></summary>
<p>This error can occur if the plugin's autoloader isn't properly loading all the necessary classes.</p>
<p><strong>Solution:</strong> Use the pre-packaged release from the <a href="https://github.com/superdav42/wp-multisite-waas/releases">Releases page</a> which includes all required files.</p>
</details>
## 🚀 Contributing
We welcome contributions to WP Multisite WaaS! Here's how you can contribute effectively:
### Development Workflow
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Set up the development environment:
```bash
# Install PHP dependencies
composer install
# Install Node.js dependencies
npm install
```
4. Make your changes
5. Use the available npm scripts for development:
```bash
# Watch for CSS/JS changes during development
npm start
# Generate translation files
npm run translations
# Process CSS (compile SCSS to CSS and minify)
npm run css
# Process JavaScript (compile TypeScript to JS and minify)
npm run js
# Run all linters (PHP, JS, CSS)
npm run lint
# Run tests
npm run test
```
6. Before committing, run the build process to ensure all assets are properly processed:
```bash
npm run build
```
This command:
- Generates translation POT files
- Compiles and minifies CSS from SCSS
- Compiles and minifies JS from TypeScript
- Optimizes other assets
7. **Important:** Update both README.md and readme.txt files when making changes that affect:
- Version numbers
- Required WordPress/PHP versions
- Feature additions or changes
- Installation instructions
- Documentation
- Changelog entries
8. Commit your changes (`git commit -m 'Add some amazing feature'`)
9. Push to the branch (`git push origin feature/amazing-feature`)
10. Open a Pull Request
### Pull Request Guidelines
When submitting pull requests, please:
1. Include a clear description of the changes and their purpose
2. Reference any related issues using GitHub's issue linking syntax (#123)
3. Ensure your code follows the existing style and conventions
4. Include screenshots or GIFs for UI changes if applicable
5. Make sure all tests pass (if available)
6. Update documentation as needed
7. Verify that both README.md and readme.txt are updated and synchronized
### Release Process
Releases are automated using GitHub Actions workflows that trigger when a version tag is pushed.
**Tagging Convention:** To trigger a new release build, push a tag following the semantic versioning format:
```bash
git tag v2.3.5 # For example, for version 2.3.5
git push origin v2.3.5
```
The tag must begin with "v" followed by the version number (v*.*.*)
This will automatically:
1. Verify all version numbers match across files
2. Build the plugin (translations, CSS, JS)
3. Create a properly packaged ZIP file
4. Create a GitHub release with the ZIP attached
When preparing for a release:
1. Update the version number in:
- The main plugin file (wp-multisite-waas.php)
- readme.txt (Stable tag)
- package.json
2. Update the changelog in readme.txt
3. Ensure README.md and readme.txt are synchronized with the latest information
4. Create and push the appropriate version tag
## 🆘 Support
For support, please open an issue on the [GitHub repository](https://github.com/superdav42/wp-multisite-waas/issues).
## ⚠️ Upgrade Notice
We recommend running this in a staging environment before updating your production environment.
## 📝 Recent Changes
### Version [2.3.4] - Released on 2024-01-31
- Fixed: Unable to checkout with any payment gateway
- Fixed: Warning Undefined global variable $pagenow
### Version [2.3.3] - Released on 2024-01-29
- Improved: Plugin renamed to WP Multisite WaaS
- Removed: Enforcement of paid license
- Fixed: Incompatibilities with WordPress 6.7 and i18n timing
- Improved: Reduced plugin size by removing many unnecessary files and shrinking images
For the complete changelog, please see [readme.txt](readme.txt).
## 👥 Contributors
WP Multisite WaaS is an open-source project with contributions from:
- [aanduque](https://github.com/aanduque)
- [superdav42](https://github.com/superdav42)
- [And the community](https://github.com/superdav42/wp-multisite-waas/graphs/contributors)
## 📄 License
WP Multisite WaaS is licensed under the GPL v2 or later.
Copyright © 2024 [WP Multisite WaaS Contributors](https://github.com/superdav42/wp-multisite-waas/graphs/contributors)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

43
bin/create-zip.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
# Get the version from the main plugin file
VERSION=$(grep -m 1 "Version: " wp-multisite-waas.php | awk -F' ' '{print $2}')
PLUGIN_SLUG="wp-multisite-waas"
BUILD_DIR="./build"
DIST_DIR="$BUILD_DIR/$PLUGIN_SLUG"
echo "📦 Building $PLUGIN_SLUG version $VERSION..."
# Ensure a clean build directory
rm -rf "$BUILD_DIR"
mkdir -p "$DIST_DIR"
# Copy all necessary files to the distribution directory
echo "🔍 Copying files..."
rsync -rc --exclude-from='.distignore' --exclude="$BUILD_DIR" ./ "$DIST_DIR/" --delete --delete-excluded
# Remove development files
echo "🧹 Removing development files..."
cd "$DIST_DIR" || exit
rm -rf .git .github .gitignore .distignore .eslintrc* .stylelintrc* composer.json composer.lock package.json package-lock.json phpunit.xml jest.config.js tsconfig.json webpack.config.js node_modules tests .vscode .idea bin
# Create the zip file
echo "🗜️ Creating zip file..."
cd "$BUILD_DIR" || exit
ZIP_FILE="$PLUGIN_SLUG-$VERSION.zip"
zip -r "$ZIP_FILE" "$PLUGIN_SLUG" -x "*.DS_Store" -x "*.git*" -x "*node_modules*" -x "*vendor*" -x "*.map"
echo "✅ Build complete: $BUILD_DIR/$ZIP_FILE"
echo "📏 ZIP size: $(du -h "$ZIP_FILE" | cut -f1)"
# Remind about version numbers
echo ""
echo "🔔 Remember to:"
echo " - Verify the zip contains all necessary files"
echo " - Ensure version numbers match in:"
echo " - wp-multisite-waas.php"
echo " - package.json"
echo " - readme.txt"
echo ""
exit 0

138
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "aa95a1b59acc93d92d18448d166a5f0e",
"content-hash": "c27fa56bfcbf860f1ae2a70ef5153e7a",
"packages": [
{
"name": "amphp/amp",
@ -97,16 +97,16 @@
},
{
"name": "automattic/jetpack-autoloader",
"version": "v5.0.6",
"version": "v5.0.1",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-autoloader.git",
"reference": "5d533e1ff64ed0107b3b46928705fbfa8d3cdb1b"
"reference": "ba3f5146426367c718312a0da87ebd596ed9cf33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/5d533e1ff64ed0107b3b46928705fbfa8d3cdb1b",
"reference": "5d533e1ff64ed0107b3b46928705fbfa8d3cdb1b",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/ba3f5146426367c718312a0da87ebd596ed9cf33",
"reference": "ba3f5146426367c718312a0da87ebd596ed9cf33",
"shasum": ""
},
"require": {
@ -114,10 +114,9 @@
"php": ">=7.2"
},
"require-dev": {
"automattic/jetpack-changelogger": "^6.0.3",
"automattic/phpunit-select-config": "^1.0.2",
"automattic/jetpack-changelogger": "^5.1.0",
"composer/composer": "^2.2",
"yoast/phpunit-polyfills": "^3.0.0"
"yoast/phpunit-polyfills": "^1.1.1"
},
"type": "composer-plugin",
"extra": {
@ -156,9 +155,9 @@
"wordpress"
],
"support": {
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v5.0.6"
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v5.0.1"
},
"time": "2025-03-31T17:43:05+00:00"
"time": "2025-01-20T16:46:39+00:00"
},
{
"name": "berlindb/core",
@ -371,16 +370,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.9.3",
"version": "7.9.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
"reference": "d281ed313b989f213357e3be1a179f02196ac99b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"shasum": ""
},
"require": {
@ -477,7 +476,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.9.3"
"source": "https://github.com/guzzle/guzzle/tree/7.9.2"
},
"funding": [
{
@ -493,7 +492,7 @@
"type": "tidelift"
}
],
"time": "2025-03-27T13:37:11+00:00"
"time": "2024-07-24T11:22:20+00:00"
},
{
"name": "guzzlehttp/promises",
@ -576,16 +575,16 @@
},
{
"name": "guzzlehttp/psr7",
"version": "2.7.1",
"version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"shasum": ""
},
"require": {
@ -672,7 +671,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.7.1"
"source": "https://github.com/guzzle/psr7/tree/2.7.0"
},
"funding": [
{
@ -688,7 +687,7 @@
"type": "tidelift"
}
],
"time": "2025-03-27T12:30:47+00:00"
"time": "2024-07-18T11:15:46+00:00"
},
{
"name": "hashids/hashids",
@ -1152,16 +1151,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.13.0",
"version": "1.12.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414"
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845",
"reference": "123267b2c49fbf30d78a7b2d333f6be754b94845",
"shasum": ""
},
"require": {
@ -1200,7 +1199,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
"source": "https://github.com/myclabs/DeepCopy/tree/1.12.1"
},
"funding": [
{
@ -1208,7 +1207,7 @@
"type": "tidelift"
}
],
"time": "2025-02-12T12:17:51+00:00"
"time": "2024-11-08T17:47:46+00:00"
},
{
"name": "nyholm/psr7",
@ -1515,16 +1514,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "2.1.0",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68"
"reference": "c00d78fb6b29658347f9d37ebe104bffadf36299"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68",
"reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299",
"reference": "c00d78fb6b29658347f9d37ebe104bffadf36299",
"shasum": ""
},
"require": {
@ -1556,9 +1555,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0"
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0"
},
"time": "2025-02-19T13:28:12+00:00"
"time": "2024-10-13T11:29:49+00:00"
},
{
"name": "psr/cache",
@ -4171,12 +4170,12 @@
"source": {
"type": "git",
"url": "https://github.com/php-stubs/wordpress-stubs.git",
"reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4"
"reference": "27f32faacb65a1230d9dac09f1b6c5ce78a6e61a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
"reference": "c04f96cb232fab12a3cbcccf5a47767f0665c3f4",
"url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/27f32faacb65a1230d9dac09f1b6c5ce78a6e61a",
"reference": "27f32faacb65a1230d9dac09f1b6c5ce78a6e61a",
"shasum": ""
},
"require-dev": {
@ -4211,7 +4210,7 @@
"issues": "https://github.com/php-stubs/wordpress-stubs/issues",
"source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.7.2"
},
"time": "2025-02-12T04:51:58+00:00"
"time": "2025-02-05T17:57:54+00:00"
},
{
"name": "phpcompatibility/php-compatibility",
@ -4633,16 +4632,16 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.11",
"version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30"
"reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/8ca5f79a8f63c49b2359065832a654e1ec70ac30",
"reference": "8ca5f79a8f63c49b2359065832a654e1ec70ac30",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/64ae44e48214f3deebdaeebf2694297a10a2bea9",
"reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9",
"shasum": ""
},
"require": {
@ -4687,7 +4686,7 @@
"type": "github"
}
],
"time": "2025-03-24T13:45:00+00:00"
"time": "2025-02-07T15:05:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -5113,21 +5112,21 @@
},
{
"name": "rector/rector",
"version": "2.0.11",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "059b827cc648929711606e9824337e41e2f9ed92"
"reference": "3c70238bc677eb98866000a05b19a34f12955954"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/059b827cc648929711606e9824337e41e2f9ed92",
"reference": "059b827cc648929711606e9824337e41e2f9ed92",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/3c70238bc677eb98866000a05b19a34f12955954",
"reference": "3c70238bc677eb98866000a05b19a34f12955954",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0",
"phpstan/phpstan": "^2.1.9"
"phpstan/phpstan": "^2.1.2"
},
"conflict": {
"rector/rector-doctrine": "*",
@ -5160,7 +5159,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.0.11"
"source": "https://github.com/rectorphp/rector/tree/2.0.8"
},
"funding": [
{
@ -5168,7 +5167,7 @@
"type": "github"
}
],
"time": "2025-03-28T10:25:17+00:00"
"time": "2025-02-06T14:02:49+00:00"
},
{
"name": "sebastian/cli-parser",
@ -6135,16 +6134,16 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.12.1",
"version": "3.11.3",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "ea16a1f3719783345febd3aab41beb55c8c84bfd"
"reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ea16a1f3719783345febd3aab41beb55c8c84bfd",
"reference": "ea16a1f3719783345febd3aab41beb55c8c84bfd",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10",
"reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10",
"shasum": ""
},
"require": {
@ -6211,24 +6210,24 @@
"type": "open_collective"
},
{
"url": "https://thanks.dev/u/gh/phpcsstandards",
"url": "https://thanks.dev/phpcsstandards",
"type": "thanks_dev"
}
],
"time": "2025-04-04T12:57:55+00:00"
"time": "2025-01-23T17:04:15+00:00"
},
{
"name": "symplify/vendor-patches",
"version": "11.4.1",
"version": "11.3.7",
"source": {
"type": "git",
"url": "https://github.com/symplify/vendor-patches.git",
"reference": "085a3a3e456e4d2d9a6b4fe02e86f92ce5b1fe35"
"reference": "dec8ec588192a3ee0d886288395b5cd6a768126e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symplify/vendor-patches/zipball/085a3a3e456e4d2d9a6b4fe02e86f92ce5b1fe35",
"reference": "085a3a3e456e4d2d9a6b4fe02e86f92ce5b1fe35",
"url": "https://api.github.com/repos/symplify/vendor-patches/zipball/dec8ec588192a3ee0d886288395b5cd6a768126e",
"reference": "dec8ec588192a3ee0d886288395b5cd6a768126e",
"shasum": ""
},
"require": {
@ -6246,7 +6245,7 @@
"description": "Generate vendor patches for packages with single command",
"support": {
"issues": "https://github.com/symplify/vendor-patches/issues",
"source": "https://github.com/symplify/vendor-patches/tree/11.4.1"
"source": "https://github.com/symplify/vendor-patches/tree/11.3.7"
},
"funding": [
{
@ -6258,7 +6257,7 @@
"type": "github"
}
],
"time": "2025-02-18T08:19:39+00:00"
"time": "2024-01-23T17:12:30+00:00"
},
{
"name": "szepeviktor/phpstan-wordpress",
@ -6479,16 +6478,16 @@
},
{
"name": "yoast/phpunit-polyfills",
"version": "1.1.4",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/Yoast/PHPUnit-Polyfills.git",
"reference": "e6faedf5e34cea4438e341f660e2f719760c531d"
"reference": "0b31ce834facf03b8b44b6587e65b3cf1d7cfb94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/e6faedf5e34cea4438e341f660e2f719760c531d",
"reference": "e6faedf5e34cea4438e341f660e2f719760c531d",
"url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/0b31ce834facf03b8b44b6587e65b3cf1d7cfb94",
"reference": "0b31ce834facf03b8b44b6587e65b3cf1d7cfb94",
"shasum": ""
},
"require": {
@ -6503,7 +6502,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "4.x-dev"
"dev-main": "3.x-dev"
}
},
"autoload": {
@ -6538,7 +6537,7 @@
"security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy",
"source": "https://github.com/Yoast/PHPUnit-Polyfills"
},
"time": "2025-02-09T18:13:44+00:00"
"time": "2025-01-08T16:58:34+00:00"
}
],
"aliases": [],
@ -6551,8 +6550,7 @@
"prefer-lowest": false,
"platform": {
"php": ">=7.4.1",
"ext-json": "*",
"ext-curl": "*"
"ext-json": "*"
},
"platform-dev": {},
"platform-overrides": {

21631
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

74
package.json Normal file
View File

@ -0,0 +1,74 @@
{
"name": "wp-multisite-waas",
"version": "2.3.4",
"title": "WP Multisite WaaS",
"description": "The Complete Network Solution for transforming your WordPress Multisite into a Website as a Service (WaaS) platform",
"homepage": "https://wpmultisitewaas.org/",
"main": "index.js",
"scripts": {
"start": "wp-scripts start",
"build": "npm run clean && npm run translations && npm run css && npm run js",
"clean": "rm -rf dist && mkdir -p dist/css dist/js",
"css": "npm run css:compile && npm run css:minify",
"css:compile": "sass --style=expanded --source-map --embed-sources --no-error-css assets/css/src/:assets/css/",
"css:minify": "cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output assets/css/ --batch --batch-suffix '.min' 'assets/css/*.css' '!assets/css/*.min.css'",
"js": "npm run js:compile && npm run js:minify",
"js:compile": "tsc -p tsconfig.json",
"js:minify": "terser assets/js/*.js --compress --mangle --output dist/js/ --source-map \"root='../assets/js',url='[name].min.js.map'\"",
"translations": "wp i18n make-pot ./ lang/wp-multisite-waas.pot --include=\"**/*.php\" --exclude=\"vendor,node_modules,tests\"",
"lint:php": "composer run-script phpcs",
"lint:js": "eslint assets/js/**/*.js assets/js/**/*.ts",
"lint:css": "stylelint assets/css/**/*.scss",
"lint": "npm run lint:php && npm run lint:js && npm run lint:css",
"test": "jest",
"prepare-release": "npm run build && npm run lint && npm run test",
"zip": "npm run build && bash ./bin/create-zip.sh",
"prebuild:compat": "composer install --no-dev",
"prebuild:dev:compat": "composer install",
"build:compat": "npm run uglify && npm run makepot && npm run cleancss:compat && npm run archive",
"build:dev:compat": "npm run uglify && npm run makepot && npm run cleancss:compat",
"archive": "composer archive --file=$npm_package_name --format=zip",
"postarchive": "rm -rf $npm_package_name && unzip $npm_package_name.zip -d $npm_package_name && rm $npm_package_name.zip && zip -r $npm_package_name.zip $npm_package_name && rm -rf $npm_package_name",
"preuglify": "rm -f assets/js/*.min.js",
"uglify": "for f in assets/js/*.js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
"precleancss:compat": "rm -f assets/css/*.min.css",
"cleancss:compat": "for f in assets/css/*.css; do file=${f%.css}; node_modules/.bin/cleancss -o $file.min.css $f; done",
"makepot": "wp i18n make-pot ./ lang/$npm_package_name.pot --exclude=node_modules,tests,docs,assets/js/lib"
},
"repository": {
"type": "git",
"url": "git+https://github.com/superdav42/wp-multisite-waas.git"
},
"keywords": [
"wordpress",
"multisite",
"waas"
],
"author": "WP Multisite WaaS Contributors",
"license": "GPL-2.0-or-later",
"bugs": {
"url": "https://github.com/superdav42/wp-multisite-waas/issues"
},
"config": {
"translate": true
},
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@wordpress/env": "^8.8.0",
"@wordpress/scripts": "^26.13.0",
"clean-css-cli": "^5.6.2",
"eslint": "^8.46.0",
"jest": "^29.6.2",
"sass": "^1.64.1",
"stylelint": "^15.10.2",
"stylelint-config-standard-scss": "^10.0.0",
"terser": "^5.19.2",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6",
"uglify-js": "^3.19.3"
}
}

View File

@ -1,24 +1,182 @@
=== WP Multisite WaaS ===
Contributors: aanduque, superdav42
Donate link: https://github.com/sponsors/superdav42/
Tags: multisite, waas, membership, domain-mapping, recurring payments, subscription
Requires at least: 5.3
Requires PHP: 7.4.30
Tested up to: 6.7.1
Requires PHP: 7.4.30
Stable tag: 2.3.4
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Contributors: aanduque, superdav42
The Complete Network Solution.
The Complete Network Solution for transforming your WordPress Multisite into a Website as a Service (WaaS) platform.
== Description ==
WP Multisite WaaS
**WP Multisite WaaS** helps you transform your WordPress Multisite installation into a powerful Website as a Service (WaaS) platform. This plugin enables you to offer website creation, hosting, and management services to your customers through a streamlined interface.
The WordPress Multisite Website as a Service (Waas) plugin. Now community maintained.
Now community maintained.
= Key Features =
* **Site Creation** - Allow customers to create their own sites in your network
* **Domain Mapping** - Support for custom domains with automated DNS verification
* **Payment Processing** - Integrations with popular payment gateways like Stripe and PayPal
* **Plan Management** - Create and manage subscription plans with different features and limitations
* **Template Sites** - Easily clone and use template sites for new customer websites
* **Customer Dashboard** - Provide a professional management interface for your customers
* **White Labeling** - Brand the platform as your own
* **Hosting Integrations** - Connect with popular hosting control panels like cPanel, RunCloud, and more
= Where to find help =
* [GitHub Repository](https://github.com/superdav42/wp-multisite-waas)
* [Issue Tracker](https://github.com/superdav42/wp-multisite-waas/issues)
= Contributing =
We welcome contributions to WP Multisite WaaS! To contribute effectively:
**Development Workflow:**
1. Fork the repository on GitHub
2. Create a feature branch from main
3. Set up the development environment:
* Install PHP dependencies with `composer install`
* Install Node.js dependencies with `npm install`
4. Make your changes
5. Use the available npm scripts for development:
* `npm start` - Watch for CSS/JS changes during development
* `npm run translations` - Generate translation files
* `npm run css` - Process CSS (compile SCSS to CSS and minify)
* `npm run js` - Process JavaScript (compile TypeScript to JS and minify)
* `npm run lint` - Run all linters (PHP, JS, CSS)
* `npm run test` - Run tests
6. Before committing, run `npm run build` to:
* Generate translation POT files
* Compile and minify CSS from SCSS
* Compile and minify JS from TypeScript
* Optimize other assets
7. **Important:** Update both README.md and readme.txt files when making changes that affect:
* Version numbers
* Required WordPress/PHP versions
* Feature additions or changes
* Installation instructions
* Documentation
* Changelog entries
8. Commit your changes and push to your fork
9. Open a Pull Request against the main repository
When submitting a Pull Request, please include a clear description of the changes and their purpose, reference any related issues, and ensure your code follows existing style conventions. Always verify that both README.md and readme.txt are updated and synchronized before submitting your PR.
**Release Process:**
Releases are automated using GitHub Actions workflows that trigger when a version tag is pushed.
To trigger a new release build, push a tag following the semantic versioning format (v*.*.*):
`git tag v2.3.5 && git push origin v2.3.5`
When preparing for a release:
1. Update the version number in:
* The main plugin file (wp-multisite-waas.php)
* readme.txt (Stable tag)
* package.json
2. Update the changelog in readme.txt
3. Ensure README.md and readme.txt are synchronized with the latest information
4. Create and push the appropriate version tag
For more detailed contribution guidelines, see the [GitHub repository](https://github.com/superdav42/wp-multisite-waas).
== Installation ==
1. Upload 'wp-multisite-waas' to the '/wp-content/plugins/' directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Follow the step by step Wizard to set the plugin up
There are two recommended ways to install WP Multisite WaaS:
= Method 1: Using the pre-packaged release (Recommended) =
1. Download the latest release ZIP from the [Releases page](https://github.com/superdav42/wp-multisite-waas/releases)
2. Log in to your WordPress Network Admin dashboard
3. Navigate to Plugins > Add New > Upload Plugin
4. Choose the downloaded ZIP file and click "Install Now"
5. Network Activate the plugin through the 'Plugins' menu in WordPress
6. Follow the step by step Wizard to set the plugin up
= Method 2: Using Git and Composer (For developers) =
This method requires command-line access to your server and familiarity with Git and Composer.
1. Clone the repository to your plugins directory:
```
cd wp-content/plugins/
git clone https://github.com/superdav42/wp-multisite-waas.git
cd wp-multisite-waas
```
2. Install the required dependencies using Composer:
```
composer install
```
3. Network Activate the plugin in your WordPress Network Admin dashboard
4. Follow the setup wizard to complete the installation
= Common Installation Issues =
**"Failed opening required [...]/vendor/autoload_packages.php"**
This error occurs when the required vendor files are missing. This typically happens when:
- You've downloaded the repository directly from GitHub without using a release package
- The composer dependencies haven't been installed
Solution: Use the pre-packaged release from the [Releases page](https://github.com/superdav42/wp-multisite-waas/releases) or run `composer install` in the plugin directory.
**"Cannot declare class ComposerAutoloaderInitWPUltimoDependencies, because the name is already in use"**
This error usually occurs when updating from an older version of WP Ultimo or when multiple versions of the plugin are installed.
Solution: Deactivate and remove any older versions of WP Ultimo or WP Multisite WaaS before activating the new version.
**"Class 'WP_Ultimo\Database\Sites\Site_Query' not found"**
This error can occur if the plugin's autoloader isn't properly loading all the necessary classes.
Solution: Use the pre-packaged release from the [Releases page](https://github.com/superdav42/wp-multisite-waas/releases) which includes all required files.
== Requirements ==
* WordPress Multisite 5.3 or higher
* PHP 7.4.30 or higher
* MySQL 5.6 or higher
* HTTPS enabled (recommended for secure checkout)
== Frequently Asked Questions ==
= Can I use this plugin with a regular WordPress installation? =
No, this plugin specifically requires WordPress Multisite to function properly. It transforms your Multisite network into a platform for hosting multiple customer websites.
= Does this plugin support custom domains? =
Yes, WP Multisite WaaS includes robust domain mapping functionality that allows your customers to use their own domains for their websites within your network.
= Which payment gateways are supported? =
The plugin supports multiple payment gateways including Stripe, PayPal, and manually handled payments.
= Can I migrate from WP Ultimo to this plugin? =
Yes, WP Multisite WaaS is a community-maintained fork of WP Ultimo. The plugin includes migration tools to help you transition from WP Ultimo.
== Screenshots ==
1. Dashboard overview with key metrics
2. Subscription plans management
3. Customer management interface
4. Site creation workflow
5. Domain mapping settings
== Support ==
For support, please open an issue on the [GitHub repository](https://github.com/superdav42/wp-multisite-waas/issues).
== Upgrade Notice ==
@ -384,7 +542,7 @@ Version 2.0.20 - Released on 2022-09-30
* Added: Security mode to deactivate all plugins except WP Ultimo and mu-plugins at once and reactivate after disable;
* Added: Allow customers to update the membership to plans and variations with different periods;
* Added: Allow customers to select one of their sites when creating a new one;
* Added: Error message when customers access the add user page over users limit;
* Added: Error message when customers access the "add user" page over users limit;
* Added: wu_return_url filter, allowing custom redirections after checkout process;
* Improvement: New payments from manual gateway are now generated by current membership;
* Improvement: Elementor compatibility on mapped sites;
@ -463,8 +621,8 @@ Version 2.0.15 - Released on 2022-06-15
* Added: Currency Saudi Riyal
* Improvement: Removes unlisted countries from the billing address checkout field when using the "Restrict by country" option;
* Improvement: Disables the "Restrict by country" toggle when saving the form without allowed countries;
* Improvement: Improves the addition of billing address fields by allowing the removal of fields through the wu_billing_address_fields filter and avoiding error in the use of this filter;
* Improvement: Checks if payment status is completed when building the cart to prevent error with Ultimo defining the cart as retry;
* Improvement: Improves the addition of billing address fields by allowing the removal of fields through the "wu_billing_address_fields" filter and avoiding error in the use of this filter;
* Improvement: Checks if payment status is completed when building the cart to prevent error with Ultimo defining the cart as "retry";
* Improvement: Verifies if the cart has a future value to be paid to better handle downgrades;
* Improvement: Checks if subscription is not already cancelled on Stripe and Stripe Checkout gateways before trying to cancel;
* Improvement: Improvement: Changes stripe.js handlers to better code readability and to follow Stripe recommendations;
@ -485,7 +643,7 @@ Version 2.0.15 - Released on 2022-06-15
* Fix: SSO not working on wp-admin page with mapped domains;
* Fix: Stripe saved cards not working;
* Fix: Downgrade cart not being correctly built when new plan is not free;
* Fix: Correctly define a cart as retry and postpone the payment verification when building it to prevent some errors on checkout validation process;
* Fix: Correctly define a cart as "retry" and postpone the payment verification when building it to prevent some errors on checkout validation process;
* Fix: Get the enable multiple membership value config from settings value;
* Fix: Allow updates with current plan on trial period;
* Fix: Stripe Checkout gateway id with wrong value on get_or_create_customer method;

26
tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"jsx": "preserve",
"outDir": "./dist/js",
"sourceMap": true,
"declaration": false,
"allowJs": true,
"checkJs": false
},
"include": [
"assets/js/**/*.ts",
"assets/js/**/*.js"
],
"exclude": [
"node_modules",
"vendor",
"dist"
]
}