Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress nothing happens #36

Open
frankyxcs opened this issue Nov 9, 2015 · 55 comments
Open

Wordpress nothing happens #36

frankyxcs opened this issue Nov 9, 2015 · 55 comments

Comments

@frankyxcs
Copy link

Hi Nick

very nice work from you ! I'm testing the wordpress plugin and gps tracker. So far everything seems to work fine (also i have checked sending the url sending the location to the wordpress blog and it gives me the time back)

but when i open a page with the shortcut i have always no entries. no google map is shown and no entries .. no tracking data to view

maybe you can tell me what is going wrong here ? i'm using wp 4.3.1

thanx for your help

@nickfox
Copy link
Owner

nickfox commented Nov 9, 2015

Hey Frank, can you give me the url of your gpstracker install please.

n

@nickfox
Copy link
Owner

nickfox commented Nov 9, 2015

The server at www.compisol.com can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

@nickfox
Copy link
Owner

nickfox commented Nov 10, 2015

Very interesting. I have not seen this problem in 10 years of working on GpsTracker. I tried 3 different browsers and tried to ping your website from the command line, but they all fail. I've asked my fellow developer to have a look at this. I think he will be joining the conversation shortly.

One thing, are you able to view the map from the same phone that you are having a problem with?

@brentfraser
Copy link
Collaborator

I am able to view your web site, but it shows no map graphics and says there are no positions to display. Likely a problem with your PHP connecting with your database. Create some some simple PHP to connect and display the status.

@nickfox
Copy link
Owner

nickfox commented Nov 10, 2015

Did you test your phone on my website from Germany? It's cool if you did. Does your website work ok now? I reset mine and it's fine. See the attached image.

screen shot 2015-11-10 at 2 39 12 pm

@frankyxcs
Copy link
Author

yes on your site it is working fine ..yes i am testing from germany ! but on my site it is still not working ..i don't know why. later i will take a look into the code of your plugin. maybe i can find a solution for it

@nickfox
Copy link
Owner

nickfox commented Nov 11, 2015

Brent, any idea why I can't see his website in Germany from here in France?

Frank, could I please get the IP address of your site?

@brentfraser
Copy link
Collaborator

It could be that when Frank blocked Russia, the IP range included parts of Europe. I wonder if there is a U.S.proxy service you could use?

@nickfox
Copy link
Owner

nickfox commented Nov 11, 2015

Frank

Can you please go to plugins in your wordpress install and deactivate GpsTracker and then reactivate it so that we can see the three default routes.

n

@frankyxcs
Copy link
Author

hi ok done but still nothing

@nickfox
Copy link
Owner

nickfox commented Nov 11, 2015

Ok, the next step is this. I use Chrome so I'll explain how do it from there. Go to the view menu then Developer then Javascript Console and copy and paste all that you find here.

n

@frankyxcs
Copy link
Author

Hi again :)

sorry no output there ! Everything is ok so far with java

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

Ok, I managed to see your webpage using that first iphone simulator you posted using this page:

http://transmog.net/cgi-bin/nph-mobilewebonastick-scroll-ipad2.cgi/000000A/http/transmog.net/cgi-bin/nph-mobilewebonastick-scroll-ipad2.cgi/000000A/http/www.compisol.com/testtracker/

Still no idea why I cannot use my regular browsers. now if you look at the javascript console, you will find this line:

Uncaught TypeError: URL.match is not a function
bing.js=3d3fver=3d3d1.0.3:8 Uncaught TypeError: Cannot read property 'extend' of undefined

I suspect this may be causing a problem. So in this file, could you please comment out or delete line 207

https://github.com/nickfox/GpsTracker/blob/master/servers/wordpress/gps-tracker/public/class-gpstracker.php

That is the line loading bing.js. Also, just a small note, this is javascript not java. Let me know what happens when you get rid of that line and thanks for trying to solve this problem with me.

n

@frankyxcs
Copy link
Author

hi nic
thanx for your efforts but it is still not working, i have commented out this line and reactivated the plugin but it still shows nothing yet

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

What version of php are you using and are you blocking any IP addresses or range of IP addresses?

@brentfraser
Copy link
Collaborator

Looking at the web site in the Firefox debugger I see that when I click the GpsTracker "Refresh" button on the web page, the browser sends a POST request to http://www.compisol.com/wp-admin/admin-ajax.php with POST data of:
action=get_all_geojson_routes
get_all_geojson_routes_nonce=6ae024cc97
but all it gets in return is:
0
so I think the database query is not returning anything. Perhaps a permissions problem?

@frankyxcs
Copy link
Author

i have php 5.3.37 installed ..normally no problems with anything ..i have only banned russia and some bots from my server nothing more..everything should work

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

Brent, I was thinking it was a permissions problem too. But being a wordpress plugin, the first thing it does it create a table in the wordpress database and then populate the table with 9 rows of "default" data.

php 5.3.37 is fine for this, I'm pretty sure. It's really difficult to diagnose without getting direct access to it.

Frank, are you able to get access to mysql and to see if that table was created and that it has the original 9 rows of data? The name of the table is prefix + gps_locations (where prefix is the wordpress table prefix, the default is wp_, so it would be wp_gps_tracker).

@brentfraser
Copy link
Collaborator

or the table could be empty...

@brentfraser
Copy link
Collaborator

We should have a default area of interest (the whole world?) if there are no entries in the table.

@brentfraser
Copy link
Collaborator

I see that get_all_geojson_routes() returns a single "0" if no rows are found. Maybe some empty geojson would be better? or consider it an error condition in the JavaScript and popup a message box?
if ( 0 == $wpdb->num_rows ) {
echo '0';
exit;
}

@frankyxcs
Copy link
Author

Hi
the table wp_gps_locations has 15 columns
and the table has a lot of entries ..everything seems to be ok with the created mysql table

wp_gps_logger is empty

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

Frank, when you say lots of entries. Are you also seeing data from your actual phone or just the default data?

@frankyxcs
Copy link
Author

i turned debug mode on and error reporting but still nothing

yes just testing with reactivated plugin ..everything is fine ..it gets the location from android-wp and makes entries every minute

maybe your plugin is conflicting with something ?

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

Ok, interesting. So we are able to put data into the table but not get data out.

Do you have other plugins (possibly with maps) that might be conflicting? Could you possible deactivate the other plugins and then check GpsTracker again.

Brent, so we have rows but why are they not showing up in get_all_geojson_routes?

@frankyxcs
Copy link
Author

no i do not have any other plugin with maps
ok i have deactivated and enabled every plugin but still no data output :(

maybe you have a bug with the wp nounce stuff ?

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

Frank, just had another idea. Please login to your wordpress database again and run the following:

call wp_get_all_geojson_routes;

and don't forget that ; at the end and then copy and paste the results here.

don't worry, we aren't done yet... :o)

@frankyxcs
Copy link
Author

im on phpmyadmin
this kind of command does not work

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

I think it should work from the SQL tab in phpmyadmin.

@frankyxcs
Copy link
Author

there is nothing with geo json routes

you need the data from wp_gps_locations ?

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

No, from the SQL tab in phpmyadmin, you need to run the following stored procedure.

call wp_get_all_geojson_routes;

and then paste the response you get here. Just seeing the table data will not work. The plugin uses this stored procedure.

@frankyxcs
Copy link
Author

i have never used this

but there is no stored procedure and i cannot execute a stored procedure

its not possible with my phpmyadmin here to make this ..but i know and understand what you mean

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

thats the reason why I hate phpmyadmin. I talked to the developers of phpmyadmin many years ago about their lack of support for stored procedures but they chose not to improve their application. From the SQL tab, what do you get when you run the following command?

SHOW PROCEDURE STATUS;

@frankyxcs
Copy link
Author

in english : Mysql delivered an empty result :)

i have never used this since 10 years :)

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

are you able to get to a command prompt (not use phpmyadmin)?

@frankyxcs
Copy link
Author

what kind of command prompt ? you mean root access to the server ?

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

yes, like this.
screen shot 2015-11-13 at 12 22 23 am

@frankyxcs
Copy link
Author

yes i have root access to my server ..its debian linux

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

ok, try to login to mysql using the following. you need to replace your root password and your database name. i always put my root password right next to the -p with no spaces.

mysql -h localhost -u root -pyour_root_password your_wordpress_database_name

when you are inside mysql, run the following command:

show databases;

and paste the response.

@frankyxcs
Copy link
Author

yes ok but it shows only my databases and nothing more

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

ok, now try the following command and paste the results here please:

call wp_get_all_geojson_routes;

@frankyxcs
Copy link
Author

ERROR 1305 (42000): PROCEDURE usr_web56_1.wp_get_all_geojson_routes does not exist
mysql>

:)

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

ok, good. we are making progress. is usr_web56_1 your wordpress database?

@frankyxcs
Copy link
Author

yes it is

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

what is the result of this command. it should show all the stored procedures in that database:

SHOW PROCEDURE STATUS;

@frankyxcs
Copy link
Author

Empty ...as i told you .there are no stored procedures in my database ..its not possible

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

why do you say it's not possible?

@frankyxcs
Copy link
Author

i have no rights in phpmyadmin to make a new procedure my version does not support this

but what is the clue with this stuff ? Did you program your plugin to store a prodecure within the database ?

on my phpmyadmin it is not working

@nickfox
Copy link
Owner

nickfox commented Nov 12, 2015

can you please look at the following webpage and run the grant all command with your root password from with mysql:

http://www.waytocode.com/2012/how-to-enable-and-execute-stored-procedures-in-mysql/

@frankyxcs
Copy link
Author

hi nick sorry but i do not want to change anything via root on my server only to make a wordpress plugin working ! i never needed this procedure stuff

i appreciate your help but this it is not worth for me to change anything

@nickfox nickfox closed this as completed Nov 13, 2015
@nickfox nickfox reopened this Nov 13, 2015
@nickfox
Copy link
Owner

nickfox commented Nov 13, 2015

Hey Frank, a final comment. I was incorrect in saying you should grant those permissions to the root user. I realized moments later that would probably not have fixed the problem. Those permissions need to be granted to the wordpress user instead.

But you are right about one thing. You shouldn't have to go to that much trouble to get the plugin to work. Using stored procedures is fairly common in large corporate enterprises but not out on the internet. Thanks for pointing out this problem.

@frankyxcs
Copy link
Author

hi i thought you got pissed off because i do not want to change anything on my server :)

ok but maybe i think you are thinking to much in a special way ! I make a lot of things too like php programming and other stuff but in 10 years i have never heard anything about stored procedures :)
(but i'm always willing to learn more :) )

if you have time i think you should maybe find a better (less complicated) way to show the data with your plugin.

I really appreciate your intensive help here !!! But as you are writing, maybe only big companies are using this.

@mikeq
Copy link

mikeq commented Nov 13, 2015

Couldn't you write an alternative Frank and make a pull request.

Stored procedures are a fairly common way to do certain tasks. If you
aren't comfortable implementing into your database perhaps you could come
up with a PHP alternative.

On Fri, 13 Nov 2015 at 14:45 frankyxcs notifications@github.com wrote:

hi i thought you got pissed off because i do not want to change anything
on my server :)

ok but maybe i think you are thinking to much in a special way ! I make a
lot of things to like php programming and other stuff too but in 10 years i
have never heard anything about stored procedures :)
(but i'm always willing to learn more :) )

if you have time i think you should maybe find a better (less complicated)
way to show the data with your plugin.

I really appreciate your intensive help here !!! But as you are writing,
maybe only big companies are using this.


Reply to this email directly or view it on GitHub
#36 (comment).

@nickfox
Copy link
Owner

nickfox commented Nov 13, 2015

Well, like Mike and I have said, stored procedures are fairly common. I do think that it's interesting that your wordpress installation does not have the permissions to install and run stored procedures. I use digitalocean.com quite a lot and I know that a lot of developers like it because you can spin up an instance of your favorite OS really quickly. When I create an ubuntu/wordpress install on Digital Ocean, the permissions are set correctly and I can get GpsTracker working literally in one click.

What I'm suggesting here is that perhaps the permissions on your box are a little too tight...

Maybe consider allowing the wordpress user the ability to run stored procedures. Check out this SO article:

http://stackoverflow.com/questions/10089308/mysql-stored-procedure-permissions

Don't take my word for it. Spend some time googling it and doing some reading on StackOverflow. Stored procedures are worth checking out. I have been using them for about 20 years I think... On the other hand, it probably wouldn't hurt to rewrite those SPs as views instead. That would be a good exercise if you're interested. Do a pull request like Mike suggested... :o)

@Tenchu
Copy link

Tenchu commented Feb 19, 2020

Hi, where can I add the google maps API Key, I see there 3 options for maps, but I would like to use google maps too

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@nickfox @mikeq @Tenchu @brentfraser @frankyxcs and others