I’m working on an older site that utilizes this plugin for PHP code within widgets. Unfortunately, the plugin is causing a critical error when trying to access Widgets and I’m working with a developer who hasn’t been able to figure out a fix without getting rid of the plugin entirely. Can you help?
]]>Plugin is not update for 2 years, is it supported? is it save to use?
Can I use it was widget on Elementor? I need to show different table on each product
Hi i use thes widget with php code on php7.4 everything ok
with php 8 i have an error….
Warning: Undefined variable $post in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Attempt to read property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 2
Warning: Undefined variable $post in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3
Warning: Attempt to read property “ID” on null in /xxxxxxx/wp-content/plugins/php-code-widget/execphp.php(27) : eval()’d code on line 3
My code:
<?php
if (get_the_terms($post->ID, 'ausstattung')) {
$taxonomy_ar = get_the_terms($post->ID, 'ausstattung');
echo "";
$output = '<ul>';
foreach ($taxonomy_ar as $taxonomy_term) {
$output .= '<li>'. $taxonomy_term->name .'</li>';
}
$output .= '</ul>';
echo $output;
}
?>
What is wrong?
Please Help…. i m a noob in PHP
]]>Throwing an error that looks like:
[cgi:error] [pid 16747:tid 140179476072192] [client 24.59.255.157:65325] AH01215: thrown in /home/tempvs/mydomain.com/wp-content/plugins/php-code-widget/execphp.php on line 62: /dh/cgi-system/php80.cgi
Is this plugin still being updated/maintained?
]]>I am currently developing a website with Elementor Pro using “Hello Elementor” theme.
That said, I have unexpectedly received an email regarding PHP Code Widget error.
Please see below my screenshots to understand what I am looking for:
https://prntscr.com/15iels8
https://prntscr.com/15iem1p
https://prntscr.com/15iem7f
Does anyone know how to get through this?
Many thanks in advance.
]]>deleted
]]>Sorry, posted this support issue to the wrong plugin and can’t find a way to delete it, so disregard (or if a moderator can delete it please do).
]]>Hi there,
As you can see the problem with Elementor and logged out users still persists. As admin everthing is fine, but other users are getting raw php-code as you can see… provided link
Help needed
regards
At the very least, it would be nice to see the deprecated function create_function updated.
]]>Deprecated: Function create_function() is deprecated in /home/mariannalemos/public_html/wp-content/plugins/php-code-widget/execphp.php on line 62
I take this message when I enable WP_DEBUG
]]>Please can you make some changes to compatible the plugin with php 7.3 version.
I get some error
Function create_function() is deprecated 1 -
wp-content/plugins/php-code-widget/execphp.php:62
wp-settings.php
wp-settings.php:377
]]>
Just to clarify: this plugin <u>ONLY</u> works in widgets – such as in sidebars, footers, or in widget-enabled pages.
Correct?
This will <u>NOT</u> work in Pages, Posts, or WooCommerce Products (such as in the “Product Short Description” field) – correct?
Thought I’d ask before immersing myself too deeply!
Thanks for your help,
D.J.
]]>Using the widget with this code provided by the plugin author breaks the site. Is this legit code?
<?php
$gallery_id = 1034;
$args = array(
‘limit’ = 1,
‘caption_title_source’ = ‘alt’
);
if ( function_exists( ‘foogallery_render_gallery’ ) ) {
foogallery_render_gallery( $gallery_id, $args );
}
?>
Hi Otto,
As mentioned before this plugin causes a deprecated warning and in my case also a “The plugin generated 215 characters of unexpected output during activation. If you notice “headers already sent” messages .. ” warning. You did update plugin few months ago, why didn’t you fix the issues mentioned above? If this plugin doesn’t work properly anymore, why not just remove it from repository? Because now I found out after installing plugin.
Guido
]]>Hi,
I love your plugin but I have had to disable all plugins to test an issue I have elsewhere on my site. When I activate your plugin all settings have disappeared. Is this normal behaviour?
[Edit] I notice your widget appears in the Inactive Widgets section so maybe this isn’t so much of an issue.
]]>Can you explain in more detail what this paragraph means?
However, this plugin should not be used long term, as anybody with access to edit the widgets on your site will be able to execute arbitrary PHP code.
Who would have access to edit the widgets on my site, and how would they be able to use it to execute arbitrary php code?
]]>The main idea is to generate on the top right login and log out links with PHP
I succeede to do that by adding code to the main contenta area, but I failed to position it correctly for mobile phones. I can’t use position:fixed. Position:absolute cause always problems.
I shoud either add content to the right sidebar but I don’t know function to do that.
Alternative i could use this plugin in order to generate the PHP code I need. Can I still safely use this plugin with WorPress 5.1?
I designed the above page with Elementor Page Builder plugin. For one section in the page, I am using the WordPress widget and pasted a PHP code using this plugin. Please check the screenshot here.
Now the template section shows perfectly when the user is logged in. So if the user is logged in then the page looks like this and he is logged out then it looks like this.
So the section goes missing for logged out users.
Regards
]]><?php $user_info = get_userdata(1);
echo 'Your current community is:<b> ';
echo '<br><br><span style="color:#63A132;">' . implode(', ', $user_info->roles) . "\n";
?>
It should be displaying something other than Administrator. I’m logged in as another role.
]]>Hello,
Your plugin makes use of deprecated function create_function() in it’s widgets_init action. See: https://php.net/manual/en/function.create-function.php
I have solved it like this, you can add it to your plugin in next update: https://gist.github.com/Marcoevich/886fdf3a101c36fa06b6081f6c9823ef
]]>hi,
instead of hardcoding contact info into the page, I used the php code widget to use variables already exist in the site. It works out quite well inside of Elementor preview and Chromium. But it just doesn’t come out right in Chrome nor other browsers. what could be the issue? it seems that the variables are not coming through.
my code (sorry i’m totally beginner):
<div><table border="0">
<tr><td width="40" valign="center" align="center">
<?php $contact_no = get_theme_mod('contact_no'); ?>
<img src="https://flexchair.uk/wp-content/uploads/2018/03/phone-icon.png" height="30" width="30" /></td><td valign="center"><?php echo $contact_no; ?>
</td></tr><tr><td valign="center">
<?php $contact_mail = get_theme_mod('contact_mail'); ?>
<img src="https://flexchair.uk/wp-content/uploads/2018/03/mail-icon.png" height="30" width="30" /></td><td valign="center"><a>"><?php echo $contact_mail; ?></a></font>
</td></tr><tr><td valign="center">
<?php $contact_add = get_theme_mod('contact_add'); ?>
<a>"><img src="https://flexchair.uk/wp-content/uploads/2018/03/FB-icon-1.png" height="30" width="30" /></a></td><td><a>"><?php echo $contact_add ?>/</a></td></tr>
</table></div>
]]>
I put this plugin on a couple of site but in each case it requires “Accessibility Mode” to be turned on. Is that a requirement?
]]>Hi,
I saw your plug-in and then this article (https://ottopress.com/2017/12/) and wanted to do it like you suggests with my own custom plug-in. However I’m at a loss, during the step 4.
You are saying to migrate the code from the PHP Code Widget with the code my plug-in. I haven’t used the plug-in before, and therefor I’m unsure as to which part of the plug-in code I need.
– JoPed
]]>Hi,
The plugin worked great I thought until I figured out that after creating the page the text is messed up and something is going wrong.
First one is the link to show how it is displayed and beneath is the code I use, thanks in advance!
https://gyazo.com/e3ecb046cd98c3735145e4fb6a2b1fb3
<?php
$url = “https://www.vip-grinders.com/member/promotions/xml/1655.xml “; // $35k VIP Race January
$xmlPromo=simplexml_load_file($url) or die (“no XML file found”);
$playerCount = count($xmlPromo->userRanking->rank);
$htmlStr = “Last updated on: “.date_format(new DateTime($xmlPromo->lastUpdate), ‘H:i’).” CET, “.date_format(new DateTime($xmlPromo->lastUpdate),’d.m.Y’).”<br><br>”;
$htmlStr .= “<table class=’promoTable’>
<thead>
<tr>
<td>Position</td><td>Username</td><td>Prize</td><td>Points</td>
</tr>
</thead><tbody>”;
if($playerCount==0){
$htmlStr .= “<tr><td>-</td><td>-</td><td>-</td><td>-</td><tr>”;
}else{
for($i=0;$i<$playerCount;$i++){
$htmlStr.=”<tr><td>”.($i+1).”</td><td>”.$xmlPromo->userRanking->rank[$i][“username”].”</td><td>”.round($xmlPromo->userRanking->rank[$i][“prize”]).”</td><td>”.$xmlPromo->userRanking->rank[$i][“points”].”</td></tr>”;
}
}
$htmlStr .= “</tbody></table>”;
echo $htmlStr;
?>
My code
php code below
<?php
$a = “hello”;
$b = “world”;
echo $a . ” ” . $b ;
?>
php code above
My output
php code below
php code above
]]>PHP Deprecated: Function create_function() is deprecated in …/plugins/php-code-widget/execphp.php on line 62
]]>Hi
I noticed that code running in this plugin is not following php.ini settings? I need set like error reporting and timezone.
If I just run php code in new file: echo date_default_timezone_get(); it will show correct timezone.
Bug or feature? Maybe you can write this to FAQ then, as some people will not figure out what is wrong.
]]>Hello,
thank you for your great plugin! But I have a little problem. I knwo, this has probably nothing to do with your plugin and I already asked here, but maybe you can yet help me.
When I paste the following code
<?php
echo 'before';
$someArray = ['foo' => 'bar'];
echo 'after';
?>
<b>some HTML</b>
into your widget inside the Elementor PageBuilder, everything works fine and returns
beforeafter
as long as I am logged in (even with an account, that has only the author role).
When I am logged out, the PHP code is not executed and the following is printed on the site:
'bar']; echo 'after'; ?>
The HTML is rendered fine.
If I paste the same code into a widget outisde of Elementor, everything also works fine.
Do you have any ideas how to solve this issue? Thank you very much!
]]>Здравствуйте, обновил вордпресс до 4.9 и версию php до 7.0 и плагин стал работать не корректно. Ставлю PHP 5.3 всё работает. Сделайте пожалуйста обновление плагина. Заранее спасибо
]]>Wordpress 4.8.1. – The widget does not work.
]]>