Plugin Directory

Changeset 2935472


Ignore:
Timestamp:
07/07/2023 08:04:42 AM (3 years ago)
Author:
SplitIt
Message:

prevent send slack notification

Location:
splitit-installment-payments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • splitit-installment-payments/tags/4.0.0/splitIt-flexfields-payment-gateway.php

    r2934336 r2935472  
    7676    }
    7777
    78     send_slack_notification( 'Splitit app has been activate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     78    // Check if the plugin was previously activated.
     79    $previous_activation_time = get_option( 'splitit_last_activation_time' );
     80
     81    if ( $previous_activation_time && ( time() - $previous_activation_time ) < 3600 ) {
     82        // If the previous activation was less than an 1 hour ago, stop executing the function.
     83        return;
     84    }
     85
     86    send_slack_notification( 'Splitit app has been activated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    7987    send_info( 'activate' );
     88
     89    // Save the activation time.
     90    update_option( 'splitit_last_activation_time', time() );
    8091}
    8192register_activation_hook( __FILE__, 'splitit_activate' );
     
    8596 */
    8697function splitit_deactivate() {
    87     send_slack_notification( 'Splitit app has been deactivate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     98    // Check if the plugin was previously deactivated.
     99    $previous_deactivation_time = get_option( 'splitit_last_deactivation_time' );
     100
     101    if ( $previous_deactivation_time && ( time() - $previous_deactivation_time ) < 3600 ) {
     102        // If the previous deactivation was less than an 1 hour ago, stop executing the function.
     103        return;
     104    }
     105
     106    send_slack_notification( 'Splitit app has been deactivated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    88107    send_info( 'deactivate' );
     108
     109    // Save the deactivation time.
     110    update_option( 'splitit_last_deactivation_time', time() );
    89111}
    90112register_deactivation_hook( __FILE__, 'splitit_deactivate' );
  • splitit-installment-payments/trunk/splitIt-flexfields-payment-gateway.php

    r2934336 r2935472  
    7676    }
    7777
    78     send_slack_notification( 'Splitit app has been activate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     78    // Check if the plugin was previously activated.
     79    $previous_activation_time = get_option( 'splitit_last_activation_time' );
     80
     81    if ( $previous_activation_time && ( time() - $previous_activation_time ) < 3600 ) {
     82        // If the previous activation was less than an 1 hour ago, stop executing the function.
     83        return;
     84    }
     85
     86    send_slack_notification( 'Splitit app has been activated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    7987    send_info( 'activate' );
     88
     89    // Save the activation time.
     90    update_option( 'splitit_last_activation_time', time() );
    8091}
    8192register_activation_hook( __FILE__, 'splitit_activate' );
     
    8596 */
    8697function splitit_deactivate() {
    87     send_slack_notification( 'Splitit app has been deactivate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     98    // Check if the plugin was previously deactivated.
     99    $previous_deactivation_time = get_option( 'splitit_last_deactivation_time' );
     100
     101    if ( $previous_deactivation_time && ( time() - $previous_deactivation_time ) < 3600 ) {
     102        // If the previous deactivation was less than an 1 hour ago, stop executing the function.
     103        return;
     104    }
     105
     106    send_slack_notification( 'Splitit app has been deactivated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    88107    send_info( 'deactivate' );
     108
     109    // Save the deactivation time.
     110    update_option( 'splitit_last_deactivation_time', time() );
    89111}
    90112register_deactivation_hook( __FILE__, 'splitit_deactivate' );
Note: See TracChangeset for help on using the changeset viewer.