| @@ 4449-4475 (lines=27) @@ | ||
| 4446 | * |
|
| 4447 | * @return string Assumed site creation date and time. |
|
| 4448 | */ |
|
| 4449 | public static function get_assumed_site_creation_date() { |
|
| 4450 | $earliest_registered_users = get_users( array( |
|
| 4451 | 'role' => 'administrator', |
|
| 4452 | 'orderby' => 'user_registered', |
|
| 4453 | 'order' => 'ASC', |
|
| 4454 | 'fields' => array( 'user_registered' ), |
|
| 4455 | 'number' => 1, |
|
| 4456 | ) ); |
|
| 4457 | $earliest_registration_date = $earliest_registered_users[0]->user_registered; |
|
| 4458 | ||
| 4459 | $earliest_posts = get_posts( array( |
|
| 4460 | 'posts_per_page' => 1, |
|
| 4461 | 'post_type' => 'any', |
|
| 4462 | 'post_status' => 'any', |
|
| 4463 | 'orderby' => 'date', |
|
| 4464 | 'order' => 'ASC', |
|
| 4465 | ) ); |
|
| 4466 | ||
| 4467 | // If there are no posts at all, we'll count only on user registration date. |
|
| 4468 | if ( $earliest_posts ) { |
|
| 4469 | $earliest_post_date = $earliest_posts[0]->post_date; |
|
| 4470 | } else { |
|
| 4471 | $earliest_post_date = PHP_INT_MAX; |
|
| 4472 | } |
|
| 4473 | ||
| 4474 | return min( $earliest_registration_date, $earliest_post_date ); |
|
| 4475 | } |
|
| 4476 | ||
| 4477 | public static function apply_activation_source_to_args( &$args ) { |
|
| 4478 | list( $activation_source_name, $activation_source_keyword ) = get_option( 'jetpack_activation_source' ); |
|
| @@ 806-836 (lines=31) @@ | ||
| 803 | * |
|
| 804 | * @return string Assumed site creation date and time. |
|
| 805 | */ |
|
| 806 | public function get_assumed_site_creation_date() { |
|
| 807 | $earliest_registered_users = get_users( |
|
| 808 | array( |
|
| 809 | 'role' => 'administrator', |
|
| 810 | 'orderby' => 'user_registered', |
|
| 811 | 'order' => 'ASC', |
|
| 812 | 'fields' => array( 'user_registered' ), |
|
| 813 | 'number' => 1, |
|
| 814 | ) |
|
| 815 | ); |
|
| 816 | $earliest_registration_date = $earliest_registered_users[0]->user_registered; |
|
| 817 | ||
| 818 | $earliest_posts = get_posts( |
|
| 819 | array( |
|
| 820 | 'posts_per_page' => 1, |
|
| 821 | 'post_type' => 'any', |
|
| 822 | 'post_status' => 'any', |
|
| 823 | 'orderby' => 'date', |
|
| 824 | 'order' => 'ASC', |
|
| 825 | ) |
|
| 826 | ); |
|
| 827 | ||
| 828 | // If there are no posts at all, we'll count only on user registration date. |
|
| 829 | if ( $earliest_posts ) { |
|
| 830 | $earliest_post_date = $earliest_posts[0]->post_date; |
|
| 831 | } else { |
|
| 832 | $earliest_post_date = PHP_INT_MAX; |
|
| 833 | } |
|
| 834 | ||
| 835 | return min( $earliest_registration_date, $earliest_post_date ); |
|
| 836 | } |
|
| 837 | ||
| 838 | /** |
|
| 839 | * Adds the activation source string as a parameter to passed arguments. |
|