PluginProbe ʕ •ᴥ•ʔ
پارسی دیت – Parsi Date / trunk
پارسی دیت – Parsi Date vtrunk
6.2.1 6.2 6.1 5.1.6 5.1.7 5.1.8 5.1.8.2 6.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.0.0-alpha 2.1 2.1.1 2.1.2 2.1.3 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0.1 2.3.0.2 2.3.1 2.3.2 2.3.3 2.3.4 3.0.1 3.0.2 3.0.3 4.0.0 4.0.1 4.0.2 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5
wp-parsidate / inc / App / Core / Debug.php
wp-parsidate / inc / App / Core Last commit date
Core.php 1 month ago Debug.php 1 month ago FixDates.php 1 month ago FixPermalink.php 1 month ago FixTitle.php 1 month ago ShamsiDate.php 1 month ago
Debug.php
59 lines
1 <?php
2
3 namespace WPParsidate\App\Core;
4
5 use WPParsidate\Helper\Notice;
6 use WPParsidate\Settings\Settings;
7
8 class Debug {
9 private const sectionID = 'debug';
10
11 public function __construct() {
12 add_filter( 'wp_parsidate_core_settings_sections', [ $this, 'addSectionSettings' ] );
13 add_action( 'wp_parsidate_admin_init', [ $this, 'addNotice' ] );
14 }
15
16 public function addNotice( $tab ): void {
17 if ( Settings::get( 'debug_mode', false ) ) {
18 Notice::add( 'dashboard', esc_html__( 'Debug mode is enabled!', 'wp-parsidate' ), 'warning' );
19 }
20 }
21
22 public function addSectionSettings( array $sections ): array {
23 $settings = array(
24 'start_grid_plugin' => array(
25 'title' => esc_html__( 'Debug', 'wp-parsidate' ),
26 'type' => 'startGrid',
27 ),
28 'debug_mode' => array(
29 'id' => 'debug_mode',
30 'title' => esc_html__( 'Debug Mode', 'wp-parsidate' ),
31 'type' => 'toggle',
32 'default' => false,
33 'desc' => esc_html__( 'By enabling this option, the uncompressed version of the JS and CSS files will be loaded.',
34 'wp-parsidate' ),
35 'sanitize' => 'bool'
36 ),
37 'local_text_domain' => array(
38 'id' => 'local_text_domain',
39 'title' => esc_html__( 'Load translate file', 'wp-parsidate' ),
40 'type' => 'toggle',
41 'default' => false,
42 'desc' => esc_html__( 'Load translate file from plugin directory.', 'wp-parsidate' ),
43 'sanitize' => 'bool'
44 ),
45 'end_grid_plugin' => array(
46 'type' => 'endGrid',
47 )
48 );
49
50 $sections[ self::sectionID ] = array(
51 'title' => esc_html__( 'Debug', 'wp-parsidate' ),
52 'desc' => esc_html__( 'Debug settings', 'wp-parsidate' ),
53 'settings' => $settings
54 );
55
56 return $sections;
57 }
58 }
59