Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#45108 closed defect (bug) (invalid)

WordPress is making a request in background

Reported by: iulianflst's profile iulianflst Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.8
Component: General Keywords: 2nd-opinion needs-testing
Focuses: Cc:

Description

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 5 years ago.
phpmyadmin result after refreshing the page just once with all plugins disabled

Download all attachments as: .zip

Change History (4)

@iulianflst
5 years ago

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

#1 @iulianflst
5 years 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
5 years 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 5 years ago by SergeyBiryukov (previous) (diff)

#3 @SergeyBiryukov
3 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.