| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\System_Info\Reporters; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Modules\System_Info\Helpers\Model_Helper; |
| 5 | -use Elementor\Utils; | |
| 6 | 5 | |
| 7 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 7 | exit; // Exit if accessed directly. |
| 9 | 8 | } |
| @@ -66,50 +65,8 @@ | ||
| 66 | 65 | public function is_enabled() { |
| 67 | 66 | return true; |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | - public function print_html() { | |
| 71 | - foreach ( $this->get_report( 'html' ) as $field ) { | |
| 72 | - $warning_class = ! empty( $field['warning'] ) ? ' class="elementor-warning"' : ''; | |
| 73 | - $log_label = ! empty( $field['label'] ) ? $field['label'] . ':' : ''; | |
| 74 | - ?> | |
| 75 | - <tr<?php Utils::print_unescaped_internal_string( $warning_class ); ?>> | |
| 76 | - <td><?php Utils::print_unescaped_internal_string( $log_label ); ?></td> | |
| 77 | - <td><?php Utils::print_unescaped_internal_string( $field['value'] ); ?></td> | |
| 78 | - <td><?php | |
| 79 | - if ( ! empty( $field['recommendation'] ) ) : | |
| 80 | - Utils::print_unescaped_internal_string( $field['recommendation'] ); | |
| 81 | - endif; | |
| 82 | - ?></td> | |
| 83 | - </tr> | |
| 84 | - <?php | |
| 85 | - } | |
| 86 | - } | |
| 87 | - | |
| 88 | - public function print_html_label( $label ) { | |
| 89 | - Utils::print_unescaped_internal_string( $label ); | |
| 90 | - } | |
| 91 | - | |
| 92 | - public function print_raw( $tabs_count ) { | |
| 93 | - $indent = str_repeat( "\t", $tabs_count - 1 ); | |
| 94 | - | |
| 95 | - $report = $this->get_report( 'raw' ); | |
| 96 | - | |
| 97 | - echo PHP_EOL . $indent . '== ' . $this->get_title() . ' =='; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 98 | - echo PHP_EOL; | |
| 99 | - | |
| 100 | - foreach ( $report as $field_name => $field ) : | |
| 101 | - $sub_indent = str_repeat( "\t", $tabs_count ); | |
| 102 | - | |
| 103 | - $label = $field['label']; | |
| 104 | - | |
| 105 | - if ( ! empty( $label ) ) { | |
| 106 | - $label .= ': '; | |
| 107 | - } | |
| 108 | - echo "{$sub_indent}{$label}{$field['value']}" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 109 | - endforeach; | |
| 110 | - } | |
| 111 | - | |
| 112 | 69 | /** |
| 113 | 70 | * Get report. |
| 114 | 71 | * |
| 115 | 72 | * Retrieve the report with all it's containing fields. |
| @@ -133,9 +90,9 @@ | ||
| 133 | 90 | $method = 'get_' . $format . $field_name; |
| 134 | 91 | |
| 135 | 92 | if ( ! method_exists( $this, $method ) ) { |
| 136 | 93 | $method = 'get_' . $field_name; |
| 137 | - // fallback: | |
| 94 | + //fallback: | |
| 138 | 95 | if ( ! method_exists( $this, $method ) ) { |
| 139 | 96 | return new \WP_Error( sprintf( "Getter method for the field '%s' wasn't found in %s.", $field_name, get_called_class() ) ); |
| 140 | 97 | } |
| 141 | 98 | } |