Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from 2.5.1 to 3.0.0 broke my website #732

Closed
1 task done
ajaxthemestudios opened this issue Mar 1, 2024 · 5 comments · Fixed by #733
Closed
1 task done

Update from 2.5.1 to 3.0.0 broke my website #732

ajaxthemestudios opened this issue Mar 1, 2024 · 5 comments · Fixed by #733
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@ajaxthemestudios
Copy link

Describe your question

I updated the plugin from my current version 2.5.1 to 3.0.0 and it broke the website. I had to disable the plugin to recover my website and then return to the old version.
WP threw the following errors:

[01-Mar-2024 21:47:51 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Classifai\Features\Feature::merge_settings() must be of the type array, string given, called in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 399 and defined in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php:394
Stack trace:
#0 C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php(399): Classifai\Features\Feature->merge_settings('1', Array)
#1 C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php(319): Classifai\Features\Feature->merge_settings(Array, Array)
#2 C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php(942): Classifai\Features\Feature->get_settings()
#3 C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php(57): Classifai\Features\Feature->is_feature_enabled()
#4 C:\laragon\www\mysite in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 394

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ajaxthemestudios ajaxthemestudios added the type:question Further information is requested. label Mar 1, 2024
@dkotter dkotter added the type:bug Something isn't working. label Mar 1, 2024
@dkotter dkotter added this to the 3.0.1 milestone Mar 1, 2024
@dkotter dkotter removed the type:question Further information is requested. label Mar 1, 2024
@dkotter
Copy link
Collaborator

dkotter commented Mar 1, 2024

Thanks for the report @ajaxthemestudios. That error message is helpful but would also be helpful to know what features you currently have set up in ClassifAI? This way I can narrow down which of the features is causing this error. Thanks!

Edit: also what settings you have for each of those features would be helpful. I've tried to reproduce this and have not run into the same error yet. It's a fairly simple code change needed to resolve this but would like to be able to actually reproduce to ensure there's nothing else we're missing.

@ajaxthemestudios
Copy link
Author

ajaxthemestudios commented Mar 2, 2024

Thank you for getting back to us.

  1. We have the Microsoft Azure Image Processing API connected with the automatic Image tagging featured checked and enabled.
  2. We also have the IBM Watson Language Processing API connected but did not check or enable the automatic content classification of posts.

I believe these two were the initial features available when we first installed the plugin three years ago. Despite all the newer features, they are the only features we have been using and all updates performed have never broken the plugin until now. Hope the information helps.

Please see attached screenshot of the settings for these two features
language-processing
image-processing

@dkotter
Copy link
Collaborator

dkotter commented Mar 4, 2024

@ajaxthemestudios Thanks for the additional details. Unfortunately I've not been able to replicate the error you're getting, even with matching those settings as close as I can get. I do have a PR up (#733) to attempt to fix this but haven't been able to verify that for sure since I haven't gotten that error.

If you happen to have some time and a local/test environment to test that PR on, that would be super helpful to let us know if it fixes your error.

@ajaxthemestudios
Copy link
Author

ajaxthemestudios commented Mar 5, 2024

@dkotter, I updated the site again. It broke the site like before. Then I replaced the Feature.php file with the updated one and the site was restored.
The only thing showing in my debug log file now that is related to classifai are PHP warnings and notices. If you are interested in time, here they are below:

[05-Mar-2024 19:43:30 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:43:30 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:43:49 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:43:49 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:17 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:17 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:24 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:24 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:32 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:32 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:32 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:32 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:44:32 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:32 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:44:32 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:32 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:44:39 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:39 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:51 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:51 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:44:51 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:51 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:44:51 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:51 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:44:51 UTC] PHP Warning:  array_search() expects parameter 2 to be array, string given in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 702
[05-Mar-2024 19:44:51 UTC] PHP Notice:  String offset cast occurred in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\Feature.php on line 711
[05-Mar-2024 19:45:04 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:45:04 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:45:07 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316
[05-Mar-2024 19:45:07 UTC] PHP Warning:  Illegal string offset 'caption' in C:\laragon\www\mysite\wp-content\plugins\classifai-stable\includes\Classifai\Features\DescriptiveTextGenerator.php on line 316

Thanks and regards

@dkotter
Copy link
Collaborator

dkotter commented Mar 6, 2024

@ajaxthemestudios Thanks for the additional errors, those were also helpful. I've made additional changes to PR #733 and I think it addresses all the issues you've run into so far.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants