WordPress.org

Ready to get started?Download WordPress

Forums

PHP Snippets
[resolved] Displayed list of snippets won't download to page. (10 posts)

  1. nigelpt
    Member
    Posted 1 year ago #

    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/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. nigelpt
    Member
    Posted 1 year ago #

    <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!

  4. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. nigelpt
    Member
    Posted 1 year ago #

    Hi,

    The header is;

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

  6. be_tnt
    Member
    Posted 1 year ago #

    Hello!

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

    Thx!

  7. nigelpt
    Member
    Posted 1 year ago #

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

  8. be_tnt
    Member
    Posted 1 year ago #

    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.

  9. be_tnt
    Member
    Posted 1 year ago #

    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.

  10. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic