From 12197aa19c6aa54eb25de23e6efe96b831da6e60 Mon Sep 17 00:00:00 2001
From: Aaron Edwards <aaron@uglyrobot.com>
Date: Wed, 3 Jul 2024 19:29:40 -0500
Subject: [PATCH] Fix rewriting of URLs until initial sync is complete

---
 inc/class-infinite-uploads.php |  6 +++++-
 infinite-uploads.php           |  6 +++---
 readme.txt                     | 14 ++++++++++----
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/inc/class-infinite-uploads.php b/inc/class-infinite-uploads.php
index b33c743..ef7f046 100644
--- a/inc/class-infinite-uploads.php
+++ b/inc/class-infinite-uploads.php
@@ -124,7 +124,6 @@ public function setup() {
 
 		add_filter( 'infinite_uploads_sync_exclusions', [ $this, 'compatibility_exclusions' ] );
 
-		// don't register all this until we've enabled rewriting.
 		if ( ! $this->api->has_token() ) {
 			add_action( 'admin_notices', [ $this, 'setup_notice' ] );
 			add_action( 'network_admin_notices', [ $this, 'setup_notice' ] );
@@ -132,6 +131,11 @@ public function setup() {
 			return true;
 		}
 
+		// don't register all this until we've enabled rewriting.
+		if ( ! infinite_uploads_enabled() ) {
+			return false;
+		}
+
 		$this->register_stream_wrapper();
 		add_action( 'shutdown', [ $this, 'stream_wrapper_debug' ] );
 
diff --git a/infinite-uploads.php b/infinite-uploads.php
index 8f54dea..c097374 100644
--- a/infinite-uploads.php
+++ b/infinite-uploads.php
@@ -2,7 +2,7 @@
 /*
  * Plugin Name: Infinite Uploads
  * Description: Infinitely scalable cloud storage and delivery for your videos and uploads made easy! Upload directly to cloud storage and manage your files right from the WordPress Media Library.
- * Version: 2.0.1
+ * Version: 2.0.2
  * Author: Infinite Uploads
  * Author URI: https://infiniteuploads.com/?utm_source=iup_plugin&utm_medium=plugin&utm_campaign=iup_plugin&utm_content=meta
  * Text Domain: infinite-uploads
@@ -14,10 +14,10 @@
  *
  * Inspired by AWS PHP SDK stream wrapper code from the S3 Uploads plugin by Human Made https://github.com/humanmade/S3-Uploads.
  *
- * Copyright 2021 UglyRobot, LLC
+ * Copyright 2021-2024 UglyRobot, LLC
 */
 
-define( 'INFINITE_UPLOADS_VERSION', '2.0.1' );
+define( 'INFINITE_UPLOADS_VERSION', '2.0.2' );
 
 if ( defined( 'WP_CLI' ) && WP_CLI ) {
 	require_once dirname( __FILE__ ) . '/inc/class-infinite-uploads-wp-cli-command.php';
diff --git a/readme.txt b/readme.txt
index 58f5439..04e345b 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,9 +1,9 @@
 === Infinite Uploads - Offload Media and Video to Cloud Storage ===
 
 Requires at least: 5.3
-Tested up to: 6.4
-Stable tag: 2.0.1
-Requires PHP: 5.6
+Tested up to: 6.6
+Stable tag: 2.0.2
+Requires PHP: 7.0
 Contributors: uglyrobot, jdailey
 Tags: cloud storage, media cloud, encoding, offload, video, streaming, s3, google cloud storage, spaces, storage, cdn, cloud sync
 License: GPLv2
@@ -152,7 +152,7 @@ Infinite Uploads is a hybrid custom stack built and hosted with multiple enterpr
 
 = Why can't I just use AWS S3, Google Cloud Storage, Azure, etc? =
 
-There are plugins for that, but they all have expensive per-site or per file annual license fees. And then you have to figure out how to signup for and configure complicated cloud providers and CDNs.
+There are plugins for that, but they all have expensive per-site or per-file annual license fees. And then you have to figure out how to signup for and configure complicated cloud providers and CDNs.
 Finally, while the per/GB prices of cloud storage may seem cheap, there are all the hidden costs you don't realize like class A/B/C/D API transaction costs, and bandwidth x3 (to cloud > to cdn > to user). Bandwidth costs alone can often total 8x more than your storage bill!
 Infinite Uploads makes the power of the cloud simple and affordable for non-cloud architects like you.
 
@@ -170,6 +170,10 @@ Infinite Uploads makes the power of the cloud simple and affordable for non-clou
 
 == Changelog ==
 
+2.0.2 - 2024-07-03
+----------------------------------------------------------------------
+- Fix rewriting of URLs until initial sync is complete
+
 2.0.1 - 2023-10-24
 ----------------------------------------------------------------------
 - Fix corrupt unzipping errors on manual plugin upgrades
@@ -244,6 +248,8 @@ Learn how to get the most out of your cloud-hosted files on our blog:
 
 [Contribute to the plugin's development on Github!](https://github.com/uglyrobot/infinite-uploads/)
 
+Want to use your WordPress site to train an AI chatbot to provide instant answers to your customers? Check out our sister project [DocsBot AI](https://docsbot.ai/?utm_source=wordpress.org&utm_medium=readme&utm_campaign=iu_readme)!
+
 Enjoy!
 
 == Contact and Credits ==