Can we use a webservice with Wordpress? - wordpress

I change the details with the new information.
Here is the situation: Our customers have Wordpress sites, they can customize it as they wish with the theme of their choice. Our customers were originally on another CMS with some features provided by an external webservice. My question at the beginning was, can we use an external webservice with Wordpress? The answer is yes, I know it. I even discovered through other forums and research the wp_remote functions. (request, post, get)
I made a Wordpress plugin, in order to have a solution whatever the theme chosen by the user. It is a search widget that will communicate with a specific function of the external webservice to receive the information that the client wants.
My question is now this: Once my plugin has communicated with my external webservice and retrieved the necessary information from the client. What do you advise me to do to integrate this data into the site? (To have a correct display on a page)
At first, I used the wp_insert_post function to add my search content as a post to the site. The display was fine, which is what I wanted, but the method of getting this result.... is confusing to me.
Thanks for your answers.

Related

Separate plugins or one giant plugin on WP

I’m building a WP plugin to enhance a website, and come to an interrogation with the workflow.
Basically, I have to create a custom post type, assorted with several custom taxonomies, which will be used/displayed on the frontend and backend, and create a backend section in order to interact with our CRM, and Supabase via their respective APIs (service centralisation).
All of the second part is only intended to be used/displayed on the admin section, to logged users.
However, when creating/saving a custom post type, or when viewing it from the frontend, I have to make a GET request to the CRM to fetch some data and store it in JSON somewhere (24h cache).
That I can do.
At the moment, I worked on the CPT part, and made a class to interact with the CRM, with credentials stored in wp_options. I now have to work on the backend part.
My question is: what are the best practices here? Keep it in a single plugin or divide into several plugins?
And if I divide, how should I turn it? 2 plugins, one for the CPT and one for the backend? Or go even deeper, and get the CRM and Supabase their own simple plugin, and call their methods to make my requests?
I am short of ideas here, so if you encountered this situation, could you enlighten me?

Using WordPress, how do I create a lead web form that does POST server side to a web api?

Is this even possible? My company has literally spent 6 months trying to figure out how to accomplish this task. Many people within the company feel the task is so simple, that it is self evident that wordpress can do this. However, the feature has still not been delivered. Which makes me question whether wordpress has the ability to accomplish this. (obviously we can accomplish in another tech stack, like asp.net, etc. But we need to know if this is technically possible within wordpress)
The page within WordPress needs to contain a form that does both client side and server side validation. The POST to the web api needs to be done server side.
Any and all help appreciated. Thank you in advance!
Are we making the false assumption that WordPress is capable of this?
Yes it is possible.
You can make a template for a page with HTML+Java​Script
code. Make validation in the browser. Then send the data to the server through AJAX and check it. At the end get an answer from server.
Also you can create widget or plugin and paste your form( +validation ) with needed code inside any page of your site through shortcode.
And besides with WordPress REST API you can do server validation on any platform that can work with JSON.
Edit
If you need the other pages or any content, you can create server side HTTP POST request via cURL or other libraries from PHP. With data taken from front-end form.
But if you don’t need content management system, then using WP doesn't have any sens. Only because of the one form and server code for HTTP POST request.

How to create an offline form for submitting WP posts

You may have seen WP plugins that allow guests to submit posts. Those submissions proceed to the WP posts area where the admin can edit/publish them.
I want to create a form like this that I can install on my (and other people's) computers, so they can fill out the form fields for a WP post, save offline, then send to my WP site when ready.
Can anyone tell me the steps involved, and, if there is a description for what type of thing this is, please let me know to aid my search.
I am learning code at present and want to learn while building tools.
Thanks
Hi hope I can give you some hints with this answer.
I don't know what programming language you would like to use, but for the communication with your Wordpress blog you could use the WP API to create a post over REST API. It offers a API to create and edit your Wordpress Posts over HTTP.
Your programm just have to check if an connection is possible and then execute the API calls.
You could use an database to store all created post and then call the Create Post Task with the POST Method over HTTP for each post saved offline.
When the creation was successful you could update your offline database, so that the post is marked as already created.

Wordpress XMLRPC advice needed

I have been tasked with creating an API for retrieving and adding content to Wordpress from a flash application and legacy CMS (non-PHP). My plan is to utilise the existing default xmlrpc endpoint and add any additional functionality by creating a plugin which hooks into xmlrpc_methods.
A previous attempt had been made by another developer based on the following code:
http://blog.5ubliminal.com/posts/remote-control-wordpress-blog-xmlrpc-api/
This code looks unwieldy and poorly documented to me and my preference would be to use this approach:
http://kovshenin.com/archives/custom-xml-rpc-methods-in-wordpress/
I would be grateful if anyone with experience in this area could confirm that:
I will be able to distinguish between separate blogs in an MU installation when both retrieving and posting data via XMLRPC
I will be able to retrieve and post to custom fields
writing a plugin is the way to go.
We do not have the option of using Wordpress 3 as it is still in Beta and we are under time pressure.
I would greatly appreciate appreciate any input / advice.
Many thanks,
I've worked with WordPress' XMLRPC system before (using a WP-Hive installation with multiple separate blogs similar to a WPMU set-up). The new approach you're using is definitely simpler and easier to implement (I tried the 5ubliminal one as well the first time).
Whether or not you can distinguish between separate blogs in a MU installation depends entirely on how you build your handler function. You can build it to distinguish the separate blogs, to only function on specific blogs, or to treat the entire system as a single WordPress site. It's all up to you.
By "handler function" I mean a custom function you define to handle XMLRPC requests that call a specific, custom method (not necessarily the default WordPress methods). For example, I use XMLRPC in all my plug-ins to report back installation progress and errors -
each plug-in makes an XMLRPC call to a custom handler (method) on my server.
Yes, you can retrieve and post to custom fields.
Absolutely writing a plug-in is the way to go. The only other options are to change core files (BAD idea) or to build it into your theme, in which case it could ONLY be used on MU sites using that theme. Build it as a site-wide MU plug-in that can be controlled on a site-by-site basis by the global admin.
Wordpress XMLRPC offers various functionalities which can be harvested easily. I have used IXR_Library to parse the XML requests/responses. Currently with very small piece of code i can easily posts, fetch, edit and delete Posts in Wordpress based blogs either self hosted or on wordpress.com sites.
http://www.hurricanesoftwares.com/wordpress-xmlrpc-posting-content-from-outside-wordpress-admin-panel/ (reference)
When you have multiple blogs hosted via MU you will need site ID of all those blogs which will become the first parameter for $params (in our case 0 should be replaced with site_id).
In the reference i gave above you will see the option to fetch and post to all created custom fields (unfortunately, you can't create custom fields on the fly from my script)
You are welcome to write a WP plugin to do all of this, be my guest and let me know if you need my help. I have used the same technique to post to blogger, tumblr, Wordpress and Posterous using their API's. I hope this helps.

Wordpress Update through email

I have a blog, that is update pretty often. I like, while on the road to be able to use my blackberry or any eepc to prepare my post, review it, and send and email to somewhere that will be able to update my blog
three solution come to my mind
offline blog, edit and resync when return (not super good)
send email, update blog with blackberry
write text doc, send it by email and manually copy-paste in new post after return
I like not to have a list of all the possible solution, but the best working solution that you have use/try and like...
I use wp 2.6
thanks
--
Note just as boj note, I discover the already there feature included in wordpress... but I like my post to be in a Drafts state, because some photos and later editing will be done, but most of the post will already there
I have found that list. Just as Weblog Client said, there is a tons of software to do that, i just like THE BEST ONE !
Post to your blog using email.
WordPress can be configured to use e-mail to post to a blog. To enable this functionality, you need to:
Create a dedicated e-mail account to be used solely for posting to your blog,
Configure WordPress to access that account, and
Configure WordPress to publish messages from the e-mail account

Resources