get_option( 'phub_integration_id', '' ), 'api_key' => get_option( 'phub_api_key', '' ), 'integration_enabled' => get_option( 'phub_integration_enabled', 'no' ), 'debug_mode' => get_option( 'phub_debug_mode', 'no' ), ); } /** * Anahtarı verilen ayarı döndürür. * * @param string $key Döndürülmesi istenen ayar. * @return mixed */ public function get_setting_by_key( $key ) { $settings = $this->get_settings(); return isset( $settings[ $key ] ) ? $settings[ $key ] : false; } /** * Get integration ID. * * @return string */ public function get_integration_id() { return $this->get_setting_by_key( 'integration_id' ); } /** * Get API key. * * @return string */ public function get_api_key() { return $this->get_setting_by_key( 'api_key' ); } /** * Check if integration is enabled. * * @return bool */ public function is_integration_enabled() { return $this->get_setting_by_key( 'integration_enabled' ) === 'yes' && ! empty( $this->get_integration_id() ) && ! empty( $this->get_api_key() ); } /** * Check if debug mode is enabled. * * @return bool */ public function is_debug_enabled() { return $this->get_setting_by_key( 'debug_mode' ) === 'yes'; } }