Skip to content

Instantly share code, notes, and snippets.

@kasparsd
Last active October 2, 2024 08:54
Show Gist options
  • Save kasparsd/0b0cec8548b0115f5611f814d534b9aa to your computer and use it in GitHub Desktop.
Save kasparsd/0b0cec8548b0115f5611f814d534b9aa to your computer and use it in GitHub Desktop.

WP Update Server Notes

See this guide for how to create a mirror of the WordPress.org SVN repositories.

WP.org API

WP.org hosts the API at api.wordpress.org (documented in the old wiki) which is accessed by WP installations via HTTP on older servers that can't do latest HTTPS crypto or upgraded to HTTPS requests on all other server.

Only some of the API source code is available at:

Note: I haven't been able to find the source code serving the core/version-check or [themes|plugins]/update-check endpoints!

WordPress Application

WP core checks for various updates to the following WP.org API endpoints:

Misc:

Patterns:

Core:

Plugins:

Themes:

Translations:

@kasparsd
Copy link
Author

@modiqi Oh, this is great! Thanks for sharing!

@devhaozi
Copy link

wenpai.org has developed a plugin to run these APIs, which can be referenced

https://github.com/WenPai-org/wenpai.org/tree/main/wp-content/plugins/plat-api

@kasparsd
Copy link
Author

@devhaozi Thanks! It appears to be rewriting those requests to api.wpmirror.com/... which seems to be a simple reverse proxy to the WP.org origin (I'm not 100% sure).

Do you have any insight into the code that actually runs on the /core/version-check/1.7 endpoints? I haven't been able to find that anywhere in public.

@devhaozi
Copy link

devhaozi commented Sep 26, 2024

@devhaozi Thanks! It appears to be rewriting those requests to api.wpmirror.com/... which seems to be a simple reverse proxy to the WP.org origin (I'm not 100% sure).

Do you have any insight into the code that actually runs on the /core/version-check/1.7 endpoints? I haven't been able to find that anywhere in public.

Yes, for APIs that have not yet been implemented, they will simply be reverse proxied to w.org currently, it has a hash-based cache to prevent excessive requests to w.org.

For /core/version-check/1.7, it can use custom post type + postmeta to implement it if necessary, wenpai.org currently implements plugins, themes and translations, core is not in currently planned.

This project was originally intended to solve the problem of w.org blocking China IPs, but later it developed into a large platform.
We refactored the plugin/theme API to optimize the speed. They now use Elasticsearch as the backend, which is very fast. We also made many improvements to GlotPress, supporting Elasticsearch memory suggestion, fully automatic machine translation, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment