• Resolved Lea

    (@leac)


    In case I don’t need my whole site printed, but just certain blog posts (for example a series of posts on a certain topic), I would appreciate being able to limit the printing by category or tag (maybe also by date, but I assume that’s more complicated).

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Michael Nelson

    (@mnelson4)

    Thanks @leac, ya I’ve actually been thinking about printing a single category, or a date range too (that also came up on https://wordpress.org/support/topic/wonderful-585/#post-10963900).
    So I’ll probably work on that next. I’ll update this thread when I have something ready, if you wouldn’t mind giving it an initial look-over before general release.

    Thread Starter Lea

    (@leac)

    Thank you for your ongoing development of features.

    I’d be very happy to test it when you’re ready.

    Plugin Author Michael Nelson

    (@mnelson4)

    FYI @leac, I haven’t gotten around to this yet, I definitely will, but I first want to finish the work mentioned on https://wordpress.org/support/topic/option-to-print-comments-too/#post-11220852 (it mostly needs some testing, theoretically it works well). After that I’ll get to this.

    Plugin Author Michael Nelson

    (@mnelson4)

    btw @leac I haven’t forgotten about this… Just got a little sidetracked while fixing a theme compatibility issue. This is still my next major focus (although finding a general solution for all these plugins/themes’ shortcodes not working is looking like my next major focus, see https://github.com/mnelson4/printmyblog/issues/12)

    Plugin Author Michael Nelson

    (@mnelson4)

    hi @leac this is now working. Would you mind testing it by downloading it from https://github.com/mnelson4/printmyblog/archive/FET/filter-by-category.zip ?
    Also, when I try to send REST API requests to your site from my server, I get a strange response containing basically only Javascript. Any idea why that is?

    Thread Starter Lea

    (@leac)

    Hi Michael,

    Sorry it took me a few days to get to this.

    1. I tried the new version, but I don’t see where to choose a specific tag. Maybe it’s under Filters? Because that part doesn’t load, and just shows a spinner gif.

    2. The strange response you get when you try to send REST API requests could be due to our server being behind a firewall. I could check with the Powers That Be if they can open up what’s needed in order for the requests to get an appropriate response, but I need to know what to ask for exactly.

    Thank you!

    Plugin Author Michael Nelson

    (@mnelson4)

    Thanks @leac!

    Regarding 1, yes, where you see that spinning gif, that’s where the new inputs should appear (it dynamically asks your site what taxonomies are available, often just categories and tags, but some sites have others). Are you using Print My Blog by going to the WP dashboard, then “Tools”, then “Print My Blog”? Or did you place the Gutenberg block on a page and then are using that page? I haven’t got it working yet for the Gutenberg block, so for now you’d need to try it from the WP dashboard page.

    2. Ok I’ll try to isolate how the requests that are failing are different from those that are working. (Although it’s been tricky, and if I had already figured that out, I would have just made the failing requests mimic the working ones…) But just knowing your behind some kind of firewall is a clue (it works with other sites with a web application firewall like Wordfence, but it may depend on settings…) stay tuned regarding this…

    Plugin Author Michael Nelson

    (@mnelson4)

    Followup for 2: when I send a request to https://leketshibolim.ort.org.il/wp-json using the API client Postman or from my server, I get a response with a big obfuscated script and nothing else. Here’s a gist containing it: https://gist.github.com/mnelson4/99ee4233952cd5e4b0ee1bd09f743429

    I can get it to go away if I set the HTTP headers User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0 and Cookie: xxx. So I think your firewall is trying to only allow traditional browsers to use your site (eg probably to prevent bots or brute force attacks). That’s usually good but it does also prevent useful code (like my hosted version of Print My Blog, currently at https::/deadeasyfamilyhistory.org/print-my-blog, from working.) I’d like to know more about the security firewall and what options we have (especially in case others have similar setups). You may prefer to continue this discussion by contacting me at https://cmljnelson.wordpress.com/contact-me/

    • This reply was modified 5 years, 1 month ago by Michael Nelson. Reason: moved big code snippet into a gist and linked to it instead
    Plugin Author Michael Nelson

    (@mnelson4)

    Huh, I just discovered a very similar (free!) service at http://www.bloxp.com which also has trouble with your site. So it’s at least not just Print My Blog.

    Plugin Author Michael Nelson

    (@mnelson4)

    I think I may have found what your issue was. What version of PHP is your site running? I got an error when I was using this latest version with an older version of PHP (5 something).

    Anyway, I’ve released this latest change so others can benefit from it too. Please let me know if you have more issues with it. Also, if you find yourself wanting filtering by dates, let’s open a new issue for that.

    Thanks for the feedback and testing @leac !

    Thread Starter Lea

    (@leac)

    Hi Michael,

    Thank you so much for keeping up with this, and sorry for the delay in my answer.
    I’ll start with telling you that the new version works great! Thank you for addressing all the problems, I really appreciate it.

    On to the rest of the stuff that came up:

    When I go to https://leketshibolim.ort.org.il/wp-json , I get a normal response (here’s a screenshot).
    I think that our firewall does take some extreme measures in blocking access since we are prone to attacks due to our geographical location (Israel), but I’ll look into it and see if anything can be done. Thank you for sharing you results.

    And I’m sorry to disappoint regarding the PHP version: we have version 7.

    Thanks for your ongoing support!

    Plugin Author Michael Nelson

    (@mnelson4)

    Thanks leac.
    FYI if I use Firefox, your site works fine, like you showed in your screenshot. It’s only with the Postman client, and from the WordPress code, that I get that strange response.

    Plugin Author Michael Nelson

    (@mnelson4)

    FYI @leac I just started a version that allows filtering by date, and also mentions what filters were used in the printout (eg what post type, categories, and dates, etc).
    If you want to give it a try, here’s the link: https://github.com/mnelson4/printmyblog/archive/FET/filter-by-date.zip

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Feature request: Print posts in specific category or tag’ is closed to new replies.