Support » Plugin: Print My Blog - Print, PDF, & eBook Converter WordPress Plugin » Plugin Does Not Work with Large Site

  • Resolved lostpine

    (@lostpine)


    Thanks for looking into this. I have tried your plugin on a smaller site I support and it works as advertised. However, my main site is quite large, over 900 pages and it is pages that I am trying to convert. Not necessarily all of them. I have tried filtering by categories and tags, neither works. The plugin just reads the correct number of pages in and then a small wheel spins. I have not released this plugin to my users so you need admin access to test it. You can message me and I can set up a test account for you if you would like to run it yourself. Just tell me the “permissions” you need. The concept of the plugin is great. Looking forward to finding a solution. I also would then love to test ebooks too.

    The page I need help with: [log in to see the link]

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

    (@mnelson4)

    Hi @lostpine, thanks so much for offering me a test account. I actually don’t need admin access, just to have Print My Blog active (that’s because you just need to know the special URL to use to use it on all the public data).
    I see the trouble I’m getting is that the WP REST API isn’t allowing incoming requests. Eg when I go to https://www.lostpine.com/wp-json/ I see this https://i.imgur.com/Wiih0Af.png
    It might work if I were logged in, or on your network or something.
    Are you using a security plugin on your site? If so, they often disable the WP REST API on them. I have a FAQ that mentions how to enable the WP REST API for some of the security plugins. Do you see your security plugin in that list?

    Thread Starter lostpine

    (@lostpine)

    Yes, I am using WP Cerber and it disables WP REST API. That disabled function is a recommendation for securing sites. Mine is attacked quite frequently so I tend to default to safe. I opened up REST API for Admin and I can see in the WP Cerber log that there are pages being created. However, it stops at page 94 and I would have expected more.

    I also spent some time looking at my CATEGORIES. My theme did not have Page Categories so I added a function to put them in. When I open my dashboard I can click and see the posts if I click on Post categories but when I try to do the same for pages, I get nothing. Do you think that either your plugin is giving up, I am running out of space somewhere or I have a configuration issue with Categories?

    Plugin Author Michael Nelson

    (@mnelson4)

    Ah ok, well that’s some progress.

    Ya it is good security policy to disable anything you’re not using, and often the WordPress REST API isn’t used. If you aren’t enabling Print My Blog’s print buttons for site visitors, Cerber lets you just enable it for site users, or even just administrators. That’s probably a good option for you, and still very secure.

    I’m not sure what you mean by WP Cerber log though. I don’t think you mean the “Audit log” or “change log” (see screenshot) right? I’m not sure which Cerber log creates pages. Can you maybe send a screenshot of that page?

    Regarding page categories, I think it depends how you registered the page category (or the “taxonomy” to be more precise). In the code where you register it, you need to set "show_in_rest" => true. See the documentation on that here: https://developer.wordpress.org/reference/functions/register_taxonomy/ I suspect you didn’t have that before, but adding that may fix the problem. Does that make sense?

    Thread Starter lostpine

    (@lostpine)

    The log probably was not the correct term. Cerber calls it the TRAFFIC INSPECTOR. It shows history of REST API Requests.

    I made a screen capture but not sure how to attach it. I am pursuing now your other advice on categories. They don’t seem right on my site so until I make them work correctly, you shouldn’t be too concerned on your plugin. However, I do notice that even when I don’t pick a category, it will not produce a .PDF file (I am assuming this unless I just am not waiting long enough). Site has 940 pages and the category I picked had about 125 pages. These were WP Pages.

    Thread Starter lostpine

    (@lostpine)

    Just a status check. I did find that I had an old REST API Plugin still active. This has been uninstalled and deleted. I set CERBER to let Admin have access to REST API. I cleared out the way I was doing tags and categories and went with your model recommendations. They are there and appear on the pages and posts correctly. Now when I run your plugin, I am just trying posts, I only have nine. I can see in the CERBER traffic inspector that all of the commands go to REST API but the little wheel keeps spinning. I am not trying to filter anything. So for now, I am just going to stand down on this topic. My feeling is that there is something wrong with my site, either a plugin or the theme. If I get time over the holiday, I will do more diagnostics. Thanks for your efforts in looking at this.

    Plugin Author Michael Nelson

    (@mnelson4)

    Ok I think I understand the Cerber Traffic Inspector you’re talking about. So it sounds like the REST API is now working ok but something else isn’t.
    If at some point you’d like me to help debug further, you could temporarily allow non-logged-in users access to the REST API, then I can see Print My Blog in action on your site and will hopefully see what’s going wrong. But I understand this has been more of a time investment than you expected. (FYI I am working on changing Print My Blog to not use the REST API, because it’s common for it to be disabled, like it was on your site, which makes it a headache for users.)
    Anyways, feel free to chime in again if you’d like more help getting it to work properly, but I understand if you’d rather not. Either way, take care!

    Thread Starter lostpine

    (@lostpine)

    I had some time to work on this and here is the current status:

    Taxonomy is now only Categories. I have cleared my tags.

    Traffic Inspector shows that REST API is open and working when I issue a request to PRINT MY BLOG.

    The Traffic Inspector shows that the operation halts on page 94

    /wp-json/wp/v2/pages?context=edit&status=publish&_embed=1&page=94

    Little wheel keeps spinning. Since I don’t know exactly what page that is, I do not know whether there is something on the page itself. However, it is a simple page of text and I have hundreds like it so I am not pursuing that concern.

    I will periodically work with my Categories themselves to see if there is something theme related. The simple site I used PRINT MY BLOG on that worked is not the same theme but uses pretty much the same plugins.

    Thanks for your time. I will be interested to see if removing the dependency on REST API helps this issue.

    Plugin Author Michael Nelson

    (@mnelson4)

    Hi @lostpine, great I was able to run Print My Blog on your site, and made some progress.

    Something is rewriting the URLs on your server, specifically changing the part of the URL that reads &statuses[]=publish to &statuses=publish (it removes the []). That was confusing the code, so it was having a silent error when it tried to place the pages’ content on the page. I have a fix for that issue. Here’s how to try the fix:

    1. Download the new version from here:
    https://github.com/mnelson4/printmyblog/archive/BUG/lost-pine-fixes.zip
    2. Go to your WordPress dashboard, click plugins, then “add new”, then “upload” and select the zip file you just downloaded
    3. Deactivate the previous version Print My Blog
    4. Activate the new version of Print My Blog
    5. Try Print My Blog WITHOUT filtering by category or date. It should show all posts/pages fine. (Plus the “Translate” and “Dark/Light” mode hovering buttons should be removed.)

    But that doesn’t fix the issue with filtering by categories and dates not working. That URL rewriting I mentioned earlier is causing those to not work too, and the fix isn’t so straightforward there. It’s possible that problem is from another plugin (maybe a redirection plugin?) or your hosting company.

    Is this site hosted by the same company that hosts the others sites you’ve used with Print My Blog (which didn’t have any issues)? If it’s a different company, then you should ask this hosting company why they’re removing square brackets (eg [ and ]) from URLs, and if they can stop that.

    If this site is with the same hosting company (which didn’t have any problem), then there’s probably another plugin rewriting the URLs. We’d probably have to disable them one-by-one (starting with the redirection-related plugins, those are the most likely) and see if that fixes the problem.

    So in summary:
    1. Please try the updated version linked-to above
    2A. If this site is using a different hosting company than your other sites, ask them why they’re removing sqaure brackets from URLs and if they can allow that
    2B. If this site is using the same hosting company as your other sites, we’ll need to try disabling each other plugin individually to see if the issue gets fixed.

    Does that make sense?

    Thread Starter lostpine

    (@lostpine)

    Did as directed with good results. No issues on the download and replacement. I went and ran the PRINT MY BLOG function without filters. Site produced a 3,318 page PDF file which I successfully saved to my computer. In looking at the PDF file, everything appeared to be as you would have expected it to be. Of course, I am interested in filtering at least on Categories. I don’t see much of a practical application for a PDF of my full site other than for archival purposes. The other sites that I tested PRINT MY BLOG are all hosted by GoDaddy. Actually, I have access to 8 sites because I volunteer to help not-for-profits with maintenance. Now that the holidays are past, I will start to look at plugins and see if I can find one that might be causing the issues you highlighted. When doing my original test, I kept the testing to lostpine as well as subwebs and did not use others under different accounts. In the next day or so, I should have more feedback. My first plugin to understand is one that I put in to Prevent XSS Vulnerability. This has been a problem for me in the past. I think this plugin does some of what you are concerned about.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.