• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Update broke my site

Messages
11
Likes
0
Points
1
#1
Hi there

I am using PHP code in snippets to parse an RSS file and to pull data from custom post types and display it. The upgrade to 2.2.2 broke my site and I got the following email.

Hi!
Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, Woody ad snippets (PHP snippets | Insert PHP).
First, visit your website (Home) and check for any visible issues. Next, visit the page where the error was caught (Log In ‹ The Guilty Feminist — WordPress) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can't access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely log in to your dashboard and investigate further.
Log In ‹ The Guilty Feminist — WordPress
To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
Error Details
=============
An error of type E_COMPILE_ERROR was caused in line 81 of the file /home/guiltyfe/public_html/wp-content/plugins/insert-php/includes/class.plugin.php. Error message: require_once(): Failed opening required '/home/guiltyfe/public_html/wp-content/plugins/insert-php/admin/includes/class.api.php' (include_path='.:/opt/alt/php72/usr/share/pear')
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#2
Hi.

Error somewhere displayed on the site? Do Woody snippets work on frontend?
 
Messages
11
Likes
0
Points
1
#3
The site didn't load at all. It just displayed a message reading "This site is experiencing technical difficulties." I believe that this is a new(-ish) feature of Wordpress so that crashes are handled more gracefully for the end user.
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#4
From my computer, your site opens without errors. Is everything working for you now?
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#7
Can you send the snippet code to identify the error? Answer here or in private messages on the forum
 
Messages
11
Likes
0
Points
1
#8
I suspect it's one of the plug ins which process the custom post type data. I use almost identical plug ins which process RSS feeds on another site which was fine after the update.

Here's the code... Sorry about the HTML.

PHP:
error_reporting(0);
$args = array(
              'post_type' => 'liveshows',
              'posts_per_page' => 100,
              'orderby' => 'date',
              'order' => 'ASC'
              );

$items = new WP_Query( $args );
?>
   
<div class="fusion-fullwidth fullwidth-box nonhundred-percent-fullwidth non-hundred-percent-height-scrolling"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class="fusion-builder-row fusion-row ">

<?php

if( $items->have_posts() ) {
    while( $items->have_posts() ) {
        $items->the_post();
        $content = get_the_content ();
        $find = chr(38).'nbsp;';
        $content = str_replace ("\n", '</p><p>', trim($content));
        $content = str_replace ($find, '', $content);
        $content = str_replace ("<p></p>", '', trim($content));
        $img = get_field('the_map');
        preg_match('/src="([^"]*)"/', $img, $img_array);
        $img_url = $img_array[1];
                ?>
<div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_1  fusion-one-full fusion-column-first fusion-column-last 1_1"  style='margin-top:0px;margin-bottom:20px;width:100%'>
                    <div class="fusion-column-wrapper" style="border-top:2px solid #fe1d1b;padding: 30px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"  data-bg-url="">
                        <div class="fusion-builder-row fusion-builder-row-inner fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_2_5  fusion-two-fifth fusion-column-first 2_5"  style='margin-top: 0px;margin-bottom: 20px;width:37.6%; margin-right:4%;'><div class="fusion-column-wrapper" style="padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"  data-bg-url=""><div class="fusion-text"><span class="fusion-imageframe imageframe-none imageframe-2 hover-type-none"><a href="<?php echo the_field('tickets_url');?>" target="_blank"><img src="<?php echo $img_url; ?>" alt="" title="" class="img-responsive wp-image-4096"/></a></span>
</div><div class="fusion-sep-clear"></div><div class="fusion-separator fusion-full-width-sep sep-double" style="border-color:#e0dede;border-top-width:0px;border-bottom-width:0px;margin-left: auto;margin-right: auto;margin-top:10px;"></div><div class="fusion-text"><div class="fusion-button-wrapper"><style type="text/css" scoped="scoped">.fusion-button.button-1 .fusion-button-text, .fusion-button.button-1 i {color:#ffffff;}.fusion-button.button-1 {border-width:0px;border-color:#ffffff;}.fusion-button.button-1 .fusion-button-icon-divider{border-color:#ffffff;}.fusion-button.button-1:hover .fusion-button-text, .fusion-button.button-1:hover i,.fusion-button.button-1:focus .fusion-button-text, .fusion-button.button-1:focus i,.fusion-button.button-1:active .fusion-button-text, .fusion-button.button-1:active{color:#ffeb3b;}.fusion-button.button-1:hover, .fusion-button.button-1:focus, .fusion-button.button-1:active{border-width:0px;border-color:#ffeb3b;}.fusion-button.button-1:hover .fusion-button-icon-divider, .fusion-button.button-1:hover .fusion-button-icon-divider, .fusion-button.button-1:active .fusion-button-icon-divider{border-color:#ffeb3b;}.fusion-button.button-1{width:100%;}</style><a class="fusion-button button-flat fusion-button-round button-medium button-default button-1" target="_blank" href="<?php the_field('tickets_url'); ?>"><span class="fusion-button-text">Get tickets now</span></a></div>
</div></div></div><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_3_5  fusion-three-fifth fusion-column-last 3_5"  style='margin-top: 0px;margin-bottom: 20px;width:58.4%'><div class="fusion-column-wrapper" style="padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;"  data-bg-url=""><div class="fusion-text"><h2><?php the_title(); ?></h2>
<?php echo $content;?>
</div></div></div></div><div class="fusion-clearfix"></div>

                    </div>
                </div>
<?php
    }
} else {
    echo "No shows";
}
?>
</div></div>
 

Temyk

Support team
Staff member
Messages
476
Likes
22
Points
18
#9
Let's first check the basic error: check if the file exists at /home/guiltyfe/public_html/wp-content/plugins/insert-php/admin/includes/class.api.php
If not, try again to update the plugin, or reinstall it (the data will remain)
 
Last edited:
Messages
11
Likes
0
Points
1
#10
That file is not present with the older version of the plugin. When I update the plugin (breaking the site), that file appears.
 
Messages
11
Likes
0
Points
1
#13
The problem seems to be that on saving, the plug in rewrites some code, turning ?> into >

I have previously had problems with older versions of this plug in, for example I can't include code to search for the string "&nbsp;" because it gets turned into a space.
 
Messages
11
Likes
0
Points
1
#14
It's also taking out all my escaping. So I write...

$echo .= "<a href=\"?page=".($cur_page + 1)."\">></a> ";

and it gets saved as

$echo .= "<a href="?page=".($cur_page + 1)."">></a> ";
 

alexkovalev

Program developer
Staff member
Messages
231
Likes
17
Points
18
#15
Well, I'm in the process of studying the problem. I will try to fix it as soon as possible.

Best regards, Alex
 

alexkovalev

Program developer
Staff member
Messages
231
Likes
17
Points
18
#17
Thanks for the help in finding problems, I will try to release an update with a solution tomorrow.

Best regards, Alex
 

alexkovalev

Program developer
Staff member
Messages
231
Likes
17
Points
18
#19
It's also taking out all my escaping. So I write...

$echo .= "<a href=\"?page=".($cur_page + 1)."\">></a> ";

and it gets saved as

$echo .= "<a href="?page=".($cur_page + 1)."">></a> ";
I can't reproduce bug with the removal of slashes. Did the slashes disappear after the update or do they disappear after saving the snippet?
 
Messages
11
Likes
0
Points
1
#20
It seemed to happen upon installing the update but I'm not certain. The other issues referred to above happen on saving the snippet.