?
Solved

Accessing a WordPress Database from a mobile app

Posted on 2017-01-02
6
Medium Priority
?
138 Views
Last Modified: 2017-01-03
I have a WordPress website with custom tables that I store data into that was entered by customers. The site owner wants to develop a barcode app that can  access this data.  When I need the data from these fields to display within the site,  I request it from a PHP script running on the server that make calls like
get_post_meta()

Open in new window

The owner has hired a mobile app consultant who believes that, if he just has the password to the account where the site is hosted,  he can access all of these database fields from the app.

 I'm not seeing how this is possible. My understanding is that a mobile app can only access a site by making HTTP requests to it. It has no way of running on the server and executing things  like
get_post_meta()

Open in new window

  Am I missing something?

Thanks
0
Comment
Question by:steva
  • 3
  • 3
6 Comments
 
LVL 3

Expert Comment

by:Edward Jimenez
ID: 41945376
Hi Steve,

If the mobile app consultant has credentials to login to where the actual site is hosted, it is possible to get the requested information directlly from the database, by passing WordPress.

Another solution to create a mobile app with WordPress is using a software called phoneGap.  it will take your WordPress site and create a mobile app both for Andriod and Ios.
0
 

Author Comment

by:steva
ID: 41945416
Thanks for responding, Edward.  The consultant does have credentials to log into to site server, but could you explain how they would then read, for example,  values stored in the wp_2_postmeta table?  I do it with my code that runs in the server by calling WordPress' get_post_meta().  How is an app that comes in on HTTP going to do that?
0
 
LVL 3

Accepted Solution

by:
Edward Jimenez earned 2000 total points
ID: 41946177
Hi Steva,

The app can read values using standard SQL query statements, something like this:

select * from wp_2_postmeta;

Now, I'm not saying this is what the approach the consultant will take, but this is just to show that it is possible to get those values.
0
2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

 

Author Comment

by:steva
ID: 41946230
Thanks.  On a different subject, since you seem to have some experience with mobile apps, and I'm talking to you, you mentioned phoneGap that will create Android and IOS apps from a WordPress site.  I've been looking for software that is  to mobile apps what Wix and Weebly are to HTML.  I just want a simple mobile app that will scan a barcode and pass the number to my site with an HTTP request, but I don't want to learn Android and IOS app development to write it.  It seems there should be something out there to let me drag and drop my way to a simple app like that.  Do you know of anything?

Thanks.
0
 
LVL 3

Expert Comment

by:Edward Jimenez
ID: 41946278
Hi Steva,

To get the barcode scanner functionality, I would recommend a plugin.  Here is one, but it has not been updated for 2 years:
https://codecanyon.net/item/order-barcodes-for-woocommerce/9745632?s_rank=3

You'll have to search around for a plugin that works for you.  

As for the mobile app, there are few changes that you have to make to your WordPress site or any web site for the phoneGap platform to be able to convert it to a mobile app.  Here is the phoneGap site that you want:

https://build.phonegap.com/

and here are the steps:
https://premium.wpmudev.org/blog/creating-a-mobile-app-for-your-wordpress-site-a-diy-guide/
0
 

Author Closing Comment

by:steva
ID: 41946410
Thanks for all the information!
1

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question