Comments (9)
This exact point (sometimes slow response) is mentioned in the plugin's disclaimer.
The states and cities need to be loaded once to create the transient, which speeds up the process.
You could manually call the transient function when loading the field ? So it's created already when it's needed.
Is there are reason to pre load all cities right after load states?
Cities are loaded after country change, not after load states s not sure what you mean.
It looks that it makes second request for load all cities and in cases like India it is about 2.7s.
I didn't provide any country packages for India, so I can't take responsibility for that file, since I don't know the contents.
from acf-city-selector.
@Beee4life the point is to not trigger load of cities after select country if state is not selected, now it tries to get all cities within country. I am not so good understand WP logic behind this, but this can be problem for users, the UI is stuck within big countries.
from acf-city-selector.
That's why I suggested a preload. I changed this on purpose a few versions ago... to try and minimize the loading time.
from acf-city-selector.
I'm not saying that was the ideal/perfect decision... because state is still obligated to enter (if you don't choose 'country + city'), so I will look into it, if I have some time.
from acf-city-selector.
Ok, I understand the logic behind this it make sense, thanks for looking on this.
from acf-city-selector.
I am focusing right now on cleaning code to get the plugin into the official WP repo so that has priority.
from acf-city-selector.
I have removed the loading of cities on change country, see here. Now only states are loaded.
I will optimize it a bit more later on.
from acf-city-selector.
Thank you, it works better now.
from acf-city-selector.
Good, then I'll close this topic for now.
from acf-city-selector.
Related Issues (20)
- front end users can't search these cities, states and countries? HOT 1
- No Country or City pr State are showing after importing csv file correctly. HOT 2
- Custom post type archives based on city selector fields HOT 8
- use in elementor or jet engine form HOT 1
- Raw import not working & some city files not available HOT 5
- I see countries but not cities HOT 25
- GB csv full of errors HOT 3
- Canada file - just downloaded - 2 errors HOT 3
- Not returning enough cities HOT 7
- Preview Doesn't Return data HOT 4
- Cities not displaying into select list in custom post type edition HOT 1
- meta query search/filter HOT 3
- Search&Filter HOT 2
- Failure in importing Chinese city names:upload was successful, but filed form showed nothing and preview was blank HOT 15
- South Africa! HOT 2
- India HOT 1
- Small field select2 HOT 6
- Transient bypasses WP localization function HOT 4
- US Countries not working. HOT 3
- Add Armenia Country HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf-city-selector.