protected function get_debug_items() { $debug_items = array(); // add debug on/off boolean $debug_items[] = (object) array('key' => 'wcc_debug_on', 'title' => 'Debug Logging', 'type' => 'boolean', 'true_text' => __('Enabled', 'connectforwoocommerce'), 'false_text' => __('Disabled', 'connectforwoocommerce'), 'description' => '', 'value' => $this->logger->is_logging_enabled(), 'save_on_toggle' => true); // add connect log tail $log_data = $this->get_debug_log_data(); $log_tail_line_count = count($log_data->tail); if ($log_tail_line_count < 1) { $description = ''; $log_tail = __('Log is empty', 'connectforwoocommerce'); } else { $url = add_query_arg(array('page' => 'wc-status', 'tab' => 'logs', 'log_file' => $log_data->key), admin_url('admin.php')); $description = sprintf(wp_kses(__('Last %d entries <a href="%s">Show full log</a>', 'connectforwoocommerce'), array('a' => array('href' => array()))), $log_tail_line_count, esc_url($url)); $log_tail = implode($log_data->tail, ''); } $debug_items[] = (object) array('key' => 'wcc_debug_log_tail', 'title' => __('Debug Log', 'connectforwoocommerce'), 'type' => 'textarea', 'description' => $description, 'readonly' => true, 'value' => $log_tail); return $debug_items; }