send(); set_transient($transient_name, 'sent', WEEK_IN_SECONDS); } } public function analytics_check_field() { register_setting( 'general', 'iwptpl_usage_track', array( 'type' => 'boolean', 'sanitize_callback' => [$this, 'sanitize_checkbox'], 'default' => 1 ) ); add_settings_field( 'iwptpl_usage_track', esc_html__('Enable Usage Tracking', 'advanced-product-table-for-woocommerce'), [$this, 'usage_tracking_checkbox'], 'general', 'default', array( 'label_for' => 'iwptpl_usage_track_general', 'description' => esc_html__('Allow anonymous usage data tracking to help improve our plugin.', 'advanced-product-table-for-woocommerce') ) ); } public function sanitize_checkbox($input) { return (isset($input) && $input == 'yes') ? 'yes' : ''; } public function usage_tracking_checkbox($args) { $option = IWPTPL_Onboarding::usage_track_is_allowed(); $description = $args['description'] ?? ''; include IWPTPL_FW_DIR . 'analytics/views/usage_track_checkbox.php'; } }