Forum Replies Created

Viewing 15 replies - 1 through 15 (of 38 total)
  • If you have a GitHub repo I have a PR To send 😉

    Thread Starter johnnyb

    (@johnnyb)

    Here’s how I’m working around the problem for now:

    
    function ca_filter_is_api_request_to_allow_cf7_requests_through_api( $is_rest_api_request ) {
    
    	if ( $is_rest_api_request ) {
    		$rest_prefix         = trailingslashit( rest_get_url_prefix() ) . 'contact-form-7';
    		$is_rest_api_request = ! ( false !== strpos( $_SERVER['REQUEST_URI'], $rest_prefix ) );
    	}
    
    	return $is_rest_api_request;
    }
    add_filter( 'woocommerce_is_rest_api_request', 'ca_filter_is_api_request_to_allow_cf7_requests_through_api' );

    The logic is:
    1. If this has been determined by WooCommerce to be an API request
    2. AND it’s a request for the CF7 API
    3. Tell WooCommerce this is NOT an API request.

    That way WooCommerce initializes the cart and properly sets the UID used when creating nonces. It feels ugly and risky, but can be done with a filter and we don’t have to modify any core or plugin files.

    • This reply was modified 5 years, 3 months ago by johnnyb.
    • This reply was modified 5 years, 3 months ago by johnnyb. Reason: formatting
    Thread Starter johnnyb

    (@johnnyb)

    Update: This is not a caching problem!

    It turned out to be WooCommerce. If someone has added an item to their cart during the session WooCommerce filters the User ID used to create nonces, but doesn’t provide that same filtering for API requests 🙁 The result is that anyone who has added something to the cart or made a purchase can’t use a contact form until they establish a new session.

    There’s an issue over on Github<. Direct link to my comment about how this is affecting CF7.

    I’m going to mark this as resolved for now. I’ll post back if I find a good workaround.

    I am also having this problem. It not only removes the dashicons, but it breaks the TinyMCE functionality of the “Classic” Gutenberg block.

    Edit: Confirming that I have gone through the steps in the “Official topic for compatibility issues with Page Builder by SiteOrigin” thread. This happens on a freshly updated clean install, running the TwentySeventeen theme, and only SiteOrigin Page Builder and Black Studio TinyMCE Widget running. The conflict does not happen with SiteOrigin Page Builder + SiteOrigin Widgets Bundle, but a lot of content already exists using Black Studio TinyMCE widget and I would like to avoid recreating it all with a new plugin.

    • This reply was modified 7 years, 5 months ago by johnnyb.

    @emilygonsalves & @kellyscurtis – If you’re still looking for a solution I just made a tiny plugin that does it. There’s no additional styling, but it works all right in the theme I’m using.

    If there’s a Title set on the image it shows the title, and if there’s a caption it shows the caption, (and if there’s both, it shows both).

    The plugin’s not in the WP.org directory, (yet?), but it’s here: https://github.com/jbeales/woo-gallery-captions

    Let me know if it works for you, and if you need any changes. If it solves problems for a few people I’ll try to get it into the WP.org Plugin Directory.

    Update again: Be very, very, sure that you have no extra white space around your API key when you paste it into the API Key box on the settings page. I had a space at the beginning of the API key and that was causing the trouble. When I found & removed the space the old API key that didn’t work before started working.

    @team-rs: Could you trim() the API key at some point? Since it’s masked as a password white-space is a very hard error to catch.

    @team-rs It looks like you’re using the V2 API endpoint to send messages when using the API:

    From class-sendgrid-api.php:
    const URL = "https://api.sendgrid.com/api/mail.send.json";

    But according to these docs on your site API keys are only supported on the V3 API and later.

    I tried just switching the URL to a V3 URL, and that didn’t work, but my error changed from an HTTP 400 to an HTTP 401.

    Update: It seems that getting a new API key started things working. Both keys have the same permissions, I’m not sure why one works and the other doesn’t.

    • This reply was modified 9 years, 5 months ago by johnnyb. Reason: Found a solution
    Forum: Reviews
    In reply to: [DeadTrees] Almost Perfect
    Plugin Author johnnyb

    (@johnnyb)

    Thanks for the review! When you’re asking for category support, do you mean like ships for Posts in WordPress?

    Forum: Plugins
    In reply to: [DeadTrees] 404 Not Found
    Plugin Author johnnyb

    (@johnnyb)

    I did some poking around and I *think* that the latest version of Suffusion might fix the problem.

    What’s going on is that the styles are all attached to the .post classname in the theme, but since the book isn’t a “post” post type, it’s a dt_book, no .post classname is generated, (a .dt_book classname is).

    I took a look at some of the Suffusion code and it seems that the post classname is automatically inserted in some situations, which may help.

    If you’re editing the CSS manually, or the theme files, adding .post to the list of classes seems to fix things.

    Forum: Plugins
    In reply to: [DeadTrees] 404 Not Found
    Plugin Author johnnyb

    (@johnnyb)

    I just pushed an update, you should see it in your WordPress admin next time you log in.

    To display books on your blog’s homepage, go to Settings > Dead Trees and choose “Book Section, tag and date archive pages” for the “Display Books On” setting, then save. Let me know if you have any more issues.

    Forum: Plugins
    In reply to: [DeadTrees] 404 Not Found
    Plugin Author johnnyb

    (@johnnyb)

    Hi,

    It’s not your theme. Books are a special post type so they’re not included in your blog’s homepage by default. There’s a setting under Settings > Dead Trees to include them in archive pages, but apparently it doesn’t save properly, I’ll have to fix that. At the same time I’ll try to make it so books will display on the main page of your blog. Watch for an update in the admin.

    Forum: Plugins
    In reply to: [DeadTrees] 404 Not Found
    Plugin Author johnnyb

    (@johnnyb)

    Hi,

    First, look at the simple possibilities:

    Does the book have a status of Published? If not, you’ll have to publish the book first.

    Is the book set to Private? If so, you might not see the book, especially if your login session has expired or something.

    If those don’t solve the problem try visiting the Settings > Permalinks page in the WordPress admin. If that doesn’t work, click the “Save Changes” button without changing anything. This should flush any permalink rules and will hopefully get rid of the 404.

    If none of those work post back here and I’ll try to help you out. When you do post back, let me know if your account is an Administrator account, or something less, like an Editor or an Author.

    Good Luck!

    Plugin Author johnnyb

    (@johnnyb)

    Got it. It looks like I have some work to do to get the next version out 😉

    Plugin Author johnnyb

    (@johnnyb)

    So far there’s only US, UK, & CA Amazon support, but I’d like to expand it to support all Amazon sites. Which one(s) are you looking for in particular?

    You can insert an Amazon affiliate ID. Go to Settings > DeadTrees in the WordPress admin, that’s where you put in your Amazon info.

    Plugin Author johnnyb

    (@johnnyb)

    So it looks like I’ll be able to make book links work through indiebound.org. I’m waiting on info to see if it’ll work on individual bookstore sites, and I’m working on better ways to get book covers.

Viewing 15 replies - 1 through 15 (of 38 total)