Support » Plugin: Yoast SEO » Remove Notice from Dashboard

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi @byvaly!

    You can disable the notice by updating your PHP. Currently, you are using PHP 5.2 which does not get any security updates any longer. More information about currently supported versions of PHP can be found here: http://php.net/supported-versions.php.

    We recommend updating to PHP 7. WordPress also strongly recommends the latest version of PHP on their requirements page, https://wordpress.org/about/requirements/.

    You can read our guide on how to update your PHP version for assistance.

    For more information on why we are doing this, please read our whipping your host into shape post.

    Thanks!

    We’re running on PHP 5.3, which isn’t yet a problem with WHIP, but which may be in the future. For support reasons, we use Red Hat Enterprise Linux, which includes PHP 5.3 with backported bug fixes and security fixes. They will continue backporting fixes until at least late 2020. Further, my environment is a controlled corporate one, not a general Web host open to the public, and our developers are aware of the limitations of PHP 5.3 and accept them as a trade-off for greater stability in our Web environment as a whole.

    Given that we understand the issues involved with an older version of PHP, and have made a conscious and educated choice to continue using it, is there a filter/hook we can use to suppress and disable this alert? Most of our users are non-technical, and this alert will only raise needless alarm.

    @benvaassen – This plugin is breaking the plugin guidelines here (see rule #11): https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#the-guidelines

    @byvaly – If this is not corrected to be dismissable in a plugin update or the plugin author isn’t willing to post code to remove the notice, I’ll dig into it and post a solution here.

    This might not be the prettiest method, but it should work on WP 4.7+. Drop this code in your theme’s functions.php:

    
    add_action( 'admin_notices', 'jt_remove_admin_notices', -999 );
    
    function jt_remove_admin_notices() {
    
    	jt_remove_object_filter( 'admin_notices', 'renderMessage' );
    }
    
    function jt_remove_object_filter( $hook, $method, $priority = 10 ) {
    	global $wp_filter;
    
    	if ( ! isset( $wp_filter[ $hook ][ $priority ] ) || ! is_array( $wp_filter[ $hook ][ $priority ] ) )
    		return;
    
    	foreach ( $wp_filter[ $hook ][ $priority ] as $id => $filter_array ) {
    
    		if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
    
    			if ( is_object( $filter_array['function'][0] ) && get_class( $filter_array['function'][0]) && $filter_array['function'][1] == $method ) {
    
    				if ( is_a( $wp_filter[ $hook ], 'WP_Hook' ) )
    					unset( $wp_filter[ $hook ]->callbacks[ $priority ][ $id ] );
    			}
    		}
    	}
    }
    

    This is probably a slightly better method:

    
    add_action( 'admin_notices', 'jt_remove_admin_notices', -999 );
    
    function jt_remove_admin_notices() {
    
    	jt_remove_object_filter( 'admin_notices', 'Whip_WPMessagePresenter', 'renderMessage' );
    }
    
    function jt_remove_object_filter( $hook, $class, $method, $priority = 10 ) {
    	global $wp_filter;
    
    	if ( ! isset( $wp_filter[ $hook ][ $priority ] ) || ! is_array( $wp_filter[ $hook ][ $priority ] ) )
    		return;
    
    	foreach ( $wp_filter[ $hook ][ $priority ] as $id => $filter_array ) {
    
    		if ( ! isset( $filter_array['function'] ) || ! is_array( $filter_array['function'] ) )
    			continue;
    
    		$_object = $filter_array['function'][0];
    		$_method = $filter_array['function'][1];
    
    		if ( is_object( $_object ) && is_a( $_object, $class ) && $_method == $method ) {
    
    			if ( is_a( $wp_filter[ $hook ], 'WP_Hook' ) )
    				unset( $wp_filter[ $hook ]->callbacks[ $priority ][ $id ] );
    		}
    	}
    }
    
    Plugin Contributor Joost de Valk

    (@joostdevalk)

    @greenshady: it’s an error, not a notice, which self-resolves, so we’re not breaking the guidelines. @ipstenu is fully aware of everything we’re doing and has approved and this has been discussed with many a core dev.

    @desmith: by running PHP 5.3, you’re part of the problem, sorry. We will start throwing this notice for PHP 5.3 soon, and while the above solution by Justin might work, I would strongly urge you to consider going with the future. By staying on PHP 5.3, while secure in your case, you’re limiting development.

    Let me be clear: this is an error. Not a notice. It’s an error for a reason. I fully intend to start making Yoast SEO require PHP 5.6 as soon as percentages look healthy, and we’ve already made a major change (from 45% on supported PHP versions to 55% supported versions) in the last few weeks. Also, that’s literally what I am pushing the core team for as well. Staying on 5.3 is not a smart solution.

    • This reply was modified 6 years, 12 months ago by Joost de Valk.

    I suppose we’ll have to agree to disagree. Or maybe just disagree. 🙂

    I’m not staying on PHP 5.3 because I love staying on really old versions of software, believe it or not. And my developers would prefer, all other things being equal, to be on a newer version as well. In this case, though, we’re beholden to a third-party (Red Hat) and what software they will and won’t support. There are plenty of options for installing newer versions of PHP (Remi, EPEL, Software Collections), but actually using any of them effectively voids our support agreement, not just for the PHP components but for the whole system. If I went to my directors and said “hey we want to risk breaking our whole OS so we can keep using one plugin” they’d laugh me out of the conference room.

    Given the choice between a single plugin and our whole server farm, I know which one I’m likely to choose.

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    @desmith: that’s fair and sad at the same time. Mostly because it won’t just be us very soon. It’ll be all of WordPress if I get my way.

    Just to head this one off at the pass: Anyone that’s interested in a much longer and deeper discussion of the pros and cons of increasing the minimum version of WordPress should take a look at this Trac issue. This Yoast ticket was/is just about suppressing the alert generated by this plugin.

    “Error, not a notice” is just quibbling over words. It’s output executed on the admin_notices hook, which is widely known in the WP development community to be a “notice”. Just because you put the error class in the HTML doesn’t mean it’s not a notice.

    I’m fully in support of pushing newer PHP versions. I don’t think a minimum of PHP 5.3 is a smart solution either. We should push for a minimum of 5.6.

    However, I am not in support of any theme/plugin hijacking the user’s admin, particularly the Dashboard screen. That screen doesn’t belong to your plugin. If the plugin required PHP 5.3+ or 5.6+ to actually work, that’d be completely different. If that’s what you want, go for it.

    Require a minimum PHP version, but don’t put a non-dismissable notice on the user’s Dashboard.

    Totally agree.. if the plugin requires a specific PHP version then just add it to requirements .. else don’t hijack the users dashboard. We should be able to report this to a higher wordpress instance as if it were a malware containing plugin.. where can we do this?

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    This is going into WordPress core, soon, probably even 4.9. And it won’t be for just PHP 5.2. So, get with the program and update your PHP to a supported PHP version.

    Reporting this to a higher authority (which would be the plugins team) is of no use, as they have explicitly OK’d this.

    It seems you’re too presumptuous to understand that there may be legitmate reasons beyond your comprehension to not upgrade .. it also seems you do not understand that people may go to even greater lenghts when forced to do something against their will.

    Many to whom your FORCED NOTICE is intended do not upgrade mainly because they either don’t know they should or don’t have the knowhow .. however there are other group of people like me that have legitimate reasons to consciously not upgrade .. these reasons should not be any of your business as it’s not mine to understand yours behind getting everybody to the latest version asides from the couple of deprecated warnings you had to fix before starting your crusade.

    In any case .. i sincerely doubt that WP Core will do the kind of #phpversionseggregation and #phpversionprofilng you’re doing (display a non-removable big sign saying you should upgrade) as they would make themselves subject to a lawsuit .. why do you think no other company has ever done that before?

    this closely borders a first amendment issue .. not being able to remove your sign is the same as having your religious ideas broadcasted day and night on my front porch..

    Respect my willfull and conscious decision not to upgrade and let me be. I wont upgrade beacuse of your plugin .. nor to have the latest version of your plugin nor for any other external reason that is trivial to my many other reasons not to.

    I see you closed the comments section on the yoast website about this notice.. wonder why..i also noticed you left to hang several people with crashed sites without even a “sorry plase contact your support service for help”.. also wonder why..

    I for one find it distasteful and lacking any consideration to systems managers (however they may call themselves) .. what would you think if i made a plugin that once installed alerted the user that there is (what i consider without a doubt) a better more secure WP All in one SEO plugin than Yoast and that they should contact their adminstrator to upgrade to it?

    I have already uninstalled your plugin from all my customers wp installations and replaced it with another seo plugin tht does the exact same thing without meddling with our php version upgrade preferences

    Ps. Thx for letting me know who to address my issues (the plugins team)

    Plugin Contributor Joost de Valk

    (@joostdevalk)

    A lawsuit? You do realise that you install WordPress by your own free will right? WordPress will do this, I’m leading the efforts on it and we’ve been discussing it at the recent WordPress community summit. Think of it much like how we have the browse happy project, which urges people to use a more recent browser.

    You think I’m dumb for not being considerate of your issues, but you’re the one using a PHP version that has not been supported for a long time. If you replace your SEO plugin for your users without asking them, I think you’re the one that’s in for a lawsuit 🙂

    what would you think if i made a plugin that once installed alerted the user that there is (what i consider without a doubt) a better more secure WP All in one SEO plugin than Yoast and that they should contact their adminstrator to upgrade to it?

    Well, if you had updated your PHP versions to supported, faster and more secure versions, you’d never been in this position. It’s you who’s not doing his work and you’re part of the problem, not the solution, by fighting this.

    Could you explain what “the problem” actually is? Can you prove that php 7 is more secure than my current setup?

    Would you force me to upgrade my windows xp too? What about dairy products? Meat? Should i also be forced to excercise? Want me to upgrade my religious beliefs too?

    What about my classic car? Will you also force me to get a faster and more secure one and get rid of it?

    L.A.W.S.U.I.T to WPCore if i we cant get rid of a notice to upgrade a third party software that it’s not required by the primary software. Either it’s required or optional.. if it’s optional stop messing with it.

    As per my clients they’ve sll been notified and don’t give a rats ass about using your plugin or anyother thst does the same thing.. they just need the functionality not the brand..

    Ps.- As explained before I’m not against the notice itself.. I’m against not being able to get rid of it

    • This reply was modified 6 years, 9 months ago by nstiac.
    • This reply was modified 6 years, 9 months ago by nstiac.
Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Remove Notice from Dashboard’ is closed to new replies.