prefix, TINVWL_PREFIX, 'lists' ); $date = $wpdb->get_var( "SELECT `date` FROM `{$lists_table}` ORDER BY `ID` ASC" ); $timestamp = $date ? strtotime( $date ) : time(); $date1 = new DateTime(); // current date $date2 = ( new DateTime() )->setTimestamp( $timestamp ); // your timestamp $interval = $date1->diff( $date2 ); $years = $interval->y; $days = $interval->d; // If the difference is 0 days, show as 1 day if ( $days === 0 ) { $days = 1; } if ( $years > 0 ) { $yearString = $years === 1 ? ' ' . esc_html__( 'year', 'ti-woocommerce-wishlist' ) . ' ' : ' ' . esc_html__( 'years', 'ti-woocommerce-wishlist' ) . ' '; $dayString = $days === 1 ? ' ' . esc_html__( 'day', 'ti-woocommerce-wishlist' ) : ' ' . esc_html__( 'days', 'ti-woocommerce-wishlist' ); return $years . $yearString . $days . $dayString; } else { $dayString = $days === 1 ? ' ' . esc_html__( 'day', 'ti-woocommerce-wishlist' ) : ' ' . esc_html__( 'days', 'ti-woocommerce-wishlist' ); return $days . $dayString; } } /** * Get the total number of wishlists. * * @return string Total number of wishlists. * @global wpdb $wpdb WordPress database abstraction object. * */ function tinvwl_wishlists_total(): string { global $wpdb; $lists_table = sprintf( '%s%s_%s', $wpdb->prefix, TINVWL_PREFIX, 'lists' ); $count = $wpdb->get_var( "SELECT COUNT(*) FROM `{$lists_table}`" ); return (string) $count; } ?>

">

' . esc_html__( 'TI WooCommerce Wishlists', 'ti-woocommerce-wishlist' ) . '', '' . tinvwl_installed_ago() . '' ); ?>

' . tinvwl_wishlists_total() . '' ); ?>

">

%s', esc_url( "https://templateinvaders.com/product/ti-woocommerce-wishlist-wordpress-plugin/?utm_source=" . TINVWL_UTM_SOURCE . "&utm_campaign=" . TINVWL_UTM_CAMPAIGN . "&utm_medium=" . TINVWL_UTM_MEDIUM . "&utm_content=wishlists_upgrade&partner=" . TINVWL_UTM_SOURCE ), esc_html__( 'Upgrade to Premium', 'ti-woocommerce-wishlist' ) ); ?>