WebDevStudios / nextjs-wordpress-starter

A headless starter for WordPress powered by Next.js.
https://webdevstudios.github.io/nextjs-wordpress-starter/
GNU General Public License v2.0
734 stars 129 forks source link

Error when activating WDS plugins #1061

Open phanuelmutuma opened 1 year ago

phanuelmutuma commented 1 year ago

Describe the bug Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "WDS_Headless_Core\activation_callback" not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php:307 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #1 C:\xampp\htdocs\wordpress\wp-includes\plugin.php(476): WP_Hook->do_action(Array) #2 C:\xampp\htdocs\wordpress\wp-admin\plugins.php(194): do_action('activate_wds-he...') #3 {main} thrown in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 307

To Reproduce Steps to reproduce the behavior:

  1. Install plugins via composer
  2. Try to activate either of the WDS plugins

Expected behavior The plugins should activate normally without error

Desktop (please complete the following information):

mrEckendonk commented 1 year ago

@phanuelmutuma What is the version of PHP? It seems that PHP 8.1.x gives a Fatal error on several plugins.

alexstandiford commented 1 year ago

I was able to work around this by temporarily adding a couple require statements in each of the WDS plugins:

I opened a PR for one of them here to provide an example: https://github.com/WebDevStudios/wds-headless-core/pull/12

sdoigmm commented 1 year ago

Same error today with PHP 8.1.9, switching to PHP 7.4.30 resolved it