aidevops 2.52.1 → 2.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/VERSION +1 -1
- package/aidevops.sh +15 -9
- package/package.json +4 -4
- package/scripts/npm-postinstall.js +6 -7
- package/setup.sh +1 -1
- package/templates/deploy-templates.sh +144 -0
- package/templates/home/.agent/README.md +33 -0
- package/templates/home/AGENTS.md +96 -0
- package/templates/home/git/.agent/README.md +48 -0
- package/templates/home/git/AGENTS.md +97 -0
- package/templates/standard-functions.sh +179 -0
- package/templates/wordpress-performance-workflow.md +217 -0
- package/.agent/AGENTS.md +0 -614
- package/.agent/accounts.md +0 -65
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +0 -456
- package/.agent/aidevops/api-integrations.md +0 -335
- package/.agent/aidevops/architecture.md +0 -510
- package/.agent/aidevops/configs.md +0 -274
- package/.agent/aidevops/docs.md +0 -244
- package/.agent/aidevops/extension.md +0 -311
- package/.agent/aidevops/mcp-integrations.md +0 -340
- package/.agent/aidevops/mcp-troubleshooting.md +0 -162
- package/.agent/aidevops/memory-patterns.md +0 -172
- package/.agent/aidevops/providers.md +0 -217
- package/.agent/aidevops/recommendations.md +0 -321
- package/.agent/aidevops/requirements.md +0 -301
- package/.agent/aidevops/resources.md +0 -214
- package/.agent/aidevops/security-requirements.md +0 -174
- package/.agent/aidevops/security.md +0 -350
- package/.agent/aidevops/service-links.md +0 -400
- package/.agent/aidevops/services.md +0 -357
- package/.agent/aidevops/setup.md +0 -153
- package/.agent/aidevops/troubleshooting.md +0 -389
- package/.agent/aidevops.md +0 -124
- package/.agent/build-plus.md +0 -244
- package/.agent/content/guidelines.md +0 -109
- package/.agent/content.md +0 -87
- package/.agent/health.md +0 -59
- package/.agent/legal.md +0 -59
- package/.agent/loop-state/full-loop.local.md +0 -16
- package/.agent/loop-state/ralph-loop.local.md +0 -10
- package/.agent/marketing.md +0 -440
- package/.agent/memory/README.md +0 -260
- package/.agent/onboarding.md +0 -796
- package/.agent/plan-plus.md +0 -245
- package/.agent/research.md +0 -100
- package/.agent/sales.md +0 -333
- package/.agent/scripts/101domains-helper.sh +0 -701
- package/.agent/scripts/add-missing-returns.sh +0 -140
- package/.agent/scripts/agent-browser-helper.sh +0 -311
- package/.agent/scripts/agno-setup.sh +0 -712
- package/.agent/scripts/ahrefs-mcp-wrapper.js +0 -168
- package/.agent/scripts/aidevops-update-check.sh +0 -71
- package/.agent/scripts/ampcode-cli.sh +0 -522
- package/.agent/scripts/auto-version-bump.sh +0 -156
- package/.agent/scripts/autogen-helper.sh +0 -512
- package/.agent/scripts/beads-sync-helper.sh +0 -596
- package/.agent/scripts/closte-helper.sh +0 -5
- package/.agent/scripts/cloudron-helper.sh +0 -321
- package/.agent/scripts/codacy-cli-chunked.sh +0 -581
- package/.agent/scripts/codacy-cli.sh +0 -442
- package/.agent/scripts/code-audit-helper.sh +0 -5
- package/.agent/scripts/coderabbit-cli.sh +0 -417
- package/.agent/scripts/coderabbit-pro-analysis.sh +0 -238
- package/.agent/scripts/commands/code-simplifier.md +0 -86
- package/.agent/scripts/commands/full-loop.md +0 -246
- package/.agent/scripts/commands/postflight-loop.md +0 -103
- package/.agent/scripts/commands/recall.md +0 -182
- package/.agent/scripts/commands/remember.md +0 -132
- package/.agent/scripts/commands/save-todo.md +0 -175
- package/.agent/scripts/commands/session-review.md +0 -154
- package/.agent/scripts/comprehensive-quality-fix.sh +0 -106
- package/.agent/scripts/context-builder-helper.sh +0 -522
- package/.agent/scripts/coolify-cli-helper.sh +0 -674
- package/.agent/scripts/coolify-helper.sh +0 -380
- package/.agent/scripts/crawl4ai-examples.sh +0 -401
- package/.agent/scripts/crawl4ai-helper.sh +0 -1078
- package/.agent/scripts/crewai-helper.sh +0 -681
- package/.agent/scripts/dev-browser-helper.sh +0 -513
- package/.agent/scripts/dns-helper.sh +0 -396
- package/.agent/scripts/domain-research-helper.sh +0 -917
- package/.agent/scripts/dspy-helper.sh +0 -285
- package/.agent/scripts/dspyground-helper.sh +0 -291
- package/.agent/scripts/eeat-score-helper.sh +0 -1242
- package/.agent/scripts/efficient-return-fix.sh +0 -92
- package/.agent/scripts/extract-opencode-prompts.sh +0 -128
- package/.agent/scripts/find-missing-returns.sh +0 -113
- package/.agent/scripts/fix-auth-headers.sh +0 -104
- package/.agent/scripts/fix-common-strings.sh +0 -254
- package/.agent/scripts/fix-content-type.sh +0 -100
- package/.agent/scripts/fix-error-messages.sh +0 -130
- package/.agent/scripts/fix-misplaced-returns.sh +0 -74
- package/.agent/scripts/fix-remaining-literals.sh +0 -152
- package/.agent/scripts/fix-return-statements.sh +0 -41
- package/.agent/scripts/fix-s131-default-cases.sh +0 -249
- package/.agent/scripts/fix-sc2155-simple.sh +0 -102
- package/.agent/scripts/fix-shellcheck-critical.sh +0 -187
- package/.agent/scripts/fix-string-literals.sh +0 -273
- package/.agent/scripts/full-loop-helper.sh +0 -773
- package/.agent/scripts/generate-opencode-agents.sh +0 -497
- package/.agent/scripts/generate-opencode-commands.sh +0 -1629
- package/.agent/scripts/generate-skills.sh +0 -366
- package/.agent/scripts/git-platforms-helper.sh +0 -640
- package/.agent/scripts/gitea-cli-helper.sh +0 -743
- package/.agent/scripts/github-cli-helper.sh +0 -702
- package/.agent/scripts/gitlab-cli-helper.sh +0 -682
- package/.agent/scripts/gsc-add-user-helper.sh +0 -325
- package/.agent/scripts/gsc-sitemap-helper.sh +0 -678
- package/.agent/scripts/hetzner-helper.sh +0 -485
- package/.agent/scripts/hostinger-helper.sh +0 -229
- package/.agent/scripts/keyword-research-helper.sh +0 -1815
- package/.agent/scripts/langflow-helper.sh +0 -544
- package/.agent/scripts/linkedin-automation.py +0 -241
- package/.agent/scripts/linter-manager.sh +0 -599
- package/.agent/scripts/linters-local.sh +0 -434
- package/.agent/scripts/list-keys-helper.sh +0 -488
- package/.agent/scripts/local-browser-automation.py +0 -339
- package/.agent/scripts/localhost-helper.sh +0 -744
- package/.agent/scripts/loop-common.sh +0 -806
- package/.agent/scripts/mainwp-helper.sh +0 -728
- package/.agent/scripts/markdown-formatter.sh +0 -338
- package/.agent/scripts/markdown-lint-fix.sh +0 -311
- package/.agent/scripts/mass-fix-returns.sh +0 -58
- package/.agent/scripts/mcp-diagnose.sh +0 -167
- package/.agent/scripts/mcp-inspector-helper.sh +0 -449
- package/.agent/scripts/memory-helper.sh +0 -650
- package/.agent/scripts/monitor-code-review.sh +0 -255
- package/.agent/scripts/onboarding-helper.sh +0 -706
- package/.agent/scripts/opencode-github-setup-helper.sh +0 -797
- package/.agent/scripts/opencode-test-helper.sh +0 -213
- package/.agent/scripts/pagespeed-helper.sh +0 -464
- package/.agent/scripts/pandoc-helper.sh +0 -362
- package/.agent/scripts/postflight-check.sh +0 -555
- package/.agent/scripts/pre-commit-hook.sh +0 -259
- package/.agent/scripts/pre-edit-check.sh +0 -169
- package/.agent/scripts/qlty-cli.sh +0 -356
- package/.agent/scripts/quality-cli-manager.sh +0 -525
- package/.agent/scripts/quality-feedback-helper.sh +0 -462
- package/.agent/scripts/quality-fix.sh +0 -263
- package/.agent/scripts/quality-loop-helper.sh +0 -1108
- package/.agent/scripts/ralph-loop-helper.sh +0 -836
- package/.agent/scripts/ralph-upstream-check.sh +0 -341
- package/.agent/scripts/secretlint-helper.sh +0 -847
- package/.agent/scripts/servers-helper.sh +0 -241
- package/.agent/scripts/ses-helper.sh +0 -619
- package/.agent/scripts/session-review-helper.sh +0 -404
- package/.agent/scripts/setup-linters-wizard.sh +0 -379
- package/.agent/scripts/setup-local-api-keys.sh +0 -330
- package/.agent/scripts/setup-mcp-integrations.sh +0 -472
- package/.agent/scripts/shared-constants.sh +0 -246
- package/.agent/scripts/site-crawler-helper.sh +0 -1487
- package/.agent/scripts/snyk-helper.sh +0 -940
- package/.agent/scripts/sonarcloud-autofix.sh +0 -193
- package/.agent/scripts/sonarcloud-cli.sh +0 -191
- package/.agent/scripts/sonarscanner-cli.sh +0 -455
- package/.agent/scripts/spaceship-helper.sh +0 -747
- package/.agent/scripts/stagehand-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-helper.sh +0 -321
- package/.agent/scripts/stagehand-python-setup.sh +0 -441
- package/.agent/scripts/stagehand-setup.sh +0 -439
- package/.agent/scripts/system-cleanup.sh +0 -340
- package/.agent/scripts/terminal-title-helper.sh +0 -388
- package/.agent/scripts/terminal-title-setup.sh +0 -549
- package/.agent/scripts/test-stagehand-both-integration.sh +0 -317
- package/.agent/scripts/test-stagehand-integration.sh +0 -309
- package/.agent/scripts/test-stagehand-python-integration.sh +0 -341
- package/.agent/scripts/todo-ready.sh +0 -263
- package/.agent/scripts/tool-version-check.sh +0 -362
- package/.agent/scripts/toon-helper.sh +0 -469
- package/.agent/scripts/twilio-helper.sh +0 -917
- package/.agent/scripts/updown-helper.sh +0 -279
- package/.agent/scripts/validate-mcp-integrations.sh +0 -250
- package/.agent/scripts/validate-version-consistency.sh +0 -131
- package/.agent/scripts/vaultwarden-helper.sh +0 -597
- package/.agent/scripts/vercel-cli-helper.sh +0 -816
- package/.agent/scripts/verify-mirrors.sh +0 -169
- package/.agent/scripts/version-manager.sh +0 -831
- package/.agent/scripts/webhosting-helper.sh +0 -471
- package/.agent/scripts/webhosting-verify.sh +0 -238
- package/.agent/scripts/wordpress-mcp-helper.sh +0 -508
- package/.agent/scripts/worktree-helper.sh +0 -595
- package/.agent/scripts/worktree-sessions.sh +0 -577
- package/.agent/seo/dataforseo.md +0 -215
- package/.agent/seo/domain-research.md +0 -532
- package/.agent/seo/eeat-score.md +0 -659
- package/.agent/seo/google-search-console.md +0 -366
- package/.agent/seo/gsc-sitemaps.md +0 -282
- package/.agent/seo/keyword-research.md +0 -521
- package/.agent/seo/serper.md +0 -278
- package/.agent/seo/site-crawler.md +0 -387
- package/.agent/seo.md +0 -236
- package/.agent/services/accounting/quickfile.md +0 -159
- package/.agent/services/communications/telfon.md +0 -470
- package/.agent/services/communications/twilio.md +0 -569
- package/.agent/services/crm/fluentcrm.md +0 -449
- package/.agent/services/email/ses.md +0 -399
- package/.agent/services/hosting/101domains.md +0 -378
- package/.agent/services/hosting/closte.md +0 -177
- package/.agent/services/hosting/cloudflare.md +0 -251
- package/.agent/services/hosting/cloudron.md +0 -478
- package/.agent/services/hosting/dns-providers.md +0 -335
- package/.agent/services/hosting/domain-purchasing.md +0 -344
- package/.agent/services/hosting/hetzner.md +0 -327
- package/.agent/services/hosting/hostinger.md +0 -287
- package/.agent/services/hosting/localhost.md +0 -419
- package/.agent/services/hosting/spaceship.md +0 -353
- package/.agent/services/hosting/webhosting.md +0 -330
- package/.agent/social-media.md +0 -69
- package/.agent/templates/plans-template.md +0 -114
- package/.agent/templates/prd-template.md +0 -129
- package/.agent/templates/tasks-template.md +0 -108
- package/.agent/templates/todo-template.md +0 -89
- package/.agent/tools/ai-assistants/agno.md +0 -471
- package/.agent/tools/ai-assistants/capsolver.md +0 -326
- package/.agent/tools/ai-assistants/configuration.md +0 -221
- package/.agent/tools/ai-assistants/overview.md +0 -209
- package/.agent/tools/ai-assistants/status.md +0 -171
- package/.agent/tools/ai-assistants/windsurf.md +0 -193
- package/.agent/tools/ai-orchestration/autogen.md +0 -406
- package/.agent/tools/ai-orchestration/crewai.md +0 -445
- package/.agent/tools/ai-orchestration/langflow.md +0 -405
- package/.agent/tools/ai-orchestration/openprose.md +0 -487
- package/.agent/tools/ai-orchestration/overview.md +0 -362
- package/.agent/tools/ai-orchestration/packaging.md +0 -647
- package/.agent/tools/browser/agent-browser.md +0 -464
- package/.agent/tools/browser/browser-automation.md +0 -400
- package/.agent/tools/browser/chrome-devtools.md +0 -282
- package/.agent/tools/browser/crawl4ai-integration.md +0 -422
- package/.agent/tools/browser/crawl4ai-resources.md +0 -277
- package/.agent/tools/browser/crawl4ai-usage.md +0 -416
- package/.agent/tools/browser/crawl4ai.md +0 -585
- package/.agent/tools/browser/dev-browser.md +0 -341
- package/.agent/tools/browser/pagespeed.md +0 -260
- package/.agent/tools/browser/playwright.md +0 -266
- package/.agent/tools/browser/playwriter.md +0 -310
- package/.agent/tools/browser/stagehand-examples.md +0 -456
- package/.agent/tools/browser/stagehand-python.md +0 -483
- package/.agent/tools/browser/stagehand.md +0 -421
- package/.agent/tools/build-agent/agent-review.md +0 -224
- package/.agent/tools/build-agent/build-agent.md +0 -784
- package/.agent/tools/build-mcp/aidevops-plugin.md +0 -476
- package/.agent/tools/build-mcp/api-wrapper.md +0 -445
- package/.agent/tools/build-mcp/build-mcp.md +0 -240
- package/.agent/tools/build-mcp/deployment.md +0 -401
- package/.agent/tools/build-mcp/server-patterns.md +0 -632
- package/.agent/tools/build-mcp/transports.md +0 -366
- package/.agent/tools/code-review/auditing.md +0 -383
- package/.agent/tools/code-review/automation.md +0 -219
- package/.agent/tools/code-review/best-practices.md +0 -203
- package/.agent/tools/code-review/codacy.md +0 -151
- package/.agent/tools/code-review/code-simplifier.md +0 -174
- package/.agent/tools/code-review/code-standards.md +0 -309
- package/.agent/tools/code-review/coderabbit.md +0 -101
- package/.agent/tools/code-review/management.md +0 -155
- package/.agent/tools/code-review/qlty.md +0 -248
- package/.agent/tools/code-review/secretlint.md +0 -565
- package/.agent/tools/code-review/setup.md +0 -250
- package/.agent/tools/code-review/snyk.md +0 -563
- package/.agent/tools/code-review/tools.md +0 -230
- package/.agent/tools/content/summarize.md +0 -353
- package/.agent/tools/context/augment-context-engine.md +0 -468
- package/.agent/tools/context/context-builder-agent.md +0 -76
- package/.agent/tools/context/context-builder.md +0 -375
- package/.agent/tools/context/context7.md +0 -371
- package/.agent/tools/context/dspy.md +0 -302
- package/.agent/tools/context/dspyground.md +0 -374
- package/.agent/tools/context/llm-tldr.md +0 -219
- package/.agent/tools/context/osgrep.md +0 -488
- package/.agent/tools/context/prompt-optimization.md +0 -338
- package/.agent/tools/context/toon.md +0 -292
- package/.agent/tools/conversion/pandoc.md +0 -304
- package/.agent/tools/credentials/api-key-management.md +0 -154
- package/.agent/tools/credentials/api-key-setup.md +0 -224
- package/.agent/tools/credentials/environment-variables.md +0 -180
- package/.agent/tools/credentials/vaultwarden.md +0 -382
- package/.agent/tools/data-extraction/outscraper.md +0 -974
- package/.agent/tools/deployment/coolify-cli.md +0 -388
- package/.agent/tools/deployment/coolify-setup.md +0 -353
- package/.agent/tools/deployment/coolify.md +0 -345
- package/.agent/tools/deployment/vercel.md +0 -390
- package/.agent/tools/git/authentication.md +0 -132
- package/.agent/tools/git/gitea-cli.md +0 -193
- package/.agent/tools/git/github-actions.md +0 -207
- package/.agent/tools/git/github-cli.md +0 -223
- package/.agent/tools/git/gitlab-cli.md +0 -190
- package/.agent/tools/git/opencode-github-security.md +0 -350
- package/.agent/tools/git/opencode-github.md +0 -328
- package/.agent/tools/git/opencode-gitlab.md +0 -252
- package/.agent/tools/git/security.md +0 -196
- package/.agent/tools/git.md +0 -207
- package/.agent/tools/opencode/oh-my-opencode.md +0 -375
- package/.agent/tools/opencode/opencode-anthropic-auth.md +0 -446
- package/.agent/tools/opencode/opencode.md +0 -651
- package/.agent/tools/social-media/bird.md +0 -437
- package/.agent/tools/task-management/beads.md +0 -336
- package/.agent/tools/terminal/terminal-title.md +0 -251
- package/.agent/tools/ui/shadcn.md +0 -196
- package/.agent/tools/ui/ui-skills.md +0 -115
- package/.agent/tools/wordpress/localwp.md +0 -311
- package/.agent/tools/wordpress/mainwp.md +0 -391
- package/.agent/tools/wordpress/scf.md +0 -527
- package/.agent/tools/wordpress/wp-admin.md +0 -729
- package/.agent/tools/wordpress/wp-dev.md +0 -940
- package/.agent/tools/wordpress/wp-preferred.md +0 -398
- package/.agent/tools/wordpress.md +0 -95
- package/.agent/workflows/branch/bugfix.md +0 -63
- package/.agent/workflows/branch/chore.md +0 -95
- package/.agent/workflows/branch/experiment.md +0 -115
- package/.agent/workflows/branch/feature.md +0 -59
- package/.agent/workflows/branch/hotfix.md +0 -98
- package/.agent/workflows/branch/refactor.md +0 -92
- package/.agent/workflows/branch/release.md +0 -96
- package/.agent/workflows/branch.md +0 -347
- package/.agent/workflows/bug-fixing.md +0 -267
- package/.agent/workflows/changelog.md +0 -129
- package/.agent/workflows/code-audit-remote.md +0 -279
- package/.agent/workflows/conversation-starter.md +0 -69
- package/.agent/workflows/error-feedback.md +0 -578
- package/.agent/workflows/feature-development.md +0 -355
- package/.agent/workflows/git-workflow.md +0 -702
- package/.agent/workflows/multi-repo-workspace.md +0 -268
- package/.agent/workflows/plans.md +0 -709
- package/.agent/workflows/postflight.md +0 -604
- package/.agent/workflows/pr.md +0 -571
- package/.agent/workflows/preflight.md +0 -278
- package/.agent/workflows/ralph-loop.md +0 -773
- package/.agent/workflows/release.md +0 -498
- package/.agent/workflows/session-manager.md +0 -254
- package/.agent/workflows/session-review.md +0 -311
- package/.agent/workflows/sql-migrations.md +0 -631
- package/.agent/workflows/version-bump.md +0 -283
- package/.agent/workflows/wiki-update.md +0 -333
- package/.agent/workflows/worktree.md +0 -477
|
@@ -1,728 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
|
|
3
|
-
|
|
4
|
-
# MainWP WordPress Management Helper Script
|
|
5
|
-
# Comprehensive WordPress site management for AI assistants
|
|
6
|
-
|
|
7
|
-
# Colors for output
|
|
8
|
-
# String literal constants
|
|
9
|
-
readonly ERROR_CONFIG_NOT_FOUND="Configuration file not found"
|
|
10
|
-
readonly ERROR_JQ_REQUIRED="jq is required but not installed"
|
|
11
|
-
readonly INFO_JQ_INSTALL_MACOS="Install with: brew install jq"
|
|
12
|
-
readonly INFO_JQ_INSTALL_UBUNTU="Install with: apt-get install jq"
|
|
13
|
-
readonly ERROR_CURL_REQUIRED="curl is required but not installed"
|
|
14
|
-
|
|
15
|
-
GREEN='\033[0;32m'
|
|
16
|
-
BLUE='\033[0;34m'
|
|
17
|
-
YELLOW='\033[1;33m'
|
|
18
|
-
RED='\033[0;31m'
|
|
19
|
-
NC='\033[0m' # No Color
|
|
20
|
-
|
|
21
|
-
# Common message constants
|
|
22
|
-
readonly HELP_SHOW_MESSAGE="Show this help"
|
|
23
|
-
readonly USAGE_COMMAND_OPTIONS="Usage: $0 <command> [options]"
|
|
24
|
-
|
|
25
|
-
# Common constants
|
|
26
|
-
readonly CONTENT_TYPE_JSON="$CONTENT_TYPE_JSON"
|
|
27
|
-
|
|
28
|
-
print_info() {
|
|
29
|
-
local msg="$1"
|
|
30
|
-
echo -e "${BLUE}[INFO]${NC} $msg"
|
|
31
|
-
return 0
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
print_success() {
|
|
35
|
-
local msg="$1"
|
|
36
|
-
echo -e "${GREEN}[SUCCESS]${NC} $msg"
|
|
37
|
-
return 0
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
print_warning() {
|
|
41
|
-
local msg="$1"
|
|
42
|
-
echo -e "${YELLOW}[WARNING]${NC} $msg"
|
|
43
|
-
return 0
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
print_error() {
|
|
47
|
-
local msg="$1"
|
|
48
|
-
echo -e "${RED}[ERROR]${NC} $msg" >&2
|
|
49
|
-
return 0
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
CONFIG_FILE="../configs/mainwp-config.json"
|
|
53
|
-
|
|
54
|
-
# Constants for repeated strings
|
|
55
|
-
readonly ERROR_SITE_ID_REQUIRED="Site ID is required"
|
|
56
|
-
readonly ERROR_AT_LEAST_ONE_SITE_ID="At least one site ID is required"
|
|
57
|
-
|
|
58
|
-
# Check dependencies
|
|
59
|
-
check_dependencies() {
|
|
60
|
-
if ! command -v curl &> /dev/null; then
|
|
61
|
-
print_error "$ERROR_CURL_REQUIRED"
|
|
62
|
-
exit 1
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
if ! command -v jq &> /dev/null; then
|
|
66
|
-
print_error "$ERROR_JQ_REQUIRED"
|
|
67
|
-
echo "$INFO_JQ_INSTALL_MACOS"
|
|
68
|
-
echo "$INFO_JQ_INSTALL_UBUNTU"
|
|
69
|
-
exit 1
|
|
70
|
-
fi
|
|
71
|
-
return 0
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
# Load configuration
|
|
75
|
-
load_config() {
|
|
76
|
-
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
77
|
-
print_error "$ERROR_CONFIG_NOT_FOUND"
|
|
78
|
-
print_info "Copy and customize: cp ../configs/mainwp-config.json.txt $CONFIG_FILE"
|
|
79
|
-
exit 1
|
|
80
|
-
fi
|
|
81
|
-
return 0
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
# Get instance configuration
|
|
85
|
-
get_instance_config() {
|
|
86
|
-
local instance_name="$command"
|
|
87
|
-
|
|
88
|
-
if [[ -z "$instance_name" ]]; then
|
|
89
|
-
print_error "Instance name is required"
|
|
90
|
-
list_instances
|
|
91
|
-
exit 1
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
local instance_config
|
|
95
|
-
instance_config=$(jq -r ".instances.\"$instance_name\"" "$CONFIG_FILE")
|
|
96
|
-
if [[ "$instance_config" == "null" ]]; then
|
|
97
|
-
print_error "Instance '$instance_name' not found in configuration"
|
|
98
|
-
list_instances
|
|
99
|
-
exit 1
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
|
-
echo "$instance_config"
|
|
103
|
-
return 0
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
# Make API request
|
|
107
|
-
api_request() {
|
|
108
|
-
local instance_name="$command"
|
|
109
|
-
local endpoint="$account_name"
|
|
110
|
-
local method="${3:-GET}"
|
|
111
|
-
local data="$options"
|
|
112
|
-
|
|
113
|
-
local config
|
|
114
|
-
config=$(get_instance_config "$instance_name")
|
|
115
|
-
local base_url
|
|
116
|
-
base_url=$(echo "$config" | jq -r '.base_url')
|
|
117
|
-
local consumer_key
|
|
118
|
-
consumer_key=$(echo "$config" | jq -r '.consumer_key')
|
|
119
|
-
local consumer_secret
|
|
120
|
-
consumer_secret=$(echo "$config" | jq -r '.consumer_secret')
|
|
121
|
-
|
|
122
|
-
if [[ "$base_url" == "null" || "$consumer_key" == "null" || "$consumer_secret" == "null" ]]; then
|
|
123
|
-
print_error "Invalid API credentials for instance '$instance_name'"
|
|
124
|
-
exit 1
|
|
125
|
-
fi
|
|
126
|
-
|
|
127
|
-
local url="$base_url/wp-json/mainwp/v1/$endpoint"
|
|
128
|
-
local auth_header="Authorization: Basic $(echo -n "$consumer_key:$consumer_secret" | base64)"
|
|
129
|
-
|
|
130
|
-
if [[ "$method" == "GET" ]]; then
|
|
131
|
-
curl -s -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
132
|
-
elif [[ "$method" == "POST" ]]; then
|
|
133
|
-
curl -s -X POST -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
134
|
-
elif [[ "$method" == "PUT" ]]; then
|
|
135
|
-
curl -s -X PUT -H "$auth_header" -H "$CONTENT_TYPE_JSON" -d "$data" "$url"
|
|
136
|
-
elif [[ "$method" == "DELETE" ]]; then
|
|
137
|
-
curl -s -X DELETE -H "$auth_header" -H "$CONTENT_TYPE_JSON" "$url"
|
|
138
|
-
fi
|
|
139
|
-
return 0
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
# List all configured instances
|
|
143
|
-
list_instances() {
|
|
144
|
-
load_config
|
|
145
|
-
print_info "Available MainWP instances:"
|
|
146
|
-
jq -r '.instances | keys[]' "$CONFIG_FILE" | while read -r instance; do
|
|
147
|
-
local description
|
|
148
|
-
description=$(jq -r ".instances.\"$instance\".description" "$CONFIG_FILE")
|
|
149
|
-
local base_url
|
|
150
|
-
base_url=$(jq -r ".instances.\"$instance\".base_url" "$CONFIG_FILE")
|
|
151
|
-
echo " - $instance ($base_url) - $description"
|
|
152
|
-
done
|
|
153
|
-
return 0
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
# List all managed sites
|
|
157
|
-
list_sites() {
|
|
158
|
-
local instance_name="$command"
|
|
159
|
-
|
|
160
|
-
print_info "Listing sites for MainWP instance: $instance_name"
|
|
161
|
-
local response
|
|
162
|
-
if response=$(api_request "$instance_name" "sites"); then
|
|
163
|
-
echo "$response" | jq -r '.[] | "\(.id): \(.name) - \(.url) (Status: \(.status))"'
|
|
164
|
-
return 0
|
|
165
|
-
else
|
|
166
|
-
print_error "Failed to retrieve sites"
|
|
167
|
-
echo "$response"
|
|
168
|
-
return 1
|
|
169
|
-
fi
|
|
170
|
-
return 0
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
# Get site details
|
|
174
|
-
get_site_details() {
|
|
175
|
-
local instance_name="$command"
|
|
176
|
-
local site_id="$account_name"
|
|
177
|
-
|
|
178
|
-
if [[ -z "$site_id" ]]; then
|
|
179
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
180
|
-
exit 1
|
|
181
|
-
fi
|
|
182
|
-
|
|
183
|
-
print_info "Getting details for site ID: $site_id"
|
|
184
|
-
local response
|
|
185
|
-
if response=$(api_request "$instance_name" "sites/$site_id"); then
|
|
186
|
-
echo "$response" | jq '.'
|
|
187
|
-
return 0
|
|
188
|
-
else
|
|
189
|
-
print_error "Failed to get site details"
|
|
190
|
-
echo "$response"
|
|
191
|
-
return 1
|
|
192
|
-
fi
|
|
193
|
-
return 0
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
# Get site status
|
|
197
|
-
get_site_status() {
|
|
198
|
-
local instance_name="$command"
|
|
199
|
-
local site_id="$account_name"
|
|
200
|
-
|
|
201
|
-
if [[ -z "$site_id" ]]; then
|
|
202
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
203
|
-
exit 1
|
|
204
|
-
fi
|
|
205
|
-
|
|
206
|
-
return 0
|
|
207
|
-
print_info "Getting status for site ID: $site_id"
|
|
208
|
-
local response
|
|
209
|
-
if response=$(api_request "$instance_name" "sites/$site_id/status"); then
|
|
210
|
-
echo "$response" | jq '.'
|
|
211
|
-
else
|
|
212
|
-
print_error "Failed to get site status"
|
|
213
|
-
echo "$response"
|
|
214
|
-
fi
|
|
215
|
-
return 0
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
# List plugins for a site
|
|
219
|
-
list_site_plugins() {
|
|
220
|
-
return 0
|
|
221
|
-
local instance_name="$command"
|
|
222
|
-
local site_id="$account_name"
|
|
223
|
-
|
|
224
|
-
if [[ -z "$site_id" ]]; then
|
|
225
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
226
|
-
exit 1
|
|
227
|
-
fi
|
|
228
|
-
return 0
|
|
229
|
-
|
|
230
|
-
print_info "Listing plugins for site ID: $site_id"
|
|
231
|
-
local response
|
|
232
|
-
if response=$(api_request "$instance_name" "sites/$site_id/plugins"); then
|
|
233
|
-
echo "$response" | jq -r '.[] | "\(.name) - Version: \(.version) (Status: \(.status))"'
|
|
234
|
-
else
|
|
235
|
-
print_error "Failed to retrieve plugins"
|
|
236
|
-
echo "$response"
|
|
237
|
-
fi
|
|
238
|
-
return 0
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return 0
|
|
242
|
-
# List themes for a site
|
|
243
|
-
list_site_themes() {
|
|
244
|
-
local instance_name="$command"
|
|
245
|
-
local site_id="$account_name"
|
|
246
|
-
|
|
247
|
-
if [[ -z "$site_id" ]]; then
|
|
248
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
249
|
-
exit 1
|
|
250
|
-
return 0
|
|
251
|
-
fi
|
|
252
|
-
|
|
253
|
-
print_info "Listing themes for site ID: $site_id"
|
|
254
|
-
local response
|
|
255
|
-
if response=$(api_request "$instance_name" "sites/$site_id/themes"); then
|
|
256
|
-
echo "$response" | jq -r '.[] | "\(.name) - Version: \(.version) (Status: \(.status))"'
|
|
257
|
-
else
|
|
258
|
-
print_error "Failed to retrieve themes"
|
|
259
|
-
echo "$response"
|
|
260
|
-
fi
|
|
261
|
-
return 0
|
|
262
|
-
}
|
|
263
|
-
return 0
|
|
264
|
-
|
|
265
|
-
# Update WordPress core for a site
|
|
266
|
-
update_wordpress_core() {
|
|
267
|
-
local instance_name="$command"
|
|
268
|
-
local site_id="$account_name"
|
|
269
|
-
|
|
270
|
-
if [[ -z "$site_id" ]]; then
|
|
271
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
272
|
-
exit 1
|
|
273
|
-
return 0
|
|
274
|
-
fi
|
|
275
|
-
|
|
276
|
-
print_info "Updating WordPress core for site ID: $site_id"
|
|
277
|
-
local response
|
|
278
|
-
if response=$(api_request "$instance_name" "sites/$site_id/update-core" "POST"); then
|
|
279
|
-
print_success "WordPress core update initiated"
|
|
280
|
-
echo "$response" | jq '.'
|
|
281
|
-
else
|
|
282
|
-
print_error "Failed to update WordPress core"
|
|
283
|
-
echo "$response"
|
|
284
|
-
return 0
|
|
285
|
-
fi
|
|
286
|
-
return 0
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
# Update all plugins for a site
|
|
290
|
-
update_site_plugins() {
|
|
291
|
-
local instance_name="$command"
|
|
292
|
-
local site_id="$account_name"
|
|
293
|
-
|
|
294
|
-
if [[ -z "$site_id" ]]; then
|
|
295
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
296
|
-
exit 1
|
|
297
|
-
fi
|
|
298
|
-
|
|
299
|
-
print_info "Updating all plugins for site ID: $site_id"
|
|
300
|
-
local response
|
|
301
|
-
if response=$(api_request "$instance_name" "sites/$site_id/update-plugins" "POST"); then
|
|
302
|
-
print_success "Plugin updates initiated"
|
|
303
|
-
echo "$response" | jq '.'
|
|
304
|
-
else
|
|
305
|
-
print_error "Failed to update plugins"
|
|
306
|
-
echo "$response"
|
|
307
|
-
fi
|
|
308
|
-
return 0
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
# Update specific plugin
|
|
312
|
-
update_specific_plugin() {
|
|
313
|
-
local instance_name="$command"
|
|
314
|
-
local site_id="$account_name"
|
|
315
|
-
local plugin_slug="$target"
|
|
316
|
-
|
|
317
|
-
if [[ -z "$site_id" || -z "$plugin_slug" ]]; then
|
|
318
|
-
print_error "Site ID and plugin slug are required"
|
|
319
|
-
exit 1
|
|
320
|
-
return 0
|
|
321
|
-
fi
|
|
322
|
-
|
|
323
|
-
local data
|
|
324
|
-
data=$(jq -n --arg plugin "$plugin_slug" '{plugin: $plugin}')
|
|
325
|
-
|
|
326
|
-
print_info "Updating plugin '$plugin_slug' for site ID: $site_id"
|
|
327
|
-
local response
|
|
328
|
-
if response=$(api_request "$instance_name" "sites/$site_id/update-plugin" "POST" "$data"); then
|
|
329
|
-
print_success "Plugin update initiated"
|
|
330
|
-
echo "$response" | jq '.'
|
|
331
|
-
else
|
|
332
|
-
print_error "Failed to update plugin"
|
|
333
|
-
return 0
|
|
334
|
-
echo "$response"
|
|
335
|
-
fi
|
|
336
|
-
return 0
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
# Create backup for a site
|
|
340
|
-
create_backup() {
|
|
341
|
-
local instance_name="$command"
|
|
342
|
-
local site_id="$account_name"
|
|
343
|
-
local backup_type="${3:-full}"
|
|
344
|
-
|
|
345
|
-
if [[ -z "$site_id" ]]; then
|
|
346
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
347
|
-
return 0
|
|
348
|
-
exit 1
|
|
349
|
-
fi
|
|
350
|
-
|
|
351
|
-
local data
|
|
352
|
-
data=$(jq -n --arg type "$backup_type" '{type: $type}')
|
|
353
|
-
|
|
354
|
-
print_info "Creating $backup_type backup for site ID: $site_id"
|
|
355
|
-
return 0
|
|
356
|
-
local response
|
|
357
|
-
if response=$(api_request "$instance_name" "sites/$site_id/backup" "POST" "$data"); then
|
|
358
|
-
print_success "Backup initiated"
|
|
359
|
-
echo "$response" | jq '.'
|
|
360
|
-
else
|
|
361
|
-
print_error "Failed to create backup"
|
|
362
|
-
echo "$response"
|
|
363
|
-
fi
|
|
364
|
-
return 0
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
# List backups for a site
|
|
368
|
-
list_backups() {
|
|
369
|
-
local instance_name="$command"
|
|
370
|
-
return 0
|
|
371
|
-
local site_id="$account_name"
|
|
372
|
-
|
|
373
|
-
if [[ -z "$site_id" ]]; then
|
|
374
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
375
|
-
exit 1
|
|
376
|
-
return 0
|
|
377
|
-
fi
|
|
378
|
-
|
|
379
|
-
print_info "Listing backups for site ID: $site_id"
|
|
380
|
-
local response
|
|
381
|
-
if response=$(api_request "$instance_name" "sites/$site_id/backups"); then
|
|
382
|
-
echo "$response" | jq -r '.[] | "\(.date): \(.type) - Size: \(.size) (Status: \(.status))"'
|
|
383
|
-
else
|
|
384
|
-
print_error "Failed to retrieve backups"
|
|
385
|
-
echo "$response"
|
|
386
|
-
fi
|
|
387
|
-
return 0
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
# Get site uptime monitoring
|
|
391
|
-
get_uptime_status() {
|
|
392
|
-
return 0
|
|
393
|
-
local instance_name="$command"
|
|
394
|
-
local site_id="$account_name"
|
|
395
|
-
|
|
396
|
-
if [[ -z "$site_id" ]]; then
|
|
397
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
398
|
-
return 0
|
|
399
|
-
exit 1
|
|
400
|
-
fi
|
|
401
|
-
|
|
402
|
-
print_info "Getting uptime status for site ID: $site_id"
|
|
403
|
-
local response
|
|
404
|
-
if response=$(api_request "$instance_name" "sites/$site_id/uptime"); then
|
|
405
|
-
echo "$response" | jq '.'
|
|
406
|
-
else
|
|
407
|
-
print_error "Failed to get uptime status"
|
|
408
|
-
echo "$response"
|
|
409
|
-
fi
|
|
410
|
-
return 0
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
# Run security scan
|
|
414
|
-
run_security_scan() {
|
|
415
|
-
return 0
|
|
416
|
-
local instance_name="$command"
|
|
417
|
-
local site_id="$account_name"
|
|
418
|
-
|
|
419
|
-
return 0
|
|
420
|
-
if [[ -z "$site_id" ]]; then
|
|
421
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
422
|
-
exit 1
|
|
423
|
-
fi
|
|
424
|
-
|
|
425
|
-
print_info "Running security scan for site ID: $site_id"
|
|
426
|
-
local response
|
|
427
|
-
if response=$(api_request "$instance_name" "sites/$site_id/security-scan" "POST"); then
|
|
428
|
-
print_success "Security scan initiated"
|
|
429
|
-
echo "$response" | jq '.'
|
|
430
|
-
else
|
|
431
|
-
print_error "Failed to run security scan"
|
|
432
|
-
echo "$response"
|
|
433
|
-
fi
|
|
434
|
-
return 0
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
return 0
|
|
438
|
-
# Get security scan results
|
|
439
|
-
get_security_scan_results() {
|
|
440
|
-
local instance_name="$command"
|
|
441
|
-
return 0
|
|
442
|
-
local site_id="$account_name"
|
|
443
|
-
|
|
444
|
-
if [[ -z "$site_id" ]]; then
|
|
445
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
446
|
-
exit 1
|
|
447
|
-
fi
|
|
448
|
-
|
|
449
|
-
print_info "Getting security scan results for site ID: $site_id"
|
|
450
|
-
local response
|
|
451
|
-
if response=$(api_request "$instance_name" "sites/$site_id/security-results"); then
|
|
452
|
-
echo "$response" | jq '.'
|
|
453
|
-
else
|
|
454
|
-
print_error "Failed to get security scan results"
|
|
455
|
-
echo "$response"
|
|
456
|
-
fi
|
|
457
|
-
return 0
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
return 0
|
|
461
|
-
# Sync site data
|
|
462
|
-
return 0
|
|
463
|
-
sync_site() {
|
|
464
|
-
local instance_name="$command"
|
|
465
|
-
local site_id="$account_name"
|
|
466
|
-
|
|
467
|
-
if [[ -z "$site_id" ]]; then
|
|
468
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
469
|
-
exit 1
|
|
470
|
-
fi
|
|
471
|
-
|
|
472
|
-
print_info "Syncing site data for site ID: $site_id"
|
|
473
|
-
local response
|
|
474
|
-
if response=$(api_request "$instance_name" "sites/$site_id/sync" "POST"); then
|
|
475
|
-
print_success "Site sync initiated"
|
|
476
|
-
echo "$response" | jq '.'
|
|
477
|
-
else
|
|
478
|
-
print_error "Failed to sync site"
|
|
479
|
-
echo "$response"
|
|
480
|
-
fi
|
|
481
|
-
return 0
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
# Bulk operations on multiple sites
|
|
485
|
-
bulk_update_wordpress() {
|
|
486
|
-
local instance_name="$command"
|
|
487
|
-
shift
|
|
488
|
-
local site_ids=("$@")
|
|
489
|
-
|
|
490
|
-
if [[ ${#site_ids[@]} -eq 0 ]]; then
|
|
491
|
-
print_error "$ERROR_AT_LEAST_ONE_SITE_ID"
|
|
492
|
-
exit 1
|
|
493
|
-
fi
|
|
494
|
-
|
|
495
|
-
print_info "Performing bulk WordPress core updates on ${#site_ids[@]} sites"
|
|
496
|
-
|
|
497
|
-
for site_id in "${site_ids[@]}"; do
|
|
498
|
-
print_info "Updating site ID: $site_id"
|
|
499
|
-
update_wordpress_core "$instance_name" "$site_id"
|
|
500
|
-
sleep 2 # Rate limiting
|
|
501
|
-
done
|
|
502
|
-
return 0
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
# Bulk plugin updates
|
|
506
|
-
bulk_update_plugins() {
|
|
507
|
-
local instance_name="$command"
|
|
508
|
-
shift
|
|
509
|
-
local site_ids=("$@")
|
|
510
|
-
|
|
511
|
-
if [[ ${#site_ids[@]} -eq 0 ]]; then
|
|
512
|
-
print_error "$ERROR_AT_LEAST_ONE_SITE_ID"
|
|
513
|
-
exit 1
|
|
514
|
-
return 0
|
|
515
|
-
fi
|
|
516
|
-
|
|
517
|
-
print_info "Performing bulk plugin updates on ${#site_ids[@]} sites"
|
|
518
|
-
|
|
519
|
-
for site_id in "${site_ids[@]}"; do
|
|
520
|
-
print_info "Updating plugins for site ID: $site_id"
|
|
521
|
-
update_site_plugins "$instance_name" "$site_id"
|
|
522
|
-
sleep 2 # Rate limiting
|
|
523
|
-
done
|
|
524
|
-
return 0
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
# Monitor all sites
|
|
528
|
-
monitor_all_sites() {
|
|
529
|
-
local instance_name="$command"
|
|
530
|
-
|
|
531
|
-
print_info "Monitoring all sites for MainWP instance: $instance_name"
|
|
532
|
-
echo ""
|
|
533
|
-
|
|
534
|
-
print_info "=== SITE STATUS OVERVIEW ==="
|
|
535
|
-
return 0
|
|
536
|
-
local sites_response
|
|
537
|
-
if sites_response=$(api_request "$instance_name" "sites"); then
|
|
538
|
-
echo "$sites_response" | jq -r '.[] | "\(.id): \(.name) - \(.url) (Status: \(.status), WP: \(.wp_version))"'
|
|
539
|
-
else
|
|
540
|
-
print_error "Failed to retrieve sites overview"
|
|
541
|
-
return 1
|
|
542
|
-
fi
|
|
543
|
-
|
|
544
|
-
return 0
|
|
545
|
-
echo ""
|
|
546
|
-
print_info "=== SITES NEEDING UPDATES ==="
|
|
547
|
-
|
|
548
|
-
# Check each site for available updates
|
|
549
|
-
echo "$sites_response" | jq -r '.[].id' | while read -r site_id; do
|
|
550
|
-
local site_status
|
|
551
|
-
site_status=$(api_request "$instance_name" "sites/$site_id/status")
|
|
552
|
-
local updates_available
|
|
553
|
-
updates_available=$(echo "$site_status" | jq -r '.updates_available // 0')
|
|
554
|
-
|
|
555
|
-
if [[ "$updates_available" -gt 0 ]]; then
|
|
556
|
-
local site_name
|
|
557
|
-
site_name=$(echo "$sites_response" | jq -r ".[] | select(.id == $site_id) | .name")
|
|
558
|
-
echo "Site ID $site_id ($site_name): $updates_available updates available"
|
|
559
|
-
fi
|
|
560
|
-
done
|
|
561
|
-
return 0
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
# Audit site security
|
|
565
|
-
audit_site_security() {
|
|
566
|
-
local instance_name="$command"
|
|
567
|
-
local site_id="$account_name"
|
|
568
|
-
|
|
569
|
-
return 0
|
|
570
|
-
if [[ -z "$site_id" ]]; then
|
|
571
|
-
print_error "$ERROR_SITE_ID_REQUIRED"
|
|
572
|
-
exit 1
|
|
573
|
-
fi
|
|
574
|
-
|
|
575
|
-
print_info "Security audit for site ID: $site_id"
|
|
576
|
-
echo ""
|
|
577
|
-
|
|
578
|
-
print_info "=== SITE DETAILS ==="
|
|
579
|
-
get_site_details "$instance_name" "$site_id"
|
|
580
|
-
echo ""
|
|
581
|
-
|
|
582
|
-
print_info "=== SECURITY SCAN RESULTS ==="
|
|
583
|
-
get_security_scan_results "$instance_name" "$site_id"
|
|
584
|
-
echo ""
|
|
585
|
-
|
|
586
|
-
print_info "=== PLUGIN STATUS ==="
|
|
587
|
-
list_site_plugins "$instance_name" "$site_id"
|
|
588
|
-
echo ""
|
|
589
|
-
|
|
590
|
-
print_info "=== THEME STATUS ==="
|
|
591
|
-
list_site_themes "$instance_name" "$site_id"
|
|
592
|
-
return 0
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
# Show help
|
|
596
|
-
show_help() {
|
|
597
|
-
echo "MainWP WordPress Management Helper Script"
|
|
598
|
-
echo "Usage: $0 [command] [instance] [options]"
|
|
599
|
-
echo ""
|
|
600
|
-
echo "Commands:"
|
|
601
|
-
echo " instances - List all configured MainWP instances"
|
|
602
|
-
echo " sites [instance] - List all managed sites"
|
|
603
|
-
echo " site-details [instance] [site_id] - Get site details"
|
|
604
|
-
echo " site-status [instance] [site_id] - Get site status"
|
|
605
|
-
echo " plugins [instance] [site_id] - List site plugins"
|
|
606
|
-
echo " themes [instance] [site_id] - List site themes"
|
|
607
|
-
echo " update-core [instance] [site_id] - Update WordPress core"
|
|
608
|
-
echo " update-plugins [instance] [site_id] - Update all plugins"
|
|
609
|
-
echo " update-plugin [instance] [site_id] [slug] - Update specific plugin"
|
|
610
|
-
echo " backup [instance] [site_id] [type] - Create backup (full/db/files)"
|
|
611
|
-
echo " backups [instance] [site_id] - List backups"
|
|
612
|
-
echo " uptime [instance] [site_id] - Get uptime status"
|
|
613
|
-
echo " security-scan [instance] [site_id] - Run security scan"
|
|
614
|
-
echo " security-results [instance] [site_id] - Get security scan results"
|
|
615
|
-
echo " sync [instance] [site_id] - Sync site data"
|
|
616
|
-
echo " bulk-update-wp [instance] [site_id1] [site_id2...] - Bulk WordPress updates"
|
|
617
|
-
echo " bulk-update-plugins [instance] [site_id1] [site_id2...] - Bulk plugin updates"
|
|
618
|
-
echo " monitor [instance] - Monitor all sites"
|
|
619
|
-
echo " audit-security [instance] [site_id] - Comprehensive security audit"
|
|
620
|
-
echo " help - $HELP_SHOW_MESSAGE"
|
|
621
|
-
echo ""
|
|
622
|
-
echo "Examples:"
|
|
623
|
-
echo " $0 instances"
|
|
624
|
-
echo " $0 sites production"
|
|
625
|
-
echo " $0 site-details production 123"
|
|
626
|
-
echo " $0 update-core production 123"
|
|
627
|
-
echo " $0 backup production 123 full"
|
|
628
|
-
echo " $0 monitor production"
|
|
629
|
-
echo " $0 bulk-update-wp production 123 124 125"
|
|
630
|
-
return 0
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
# Main script logic
|
|
634
|
-
main() {
|
|
635
|
-
# Assign positional parameters to local variables
|
|
636
|
-
local command="${1:-help}"
|
|
637
|
-
local account_name="$account_name"
|
|
638
|
-
local target="$target"
|
|
639
|
-
local options="$options"
|
|
640
|
-
# Assign positional parameters to local variables
|
|
641
|
-
local command="${1:-help}"
|
|
642
|
-
local account_name="$account_name"
|
|
643
|
-
local target="$target"
|
|
644
|
-
local options="$options"
|
|
645
|
-
# Assign positional parameters to local variables
|
|
646
|
-
local command="${1:-help}"
|
|
647
|
-
local account_name="$account_name"
|
|
648
|
-
local target="$target"
|
|
649
|
-
local options="$options"
|
|
650
|
-
# Assign positional parameters to local variables
|
|
651
|
-
# Assign positional parameters to local variables
|
|
652
|
-
local instance_name="$account_name"
|
|
653
|
-
local site_id="$target"
|
|
654
|
-
local plugin_name="$options"
|
|
655
|
-
local backup_name="$param6"
|
|
656
|
-
|
|
657
|
-
check_dependencies
|
|
658
|
-
|
|
659
|
-
case "$command" in
|
|
660
|
-
"instances")
|
|
661
|
-
list_instances
|
|
662
|
-
;;
|
|
663
|
-
"sites")
|
|
664
|
-
list_sites "$instance_name"
|
|
665
|
-
;;
|
|
666
|
-
"site-details")
|
|
667
|
-
get_site_details "$instance_name" "$site_id"
|
|
668
|
-
;;
|
|
669
|
-
"site-status")
|
|
670
|
-
get_site_status "$instance_name" "$site_id"
|
|
671
|
-
;;
|
|
672
|
-
"plugins")
|
|
673
|
-
list_site_plugins "$instance_name" "$site_id"
|
|
674
|
-
;;
|
|
675
|
-
"themes")
|
|
676
|
-
list_site_themes "$instance_name" "$site_id"
|
|
677
|
-
;;
|
|
678
|
-
"update-core")
|
|
679
|
-
update_wordpress_core "$instance_name" "$site_id"
|
|
680
|
-
;;
|
|
681
|
-
"update-plugins")
|
|
682
|
-
update_site_plugins "$instance_name" "$site_id"
|
|
683
|
-
;;
|
|
684
|
-
"update-plugin")
|
|
685
|
-
update_specific_plugin "$instance_name" "$site_id" "$plugin_name"
|
|
686
|
-
;;
|
|
687
|
-
"backup")
|
|
688
|
-
create_backup "$instance_name" "$site_id" "$backup_name"
|
|
689
|
-
;;
|
|
690
|
-
"backups")
|
|
691
|
-
list_backups "$instance_name" "$site_id"
|
|
692
|
-
;;
|
|
693
|
-
"uptime")
|
|
694
|
-
get_uptime_status "$instance_name" "$site_id"
|
|
695
|
-
;;
|
|
696
|
-
"security-scan")
|
|
697
|
-
run_security_scan "$instance_name" "$site_id"
|
|
698
|
-
;;
|
|
699
|
-
"security-results")
|
|
700
|
-
get_security_scan_results "$instance_name" "$site_id"
|
|
701
|
-
;;
|
|
702
|
-
"sync")
|
|
703
|
-
sync_site "$instance_name" "$site_id"
|
|
704
|
-
;;
|
|
705
|
-
"bulk-update-wp")
|
|
706
|
-
shift 2
|
|
707
|
-
bulk_update_wordpress "$instance_name" "$@"
|
|
708
|
-
;;
|
|
709
|
-
"bulk-update-plugins")
|
|
710
|
-
shift 2
|
|
711
|
-
bulk_update_plugins "$instance_name" "$@"
|
|
712
|
-
;;
|
|
713
|
-
"monitor")
|
|
714
|
-
monitor_all_sites "$param2"
|
|
715
|
-
;;
|
|
716
|
-
"audit-security")
|
|
717
|
-
audit_site_security "$param2" "$param3"
|
|
718
|
-
;;
|
|
719
|
-
"help"|*)
|
|
720
|
-
show_help
|
|
721
|
-
;;
|
|
722
|
-
esac
|
|
723
|
-
return 0
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
main "$@"
|
|
727
|
-
|
|
728
|
-
return 0
|