PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev1
Elementor Website Builder – more than just a page builder v3.32.0-dev1
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / system-info / reporters / base-plugin.php

base-plugin.php in Elementor Website Builder – more than just a page builder 3.32.0-dev1, at modules/system-info/reporters/base-plugin.php

80 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\System_Info\Reporters;
3
4 use Elementor\Utils;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 abstract class Base_Plugin extends Base {
11 public static $required_plugins_properties = [
12 'Name',
13 'Version',
14 'URL',
15 'Author',
16 ];
17
18 public function print_html() {
19 foreach ( $this->get_report( 'html' ) as $field ) {
20 foreach ( $field['value'] as $plugin_info ) :
21 ?>
22 <tr>
23 <td><?php
24 if ( $plugin_info['PluginURI'] ) :
25 $plugin_name = sprintf( '<a href="%s">%s</a>', $plugin_info['PluginURI'], $plugin_info['Name'] );
26 else :
27 $plugin_name = $plugin_info['Name'];
28 endif;
29
30 if ( $plugin_info['Version'] ) :
31 $plugin_name .= ' - ' . $plugin_info['Version'];
32 endif;
33
34 Utils::print_unescaped_internal_string( $plugin_name );
35 ?></td>
36 <td><?php
37 if ( $plugin_info['Author'] ) :
38 if ( $plugin_info['AuthorURI'] ) :
39 $author = sprintf( '<a href="%s">%s</a>', $plugin_info['AuthorURI'], $plugin_info['Author'] );
40 else :
41 $author = $plugin_info['Author'];
42 endif;
43
44 Utils::print_unescaped_internal_string( "By $author" );
45 endif;
46 ?></td>
47 <td></td>
48 </tr>
49 <?php
50 endforeach;
51 }
52 }
53
54 public function print_raw( $tabs_count ) {
55 echo PHP_EOL;
56
57 $required_plugins_properties = array_flip( self::$required_plugins_properties );
58
59 unset( $required_plugins_properties['Name'] );
60
61 foreach ( $this->get_report( 'raw' ) as $field_name => $field ) :
62 $sub_indent = str_repeat( "\t", $tabs_count );
63
64 echo "== {$field['label']} ==" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
65
66 foreach ( $field['value'] as $plugin_info ) :
67 $plugin_properties = array_intersect_key( $plugin_info, $required_plugins_properties );
68
69 echo esc_html( $sub_indent . $plugin_info['Name'] );
70
71 foreach ( $plugin_properties as $property_name => $property ) :
72 echo PHP_EOL . "{$sub_indent}\t{$property_name}: {$property}"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
73 endforeach;
74
75 echo PHP_EOL . PHP_EOL;
76 endforeach;
77 endforeach;
78 }
79 }
80