wordpress and the $_GET method - wordpress

I have recently updated a plain html website for a music festival into wordpress. All is fine and beautifulllllll(!), except for one thing. People who apply for the courses are supposed to pay for a deposit, and when they do so they should receive a confirmation email that includes a URL for the future payment of the rest of the course fee.
With the old site, we used to have something like:
http://www.mysite.com/coursefee.php?amount=10&refno=1234&name=John
The coursefee.php file used the $_GET method to create a form that would lead to the payment service (with the right amount to be paid, the correct reference number, ASO). The problem is that if I use the same configuration in wordpress.... well, things don't work. Wordpress uses url parameters as query parameters and I really don't know how to go around this issue.
Any ideas?
Thanks!!!!!

Did you check the path to your coursefee.php files is in the wordpress root directory ?
This php file is not part of Wordpress core, so if you have the standard .htaccess file, you should access it directly without initializing WordPress.

Related

Post file to Shopify URL

I have produced an ASP.NET/MVC Web application where a user uploads a file, I then take that file and generate a new file based on server-side calculations. This new file is saved server-side.
I then need to post this new file to my client's Shopify URL via a Submit button (the end user will see this file and can then select 'Add to Cart').
I've been doing some looking around (e.g. 'post file to Shopify URL?') and the search results returned relate to either uploading files to your Shopify account through the Shopify admin console, or, a Shopify form post to external URL - this is not what I want - I need to post to Shopify from an external URL.
Is it possible to post a file to a Shopify URL? and if so, presumably this could be done using JSON? Can I use the Shopify API to do this? Presumably I'd need Shopify username / password credentials from the client to do this?
As you can tell(!) I'm a newbie to Shopify development so please forgive the seemingly straight-forward questions, but some guidance would be greatly appreciated, Thanks
You should be using Shopify to upload the file. In product.liquid you can do this, and the file is saved along with the order as a product's line item property. When the order is booked, you can listen for that event, then use API calls to get the order and the image the customer uploaded. At that point you manipulate the image or file as you wish.
You cannot POST a file to Shopify in the sense of making a product that then goes in the cart. What you could do is POST to your server, use the API to generate a new product with that file as part of the new product, then show that new product off to the customer. A lot of work in that pattern for sure!
Anyway, your question in the context of Shopify and how it works is too difficult to answer here with much more detail, especially without you saying what it is you are trying to actually do.

Get recent wordpress posts in Laravel

I have a Wordpress site and a Laravel site and I want to display recent wordpress posts in the footer of Laravel site. How can I do this without having my wordpress database information in my config/database.php file and using it in the models? Can I get them using RSS?
Recent WordPress was released with a huge thing called REST API – earlier it was possible only with external plugins. So now we can query WordPress database from external projects. Including Laravel.
set up a local WordPress website, and after installation you got that usual dashboard.
we can already make API calls after installation. No need to configure anything, we just launch the URL in the browser:
we’ve received a JSON with a list of posts – by default, WordPress creates one dummy post.
Basically, URL structure for the API calls is simple:
/wp-json/wp/v2/[endpoint]?[parameters]
Yes, you’ve read it right, we can get posts, categories, tags and other things that are publicly available, so we don’t need any authentication here.
And we also can filter the data with GET parameters, like this:
/wp-json/wp/v2/posts?per_page=2&orderby=title
For more details open link:- Using WordPress REST API in Laravel
You can get the posts by calling an API endpoint:
yoursiteurl/wp-json/wp/v2/posts
It will return all the posts in a json format. You can also see the reference from here.

Headless CMS: Wordpress Rest-API – Add links to existing posts/pages

We want to use the Wordpress Rest-API to build a page decoupled from the backend. A few things still bother us though:
Within the wordpress backend one can add links in the content editor of a page or a post and one gets normally a list of all existing pages and posts of the same page to link to them. By decoupling the backend it does not know the exact urls to other pages and we need to provide this. Is there a possibility to tell wordpress what links are available?
Thanks in advance.
Cheers
For those looking for the answer:
There are two URL settings under Settings > General.
WordPress Address (URL) should be the URL for your api site. Like api.whatever.com.
Site Address (URL) should be the URL for the frontend. Like www.whatever.com.
This allows the internal linking to work properly in the Editor while keeping the backend site on a separate URL from a headless frontend.
I'm not sure what you're trying to ask. The WordPress REST API just provides a way to access posts, etc. from somewhere else part from the web site side (e.g. themes, etc). Pages would still be accessible from the admin backend and the JSON/REST API: https://developer.wordpress.org/rest-api/reference/pages/
Specifically with WordPress you could ensure that you're not rewriting the permalinks. That way they are all still site.com/?p=post-id
That way it's easy to parse fetch the new pages. Then replace the hrefs with whatever your frontend needs.
You could use the ID to fetch the slug of the new post immediately.
Or you could even keep a mapping in your presentation layer of IDs to your own slugs.
Changing the site_url doesn't work for me.
Since I also have a wordpress theme with custom rest controllers
Plus the wp-json breaks if I change the site url
My backend is hosted at digital ocean app
My frontend is hosted at vercel
I fixed it by using a wordpress plugin called make-paths-relative
But since my backend doesnt know where my frontend is I added one change within the plugin at:
frontend/class-make-paths-relative.php line 123
I added a constant FRONTEND_URL which i define in the wp-config
$relative_link = FRONTEND_URL.$link;
This changes both the permalink within my backend of a post, page or cpt
And changes internal links as wel, links within the content editor
I made a request to the plugin author as well

Wordpress : Why Plugin name is unique?

I am new in wordpress. I have read lots of about the plugin creation and thier steps. Can any body explain me why the plugin name is unique? I have read that for avoiding conflict keep plugin name unique. My question is if I have created different or unique shortcode then whats the problem?
In case you publish it, it needs a unique name to display on the WordPress page (or wherever).
How would a regular user know which plugin is the right one if both have the same name? Less computer-savvy users wouldn't be able to check for the plugin code to differentiate them.
Also, the plugin files are named after the plugin name itself. And Wordpress uses this information internally. If two plugins that happen to have the same name were installed under the same Wordpress website, there might be conflicts on Wordpress representation.
A WordPress plugin identified on WordPress.org by its name only. So if plugin name is not unique, even on a local computer for testing, plugin might be overridden automatically by the next update from by a developer with the same app name published in wordpress.org/plugins/.
What happens when you upload manually a none unique name plugin to your WordPress blog? I guess it will be damaged or hacked by anyone who publishes plugin with the same name. That is why not only the name must be unique but you also have to publish it on wordpress.org/plugins/ to prevent anyone change it, or else you have to disable plugin updates.

How can I sign in a Wordpress (mu) user from outside of Wordpress?

I'm working for a company that is using Wordpress MU to supplement other functions on a member site. We have a user signup process that creates the appropriate Wordpress MU users and blogs on signup, but I'm having real trouble figuring out how to log someone in to a WP blog from outside of Wordpress itself. The documentation these methods seem to be non-existent or just too obtuse for me.
In the abstract I know how to do it: Take user info, set the same cookie that Wordpress would set itself. Done. It is, however, not this simple.
Has anyone done this successfully before?
I've been able to log people into Wordpress, however I'm was running inside Wordpress. (I was inside a theme)
Basically, the tough part is getting all the hashes correct, because Wordpress uses a set of defined security hashes in the config file to create the cookie. Ideally you should be able to copy and paste the functions that Wordpress uses.
Yes Wordpress documentation for security sucks, but that is what you get in a Open Source application, not stellar documentation.
What you are looking for is the wp_set_auth_cookie function in the /wp-includes/pluggable.php file. You should look into what the do_action()s actually do, but you should be able to simply replace all the constants with the correct values, and you'll have a function that can port anywhere on the domain.
Hey, it's not so tough task, once you are using correct instruments ;)
Try XML-RPC

Resources