bluebananaconsulting
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Job Manager] Approve jobs from the frontendI’ve split out my job manager functions and call them through functions.php – wouldn’t this load after plugin functions have loaded?
Forum: Plugins
In reply to: [WP Job Manager] Approve jobs from the frontendThat’s weird – is there anything that would stop this function being called?
I’m not a WordPress developer so learning as I go here!
public function set_expiry( $post ) {}is trying to use thecalculate_job_expiry()function you mentioned.For what it’s worth this error only gets thrown up with jobs that go through Woocommerce Paid Listings. I’ve bypassed the payment flow for users who have a meta value in the user profile who we don’t want to pay. Their jobs can be approved from the frontend without generating the error.
Thanks for any insight.
Forum: Plugins
In reply to: [WP Job Manager] Making the admin able to bypass pendingHi Mike,
Was this filter implemented? I use wpjobmanager for a disabled charity, and the admins frequently post jobs on behalf of users. One of the admins uses a screen reader which is unusable with the backend!
It would be great to bypass the approval flow for logged-in admins via the frontend.
Thanks!
Forum: Plugins
In reply to: [GEO my WP] Premium Settings questionAh, OK.
In that case is it possible to use the premium settings plugin and a custom form to query the job_listing post type? Since the posts are geocoded using the Geomywp engine the geolocation fields used are the same as if Geomywp performed the job address lookup.
Then instead of using the [jobs] shortcode from wpjobmanager could I create a form using Geomywp and Premium Settings to perform geocoded lookups with additional custom field and taxonomy querying?
Is this possible, and could you advise how it works? I had a look for Premium Settings documentation but couldn’t really find anything.
Thanks!
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationDon’t forget that when you add an API key to the string you need to use HTTPS! I fell foul of that.
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationHi Mike,
Me again! I’ve been setting up a dev site live online and I’m running into the same issue we had before – but this time my fix isn’t working!
My API key is valid since I can use it to call a geocode request in the footer as you suggested, but new jobs aren’t being looked up – the metafields just aren’t appearing. Is there any way of accessing logs so I can see what’s going on when the plugin saves the post and performs the lookup?
I’ve got
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true);in my wp-config.php but I’m not seeing anything being generated. Would errors in your plugin show up here?
Just to rule out conflicts I’m running a blank install on a new database with only wpjobmanager installed.
Thanks,
James
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with Geolocation@jobme, as I was doing this in a test development site locally, I trashed the database and started over. Geocoding is working fine now so I suspect previously geocoded lookups were being cached somewhere. This may not be an option for you though if your site is live!
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationInteresting. I’m finding the code geolocates all new requests but not ones that I’d previously checked when the system wasn’t working!
I tried to geolocate Cromer in Norfolk and it comes back with California! All new addresses are Geolocating so I wonder if there is some sort of error caused by cacheing. I’m going to have a play tomorrow. I’ll post my findings!
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationThanks Mike, I really appreciate you taking the time to do this. It always amazes me the quality of work that goes into free WordPress plugins!
Cheers,
James
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationOK, got it sussed! I modified the class-wp-job-manager-geocode.php line 123-132 to read:
$result = wp_remote_get( "https://maps.googleapis.com/maps/api/geocode/json?address=" . $raw_address . "&key=+++APIKEY+++&sensor=true", array( 'timeout' => 5, 'redirection' => 1, 'httpversion' => '1.1', 'user-agent' => 'WordPress/WP-Job-Manager-' . JOB_MANAGER_VERSION . '; ' . get_bloginfo( 'url' ), 'sslverify' => false, ) );Obviously substituting my API key for the +++APIKEY+++ placeholder above. It now works and is Geocoding my jobs.
Mike, I appreciate this is a free plugin, but is there any chance in a future release that there could be a space in the Dashboard to enter an API key? I’m running a simple job board for a disabled charity so I can re-do this mod after an update, but it would be useful.
Anyway, hope this solution helps someone else!
@jobme, you’ll need to go to https://code.google.com/apis/console/ and create a server API key for the Geocoding API. Get the IP address for your server from MediaTemple and use that as the referer IP. Then throw the switch for Geocoding API to “on” in the console once you’ve created the key to activate it.
After that you can follow the steps above to add the API variable to the geocode query string.
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationOK, I haven;t done a fresh install but I have been in contact with my host, TSOhost. We identified that an API key needs to be set because the API call limit was being hit by the aggregated number of calls coming from my cloud-based server.
I created and activated an API key and amended your test script you posted to @jobme. I know get a successful lookup:
array(5) { ["headers"]=> array(12) { ["content-type"]=> string(31) "application/json; charset=UTF-8" ["date"]=> string(29) "Tue, 09 Sep 2014 13:35:54 GMT" ["pragma"]=> string(8) "no-cache" ["expires"]=> string(29) "Fri, 01 Jan 1990 00:00:00 GMT" ["cache-control"]=> string(25) "no-cache, must-revalidate" ["vary"]=> string(15) "Accept-Language" ["access-control-allow-origin"]=> string(1) "*" ["server"]=> string(4) "mafe" ["x-xss-protection"]=> string(13) "1; mode=block" ["x-frame-options"]=> string(10) "SAMEORIGIN" ["alternate-protocol"]=> string(8) "443:quic" ["connection"]=> string(5) "close" } ["body"]=> string(111) "{ "error_message" : "The provided API key is expired.", "results" : [], "status" : "REQUEST_DENIED" } " ["response"]=> array(2) { ["code"]=> int(200) ["message"]=> string(2) "OK" } ["cookies"]=> array(0) { } ["filename"]=> NULL } array(5) { ["headers"]=> array(11) { ["content-type"]=> string(31) "application/json; charset=UTF-8" ["date"]=> string(29) "Tue, 09 Sep 2014 13:35:54 GMT" ["expires"]=> string(29) "Wed, 10 Sep 2014 13:35:54 GMT" ["cache-control"]=> string(21) "public, max-age=86400" ["vary"]=> string(15) "Accept-Language" ["access-control-allow-origin"]=> string(1) "*" ["server"]=> string(4) "mafe" ["x-xss-protection"]=> string(13) "1; mode=block" ["x-frame-options"]=> string(10) "SAMEORIGIN" ["alternate-protocol"]=> string(8) "443:quic" ["connection"]=> string(5) "close" } ["body"]=> string(1340) "{ "results" : [ { "address_components" : [ { "long_name" : "California", "short_name" : "CA", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "United States", "short_name" : "US", "types" : [ "country", "political" ] } ], "formatted_address" : "California, USA", "geometry" : { "bounds" : { "northeast" : { "lat" : 42.0095169, "lng" : -114.131211 }, "southwest" : { "lat" : 32.5342321, "lng" : -124.4096196 } }, "location" : { "lat" : 36.778261, "lng" : -119.4179324 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 42.0095169, "lng" : -114.131211 }, "southwest" : { "lat" : 32.5342321, "lng" : -124.4096196 } } }, "types" : [ "administrative_area_level_1", "political" ] } ], "status" : "OK" } " ["response"]=> array(2) { ["code"]=> int(200) ["message"]=> string(2) "OK" } ["cookies"]=> array(0) { } ["filename"]=> NULL }So now I was wondering if I could modify your plugin file to test if this fixes my problem. (Not a good solution I know but just to test!) Could you help me format the string, since I’ve tried to make the change and new jobs and old jobs re-saved still aren’t geolocating.
I’ve changed the code in class-wp-job-manager-geocode.php starting at line 122 to add my API key before the sensor variable.
if ( false === $geocoded_address || empty( $geocoded_address->results[0] ) ) { $result = wp_remote_get( apply_filters( 'job_manager_geolocation_endpoint', "http://maps.googleapis.com/maps/api/geocode/json?address=" . $raw_address . "&key=AIzaSy+++API KEY+++SYPycYk&sensor=true®ion=" . apply_filters( 'job_manager_geolocation_region_cctld', '', $raw_address ), $raw_address ), array( 'timeout' => 5, 'redirection' => 1, 'httpversion' => '1.1', 'user-agent' => 'WordPress/WP-Job-Manager-' . JOB_MANAGER_VERSION . '; ' . get_bloginfo( 'url' ), 'sslverify' => false ) );As I say, this still isn’t geolocating jobs. How would you format the string?
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationHi Mike, Jobme.
Some Googling around the subject with the same error code suggests that being on a cloud hosting platform and sharing an IP address means you also share the API calls. (as jobm suggests with MT.)
I logged a ticket with TSOhost asking if they think this is the case and they responded :
Hi James,
Yes – this will be due to you sharing api calls
Can you authenticate and therefore remove the limits for the requests you make?
Kind Regards,
Seb
Mike, just to clarify you’re using client side lookups aren’t you? I know Google’s API docs say you don’t run into the server limit, but do you think shared Cloud-based hosting could be the issue?
As I said, the same install base of WP and plugins works on my local dev server and Heart Internet. I will do a fresh install on a new hosting package without the geojobmanager plugin to be sure.
Unfortunately getting a Google Maps for Business API key isn’t an option for this project. I’m doing a freebie for a charity that matches people with disabilities with local carers looking for work!
I’ll post back here with my findings re: fresh install.
Forum: Plugins
In reply to: [WP Job Manager] Huge issue with GeolocationHi Mike,
I’m getting the same issue :
array(5) { ["headers"]=> array(12) { ["content-type"]=> string(31) "application/json; charset=UTF-8" ["date"]=> string(29) "Mon, 08 Sep 2014 20:09:21 GMT" ["pragma"]=> string(8) "no-cache" ["expires"]=> string(29) "Fri, 01 Jan 1990 00:00:00 GMT" ["cache-control"]=> string(25) "no-cache, must-revalidate" ["vary"]=> string(15) "Accept-Language" ["access-control-allow-origin"]=> string(1) "*" ["server"]=> string(4) "mafe" ["x-xss-protection"]=> string(13) "1; mode=block" ["x-frame-options"]=> string(10) "SAMEORIGIN" ["alternate-protocol"]=> string(7) "80:quic" ["connection"]=> string(5) "close" } ["body"]=> string(137) "{ "error_message" : "You have exceeded your daily request quota for this API.", "results" : [], "status" : "OVER_QUERY_LIMIT" } " ["response"]=> array(2) { ["code"]=> int(200) ["message"]=> string(2) "OK" } ["cookies"]=> array(0) { } ["filename"]=> NULL }This is on a brand new install, with a new web hosting platform I’m trying out. There are only three jobs created. I did have Geojobmanager installed when I created the jobs, which I’ve now deactivated. I noticed jobs weren’t being geolocated which led me to this post.
Any idea why this might be happening?
Thanks,
James