Home › Forums › Backend Issues (wp-admin) › JS performance issues › Reply To: JS performance issues
No solution here, just some thoughts.
The JS issue will cause the admin page to be sluggish do to the way that ACF4 tests conditional logic. ACF5 has improved this…. but if you have a highly complex field groups setup with a lot of conditional logic, you’re still probably going to see problems and a slow down.
The second issue, slow saving. This is an issue with the way that WP updates meta values. Every update query for every field in ACF produces at least 4 DB queries. First WP checks to see if there is already a value for a field and then it updates the value for the field. Sometimes it then does a new query to get the new value and populate the cache… why it needs to do this 3rd one, HTH knows. This is done twice for each field because ACF also needs to update the field key reference for the field. This is a limitation of WP because when updating it deals with one meta field at a time. It may be possible to improve this by adding an acf/save_post filter that gets all the post meta for a post before doing an update… but I have not tested this theory. At any rate, given enough fields on a single update it is possible that the update will time out in the browser before it completes. Fixing this problem I suspect is beyond the scope of what ACF is meant to do. Now, if someone could come up with a way to bypass this one at a time field update…. I’ve thought about it but I simple don’t have the time.
On top of both of these issues is the fact that validation of field values is done on the server using AJAX. Part of the reason for this is to allow us, the developers, to create custom validation filters. This is an extra step that means the a post is actually sent to the server twice before it’s updated.
My solution is to consider the limitations and plan my development around those limitations. What is logically possible and what is possible in practice are not the always the same thing. If I give a user a repeater field to add images and content with I expect them to be practical and not add 10,000 images to the repeater, although I wouldn’t be surprised if they tried.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.