Rogue Scholar DOI Sync
WordPress plugin to add Rogue Scholar DOIs to posts
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/redasadki/rogue-scholar-doi-sync/archive/refs/heads/main.zipSyncs DOIs from any Rogue Scholar–indexed blog into Yoast SEO canonical URLs for your WordPress posts, and exposes a shortcode to display the DOI.
What’s new in 1.3.0
- Per‑post DOI sync is now asynchronous, scheduled via a single cron event, so saving/updating posts no longer waits on a remote HTTP request.
- Shortcode
[rogue_scholar_doi]now only renders when the Yoast canonical URL is adoi.org/...URL, avoiding misinterpretation of non‑DOI canonicals.
Features
- Generic support for any Rogue Scholar InvenioRDM community (community ID configurable in settings).
- Robust mapping using:
pids.doi.identifierfor DOIs.metadata.identifiers[scheme="url"]for original blog URLs.- Fallback to
metadata.identifiers[scheme="guid"]→wp_posts.guidfor URL‑change resilience.
- Integration with Yoast SEO:
- Stores
https://doi.org/<doi>in_yoast_wpseo_canonical. - Overrides Yoast’s canonical output via
wpseo_canonicalso canonical tags point to DOIs when present.
- Stores
- Sync modes:
- Manual full sync (admin page).
- Hourly incremental cron sync of newest records.
- Asynchronous per‑post sync scheduled on
save_postafter publish.
- Shortcode:
[rogue_scholar_doi]to display the DOI URL or bare DOI text.
- Logging:
- Optional logging to
wp-content/debug.log(prefix[RogueScholarDOI]), whenWP_DEBUG_LOGis enabled.
- Optional logging to
Requirements
- WordPress 6.x (or recent 5.x).
- Yoast SEO plugin active.
- Rogue Scholar community records with:
pids.doi.identifierpopulated.- Your blog URLs in
metadata.identifierswithscheme="url". - Ideally GUIDs in
metadata.identifierswithscheme="guid"for robust mapping.
Usage
Configure
In Rogue Scholar DOIs → Settings:
- Set Community ID to your Rogue Scholar community’s UUID.
- Optionally set Community Slug.
- Enable logging if you want debug output.
Initial full sync
- Go to Rogue Scholar DOIs.
- Click Sync DOIs from Rogue Scholar (full).
- Watch for success or error notice; check
debug.logfor[RogueScholarDOI]entries if needed.
Automatic sync
- Hourly cron: Incremental sync of newest records.
- Per‑post async sync: On update of a published post without a DOI canonical:
- Schedules
rs_doi_async_single_sync5 seconds later. - That async job checks newest records for a matching URL and writes the DOI canonical if found.
- Schedules
Shortcode
Inside post content:
[rogue_scholar_doi]