WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: PHP Snippets] Displayed list of snippets won't download to page.

[Resolved] [Plugin: PHP Snippets] Displayed list of snippets won't download to page.

  • Hi,

    I have just stumbled across this extremely interesting plug-in and felt it was the answer to my prayers.

    However, the problem I have is that whilst my created test snippets are displayed in the list of options along with the samples, clicking on these will not load them onto the WP page. The samples work fine when the links are clicked and function perfectly!

    Any ideas?

    http://wordpress.org/extend/plugins/php-snippets/

Viewing 9 replies - 1 through 9 (of 9 total)
  • When you say “clicking on these will not load them onto the WP page” — what do you mean exactly? Do you mean that the short-codes don’t get pasted into the page when you click them? Here’s where a screencast would say a thousand words (try using Jing).

    That could be caused by 2 things: make sure your description is contained in a single line with no returns. Also, there have been bugs if the description contains quotes (e.g. apostrophes). Try removing any single or double quotes. Paste an example of your header from one of your snippets

    <Do you mean that the short-codes don’t get pasted into the page when you click them?>

    Yes, exactly that. Interestingly, if I enter the shortcode manually it is fine. I guess the alternative is to keep a list of shortcodes on a handy bit of paper!

    Can you paste the contents of your info-head(s) here? The shortcodes work since they’re all in PHP — the problem you described is all about Javascript — so there’s something in your information head there where the text is not making it cleanly through Javascript. Please paste the contents of your comment blocks here so I can debug it.

    Hi,

    The header is;

    <?php
    /*
    Description: PARISH COUNCIL MEETING DATE CODE.
    Shortcode: [parishmeeting]
    */

    Hello!

    What was finally the problem? I got the same behavior.

    Thx!

    Sorry, I can’t help. I just stopped using it until it gets resolved.

    ok I found the issue. It’s due to type of used carriage return.

    On unix system -> LF
    On windows system -> CR LF

    When I have converted my file to use unix carriage return, it works.

    The plugin is Unix supported but not windows. That’s a bug I guess.

    just found something interesting about PHP code standard:

    Line termination follows the Unix text file convention. Lines must end with a single linefeed (LF) character. Linefeed characters are represented as ordinal 10, or hexadecimal 0x0A.

    So this is not a bug. As php developper, we need to make sure we follow standard.

    This would be good to file in the bug tracker: I develop only on Mac and Linux, never on Windows. I can rewrite the regular expressions to ensure that the Windows line endings do not corrupt the Javascript.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] [Plugin: PHP Snippets] Displayed list of snippets won't download to page.’ is closed to new replies.