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

Possible to use for admin dashboard? #42

Open
abhishek-sharma8 opened this issue Mar 6, 2024 · 9 comments
Open

Possible to use for admin dashboard? #42

abhishek-sharma8 opened this issue Mar 6, 2024 · 9 comments

Comments

@abhishek-sharma8
Copy link

Hi, thank you for this super awesome plugin. It works fine for the frontend, but is it possible to also use it for backend images, like the media library, product images in the edit screen, etc?

I tried both the plugin and the worker but none are rewriting the images in the backend. I'd like to completely get rid of the thumbnails and only keep the original copies on my server.

@Mecanik
Copy link
Owner

Mecanik commented Mar 8, 2024

Hi, sorry but I do not understand. Do you want to apply image resizing to the admin area as well?

@abhishek-sharma8
Copy link
Author

Hi, yes. That is correct. I want to apply resizing to the admin area as well. Like thumbnails in the media library page (both list view and grid view) as well as product thumbnails in the Woocommerce products list page, etc.

@Mecanik
Copy link
Owner

Mecanik commented Mar 9, 2024

In this case, you have to edit the plugin manually here:

(just comment out that line).

@abhishek-sharma8
Copy link
Author

Unfortunately, it does not seem to work. The images are still loading from the server and not Cloudflare

@wpsumo
Copy link

wpsumo commented Mar 12, 2024

@Mecanik I think he mean to rewrite in wp-admin not just allow rewrite when is_admin and is_logged_in @abhishek-sharma8 correct?

@abhishek-sharma8
Copy link
Author

Yes, that is correct @wpsumo
To save space on the server when there are thousands of images, I'd like to only keep the original images on the server and no thumbnails. The thumbnail generation should be taken care of by this awesome plugin, which works great for the frontend. But the images are still served from the server on the backend.
This is what I am asking. The thumbnails for media files that I see in the media library (150x150 for list view and 300x300 for grid view), can they be served from Cloudflare as well? I did try a few filters but none of them worked.

@Mecanik
Copy link
Owner

Mecanik commented Mar 16, 2024

Guys, I still don't understand your use case. Please explain a bit better.

@wpsumo
Copy link

wpsumo commented Mar 16, 2024

I think he want to rewrite everything in wp-admin not sure the reason but maybe to offload the whole media library to cloudflare images? And not storing anything locally? Not sure either but that's what I understand.

Rewrite to offload make sense in one way but disabling resizing is overkill, in wp-admin as there is no point doing it there.

@abhishek-sharma8
Copy link
Author

@Mecanik The thumbnails you see in wp-admin are loaded from the server, not Cloudflare. For example, if you go to the media library, (example.com/wp-admin/upload.php?mode=grid or example.com/wp-admin/upload.php), the thumbnails you see are loaded from the server (150x150 size or 300x300). Same is the case when you add media media through the post and also the product gallery in the product gallery page. I've attached images for these screens, where I want to use Cloudflare images. Hopefully, this explains it better.

@wpsumo, for a smaller site, yes it is an overkill. But I have multiple sites on the same server, with up to 30k images per site. I don't want to offload the images, I only want to keep the original images on the server and use Cloudflare images for generating thumbnails on-demand, including for the wp-admin pages. This will not just save me a lot of storage space but the backups will also be quicker.
This is working fine for the front end through this plugin, but backend images, which I am assuming have different filters/hooks, are not working.

I'll try doing it myself if I can, but since I am not a developer, I am less likely to succeed.

https://i.ibb.co/yqrkJmS/media-library.jpg
https://i.ibb.co/55dSVfB/media-library-1.jpg
https://i.ibb.co/55dSVfB/media-library-1.jpg
https://i.ibb.co/55dSVfB/media-library-1.jpg
https://i.ibb.co/XkDxSbN/add-media.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants