WP Residence Help WP Residence Help

  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API
Home / FAQ / Database query- How the theme works

Database query- How the theme works

3559 views 0

When doing searches or any other database related requests we are always using the wordpress api. – more exaxctly the wp api instruction called wp_query https://codex.wordpress.org/Class_Reference/WP_Que…

We are NOT using our custom SELECT’s or any other manual query to the sql database. This is the best practice when writing WordPress themes and themeforest will not even accept the theme for sale if it will have such direct queries.

We also did not add new custom tables but use only the ones in a wordpress default install.

Now, since we are using the wordpress api and we are using the default tables it means that all the queries are are made by WordPress core.

We have had many clients that said  that the the loading times are very very slow because the database is not optimized and goes to retrieve slow query. This is equivalent with saying wordpress db design is a poor one. Which  we think is not the case.

Any other wordpress theme will use the same mechanism so is not something particular to us.

Since we did not create custom tables we did not add indexes on any tables . The reason your indexes are not used is probably because the wp queries are not needing those.  Please look over this document

https://codex.wordpress.org/Database_Description and see the database structure and also see the index chapters.

So far(we have 5+ years in working with wp ) the only problems we discover are related to the meta_query part of a wp_query . In your case meta_query are the Features And Amenit ies from the search form . This is a real problem on wordpress an you can see more details here http://wordpress.stackexchange.com/questions/15889…

However the latest updates comes with a partial rewrite of the search algo while the version will release next week will have the full implementation of the solution.

When you have search speed issues, the step in this investigation is to look how the mysql is configured and if any search you are doing is increasing the load on it.

Also you can work on a fine tuning with indexes – although i don;t think you will be able to improve it.

Go to advanced_Ssearch_results.php and do a print_r($prop_selection);

This will print the results object of the wp_query and it will show you the actual mysql query wordrpress does.

 

FAQ

Related Articles

  • Error on Single Property Page: Call to undefined function wpestate_return_property_address()
  • Create custom Login/Register buttons in elementor
  • How to change the login icon on mobile.
  • Core Plugin deactivates when another theme, different than WpResidence is activated

WP Residence Documentation

  • 1. General
    • How to Get Support
    • Get your buyer license code.
    • Use SSL / https
    • Server / Theme Requirements
  • 2. Installation
  • 3. Installation FAQ
  • 4. Advanced Search
    • Advanced Search Display Settings
    • Advanced Search Form
    • Geolocation Search for Half Map
    • Save Search Theme Options
    • Advanced Search Colors
  • 5. Agent, Agency & Developers
  • 6. Property Page
  • 7. Properties List
  • 8. Property Taxonomies
  • WpResidence Elementor Studio
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List Properties or Articles by ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Icon Content Box Shortcode
  • 12. Widgets
  • Theme Options
    • General Settings
    • User Types Settings
    • Appearance
    • Logos & Favicon
    • Header
    • Footer Style and Colors
    • Price & Currency
    • Property Custom Fields
    • Features & Amenities
    • Listing Labels
    • Theme Slider
    • Permalinks
    • Splash Page
    • Social & Contact
    • Map Settings
    • Pin Management
    • How read from file works
    • General Design Settings
    • Custom Colors Settings
    • Header Design & Colors
    • Mobile Menu Colors
    • User Dashboard Colors
    • Print PDF Design
    • Property, Agent, Blog Lists Design Settings
    • Sidebar Widget Design
    • Font management
    • How to add custom CSS
    • Custom Property Card Unit – Beta version
    • Email Management
    • Import & Export theme options
    • reCaptcha settings
    • YELP API Integration
    • iHomefinder Optima Express IDX
    • MEMBERSHIP & PAYMENT Settings
    • Property Submission Page
    • PayPal Setup
    • Stripe Setup
    • Wire Transfer Payment Method
  • Translation
  • FAQ
  • Pages
  • Header
  • Footer
  • Google or Open Street Maps
  • Payment Options
  • Plugins
    • Included Plugins
    • Third Party Plugins – IDX Compatibility
    • Third Party Plugins – Multi Languages
    • Third party Plugins – Other
  • Technical
    • Technical how to | Custom Code Required
    • Technical: Child Theme

Join Us On

Powered by WP Estate - All Rights Reserved
  • WpEstate
  • How to Build Your Website
  • Video Tutorials
  • Client Support
  • API