How to prevent action in ajax request, when in admin side?

After testing a lot of things, I found this function, which works: function is_admin_request() { /** * Get current URL. * * @link https://wordpress.stackexchange.com/a/126534 */ $current_url = home_url( add_query_arg( null, null ) ); /** * Get admin URL and referrer. * * @link https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/pluggable.php#L1076 */ $admin_url = strtolower( admin_url() ); $referrer = strtolower( wp_get_referer() ); … Read more

Creating an Exit Confirmation Popup

First things first, change the name of the functions – you have them the same as the tutorial – as a rule, always make them something unique just to reduce the possibility of conflicts. So instead of wpb_confirm_leaving() you should maybe change it to something like jkkr_confirm_leaving. Just make sure you change it everywhere. But … Read more

WordPress web page struggling with performance

Your site appears to be pretty well structured in most ways and you’re getting a good score. If you’re seeing a huge swing day to day, test to test, etc, then it’s probably a hosting related issue. What type of hosting are you on? Is it cloud, is it shared, is it WordPress specific? https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwww.greenstuff.sk%2F&tab=desktop … Read more

Generate JWT Token without username and password

For the developers who are facing the similar issue here is what I have done to achieve the desired results. The best way would be to develop the functionality from scratch but due to a tight deadline I opted to modify the JWT Auth Plugin I have modified the method get_token in the file class-auth.php. … Read more

How can I use RDFa with WordPress?

As far as I know, there are no plans to implement RDF into WordPress. RDFa on the other hand can be quite easily implemented by any theme or plugin author by simply adding the RDFa attributes to the generated markup. Writing a plugin to expose WordPress’ taxonomy as RDF wouldn’t be hard and making it … Read more