Jay McPartland
Forum Replies Created
-
Forum: Plugins
In reply to: [Account Engagement] Issue with wp-loadNo worries, Cliff. Thanks for sorting everything, it all happened just in time! 🙂
Forum: Plugins
In reply to: [Account Engagement] Issue with wp-loadThat would do it, yeah 🙂
CheersForum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)Thanks. It worked with the third account I tried! 🙂
Forum: Plugins
In reply to: [Account Engagement] Issue with wp-loadHi Cliff
It does the job, mostly 🙂
The only issue with this solution (in my environment, at least), is on this line: http://jon.moe/15rtu/3ldgONBd
Because you’re assigning$wp_loadto a string, its value is no longer falsey (in my environment, it’s set to/Users/wp-load.phpat this point), regardless of whether the file exists or not. As such, line 27 will equate to true, and the custom file will not be loaded.
The solution, for me, was to change line 22 toif ( file_exists( $filepath = "{$dir}/wp-load.php" ) ) {, and add$wp_load = $filepath;on line 23 (abovebreak;). That way,$wp_loadremains false if the file doesn’t exist.Cheers!
Forum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)Not on this installation, no. I’ve tried resetting my settings repeatedly. I’ll see if I can’t get someone else with access to that Pardot account to try authenticating, I guess, in case it’s a problem with my account.
Forum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)Hi Cliff
Thanks for sorting this (and the other things noted on the other threads).
I’ve cloned 1.4, but it won’t allow me to authenticate, so I’m currently unable to test the new functionality. User name & password are definitely correct (I even tried changing my password), and the API key was a copy/paste from the Pardot dashboard. I’m an account administrator – should that be sufficient, or would I need to use the account owner’s information (it’s been a while!)?Cheers!
Forum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)Fair enough. I suppose that, as long as the functionality implemented is documented on the Pardot site’s KB, users can figure it out.
Thanks for looking into this.Forum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)We do have forms that are set-and-forget, too, but the majority do need the query string. Perhaps ask your API devs for an endpoint that returns just the URL of a form requested by ID? 😉
That’s pretty much what I’ve implemented currently, yes. My concern with that (and why I didn’t submit a PR) is that I wasn’t sure it was the most user-friendly way in which to allow the user to add custom fields. By that, I mean that not all Pardot users may understand what a query string is, or how to build one, which is why this plugin is likely very important to their workflow.
I have been pondering whether allowing a comma/colon separated list of key/value pairs might be more beneficial to some users, using that to build the query string in the back end. In that case, users only have to worry about what their custom fields are called, and what values they wish to pass to each.
What are your thoughts on that?Forum: Plugins
In reply to: [Account Engagement] Custom field integration (feature request)I did think about implementing my own solution from scratch but, from the client’s perspective, having the Pardot integration as it stands in the current plugin is much preferable to remembering a custom shortcode’s syntax. By simply extending the base implementation offered by the plugin, I’m saving myself time and effort, as well as maintaining the client’s user experience at no extra cost to them (from time spent by me).
When I submitted the feature request, I did so under the assumption that there will be a decent number of Pardot clients running WordPress (hence the existence of the plugin in the first instance), and that many of them would like the ability to implement custom fields. I’ll be surprised if I’m the first to require such functionality! 🙂Forum: Plugins
In reply to: [Account Engagement] Issue with wp-loadThanks for the response.
When I discovered the issue, I did mull over setting a constant in wp-config, but I found inconsistent behaviour with supposedly predefined constants, which is why I ended up hard-coding the path into the loader.
I did also look into whether WP had some predefined methodology for returning the WP directory (perhaps similar toget_template_directory()), but didn’t find anything.If it’s true that there is no predefined way of returning the installation directory, there’s a few ways to try to find it manually, but I don’t think any of those are going to be foolproof.
Since one has to set theWP_SITEURLconstant to point to the wordpress installation folder (else WP will use its ridiculouswp_guess_url()function), one method might be to strip the domain from the constant, which would leave the installation folder name.
That can then be fully resolved withrealpathor similar. Something like this, for example.
file_exists(realpath(str_replace($_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"]."/", "", WP_SITEURL))."/wp-load.php");
This looks absolutely horrible but, with WP_SITEURL set inwp-config.php, it’d be _somewhat_ reliable (though I am loathe to use the word).Currently, I wouldn’t be able to update the Pardot plugin, regardless, since I’ve modified the form shortcode to allow the addition of a custom field + value (re this other thread). I’ve not submitted a pull request as yet as it’s not as extensive as I’d like, i.e. it only allows addition of one custom field.
Thanks
Forum: Plugins
In reply to: [Account Engagement] Issue with wp-loadCertainly. On the project I’m working on, we have it as follows:
docroot
|
|—–/content
| |
| |—–/themes
|
|—–/wordpress
| |
| |—–/wp-admin
| |—–/wp-includes
| |—–/wp-load.php
etcCurrently, the function to find wp-load.php traverses up the directory tree from the plugin directory; this prevents, of course, traversing sibling directories.
Many thanks