Jason Judge
Forum Replies Created
-
Forum: Reviews
In reply to: [CSV Importer Improved] Still works!!!OMG, did I write this? Totally forgot, and WordPress has certainly not been sending me any reviews or issue reports, so I completely lost track of it.
I suppose it could be something backing up ALL the tables, but only the particularly slow tables are making it to the slow query log.
I’ll chase it up with the other devs. There’s nothing I have installed that would back up databases like this, table by table, but maybe someone has…
Thanks for the quick response ??
Started for us yesterday (2018-04-21) afternoon, PHP 5.6. Every five minutes, it has filled up my inbox with warnings. We have a five minute scheduler running, which is generating this warning.
PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, class '\Layered\IfMenu\Admin' not found in .../httpdocs/wp-includes/class-wp-hook.php on line 286
We don’t see it on the from end, because error display and debug are turned off, and WP has literally no error log to send these things to. And the fact that front-end plugins like this are loaded during off-line scheduled events is just another crappy thing about WP, but we put up with it.
- This reply was modified 6 years, 10 months ago by Jason Judge.
- This reply was modified 6 years, 10 months ago by Jason Judge.
Forum: Plugins
In reply to: [WooCommerce Custom Product Data Fields] Documentation Page OfflineStill offline – the server on the domain (or the domain itself) cannot be found.
Forum: Plugins
In reply to: [WC API Custom Meta] Does not work for woo 3.0Please use the new v2 REST API (WC 3.x) instead of this plugin. It now does everything this plugin does out of the box. The github README gives some examples of how you would manage the metadata fields:
https://github.com/judgej/wc-api-custom-meta
WC 3.1.x has a very different API (v2 REST) and you should be using that now.
Forum: Plugins
In reply to: [WC API Custom Meta] Suggestion: Extend to custom fields in the order too?Please use the new v2 REST API (WC 3.x) instead of this plugin. It now does everything this plugin does out of the box. The github README gives some examples of how you would manage the metadata fields:
https://github.com/judgej/wc-api-custom-meta
The v3 REST API supports orders, customers, etc. with metadata for all of them.
Forum: Plugins
In reply to: [WP Job Manager] What API facilities are available?Thanks. I’ve since added
get_permalink()
and a few other bits of public data to my snippet. There is no security enforced on it, as none is needed in this case. Hopefully it will be useful to someone in the interim.I will watch and wait with eager anticipation. It’s all good ??
Forum: Plugins
In reply to: [WP Job Manager] What API facilities are available?This snippet in functions.php does the trick for now, until I know what is happening with the API officially:
/** * API Access to job titles and some other limited data. * This will go into a plugin of its own at some point. */ add_action('rest_api_init', function () { register_rest_route( 'wpjm_public/v1', '/title/(?P<id>\d+)',[ 'methods' => 'GET', 'callback' => function(WP_REST_Request $request) { // The ID of the job we want. $post_id = $request->get_param('id'); // Get the job. $post = get_post($post_id); // Return the limited job details, if it is a job listing. if ($post->post_type == 'job_listing') { return [$post_id => ['post_title' => $post->post_title]]; } // No post or the wrong type of post. return new WP_Error('invalid_job', 'Invalid job', ['status' => 404]); }, ]); });
I can get a job title using a URL like this:
https://example.com/wp-json/wpjm_public/v1/title/41820
The result is an array, and the job title is in any array, to allow for extending to return multiple jobs and multiple data items per job. It is limited by design as it is not taking into account any group security on the job listings, so only the minimum is exposed.
- This reply was modified 7 years, 8 months ago by Jason Judge.
- This reply was modified 7 years, 8 months ago by Jason Judge.
Forum: Plugins
In reply to: [WC API Custom Meta] Does not work for woo 3.0Release 0.7.1 just made with this quick fix. I’ve not had time to test it properly, so I’ll try to fix any consequential issues quickly with enough information.
Forum: Plugins
In reply to: [WC API Custom Meta] Does not work for woo 3.0Thanks Robert, I’ll try to get that into a release today.
I will add that as “an alternative” to GA code snippets, it means that once the site is set up, a lot of the tracking can be configured and updated from within GTM by a third party, without changing settings on your site. So long as all the information that *may be* needed is available on the page as a JavaScript object, then through GTM you can pick and choose at any time how you want to use that data for tracking, both in terms of where the data goes, and when it is tracked. It’s quite flexible and very sophisticated.
Sounds marvellous, yes? The upside is also its downside. The fact that everything needs to be set up through a complex set of GTM admin pages means an GTM expert has to be involved to set it up. The old method puts all (or most of) the control into plugin you install on the website, so little expertise is needed. That setup is moved to pointy-clicky configuration screens, and that completely changes the market to who the end users are. It’s great if you are selling your GTM skills though.
Just my 2p ??
- This reply was modified 7 years, 9 months ago by Jason Judge.
- This reply was modified 7 years, 9 months ago by Jason Judge.
Forum: Plugins
In reply to: [Query Recorder] Recording SELECT queriesI’ve put the amended plugin here if it is any use to anyone:
https://github.com/judgej/WordPress-Query-Recorder
I have noticed however that not all queries are caught. I’m debugging a WooCommerce query that updates taxonomy counts after updating a product, and that cannot be seen in the list even though I know it runs (by logging the query explicitly before it executes). It’s the query in _wc_terms_recount https://github.com/woocommerce/woocommerce/blob/25bca1c2183c27b59c47bddf38172bd0264bffe9/includes/wc-term-functions.php#L557 and that uses $wpdb->get_var($sql_query) so I would not expect it to bypass any logging.
Anyway – take it as a starting point and feel free to submit PRs to improve it. I’ve not changed any of the author details – just what I needed to use it.
Forum: Plugins
In reply to: [Query Recorder] Recording SELECT queriesThis seems to be the only plugin I can find that records queries to a file, so you can monitor queries during POST requests (when there is no page returned for showing the debug bar). But only DML – no SQL! What a strange omission.
I’ll hack those code changes in to my install. Thanks.
The ga_dash_addtrackingcode action hook is great for adding new custom dimension data. I wonder if you could pass
$this
as a parameter, or at least$this->gawp
. That way the hooked code has access to the settings and so on for your plugin without having to go out to globals.Another place where an action would be very useful, is the events-unieveral.php event tracking code, within the
$(window).load(function() {...}
. I realise we can add that jQuery wrapper ourselves, but it is nice for all the event-based tracking code to be collected together in one place like this.Fantastic ??
Will the hook work the same in 5.0 as it does in 4.9? Just wondering whether it is worth diving into the hooks now, or waiting for 5.0 to come out and do the configuration through the GUI.