Skip to content

Commit

Permalink
refactor: remove install category from survey
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Feb 18, 2025
1 parent c152980 commit d3af6ff
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ function( $data, $page_slug ) {
$data = array(
'environmentId' => 'clr7jal6eexcy8up0wdufqz2d',
'attributes' => array(
'days_since_install' => self::convert_to_category( $install_days_number ),
'install_days_number' => $install_days_number,
'version' => RIVERBANK_VERSION,
),
Expand All @@ -340,28 +339,4 @@ function( $data, $page_slug ) {
);
do_action( 'themeisle_internal_page', RIVERBANK_PRODUCT_SLUG, $screen->id );
}

/**
* Convert a number to a category.
*
* @param int $number Number to convert.
* @param int $scale Scale.
*
* @return int
*/
public static function convert_to_category( $number, $scale = 1 ) {
$normalized_number = intval( round( $number / $scale ) );

if ( 0 === $normalized_number || 1 === $normalized_number ) {
return 0;
} elseif ( $normalized_number > 1 && $normalized_number < 8 ) {
return 7;
} elseif ( $normalized_number >= 8 && $normalized_number < 31 ) {
return 30;
} elseif ( $normalized_number > 30 && $normalized_number < 90 ) {
return 90;
} elseif ( $normalized_number > 90 ) {
return 91;
}
}
}

0 comments on commit d3af6ff

Please sign in to comment.