• Resolved Rufus87

    (@rufus87)


    Hi guys,

    Many thanks for the great plugin.

    There is a deprecated filter usage at clearfy/includes/classes/class.configurate-performance.php: add_filter(‘rest_enabled’, ‘__return_false’);

    this filter is deprecated and it triggers following notice

    PHP Notice: rest_enabled is deprecated since version 4.7.0! Use rest_authentication_errors instead. The REST API can no longer be completely disabled, the rest_authentication_errors filter can be used to restrict access to the API, instead.

    It should be replaced with ‘rest_authentication_errors’

    Kindly please include the fix in your next update.

    Thanks,
    Keep it up.

    • This topic was modified 6 years, 6 months ago by Rufus87.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author webcraftic

    (@webcraftic)

    Hi,

    This issue is fixed in the new version.

    Thanks for reporting bugs!

    Best regards, Alex

    Thread Starter Rufus87

    (@rufus87)

    Thank you so much

    Thread Starter Rufus87

    (@rufus87)

    Sorry for disturb.

    I can see the new update 1.3.184 does not contain the fix

    Plugin Author webcraftic

    (@webcraftic)

    What is your version of WordPress?

    For old version, I left the ‘json_enabled’ filter, for the new version 4.7+, a new ‘rest_authentication_errors’ filter is used.

    See the sample code below:

    /*
        Disable REST API
    */
    if( version_compare(get_bloginfo('version'), '4.7', '>=') ) {
    	add_filter('rest_authentication_errors', array($this, 'disableWpRestApi'));
    } else {
    	// REST API 1.x
    	add_filter('json_enabled', '__return_false');
    	add_filter('json_jsonp_enabled', '__return_false');
    
    	// REST API 2.x
    	add_filter('rest_enabled', '__return_false');
    	add_filter('rest_jsonp_enabled', '__return_false');
    }

    Best regards, Alex

    Thread Starter Rufus87

    (@rufus87)

    Got it.

    Thank you very much.

    You can close this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Deprecated filter’ is closed to new replies.