KFX Media Importer for Google Drive

Description

This plugin lets authorized WordPress users import images from Google Drive directly into the standard Media Library. After import, files are normal local WordPress attachments.

Free (this plugin): bring-your-own (BYO) Google credentials

You create a Google Cloud project and paste (in Media Google Drive Import, or via constants in wp-config.php):

  • OAuth Client ID (Web application) — KFX_GDRIVE_CLIENT_ID
  • Google Picker API key — KFX_GDRIVE_PICKER_API_KEY
  • App ID (Google Cloud project number) — KFX_GDRIVE_APP_ID

Sign-in uses Google Identity Services in the browser. Do not put the OAuth client secret in WordPress. Kodefix does not host OAuth for the Free plugin. Credentials set in wp-config.php appear masked in the admin UI.

Pro (optional addon)

The main benefit of Pro is simpler setup: with an active Kodefix Store license you connect Google Drive without creating a Google Cloud project. Enter the license key under Media Google Drive Import, or define KFX_GDRIVE_PRO_LICENSE_KEY in wp-config.php. Pro also adds resize, filename normalization, ALT from filename, and content-hash duplicate detection.

External services

This plugin connects to third-party services to import images from Google Drive.

Google Identity Services, Google Picker, and Google Drive API

Used to sign in with Google, browse and select image files, and download those files into the WordPress Media Library. Scope: https://www.googleapis.com/auth/drive.file only (files you explicitly pick).

When you import:

  • In the browser, Google Identity Services and Google Picker receive your OAuth Client ID (Free) and the selected file metadata (ID, name, MIME type, size).
  • Your WordPress server then requests file bytes from the Google Drive API (www.googleapis.com) using a short-lived Bearer access token and the selected file IDs. The token is not stored permanently.

This service is provided by Google: Privacy Policy · Terms of Service.

Your Google Cloud project (Free)

You configure your own OAuth Client ID, Picker API key, and App ID under Media Google Drive Import (or via KFX_GDRIVE_* constants). Kodefix does not receive Google tokens or file contents on the Free import path.

Kodefix hosted Google sign-in (Pro only, licensed)

With an active Kodefix Store license, the optional Pro addon can use Kodefix hosted Google sign-in so you do not need your own Google Cloud project. It temporarily processes session/installation identifiers and the WordPress site origin to complete Connect. File contents are never sent through Kodefix servers — downloads still go from Google Drive to your WordPress site. The Free plugin does not call this service.

Kodefix Store Terms · Privacy Policy.

Installation

  1. Upload the plugin folder to /wp-content/plugins/kfx-media-importer-for-google-drive/
  2. Activate through the Plugins menu
  3. Go to Media Google Drive Import and enter your Google Cloud credentials, or define KFX_GDRIVE_CLIENT_ID, KFX_GDRIVE_PICKER_API_KEY, and KFX_GDRIVE_APP_ID in wp-config.php
  4. Open Media Library and use Import from Google Drive / the Google Drive tab

FAQ

Does this embed files from Google Drive on the frontend?

No. Files are downloaded into your WordPress Media Library as local attachments.

What Google permissions are requested?

Only https://www.googleapis.com/auth/drive.file — access to files you select in Google Picker.

Do I need a Google Cloud project?

Yes for Free. Create a Web OAuth Client ID, enable Picker + Drive APIs, create an API key, and use the numeric project number as App ID. Add your WordPress site URL under Authorized JavaScript origins. You can paste credentials in the settings UI or set KFX_GDRIVE_CLIENT_ID, KFX_GDRIVE_PICKER_API_KEY, and KFX_GDRIVE_APP_ID in wp-config.php.

What about Pro simpler setup?

Install KFX Media Importer for Google Drive Pro, enter your Kodefix Store license key under Media Google Drive Import (or define KFX_GDRIVE_PRO_LICENSE_KEY in wp-config.php). You can connect Google Drive without creating a Google Cloud project. If the license expires, existing media stays; use Free BYO credentials to keep importing.

Can I set credentials in wp-config.php?

Yes. Free: KFX_GDRIVE_CLIENT_ID, KFX_GDRIVE_PICKER_API_KEY, KFX_GDRIVE_APP_ID. Pro license: KFX_GDRIVE_PRO_LICENSE_KEY. Values from wp-config.php override the database options and appear masked (read-only) in the admin UI.

Are duplicates prevented?

Free skips re-import of the same Google Drive file ID. Pro can also detect identical image content (SHA-256).

Compatible with TinyPNG / WP Offload Media?

Imports use WordPress media_handle_sideload, so plugins that hook attachment creation / metadata generally work. Tested conceptually with TinyPNG and WP Offload Media style pipelines; always smoke-test on a staging site.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“KFX Media Importer for Google Drive” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.2

  • WordPress.org review: enqueue-only scripts, remove bundled translations, document external services with Terms and Privacy links, Contributors username, remove admin upsell notice outside plugin settings.

1.1.1

  • PHP 8.0 compatibility: removed typed static class properties (PHP 8.3+ syntax) so the plugin runs on PHP 8.0–8.2 as declared in Requires PHP.

1.1.0

  • Free uses BYO Google credentials in settings (GIS token client).
  • Drive file ID duplicate detection in Free.
  • Pro can override auth to licensed hosted Google sign-in.
  • Credentials and Pro license key can be set via wp-config.php constants.

1.0.0

  • Initial release.