Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ Repos below are my WordPress plugins hosted here at GitHub. Easy to install, and
<tr>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/additional-javascript">Additional Javascript</a></dt>
<dt><a href="https://github.com/soderlind/additional-javascript">Additional Javascript</a> ⭐ 4</dt>
<dd>Use WordPress Customizer to add JavaScript</dd>
</dl>
</td>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/all-sites-cron">All Sites Cron</a></dt>
<dt><a href="https://github.com/soderlind/all-sites-cron">All Sites Cron</a> ⭐ 7</dt>
<dd>Run wp-cron on all public sites in a multisite network</dd>
</dl>
</td>
</tr>
<tr>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/content-poll">Content Poll</a></dt>
<dt><a href="https://github.com/soderlind/content-poll">Content Poll</a> ⭐ 2</dt>
<dd>A modern, accessible polling block that lets visitors vote on questions about your content</dd>
</dl>
</td>
Expand All @@ -41,41 +41,41 @@ Repos below are my WordPress plugins hosted here at GitHub. Easy to install, and
<tr>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/editor-can-manage-privacy-options">Editor Can Manage Privacy Options</a></dt>
<dt><a href="https://github.com/soderlind/editor-can-manage-privacy-options">Editor Can Manage Privacy Options</a> ⭐ 1</dt>
<dd>A lightweight WordPress plugin that grants the Editor role access to manage site Privacy Settings — capabilities normally restricted to Administrators.</dd>
</dl>
</td>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/multisite-exporter">Multisite Exporter</a></dt>
<dt><a href="https://github.com/soderlind/multisite-exporter">Multisite Exporter</a> ⭐ 5</dt>
<dd>Multisite Exporter is a WordPress plugin that allows you to export content from all subsites in a WordPress multisite installation. The plugin generates WordPress XML (WXR) files by running the WordPress exporter on each subsite in the background using the Action Scheduler library, making it efficient even for large multisite networks.</dd>
</dl>
</td>
</tr>
<tr>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/read-offline">Read Offline</a></dt>
<dt><a href="https://github.com/soderlind/read-offline">Read Offline</a> ⭐ 33</dt>
<dd>Read Offline allows you to download posts and pages. You can download the post as PDF, ePub and markdown</dd>
</dl>
</td>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/redis-queue">Redis Queue</a></dt>
<dt><a href="https://github.com/soderlind/redis-queue">Redis Queue</a> ⭐ 1</dt>
<dd>Robust Redis-backed background job processing for WordPress. Provides prioritized, delayed, and retryable jobs with an admin UI, REST API, token-based auth (scopes + rate limiting), and extensibility for custom job types.</dd>
</dl>
</td>
</tr>
<tr>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/super-admin-switch-to-admin">Super Admin Switch To Admin</a></dt>
<dt><a href="https://github.com/soderlind/super-admin-switch-to-admin">Super Admin Switch To Admin</a> ⭐ 7</dt>
<dd>If you are logged in as a super admin, this plugin allows you to switch to a regular admin account on the current site.</dd>
</dl>
</td>
<td valign="top" width="50%">
<dl>
<dt><a href="https://github.com/soderlind/wp-loupe">Wp Loupe</a></dt>
<dt><a href="https://github.com/soderlind/wp-loupe">Wp Loupe</a> ⭐ 79</dt>
<dd>WP Loupe is a powerful search enhancement plugin for WordPress that delivers fast, accurate, and typo-tolerant search results.</dd>
</dl>
</td>
Expand Down
25 changes: 17 additions & 8 deletions update_plugins_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def extract_repo_info(url):
return parts[-2], parts[-1]


def fetch_repo_description(owner, repo, token):
"""Fetch repository description from GitHub API."""
def fetch_repo_info(owner, repo, token):
"""Fetch repository description and stars from GitHub API."""
headers = {}
if token:
headers["Authorization"] = f"Bearer {token}"
Expand All @@ -40,8 +40,11 @@ def fetch_repo_description(owner, repo, token):

if response.status_code == 200:
data = response.json()
return data.get("description", "") or ""
return ""
return {
"description": data.get("description", "") or "",
"stars": data.get("stargazers_count", 0)
}
return {"description": "", "stars": 0}


def format_repo_name(repo_name):
Expand All @@ -59,9 +62,11 @@ def generate_html_table(repos):
for j in range(2):
if i + j < len(repos):
repo = repos[i + j]
stars = repo.get("stars", 0)
stars_text = f" ⭐ {stars}" if stars > 0 else ""
cell = (
f'<dl>\n'
f'<dt><a href="{repo["url"]}">{repo["name"]}</a></dt>\n'
f'<dt><a href="{repo["url"]}">{repo["name"]}</a>{stars_text}</dt>\n'
f'<dd>{repo["description"]}</dd>\n'
f'</dl>'
)
Expand All @@ -86,16 +91,20 @@ def main():
url = item["url"]
owner, repo_name = extract_repo_info(url)

# Use description from JSON if provided, otherwise fetch from API
# Fetch repo info from API (description and stars)
print(f"Fetching info for {owner}/{repo_name}...")
repo_info = fetch_repo_info(owner, repo_name, TOKEN)

# Use description from JSON if provided, otherwise use API response
description = item.get("description", "").strip()
if not description:
print(f"Fetching description for {owner}/{repo_name}...")
description = fetch_repo_description(owner, repo_name, TOKEN)
description = repo_info["description"]

repos.append({
"url": url,
"name": format_repo_name(repo_name),
"description": description or "No description available.",
"stars": repo_info["stars"],
})

# Generate HTML table
Expand Down