I got an error message saying
“Parse error: syntax error, unexpected ‘print’ (T_PRINT), expecting identifier (T_STRING) in /home/celticcornernj/public_html/wp-content/plugins/contact-form-7/admin/includes/welcome-panel.php on line 9”
<?php
abstract class WPCF7_WelcomePanelColumn {
abstract protected function icon();
abstract protected function title();
abstract protected function content();
public function print() { // This is line 9.
$icon = sprintf(
'<span class="dashicons dashicons-%s" aria-hidden="true"></span>',
esc_attr( $this->icon() )
);
]]>
Why does my Page open this error messages ?
]]>I’ve been getting 500 errors on all pages containing PHP Code For Posts shortcodes. The plugin is still present, but when I try to call up the Details page from the plugin list, I get an error as well. The plugin also suddenly seems to be missing from the repository, even when I call up the plugin page from the developer’s website.
What’s going on? Is PHP Code for Posts suddenly defunct?
]]>Hi –
Noticed today after updating Woo commerce to latest version that Php for posts will return a 500 error. When I deactivate Php for posts the issue is resolved.
I also get this in my error log recently before the Woo issue but after upgrading the Cpanel :
[05-Apr-2017 16:07:56 UTC] PHP Warning: file_get_contents(https://www.geoplugin.net/php.gp?ip=23.235.195.140): failed to open stream: no suitable wrapper could be found in /home/avicadca/public_html/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(95) : eval()’d code on line 5
[05-Apr-2017 16:21:09 UTC] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data’ to ‘-1’ in php.ini and use the php://input stream instead. in Unknown on line 0
Thanks –
]]>Can anyone help me with the code to display a database extract ?
]]>So I am trying to do something like this…
?php
switch($_SERVER['HTTP_HOST']) {
case 'wahsingtonbasedsite.com':
case 'www.washingtonbasedsite.com':
echo 'WASHINGTON PHONE NUMBER';
break;
case 'idahobasedsite.com':
case 'www.idahobasedsite.com':
echo 'IDAHO PHONE NUMBER';
break;
default:
echo 'DEFAULT PHONE NUMBER';
break;
?>
But all I keep getting is nothing shown, if anyone has any ideas that would superb. Thank you for your time!
Chad
]]>Hello
can anyone help me out please?
I am trying to call a 3rd party short code set up via the do_shortcode process. The coding is below
<?php
// Get amount from querystring value.
$reference = $_GET[ "fullcode" ];
// Output shortcode where needed in template files.
echo do_shortcode('[stripe name="Access Housing" description="Housing Costs"]
[stripe_text label="To Confirm, please re-enter your unique reference" Default = '.$reference .' id="Reference" required="true"]
[stripe_amount label="Enter Desired Payment" placeholder = "300" required = "true"]
[/stripe]');
however I am having problems pulling the $reference part through into the shortcode.
fullcode comes from a html form which is then using JS to validate the data entry, but I need the fullcode value to appear as part of the stripe shortcode process.
Someone suggested it would be possible via the do_shortcode process. The php/do_shortcode does work as the remainder of the shortcode does appear on the page when it should, , but I dont seem to be able to pull the fullcode from the html through.
any suggestions?
Thanks
]]>Query monitor reports this PHP error:
Notice Undefined property: stdClass::$slug 1 wp-content/plugins/php-code-for-posts/Classes/Snippet.php:19
Stack trase:
PhpCodeForPosts_Snippet::create_from_database_object()
wp-content/plugins/php-code-for-posts/Classes/Database.php:92
PhpCodeForPosts_Database::load_single_snippet()
wp-content/plugins/php-code-for-posts/Classes/Shortcode.php:34
PhpCodeForPosts_Shortcode::handle_shortcode()
wp-includes/shortcodes.php:345
do_shortcode_tag()
Unknown location
preg_replace_callback()
wp-includes/shortcodes.php:223
do_shortcode()
wp-includes/class-wp-hook.php:298
apply_filters('the_content')
wp-includes/post-template.php:240
the_content()
wp-content/themes/virtue/templates/content-page.php:2
load_template('~/wp-content/themes/virtue/templates/content-page.php')
wp-includes/template.php:647
locate_template()
wp-includes/general-template.php:167
get_template_part('templates/content','page')
wp-content/themes/virtue/page.php:11 Plugin: php-code-for-posts
The php code from the snippet is executed.
]]>Question for the Developer of this plugin…
Any chance you could make a plugin and/or direct me to a plugin that would replace the text editor (not visual editor) with the CodeMirror editor for when creating Posts/Pages/Etc..?
I really like this editor, it’s very nice.
Especially when you change the viewportMargin to Infinity and change the height to auto in the css. Those two changes make this editor the best editor ever!
Thanks for your time and I look forward to your reply.
Very Nice Plugin BTW, Probably one of my most used plugins so far.
]]>After update to 2.2.1, i get this error on saving an edited snippet or on saving a new snippet:
Failed to save snippet – has it changed?
Reverted back to 2.1.3.1 and got this on activation:
The plugin generated 492 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
]]>Hi all,
if I enable this PI my site is unresponsive. Current PHP Version: php -v
PHP 7.0.15-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.2, Copyright (c) 1999-2017, by Zend Technologies
Any other ideas are welcome.
KR
Stephan
I have a link set up that is capturing a variable from a URL. It works perfectly when I use my snippet to hyperlink an image.
However, when I try to hyperlink to a text link I get a bunch of crud at the beginning of the link.
When I then use [php snippet=1] as a hyperlink within the WordPress text link like this: click here the result is this: https://%3Ca%20href%3D%22http//somesite.gosomewhere.org/aff_c?offer_id=31&aff_id=109&aff_sub=123456789
What is making this happen and how do I fix it? https://%3Ca%20href%3D%22
Thank you!
]]>Ever since the WP 4.7.1 update today, I can create new codes, but I cannot save codes after editing an existing code.
Any update soon? Love this plugin!
]]>I’m trying to create a snippet that will embed a youtube video and then a link. I need to pass the video and link as variables in the shortcode. The video works fine, but I don’t know how to pass the link. Here’s the snippet:
<div class="videowrapper">
<div class="videocontainer" itemprop="video">
<iframe width="775" height="436" src="https://www.youtube.com/embed/<?php echo $video; ?>" frameborder="0" allowfullscreen></iframe>
</div>
<?php echo $caption; ?>
</div>
Here’s the shortcode:
[php snippet=1 param="video=Du5KKQKEw84&caption=<a href="https://www.link.com">Link</a>"]
Obviously, the quotes in the link are going to be an issue. I tried escaping them, but that didn’t help. Any ideas?
]]>Hii There,
I installed this plugin to see if I can get my PHP script to work (i’ve tried a few others, but none worked the way I needed them to).
However, the output doesn’t show up at all, what is wrong?
this is my code:
`
<?php
function getKeybase($username){
$url = “https://keybase.io/_/api/1.0/user/lookup.json?usernames=”. $username;
echo $url;
if(function_exists(‘curl_version’) == true){
$cSession = curl_init();
curl_setopt($cSession,CURLOPT_URL,$url);
curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);
curl_setopt($cSession,CURLOPT_HEADER, false);
$result=curl_exec($cSession);
curl_close($cSession);
}else{
ini_set(“allow_url_fopen”, true);
$result = file_get_contents($url);
echo $result;
}
return $result;
}
$array = json_decode(getKeybase(“finlaydag33k”), true);
if($array[‘them’][0][‘proofs_summary’][‘by_proof_type’][‘generic_web_site’]){
?>
<ul>
<?php
foreach($array[‘them’][0][‘proofs_summary’][‘by_proof_type’][‘generic_web_site’] as $key => $value){
?>
<li>
<a href=”<?php echo htmlentities($value[‘proof_url’]); ?>” target=”_new”><?php echo htmlentities($value[‘nametag’]); ?></a> (<?php if($value[‘state’] == 1){?>Verified!<?php }else{?>Unverified!<?php } ?>)
</li>
<?php
}
?>
</ul>
<?php
}else{
echo “Could not fetch websites!”;
}
?>
`
Thanks
]]>Hi,
I updated WordPress to 4.6.. and from now on plugin php-in-all-posts does not work any more. The massage:
Fatal error: Cannot redeclare heizoel24_get_prices() (previously declared in /www/htdocs/w0150853/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(91) : eval()'d code:93) in /www/htdocs/w0150853/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(91) : eval()'d code on line 104
Try out on press red button jetzt vergleichen
https://www.12test.de/
Using newest Plugin-Version: 2.1.3.1
Thanks
Best Regards
Martin
Just installed this plugin on a test site. Created a new snippet, saved it.
Then created a new page. Got only this :
array()
Same error when creating new post.
De-activated. Solution?
Edit: oops…my test site is borked. Please ignore. Thanks.
]]>error.log:
[22-Nov-2016 21:27:52 UTC] PHP Notice: Undefined index: shared in /***/public_html/wp-content/plugins/php-code-for-posts/Classes/Snippet.php on line 166
line code:
$snippet->set_shared( intval($post_fields['shared']) );
code block:
public static function save_posted_snippet( $post_fields )
{
$snippet_id = isset( $post_fields['item'] ) ? $post_fields['item'] : 0;
$snippet = $snippet_id > 0 ? PhpCodeForPosts_Database::load_single_snippet( $snippet_id ) : new PhpCodeForPosts_Snippet();
$snippet->set_name( stripslashes($post_fields['name']) );
$snippet->set_code( $post_fields['code'] );
$snippet->set_description( stripcslashes($post_fields['description']) );
$snippet->set_shared( intval($post_fields['shared']) );
PhpCodeForPosts_Snippet::$last_saved_snippet = $snippet;
return PhpCodeForPosts_Database::save_snippet( $snippet );
}
regards…
]]>Hi,
I want to take a backup of my code snippet. I have taken db backup in which i can find my snippet. But its is encrypted i want to change the snippet and rewrite it.
Please help me
]]>Please could you provide an example of using parameters in PHP Code for Posts plugin
]]>When I updated the plugin to the latest version (2.1.3.1) my snippets were not visible anymore. I’m running a WordPress multisite. Nothing worked.
I decided to download an older version (2.0.11) and when I uploaded the files to my server all snippets were visible again.
Somehow from version 2.1 it doesn’t work anymore. Does anyone have a solution?
]]>Hello dear Jamie F.,
Hello dear staff,
i noted that, a snippet always worked in 2.1.2 version, similar to:
[code]
<a href="https://mysite.net/page/?var=<?php
echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]
?>"> click here < /a>
[/code]
(note: the < /a> in the snippet is correctly wrote without the space after the <, here in this way just for representation reasons)
cannot be not even saved(!) in 2.1.3.1 version of the plugin.
Why?
Thanks.
]]>The admin toolbar disappears when this plugin is activated. Can you fix it?
]]>I have all-in-one seo plugin. And when I put [php snippet=1] in MetaTitle or MetaDescription, or into another CustomField … I see the [php snippet=1] it’s not tranforming into the the result. Into the contect page its working good.
I setup ShortCode for title plugin and now it’s working good with H1… Please really need your help!!!
]]>I am getting the following php warning. How can I fix it?
PHP Warning: Invalid argument supplied for foreach() in /{MY_SERVER_PATH}/wp-content/plugins/php-code-for-posts/Classes/Shortcode.php(81) : eval()’d code on line 37
]]>Website crashed after the update today.
Only after the removal of plugin, site back to life.
You must check update before you release it to the public.
Thanks.
– Right after updating the plugin my site goes down.
– Manually deactivated plugin via FTP and attempted to reactivate in admin.
– Received this fatal error:
“Parse error: syntax error, unexpected ‘[‘ in /home/crystals/public_html/wp-content/plugins/php-code-for-posts/Classes/Exporter.php on line 10”
– Could only get it working again after commenting out line 58 in PhpCodeForPosts.php, removing the need for Exporter.php which was causing the error.
Hello
Where is stored the snippet source code?
How I can read them?
Hello!
I recently migrated from another plugin for php code inclusion due to some problems with that plugin, but I noticed that this one breaks all vidgets on the pages where it is called.
It doesn’t matter what theme is used – the result is the same.
Did anybody face the same problem?