Skip to content
TarekNabil.Net
All projects

Project · WordPress plugin · Legacy

Auto Google Images

A WordPress plugin that searches Google for each post's title when the post is saved, and inserts the first image result at the top, linked to its source.

Role
Solo developer
Year
2011
Tags
WordPressPHPWordPress PluginGoogle APIJavaScriptjQuery
Before and after: the post editor's Code tab with only text and no image, and the published post with a coastal photo added at the top beside the text Before and after: the post editor's Code tab with only text and no image, and the published post with a coastal photo added at the top beside the text

About the Project

Auto Google Images is a WordPress plugin I built on a client’s request. It was inspired by an existing plugin, SS GoogleImages, which required the admin to choose each image by hand.

Auto Google Images runs a Google image search from the post title whenever a post is saved, and inserts the first result at the top of the post, linked to its source. The width is capped by a setting, and the admin can restrict results to images with certain Creative Commons licenses. An optional uploader can download the image into the WordPress Media Library when the post is published. The plugin also works with WP Robot, which publishes posts from RSS feeds.

Problem

Finding an image for every post by hand slowed publishing. The original plugin still needed manual selection, and the client wanted that step removed while keeping the plugin compatible with WP Robot.

Role

Solo developer. I analyzed the original plugin, designed and built the new one from scratch, and handled the end-to-end work. I kept in regular contact with the client through daily updates and feedback. I also handled WordPress saving edited posts as drafts so publishing still worked.

Stack

PHPWordPress Plugin APIGoogle AJAX Search APIjQuery 1.4.2Save-post filterPublish hookMedia Library functionsOptions APIJSON parsingJavaScriptGoogle Images APIMySQL

Outcome

100% Project certified as complete and fully satisfactory by the client, who also paid an extra bonus for work they had not asked for.
2 Image modes: the plugin either hotlinks the Google result, or downloads it into the Media Library on publish.
Status: Completed (2011).

FAQ

What does the plugin do?

When a post is saved, it searches Google for the post title, takes the first image result, and inserts it at the top, linked to the source.

Can I keep a local copy of the image?

Yes. The uploader downloads images into the Media Library on publish. Admins can also set a custom folder and URL.

Can I limit which images are used?

Yes. The admin can restrict results to images labeled for reuse, commercial reuse, or reuse with modification.

Does it need an API key?

Yes. The settings page has an API key field and links to a Google sign-up page.

What does it need on the server?

Either the cURL PHP extension or allow_url_fopen. Without one of them, the plugin shows a warning.

Does it work with auto-posting plugins?

Yes. It was built to work with WP Robot, which publishes posts from RSS feeds.

Does it still work with Google today?

It is a 2011 build, made for Google's AJAX Search API as it worked at the time.

Get in Touch

Reach out for any reason: a role, a project, or a question.

Send a message