islp
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: What’s the best way to deal with the nonce expiration?You must define “idle”: for example, we can have a user that comes back to that page every 3 hours and he could have the same nonce in every session.
Reloding the page or restarting the app is not good UX practice: I should eventually store the state of the JS application, but at the moment it’s too much work and there’s not enough time.
Thanks for pointing out what a nonce is.
I haven’t tried it, it’s very interesting, even if a prefer, as long as it works, the solution by Jacob Peattie
Forum: Developing with WordPress
In reply to: What’s the best way to deal with the nonce expiration?Problem isn’t the session expiration: problem is a session expiration in an edge case. ??
Nonce, in general, is quite useful, maybe less useful than other things (eg. user_can), but in any case useful as an “added value”.
Forum: Developing with WordPress
In reply to: What’s the best way to deal with the nonce expiration?I must say I should have tried but… I don’t remember where I red if you consecutively create a nonce this thing has no effect because there can be only one nonce with that name and, once set, it stays 12/24 hours. But… if you say what you are saying, this information could be wrong. Now I try and see what happens.
Forum: Developing with WordPress
In reply to: What’s the best way to deal with the nonce expiration?I’d like to avoid this thing for a usability reason: since I can’t restore the state of the app (I can, but I should do some work at the moment I can’t do), the user should go out to the login page, access again the page of the app, use again the app, send the data…
Is there something like refreshing a nonce? I could do the following: when the page is accessed, I verify (if this is possible) the “age” of the nonce and, if it’s too old, I generate a new one. Is this possible?
@bcworkz: my theme has a little panel where you can put some CSS, but this has “global scope”, not something I can load into a single page.
Isn’t strange to create a child-theme only to overwrite 4 rules of the main theme?
Consider that, before rethinking that page and the application inside that page, the CSS was simply pasted into the page HTML body (of course this is not valid HTML, but it worked) ??
(it works! I must say I was about to complete my first child-theme, even if for a simple thing like this one it looked like a little overkill. And it left opened two questions: “how to add my style to my child theme”. I suppose this was something I had to do in the functions.php of the child-theme)
Ok, perfect, thank you very much ??
Ok, you’re suggesting a thing like this one:
function last() { // } add_action('wp_enqueue_scripts','last', PHP_INT_MAX);
and then work on CSS !important too (or similar solution).
Have I understood well? ??
Forum: Fixing WordPress
In reply to: Direct access to wp-jsonOk, thanks
Forum: Fixing WordPress
In reply to: Direct access to wp-json(I meant custom endpoint, sorry)
Forum: Fixing WordPress
In reply to: Direct access to wp-jsonThe fact that I have (for example) a custom plugin, its URL is listed there, and someone can to brutally request it ?? Things like that
Forum: Developing with WordPress
In reply to: Send data from a WP page using AJAXThe right tool totally depends on your needs (what you must do now and how could one day grow your project), and your skills too.
I come from a RIA background, now I’m a mobile developer (mainly Obj-C/Swift), I’m quite proficient with JS and PHP (I’m looking into Laravel this days) but absolutely not very good at WP, and sometimes I found myself using a lot personal insight, experience and senses I didn’t suspect I had ?? In SPAs, I played a little with EmberJS (very good, but really “big”, and you must find the right project) ??
Forum: Developing with WordPress
In reply to: Send data from a WP page using AJAXThanks, very interesting, I was reading this old post and found some more infos: https://solislab.com/blog/5-tips-for-using-ajax-in-wordpress/
Anyway, a REST API would be more interesting. I didn’t use Angular, I’m exploring Vue, Angular was a little “too much” for what I was going to do, and Vue scales quite well. ??
Forum: Fixing WordPress
In reply to: Rendering Vuejs app inside common pageOk, thanks, I’ll look into this ??