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

QUESTION Woody snippet code not longer working

Sunet

New member
Messages
5
Likes
0
Points
1
#1
Hello,

Recently, I made a small change on Woody snippet code to display text. But somehow, my website always read the old codes. Then I decided to put debug code (die('come to here');) on each line of code to see which line goes wrong. The strange thing happens, the website seems still looking old code, new code seems not taking effect. I already to clear up the browser cache up to 30 days. But not lucky.

The snippet code looks like the following ([wbcr_php_snippet id="8027"])
-----------------------------------------------
global $current_user;
if ( is_user_logged_in() ) {
wp_get_current_user();
echo '<span style="font-size: 24pt;"><strong>Hello, ' . $current_user->display_name . '! Would you like to see which products are available to purchase?</strong></span>'. "\n"; }
else { echo '<span style="font-size: 18pt;"><strong>Hello, Guest! Would you like to <a href="https://mydomain/my-account/">log yourself in or create an account</a>? We offer a great variety of specially selected products at affordable prices!</strong></span>'; }
-------------------------------------------------

On my home page, I had page likes this:
------------------------------------------
Welcome to <br>My Online Store!
[wbcr_php_snippet id="8027" title="Show different content if a user has signed in"]
<br><br>
<a class="button" href="https://mydomain/shop/">Shop now</a>
--------------------------

It works well before until I find out it is not working when I made a change. Even strange, I put snippet code inactive or removed snippet code on my home page, the website still read an old code and displays text.

I don't know what is wrong with my snippet code? Does anyone encounter the same problem and how to solve it?

Thanks.

Bruce
 

Sunet

New member
Messages
5
Likes
0
Points
1
#2
I don't understand, even I deleted the snippet code (id: 8027), and on the home page removed this line of code "[wbcr_php_snippet id="8027" title="Show different content if a user has signed in"]", but the website still displays text content.
 

Kirill

Support team
Staff member
Messages
80
Likes
4
Points
8
#3
Hi

Do you have cache plugins in wordpress?
Maybe you use CDN?
Try clearing cache in these plugins /CDN account.

Best regards, Kirill
Webcraftic team
 
Messages
5
Likes
0
Points
1
#4
Hi, Kirill:

No, I don't have any cache plugin or using CDN. Right now, I totally remove the snipped code from home page, but the website seems still displays the content from the this snipped code.

It is weird that it obviously it looks from the cache, but I don't know where it is coming from.

By the way, I use woocommerce.

Bruce
 

Kirill

Support team
Staff member
Messages
80
Likes
4
Points
8
#5
Please write to me a list of plugins that you use. And a link to a page with a snipped.

Best regards, Kirill
Webcraftic team
 
Messages
5
Likes
0
Points
1
#6
Hi, Kirill:

There is a dozen of plugins. Here is the list:

2Checkout Payment Gateway, AfterShip - WooCommerce Tracking, AliDropship Woo Plugin, Contact Form 7, Currency Switcher for WooCommerce, Dropship Me, Easy Facebook Likebox, GDPR Banner, Google Analytics Dashboard for WP (GADWP), Instagram Feed, Mailchimp for WooCommerce, Simple Social Icons, TinyMCE Advanced, Webcraftic Robin image optimizer, WooCommerce, Woody ad snippets (PHP snippets | Insert PHP), WP Maintenance Mode, YITH WooCommerce Wishlist, Yoast SEO

I haven't installed plugins for one year except "Webcraftic Robin image optimizer". I installed it one month ago. There is only one piece of the snippet and only it was used on the front page (Home page), which is Online shopping for Sports Bags with free worldwide shipping.

Right now, home page supposes to display "Welcome to My Sports Bags Online Store!" and "Shop Now" button, there is no snippet code on the front page, but you will notice that home page still displays some text between welcome and button. Even, I go to edit the front page, click "Preview" button, it still the same result.

Hope this will help you.

Thank you.

Bruce
 
Last edited: