- This topic has 28 replies, 4 voices, and was last updated 5 years, 3 months ago by
Leo.
-
AuthorPosts
-
June 5, 2020 at 9:41 am #1315870
Steve
Just ran a PHP compatibility scan for 7.3 and received this error:
FILE: /var/www/vhosts/mysite.uk/httpdocs/wp-content/themes/generatepress/page-editors.php ---------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------------------------------------------------- 269 | ERROR | Function split() is deprecated since PHP 5.3 and removed since PHP 7.0; Use preg_split() instead
June 5, 2020 at 9:49 am #1315873Tom
Lead DeveloperLead Developerpage-editors.php
isn’t a file in GeneratePress. Did you add it to the theme?If so, you’ll want to move all custom code you’ve added to the parent theme to a child theme: https://docs.generatepress.com/article/using-child-theme/
Then you’ll want to re-install a fresh copy of the parent theme.
June 5, 2020 at 10:01 am #1315888Steve
That’s bizarre. I’m working with a copy of Generate Press originally installed by a previous designer and updated incrementally. It may be possible he placed files there. Just taken a look at it’s contents and it’s commented in Italian. If I were to delete the GP install entirely and upload a clean install downloaded direct from you guys, would that be a problem re-instating?
June 5, 2020 at 2:15 pm #1316150Leo
StaffCustomer SupportIf I were to delete the GP install entirely and upload a clean install downloaded direct from you guys, would that be a problem re-instating?
That would erase all the custom codes/files that doesn’t come with the theme by default.
Your customizer settings will be saved as it’s in the database.
I do recommend backing up your site before reinstalling.
June 5, 2020 at 2:23 pm #1316165Steve
Hi Leo, thanks for your advise. I am actually working from a child theme and did manage to overwrite the previous installation without losing any settings. Problem is, I’m still seeing this error. I’ve had a whole day of going back over error log files so may have to give my eyes a rest for tonight! Will take another look at this tomorrow. Any suggestions greatly appreciated!
June 5, 2020 at 2:29 pm #1316170Steve
Just as a final update for tonight;
I just went to download a db optimisation plugin and noticed the ‘Add New’ button was missing from the Plugins management page. When I re-instated the line ‘define(‘DISALLOW_FILE_MODS’,true);’ in functions.php it re-appeared. Does this not mean it’s not being declared elsewhere?June 5, 2020 at 4:25 pm #1316240Leo
StaffCustomer SupportAre you using any security plugins?
It’s probably defined somewhere.
June 5, 2020 at 5:14 pm #1316264Steve
I use a User roles plugin but I already tried deactivating all plugins except GP premium and ACF and it still didn’t work.
June 6, 2020 at 2:44 am #1316553Steve
This morning I now have an error message within the Hook admin
Unable to execute PHP as DISALLOW_FILE_EDIT is defined.
I have tried settingdefine('DISALLOW_FILE_MODS',false);
in functions.php and I’ve tried taking it out altogether. I’ve also searched online to see if there is some kind of a scan I can perform to find where this code exists.
I’m also writing to our webhosting company to see if the site may have been compromised.June 6, 2020 at 8:19 am #1316931Leo
StaffCustomer SupportCheck your
wp-config.php
file for that:
https://docs.generatepress.com/article/disallow-php-execution/June 6, 2020 at 9:01 am #1316995Steve
You’re right. When I comment out the one in wp-config.php the error message in Hooks admin page goes away but yet still, the PHP doesn’t execute in the Hook itself. I just can’t seem to find any clues as to where this is being blocked.
June 6, 2020 at 4:18 pm #1317314Leo
StaffCustomer SupportDoes PHP execute in your child theme’s
function.php
file?June 7, 2020 at 1:23 am #1317598Steve
I thought to try a different approach in the hope to eliminate the possibility of any conflicts within the Hook PHP code capability by placing the Hook within my child theme’s functions.php as follows:
function add_mixcloudplaylist(){ if (is_singular ( 'dj' )) { add_action( 'generate_after_main_content', function(){ echo '<h2>Latest Mixcloud uploads</h2>'; echo '<div id="mixplaylists">'; $page = get_page_by_path('my-slug'); $page_id = is_object( $page ) ? $page->ID : ''; get_field('mixcloud_playlist_code', $page_id); echo '</div>'; }, 25); } } add_action( 'generate_after_main_content', 'add_mixcloudplaylist' );
and it worked! I can only conclude there is something blocking PHP code being run from within GP Hooks but could not determine precisely what. Hope that helps someone.
June 7, 2020 at 9:19 am #1318145Leo
StaffCustomer SupportGlad you’ve figured out 🙂
-
AuthorPosts
- The topic ‘eval() d code 5 error within element hook’ is closed to new replies.