• Resolved greentp

    (@greentp)


    I have a PHP application which is authenticating users against WordPress by including wp_load.php and then using wp_authenticate() etc. In the last couple of days I have started getting the following errors every time the application includes wp_load.php:

    E_USER_DEPRECATED in /home/****/public_html/wp-includes/functions.php at line 6078
    Hook custom_css_loaded is deprecated since version jetpack-13.5! Use WordPress Custom CSS instead. Jetpack no longer supports Custom CSS. Read the WordPress.org documentation to learn how to apply custom styles to your site: https://wordpress.org/documentation/article/styles-overview/#applying-custom-css
    #0 MRBS\generate_backtrace() called at [/home/****/public_html/book/functions_error.inc:228]
    #1 MRBS\output_error() called at [/home/****/public_html/book/functions_error.inc:274]
    #2 MRBS\error_handler()
    #3 trigger_error() called at [/home/****/public_html/wp-includes/functions.php:6078]
    #4 wp_trigger_error() called at [/home/****/public_html/wp-includes/functions.php:5941]
    #5 _deprecated_hook() called at [/home/****/public_html/wp-content/plugins/jetpack/modules/custom-css.php:35]
    #6 custom_css_loaded() called at [/home/****/public_html/wp-includes/class-wp-hook.php:324]
    #7 WP_Hook->apply_filters() called at [/home/****/public_html/wp-includes/class-wp-hook.php:348]
    #8 WP_Hook->do_action() called at [/home/****/public_html/wp-includes/plugin.php:517]
    #9 do_action() called at [/home/****/public_html/wp-content/plugins/jetpack/class.jetpack.php:1854]
    #10 Jetpack::load_modules() called at [/home/****/public_html/wp-includes/class-wp-hook.php:324]
    #11 WP_Hook->apply_filters() called at [/home/****/public_html/wp-includes/class-wp-hook.php:348]
    #12 WP_Hook->do_action() called at [/home/****/public_html/wp-includes/plugin.php:517]
    #13 do_action() called at [/home/****/public_html/wp-settings.php:550]
    #14 require_once(/home/****/public_html/wp-settings.php) called at [/home/****/public_html/wp-config.php:66]
    #15 require_once(/home/****/public_html/wp-config.php) called at [/home/****/public_html/wp-load.php:50]
    

    I am using the Twenty Sixteen theme. Deactivating Jetpack makes the problem go away.

    Any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Mehdi Benchalal

    (@muffinpeace)

    Hi @greentp

    Can you share your website’s URL along with the name of the specific PHP app you are using? This will allow us to look closely into the issue. If you wish that to be private, you can use the contact form instead.

    Looking forward to your reply.

    Thread Starter greentp

    (@greentp)

    I’ve investigated it a bit more and found that it’s nothing to do with wp_load.php and the PHP app. It was just the error handling in the app that was alerting me to the issue and I now see that the debug.log is filling up with similar messages when I am just in the dashboard. I have found this post but am a bit confused by it. I am using the Twenty Sixteen theme with additional CSS. What do I need to do?

    • This reply was modified 2 months ago by greentp.
    Thread Starter greentp

    (@greentp)

    Does it mean that I can’t add additional CSS without updating to a block-based theme? Or can I still add additional CSS to Twenty Sixteen by temporarily enabling the “Enhance CSS customisation panel” button to add the CSS and them disabling it afterwards to get rid of the deprecation notice?

    Plugin Support Gaurav (a11n)

    (@gaurav984)

    Hi @greentp,

    Thanks for getting back to us! I recommend adding the custom css on your website using WordPress Admin -> APPEARANCE -> CUSTOMIZE panel. Here you can add your custom CSS to override the defaults that came with your theme, plugins and WordPress (where applicable).

    Along with this if you have added custom CSS code using Jetpack I recommend moving this CSS code to the theme customize panel too.

    In case you are using SCSS or LESS you can first convert these into CSS and then add them to the theme customizer.

    Best,

    Thread Starter greentp

    (@greentp)

    Ok, thanks. I think what you are saying is that Appearance -> Additional CSS no longer works (without triggering the deprecation notice), but that Appearance -> Customize -> Additional CSS does, albeit without SCSS or LESS support. Is that correct? It’s a bit confusing!

    charlesmdq

    (@charlesmdq)

    The same thing happened to me, I could not log in and I got the error that appears. I solved it by first disabling the debug in wp-config, then it allows you to enter the administrator, there you have to go to jetpack /wp-admin/admin.php?page=jetpack#/writing and disable “custom css”. Regards

    • This reply was modified 2 months ago by charlesmdq.
    Plugin Contributor njweller

    (@njweller)

    Hey there @greentp!

    TLDR – you can turn off the Jetpack Custom CSS feature and still write custom styles for your site using the WordPress Customizer, without changing your theme.

    The Appearance -> Additional CSS section will still work, and should take you to the following URL on your site: wp-admin/customize.php?autofocus[section]=custom_css

    Any existing custom styles will still be available, but turning off the Jetpack feature will essentially remove support for using SCSS/LESS in your custom CSS, and the ability to completely disable the current theme’s styles.

    *If you are currently using SCSS/LESS in your custom styles, I would recommend converting them to standard CSS before turning off the Jetpack feature.

    For context, Jetpack added this custom CSS feature a long time ago, back when WordPress didn’t offer this built-in. We had some extra fancy things in there, such as supporting SCSS or LESS, turning off the current theme stylesheet, and overriding default WordPress image sizes. Now that WordPress has supported custom CSS for a long while, we are removing the redundancy!

    You can find more information regarding this particular deprecation notice here:
    https://jetpack.com/support/custom-css/

    Hopefully this clarifies things, please let us know if you have further questions about this!

    Plugin Contributor njweller

    (@njweller)

    As an aside, to build on @charlesmdq answer – I would recommend keeping WP_DEBUG disabled when your site is in production, and only enabling it in testing and development environments. This ensures that PHP warnings and deprecation notices like these are not shown to your users.

    More info on modifying this value can be found here: https://jetpack.com/blog/wp-config-php/

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi there, @charlesmdq,

    I hope the answers provided helped! I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.