Coder Social home page Coder Social logo

Comments (9)

Beee4life avatar Beee4life commented on September 27, 2024

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.

Akots avatar Akots commented on September 27, 2024

@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.

Beee4life avatar Beee4life commented on September 27, 2024

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.

Beee4life avatar Beee4life commented on September 27, 2024

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.

Akots avatar Akots commented on September 27, 2024

Ok, I understand the logic behind this it make sense, thanks for looking on this.

from acf-city-selector.

Beee4life avatar Beee4life commented on September 27, 2024

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.

Beee4life avatar Beee4life commented on September 27, 2024

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.

Akots avatar Akots commented on September 27, 2024

Thank you, it works better now.

from acf-city-selector.

Beee4life avatar Beee4life commented on September 27, 2024

Good, then I'll close this topic for now.

from acf-city-selector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.