WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode Exec PHP
How Do I Add a PHP Page To My Website (21 posts)

  1. 1ststeps
    Member
    Posted 3 years ago #

    I downloaded the plug-in and I don't see any instructions on what to do next, including how do you set it up, that I can understand. I want to add an rss feed to a page that is in a php format. I created a page called "rss-test" and added the php code to it. Now what? The support page is in another language. Obviously I have no knowledge of php so please be specific.

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 3 years ago #

    The idea is that you define your own shortcodes using the WordPress menu Tools > Shortcode Exec PHP and use these in your posts/pages.

    Try putting [hello_world] on your "rss-test" page and you'll probably get the idea.

    The support page is in English, what language did you expect?

  3. 1ststeps
    Member
    Posted 3 years ago #

    I have no clue to what you're talking about. The test doesn't mean anything to me because I don't know what I'm supposed to do or what it's supposed to do. I need step by step directions. I must have been on the wrong support page because it was not english.

    I put the code you suggested here: http://my1ststeps.com/applecidervinegarweightloss/news/

    At the bottom of the page it has "Hello world! Arg=default Content=" is this what it was supposed to do.

    Here is the php code for the rss feed I'm trying to enter on the page. Currently, the javascript version of the newsfeed is on the page so you can see what it should look like.

    <?php
    #Begin code - Feedzilla's news widget
    include ("http://www.FeedZilla.com/tools/steppatch_nc.asp?lang=us&id=11271705062011932&mode=w&charset=iso-8859-1&lcid=1033&country=us&c=&code=php&scroll=v&prov=news&width=468&height=336&cat=Health&cat2=Weight&num_articles=10&show_border=Yes&show_summaries=Yes&show_sources=Yes&show_dates=Yes&title=&keywords=&andor=and&url=&headers_size=14pt&title_size=12pt&title_bold=Yes&font_size=10pt&font_family=Arial&text_alignment=Left&space=Yes&titlecolor=%2315aa15&fcolor=%232200cc&desccolor=%231b1b1b&sourcecolor=%23008000&datecolor=%23777777&bordercolor=%2300232c&bgcolor=%23ffffff&related_show=No&kwd=")
    #End code - Feedzilla's news widget
    ?>

  4. Marcel Bokhorst
    Member
    Plugin Author

    Posted 3 years ago #

    I cannot be more clear than I already was:

    The idea is that you define your own shortcodes using the WordPress menu Tools > Shortcode Exec PHP and use these in your posts/pages.

    You should at least basically understand what you are doing. Maybe reading here helps.

    You can try to add a new shortcode with the code for the news widget (without <?php and ?>), but there is a big chance that it will not work, because most hosting providers do not allow remote includes (http://...).

  5. canoock
    Member
    Posted 3 years ago #

    I admire your patience.

    I just installed your plugin and it is absolutely great and safe! And I am a novice to WordPress!

  6. Marcel Bokhorst
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks!

  7. 1ststeps
    Member
    Posted 3 years ago #

    Thank you for being absolutely no help. I already said I don't know php, just like I didn't know wordpress before I started using it. However, simply knowing what you want to do doesn't mean you understand it well enough to use other people's programs. I thought that was the purpose of support. It's good to know it probably won't work anyway, according to you. So I'll quit wasting my time.

    I have many plugins on my website but this is the first one that I could not get to wort and there was no supportive. I'm sure I'll have better success with another plug-in, where support actually answers your questions.

    Thank you again for being so helpful and I promise not to bother you again.

  8. Marcel Bokhorst
    Member
    Plugin Author

    Posted 3 years ago #

    I am sorry you feel this way. I really tried to point you in the right direction and I am not giving up:

    Assuming you have the plugin still installed: login to your weblog, use the right menu Tools > Shortcode Exec PHP, scroll to the shortcodes section. Replace [hello_world] by [anything-you-like] and replace the code below this name in the big box by the code above in this forum, without <?php and ?> and press the Save button.

    Now, create a post or page and put the shortcode [anything-you-like] in the text to call the code defined in the previous paragraph.

  9. lonniea
    Member
    Posted 3 years ago #

    i've been online for more than 11 years now and train many newbies. my slogan is "Newbies eventually come to me"

    However, for you programmers out there let me explain exactly what newbies are asking for.

    They don't see the overall picture. You MUST add a video or a numbered step-by-step guide to follow. Even though its clear cut for you; doesn't mean it is for the installer.

    Next place 2 or 3 more examples and tell us why you did this and for what purpose. How many other ways will this plugin benefit me, etc.

    You do these things and you'll get 85% more users. And that's a fact!

  10. Marcel Bokhorst
    Member
    Plugin Author

    Posted 3 years ago #

    I do not disagree with this, but this plugin is intended for programmers or in any case people that want to become programmers.

    Personally I don't like instruction videos, because a written text helps me faster, since it allows me to find the information I need more easily. But again this is personally, maybe other people can benefit from a video.

  11. bundyS
    Member
    Posted 2 years ago #

    I am a newbie also and also very frustrated
    I have read this post and a ton of other pages and getting nowhere.
    OK it is supposed to be for programmers - well how about just for anyone that can read?
    Here is what I did:
    1. Installed and activated plug in.
    2. Typed [gallery] on a sample page.
    - an image showed on the edit page - but [gallery] on public page
    3. read a ton more posts
    4. created, (copy & paste) and TESTED the age birthdate example
    - this worked on the "settings TEST" page
    BUT shows [age birthdate="Mar 20, 2011"] on public site
    YES I saved as age WITH and WITHOUT the parameters
    WITH options ENABLED and OUTPUT CHECKED
    A further note the Test page in the settings has links to age birthdate="Mar 20, 2011" BUT the test/save input keeps reverting to "age birthdate=" - even thought SAVED with just age
    ALSO
    I have enabled "Add button to TinyMCE editor" so I can select from shortcodes
    BUT NOTHING IS WORKING
    I guess I must NOT be a programmer
    ALSO
    I AGREE that a video tutorial has shortcomings - as does all instructions and documentation
    but STEP by STEP is what the newbies need with 3 simple examples

    I AM NOT SCREAMING - CAPS IS FOR EMPHASIS in the interests of clarity
    by the way I AM a programmer C, C++, awk, perl, java, javascript, basic, sql, etc - just NEW to WordPress and shortcodes.

  12. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    It should work on public WordPress posts and pages, but not always by default on other page types. If it doesn't, try switching to the default theme (Twenty Ten or Eleven) to see if your theme is the problem.

  13. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    [gallery] is a built-in WordPress shortcode. You should use another name to test shortcodes with the plugin to avoid conflicts.

  14. bundyS
    Member
    Posted 2 years ago #

    Well I certainly agree it SHOULD work!
    My bad - I should have said:
    I am using a hosted service.
    A new install (2 days old) of WordPress, using theme 2011.
    Have installed Jetpack(unused), Askimet(unused), DukaPress, FastSecure Forms, DB extension, PHP shortcodes.
    But shortcodes do NOT work on public pages.
    QUESTIONS:
    You say the codes are saved in "WP options" - but which file specifically?
    wp-content?/plugins?/shortcodes/?/filename?
    OR THEMES/functions.php?
    obviously I have looked and cannot find...
    When a code is SAVED where does it get saved to?
    is there a DEBUG mode?
    BY THE WAY
    IF I make a type or syntax error - the ERROR is OUTPUT to the public page!?!?!
    WHY does the SAVED shortcode REVERT to "age birthdate="

    NEW:
    OK here is ONE problem
    For whatever reason (ON the settings page) the SAVE, DELETE functions do not work
    I tried deactivated and then activated your plugin
    I CHANGE(MODIFY) the shortcode and TEST always works.
    BUT when I return to the settings page the CHANGES are gone.
    the shortcode ALWAYS resets(reverts) to [age birthdate=]
    I can DELETE or even ADD a new shortcode and SAVE
    BUT the changes/modifications/new shortcodes always disappear.

  15. bundyS
    Member
    Posted 2 years ago #

    UPDATE:
    I have enabled option to delete all shortcodes on deactivation.
    Deactivated the plugin and activated.
    The I tried [hello_world] in a page and it WORKED!
    BUT
    WHEN I added a very simple [age] which had ONE line return "TEST";
    HERE IS ONE PROBLEM - maybe THE problem for SOME newbies.
    the TWO codes together [age][age] RESULTS in: TEST[age]
    so SECOND one does NOT work!!?!?!
    BUT [age] with some text in between [age] RESULTS:
    TEST with some text in between TEST so THAT works!

    ADVICE to newbies:
    1. Install plugin, activate and paste [hello_world] in ANY page to TEST
    2. ON PHP SHORTCODES SETTINGS PAGE - BELOW "hello_world" shortcode
    ADD and SAVE a NEW simple plugin called "age" with ONE line e.g.
    return "TEST";
    3. TYPE [age] in ANY PAGE
    SAVE and VIEW PAGE

    PLEASE NOTE:
    1. The supplied example [hello_world] uses "echo" you should NOTE the difference with "return" and "echo"
    2. NOTE that TWO shortcodes side by side do NOT work!

    GOOD LUCK!

    QUESTION:
    1. Any idea WHY the stoopid WordPress or plugin kept reverting?
    2. WHERE are the SAVED shortcodes?
    3. WHERE are any supplied shortcode?
    ARE there any?

    thanks

  16. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    1. Sometimes anti-spam measures, for example of your hosting provider, block saving shortcodes
    2+3. The shortcode definitions are saved in the WordPress database as options

    An advice: stop using capitalizing words, most people hate this. You may not get the answers you want. Try using bold or italic instead.

  17. bundyS
    Member
    Posted 2 years ago #

    well thanks for the replies
    not sure where all this got me
    hopefully some newbies may benefit
    (particularly about two shortcodes side by side)
    I may find your plugin useful ...?

    Advice: your links to other shortcode tutorials are onfusing since they suggest block encoding and saving definitions in the theme functions.php and not in the database.

    FWIW I don't think it was an anti spam issue which caused the saving issue, since somehow it was saved sometimes

    Question: Why (and is there a difference) are there two identical settings for your plugin
    1. under "settings"
    2. under "Tools"
    could that have caused the saving issues(I don't see how) but maybe you can give it some thought.

    once again thanks
    P.S.
    apologies to anyone who may not like the caps, but FWIW I personally think clarity makes them valuable
    I will admit that all caps is offensive

  18. bundyS
    Member
    Posted 2 years ago #

    OK I think I understand the problem with saving, and why it went wrong
    - although I may not explain it well.
    As a newbie I was attracted to the "live test" shortcode ability of the plugin
    Also as a newbie, I need to experiment.
    So I created a test shortcode based on the "age" example from the support site.

    Here is the seed of the problem.

    The age example requires a parameter so I happily test and save what I think works - because indeed in the test page it does.
    However, by the time the shortcode name(s) are saved in the database the shortcode with parameter [age birthdate="Mar 20, 2010"] becomes "age birthdate="
    I have looked at the database entries and indeed there is an "age" and an "age birthdate="
    Of course I tried to delete them from the plugin test page - but no luck.

    Perhaps understandably the presence of the 2 similarly named shortcodes may explain why they did not work?

    Also, since the plugin source code is encrypted, I have no idea what may be the problem - but it could be an easy fix....?

    Hopefully this is somewhat enlightening.

  19. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    I think I see your problem. Shortcode definitions should not include brackets and parameters (these should be decoded in PHP code, see the WordPress documentation for how to). Brackets and parameters should only be included on shortcode usage, for example in a post. Updating and deleting a shortcode definitions with brackets and/or quotes may be impossible, because of database escaping done by WordPress.

    The source code is open source, a requirement to be listed on wordpress.org, and not encrypted in any way.

  20. bundyS
    Member
    Posted 2 years ago #

    OK no parameters and quotes - I am getting it figured out
    and thanks again for the response

    regarding encryption In my Plugins/Edit page:
    Editing shortcode-exec-php/shortcode-exec-php-class.php (inactive)
    Select plugin to edit:
    <?php if (!WPShortcodeExecPHP::Get_option(c_scep_option_donated)) { ?>
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHXwYJKoZIhvcNAQcEoIIHUDCCB0wCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2

    is the highlighted area not encrypted?
    I am fairly sure it is your plugin - no?

  21. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    That is the standard PayPal donate link. The source code of the plugin itself is open source as said before.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic