Plugin is generating PHP warning and error
-
When the dokan-lite plugin is active it throws a PHP warning in wp-cli. The warning persists in wp-cli while the plugin is active. This makes it difficult to use wp-cli for administrative tasks. When dokan-lite is deactivated the warning no longer shows.
This is the warning message:
“Warning: call_user_func() expects parameter 1 to be a valid callback, array must have exactly two members in wp-includes/rest-api/class-wp-rest-server.php on line 1487”I tested this by deactivating all plugins, and activating default theme twentytwentythree. Then I activated Woocommerce, followed by dokan-lite. If the plugins are activated in the reverse order a fatal error is generated. This may help to identify the source of the problem as it’s not easy to debug given that it’s a rest-api error.
To generate the warning in php. Type following commands into wp-cli:
- wp theme activate twentytwentythree (ensure no theme conflicts)
- wp plugin deactivate –all
- wp plugin activate woocommerce
- wp plugin activate dokan-lite
- wp shell or any other wp command
To generate fatal error. Type following commands into wp-cli:
1. wp theme activate twentytwentythree (ensure no theme conflicts)
2. wp plugin deactivate –all
3. wp plugin activate dokan-lite
4. wp plugin activate woocommerce
The following error is generated:
Fatal error: Uncaught Error: Call to undefined function WeDevs\Dokan\dokan_get_option() in wp-content/plugins/dokan-lite/includes/Rewrites.php:19
- The topic ‘Plugin is generating PHP warning and error’ is closed to new replies.