• Resolved bjrnet21

    (@bjrnet21)


    Just finished updating my entire site to WP 5.0.3 and latest Twenty Fourteen Theme 2.5. Everything is working.

    Just noticed new Woody Snippets update.

    I have a staging site and after installing I find that it breaks at least one page on my site. I get the following error:

    Parse error: syntax error, unexpected ‘tdih_table’ (T_STRING) in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 2

    This page uses several snippets similar to [wbcr_php_snippet id=”xxxxxx”].

    It worked fine before. Now it is broken.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author webcraftic

    (@webcraftic)

    Hi,

    Can you show your code?

    Please follow formatting when inserting the code and clean private data!
    https://www.ads-software.com/support/topic/before-creating-a-new-topic-please-read/

    Best regards, Alex

    Thread Starter bjrnet21

    (@bjrnet21)

    On the page that breaks I simply have several snippets in the HTML similar to [wbcr_php_snippet id=”xxxxxx”].

    I’ve cleared all my cache.

    The snippet code that appears to break is:

    $Month = $_GET["Month"]; $Day = $_GET["Day"]; $Year = $_GET["Year"]; if ($Month == "" AND $Day == "" AND $Year == "") { $Month="9"; $Day="2"; $Year="1956"; }
    if ($Month == "" AND $Year == "") {$tdih = "[tdih_tab day= " . $Day . "]";} else if ($Day == "" AND $Year == "") {$tdih = "[tdih_tab month= " . $Month . "]";} else if ($Month == "" AND $Day == "") {$tdih = "[tdih_tab year= " . $Year . "]";} else if ($Month == "" AND $Day AND $Year) {$tdih = "[tdih_tab day= " . $Day . " year= " . $Year . "]";} else if ($Day == "" AND $Month AND $Year) {$tdih = "[tdih_tab month= " . $Month . " year= " . $Year . "]";} else if ($Year== "" AND $Month AND $Day) {$tdih = "[tdih_tab month= " . $Month . " day= " . $Day . "]";} else {$tdih = "[tdih_tab month= " . $Month . " day= " . $Day . " year= " . $Year . "]";} 
    echo do_shortcode($tdih);
    • This reply was modified 6 years, 1 month ago by bjrnet21.
    Thread Starter bjrnet21

    (@bjrnet21)

    Running some tests and it appears that even the first PHP line in the snippet:

    $Month = $_GET[“Month”]; $Day = $_GET[“Day”]; $Year = $_GET[“Year”]; if ($Month == “” AND $Day == “” AND $Year == “”) { $Month=”9″; $Day=”2″; $Year=”1956″; }

    causes it to break.

    I also tried “commented out” all the PHP in this snippet with // and the page still breaks. If I delete the snippet and put in something simple such as echo “TEST”; it works.

    Plugin Author webcraftic

    (@webcraftic)

    In php error there is such part of the “tdih_table” line, I could not find it in your code. Did you give another snippet code?

    Best regards, Alex

    Well, I’d LOVE to show my code, but every time I enable the damned plugin I loose access to the backend of my site ??

    It was working fine before the update.

    Plugin Author webcraftic

    (@webcraftic)

    @bjrnet21 TinyMCE converts double quotes to special characters. So if you place this code on the snippet editor, it may not work. To avoid this problem, replace all special symbols of double quotes in your PHP code with classic double quotes.

    Best regards, Alex

    • This reply was modified 6 years, 1 month ago by webcraftic.
    Plugin Author webcraftic

    (@webcraftic)

    @imkimc Do not despair! We created a secure mode for this case. Go into it and your snippets code will not be executed.

    Go to the safe mode by this link: https://your-site-name.dev/wp-admin/?wbcr-php-snippets-safe-mode
    Edit the snippet in which you made a mistake;
    Leave safe mode by clicking the link: https://your-site-name.dev/wp-admin/?wbcr-php-snippets-disable-safe-mode

    Best regards, Alex

    Thread Starter bjrnet21

    (@bjrnet21)

    I am using the standard “” quotes. When I copied and pasted the code the forum must have converted it. Here is my code:

    $Month = $_GET[“Month”]; $Day = $_GET[“Day”]; $Year = $_GET[“Year”]; if ($Month == “” AND $Day == “” AND $Year == “”) { $Month=”9″; $Day=”2″; $Year=”1956″; }
    if ($Month == “” AND $Year == “”) {$tdih = “[tdih_tab day= ” . $Day . “]”;} else if ($Day == “” AND $Year == “”) {$tdih = “[tdih_tab month= ” . $Month . “]”;} else if ($Month == “” AND $Day == “”) {$tdih = “[tdih_tab year= ” . $Year . “]”;} else if ($Month == “” AND $Day AND $Year) {$tdih = “[tdih_tab day= ” . $Day . ” year= ” . $Year . “]”;} else if ($Day == “” AND $Month AND $Year) {$tdih = “[tdih_tab month= ” . $Month . ” year= ” . $Year . “]”;} else if ($Year== “” AND $Month AND $Day) {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . “]”;} else {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . ” year= ” . $Year . “]”;}
    echo do_shortcode($tdih);

    Plugin Author webcraftic

    (@webcraftic)

    @bjrnet21

    Parse error: syntax error, unexpected ‘tdih_table’ (T_STRING) in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 2

    In php error there is such part of the “tdih_table” line, I could not find it in your code. Did you give another snippet code?

    Best regards, Alex

    Thread Starter bjrnet21

    (@bjrnet21)

    Now I am noticing the following error:

    Parse error: syntax error, unexpected ‘<‘, expecting end of file in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 3

    I only have 1 snippet enabled and I get this too:

    Parse error: syntax error, unexpected ‘tdih_table’ (T_STRING) in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 2

    … and you are right. I don’t see tdih_table anywhere in my code in this snippet or any other snippet I have.

    Plugin Author webcraftic

    (@webcraftic)

    @bjrnet21

    Parse error: syntax error, unexpected ‘<‘, expecting end of file in /home/blackj90/staging/2/wp/wp-content/plugins/insert-php/includes/shortcodes/shortcode-php.php(47) : eval()’d code on line 3

    Do you use opening and closing tags in php snippets?

    I could quickly fix this problem. Can you give me access to your site?

    I need more information. Here is a link to the form where you can send private data:
    https://woody-ad-snippets.webcraftic.com/other-question-support/

    Best regards, Alex

    • This reply was modified 6 years, 1 month ago by webcraftic.
    Thread Starter bjrnet21

    (@bjrnet21)

    You asked, “Do you use opening and closing tags in php snippets?”

    I posted the entire snippet above exactly as it is in the snippet.

    It appears that even when I comment out the entire snippet the page breaks. When I remove the code and use an empty snippet it loads the page.

    Could your plug-in have a problem in parsing the text in the snippet even when commented out?

    Thank you for your help in this manner. I’ll (we will) figure this out.

    Plugin Author webcraftic

    (@webcraftic)

    Сode you gave me does not cause errors. Maybe you really have a typo or you missed quotation mark.

    I checked it on my site, the shortcode is not reproduced, because I have not installed the plugin tabs. But the content of the snippet is printed without errors.

    Start: https://joxi.ru/a2Xza8lT16oj0r
    Result: https://joxi.ru/nAyvLPpiYElqjr

    Best regards, Alex

    Thread Starter bjrnet21

    (@bjrnet21)

    I think I have narrowed down the code that the plugin is having a problem with:

    if ($Month == “” AND $Year == “”) {$tdih = “[tdih_tab day= ” . $Day . “]”;} else if ($Day == “” AND $Year == “”) {$tdih = “[tdih_tab month= ” . $Month . “]”;} else if ($Month == “” AND $Day == “”) {$tdih = “[tdih_tab year= ” . $Year . “]”;} else if ($Month == “” AND $Day AND $Year) {$tdih = “[tdih_tab day= ” . $Day . ” year= ” . $Year . “]”;} else if ($Day == “” AND $Month AND $Year) {$tdih = “[tdih_tab month= ” . $Month . ” year= ” . $Year . “]”;} else if ($Year== “” AND $Month AND $Day) {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . “]”;} else {$tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . ” year= ” . $Year . “]”;}

    As mentioned before, this code worked before.

    [tdih xxxxxx] is short code for the “This Day in History” plugin.

    Can Woody Snippets handle other short codes still?

    Plugin Author webcraftic

    (@webcraftic)

    @bjrnet21

    Can Woody Snippets handle other short codes still?

    In php snippets, you must use do_shortcode to handle shortcodes. In text snippets, you can embed shortcodes along with the text.

    See this problem:
    https://www.ads-software.com/support/topic/textarea-tag-problem/
    Maybe you had the HTML code? This bug cuts out some code. I will fix this as soon as possible.

    Best regards, Alex

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘New update Woody Snippets breaks page’ is closed to new replies.