ayice
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’For people wanting to see the solution I can send you the function I used here:
function getIssuesData() { if (class_exists('wfIssues')) { $issues = wfIssues::shared()->getIssues(0, WORDFENCE_SCAN_ISSUES_PER_PAGE, 0, WORDFENCE_SCAN_ISSUES_PER_PAGE); $issueCounts = array_merge(array('new' => 0, 'ignoreP' => 0, 'ignoreC' => 0), wfIssues::shared()->getIssueCounts()); return array( 'issues' => $issues, 'issueCounts' => $issueCounts, ); } else { return array( 'body' => 'Have you installed WordFence? We can not find the "wfIssues" class', 'status' => 404 ); } }Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Great suggestion, hadn’t even considered that thank you again 🙂
Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’@joyously Hi again Joy
Just to let you know it works now, but not with thedo_action()or any other wp hooks. I looked through WordFence code and used some of the functions they had in one of their classes, which returned the data I wanted ! 🙂So now I am all good for the school project 😉
Thank you very much for your patience while answering my questions and thank you for spending some time, trying to help me 🙂
Happy new year 😉
Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Okay thank you @joyously I will look into it 😀
I was hoping for a way to request the rest api from a wp_hook or something. But I see that is not possible 🙂Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Okay great, The problem is, I haven’t made the action, its inside the plugin.
Can you give me an example of how to trigger this action from php, thank you ?
Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Basically I want a function that kinda does the same as an HTTP request to the
admin-ajax.phpfile. But within php code? Is this possible ? 🙂Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Just to clarify, when I send an AJAX request to the
admin-ajax.phpfile with an ‘action’ in the body. Am I not tellingadmin-ajaxto run a certain functionality and maybe return a value ?Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Oh okay, that makes sense.
I know that an action, is not containing data, but the request to call that action returns data, maybe that is more accurate ?
I will try
do_action()and see if that does the trick 🙂I already spoke with the WordFence guys, but they didn’t think this was possible, but it is, I already made it work from the frontend, but now I want PHP to return the data 🙂
Forum: Developing with WordPress
In reply to: wp_remote_request returning ‘400 Bad request’Hi @joyously
Maybe I misunderstood what wp_remote_request does.
All I need is to make a request to the admin-ajax.php file to get some data and return this to my other site 🙂What I want is to access the data in the
'wordfence_loadIssues'action and return it to my other site 🙂When writing my own route, can I return an this data ?
I’m new in trying to work with WP like this, so I don’t know if this is possible ? 😀
Hope you can help meHi happy new year
Thanks for the clarification 😊
Hi again @wfphil
I would like to show wordfence data without actually going to the wordfence central.
I have a dashboard where I am showing a lot of different information about different websites and here I thought it would be cool if I could add the number of issues from wordfence for each site to get a quick overview.Hi
Thank you for the quick response.
What I understand from your answer is that ppl want to access the WordPress entry of WordFence, but I want to access the WordFence Central Dashboard on WordFence.com.
(Maybe this is not the place?)Just to clarify:
All I want to fetch from WordFence Central is the number of issues and eventually what these problems are.