How to live update data in WordPress

How to live update data in WordPress
0.0 0

#1

Hi,

Can I get any examples on how to update data on page live in WordPress ? The data should get updated from database. Something like chat application - I want to implement that on a auction site where people are bidding and as soon as bid is done it should update on aution page with live data that how many bids are done. Dont want to use pgp websockets.


#2

WordPress is not what I would use to do this. A proper application is the best idea.


#3

I already have existing WordPress application where I need to update. Want to update a page continuously with live data from database.And do not want to use php websockets


#4

What about https://socket.io/


#5

SSE is a better alternative, since it’s not bi-directional as WebSockets and usually easier to implement.

Although for WordPress I don’t think there is a pre-made solution.


#6

I think this uses php web sockets. So cant use it


#7

Thanks for it :). I will check that


#8

Hello,

Can we use WordPress REST api to do that ? Anybody can suggest any links or plugins which are already available?


#9

Yes, REST API might help you. But I would too not recommend using WordPress for this kind of task.


#10

The problem is once the backend renders the webpage and returns it to the client The WordPress loop is over. One possible method ( and I have not tried it, but it seems it may work ) is the following:

http://www.developerdrive.com/2012/03/pushing-updates-to-the-web-page-with-html5-server-sent-events/


#11

Thanks for sharing that :). I will check that in detail. But demo does not work and not sure if this is a good idea for heavy database or sites with heavy traffic?