- This topic has 16 replies, 3 voices, and was last updated 5 years, 5 months ago by Tom.
-
AuthorPosts
-
October 24, 2018 at 10:33 pm #709855Carlos
Hi,
I can´t disable the messaje Unable to execute PHP as DISALLOW_FILE_EDIT is defined. in PHP execute.Is this an issue?
I have tried to remove this creating a code snippet.
Could you check if is right and help me to solve it please?.
Here screenshorts and short video of what i m doing.
https://cl.ly/dbbfeda30559
https://cl.ly/59c9839fc74bhttps://cl.ly/59b043a3a13d
ThanksOctober 25, 2018 at 10:07 am #710394LeoStaffCustomer SupportHi Carlos,
Looks like the code you are trying to add isn’t PHP (javascript) so you shouldn’t need to check the execute PHP option.
If you want to allow PHP execution anyways, you will need to go into wp-config file and remove that specific line here:
https://codex.wordpress.org/Hardening_WordPress#Disable_File_EditingLet me know if this helps.
October 25, 2018 at 10:52 am #710440TomLead DeveloperLead DeveloperIt’s not an issue, it’s just telling you that Hooks can’t execute PHP as you have that turned off in the Dashboard.
You can:
a) Move from the old Hooks module to the new Elements module: https://docs.generatepress.com/article/moving-hooks-page-headers-to-elements/
b) Remove that message with this function:
add_action( 'after_setup_theme', function() { remove_action( 'admin_notices', 'generate_hooks_php_check' ); } );
October 25, 2018 at 11:28 am #710463CarlosHi Tom,
A little confused about, because that messaje started because of security plugin.
I thought was an issue because the messaje was displayed, so i insert the code snippet in the plugin to disallow… for dissapear.What should i do with that meesaje?remove it or leave it?
Im trying to insert a code to display a chat button but does not worrk. And i dont know if is because that can not execute php because i made dissapeared or because that code is not javassript as Leo says.Please can you tell me what would you do with that?
And please can you tell me if the code i insert in code snippet plugin is correct or not Aparently messaje disappeared.
https://cl.ly/dbbfeda30559
https://cl.ly/59c9839fc74bOctober 25, 2018 at 3:37 pm #710593TomLead DeveloperLead DeveloperSecurity plugins will sometimes make it so PHP can’t be edited inside the WP Dashboard.
When that happens, the old GP Hooks plugins will tell you to do the same so Hooks don’t accept PHP.
In the new Elements module, which is what Hooks turned into, the message is inside the Element itself while you’re editing it.
I would personally remove the message using one of the methods I mentioned above.
That code you added in the second screenshot should be added to your
wp-config.php
file instead of the Code Snippets plugin.However, you can probably just avoid all of this by telling your security plugin to allow file editing in the WP Dashboard.
October 26, 2018 at 1:45 am #710783CarlosThank you Tom,
One more question please. I delete de code snippet from the plugin.
And messaje displayed again.
https://cl.ly/c8091a2e5621My question is in which part of my wp-config.php, should i insert the code to remove the messaje DISALLOW_FILE_EDIT is defined?
Thank you again
October 26, 2018 at 2:18 am #710804CarlosHi Tom,
I removed the messaje of DISALLOW_FILE_EDIT is defined in wp-config.php (1 screenshot https://cl.ly/f7b1a7085b6f)and suppose i can to execute php in elements / Hooks?
Here i trying execute php, but i can´t. Maybe this code has to be as a header?, or what do you think is the problem for not being able execute PHP and display Unable to execute PHP as DISALLOW_FILE_EDIT is defined and probably doesn´t shows chat button for that reason.
(a Short video https://cl.ly/08ff72da4d78)If you has told me the amswer yet and i didn´t understand sorry for that.
Trying to understand.Thank you.
October 26, 2018 at 9:15 am #711239TomLead DeveloperLead DeveloperThat code you’re trying to add isn’t PHP, it’s javascript.
So you would have to put it inside
<script>
tags, like this:<script> // Your code here </script>
October 26, 2018 at 11:47 am #711344CarlosThen, is not enable to execute Php becacuse the code was not Php wasn’t it?
So if i insert php could i execute?Thanks
CarlosOctober 26, 2018 at 4:22 pm #711446TomLead DeveloperLead DeveloperNot unless you disable the option that disabled file editing in your security plugin.
October 27, 2018 at 1:59 am #711594CarlosHi,
In which part of wp-config.php should i aad this code as you recomended me?At the end?
b) Eliminar ese mensaje con esta función:
add_action( ‘after_setup_theme’, function() {
remove_action( ‘admin_notices’, ‘generate_hooks_php_check’ );
} );Thanks
CarlosOctober 27, 2018 at 9:41 am #711956TomLead DeveloperLead DeveloperThat specific code can go into your Code Snippets plugin.
October 28, 2018 at 11:14 am #712535CarlosHi Tom,
I pasted that code in code snippets, but still can´t execute PHP. What i doing wrong?October 28, 2018 at 11:48 am #712563CarlosHi again,
Deactivated the security plugin, now it is possible to execute .php. Do you think must talk to them to allow it?Thanks
October 28, 2018 at 8:36 pm #712728TomLead DeveloperLead DeveloperThere should be a setting inside the security plugin that allows you to edit files. Which plugin are you using?
-
AuthorPosts
- You must be logged in to reply to this topic.