Closed jbma closed 1 year ago
@jbma to confirm we need to show the exact same popup he got at 20% storage remaining again even if the customer already clicked on it by the past to dismiss it? Or we need a new one looking the same way.
In the previous version when the quota was 0, when we tried to launch the bulk optimization or when running (we had to stay on the same page, wasn't async) a popin was displayed when launching the bulk or when it was running.
I guess here the best solution would be to display the popin each time we go the bulk when the quota is 0
To activate the popup when the quota is over we need to modify two classes to add the following logic:
classes/Notices/Notices.php
where we will have to modify the method display_almost_over_quota
:
First we will need to move $user
instantiation over the self::notice_is_dismissed( 'almost-over-quota' )
condition and add a check if the quota different from zero on that condition:
$user = new \Imagify_User();
if ( self::notice_is_dismissed( 'almost-over-quota' ) && $user->get_percent_unconsumed_quota() !== 0 ) {
return $display;
}
inc/classes/class-imagify-user.php
where we will have to modify the method get_percent_consumed_quota
:
We will have to a new condition checking for 100% on the 80% condition launching imagify_not_almost_over_quota_anymore
action:
if ( ( (float) $previous_percent >= 80.0 && $percent < 80 ) || $percent === 100 ) {
Effort XS
PS:
@Tabrisrp while doing that I got no popup displaying due to no results found in renew_almost_over_quota_notice
method, could you confirm that value would be filled if we reach 80% usage?
Is your feature request related to a problem? Please describe. Once the bulk optimization is launched and all the quota is consumed, we don't directly display the information about the quota. Instead it looks like the bulk is continuing.
That's for example how this is displayed on the bulk (the user has consumed all his quota) :
Describe the solution you'd like Instead we should directly use the popin we were using before to warn the user about the quota and provide him a solution.