Skip to content

Commit 7e8e11f

Browse files
authored
Merge pull request #1 from soderlind/ui
UI changes
2 parents 608f421 + b3103ce commit 7e8e11f

7 files changed

Lines changed: 1544 additions & 61 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
All notable changes to the Multisite Exporter plugin will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [1.0.1] - 2025-05-07
8+
### Changed
9+
- Updated documentation to clarify the location of the Action Scheduler library
10+
- Improved README.md with more detailed information about Action Scheduler integration
11+
12+
## [1.0.0] - 2025-05-07
13+
### Added
14+
- Initial plugin release
15+
- Background export processing for all subsites using Action Scheduler
16+
- Export filtering by content type, custom post type, and date range
17+
- Centralized export storage in uploads directory
18+
- Export history page showing all completed exports
19+
- Download functionality for individual export files
20+
- Multiple selection and bulk download of export files as a zip archive
21+
- Full internationalization support with POT file

README.md

Lines changed: 152 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,152 @@
1-
# multisite-exporter
1+
# Multisite Exporter
2+
3+
Multisite Exporter is a WordPress plugin that allows you to export content from all subsites in a WordPress multisite installation. The plugin runs the WordPress exporter on each subsite in the background using the Action Scheduler library, making it efficient even for large multisite networks.
4+
5+
## Features
6+
7+
- Export content from all subsites in a WordPress multisite network
8+
- Background processing using Action Scheduler to handle large networks efficiently
9+
- Filter exports by content type, post type, and date range
10+
- Centralized export file storage for easy access to all exports
11+
- Select and download multiple export files as a zip archive
12+
- Fully translatable with .pot file included
13+
- Customizable export directory location via filter
14+
15+
## Requirements
16+
17+
- WordPress Multisite installation
18+
- PHP 7.0 or higher
19+
- Action Scheduler library (included via Composer)
20+
21+
## Installation
22+
23+
### Method 1: Composer
24+
25+
1. Clone this repository to your WordPress plugins directory
26+
2. Navigate to the plugin directory
27+
3. Run `composer install` to install dependencies
28+
4. Activate the plugin from the WordPress Network Admin
29+
30+
```bash
31+
cd wp-content/plugins
32+
git clone https://github.com/yourusername/multisite-exporter.git
33+
cd multisite-exporter
34+
composer install
35+
```
36+
37+
### Method 2: Manual Installation
38+
39+
1. Download the plugin zip file
40+
2. Upload and extract to your WordPress plugins directory
41+
3. Make sure the Action Scheduler library is included in the vendor directory
42+
4. Activate the plugin from the WordPress Network Admin
43+
44+
## Usage
45+
46+
### Running an Export
47+
48+
1. Log in to your WordPress Network Admin dashboard
49+
2. Navigate to MS Exporter → Multisite Exporter
50+
3. Configure your export settings:
51+
- Content: Choose to export all content, posts, pages, or media
52+
- Post Type: Optionally specify a custom post type
53+
- Date Range: Optionally filter by start and end date
54+
4. Click "Run Export for All Subsites"
55+
5. Exports will be processed in the background using Action Scheduler
56+
57+
### Accessing Export Files
58+
59+
1. Navigate to MS Exporter → Export History
60+
2. View a list of all completed exports from all subsites
61+
3. Download options:
62+
- Click the "Download" button next to an individual export
63+
- Select multiple exports using checkboxes and click "Download Selected" to get a zip file
64+
- Use "Select All" and "Download Selected" to download all exports at once
65+
66+
## How Action Scheduler Works
67+
68+
The Multisite Exporter plugin uses Action Scheduler, a robust background processing library for WordPress, to handle export operations efficiently across multiple sites. Here's how it works:
69+
70+
### Overview
71+
72+
1. **Task Scheduling**: When you click "Run Export for All Subsites," the plugin creates an individual task for each subsite in your network.
73+
74+
2. **Background Processing**: These tasks are processed in the background using WordPress cron, without blocking user interactions or causing timeout issues.
75+
76+
3. **Failure Handling**: If an export fails, Action Scheduler will automatically retry it based on its built-in retry logic, ensuring robust operation even in challenging environments.
77+
78+
### Technical Details
79+
80+
- **Storage**: Action Scheduler stores tasks in a custom table, ensuring they don't get lost even in case of server interruptions.
81+
82+
- **Queue Processing**: Tasks are executed in a controlled manner, with rate limiting to prevent server overload.
83+
84+
- **Admin Interface**: The plugin provides a filtered view of Action Scheduler's interface under MS Exporter → Scheduled Actions, where you can monitor the progress of exports.
85+
86+
- **Scaling**: The architecture can handle thousands of tasks, making it perfect for large multisite networks with hundreds of subsites.
87+
88+
### Action Scheduler Location
89+
90+
The Action Scheduler library is included in this plugin via Composer and can be found at:
91+
92+
```
93+
/vendor/woocommerce/action-scheduler/
94+
```
95+
96+
All Action Scheduler related files are loaded automatically when the plugin initializes.
97+
98+
### Benefits for Multisite Exports
99+
100+
- **No Timeout Issues**: Export processes run in the background, avoiding PHP timeout restrictions.
101+
102+
- **Server-Friendly**: Tasks are processed in batches, preventing server resource exhaustion.
103+
104+
- **Monitoring**: You can track the progress of exports and identify any issues that may occur.
105+
106+
- **Reliability**: The persistent storage mechanism ensures that even if a server restarts, your export tasks will continue where they left off.
107+
108+
## Export File Storage
109+
110+
All export files are stored in a centralized location within your WordPress uploads directory:
111+
112+
```
113+
wp-content/uploads/multisite-exports/
114+
```
115+
116+
This makes it easy to find and manage exports from all your subsites in one place.
117+
118+
### Customizing Export Directory
119+
120+
You can change the default export directory by using the `multisite_exporter_directory` filter:
121+
122+
```php
123+
/**
124+
* Change the directory where Multisite Exporter stores exported files
125+
*/
126+
add_filter( 'multisite_exporter_directory', 'my_custom_export_directory' );
127+
function my_custom_export_directory( $default_export_dir ) {
128+
// Define a custom location for your export files
129+
return WP_CONTENT_DIR . '/my-custom-exports';
130+
}
131+
```
132+
133+
Add this code to your theme's functions.php file or a custom plugin.
134+
135+
## Translation
136+
137+
The plugin is fully translatable. A POT file is included in the `languages` directory to help with translations.
138+
139+
To create a translation:
140+
141+
1. Copy the `languages/multisite-exporter.pot` file
142+
2. Rename it to `multisite-exporter-{locale}.po` (e.g., `multisite-exporter-fr_FR.po`)
143+
3. Translate using a tool like Poedit
144+
4. Save both .po and .mo files to the languages directory
145+
146+
## License
147+
148+
This plugin is licensed under the GPL v2 or later.
149+
150+
## Author
151+
152+
[Per Søderlind](https://soderlind.no)

css/multisite-exporter.css

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/**
2+
* Styles for Multisite Exporter plugin
3+
*/
4+
5+
/* Export History Page Styles */
6+
.multisite-exporter-table .check-column {
7+
width: 2.2em;
8+
padding: 8px 10px !important;
9+
vertical-align: middle !important;
10+
}
11+
12+
.multisite-exporter-table #cb-select-all {
13+
margin-left: 0;
14+
vertical-align: middle;
15+
}
16+
17+
.multisite-exporter-table input[name="selected_exports[]"] {
18+
margin-left: 0;
19+
}
20+
21+
.multisite-exporter-table .tablenav .actions {
22+
padding: 2px 0;
23+
}
24+
25+
.multisite-exporter-table .tablenav .button {
26+
margin-right: 5px;
27+
}
28+
29+
/* General styles for the export table */
30+
.me-export-table {
31+
width: 100%;
32+
border-collapse: collapse;
33+
margin-bottom: 20px;
34+
}
35+
36+
.me-export-table th,
37+
.me-export-table td {
38+
padding: 8px 12px;
39+
text-align: left;
40+
vertical-align: middle;
41+
border-bottom: 1px solid #e5e5e5;
42+
}
43+
44+
.me-export-table th {
45+
background-color: #f9f9f9;
46+
}
47+
48+
/* Styles for the selection controls */
49+
.me-selection-controls {
50+
display: flex;
51+
align-items: center;
52+
margin-bottom: 15px;
53+
padding: 10px;
54+
background: #f9f9f9;
55+
border: 1px solid #e5e5e5;
56+
border-radius: 4px;
57+
}
58+
59+
.me-selection-controls label {
60+
margin-right: 20px;
61+
display: flex;
62+
align-items: center;
63+
}
64+
65+
.me-selection-controls input[type="checkbox"] {
66+
margin-right: 5px;
67+
}
68+
69+
.me-selection-controls .me-bulk-actions {
70+
margin-left: auto;
71+
}
72+
73+
.me-select-all-pages-info {
74+
padding: 5px 10px;
75+
background-color: #f0f6ff;
76+
border-left: 4px solid #2271b1;
77+
margin: 10px 0;
78+
font-size: 13px;
79+
display: none;
80+
}
81+
82+
.me-selected-count-wrapper {
83+
margin-right: 10px;
84+
font-size: 13px;
85+
color: #606060;
86+
}
87+
88+
.me-selected-count {
89+
font-weight: bold;
90+
color: #2271b1;
91+
}
92+
93+
/* Button styles */
94+
.button-disabled {
95+
opacity: 0.6;
96+
cursor: not-allowed;
97+
}

0 commit comments

Comments
 (0)