Development of Plugin (Part 2)
-
Dear Jeremy,
I hope you are well.
I’ve currently got someone working on the issue I emailed you about recently; although, a snag has been hit.
Basically, the person has created the following code:
Code Modified , Index.php Line 103
$ip_address = $_SERVER[‘REMOTE_ADDR’];
$url = “https://ip-api.com/json/” . $ip_address;
$response = wp_remote_get( $url );
$response_body = wp_remote_retrieve_body( $response );
$location = json_decode( $response_body );if(isset($location->timezone)){
$date = new DateTime();
$timezone = new DateTimeZone($location->timezone);
$date->setTimezone($timezone);
$curday = $date->format(‘z’);
}else{
$curday=current_time(‘z’);
}Having tested this, I can confirm that when using a VPN, it does change the relevant quote for different places (e.g., I’ve switched to Perth, Australia, and the day/quote changes as expected).
However, weirdly, I’ve found that at about 7/8 PM local time (my computer is currently set to UTC Atlantic Time (Canada) -4 (although, I’m not in Canada) the quote changes to the next day/date (this should, I would expect, change after midnight local time). E.g., it’s the 6th February. At 7/8 PM the quote will change to 8th February, but the local time/date will still be 7/8PM on 6th February.
This occurs when using different PCs that have no VPN, and also having tried on cellular telephones (Android, iPhone), using the cellular network (meaning it is not the local router at fault).
The WordPress Server is set to GMT (UTC+0).
So, the person helping is currently perplexed (as am I) as to what’s causing the Issue.
I’m wondering if you are able to shed some light on a possible cause (you know the plugin better than anyone), so that I can feed this back to the person assisting, please?
Thank you for any pointers you might be able to offer as to the issue.
- The topic ‘Development of Plugin (Part 2)’ is closed to new replies.