10up / classifai

Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence.
https://classifaiplugin.com
GNU General Public License v2.0
578 stars 53 forks source link

`Descriptive text` and `Image tags` buttons show up even if those features are turned off #427

Closed dkotter closed 1 year ago

dkotter commented 1 year ago

Describe the bug

I have the Generate descriptive text option and the Tag images option turned off within the Image Processing settings for Microsoft Azure:

Image Processing settings

But if I go and open an image in the Media Library, I still see the Descriptive text and Image tags buttons:

Image settings

When I actually click on the buttons, requests are sent but luckily the code that runs does check to ensure those features are turned on before modifying any content (though API requests are still made which is a separate issue). Ideally we shouldn't be showing these buttons at all. For instance, we don't show the smart cropping button or OCR button if those features are turned off, so we should copy what's been done there for these other options.

Steps to Reproduce

  1. Setup a connection with Computer Vision
  2. Ensure no features are turned on
  3. Upload a new image and then select that image
  4. Notice the buttons that show up
  5. Click on these buttons and note nothing gets changed but the request still sends

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

dkotter commented 1 year ago

In addition to the above, also found out that if you have the Generate descriptive text option turned off, there's still a Scan Image option that is available within the Media Library list view bulk action dropdown that we should look to remove:

Media library list view