The Big Spring Sale! Up to 50% off!

PHP Block Causing Wordpress Critical Errors

shane53
124 Posts
shane53 posted this 26 May 2021
Ask a Question

Hello all,

Because the contact form block in Nicepage only allow Recaptcha 3 I'm on a mission to create my own PHP contact form using Recaptcha 2.0 due to Recaptcha 3's failure to block spammers. However I've noticed that inserting PHP code via the PHP block in Nicepage causes a critical error in Wordpress. This only happens when I output tags. For example:

<?php echo "This line of code is fine and works as expected." ?>

However,

<?php echo "<p>This line of code causes a critical error in Wordpress.</p>" ?>

Is this because Wordpress doesn't allow the use of html tags for security reasons?

Hello all, Because the contact form block in Nicepage only allow Recaptcha 3 I'm on a mission to create my own PHP contact form using Recaptcha 2.0 due to Recaptcha 3's failure to block spammers. However I've noticed that inserting PHP code via the PHP block in Nicepage causes a critical error in Wordpress. This only happens when I output tags. For example: <?php echo "This line of code is fine and works as expected." ?> However, <?php echo "<p>This line of code causes a critical error in Wordpress.</p>" ?> Is this because Wordpress doesn't allow the use of html tags for security reasons?
Vote to pay developers attention to this features or issue.
11 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 26 May 2021

Hi, Shane,

Have you checked the security settings of your server? Have you tried to add an HTML code via the HTML Element?

...................................................

Sincerely,

Paul C.

Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1

Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Shane, Have you checked the security settings of your server? Have you tried to add an HTML code via the HTML Element? ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp

Last edited 26 May 2021 by Support Team

shane53
124 Posts
shane53 posted this 26 May 2021

Hi Paul.

So after 5 hours of frustration I've discovered two strange things with PHP in Nicepage/(Wordpress?). Having two issues made it difficult to figure out what was the actual cause of the problem.

Firstly, when you use the full window code editor under Nicepage/ Wordpress the first few lines of the editor get cut off from the user bar in Wordpress/ toolbar in Nicepage. To see the first few lines I would carriage return the first few lines in the editor to move the code down. In a normal editor these white spaces wouldn't have any consequences. However under Nicepage/ Wordpress this creates an error.

Screen-Shot-2021-05-26-at-3.12.23-PM.png

Secondly the way Nicepage/ Wordpress handles quotations is weird. Normally in PHP you can use quotes in the following way:

echo '<input type="text" placeholder="name">';

However this does not work. You must always escape your quotation marks:

<?php echo "<input type=\"text\">"; ?>

Strangely this also works but shouldn't:

echo '<input type=\"text\">';

I tried using XYZ PHP Code plugin in Wordpress which allows you to insert php via shortcode. It doesn't suffer from the same requirement to escape every quotation mark which leads me to believe it's a Nicepage issue.

I can code while escaping quotation marks, but the first two problems are an issue:

  1. First 3 lines of code in the Nicepage full screen code editor via Wordpress plugin are obstructed (see screenshot).
  2. Starting the code editor with carriage returns causes the PHP to error.

Thanks.

Hi Paul. So after 5 hours of frustration I've discovered two strange things with PHP in Nicepage/(Wordpress?). Having two issues made it difficult to figure out what was the actual cause of the problem. Firstly, when you use the full window code editor under Nicepage/ Wordpress the first few lines of the editor get cut off from the user bar in Wordpress/ toolbar in Nicepage. To see the first few lines I would carriage return the first few lines in the editor to move the code down. In a normal editor these white spaces wouldn't have any consequences. However under Nicepage/ Wordpress this creates an error. !Screen-Shot-2021-05-26-at-3.12.23-PM.png! Secondly the way Nicepage/ Wordpress handles quotations is weird. Normally in PHP you can use quotes in the following way: echo '<input type="text" placeholder="name">'; However this does not work. You must always escape your quotation marks: <?php echo "<input type=\"text\">"; ?> Strangely this also works but shouldn't: echo '<input type=\"text\">'; I tried using XYZ PHP Code plugin in Wordpress which allows you to insert php via shortcode. It doesn't suffer from the same requirement to escape every quotation mark which leads me to believe it's a Nicepage issue. I can code while escaping quotation marks, but the first two problems are an issue: 1. First 3 lines of code in the Nicepage full screen code editor via Wordpress plugin are obstructed (see screenshot). 2. Starting the code editor with carriage returns causes the PHP to error. Thanks.

Last edited 26 May 2021 by shane53

Support Team
Support Team posted this 27 May 2021

Hi, Shane,
1. I have opened the PHP code editor on the Nicepage plugin in the full-screen mode, and your issue has not been reproduced on my localhost.

enter image description here

2. I typed this code in the editor:

<?php echo "<p>This line of code causes a critical error in Wordpress.</p>" ?>

However, I didn't get an error, and it appeared on my test website.

enter image description here

The issue may come from the fact that you are currently using an outdated version of the Nicepage plugin (3.11.0). Could you please update it to the latest version and try reproducing this problem again? Also, try disabling all plugins, except for Nicepage.
...................................................
Sincerely,
Paul C.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Shane, 1. I have opened the PHP code editor on the Nicepage plugin in the full-screen mode, and your issue has not been reproduced on my localhost. ![enter image description here][1] 2. I typed this code in the editor: <?php echo "<p>This line of code causes a critical error in Wordpress.</p>" ?> However, I didn't get an error, and it appeared on my test website. ![enter image description here][2] The issue may come from the fact that you are currently using an outdated version of the Nicepage plugin (3.11.0). Could you please update it to the latest version and try reproducing this problem again? Also, try disabling all plugins, except for Nicepage. ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp [1]: https://sun9-20.userapi.com/impg/T28yhM5PshWpNDKPQZ-Lu22X5TZ5wmaXDbze2Q/tVdW3PdYNlQ.jpg?size=1280x180&quality=96&sign=a95d87ddb100565e6fd704255a54e8db&type=album [2]: https://sun9-63.userapi.com/impg/MS4safs-YwyxAKsTWro7ZorgoyuxgpDmxaYBww/4nPY7_0Vcis.jpg?size=1275x416&quality=96&sign=90cf4d78b168c33033c8ffdf25302f66&type=album

Last edited 27 May 2021 by Support Team

shane53
124 Posts
shane53 posted this 28 May 2021

Hi Paul,

What browser are you using? I was using Safari which I admit isn't great for things working as they should. I tried Firefox which didn't have that problem. When I inserted white spaces at the beginning of the code editor it didn't cause a critical error either. It suggests that Safari and the code editor have issues with each other. This is good to know.

In Firefox the php double quotes still should be escaped. For example:

<?php
    echo '<input type="text">';
?>

This code is proper PHP but causes a critical error in Wordpress/ Nicepage. You have to change it to:

<?php
    echo '<input type=\"text\">';
?>

This is rather weird, but I can work around this. Thanks for your help.

Hi Paul, What browser are you using? I was using Safari which I admit isn't great for things working as they should. I tried Firefox which didn't have that problem. When I inserted white spaces at the beginning of the code editor it didn't cause a critical error either. It suggests that Safari and the code editor have issues with each other. This is good to know. In Firefox the php double quotes still should be escaped. For example: <?php echo '<input type="text">'; ?> This code is proper PHP but causes a critical error in Wordpress/ Nicepage. You have to change it to: <?php echo '<input type=\"text\">'; ?> This is rather weird, but I can work around this. Thanks for your help.
Support Team
Support Team posted this 31 May 2021

Hi, Shane,

What browser are you using?

I was testing your issue on Mozilla Firefox.

It suggests that Safari and the code editor have issues with each other. This is good to know.

It sounds interesting. Have you tried to clear the cache on Safari?

This is rather weird, but I can work around this. Thanks for your help.

You're welcome! Let us know if you have other questions concerning Nicepage.
Our team works for you, and we will be happy to hear if you like our product.
You can leave your review at one of the following websites:
https://www.trustpilot.com/review/nicepage.com
https://www.saasworthy.com/product/nicepage
...................................................
Sincerely,
Paul C.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Shane, > What browser are you using? I was testing your issue on Mozilla Firefox. > It suggests that Safari and the code editor have issues with each other. This is good to know. It sounds interesting. Have you tried to clear the cache on Safari? > This is rather weird, but I can work around this. Thanks for your help. You're welcome! Let us know if you have other questions concerning Nicepage. Our team works for you, and we will be happy to hear if you like our product. You can leave your review at one of the following websites: https://www.trustpilot.com/review/nicepage.com https://www.saasworthy.com/product/nicepage ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
shane53
124 Posts
shane53 posted this 01 June 2021

Hi Paul,

I was clearing the cache but maybe not recently. I've noticed that problem before so I still think it's a Safari issue as Safari sometimes doesn't play nicely with certain systems. I use it because I can trust it to store all my passwords.

Hi Paul, I was clearing the cache but maybe not recently. I've noticed that problem before so I still think it's a Safari issue as Safari sometimes doesn't play nicely with certain systems. I use it because I can trust it to store all my passwords.

Last edited 01 June 2021 by shane53

Support Team
Support Team posted this 02 June 2021

Hi, Shane,

Do you use the latest version of Safari? Also, have you contacted the Safari support team concerning this issue?
...................................................
Sincerely,
Paul C.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Shane, Do you use the latest version of Safari? Also, have you contacted the Safari support team concerning this issue? ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
Ordinary Dad
3 Posts
Ordinary Dad posted this 02 September 2022

I'm in big trouble, suddenly the following error message appeared on my created page: There has been a critical error on this website.

Can you help me?

In wordpress, if I go to the page, my page appears normally, but if I type in the web address on any device, this phenomenon is received.

I'm in big trouble, suddenly the following error message appeared on my created page: There has been a critical error on this website. Can you help me? In wordpress, if I go to the page, my page appears normally, but if I type in the web address on any device, this phenomenon is received.
Ordinary Dad
3 Posts
Ordinary Dad posted this 02 September 2022

I'm in big trouble, suddenly the following error message appeared on my created page: There has been a critical error on this website.

Can you help me?

In wordpress, if I go to the page, my page appears normally, but if I type in the web address on any device, this phenomenon is received.

pilgrims.hu

> I'm in big trouble, suddenly the following error message appeared on my created page: There has been a critical error on this website. > > Can you help me? > > In wordpress, if I go to the page, my page appears normally, but if I type in the web address on any device, this phenomenon is received. > > pilgrims.hu
Support Team
Support Team posted this 02 September 2022

Hi, Gilbert,

Please create a separate private topic with provided access to your WordPress admin panel. We will check your issue.
...................................................
Sincerely,
Paul C.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Gilbert, Please create a separate private topic with provided access to your WordPress admin panel. We will check your issue. ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
Ordinary Dad
3 Posts
Ordinary Dad posted this 02 September 2022

I did it!

I did it!
You must log in or register to leave comments