Make WordPress Core

Opened 14 months ago

Last modified 14 months ago

#45108 new defect (bug)

WordPress is making a request in background

Reported by: iulianflst Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.8
Component: General Keywords: 2nd-opinion needs-testing close
Focuses: Cc:
PR Number:


Something very weird is going one, here are the steps to reproduce:

  1. Add a $wpdb->insert into header or footer
  2. refresh the page

Expected results: A single entry in database

Actual result: 2 entries

More details: If you check the http referer you will see is the referer of the current page

So it looks like somehow there is another request that is triggering the insert. Weird part is that it does not show up in newtwork xhr request when you debug it.

I marked this as critical, because is doing another request -> this will result in slower website due to multiple request!!!

Attachments (1)

thebug.jpg (114.0 KB) - added by iulianflst 14 months ago.
phpmyadmin result after refreshing the page just once with all plugins disabled

Download all attachments as: .zip

Change History (3)

14 months ago

phpmyadmin result after refreshing the page just once with all plugins disabled

#1 @iulianflst
14 months ago

I forgot to mention that I'm using Twenty Seventeen theme with all plugins disabled except the one I'm building ...

I checked via var_dump ( id_saved) and I got only 1 result (but multiple results in database)

#2 @SergeyBiryukov
14 months ago

  • Keywords close added
  • Severity changed from critical to normal

Hi @iulianflst, welcome to WordPress Trac!

This is generally caused by browser prefetching, see #12603, #14382, #19018, #20192, #21658, #28797, #32290.

Some browsers automatically load any <link> elements with rel="next" or rel="prefetch".

I don't think there's a bug here.

Last edited 14 months ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.