← 返回
未分类

Wp Login

Automates WordPress login using WP_URL, WP_USER, and WP_PASSWORD environment variables and reports success or failure.
使用 WP_URL、WP_USER 和 WP_PASSWORD 环境变量自动登录 WordPress,并报告成功或失败。
mikoboulot
未分类 clawhub v1.0.0 1 版本 99428.6 Key: 无需
★ 0
Stars
📥 174
下载
💾 0
安装
1
版本
#latest

概述

wp-login Skill

This skill automates WordPress login using the environment variables:

  • WP_URL - WordPress site URL
  • WP_USER - Username
  • WP_PASSWORD - Password

Usage

The skill script will use these environment variables to perform a login to the WordPress site.

Description

The skill should support:

  • Automating the login process to the WordPress site
  • Handling login success/failure

Implementation

Implementation details can include using HTTP requests or browser automation to perform the login.


Below is an example script outline for the wp-login skill in Node.js:

const axios = require('axios');
const qs = require('qs');

async function wpLogin() {
  const url = process.env.WP_URL;
  const user = process.env.WP_USER;
  const password = process.env.WP_PASSWORD;
  if (!url || !user || !password) {
    throw new Error('Missing WP_URL, WP_USER, or WP_PASSWORD environment variables');
  }

  // WordPress login endpoint
  const loginUrl = `${url.replace(/\/$/, '')}/wp-login.php`;

  // Prepare login form data
  const data = qs.stringify({
    log: user,
    pwd: password,
    wp-submit: 'Log In',
    redirect_to: `${url.replace(/\/$/, '')}/wp-admin/`,
    testcookie: 1
  });

  try {
    // Send login POST request
    const response = await axios.post(loginUrl, data, {
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      maxRedirects: 0,
      validateStatus: status => status === 302 // Expect redirect on success
    });

    if (response.status === 302) {
      console.log('Login successful');
      return true;
    } else {
      console.error('Login failed');
      return false;
    }
  } catch (err) {
    console.error('Error during login:', err.message);
    return false;
  }
}

module.exports = { wpLogin };

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-20 06:11 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,586
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,135
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,219 📥 266,932