=== Easy Integration for Dropbox – File Manager ===
Contributors: ultradevs, mhimon
Donate link: https://ultradevs.com/donate
Tags: dropbox, file manager, cloud storage, file upload, gallery, embed, shortcode, form
Requires at least: 6.2
Tested up to:      7.1
Stable tag:       2.2.10
Requires PHP:      7.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn Dropbox into a WordPress file manager — browse, embed, upload & share files with shortcodes, blocks & forms.

== Description ==

**[Easy Integration for Dropbox – File Manager](https://ultradevs.com/easy-dropbox-integration/) connects your WordPress site directly to Dropbox**, so you can browse, embed, upload, and manage files without ever touching your server's storage. Your files stay in Dropbox — WordPress just displays and manages them.

Whether you need a simple download link, a full image gallery, or a way for visitors to upload files straight into your Dropbox account, the shortcode builder, Gutenberg blocks, and page-builder widgets get you there in minutes — no code required.

https://www.youtube.com/watch?v=hvbuVTy6-7s

= 💡 Why Choose Easy Dropbox Integration? =

- ✅ **Save server space** — Dropbox stores the files, not your WordPress host, so large media libraries never eat your hosting quota.
- ✅ **No coding required** — a visual shortcode builder plus Gutenberg, Elementor, and Divi support handle the setup.
- ✅ **Built-in previews** — PDFs, Office documents, images, and video open in a responsive popup, no download needed.
- ✅ **Form-ready uploads** — connect Contact Form 7 (or WPForms, Ninja Forms, and more with PRO) so submissions upload straight to Dropbox.
- ✅ **SEO-friendly embeds** — shortcodes render clean, crawlable markup instead of files hidden behind a Dropbox login wall.
- ✅ **Scales with PRO** — add multiple Dropbox accounts, sync with the WordPress Media Library, and more when you need it.

= 🚀 Key Features =

- **File Browser** – Browse, search, and organize Dropbox files and folders from the WordPress admin.
- **Shortcode Builder** – Visually create embeds for documents, image galleries, view links, and download links.
- **File Uploader** – Drop an uploader into any page, post, or Contact Form 7 form; submissions save straight to Dropbox.
- **File Previewer** – Responsive popup previews for PDFs, Office documents, images, and more, powered by lightGallery and the Microsoft Office viewer.
- **Gutenberg, Elementor & Divi Support** – Native blocks and a module for the page builder you already use.

= 👥 Perfect For =

- **Agencies & freelancers** managing client files without server storage limits.
- **Course creators & membership sites** delivering downloadable resources.
- **Real estate & portfolio sites** embedding image galleries and documents.
- **Businesses collecting files** from customers through Contact Form 7 (or WPForms/Ninja Forms with PRO).

= ⚡ Getting Started in 3 Steps =

1. Install and activate the plugin, then connect your Dropbox account from **Dropbox → Connect Dropbox** using the guided OAuth flow.
2. Open **Dropbox → Shortcode Builder** and create an embed for a document, gallery, or download link.
3. Paste the generated shortcode into any page or post — or use the Gutenberg block, Elementor widget, or Divi module instead.

= ✨ Free Features =

**⚙️ Easy Setup**
Connect your Dropbox account in a few clicks with the guided OAuth flow.

**🗂️ File Browser**
Browse, search, and manage Dropbox files and folders directly from the WordPress admin.

**⏫ File Uploader**
Let visitors upload files straight to Dropbox from a shortcode, Gutenberg block, or Elementor widget.

**🔍 File Search**
Add a lightweight search box so visitors can quickly find Dropbox files by name.

**📝 Shortcode Builder**
Visually create SEO-friendly embeds for folders, documents, galleries, and download links.

**👁️ File Previewer**
Show a responsive preview popup for PDFs, images, Office documents, and other files — no download required.

**🔀 Contact Form 7 Integration**
Add a Dropbox uploader to Contact Form 7 so submitted attachments save directly to Dropbox instead of your server.

= 🚀 PRO Features =

Unlock more with [Easy Dropbox Integration PRO](https://ultradevs.com/easy-dropbox-integration/):

**🔒 User Private Files**
Give logged-in users their own private Dropbox folder with per-user visibility controls for uploads and downloads.

**📚 WordPress Media Library Integration**
Sync Dropbox folders into the WordPress Media Library so you can reuse files in posts, blocks, and widgets like any other upload.

**🔐 Multiple Dropbox Accounts**
Connect and switch between several Dropbox accounts without re-authenticating — ideal for agencies managing multiple clients.

**📁 Dropbox Team Folders**
Use your Dropbox Business Team root as the plugin's root folder. Review existing shortcodes and linked folders first, since the root will no longer be your personal folder.

**🎬 Media Player in Shortcode Builder**
Play audio and video directly through shortcode embeds, no extra configuration needed.

**📡 Media Streaming**
Stream media assets from Dropbox with optimized buffering for smooth playback.

**🎠 Slider Carousel Layouts**
Display folder contents as a touch-friendly carousel to spotlight featured files.

**💾 Storage Syncing**
Keep Dropbox and WordPress media in sync automatically so files stay available wherever they're used.

= 🔌 Integrations =

**Included free:**
- [Gutenberg Block Editor](https://wordpress.org/plugins/gutenberg/) – native blocks for embedding Dropbox content.
- [Elementor Page Builder](https://wordpress.org/plugins/elementor/) – dedicated widgets for folders, galleries, and uploaders.
- [Divi Page Builder](https://www.elegantthemes.com/gallery/divi/) – embed Dropbox shortcodes inside Divi.
- [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) – upload form attachments straight to Dropbox.

**Available in PRO:**
- [WooCommerce](https://wordpress.org/plugins/woocommerce/) – sell Dropbox files as downloadable products.
- [WPForms](https://wordpress.org/plugins/wpforms-lite/) & [Ninja Forms](https://wordpress.org/plugins/ninja-forms/) – Dropbox file uploaders for form submissions.
- Gravity Forms, Fluent Forms, Formidable Forms & MetForm – Dropbox uploaders for each form builder.
- [Tutor LMS](https://wordpress.org/plugins/tutor/) – use Dropbox files as lesson or course intro videos.

= 🗺️ Roadmap =

We're actively expanding support to more page builders, form plugins, and LMS platforms — [let us know](https://ultradevs.com/easy-dropbox-integration/) what you'd like to see next.

= 📚 External Libraries & Third-Party Services =

This plugin relies on the following third-party libraries and services:
- [Dropbox PHP SDK](https://github.com/kunalvarma05/dropbox-php-sdk) — communicates with the Dropbox API to browse, upload, and manage files.
- [lightGallery](https://www.lightgalleryjs.com/) — renders responsive image, video, and document galleries and previews.
- [Flaticon](https://www.flaticon.com/) — provides interface icons.
- Google Docs Viewer (`docs.google.com/viewerng/viewer`) — embeds PDF previews.
- Microsoft Office Viewer (`view.officeapps.live.com`) — embeds Office document previews.

= 🔐 Data Privacy =

Connecting Dropbox requires your own Dropbox App (see the FAQ below) — the plugin does not use a shared or default Dropbox App. When you complete the OAuth flow from **Dropbox → Connect Dropbox**, your site talks directly to Dropbox's own authorization servers, and Dropbox redirects back to your site once you approve access.

**No ultraDevs server is involved in this exchange, and your files are never stored on or transferred through our infrastructure.** All file operations happen directly and securely between your server and Dropbox's API.

See the [ultraDevs Privacy Policy](https://ultradevs.com/privacy-policy/) for how we handle other data, such as license and support information.

= 💬 Support, Docs & Community =

- 🆘 [Free Support Forum](https://wordpress.org/support/plugin/easy-dropbox-integration/)
- 📖 [Documentation](https://ultradevs.com/docs/easy-dropbox-integration)
- 🎥 [Video Tutorials](https://www.youtube.com/playlist?list=PL6-MOhUm73eiSSVHgAVnFFEvs6rO2sZyC)
- 💬 [Live Chat on Facebook](https://web.facebook.com/hello.ultradevs)
- 👥 [Facebook Community Group](https://web.facebook.com/groups/ultradevs/)
- 📺 [YouTube Channel](https://www.youtube.com/channel/UCc2yL-QGQjscXpPx9Pp7J8w)
- 🐦 [Twitter/X](https://twitter.com/ultraDevsBD)
- 📸 [Instagram](https://www.instagram.com/ultradevs/)

Made with ❤️ by [ultraDevs](https://ultradevs.com).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/easy-dropbox-integration`, or install it directly through **Plugins → Add New** in your WordPress admin.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Dropbox → Connect Dropbox** and follow the guided OAuth flow to link your Dropbox account.
4. Open **Dropbox → Shortcode Builder** to create your first embed, then paste the shortcode into any page or post.

== Frequently Asked Questions ==

= Is it safe to connect my Dropbox account with this plugin? =
Yes. The plugin uses the official Dropbox API, and after the OAuth handshake, file transfers happen directly and securely between your server and Dropbox — no ultraDevs server is involved. See Data Privacy above for details.

= Does the plugin require a Dropbox App of my own? =
Yes, you need to create a Dropbox App and get the App Key and App Secret from the Dropbox Developer Console. Follow the [step-by-step guide](https://ultradevs.com/docs/easy-dropbox-integration/settings/how-to-link-your-own-dropbox-app-with-easy-dropbox-integration-plugin/) to set one up — it only takes a few minutes.

= Can I embed Dropbox folders on any WordPress page? =
Yes, the shortcode builder, Gutenberg blocks, and Elementor and Divi support let you place Dropbox folders, files, or galleries anywhere your theme allows content.

= Can I use Dropbox files in WooCommerce? =
Yes, with the WooCommerce Downloadable Products integration in the PRO version, you can deliver downloadable products straight from Dropbox.

= Do my visitors need their own Dropbox account? =
No. Visitors browse, preview, and download files through your WordPress site — they never need to log in to Dropbox or see your account.

= What happens to my files if I deactivate the plugin? =
Your files always stay safely in Dropbox. Deactivating the plugin only removes the WordPress-side embeds and local cache; nothing is deleted from your Dropbox account.

= Will this slow down my website? =
No. Files are served from Dropbox instead of your own server, and file listings are cached locally so repeat visits load quickly without hitting the Dropbox API every time.

== Screenshots ==
1. File Browser
2. Shortcode Builder
3. Settings

== Changelog ==

= 2.2.10 - 14 September, 2026 =
- **Fix:** Frontend gallery images could still show as permanently broken until a full page reload — large originals over Dropbox's thumbnail size limit are now resized and cached locally instead of being served as a raw, repeatedly-refetched original file.
- **Enhancement:** Gallery images now retry automatically if a load briefly fails, instead of requiring a manual page reload.
- **New:** Added Move, Duplicate, and Share to the File Browser's file/folder menu (previously showed "Coming Soon").
- **New:** Added Cut & Paste to the File Browser — cut a file or folder from its menu, then use the new Paste button to move it into any folder you open.
- **Fix:** Dropbox errors (such as a naming conflict when moving, duplicating, or renaming a file) showed a raw error code instead of a clear, readable message.
- **Fix:** The File Browser's ⋮ and right-click menus could appear as an empty box (just their divider lines) on a shortcode with every file or folder action disabled — the menu, and its ⋮ button, no longer render when there's nothing left to show.
- **New:** **PRO Feature:** Tutor LMS Integration module now lets you select Dropbox files as lesson or course intro videos in the Tutor LMS course builder.

= 2.2.9 - 11 September, 2026 =
- **Fix:** Frontend gallery images could show as broken (with working click/preview links) until the page was reloaded — cached thumbnail URLs that had gone stale (expired Dropbox temporary links or cleared local thumbnail files) are now detected and regenerated automatically.
- **New:** Added a search box to the File Browser so you can quickly find files and folders by name.
- **Fix:** Dropdown css classnaming conflict.
- **Fix:** The File Browser could show stale results after uploading a file or clicking Refresh — every other refresh silently reused cached data instead of pulling new files. Uploads and manual refreshes now always fetch the latest data from Dropbox.
- **Fix:** Many file types (.txt, .csv, .docx, code files, fonts, archives, and more) showed a folder icon in the File Browser instead of their correct file-type icon.

= 2.2.8 - 30 August, 2026 =
- **Fix:** Saving or duplicating a shortcode could fail with a database error ("Unknown column 'hash'") on sites where the 2.2.0 schema migration was silently missed — the migration now re-runs and repairs the table automatically.
- **Fix:** Reactivating the plugin after an update no longer skips pending database migrations.
- **New:** "Check & Repair Database" tool in Settings → Tools re-checks the plugin tables and restores missing columns/indexes on demand.
- **Enhancement:** Database update routines now record failures and show an admin notice with a retry action instead of failing silently.

= 2.2.7 - 26 August, 2026 =
- **Fix:** Fatal error ("Call to a member function getToken() on null") when connecting an account whose Dropbox app is missing required permissions, or when a request ran without a valid access token — the plugin now fails gracefully and asks you to reconnect.
- **Fix:** Connection errors now show a clear, actionable message (incorrect App Key or Secret, Redirect URI not registered, server unable to reach Dropbox, expired authorization code) instead of failing silently.
- **Enhancement:** The app setup screen now lists all six permission scopes your Dropbox app must enable before connecting.
- **Fix:** PRO badges and upgrade prompts were shown to users with an active PRO license.
- **Fix:** Connecting again while an earlier authorization window is still open no longer fails with "CSRF Token Mismatch" — outstanding authorization links stay valid until used.
- **Fix:** Compatibility with page-cache plugins such as LiteSpeed Cache — cached AJAX responses could leave the settings page loading forever; all plugin AJAX responses are now sent with no-cache headers.

= 2.2.6 - 21 August, 2026 =
- **Improvement:** "Clear Attachments" (Media Library settings) now asks for confirmation before removing the Dropbox attachments.

= 2.2.5 - 19 August, 2026 =
- **QUICK FIX:** Fixed a bug that caused clear cache to not work properly in some cases.

= 2.2.4 - 19 August, 2026 =
- **Fix:** Files could swap thumbnails or disappear when the same Dropbox account was connected twice — cached files are now stored per account.
- **Fix:** "Clear Cache" now removes the cached files of every connected account, plus the stored thumbnails and stale thumbnail links.
- **Fix:** Renaming a file in the file browser no longer leaves its cached copy pointing at the old location.

= 2.2.3 - 15 August, 2026 =
- **Fix:** Fixed folders not found while switching accounts in some cases.
- **Improvement:** Improved shortcode and added folder selection for image gallery and other shortcodes.

= 2.2.2 - 09 August, 2026 =
- **Fix:** Fixed Media Library Integration issue in some cases.
- **New:** Added Ninja Forms Integration module for file uploads (PRO).

= 2.2.1 - 03 August, 2026 =
- **Enhancement:** Added preset design templates for Image Gallery shortcodes and some new shortcode builder options for better customization.

= 2.2.0 - 24 July, 2026 =
- **Security:** Closed a front-end IDOR. The numeric shortcode `id` is no longer exposed to anonymous visitors — `[easy_dropbox_integration id="N"]` is resolved on the server and only an unguessable stored hash is emitted as the front-end `shortcode_id` used to authorize file-listing requests. The short `[id="N"]` shortcode, admin edit URLs, and admin CRUD AJAX continue to use the numeric id (admin-only).
- **Security:** Fixed a path-traversal flaw in the per-shortcode folder-allowlist check. Paths are now canonicalized (`.`/`..` collapsed) before comparison, so requests like `/allowed/../../outside` can no longer reach folders outside the configured source.
- **Security:** Front-end shortcode views are now scoped to the shortcode's allowed folders for all users, including administrators. A request carrying a `shortcode_id` can no longer list folders outside the configured source by changing the `path` — the admin bypass now applies only to the unscoped admin file manager.
- **Security:** Hardened write operations — `rename` now validates the destination path too, and `create_folder` validates the full joined path, preventing escape from the allowed folder for management-capable users.
- **Security:** `sync_storage` no longer returns connected-account details (emails, scopes, the full account list) to non-administrators; front-end callers receive only public fields.
- **Security:** Hardened AJAX authorization for the frontend file browser and uploader. File actions now require either an administrator capability or a valid shortcode context; they are no longer reachable by unauthenticated users without a shortcode.
- **Security:** Enforced the per-shortcode source-folder allowlist for every file action (list, download, preview, direct link, media, stream, zip, upload), and denied access by default when no shortcode context is present.
- **Security:** Stopped exposing connected-account details (Dropbox owner email, administrator email, OAuth scopes) to anonymous visitors in front-end localized data.
- **Fix:** Fixed image preview for some file types.
- **Fix:** Fixed shortcode builder for some cases.
- **Fix:** Account ID is now correctly passed to the front-end for shortcodes with multiple accounts.
- **Update:** Updated Freemius SDK to 2.13.4



= 2.1.0 - 20 July, 2026 =
- **Fix:** Account Storage UI Issue.
- **Improvement:** Dropbox App Permissions Handling.
- **Fix:** Shortcode Preview Nonce Issue.
- **New:** Added App Folder Support.

= 2.0.4 - 16 May, 2026 =
- **Fix:** Form Uploader for non-authenticated users.


= 2.0.3 - 31 March, 2026 =
- **Fix:** App Setup Page Assets Loading.
- **Improvement:** Freemius Integration.
- **Improvement:** Code Quality.
- **Fix:** Plugin Name Change.

= 2.0.2 - 20 March, 2026 =
- **New:** Added get_files ajax functionality.
- **Improvement:** Refactored Freemius integration via Composer.
- **Improvement:** Settings sanitization enhancements.
- **Improvement:** Better debugging capabilities.
- **Fix:** Database prepare statement fixes.
- **Fix:** File browser and refresh issues resolved.
- **Fix:** PHPCS and general code formatting improvements.

= 2.0.1 - 27 February, 2026 =
- **Fix:** Ajax Error.

= 2.0.0 - 20 February, 2026 =
- **Fix:** Some Issues.
- **Fix:** Media Library Folder Selection.
- **Improvement:** Refresh Token.
- **Improvement:** Active Account Management.
- **Improvement:** File Uploader Shortcode.
- **Fix:** Connect Dropbox Error.
- **Fix:** Set access token issue.
- **Improvement:** CSS.

= 1.14.0 - 27 January, 2026 =
- **Fix:** Multiple account shortcode view issue.
- **Improvement:** Filebrowser.
- **New:** Module Preview.
- **Fix:** Refresh Token Issue.

= 1.13.2 - 17 January, 2026 =
- **Fix:** Refresh Token Issue.
- **New:** File Browser Component Exported to Window for External Usage.
- **Fix:** Rename issue.
- **Improvement:** REST API.
- **Improvement:** Error Handling.

= 1.13.1 - 08 January, 2026 =
- **Fix:** Replace cache `.htaccess` files.

= 1.13.0 - 08 January, 2026 =
- **Fix:** Shortcode Builder Issue.
- **New:** Media Player Support in Shortcode builder.
- **New:** Media Streaming.
- **New:** Slider Carousel in Shortcode Builder.
- **New:** Storage Syncing.

= 1.12.6 - 3 January, 2026 =
- **Improvement:** Thumbnail folder security.

= 1.12.5 - 3 January, 2026 =
- **Fix:** Module Manager.

= 1.12.4 - 3 January, 2026 =
- **Improvement:** Frontend CSS.
- **Improvement:** Assets Class.
- **New:** Added Delete Button for Uploaded Files List.
- **Enhancement:** Uploader Component.
- **New:** Added WPForms Support.
- **New:** Added Import to Media Library Feature.

= 1.12.3 - 20 December, 2025 =
- **New:** Shared Link Cache Added.
- **New:** Direct Download Link Added.
- **Fix:** Media Library Folder Selection Issue.
- **Improvement:** Thumbnail Security Improvement.
- **Improvement:** Uploader UI Improvement.
- **Fix:** Elementor Form Uploader Module.

= 1.12.2 - 12 October, 2025 =
- **Fix:** Load Text Domain warning issue.
- **Fix:** Some Issues.
- **Improvement:** Code Improvement.
- **Improvement:** Assets loading improvement.

= 1.12.1 - 24 September, 2025 =
- **Fix:** Some CSS Issues.

= 1.12.0 - 23 September, 2025 =
- **Enhancement:** New File Browser, Shortcode Builder, Settings UI.
- **New:** Download folder as Zip.
- **New:** File/Folder More Menu in File Browser.
- **Fix:** Some Issues.
- **Update:** Performance Improvements.

= 1.11.1 - 30 April, 2025 =
- **Update:** No more default Dropbox App Key and Secret.

= 1.11.0 - 12 January, 2025 =
- **New:** CF7 Module Opener Button Styles.
- **New:** Elementor Pro Form Uploader Module.

= 1.10.0 - 21 December, 2024 =
- **Fix:** Header Already Sent Issue.
- **Fix:** Elementor Module.
- **Fix:** Account Removal Issue.
- **New:** Added Option to use Own Dropbox App.
- **New:** Added CF7 compatibility.

= 1.9.1 - 1 December, 2024 =
- **Fix:** PHP Version Issue.
- **Fix:** Elementor Module.
- **Update:** Dropbox App Key and Secret.

= 1.9.0 - 30 October, 2024 =
- **New:** File Uploader Elementor Widget.
- **Fix:** Admin Common CSS loading.

= 1.8.0 - 27 October, 2024 =
- **Fix:** Media Library.
- **New:** Gutenberg Shortcode Modules Block.
- **Fix:** UI Changes, Admin Common CSS compatibility.
- **Fix:** Ajax Class Active Account Issue.

= 1.7.0 - 10 October, 2024 =
- **Fix:** Shortcode Permission.
- **Fix:** Folder Selector Modal Fix.
- **New:** More Uploader Config Options.
- **New:** WordPress Media Library Integration. (PRO)
- **Update:** Freemius Updated to 2.8.0.

= 1.6.4 - 18 September, 2024 =
- **Fix:** ShortCode Builder Save Button.
- **Fix:** ShortCode Builder Type .
- **Fix:** File Uploader Fix.
- **New:** Embed Documents, Download Links, View Links in Shortcode.
- **New:** Permission in Shortcode.
- **New:** Tools page to clear cached files.

= 1.6.3 - 17 September, 2024 =
- **Fix:** Uploader.
- **New:** More Uploader Config Options.

= 1.6.1 - 16 September, 2024 =
- **Fix:** CF7.
- **Fix:** Uploader.
- **Fix:** Shortcode Builder.

= 1.6.0 - 09 September, 2024 =
- **New:** Masonry and Justified Gallery Layout.
- **New:** Advanced File Uploader.
- **New:** Contact Form 7 Integration.
- **Fix:** Some Issues.

= 1.5.0 - 31 August, 2024 =
- **Fix:** Some Issues.
- **Tweak:** Shortcode Rendering.
- **New:** File Uploader Shortcode.

= 1.4.2 - 17 August, 2024 =
- **Fix:** File Preview
- **Fix:** Open download link for non preview supported files.
- **New:** Added Pro Trial.

= 1.4.1 - 15 August, 2024 =
- **Fix:** Class name issue

= 1.4.0 - 15 August, 2024 =
- **Tweak:** Breadcrumb.
- **New:** wooCommerce Downloadable Products Integration
- **New:** Modules Manager.

= 1.3.1 - 35 July, 2024 - 🇧🇩 Supporting Bangladeshi Students =
- **Tweak:** Modules.
- **Fix:** Updates.

= 1.3.0 - 35 July, 2024 - 🇧🇩 Supporting Bangladeshi Students =
- **New:** Added File Download.
- **Fix:** Preview.
- **Fix:** Previous Path.
- **Tweak:** Caching.

= 1.2.0 - 29 July, 2024 =
- **New:** Files and Folder Cache.
- **New:** File Browser's File/Folder More Menu.
- **New:** File Icons.
- **New:** Refresh Button Functionalities.
- **Fix:** Add Account Button Fixes
- **Tweak:** UI.

= 1.1.1 - 28 July, 2024 =
- **New:** Preview.
- **New:** Preview In New Window.
- **Tweak:** - Files Table.

= 1.0.1 - 26 July, 2024 =
- **Fix:** Bug Fix.

= 1.0.0 - 26 July, 2024 =
* Initial Stable Release

== Upgrade Notice ==

= 2.2.9 =
Fixes stale/broken gallery thumbnails, adds File Browser search, and corrects file-type icons for many formats. Recommended for all users.
