Please or Register to create posts and topics.

Problems (Notices) with Wordpress 5.5

Hello, After updating the new version of Wordpress (5.5), I discovered that when I get to the article change section, I get a message, which then disappears under other html objects.

 

Notice: Funkce register_rest_route nebyla použita správným způsobem. The REST API route definition for asgaros-forum/v1/reaction/(?P\d )/(?P[a-zA-Z0-9-] ) is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Další informace o testování programu a hledání chyb naleznete v manuálu na stránce Ladění ve WordPressu (anglicky). (Tato zpráva se nově zobrazuje od verze 5.5.0.) in /var/www/vhosts/*****.***/httpdocs/wp-includes/functions.php on line 5225

Notice: Funkce register_rest_route nebyla použita správným způsobem. The REST API route definition for asgaros-forum/v1/suggestions/mentioning/(?P[a-zA-Z0-9-] ) is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Další informace o testování programu a hledání chyb naleznete v manuálu na stránce Ladění ve WordPressu (anglicky). (Tato zpráva se nově zobrazuje od verze 5.5.0.) in /var/www/vhosts/*****.***/httpdocs/wp-includes/functions.php on line 5225

 

The English equivalent of this message is from another plugin:


PHP Notice: register_rest_route was called <strong> incorrectly </strong>. The REST API route definition for <code> wp-rocket / v1 / rocketcdn / enable </code> is missing the required <code> permission_callback </code> argument. For REST API routes that are intended to be public, use <code> __return_true </code> as the permission callback. Please see <a href=”https://wordpress.org/support/article/debugging-in-wordpress/”> Debugging in WordPress </a> for more information. (This message was added in version 5.5.0.) In C: \ Users \ David \ Local Sites \ test \ app \ public \ wp-includes \ functions.php on line 5225

Source: https://github.com/wp-media/wp-rocket/issues/2985

 

So I tried to install a new version of Wordpress 5.5 and Asgaros Forum 1.15.6 on another website, if it is not caused by my template, but it did not appear here because I did not have WP_DEBUG mode enabled. After switching on, the message was displayed to me there.

Since I’m used to modifying the code as needed, I was looking for what was causing this error. After combining with commenting, I found that the error is raised during the construction of AsgarosForum in the file AsgarosForum.php, where the error appears after the constructors:

$ this-> reactions = new AsgarosForumReactions ($ this);
$ this-> mentioning = new AsgarosForumMentioning ($ this);

The first error message is displayed after the first line. The second message after the second line.

Then, when I was rummaging through the constructor, I found the command:

add_action (‘rest_api_init’, array ($ this, ‘initialize_routes’));

and finally:

register_rest_route (‘asgaros-forum / v1’, ‘/ reaction / (? P <post_id> \ d) / (? P <reaction> [a-zA-Z0-9-])’, array (‘methods’ => ‘POST’, ‘callback’ => array ($ this, ‘reaction_callback’)));
This command causes the notice.

A possible solution is at https://make.wordpress.org/core/2020/07/22/rest-api-changes-in-wordpress-5-5/, but I personally don’t know what the function does, what it’s for so i don’t know how to fix it.

A similar procedure would probably also apply to the second message I wrote about.

Hello @gorsignol

Thanks for the info. I will fix this soon in the next update!

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!