Skip to content

Commit 2d4b637

Browse files
committed
initial commit
0 parents  commit 2d4b637

8 files changed

+713
-0
lines changed

.gitignore

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
### JetBrains template
2+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4+
5+
# User-specific stuff
6+
.idea/**/workspace.xml
7+
.idea/**/tasks.xml
8+
.idea/**/usage.statistics.xml
9+
.idea/**/dictionaries
10+
.idea/**/shelf
11+
12+
# AWS User-specific
13+
.idea/**/aws.xml
14+
15+
# Generated files
16+
.idea/**/contentModel.xml
17+
18+
# Sensitive or high-churn files
19+
.idea/**/dataSources/
20+
.idea/**/dataSources.ids
21+
.idea/**/dataSources.local.xml
22+
.idea/**/sqlDataSources.xml
23+
.idea/**/dynamic.xml
24+
.idea/**/uiDesigner.xml
25+
.idea/**/dbnavigator.xml
26+
27+
# Gradle
28+
.idea/**/gradle.xml
29+
.idea/**/libraries
30+
31+
# Gradle and Maven with auto-import
32+
# When using Gradle or Maven with auto-import, you should exclude module files,
33+
# since they will be recreated, and may cause churn. Uncomment if using
34+
# auto-import.
35+
# .idea/artifacts
36+
# .idea/compiler.xml
37+
# .idea/jarRepositories.xml
38+
# .idea/modules.xml
39+
# .idea/*.iml
40+
# .idea/modules
41+
# *.iml
42+
# *.ipr
43+
44+
# CMake
45+
cmake-build-*/
46+
47+
# Mongo Explorer plugin
48+
.idea/**/mongoSettings.xml
49+
50+
# File-based project format
51+
*.iws
52+
53+
# IntelliJ
54+
out/
55+
56+
# mpeltonen/sbt-idea plugin
57+
.idea_modules/
58+
59+
# JIRA plugin
60+
atlassian-ide-plugin.xml
61+
62+
# Cursive Clojure plugin
63+
.idea/replstate.xml
64+
65+
# SonarLint plugin
66+
.idea/sonarlint/
67+
68+
# Crashlytics plugin (for Android Studio and IntelliJ)
69+
com_crashlytics_export_strings.xml
70+
crashlytics.properties
71+
crashlytics-build.properties
72+
fabric.properties
73+
74+
# Editor-based Rest Client
75+
.idea/httpRequests
76+
77+
# Android studio 3.1+ serialized cache file
78+
.idea/caches/build_file_checksums.ser
79+
80+
### macOS template
81+
# General
82+
.DS_Store
83+
.AppleDouble
84+
.LSOverride
85+
86+
# Icon must end with two \r
87+
Icon
88+
89+
# Thumbnails
90+
._*
91+
92+
# Files that might appear in the root of a volume
93+
.DocumentRevisions-V100
94+
.fseventsd
95+
.Spotlight-V100
96+
.TemporaryItems
97+
.Trashes
98+
.VolumeIcon.icns
99+
.com.apple.timemachine.donotpresent
100+
101+
# Directories potentially created on remote AFP share
102+
.AppleDB
103+
.AppleDesktop
104+
Network Trash Folder
105+
Temporary Items
106+
.apdisk
107+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 BE API
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# wp-cli-reduce-db-command
2+
3+
Reduce DB size for WP-CLI
4+
5+
This command allows you to significantly reduce the size of the WordPress database by removing non-essential data, revisions, transients, orphaned data, and keeping only the 500 most recent contents for each content type.
6+
7+
Data from the following plugins will be deleted:
8+
* Action Scheduler
9+
* Broken Link Checker
10+
* Cavalcade
11+
* Contact Form 7
12+
* FacetWP
13+
* FormidableForms
14+
* GDPR Cookie Consent
15+
* GravityForms
16+
* Log HTTP requests
17+
* Matomo
18+
* Redirection
19+
* SearchWP 3.x & 4.x
20+
* Stream
21+
* TA Links
22+
* ThirstyAffiliates
23+
* WP All Export
24+
* WP Cerber
25+
* WP Forms
26+
* WP Mail Log
27+
* WP Mail Logging
28+
* WP Rocket
29+
* WP Security Audit Log
30+
* WooCommerce
31+
* Yoast SEO
32+
* Yop Polls
33+
34+
## Installing
35+
36+
Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`.
37+
38+
Once you've done so, you can install this package with `wp package install BeAPI/wp-cli-reduce-db-command`
39+
You also can update your package with `wp package update`
40+
41+
## Usage
42+
43+
Start database cleanup
44+
45+
`wp reduce_db all`
46+
47+
## Credits
48+
49+
Based on https://github.com/BeAPI/wp-cli-light-db-export for the table/plugin list

command.php

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
if ( ! class_exists( 'WP_CLI' ) ) {
3+
return;
4+
}
5+
6+
require_once __DIR__ . '/src/wp-cli-reduce-db.php';

composer.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "beapi/wp-cli-reduce-db-command",
3+
"description": "This command allows you to significantly reduce the size of the WordPress database by removing non-essential data, revisions, transients, orphaned data, and keeping only the 500 most recent contents for each content type.",
4+
"type": "wp-cli-package",
5+
"homepage": "https://github.com/BeAPI/wp-cli-reduce-db-command",
6+
"license": "MIT",
7+
"require": {
8+
"php": ">=7.4"
9+
},
10+
"authors": [
11+
{
12+
"name": "Amaury BALMER",
13+
"email": "[email protected]"
14+
}
15+
],
16+
"minimum-stability": "dev",
17+
"autoload": {
18+
"files": [ "command.php" ]
19+
}
20+
}

composer.lock

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)