@@ -34,7 +34,7 @@ class Plugin extends Plugin_Base {
34
34
public function __construct () {
35
35
36
36
// Parse plugin version.
37
- if ( preg_match ( '/Version:\s*(\S+)/ ' , file_get_contents ( dirname ( __FILE__ ) . '/../customize-snapshots.php ' ), $ matches ) ) {
37
+ if ( preg_match ( '/Version:\s*(\S+)/ ' , file_get_contents ( __DIR__ . '/../customize-snapshots.php ' ), $ matches ) ) {
38
38
$ this ->version = $ matches [1 ];
39
39
}
40
40
@@ -66,7 +66,8 @@ public function init() {
66
66
* @param \WP_Scripts $wp_scripts Instance of \WP_Scripts.
67
67
*/
68
68
public function register_scripts ( \WP_Scripts $ wp_scripts ) {
69
- $ min = ( SCRIPT_DEBUG ? '' : '.min ' );
69
+ $ is_git_repo = file_exists ( dirname ( __DIR__ ) . '/.git ' );
70
+ $ min = ( SCRIPT_DEBUG || $ is_git_repo ? '' : '.min ' );
70
71
71
72
$ handle = 'customize-snapshots ' ;
72
73
$ src = $ this ->dir_url . 'js/customize-snapshots ' . $ min . '.js ' ;
@@ -92,7 +93,8 @@ public function register_scripts( \WP_Scripts $wp_scripts ) {
92
93
* @param \WP_Styles $wp_styles Instance of \WP_Styles.
93
94
*/
94
95
public function register_styles ( \WP_Styles $ wp_styles ) {
95
- $ min = ( SCRIPT_DEBUG ? '' : '.min ' );
96
+ $ is_git_repo = file_exists ( dirname ( __DIR__ ) . '/.git ' );
97
+ $ min = ( SCRIPT_DEBUG || $ is_git_repo ? '' : '.min ' );
96
98
97
99
$ handle = 'customize-snapshots ' ;
98
100
$ src = $ this ->dir_url . 'css/customize-snapshots ' . $ min . '.css ' ;
0 commit comments