Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| Settings | |
0.00% |
0 / 7 |
|
0.00% |
0 / 5 |
56 | |
0.00% |
0 / 1 |
| get_log_level | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_plugin_name | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_plugin_slug | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| get_plugin_basename | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| get_plugin_version | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Plain-ish object returning plugin settings. |
| 4 | * |
| 5 | * @package brianhenryie/bh-wp-plugins-page |
| 6 | */ |
| 7 | |
| 8 | namespace BrianHenryIE\WP_Plugins_Page\API; |
| 9 | |
| 10 | use BrianHenryIE\WP_Plugins_Page\BrianHenryIE\WP_Logger\Logger_Settings_Interface; |
| 11 | use Psr\Log\LogLevel; |
| 12 | |
| 13 | /** |
| 14 | * Plugin settings for Logger. |
| 15 | */ |
| 16 | class Settings implements Logger_Settings_Interface { |
| 17 | |
| 18 | /** |
| 19 | * Detail of logs to record. |
| 20 | */ |
| 21 | public function get_log_level(): string { |
| 22 | return get_option( 'bh_wp_plugins_page_log_level', LogLevel::INFO ); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Plugin name as displayed on the logs page. |
| 27 | */ |
| 28 | public function get_plugin_name(): string { |
| 29 | return 'Plugins Page Cleanup'; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * The plugin's slug. |
| 34 | */ |
| 35 | public function get_plugin_slug(): string { |
| 36 | return 'bh-wp-plugins-page'; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * The plugin basename used when determining is a log related to this plugin, and to add the logs link to the plugins page. |
| 41 | */ |
| 42 | public function get_plugin_basename(): string { |
| 43 | return defined( 'BH_WP_PLUGINS_PAGE_BASENAME' ) |
| 44 | ? BH_WP_PLUGINS_PAGE_BASENAME |
| 45 | : 'bh-wp-plugins-page/bh-wp-plugins-page.php'; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * The plugin version, used for JS and CSS caching. |
| 50 | */ |
| 51 | public function get_plugin_version(): string { |
| 52 | return defined( 'BH_WP_PLUGINS_PAGE_VERSION' ) ? BH_WP_PLUGINS_PAGE_VERSION : '1.2.0'; |
| 53 | } |
| 54 | |
| 55 | } |