| 开发者 | fmojibur |
|---|---|
| 更新时间 | 2026年10月30日 20:56 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
auto_image searches Pexels, Pixabay, Openverse and Wikimedia Commons together, ranks the results against the slot the image has to fill, downloads the winner, resizes it, converts it to WebP, sets the alt text and returns a URL.
Ranking that knows about the slot. Aspect ratio, minimum width and the site's brand colour all feed the score, so a 16:9 hero gets a wide photograph in the right palette rather than whatever matched the keyword first.
Ranking that knows about the licence. A CC0 photograph outranks one that requires a credit, which outranks one that adds share-alike terms. What lands on a client site is the picture with the fewest obligations attached to it.
One round trip. All four sources are queried together, not one after another, and results are cached for 24 hours.
No duplicates. The same source URL always resolves to the same attachment, so rebuilding a page does not fill the library with copies.
Credits kept. The photographer, the source and the licence are stored on every attachment, shown in a Credit column in the media library and available through the [shilpi_image_credits] shortcode.
Sources
/wp-json/shilpi-image-kit/v1/. They support searching free images and importing a selected result into the Media Library.
wp-config.php as SHILPI_IK_PEXELS_KEY, SHILPI_IK_PIXABAY_KEY and SHILPI_IK_OPENVERSE_TOKEN, which then take precedence over the settings screen.Unsplash's API guidelines require their image URLs to be hotlinked rather than copied to your own server, which is the opposite of what this plugin does.
Pexels and Pixabay ask for it without requiring it. Several Openverse and Wikimedia Commons licences do require it. The credit is stored on every attachment either way, so [shilpi_image_credits] in the footer covers you.
[shilpi_image_credits].