[wp-trac] [WordPress Trac] #60299: Default assignment of `use_ssl` user meta value causes unnecessary DB write.

WordPress Trac noreply at wordpress.org
Mon Sep 30 20:11:54 UTC 2024


#60299: Default assignment of `use_ssl` user meta value causes unnecessary DB
write.
-------------------------------------------------+-------------------------
 Reporter:  prettyboymp                          |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.7
Component:  Users                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  testing-info needs-testing                     |  performance
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 > a comparison against the current values in the database prior to running
 an update query

 Reviewing this again, I wonder if we can use a different approach for the
 fix. My concern with altering the `use_ssl` meta value is the many other
 plugins already using the field and possibly expecting the existing type,

 > because the DB returns a string value ('1' or '0') while the meta_value
 is set to a boolean value by default the comparison always fails causing a
 write when not needed.

 Could we cast the values to the same type before/when comparing them?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60299#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list