PluginProbe
Plugin Check (PCP) / 1.5.0
Plugin Check (PCP) v1.5.0
2.1.0 trunk 0.1 0.2.0 0.2.1 0.2.2 0.2.3 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 ci-artifacts
plugin-check / includes / Checker / Checks / Performance / Image_Functions_Check.php

Image_Functions_Check.php in Plugin Check (PCP) 1.5.0, at includes/Checker/Checks/Performance/Image_Functions_Check.php

79 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class Image_Functions_Check.
4 *
5 * @package plugin-check
6 */
7
8 namespace WordPress\Plugin_Check\Checker\Checks\Performance;
9
10 use WordPress\Plugin_Check\Checker\Check_Categories;
11 use WordPress\Plugin_Check\Checker\Check_Result;
12 use WordPress\Plugin_Check\Checker\Checks\Abstract_PHP_CodeSniffer_Check;
13 use WordPress\Plugin_Check\Traits\Stable_Check;
14
15 /**
16 * Check for running WordPress image functions sniffs.
17 *
18 * @since 1.3.0
19 */
20 class Image_Functions_Check extends Abstract_PHP_CodeSniffer_Check {
21
22 use Stable_Check;
23
24 /**
25 * Gets the categories for the check.
26 *
27 * Every check must have at least one category.
28 *
29 * @since 1.3.0
30 *
31 * @return array The categories for the check.
32 */
33 public function get_categories() {
34 return array( Check_Categories::CATEGORY_PERFORMANCE );
35 }
36
37 /**
38 * Returns an associative array of arguments to pass to PHPCS.
39 *
40 * @since 1.3.0
41 *
42 * @param Check_Result $result The check result to amend, including the plugin context to check.
43 * @return array An associative array of PHPCS CLI arguments.
44 */
45 protected function get_args( Check_Result $result ) {
46 return array(
47 'extensions' => 'php',
48 'standard' => 'PluginCheck',
49 'sniffs' => 'PluginCheck.CodeAnalysis.ImageFunctions',
50 );
51 }
52
53 /**
54 * Gets the description for the check.
55 *
56 * Every check must have a short description explaining what the check does.
57 *
58 * @since 1.3.0
59 *
60 * @return string Description.
61 */
62 public function get_description(): string {
63 return __( 'Checks whether images are inserted using recommended functions.', 'plugin-check' );
64 }
65
66 /**
67 * Gets the documentation URL for the check.
68 *
69 * Every check must have a URL with further information about the check.
70 *
71 * @since 1.3.0
72 *
73 * @return string The documentation URL.
74 */
75 public function get_documentation_url(): string {
76 return __( 'https://developer.wordpress.org/plugins/', 'plugin-check' );
77 }
78 }
79