Live Blog

WordPress Plugins Disappearing or Erroring After Update – Disabling Cloudflare Speed Brain

Content Error or Suggest an Edit

Notice a grammatical error or technical inaccuracy? Let us know; we will give you credit!

Introduction

If you recently tried to update your WordPress website’s plugins, you might have run into issues where the plugins will fail and then disappear. Sometimes the plugin will error with a number of different messages.

Installation failed: Could not copy file.
Installation failed: The package could not be installed. PCLZIP_ERR_MISSING_FILE
Update Failed: Could not copy file.
WordPress Update Failed: the package could not be installed missing file

You might also have errors in Chrome console.

updates.min.js?ver=6.6.2:2 Uncaught TypeError: Cannot read properties of undefined (reading 'attr')
    at g.updates.updatePluginError (updates.min.js?ver=6.6.2:2:8930)
    at c (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:25304)
    at Object.fireWith [as rejectWith] (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:26053)
    at Object.<anonymous> (wp-util.min.js?ver=6.6.2:2:1230)
    at c (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:25304)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:26053)
    at l (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:77782)
    at XMLHttpRequest.<anonymous> (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2:80265)
g.updates.updatePluginError @ updates.min.js?ver=6.6.2:2
c @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
fireWith @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
(anonymous) @ wp-util.min.js?ver=6.6.2:2
c @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
fireWith @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
l @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
(anonymous) @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
load
send @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
ajax @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
(anonymous) @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:5
e.<computed> @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:5
(anonymous) @ wp-util.min.js?ver=6.6.2:2
(anonymous) @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:5
e.<computed> @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:5
send @ wp-util.min.js?ver=6.6.2:2
g.updates.ajax @ updates.min.js?ver=6.6.2:2
g.updates.updatePlugin @ updates.min.js?ver=6.6.2:2
(anonymous) @ updates.min.js?ver=6.6.2:2
dispatch @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
v.handle @ load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.6.2:2
videopreview.html:13 
        
        
       GET blob:chrome-extension://blimjkpadkhcpmkeboeknjcmiaogbkph/4ec1906d-f4b3-4cef-a608-a88eaefe09ed net::ERR_FILE_NOT_FOUND
plugins.php:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
plugins.php:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
plugins.php:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
background.js:373 Error: An error occurred. See https://git.io/JUIaE#17 for more information.
    at T (background.js:1:3590)
    at background.js:1:5953
    at new e (background.js:1:5959)
    at t.getTag (background.js:1:7814)
    at t.insertRules (background.js:1:8127)
    at e.generateAndInjectStyles (background.js:1:9640)
    at background.js:1:15784
    at background.js:1:15848
    at _ (background.js:1:16250)
    at Gi (background.js:373:57930)
es @ background.js:373
n.callback @ background.js:373
di @ background.js:373
is @ background.js:373
hl @ background.js:373
t.unstable_runWithPriority @ background.js:381
Wa @ background.js:373
pl @ background.js:373
Js @ background.js:373
(anonymous) @ background.js:373
t.unstable_runWithPriority @ background.js:381
Wa @ background.js:373
Ha @ background.js:373
Va @ background.js:373
gl @ background.js:373
t.unstable_runWithPriority @ background.js:381
Wa @ background.js:373
ml @ background.js:373
(anonymous) @ background.js:373
B @ background.js:381
k.port1.onmessage @ background.js:381
Show 21 more frames
Show less
background.js:1 Uncaught Error: An error occurred. See https://git.io/JUIaE#17 for more information.
    at T (background.js:1:3590)
    at background.js:1:5953
    at new e (background.js:1:5959)
    at t.getTag (background.js:1:7814)
    at t.insertRules (background.js:1:8127)
    at e.generateAndInjectStyles (background.js:1:9640)
    at background.js:1:15784
    at background.js:1:15848
    at _ (background.js:1:16250)
    at Gi (background.js:373:57930)
T @ background.js:1
(anonymous) @ background.js:1
e @ background.js:1
t.getTag @ background.js:1
t.insertRules @ background.js:1
e.generateAndInjectStyles @ background.js:1
(anonymous) @ background.js:1
(anonymous) @ background.js:1
_ @ background.js:1
Gi @ background.js:373
Do @ background.js:373
gs @ background.js:373
ul @ background.js:373
sl @ background.js:373
Js @ background.js:373
(anonymous) @ background.js:373
t.unstable_runWithPriority @ background.js:381
Wa @ background.js:373
Ha @ background.js:373
Va @ background.js:373
gl @ background.js:373
t.unstable_runWithPriority @ background.js:381
Wa @ background.js:373
ml @ background.js:373
(anonymous) @ background.js:373
B @ background.js:381
k.port1.onmessage @ background.js:381
Show 27 more frames
Show less

Trying from an incognito browser or from a VPN didn’t seem to change anything.

The Cause? Cloudflare Speed Brain

There is a new feature that Cloudflare is beta testing that is being enabled by default on all Cloudflare free plans, that feature is called “Speed Brain”. You can read more about it here.

Speed Brain | Cloudflare Speed docs
Speed Brain is a tool for improving web page performance by prefetching the most likely next navigation.
developers.cloudflare.com

Here’s a quote from the above article.

What is Speed Brain?

The overall goal of Speed Brain is to try to download a webpage to the browser before a user navigates to it.

Cloudflare leverages the Speculation Rules API ↗ to improve web page performance by instructing the browser to consider prefetching future navigations. Speed Brain does not improve page load time for the first page that is visited on a website, but it can improve it for subsequent web pages that are navigated to on the same site.

By prefetching pages that the browser considers likely to be navigated to, Speed Brain can enhance key metrics like Largest Content Paint ↗ (LCP), Time to First Byte ↗ (TTFB) and overall page load time.

So when you’re logged into your site, with Cloudflare proxy enabled on a free plan, and try to update plugins or WordPress. You might run into this issue where Cloudflare Speed Brain will pre-fetch the update links, which proceeds with the update but closes the connection before the update completes.

Resolution

Since this feature is only imperative to the front end of a WordPress site, it doesn’t need to be activated in the backend of a WordPress site.

Disable Speed Brain Completely

  1. Log in to your Cloudflare account ↗, select your account and go to a specific domain.
  2. Go to Speed > Optimization
  1. Click on the “Content Optimization” tab and toggle Speed Brain to On or Off.

Disable Speed Brain on WordPress Admin

Currently there isn’t a method to just disable Speed Brain on specific URL’s using “Configuration Rules” or “Page Rules”

However, you can use an inline html element or HTTP headers pointing to a json file. Here’s a reference to the “Speculation Rules API” which talks about both.

Speculation Rules API – Web APIs | MDN
The Speculation Rules API is designed to improve performance for future navigations. It targets document URLs rather than specific resource files, and so makes sense for multi-page applications (MPAs) rather than single-page applications (SPAs).
developer.mozilla.org

Conclusion

Speed Brain isn’t always Active

I had a case where I wasn’t experiencing the issue, however someone else was and this is what is written on the toggle for Speed Brain.

NOTE: Speed Brain is currently in Beta testing. Even when enabled, it might not be actively running at all times on your website.

Speed Brain only Pre-Fetches Cached Content

Something else to consider, as per the documentation, if the content isn’t cached, it won’t be pre-fetched https://developers.cloudflare.com/speed/optimization/content/speed-brain/

Prefetch requests will never reach origin servers. Prefetch requests only serve content that is stored in Cloudflare’s Cache. If the content is not in Cache, the prefetch request will not continue to origin servers. Without this safeguard, origin server state could be modified despite the prefetch response not being rendered in the browser. An example of this could be a prefetch GET request to a sign-out URL inadvertently triggering a sign-out action on the server.

So it’s quite possible that if you’re caching the entire site including /wp-admin then this could be the culprit.

Cloudflare Support Thread

There is a support thread on the Cloudflare Community Forums that talks about this issue. I’ve posted.

https://community.cloudflare.com/t/cloudflare-speed-brain-feedback-wordpress-delete-trash-errors/722992/4

Sources

0 Shares: