fatal error (ocean extra)
-
PHP Fatal error: ?Uncaught Error: Call to undefined function get_current_screen() in /wp-content/plugins/ocean-extra/includes/menu-icons/includes/picker.php:126
Stack trace:
-
Hello @finnwulf,
It seems your message isn’t completed.
I checked the issue you have raised on this topic and was unable to replicate it on my end, and no similar issues have been reported by other users to this moment.How can we replicate your steps to arrive at the issue on a fresh WordPress installation?
Please explain to us step by step how we can reproduce the issue so we can recreate it somewhere other than your website. You can upload your files using one of the following online services:
https://postimages.org
https://imgbb.com
https://loom.com
https://drive.google.comAlso, kindly provide us with your system environment information. Please navigate to WP Dashboard > OceanWP > OceanWP Panel > System Info: https://i.postimg.cc/0QZrGq46/system-info.png. You can send the information as code here or upload them to https://pastebin.com/ and get an exclusive link.
Please keep us posted.
Thank you,
Best Regardshi, thanks for your answer. here the full log:
[14-Dec-2023 18:08:23 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in …/wp-content/plugins/ocean-extra/includes/menu-icons/includes/picker.php:126
Stack trace: 0 …/wp-includes/class-wp-hook.php(324): OE_Menu_Icons_Picker::_save() 1 …/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 2 …/wp-includes/plugin.php(517): WP_Hook->do_action() 3 …/wp-includes/nav-menu.php(613): do_action() 4 …/wp-includes/nav-menu.php(1153): wp_update_nav_menu_item() 5 …/wp-includes/class-wp-hook.php(324): _wp_auto_add_pages_to_menu() 6 …/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 7 …/wp-includes/plugin.php(517): WP_Hook->do_action() 8 …/wp-includes/post.php(5390): do_action() 9 …/wp-includes/post.php(4650): wp_transition_post_status() 10 …/wp-includes/post.php(4862): wp_insert_post() 11 …/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(880): wp_update_post() 12 …/wp-includes/rest-api/class-wp-rest-server.php(1193): WP_REST_Posts_Controller->update_item() 13 …/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request() 14 …/wp-includes/rest-api/class-wp-rest-server.php(431): WP_REST_Server->dispatch() 15 …/wp-includes/rest-api.php(424): WP_REST_Server->serve_request() 16 …/wp-includes/class-wp-hook.php(324): rest_api_loaded() 17 …/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 18 …/wp-includes/plugin.php(565): WP_Hook->do_action() 19 …/wp-includes/class-wp.php(418): do_action_ref_array() 20 …/wp-includes/class-wp.php(813): WP->parse_request() 21 …/wp-includes/functions.php(1336): WP->main() 22 …/wp-blog-header.php(16): wp() 23 …/index.php(17): require('…') 24 {main}thrown in …/wp-content/plugins/ocean-extra/includes/menu-icons/includes/picker.php on line 126
and the sys info
### WordPress Environment ### WP Version: 6.4.2 WP Multisite: False No Front Page Display: page Front Page: Home (#73) Posts Page: Blog (#72) WP Memory Limit: 128 MB WP Upload Limit: 2M WP Debug Mode: True The Main WP Directory: True Writable The wp-content Directory: True Writable The uploads Directory: True Writable The plugins Directory: True Writable The themes Directory: True Writable ### Theme ### Name: OceanWP Version: 3.5.3 Author URL: https://oceanwp.org/about-oceanwp/ Child Theme: False No ### Server Environment ### Server Info: Apache/2.4.52 (Ubuntu) Localhost Environment: False No PHP Version: 8.1.2-1ubuntu2.14 PHP Memory Limit: 128 MB PHP Post Max Size: 8 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 PHP Display Errors: False Disabled MySQL Version: 8.0.35 Max Upload Size: 2 MB PHP XML: True MBString: True SimpleXML: True Fsockopen/cURL: True SoapClient: False Your server does not have the SOAP Client class enabled - some gateway plugins which use SOAP may not work as expected. DOMDocument: False Your server does not have the DOMDocument class enabled - HTML/Multipart emails and also some extensions will not work without DOMDocument. GZip: False Your server does not support the gzopen function - this is required to use the GeoIP database from MaxMind. The API fallback will be used instead for geolocation. Zip Archive: True Iconv: True HTTP Requests: True Communication with oceanwp.org: True ### Active Plugins (1) ### Ocean Extra: by OceanWP – 2.2.4
trying to create a new page causes the error
Hello @finnwulf,
“get_current_screen()” is a default WP function introduced since WP 3.1.0: https://developer.www.ads-software.com/reference/functions/get_current_screen/.
This means that either your WP installation got corrupted or the issue could be related to the extremely low Memory Limit since WordPress needs a little bit more to function.
We are not able to replicate this error on our end, neither have similar errors been reported.
First, we recommend to you increase the WP Memory Limit to 512M, or even 768M, depending on all the plugins you’re using.
We would also kindly ask you to share all the steps and share options related to menu icons on your end, as well as to share the list of all plugins installed and used.
Best Regards
hi. I reinstalled WP but nothing changes. Here some insights from GPT:
The error message you’re seeing in WordPress, “Publishing failed. The response is not a valid JSON response,” is often related to a problem with the REST API or a JavaScript issue in the admin area. The error log you provided indicates a PHP fatal error due to an undefined function
get_current_screen()
in one of your plugins (ocean-extra
).Here’s how you can troubleshoot and potentially fix this issue:
- Check Plugin Compatibility: Make sure that all your plugins, especially ‘Ocean Extra’, are compatible with the version of WordPress you are using. Incompatibility can cause functions to be undefined.
- Plugin Conflict: The error suggests there’s a problem with the ‘Ocean Extra’ plugin. Try deactivating this plugin and see if that resolves the issue. If it does, you may need to look for an update to the plugin or contact the plugin’s support for a solution.
- Theme Conflict: Since ‘Ocean Extra’ is related to the ‘OceanWP’ theme, ensure that the theme is updated to its latest version. Theme files can also cause conflicts, especially if they are outdated.
- Clear Cache: Sometimes, caching mechanisms can cause outdated scripts to run. Clear all caching layers, including any WordPress caching plugins, your browser cache, and server-side caching.
- Check File Permissions: Incorrect file permissions on the WordPress files can sometimes cause issues with the REST API.
- Debugging: Enable WordPress debugging by setting
WP_DEBUG
totrue
in yourwp-config.php
file to see if any other errors are being reported. - Server Configuration: The error log mentions “fastcgi,” which suggests you’re using PHP-FPM. Check if the PHP-FPM service is running correctly and isn’t overloaded or misconfigured.
- Consult Hosting Support: Since the issue appears to involve server configuration (
fastcgi://unix:/var/run/php8.1-fpm-eagleup.sock
), your hosting provider might be able to offer specific assistance. - Check REST API Status: Use the Site Health tool under Tools > Site Health in your WordPress admin to check for any issues with the REST API.
- Backup and Manual Intervention: If you’re comfortable editing PHP files, you could comment out the problematic line in the plugin file as a temporary measure. However, this should only be done as a last resort, and you should always back up the file before making any changes.
—
2. Solves the issue. Although a fatal error, nothing else happens apart receiving the notification. The post/page is published. Regarding 7/8, server configuration I checked also on a hosted environment where I get the same error.
Best regards
- The topic ‘fatal error (ocean extra)’ is closed to new replies.