public function account() { // Set Gdrive client $gdrive = new ServMaskGdriveClient( get_option( 'ai1wmge_gdrive_token' ), get_option( 'ai1wmge_gdrive_ssl', true ) ); // Get account info $account = $gdrive->getAccountInfo(); // Set account name $name = null; if ( isset( $account['name'] ) ) { $name = $account['name']; } // Set used quota $used = null; if ( isset( $account['quotaBytesUsed'] ) ) { $used = $account['quotaBytesUsed']; } // Set total quota $total = null; if ( isset( $account['quotaBytesTotal'] ) ) { $total = $account['quotaBytesTotal']; } return array( 'name' => $name, 'used' => size_format( $used ), 'total' => size_format( $total ), 'progress' => ceil( ( $used / $total ) * 100 ), ); }