REST API changes in WordPress 5.5 are documented here:
REST API changes in WordPress 5.5
My change in the shariff.php file after line 210 to add that line:
'permission_callback' => '__return_true',
The function (shariff.php, line 187-215) after the my change:
/** Register the wp rest api route and sanitize the input */
function shariff3uu_sanitize_api() {
register_rest_route(
'shariff/v1',
'/share_counts',
array(
'methods' => 'GET',
'callback' => 'shariff3uu_share_counts',
'args' => array(
'url' => array(
'sanitize_callback' => 'esc_url',
'required' => true,
'description' => __( 'URL of the post or page to request share counts for.', 'shariff' ),
),
'services' => array(
'sanitize_callback' => 'sanitize_text_field',
'required' => true,
'description' => __( 'A list of services separated by |. Example: twitter|facebook|xing', 'shariff' ),
),
'timestamp' => array(
'sanitize_callback' => 'absint',
'description' => __( 'Timestamp of the last update of the post. Used for dynamic cache lifespan.', 'shariff' ),
),
),
'permission_callback' => '__return_true',
)
);
}
add_action( 'rest_api_init', 'shariff3uu_sanitize_api' );
I am getting this error as well. Disappointed to say that I will not be able to use Shariff until this is fixed. It’s a great plugin.
@kometschuh
Thank you for debugging this and providing the code. I am disappointed to see the dev has not even acknowledged your help, much less fix the problem. I am not a coder and will have to wait til the plugin is fixed.
Because it is not an error. It is a notice. Something you can only see if you have WP_DEBUG turned on, which you should never have in the first place on a production site.
Thank you @kometschuh it will be updated with the next release.
This is a community forum and plugin. All support and updates are provided from normal users in their spare time. There is no obligation whatsoever to help anyone for free. In 2020 there are definitely other things more important than to maintain a share button plugin.
Hi @starguide,
Thanks very much for your post and the plan for the update.