Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Thank you for posting about the issue. It’s the first time to hear about it – there were a couple of people who mentioned that having a large number of posts (~5000, I think it was) slowed down the queries/page load, but that’s true in general.

    ..at the time I didn’t have any shortcodes being used on the site

    This is an interesting point: if the plugin wasn’t doing any work, then it means there’s a memory issue only from being loaded..?

    In the plugin settings, could you try turning off all modules one by one to see if any of them are directly related? For example, the [raw] shortcode by its nature needs to parse the post content, which could be memory intensive.

    Also, the plugin Query Monitor could be helpful in showing a stack trace of the error, to see where it originated.

    Meanwhile, I’ll try to recreate the issue on my end to analyze where it could be happening.

    Thread Starter Bryan Willis

    (@codecandid)

    Hey thanks for the reply Eliot. I backed up the site so I could try it on WPENGINE because I know it will work there.

    When this originally happened, Query Monitor was actually the first thing I checked, but since the page was “cashing out” before it was able load all the way, the Admin Bar and Query Monitor wouldn’t load.

    Anyway, WP-ENGINE lets you create sandbox servers, so I’m going to try and recreate there. I’ll let you know when I do and can give you login access if you want to check it out so you don’t have to waste your time trying to recreate. Just let me know.

    Thread Starter Bryan Willis

    (@codecandid)

    Hey Eliot I got to the bottom of it. I created a sandbox on WPENGINE and transferred over the .sql database file from the GoDaddy site. To my surprise it didn’t work there either and was bringing me to a 502 error page.

    So I took the same steps I did on GoDaddy and I disabled all the plugins, then the genesis child theme, then genesis, and all the plugins. Still no luck.

    The fatal error logged in the debug for exhausted memory occured on one of three lines below each time the page would load

    wp-includes/shortcodes.php on line 200
        wp-includes/shortcodes.php on line 227
        wp-includes/shortcodes.php on line 196

    In the backend, while updating the post, query monitor would report this

    Since this whole time I’d thought it was too long of a post I decided to see how many words I could actually have before it broke, but not even that helped! I only had a paragraph left and it still broke.

    Anyway, I switched to html mode and caught it right away. I wish I had done that earlier…

    This was the second sentence of the article:

    The study, published in Health Affairs scientific journal, found that 50 US hospitals were charging an average of 10 times the actual cost of providing care to their patients.

    But when looking at it in html mode, the comment you quoted me on about having no shortcodes caught my attention :

    <a href="http://content.healthaffairs.org/content/34/6/922.abstract[content.healthaffairs.org]">The study, published in <em>Health Affairs</em> scientific journal</a>, found that 50 US hospitals were charging an average of 10 times the actual cost of providing care to their patients.

    I’ll tell the owner of the website to try to find a different link to point to because I know urls aren’t suppose use square brackets. However, what do you think the odds are that we can fix this with custom content shortcode, since it allows shortcodes to be used in urls?

    Plugin Author Eliot Akira

    (@miyarakira)

    Ahh, I see, it’s interpreted as [content] which shows the content of the current post, which then runs it again, in an infinite loop. I actually came across this problem before – someone just put [content] in a post, which ran itself endlessly. I’ll work on a solution to detect this situation and stop it from happening.

    I’m not sure if there is a way to prevent accidental shortcodes. The difficulty is that square brackets are fairly common to use, and that’s a fundamental design problem of shortcodes. The strange thing I see above, is that there is no closing square bracket ] – so it looks like it shouldn’t be interpreted as a shortcode.

    A couple related points.. There is a [direct] shortcode, which can be used to disable shortcodes inside itself.

    [direct]
      Here, shortcodes like [content] are displayed directly, without running.
    [/direct]

    Another point is about the escape parameter for fields. When using a field value in an HTML attribute like a link, this will prevent issues if the value contains special characters like " or &.

    <a href="[field url]" title="[field title escape='true']">

    Anyway, I’ve started on a solution to prevent infinite loops, and will include it in the next update. Thanks for the information.

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, I just made a plugin update so [content] will detect if it’s showing the current post already, and show a warning if there’s an infinite loop happening.

    Yes, I see the link ends with [content.healthaffairs.org] which was causing the issue. You’re right that [ and ] are not valid characters for URL and should be escaped.

    Thread Starter Bryan Willis

    (@codecandid)

    Glad we got this figured out quickly. Thanks again for the quick responses. You’ve really done a great job with this plugin. Reminds me a lot of Timber, but way more convienent for wordpress. I’ve actually been taking some ideas from https://github.com/cftp/shortcode-suggest and http://gndev.info/shortcodes-ultimate/maker/ the last month and am making an addon for custom-content-shortcode, that would give us a custom post type for the templates with autocompletion and an insert button on the post editor. I’ll let you know how it goes!

    Plugin Author Eliot Akira

    (@miyarakira)

    Wow, first add-on for the plugin, cool! Curious to hear how it turns out. I’ve been using the front page of the plugin references as a place to put announcements and notices. I can put a link to your add-on there so people will know about it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Memory issues’ is closed to new replies.