New to this site and the biz. I am trying to incorporate the Amazon API into my Wordpress site. When an ISBN # is typed into search box product info from Amazon database is populated. When I copy and paste an ISBN# from another source the search does not perform. Any suggestions appreciated.
Thanks
This isn't an AWS question and is probably more a jQuery/javascript question. Your database lookup is probably using jQuery .change() event listener to perform the query when the search box is changed. This doesn't work very well for direct pastes, and a solution for that can be found here:
stackoverflow: Catch paste input
However if you're using a pre-build wordpress site, chances are you have no direct control over how the search system works, in which case you either need to use something different or contact the original developer to ask for a fix.
Related
I love WordPress as it provides plenty of great themes, good SEO and overall content management.
But I'm not always happy with WordPress's original "Add post" and "Edit post" features as it required manual work to provide the content for the site.
However all the data of WordPress site stored in the database which can be easily manipulated by 'handwritten' script (PHP for example). It'd look promising but I'd be afraid of crashing WordPress-specific data structure and invoke mistakes in the site work or even make it inaccessible. Moreover WordPress has its own caching and probably many other things I should take care about before I get started.
So my questions are:
1) Is it even possible and (more important) reasonable to manipulate the WordPress database by handwritten script?
2) If the answer for the 1st question is 'Yes' - is there any tools (for PHP in the first place) which can make this process more save and pleasant?
3) Is there any reading for the task I'd like to accomplish? I tried to Google a little bit but I didn't find any even close to this (I tried a queries like 'wordpress database manipulation', 'wordpress post by php script' and so on).
If you are going to do this, it's safest to use the wordpress API and have your script do things through the API instead. That way if any database structures or features change, the API will incorporate those changes and you won't need to edit your code as much.
Read up on how to use the Wordpress API to make and edit posts. Here's an example: https://netmidas.com/blog/wordpress-rest-api-crud-example-with-a-post/
I have a question about integration e.g. Woocommerce with external app.
What is the best and safe method to accomplish this goal?
Woocommerce has REST API but it might be quite vulnerable and will not show anything (products etc.) to non logged user(which is understandable).
Only safe idea that's comes to my mind is creating scripts inside WordPress and access them via AJAX but I'm worrying about performance of this method.
Maybe there is a right way that I'm not familiar with?
For that purpose, you should create an API from scratch of the wordpress database. wordpress databse has all of you need in a good way and only some php codes needed to create and execute the API. then in you app with AJAX you should access that.
this link may help you:
https://developer.okta.com/blog/2019/03/08/simple-rest-api-php
The right way is likely creating your own API if you don't want to use Woocommence's one. That means you make a plan of what you need to expose, all the routes and start building the API. I warmly recommend the book by Phil Sturgeon - Build APIs you won't hate. The author is also a co-founder of https://phptherightway.com/ so it's quite reputable.
I am working with a client who is using WordPress. I am not familiar with WP like I am with other frameworks. In this situation, the client wants to allow users to enter data into a form and I will create pages to display this data so it can be managed. I am thinking I need to get the user entered data saved into a table. I will then read from this table to display in another page. I need to do CRUD stuff within WP with JavaScript.
Are there plugins that will allow me to create tables within the WP database? Can I use JavaScript to read/write to them, or do I need to use PHP? I don't have access to the source code so I am doing everything via the functions.php and JS files.
Because I don't have much experience with WP, I am not sure what can be done. Thanks for any suggestions.
While it's definitely doable programmatically, I don't see much reason in recreating the wheel. Perhaps Contact Form 7 would work for you. If not, Gravity Forms can do what you need, but I believe there is a cost for that.
EDIT
(But please read it all if you really wanna help :) )
Since I'm able to view all the profiles with the correct LDAP data (it's fetched when asked for, but never stored), an possible, albeit hackish solution, would be to display all the profiles as a table. Does anyone have an idea how that might be done ? Google hasn't help, understandably since most people never need to use such a feature.
EDIT
I've successfully used the LDAP Integration module to use LDAP authentication with Drupal. Now I'm trying to create an address book with information from LDAP. I've tried the following solution:
Changed the ldap_data.module, the part that states which fields can be mapped between ldap and drupal (e.g. mail => mail). This fails when I try to add more mappings. I believe this maps to the "users" table in drupal, but when I try to add a field to that table and map a LDAP attribute to it, nothing goes into the database. My plan was to then use Table Wizard with views to create the address book. Using Table Wizard and Views I was able to extract everything I wanted from the users table, but the problem of entering data into the table is still not solved.
If you have any ideas, any at all, I'd really appreciate it. I'm a beginner in drupal and LDAP altogether btw. I've already tried to google this to death over the last few days but nothing has helped me solve this problem.
The answer below helped me understand why this didn't work, but the problem is still unsolved.
The LDAP Data module is not intended to work with fields arbitrarily added to the users table. Instead, it works in conjunction with the core Profiles module and can map to its fields.
Can anyone recommend an xml rpc library or client for wordpress using java?
I've run into migration hell moving a joomla install to wordpress.
Main reason for wanting to use rpc now is because i will be using it as my primary way of posting to the blog so i'm putting a simple client together and it needs to be configurable enough to allow me to port my joomla posts.
Some posts in future will just be reports generated from a java program as well so, its kinda essential i get something now if possible.
BTW if anyone understands the current wordpress table structure and can advise on how to do direct mysql inserts then i'm open to that too.
thanks in advance.
Have a look at http://code.google.com/p/wordpress-java , I've just added a few features.
I've just posted this link on a different WordPress question:
Database Description from WordPress Codex. That will help you understand WordPress' table structure.
Your project sounds pretty interesting. A quick google search shows some info on Java and XML-RPC: 1, 2 (javax.xml.rpc ).
Second link belongs to Apache XML-RPC, probably a good option for your project.