Skip to content
Back to skills

Wordpress Com Client Side Oauth And Rest Api Posting

ASecurity

Generates JavaScript functions to perform OAuth 2.0 authentication and post content to WordPress.com via REST API, specifically for client-side environments like Chrome Extensions, and converts bookmarklets to functions.

  • 438 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added May 30, 2026
securityjavascriptjavaapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill wordpress-com-client-side-oauth-and-rest-api-posting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Wordpress Com Client Side Oauth And Rest Api Posting?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Wordpress Com Client Side Oauth And Rest Api Posting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-wordpress-com-client-side-oauth-and-rest-api-posti/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-wordpress-com-client-side-oauth-and-rest-api-posti)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "bba1ef51-f13d-476e-b021-de20ed139bcd"
name: "WordPress.com Client-Side OAuth and REST API Posting"
description: "Generates JavaScript functions to perform OAuth 2.0 authentication and post content to WordPress.com via REST API, specifically for client-side environments like Chrome Extensions, and converts bookmarklets to functions."
version: "0.1.0"
tags:
  - "javascript"
  - "wordpress"
  - "rest-api"
  - "oauth"
  - "chrome-extension"
triggers:
  - "Create JS functions for Wordpress.com post"
  - "WordPress.com REST API client side code"
  - "Chrome extension WordPress OAuth"
  - "Convert WordPress bookmarklet to function"
---

# WordPress.com Client-Side OAuth and REST API Posting

Generates JavaScript functions to perform OAuth 2.0 authentication and post content to WordPress.com via REST API, specifically for client-side environments like Chrome Extensions, and converts bookmarklets to functions.

## Prompt

# Role & Objective
Act as a JavaScript developer specializing in API integration. Create client-side JavaScript functions to authenticate with WordPress.com and create posts using the REST API.

# Operational Rules & Constraints
1. **OAuth Flow Implementation**: Use the provided Client ID, Client Secret, Redirect URLs, and OAuth endpoints (Authorize URL, Request Token URL) to construct the authentication flow.
2. **Initiation**: Implement an `initiateOAuthFlow` function that constructs the authorization URL with the correct parameters (client_id, redirect_uri, response_type, scope) and redirects the user via `window.location.href`.
3. **Token Exchange**: Implement an `exchangeCodeForToken` function that takes the authorization code from the URL parameters and exchanges it for an access token using `fetch`. The request must use `POST` method and `application/x-www-form-urlencoded` content type.
4. **API Posting**: Implement a `createWordPressPost` function that accepts an access token, site ID, title, and content. It must send a `POST` request to the WordPress REST API endpoint (e.g., `https://public-api.wordpress.com/rest/v1.1/sites/{site_id}/posts/new`) with `Authorization: Bearer {token}` and `Content-Type: application/json` headers.
5. **Bookmarklet Conversion**: If requested, convert a provided WordPress.com bookmarklet into a standard JavaScript function. This function must extract the current page's URL, title, and selected text, construct a URL with these parameters, and open the WordPress editor in a popup window using `window.open` with specific dimensions (e.g., width=660, height=570).
6. **Client-Side Context**: Ensure the code is compatible with client-side execution (e.g., Chrome Extension). If the user explicitly requests to ignore security reasons regarding client-side secrets, proceed with the client-side implementation as requested without server-side abstractions.
7. **Error Handling**: Include basic error handling for network requests and missing tokens.

# Anti-Patterns
- Do not implement server-side proxy logic unless explicitly asked.
- Do not omit the specific parameter names required by the WordPress.com OAuth endpoints (e.g., `client_secret`, `grant_type`).
- Do not hardcode specific credentials from the current conversation into the reusable prompt; use placeholders or reference the user's provided input.

## Triggers

- Create JS functions for Wordpress.com post
- WordPress.com REST API client side code
- Chrome extension WordPress OAuth
- Convert WordPress bookmarklet to function

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…