Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter Jay McPartland

    (@jonmcpartland)

    No worries, Cliff. Thanks for sorting everything, it all happened just in time! 🙂

    Thread Starter Jay McPartland

    (@jonmcpartland)

    That would do it, yeah 🙂
    Cheers

    Thread Starter Jay McPartland

    (@jonmcpartland)

    Thanks. It worked with the third account I tried! 🙂

    Thread Starter Jay McPartland

    (@jonmcpartland)

    Hi 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_load to a string, its value is no longer falsey (in my environment, it’s set to /Users/wp-load.php at 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 to if ( file_exists( $filepath = "{$dir}/wp-load.php" ) ) {, and add $wp_load = $filepath; on line 23 (above break;). That way, $wp_load remains false if the file doesn’t exist.

    Cheers!

    Thread Starter Jay McPartland

    (@jonmcpartland)

    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.

    Thread Starter Jay McPartland

    (@jonmcpartland)

    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!

    Thread Starter Jay McPartland

    (@jonmcpartland)

    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.

    Thread Starter Jay McPartland

    (@jonmcpartland)

    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?

    Thread Starter Jay McPartland

    (@jonmcpartland)

    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! 🙂

    Thread Starter Jay McPartland

    (@jonmcpartland)

    Thanks 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 to get_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 the WP_SITEURL constant to point to the wordpress installation folder (else WP will use its ridiculous wp_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 with realpath or 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 in wp-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

    Thread Starter Jay McPartland

    (@jonmcpartland)

    Certainly. On the project I’m working on, we have it as follows:

    docroot
    |
    |—–/content
    | |
    | |—–/themes
    |
    |—–/wordpress
    | |
    | |—–/wp-admin
    | |—–/wp-includes
    | |—–/wp-load.php
    etc

    Currently, 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

Viewing 11 replies - 1 through 11 (of 11 total)