Support » Plugin: PHP Code Widget » [Plugin: PHP Code Widget] Executable PHP widget – Not Working

  • Resolved acmc


    Uploaded executed the plugin

    I have a custom widgetized sidebar on a template page.

    Put in a query post call – showed nothing

    Put in text – it’s there

    Put in the <?php echo ‘testing!’; ?> and that didn’t show either…


    I have used this plugin before and it worked beautifully and unsure what I am doing wrong. Any help greatly appreciated.



Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Samuel Wood (Otto)


    Dunno. Works fine for me.

    Do you have any sort of caching plugins like super-cache or similar? Maybe you’re only seeing the cached version of the page. Clear the cache in that case.

    I try to put only a include:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"; ?>
    And didn’t work:
    Parse error: syntax error, unexpected ‘;’ in /path_to_wordpress/wp-content/plugins/php-code-widget/execphp.php(44) : eval()’d code on line 1

    function widget( $args, $instance ) {
    		$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
    		$text = apply_filters( 'widget_execphp', $instance['text'], $instance );
    		echo $before_widget;
    		if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
    /*Line 44*/		eval('?>'.$text);
    			$text = ob_get_contents();
    			<div class="execphpwidget"><?php echo $instance['filter'] ? wpautop($text) : $text; ?></div>
    		echo $after_widget;

    I didn’t known the problem (it’s not the problem for use ” or ‘).
    I try to put a simple echo “Hello World”, and it works, but not with an a include…

    Plugin Author Samuel Wood (Otto)


    Well, this:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"; ?>

    Isn’t valid PHP code.

    For one thing, you’re missing the closing parenth.

    For another, you’re trying to include an HTTP URL as PHP code, which is incorrect.

    Sorry, I typed incorrectly the php code in the message, but it was right in the widget:
    <?php include("http://url_smf/SSI.php?ssi_function=recentTopics"); ?>
    I wrote this because it was only to simplify the php code and it would be more easily understood.

    Finally, if I include the php file, it works, but not with include(“…”)

    The final code:

    $Lista = ssi_recentPosts($num_recent = 10, $exclude_boards = null, $include_boards = null, $output_method = 'array');
    foreach ($Lista as $Post) {
    echo '<li><a target="_blank" href=', $Post['href'], '>', $Post['subject'], '</a></li>';


    Hello there!
    It just can’t execute shortcodes?? Very useful, miss this functionallity in this plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: PHP Code Widget] Executable PHP widget – Not Working’ is closed to new replies.