Child Theme Configurator - Version 2.3.0

Version Description

  • Added ability to rename @media query
  • Added height/Width for theme images on Files Tab
  • Added test for RTL in Analyzer
  • Added test cases for WP Rocket and AutOptimize plugins in Analyzer
  • Added redirect for error condition after configurator POST
  • Clarified descriptions for certain Analyzer signal conditions
  • Set priority of child theme css hook to force load after parent
  • Remove pruned selectors from menu
Download this release

Release Info

Developer lilaeamedia
Plugin Icon 128x128 Child Theme Configurator
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.9 to 2.3.0

child-theme-configurator.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
9
- Version: 2.2.9
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
9
+ Version: 2.3.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
css/chldthmcfg.css CHANGED
@@ -638,11 +638,13 @@ h3.theme-name {
638
  -webkit-border-radius: 3px;
639
  border-radius: 3px;
640
  }
641
- /* fixed position debug output */
642
  #ctc_main textarea#ctc_debug_box {
 
643
  position: fixed;
644
  bottom: 0;
645
  z-index: 10000;
 
646
  width: 82%;
647
  height: 170px;
648
  font-size:11px;
638
  -webkit-border-radius: 3px;
639
  border-radius: 3px;
640
  }
641
+ /* debug output - commented fixed position v.2.3.0 */
642
  #ctc_main textarea#ctc_debug_box {
643
+ /*
644
  position: fixed;
645
  bottom: 0;
646
  z-index: 10000;
647
+ */
648
  width: 82%;
649
  height: 170px;
650
  font-size:11px;
includes/classes/Admin.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorAdmin
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
- Version: 2.2.9
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
@@ -176,6 +176,7 @@ class ChildThemeConfiguratorAdmin {
176
  }
177
 
178
  function load_config() {
 
179
  $this->css = new ChildThemeConfiguratorCSS();
180
  if ( FALSE !== $this->css->load_config() ):
181
  $this->debug( 'config exists', __FUNCTION__, __CLASS__, __CLASS__ );
@@ -225,7 +226,7 @@ class ChildThemeConfiguratorAdmin {
225
  *
226
  if ( $this->get( 'max_sel' ) ):
227
  $this->debug( 'Max selectors exceeded.', __FUNCTION__, __CLASS__, __CLASS__ );
228
- //$this->errors[] = __( 'Maximum number of styles exceeded.', 'child-theme-configurator' );
229
  add_action( 'chld_thm_cfg_admin_notices', array( $this, 'max_styles_notice' ) );
230
  endif;
231
  */
@@ -358,6 +359,7 @@ class ChildThemeConfiguratorAdmin {
358
  $path = ( preg_match( "/^[\.\/]/", $pathinfo[ 'dirname' ] ) ? '' : $pathinfo[ 'dirname' ] . '/' ) . $pathinfo[ 'filename' ];
359
  return array( $path, $pathinfo[ 'extension' ] );
360
  }
 
361
  /**
362
  * Handles processing for all form submissions.
363
  * Moved conditions to switch statement with the main setup logic in a separate function.
@@ -375,7 +377,10 @@ class ChildThemeConfiguratorAdmin {
375
  if ( empty( $actionfield ) ) return FALSE;
376
 
377
  // make sure post passes security checkpoint
378
- if ( $this->validate_post( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ) ):
 
 
 
379
  // reset debug log
380
  delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
381
  // handle uploaded file before checking filesystem
@@ -386,16 +391,16 @@ class ChildThemeConfiguratorAdmin {
386
  endif;
387
  // now we need to check filesystem access
388
  $args = preg_grep( "/nonce/", array_keys( $_POST ), PREG_GREP_INVERT );
 
389
  $this->verify_creds( $args );
390
  if ( $this->fs ):
391
- $msg = FALSE;
392
  // we have filesystem access so proceed with specific actions
393
  switch( $actionfield ):
394
  case 'export_child_zip':
395
  case 'export_theme':
396
  $this->export_theme();
397
  // if we get here the zip failed
398
- $this->errors[] = __( 'Zip file creation failed.', 'child-theme-configurator' );
399
  break;
400
  case 'load_styles':
401
  // main child theme setup function
@@ -420,8 +425,7 @@ class ChildThemeConfiguratorAdmin {
420
  foreach ( $_POST[ 'ctc_file_child' ] as $file ):
421
  list( $path, $ext ) = $this->get_pathinfo( sanitize_text_field( $file ) );
422
  if ( 'functions' == $path ):
423
- $this->errors[] =
424
- __( 'The Functions file is required and cannot be deleted.', 'child-theme-configurator' );
425
  continue;
426
  else:
427
  $this->delete_child_file( $path, $ext );
@@ -489,21 +493,19 @@ class ChildThemeConfiguratorAdmin {
489
  $msg = '8&tab=file_options';
490
  endswitch;
491
  endif; // end filesystem condition
492
- if ( empty( $this->errors ) && empty( $this->fs_prompt ) ):
493
- $this->processdone = TRUE;
494
- //die( '<pre><code><small>' . print_r( $_POST, TRUE ) . '</small></code></pre>' );
495
- // no errors so we redirect with confirmation message
496
- $this->update_redirect( $msg );
497
- endif;
498
- // otherwise fail gracefully
499
- $msg = NULL;
500
- return FALSE;
501
  endif; // end post validation condition
502
- // if you end up here you are persona non grata
503
- $msg = NULL;
504
- $this->errors[] = __( 'You do not have permission to configure child themes.', 'child-theme-configurator' );
 
 
 
 
 
 
 
505
  endif; // end request method condition
506
- return FALSE;
507
  }
508
 
509
  /**
@@ -533,25 +535,23 @@ class ChildThemeConfiguratorAdmin {
533
  // validate parent and child theme inputs
534
  if ( $parnt ):
535
  if ( ! $this->check_theme_exists( $parnt ) ):
536
- $this->errors[] = sprintf(
537
- __( '%s does not exist. Please select a valid Parent Theme.', 'child-theme-configurator' ), $parnt );
538
  endif;
539
  else:
540
- $this->errors[] = __( 'Please select a valid Parent Theme.', 'child-theme-configurator' );
541
  endif;
542
 
543
  // if this is reset, duplicate or existing, we must have a child theme
544
  if ( 'new' != $type && empty( $child ) ):
545
- $this->errors[] = __( 'Please select a valid Child Theme.', 'child-theme-configurator' );
546
  // if this is a new or duplicate child theme we must validate child theme directory
547
  elseif ( 'new' == $type || 'duplicate' == $type ):
548
  if ( empty( $template ) && empty( $name ) ):
549
- $this->errors[] = __( 'Please enter a valid Child Theme directory name.', 'child-theme-configurator' );
550
  else:
551
  $template_sanitized = preg_replace( "%[^\w\-]%", '', empty( $template ) ? $name : $template );
552
  if ( $this->check_theme_exists( $template_sanitized ) ):
553
- $this->errors[] = sprintf(
554
- __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.', 'child-theme-configurator' ), $template_sanitized );
555
  elseif ( 'duplicate' == $type ):
556
  // clone existing child theme
557
  $this->clone_child_theme( $child, $template_sanitized );
@@ -570,8 +570,7 @@ class ChildThemeConfiguratorAdmin {
570
  // verify_child_dir creates child theme directory if it doesn't exist.
571
  if ( FALSE === $this->verify_child_dir( $child ) ):
572
  // if it returns false then it could not create directory.
573
- $this->errors[] = __( 'Your theme directories are not writable.', 'child-theme-configurator' );
574
- add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
575
  return FALSE;
576
  endif;
577
 
@@ -651,7 +650,7 @@ class ChildThemeConfiguratorAdmin {
651
  $this->backup_or_restore_file( 'style.css', TRUE, 'ctc-genesis.css' ) ):
652
  $this->delete_child_file( 'ctc-genesis', 'css' );
653
  else:
654
- $this->errors[] = __( 'Could not upgrade child theme', 'child-theme-configurator' );
655
  endif;
656
  endif;
657
 
@@ -733,8 +732,7 @@ class ChildThemeConfiguratorAdmin {
733
  $this->debug( 'Writing new CSS...', __FUNCTION__, __CLASS__ );
734
  if ( FALSE === $this->css->write_css() ):
735
  //$this->debug( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ), __FUNCTION__, __CLASS__ );
736
- $this->errors[] = __( 'Your stylesheet is not writable.', 'child-theme-configurator' );
737
- add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
738
  return FALSE;
739
  endif;
740
  // get files to reload templates in new css object
@@ -772,7 +770,7 @@ class ChildThemeConfiguratorAdmin {
772
  $screen = get_current_screen()->id;
773
  wp_safe_redirect(
774
  ( strstr( $screen, '-network' ) ? network_admin_url( 'themes.php' ) : admin_url( 'tools.php' ) )
775
- . '?page=' . $ctcpage . ( $msg ? '&updated=' . $msg : '' ) );
776
  die();
777
  endif;
778
  }
@@ -887,6 +885,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
887
  . ' ignoreparnt: ' . $ignoreparnt . ' priority: ' . $priority . ' childtype: ' . $this->childtype, __FUNCTION__, __CLASS__ );
888
  // enqueue parent stylesheet
889
  if ( 'enqueue' == $enq && $hasstyles && !$parntloaded && !$ignoreparnt ):
 
 
890
  $code .= "
891
  if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
892
  function chld_thm_cfg_parent_css() {
@@ -924,17 +924,23 @@ add_action( 'wp_head', 'chld_thm_cfg_add_parent_dep', 2 );
924
  endif;
925
  endforeach;
926
  endif;
 
 
927
  // if child not loaded, enqueue it and add it to dependencies
928
  if ( 'separate' != $handling && ( ( $csswphead || $cssunreg || $cssnotheme )
929
  || ( 'new' != $this->childtype && !$childloaded )
930
  ) ):
931
  $deps = array_merge( $deps, $this->get( 'child_deps' ) );
 
 
932
  $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( " . implode( ',', $deps ) . " ) );";
933
  // if loading child theme stylesheet, reset deps and add child stylesheet
934
  $deps = array( "'chld_thm_cfg_child'" );
935
  endif;
936
  if ( 'separate' == $handling ):
937
  $deps = array_merge( $deps, $this->get( 'child_deps' ) );
 
 
938
  $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( " . implode( ',', $deps ) . " ) );";
939
  endif;
940
  if ( count( $enqueues ) ):
@@ -945,7 +951,7 @@ if ( !function_exists( 'child_theme_configurator_css' ) ):
945
  $code .= "
946
  }
947
  endif;
948
- add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css' );" . LF;
949
  endif;
950
  if ( $ignoreparnt )
951
  $code .= "
@@ -1064,7 +1070,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1064
  // verify there is no PHP close tag at end of file
1065
  if ( ! $phpopen ):
1066
  $this->debug( 'PHP not open', __FUNCTION__, __CLASS__ );
1067
- //$this->errors[] = __( 'A closing PHP tag was detected in Child theme functions file so "Parent Stylesheet Handling" option was not configured. Closing PHP at the end of the file is discouraged as it can cause premature HTTP headers. Please edit <code>functions.php</code> to remove the final <code>?&gt;</code> tag and click "Generate/Rebuild Child Theme Files" again.', 'child-theme-configurator' );
1068
  //return FALSE;
1069
  $newfile .= '<?php' . LF;
1070
  endif;
@@ -1136,6 +1142,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1136
  }
1137
 
1138
  function copy_parent_file( $file, $ext = 'php' ) {
 
1139
  if ( !$this->fs ):
1140
  $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
1141
  return FALSE; // return if no filesystem access
@@ -1144,17 +1151,22 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1144
  $parent_file = NULL;
1145
  if ( 'screenshot' == $file ):
1146
  foreach ( array_keys( $this->imgmimes ) as $extreg ):
1147
- foreach( explode( '|', $extreg ) as $ext ):
1148
- if ( $parent_file = $this->css->is_file_ok( $this->css->get_parent_source( 'screenshot.' . $ext ) ) ) break;
1149
- endforeach;
1150
  if ( $parent_file ):
1151
  $parent_file = $this->fspath( $parent_file );
1152
  break;
1153
  endif;
1154
  endforeach;
 
 
 
 
1155
  else:
1156
  $parent_file = $this->fspath( $this->css->is_file_ok( $this->css->get_parent_source( $file . '.' . $ext ) ) );
1157
  endif;
 
1158
  // get child theme + file + ext ( passing empty string and full child path to theme_basename )
1159
  $child_file = $this->css->get_child_target( $file . '.' . $ext );
1160
  // return true if file already exists
@@ -1168,7 +1180,8 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1168
  $this->debug( 'Filesystem copy successful', __FUNCTION__, __CLASS__ );
1169
  return TRUE;
1170
  endif;
1171
- $this->errors[] = __( 'Could not copy file:' . $parent_file, 'child-theme-configurator' );
 
1172
  }
1173
 
1174
  function delete_child_file( $file, $ext = 'php' ) {
@@ -1181,11 +1194,14 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1181
  $file = ( 'img' == $ext ? $file : $file . '.' . $ext );
1182
  if ( $child_file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
1183
  if ( $wp_filesystem->exists( $this->fspath( $child_file ) ) ):
 
1184
  if ( $wp_filesystem->delete( $this->fspath( $child_file ) ) ):
1185
  return TRUE;
1186
  else:
1187
- $this->errors[] = __( 'Could not delete ' . $ext . ' file.', 'child-theme-configurator' );
 
1188
  $this->debug( 'Could not delete ' . $ext . ' file', __FUNCTION__, __CLASS__ );
 
1189
  endif;
1190
  endif;
1191
  endif;
@@ -1315,10 +1331,10 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1315
  if ( $this->fs ): // filesystem access
1316
  if ( is_writable( $file ) ) return;
1317
  global $wp_filesystem;
1318
- if ( $file && $wp_filesystem->chmod( $this->fspath( $file ), 0666 ) ) return;
 
1319
  endif;
1320
- $this->errors[] = __( 'Could not set write permissions.', 'child-theme-configurator' );
1321
- add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
1322
  return FALSE;
1323
  }
1324
 
@@ -1341,10 +1357,10 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1341
  $this->debug( 'Verifying child dir... ', __FUNCTION__, __CLASS__ );
1342
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1343
  if ( is_file( $file ) && !@$wp_filesystem->copy( $childpath, $newpath ) ):
1344
- $errors[] = 'could not copy ' . $newpath;
1345
  endif;
1346
  else:
1347
- $errors[] = 'invalid dir: ' . $newfile;
1348
  endif;
1349
  endforeach;
1350
  }
@@ -1380,10 +1396,10 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1380
  $this->debug( 'Verifying child dir... ' . $file, __FUNCTION__, __CLASS__ );
1381
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1382
  if ( is_file( $file ) && !$wp_filesystem->copy( $childpath, $newpath ) ):
1383
- $errors[] = 'could not copy ' . $newpath;
1384
  endif;
1385
  else:
1386
- $errors[] = 'invalid dir: ' . $newfile;
1387
  endif;
1388
  else:
1389
  $wp_filesystem->chmod( $this->fspath( $file ) );
@@ -1411,15 +1427,14 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1411
  endif;
1412
  endforeach;
1413
  if ( $deletedfiles != count( $oldfiles ) ):
1414
- $errors[] = 'deleted: ' . $deletedfiles . ' != ' . count( $oldfiles ) . ' files';
1415
  endif;
1416
  else:
1417
- $errors[] = 'newfiles != files';
1418
  endif;
1419
  endif;
1420
  if ( count( $errors ) ):
1421
- $this->errors[] = __( 'There were errors while resetting permissions.', 'child-theme-configurator' ) ;
1422
- add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
1423
  endif;
1424
  }
1425
 
@@ -1433,10 +1448,11 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1433
  'test_form' => FALSE,
1434
  'mimes' => ( is_array( $mimes ) ? $mimes : NULL )
1435
  );
1436
- if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . 'wp-admin/includes/file.php' );
 
1437
  $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
1438
  if ( isset( $movefile[ 'error' ] ) ):
1439
- $this->errors[] = $movefile[ 'error' ];
1440
  return FALSE;
1441
  endif;
1442
  $_POST[ 'movefile' ] = $this->uploads_basename( $movefile[ 'file' ] );
@@ -1492,7 +1508,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1492
  $this->debug( 'Could not verify child dir', __FUNCTION__ );
1493
  endif;
1494
 
1495
- $this->errors[] = __( 'Could not upload file.', 'child-theme-configurator' );
1496
  }
1497
 
1498
  /**
@@ -1518,7 +1534,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1518
  return FALSE;
1519
  endif;
1520
  else:
1521
- $this->errors = __( 'Invalid theme root directory.', 'child-theme-configurator' );
1522
  endif;
1523
  }
1524
 
@@ -1530,7 +1546,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1530
  $uploads = wp_upload_dir();
1531
  $tmpdir = $uploads[ 'basedir' ];
1532
  if ( !is_writable( $tmpdir ) ):
1533
- $this->errors[] = __( 'No writable temp directory.', 'child-theme-configurator' );
1534
  return FALSE;
1535
  endif;
1536
  endif;
@@ -1560,7 +1576,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1560
  unlink( $file );
1561
  die();
1562
  else:
1563
- $this->errors[] = __( 'PclZip returned zero bytes.', 'child-theme-configurator' );
1564
  endif;
1565
  }
1566
  /*
@@ -1568,7 +1584,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1568
  */
1569
  function verify_creds( $args = array() ) {
1570
  $this->fs_prompt = $this->fs = FALSE;
1571
- //fs prompt does not support arrays as post data - serialize arrays
1572
  $this->serialize_postarrays();
1573
  // generate callback url
1574
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
@@ -1590,10 +1606,10 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1590
  WP_Filesystem();
1591
  endif;
1592
  // if form was generated, store it
1593
- $this->fs_prompt = ob_get_contents();
 
1594
  // now we can read/write if fs is TRUE otherwise fs_prompt will contain form
1595
- ob_end_clean();
1596
- //fs prompt does not support arrays as post data - unserialize arrays
1597
  $this->unserialize_postarrays();
1598
  }
1599
 
@@ -2067,21 +2083,27 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
2067
  if ( isset( $analysis->{ $baseline } ) ):
2068
  if ( isset( $analysis->{ $baseline }->deps ) ):
2069
  foreach ( $analysis->{ $baseline }->deps[ 0 ] as $deparray ):
 
 
 
2070
  if ( !in_array( $deparray[ 0 ], $unregs ) ):
2071
  $this->css->parnt_deps[] = $deparray[ 0 ];
2072
  endif;
2073
- if ( !preg_match( "/^style([\-\.]min)?\.css$/", $deparray[ 1 ] ) ):
2074
  // bootstrap wastes memory among other resources
2075
  //if ( !preg_match( "/bootstrap/i", $deparray[ 0 ] ) && !preg_match( "/bootstrap/i", $deparray[ 1 ] ) )
2076
  $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2077
  endif;
2078
  endforeach;
2079
  foreach ( $analysis->{ $baseline }->deps[ 1 ] as $deparray ):
 
 
 
2080
  if ( !in_array( $deparray[ 0 ], $unregs ) ):
2081
  $this->css->child_deps[] = $deparray[ 0 ];
2082
  endif;
2083
  if ( 'separate' == $this->get( 'handling' ) || !empty( $analysis->{ $baseline }->signals->ctc_child_loaded ) ):
2084
- if ( !preg_match( "/^style([\-\.]min)?\.css$/", $deparray[ 1 ] ) ):
2085
  //if ( !preg_match( "/bootstrap/", $deparray[ 0 ] ) && !preg_match( "/bootstrap/", $deparray[ 1 ] ) )
2086
  $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2087
  endif;
6
  Class: ChildThemeConfiguratorAdmin
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
+ Version: 2.3.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
176
  }
177
 
178
  function load_config() {
179
+
180
  $this->css = new ChildThemeConfiguratorCSS();
181
  if ( FALSE !== $this->css->load_config() ):
182
  $this->debug( 'config exists', __FUNCTION__, __CLASS__, __CLASS__ );
226
  *
227
  if ( $this->get( 'max_sel' ) ):
228
  $this->debug( 'Max selectors exceeded.', __FUNCTION__, __CLASS__, __CLASS__ );
229
+ //$this->errors[] = 26; //__( 'Maximum number of styles exceeded.', 'child-theme-configurator' );
230
  add_action( 'chld_thm_cfg_admin_notices', array( $this, 'max_styles_notice' ) );
231
  endif;
232
  */
359
  $path = ( preg_match( "/^[\.\/]/", $pathinfo[ 'dirname' ] ) ? '' : $pathinfo[ 'dirname' ] . '/' ) . $pathinfo[ 'filename' ];
360
  return array( $path, $pathinfo[ 'extension' ] );
361
  }
362
+
363
  /**
364
  * Handles processing for all form submissions.
365
  * Moved conditions to switch statement with the main setup logic in a separate function.
377
  if ( empty( $actionfield ) ) return FALSE;
378
 
379
  // make sure post passes security checkpoint
380
+ if ( !$this->validate_post( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ) ):
381
+ // if you end up here you are persona non grata
382
+ $this->errors[] = 2; //__( 'You do not have permission to configure child themes.', 'child-theme-configurator' );
383
+ else:
384
  // reset debug log
385
  delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
386
  // handle uploaded file before checking filesystem
391
  endif;
392
  // now we need to check filesystem access
393
  $args = preg_grep( "/nonce/", array_keys( $_POST ), PREG_GREP_INVERT );
394
+ $msg = FALSE;
395
  $this->verify_creds( $args );
396
  if ( $this->fs ):
 
397
  // we have filesystem access so proceed with specific actions
398
  switch( $actionfield ):
399
  case 'export_child_zip':
400
  case 'export_theme':
401
  $this->export_theme();
402
  // if we get here the zip failed
403
+ $this->errors[] = 1; //__( 'Zip file creation failed.', 'child-theme-configurator' );
404
  break;
405
  case 'load_styles':
406
  // main child theme setup function
425
  foreach ( $_POST[ 'ctc_file_child' ] as $file ):
426
  list( $path, $ext ) = $this->get_pathinfo( sanitize_text_field( $file ) );
427
  if ( 'functions' == $path ):
428
+ $this->errors[] = 4; // __( 'The Functions file is required and cannot be deleted.', 'child-theme-configurator' );
 
429
  continue;
430
  else:
431
  $this->delete_child_file( $path, $ext );
493
  $msg = '8&tab=file_options';
494
  endswitch;
495
  endif; // end filesystem condition
 
 
 
 
 
 
 
 
 
496
  endif; // end post validation condition
497
+ // if we have errors, redirect failure
498
+ if ( $this->errors ):
499
+ $this->update_redirect( 0 );
500
+ // if we have filesystem access, redirect successful
501
+ elseif ( empty( $this->fs_prompt ) ):
502
+ $this->processdone = TRUE;
503
+ //die( '<pre><code><small>' . print_r( $_POST, TRUE ) . '</small></code></pre>' );
504
+ // no errors so we redirect with confirmation message
505
+ $this->update_redirect( $msg );
506
+ endif;
507
  endif; // end request method condition
508
+ // if we are here, then this is either a get request or we need filesystem access
509
  }
510
 
511
  /**
535
  // validate parent and child theme inputs
536
  if ( $parnt ):
537
  if ( ! $this->check_theme_exists( $parnt ) ):
538
+ $this->errors[] = '3:' . $parnt; //sprintf( __( '%s does not exist. Please select a valid Parent Theme.', 'child-theme-configurator' ), $parnt );
 
539
  endif;
540
  else:
541
+ $this->errors[] = 5; // __( 'Please select a valid Parent Theme.', 'child-theme-configurator' );
542
  endif;
543
 
544
  // if this is reset, duplicate or existing, we must have a child theme
545
  if ( 'new' != $type && empty( $child ) ):
546
+ $this->errors[] = 6; //__( 'Please select a valid Child Theme.', 'child-theme-configurator' );
547
  // if this is a new or duplicate child theme we must validate child theme directory
548
  elseif ( 'new' == $type || 'duplicate' == $type ):
549
  if ( empty( $template ) && empty( $name ) ):
550
+ $this->errors[] = 7; // __( 'Please enter a valid Child Theme directory name.', 'child-theme-configurator' );
551
  else:
552
  $template_sanitized = preg_replace( "%[^\w\-]%", '', empty( $template ) ? $name : $template );
553
  if ( $this->check_theme_exists( $template_sanitized ) ):
554
+ $this->errors[] = '8:' . $template_sanitized; //sprintf( __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.', 'child-theme-configurator' ), $template_sanitized );
 
555
  elseif ( 'duplicate' == $type ):
556
  // clone existing child theme
557
  $this->clone_child_theme( $child, $template_sanitized );
570
  // verify_child_dir creates child theme directory if it doesn't exist.
571
  if ( FALSE === $this->verify_child_dir( $child ) ):
572
  // if it returns false then it could not create directory.
573
+ $this->errors[] = 9; //__( 'Your theme directories are not writable.', 'child-theme-configurator' );
 
574
  return FALSE;
575
  endif;
576
 
650
  $this->backup_or_restore_file( 'style.css', TRUE, 'ctc-genesis.css' ) ):
651
  $this->delete_child_file( 'ctc-genesis', 'css' );
652
  else:
653
+ $this->errors[] = 10; //__( 'Could not upgrade child theme', 'child-theme-configurator' );
654
  endif;
655
  endif;
656
 
732
  $this->debug( 'Writing new CSS...', __FUNCTION__, __CLASS__ );
733
  if ( FALSE === $this->css->write_css() ):
734
  //$this->debug( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ), __FUNCTION__, __CLASS__ );
735
+ $this->errors[] = 11; //__( 'Your stylesheet is not writable.', 'child-theme-configurator' );
 
736
  return FALSE;
737
  endif;
738
  // get files to reload templates in new css object
770
  $screen = get_current_screen()->id;
771
  wp_safe_redirect(
772
  ( strstr( $screen, '-network' ) ? network_admin_url( 'themes.php' ) : admin_url( 'tools.php' ) )
773
+ . '?page=' . $ctcpage . ( $msg ? '&updated=' . $msg : ( $this->errors ? '&error=' . implode( ',', $this->errors ) : '' ) ) );
774
  die();
775
  endif;
776
  }
885
  . ' ignoreparnt: ' . $ignoreparnt . ' priority: ' . $priority . ' childtype: ' . $this->childtype, __FUNCTION__, __CLASS__ );
886
  // enqueue parent stylesheet
887
  if ( 'enqueue' == $enq && $hasstyles && !$parntloaded && !$ignoreparnt ):
888
+ // Sanity check: remove dependency to parent css handle to avoid loop v2.3.0
889
+ $deps = array_diff( $deps, array( 'chld_thm_cfg_parent' ) );
890
  $code .= "
891
  if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
892
  function chld_thm_cfg_parent_css() {
924
  endif;
925
  endforeach;
926
  endif;
927
+
928
+
929
  // if child not loaded, enqueue it and add it to dependencies
930
  if ( 'separate' != $handling && ( ( $csswphead || $cssunreg || $cssnotheme )
931
  || ( 'new' != $this->childtype && !$childloaded )
932
  ) ):
933
  $deps = array_merge( $deps, $this->get( 'child_deps' ) );
934
+ // Sanity check: remove dependency to child css handle to avoid loop v2.3.0
935
+ $deps = array_diff( $deps, array( 'chld_thm_cfg_child' ) );
936
  $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( " . implode( ',', $deps ) . " ) );";
937
  // if loading child theme stylesheet, reset deps and add child stylesheet
938
  $deps = array( "'chld_thm_cfg_child'" );
939
  endif;
940
  if ( 'separate' == $handling ):
941
  $deps = array_merge( $deps, $this->get( 'child_deps' ) );
942
+ // Sanity check: remove dependency to separate css handle to avoid loop v2.3.0
943
+ $deps = array_diff( $deps, array( 'chld_thm_cfg_separate' ) );
944
  $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( " . implode( ',', $deps ) . " ) );";
945
  endif;
946
  if ( count( $enqueues ) ):
951
  $code .= "
952
  }
953
  endif;
954
+ add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', " . ( $priority + 10 ) . " );" . LF;
955
  endif;
956
  if ( $ignoreparnt )
957
  $code .= "
1070
  // verify there is no PHP close tag at end of file
1071
  if ( ! $phpopen ):
1072
  $this->debug( 'PHP not open', __FUNCTION__, __CLASS__ );
1073
+ //$this->errors[] = 12 //__( 'A closing PHP tag was detected in Child theme functions file so "Parent Stylesheet Handling" option was not configured. Closing PHP at the end of the file is discouraged as it can cause premature HTTP headers. Please edit <code>functions.php</code> to remove the final <code>?&gt;</code> tag and click "Generate/Rebuild Child Theme Files" again.', 'child-theme-configurator' );
1074
  //return FALSE;
1075
  $newfile .= '<?php' . LF;
1076
  endif;
1142
  }
1143
 
1144
  function copy_parent_file( $file, $ext = 'php' ) {
1145
+
1146
  if ( !$this->fs ):
1147
  $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
1148
  return FALSE; // return if no filesystem access
1151
  $parent_file = NULL;
1152
  if ( 'screenshot' == $file ):
1153
  foreach ( array_keys( $this->imgmimes ) as $extreg ):
1154
+ foreach( explode( '|', $extreg ) as $ext )
1155
+ if ( !( $parent_file = $this->css->is_file_ok( $this->css->get_parent_source( 'screenshot.' . $ext ) ) ) )
1156
+ continue;
1157
  if ( $parent_file ):
1158
  $parent_file = $this->fspath( $parent_file );
1159
  break;
1160
  endif;
1161
  endforeach;
1162
+ if ( !$parent_file ):
1163
+ $this->debug( 'No screenshot found.', __FUNCTION__, __CLASS__ );
1164
+ return;
1165
+ endif;
1166
  else:
1167
  $parent_file = $this->fspath( $this->css->is_file_ok( $this->css->get_parent_source( $file . '.' . $ext ) ) );
1168
  endif;
1169
+
1170
  // get child theme + file + ext ( passing empty string and full child path to theme_basename )
1171
  $child_file = $this->css->get_child_target( $file . '.' . $ext );
1172
  // return true if file already exists
1180
  $this->debug( 'Filesystem copy successful', __FUNCTION__, __CLASS__ );
1181
  return TRUE;
1182
  endif;
1183
+
1184
+ $this->errors[] = '13:' . $parent_file; //__( 'Could not copy file:' . $parent_file, 'child-theme-configurator' );
1185
  }
1186
 
1187
  function delete_child_file( $file, $ext = 'php' ) {
1194
  $file = ( 'img' == $ext ? $file : $file . '.' . $ext );
1195
  if ( $child_file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
1196
  if ( $wp_filesystem->exists( $this->fspath( $child_file ) ) ):
1197
+
1198
  if ( $wp_filesystem->delete( $this->fspath( $child_file ) ) ):
1199
  return TRUE;
1200
  else:
1201
+
1202
+ $this->errors[] = '14:' . $ext; //__( 'Could not delete ' . $ext . ' file.', 'child-theme-configurator' );
1203
  $this->debug( 'Could not delete ' . $ext . ' file', __FUNCTION__, __CLASS__ );
1204
+
1205
  endif;
1206
  endif;
1207
  endif;
1331
  if ( $this->fs ): // filesystem access
1332
  if ( is_writable( $file ) ) return;
1333
  global $wp_filesystem;
1334
+ if ( $file && $wp_filesystem->chmod( $this->fspath( $file ), 0666 ) )
1335
+ return;
1336
  endif;
1337
+ $this->errors[] = 28; //__( 'Could not set write permissions.', 'child-theme-configurator' );
 
1338
  return FALSE;
1339
  }
1340
 
1357
  $this->debug( 'Verifying child dir... ', __FUNCTION__, __CLASS__ );
1358
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1359
  if ( is_file( $file ) && !@$wp_filesystem->copy( $childpath, $newpath ) ):
1360
+ $this->errors[] = '15:' . $newpath; //'could not copy ' . $newpath;
1361
  endif;
1362
  else:
1363
+ $this->errors[] = '16:' . $newfile; //'invalid dir: ' . $newfile;
1364
  endif;
1365
  endforeach;
1366
  }
1396
  $this->debug( 'Verifying child dir... ' . $file, __FUNCTION__, __CLASS__ );
1397
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1398
  if ( is_file( $file ) && !$wp_filesystem->copy( $childpath, $newpath ) ):
1399
+ $errors[] = '15:' . $newpath; //'could not copy ' . $newpath;
1400
  endif;
1401
  else:
1402
+ $errors[] = '16:' . $newfile; //'invalid dir: ' . $newfile;
1403
  endif;
1404
  else:
1405
  $wp_filesystem->chmod( $this->fspath( $file ) );
1427
  endif;
1428
  endforeach;
1429
  if ( $deletedfiles != count( $oldfiles ) ):
1430
+ $errors[] = '17:' . $deletedfiles . ':' . count( $oldfiles ); //'deleted: ' . $deletedfiles . ' != ' . count( $oldfiles ) . ' files';
1431
  endif;
1432
  else:
1433
+ $errors[] = 18; //'newfiles != files';
1434
  endif;
1435
  endif;
1436
  if ( count( $errors ) ):
1437
+ $this->errors[] = 19; //__( 'There were errors while resetting permissions.', 'child-theme-configurator' ) ;
 
1438
  endif;
1439
  }
1440
 
1448
  'test_form' => FALSE,
1449
  'mimes' => ( is_array( $mimes ) ? $mimes : NULL )
1450
  );
1451
+ if ( ! function_exists( 'wp_handle_upload' ) )
1452
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
1453
  $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
1454
  if ( isset( $movefile[ 'error' ] ) ):
1455
+ $this->errors[] = '27:' . $movefile[ 'error' ];
1456
  return FALSE;
1457
  endif;
1458
  $_POST[ 'movefile' ] = $this->uploads_basename( $movefile[ 'file' ] );
1508
  $this->debug( 'Could not verify child dir', __FUNCTION__ );
1509
  endif;
1510
 
1511
+ $this->errors[] = 20; //__( 'Could not upload file.', 'child-theme-configurator' );
1512
  }
1513
 
1514
  /**
1534
  return FALSE;
1535
  endif;
1536
  else:
1537
+ $this->errors[] = 21; //__( 'Invalid theme root directory.', 'child-theme-configurator' );
1538
  endif;
1539
  }
1540
 
1546
  $uploads = wp_upload_dir();
1547
  $tmpdir = $uploads[ 'basedir' ];
1548
  if ( !is_writable( $tmpdir ) ):
1549
+ $this->errors[] = 22; //__( 'No writable temp directory.', 'child-theme-configurator' );
1550
  return FALSE;
1551
  endif;
1552
  endif;
1576
  unlink( $file );
1577
  die();
1578
  else:
1579
+ $this->errors[] = 23; //__( 'PclZip returned zero bytes.', 'child-theme-configurator' );
1580
  endif;
1581
  }
1582
  /*
1584
  */
1585
  function verify_creds( $args = array() ) {
1586
  $this->fs_prompt = $this->fs = FALSE;
1587
+ // fs prompt does not support arrays as post data - serialize arrays
1588
  $this->serialize_postarrays();
1589
  // generate callback url
1590
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
1606
  WP_Filesystem();
1607
  endif;
1608
  // if form was generated, store it
1609
+ $this->fs_prompt = ob_get_clean();
1610
+ $this->debug( 'FS: ' . $this->fs . ' PROMPT: ' . $this->fs_prompt, __FUNCTION__, __CLASS__ );
1611
  // now we can read/write if fs is TRUE otherwise fs_prompt will contain form
1612
+ // fs prompt does not support arrays as post data - unserialize arrays
 
1613
  $this->unserialize_postarrays();
1614
  }
1615
 
2083
  if ( isset( $analysis->{ $baseline } ) ):
2084
  if ( isset( $analysis->{ $baseline }->deps ) ):
2085
  foreach ( $analysis->{ $baseline }->deps[ 0 ] as $deparray ):
2086
+ // avoid endless loop from renamed parent link (e.g., WP Rocket)
2087
+ if ( 'chld_thm_cfg_parent' == $deparray[ 0 ] )
2088
+ continue;
2089
  if ( !in_array( $deparray[ 0 ], $unregs ) ):
2090
  $this->css->parnt_deps[] = $deparray[ 0 ];
2091
  endif;
2092
+ if ( !preg_match( "/^style.*?\.css$/", $deparray[ 1 ] ) ):
2093
  // bootstrap wastes memory among other resources
2094
  //if ( !preg_match( "/bootstrap/i", $deparray[ 0 ] ) && !preg_match( "/bootstrap/i", $deparray[ 1 ] ) )
2095
  $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2096
  endif;
2097
  endforeach;
2098
  foreach ( $analysis->{ $baseline }->deps[ 1 ] as $deparray ):
2099
+ // avoid endless loop from renamed child link
2100
+ if ( 'chld_thm_cfg_child' == $deparray[ 0 ] )
2101
+ continue;
2102
  if ( !in_array( $deparray[ 0 ], $unregs ) ):
2103
  $this->css->child_deps[] = $deparray[ 0 ];
2104
  endif;
2105
  if ( 'separate' == $this->get( 'handling' ) || !empty( $analysis->{ $baseline }->signals->ctc_child_loaded ) ):
2106
+ if ( !preg_match( "/^style.*?\.css$/", $deparray[ 1 ] ) ):
2107
  //if ( !preg_match( "/bootstrap/", $deparray[ 0 ] ) && !preg_match( "/bootstrap/", $deparray[ 1 ] ) )
2108
  $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2109
  endif;
includes/classes/CSS.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
- Version: 2.2.9
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -167,7 +167,7 @@ class ChildThemeConfiguratorCSS {
167
  $this->parnt = '';
168
  $this->ignoreparnt = 0;
169
  $this->qpriority = 10;
170
- $this->version = '2.2.9';
171
 
172
  // do not set enqueue, not being set is used to flag old versions
173
 
@@ -435,6 +435,7 @@ class ChildThemeConfiguratorCSS {
435
  $arr[] = "'" . str_replace("'", "\'", $el ) . "'";
436
  return $arr;
437
  }
 
438
  // creates header comments for stylesheet
439
  function get_css_header() {
440
  return array(
@@ -449,6 +450,7 @@ class ChildThemeConfiguratorCSS {
449
  'Updated' => current_time( 'mysql' ),
450
  );
451
  }
 
452
  function get_css_header_comment( $handling = 'primary' ) {
453
  if ( 'separate' == $handling ):
454
  $contents = "/*" . LF
@@ -539,7 +541,7 @@ class ChildThemeConfiguratorCSS {
539
  $this->packer->reset( $this->packer->decode( $this->val_ndx[ $qsid ] ) );
540
  return $this->packer->unpack();
541
  } catch ( Exception $e ){
542
- $this->ctc()->errors[] = 'Unpack failed -- ' . $e->getMessage();
543
  return FALSE;
544
  }
545
  endif;
@@ -550,7 +552,7 @@ class ChildThemeConfiguratorCSS {
550
  try {
551
  $this->val_ndx[ $qsid ] = $this->packer->encode( $this->packer->pack( $valarr ) );
552
  } catch ( Exception $e ){
553
- $this->ctc()->errors[] = 'Pack failed -- ' . $e->getMessage();
554
  }
555
  }
556
 
@@ -777,6 +779,7 @@ class ChildThemeConfiguratorCSS {
777
  $this->load_config( 'dict_seq' );
778
  $this->load_config( 'dict_qs' );
779
  $this->cache_updates = TRUE;
 
780
  if ( isset( $_POST[ 'ctc_new_selectors' ] ) ):
781
  $this->styles = $this->parse_css_input( LF . $_POST[ 'ctc_new_selectors' ] );
782
  $this->parse_css( 'child',
@@ -785,11 +788,12 @@ class ChildThemeConfiguratorCSS {
785
  '',
786
  TRUE
787
  );
 
788
  elseif ( isset( $_POST[ 'ctc_child_imports' ] ) ):
789
  $this->imports[ 'child' ] = array();
790
  $this->styles = $this->parse_css_input( $_POST[ 'ctc_child_imports' ] );
791
  $this->parse_css( 'child' );
792
-
793
  elseif ( isset( $_POST[ 'ctc_analysis' ] ) ):
794
 
795
  if ( $this->ctc()->cache_updates ):
@@ -800,7 +804,7 @@ class ChildThemeConfiguratorCSS {
800
  endif;
801
 
802
  $this->ctc()->evaluate_signals( $this->get_prop( 'ignoreparnt' ) );
803
-
804
  elseif ( isset( $_POST[ 'ctc_configtype' ] ) ):
805
  ob_start();
806
  do_action( 'chld_thm_cfg_get_stylesheets' );
@@ -819,10 +823,15 @@ class ChildThemeConfiguratorCSS {
819
  );
820
  ob_end_clean();
821
  return;
 
822
  else:
 
 
 
823
  $newselector = isset( $_POST[ 'ctc_rewrite_selector' ] ) ?
824
  $this->sanitize( $this->parse_css_input( $_POST[ 'ctc_rewrite_selector' ] ) ) : NULL;
825
  $newqsid = NULL;
 
826
  // set the custom sequence value
827
  foreach ( preg_grep( '#^ctc_ovrd_child_seq_#', array_keys( $_POST ) ) as $post_key ):
828
  if ( preg_match( '#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches ) ):
@@ -836,66 +845,48 @@ class ChildThemeConfiguratorCSS {
836
  endif;
837
  endif;
838
  endforeach;
 
 
839
  $parts = array();
840
  foreach ( preg_grep( '#^ctc_(ovrd|\d+)_child#', array_keys( $_POST ) ) as $post_key ):
 
 
841
  if ( preg_match( '#^ctc_(ovrd|\d+)_child_([\w\-]+?)_(\d+?)_(\d+?)(_(.+))?$#', $post_key, $matches ) ):
842
- $valid = $matches[ 1 ];
843
- $rule = $matches[ 2 ];
844
  if ( NULL == $rule || FALSE === $this->lookup_dict_value( 'rule', $rule ) )
845
  continue;
846
- $qsid = $matches[ 3 ];
847
- $rulevalid = $matches[ 4 ];
 
848
  $value = $this->normalize_color( $this->sanitize( $this->parse_css_input( $_POST[ $post_key ] ) ) );
849
- $important = $this->is_important( $value );
 
 
850
  if ( !empty( $_POST[ 'ctc_' . $valid . '_child_' . $rule . '_i_' . $qsid . '_' . $rulevalid ] ) ) $important = 1;
 
 
851
  $selarr = $this->denorm_query_sel( $qsid );
852
  if ( empty( $selarr ) ) continue;
 
 
853
  if ( !empty( $matches[ 6 ] ) ):
854
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ $matches[ 6 ] ] = $value;
855
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ 'important' ] = $important;
856
- $parts[ $qsid ][ $rule ][ 'query' ] = $selarr[ 'query' ];
857
- $parts[ $qsid ][ $rule ][ 'selector' ] = $selarr[ 'selector' ];
858
- //$this->ctc()->debug( 'value: ' . $value . ' parts: ' . print_r( $parts, TRUE ), __FUNCTION__, __CLASS__ );
859
  else:
860
- if ( $newselector && $newselector != $selarr[ 'selector' ] ):
861
- // If this is a renamed selector, add new selector to array
862
- $newqsid = $this->update_arrays(
863
- 'c',
864
- $selarr[ 'query' ],
865
- $newselector,
866
- $rule,
867
- trim( $value ),
868
- $important,
869
- $rulevalid
870
- );
871
- // clear the original selector's new value:
872
- $this->update_arrays(
873
- 'c',
874
- $selarr[ 'query' ],
875
- $selarr[ 'selector' ],
876
- $rule,
877
- '',
878
- 0,
879
- $rulevalid
880
- );
881
- $seq = $this->get_dict_value( 'seq', $qsid );
882
- if ( $seq != $newqsid ):
883
- $this->set_dict_value( 'seq', $newqsid, $seq );
884
- else:
885
- unset( $this->dict_seq[ $newqsid ] );
886
- endif;
887
- else:
888
- // otherwise, just update with the new values:
889
- $this->update_arrays(
890
- 'c',
891
- $selarr[ 'query' ],
892
- $selarr[ 'selector' ],
893
- $rule,
894
- trim( $value ),
895
- $important,
896
- $rulevalid
897
- );
898
- endif;
899
  endif;
900
  endif;
901
  endforeach;
@@ -943,49 +934,27 @@ class ChildThemeConfiguratorCSS {
943
  $value = '';
944
  endif;
945
 
946
- //$this->ctc()->debug( 'modified value: ' . $value, __FUNCTION__, __CLASS__ );
947
- if ( $newselector && $newselector != $rule_arr[ 'selector' ] ):
948
- // If this is a renamed selector, add new selector to array
949
- $newqsid = $this->update_arrays(
950
- 'c',
951
- $rule_arr[ 'query' ],
952
- $newselector,
953
- $rule,
954
- trim( $value ),
955
- $rule_part[ 'important' ],
956
- $rulevalid
957
- );
958
- // clear the original selector's new value:
959
- $this->update_arrays(
960
- 'c',
961
- $rule_arr[ 'query' ],
962
- $rule_arr[ 'selector' ],
963
- $rule,
964
- '',
965
- 0,
966
- $rulevalid
967
- );
968
- else:
969
- // otherwise, just update with the new values:
970
- $this->update_arrays(
971
- 'c',
972
- $rule_arr[ 'query' ],
973
- $rule_arr[ 'selector' ],
974
- $rule,
975
- trim( $value ),
976
- $rule_part[ 'important' ],
977
- $rulevalid
978
- );
979
- endif;
980
  endforeach;
981
  endforeach;
982
  endforeach;
983
- if ( $newqsid )
984
- $qsid = $newqsid;
985
 
986
  // remove if all values have been cleared - moved from update_arrays v2.2.5
987
  $this->prune_if_empty( $qsid );
988
 
 
 
 
989
  // return updated qsid to browser to update form
990
  if ( $this->ctc()->cache_updates )
991
  $this->ctc()->updates[] = array(
@@ -1002,6 +971,50 @@ class ChildThemeConfiguratorCSS {
1002
  add_action( 'chld_thm_cfg_addl_files', array( $this->ctc(), 'enqueue_parent_css' ), 15, 2 );
1003
  }
1004
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1005
  /**
1006
  * parse_css_input
1007
  * Normalize raw user CSS input so that the parser can read it.
@@ -1094,6 +1107,7 @@ class ChildThemeConfiguratorCSS {
1094
  * parse_css
1095
  * Accepts raw CSS as text and parses into individual properties.
1096
  * FIXME - this function has grown too monolithic - refactor and componentize
 
1097
  */
1098
  function parse_css( $template, $basequery = NULL, $parse_imports = TRUE, $relpath = '', $reset = FALSE ) {
1099
  //$this->load_config( 'sel_ndx' );
@@ -2129,7 +2143,7 @@ class ChildThemeConfiguratorCSS {
2129
  try {
2130
  return $this->packer->encode( $this->packer->pack( $array ) );
2131
  } catch ( Exception $e ) {
2132
- $this->ctc()->errors[] = 'Pack failed -- ' . $e->getMessage();
2133
  }
2134
  }
2135
 
@@ -2144,7 +2158,8 @@ class ChildThemeConfiguratorCSS {
2144
  $this->packer->reset( $this->packer->decode( $packed ) );
2145
  $array = $this->packer->unpack();
2146
  } catch ( Exception $e ) {
2147
- $this->ctc()->errors[] = 'Unpack failed -- ' . $e->getMessage();
 
2148
  }
2149
  $unpacked = array();
2150
  // iterate array and replace tokens
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
+ Version: 2.3.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
167
  $this->parnt = '';
168
  $this->ignoreparnt = 0;
169
  $this->qpriority = 10;
170
+ $this->version = '2.3.0';
171
 
172
  // do not set enqueue, not being set is used to flag old versions
173
 
435
  $arr[] = "'" . str_replace("'", "\'", $el ) . "'";
436
  return $arr;
437
  }
438
+
439
  // creates header comments for stylesheet
440
  function get_css_header() {
441
  return array(
450
  'Updated' => current_time( 'mysql' ),
451
  );
452
  }
453
+
454
  function get_css_header_comment( $handling = 'primary' ) {
455
  if ( 'separate' == $handling ):
456
  $contents = "/*" . LF
541
  $this->packer->reset( $this->packer->decode( $this->val_ndx[ $qsid ] ) );
542
  return $this->packer->unpack();
543
  } catch ( Exception $e ){
544
+ $this->ctc()->debug( 'Unpack failed -- ' . $e->getMessage(), __FUNCTION__, __CLASS__ );
545
  return FALSE;
546
  }
547
  endif;
552
  try {
553
  $this->val_ndx[ $qsid ] = $this->packer->encode( $this->packer->pack( $valarr ) );
554
  } catch ( Exception $e ){
555
+ $this->ctc()->debug( 'Pack failed -- ' . $e->getMessage(), __FUNCTION__, __CLASS__ );
556
  }
557
  }
558
 
779
  $this->load_config( 'dict_seq' );
780
  $this->load_config( 'dict_qs' );
781
  $this->cache_updates = TRUE;
782
+ // process RAW CSS input
783
  if ( isset( $_POST[ 'ctc_new_selectors' ] ) ):
784
  $this->styles = $this->parse_css_input( LF . $_POST[ 'ctc_new_selectors' ] );
785
  $this->parse_css( 'child',
788
  '',
789
  TRUE
790
  );
791
+ // process WEB FONTS & CSS inputs
792
  elseif ( isset( $_POST[ 'ctc_child_imports' ] ) ):
793
  $this->imports[ 'child' ] = array();
794
  $this->styles = $this->parse_css_input( $_POST[ 'ctc_child_imports' ] );
795
  $this->parse_css( 'child' );
796
+ // process ANALYZER SIGNAL inputs
797
  elseif ( isset( $_POST[ 'ctc_analysis' ] ) ):
798
 
799
  if ( $this->ctc()->cache_updates ):
804
  endif;
805
 
806
  $this->ctc()->evaluate_signals( $this->get_prop( 'ignoreparnt' ) );
807
+ // process CONFIGURE inputs
808
  elseif ( isset( $_POST[ 'ctc_configtype' ] ) ):
809
  ob_start();
810
  do_action( 'chld_thm_cfg_get_stylesheets' );
823
  );
824
  ob_end_clean();
825
  return;
826
+ // process SAVE inputs
827
  else:
828
+ // New query added v2.3.0
829
+ $newquery = isset( $_POST[ 'ctc_rewrite_query' ] ) ?
830
+ $this->sanitize( $this->parse_css_input( $_POST[ 'ctc_rewrite_query' ] ) ) : NULL;
831
  $newselector = isset( $_POST[ 'ctc_rewrite_selector' ] ) ?
832
  $this->sanitize( $this->parse_css_input( $_POST[ 'ctc_rewrite_selector' ] ) ) : NULL;
833
  $newqsid = NULL;
834
+
835
  // set the custom sequence value
836
  foreach ( preg_grep( '#^ctc_ovrd_child_seq_#', array_keys( $_POST ) ) as $post_key ):
837
  if ( preg_match( '#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches ) ):
845
  endif;
846
  endif;
847
  endforeach;
848
+
849
+ // iterate each property input
850
  $parts = array();
851
  foreach ( preg_grep( '#^ctc_(ovrd|\d+)_child#', array_keys( $_POST ) ) as $post_key ):
852
+
853
+ // parse input key into individual components if it matches specific format, skip otherwise
854
  if ( preg_match( '#^ctc_(ovrd|\d+)_child_([\w\-]+?)_(\d+?)_(\d+?)(_(.+))?$#', $post_key, $matches ) ):
855
+ $valid = $matches[ 1 ]; // this is used for inputs from property value tab
856
+ $rule = $matches[ 2 ]; // property name
857
  if ( NULL == $rule || FALSE === $this->lookup_dict_value( 'rule', $rule ) )
858
  continue;
859
+ $qsid = $matches[ 3 ]; // query/selector id
860
+ $rulevalid = $matches[ 4 ]; // id to identify multiple values of same property
861
+ // normalize input value
862
  $value = $this->normalize_color( $this->sanitize( $this->parse_css_input( $_POST[ $post_key ] ) ) );
863
+ // set important flag
864
+ $important = $this->is_important( $value ); // strip and set if !important passed in input
865
+ // set important if checkbox input is set
866
  if ( !empty( $_POST[ 'ctc_' . $valid . '_child_' . $rule . '_i_' . $qsid . '_' . $rulevalid ] ) ) $important = 1;
867
+
868
+ // get current values from query/selector id if it exists, skip this property otherwise
869
  $selarr = $this->denorm_query_sel( $qsid );
870
  if ( empty( $selarr ) ) continue;
871
+
872
+ // if there is a "rule-part" (e.g., border or gradient properties ), store in parts array and process separately.
873
  if ( !empty( $matches[ 6 ] ) ):
874
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ $matches[ 6 ] ] = $value;
875
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ 'important' ] = $important;
876
+ $parts[ $qsid ][ $rule ][ 'query' ] = $selarr[ 'query' ];
877
+ $parts[ $qsid ][ $rule ][ 'selector' ] = $selarr[ 'selector' ];
878
+ // otherwise process this property
879
  else:
880
+ $newqsid = $this->update_property(
881
+ $newquery,
882
+ $newselector,
883
+ $selarr[ 'query' ],
884
+ $selarr[ 'selector' ],
885
+ $rule,
886
+ $value,
887
+ $important,
888
+ $rulevalid
889
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
  endif;
891
  endif;
892
  endforeach;
934
  $value = '';
935
  endif;
936
 
937
+ $newqsid = $this->update_property(
938
+ $newquery,
939
+ $newselector,
940
+ $rule_arr[ 'query' ],
941
+ $rule_arr[ 'selector' ],
942
+ $rule,
943
+ $value,
944
+ $rule_part[ 'important' ],
945
+ $rulevalid
946
+ );
947
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
948
  endforeach;
949
  endforeach;
950
  endforeach;
 
 
951
 
952
  // remove if all values have been cleared - moved from update_arrays v2.2.5
953
  $this->prune_if_empty( $qsid );
954
 
955
+ if ( $newqsid != $qsid )
956
+ $qsid = $newqsid;
957
+
958
  // return updated qsid to browser to update form
959
  if ( $this->ctc()->cache_updates )
960
  $this->ctc()->updates[] = array(
971
  add_action( 'chld_thm_cfg_addl_files', array( $this->ctc(), 'enqueue_parent_css' ), 15, 2 );
972
  }
973
 
974
+ /**
975
+ * standarized property update function
976
+ * added v2.3.0
977
+ */
978
+ function update_property(
979
+ $newquery,
980
+ $newselector,
981
+ $query,
982
+ $selector,
983
+ $rule,
984
+ $value,
985
+ $important,
986
+ $rulevalid
987
+ ){
988
+ // If this is a renamed selector, add new selector to data
989
+ // otherwise update existing selector
990
+ $newqsid = $this->update_arrays(
991
+ 'c',
992
+ $newquery ? $newquery : $query,
993
+ $newselector ? $newselector : $selector,
994
+ $rule,
995
+ trim( $value ),
996
+ $important,
997
+ $rulevalid
998
+ );
999
+ // if query or selector have been renamed,
1000
+ // clear the original selector's value:
1001
+ if ( $newquery || $newselector ):
1002
+ $qsid = $this->update_arrays(
1003
+ 'c',
1004
+ $query,
1005
+ $selector,
1006
+ $rule,
1007
+ '',
1008
+ 0,
1009
+ $rulevalid
1010
+ );
1011
+ // add new sequence entry
1012
+ $seq = $this->get_dict_value( 'seq', $qsid );
1013
+ $this->set_dict_value( 'seq', $newqsid, $seq );
1014
+ endif;
1015
+ return $newqsid;
1016
+ }
1017
+
1018
  /**
1019
  * parse_css_input
1020
  * Normalize raw user CSS input so that the parser can read it.
1107
  * parse_css
1108
  * Accepts raw CSS as text and parses into individual properties.
1109
  * FIXME - this function has grown too monolithic - refactor and componentize
1110
+ * FIXME - migrate to event parser? handle comments?
1111
  */
1112
  function parse_css( $template, $basequery = NULL, $parse_imports = TRUE, $relpath = '', $reset = FALSE ) {
1113
  //$this->load_config( 'sel_ndx' );
2143
  try {
2144
  return $this->packer->encode( $this->packer->pack( $array ) );
2145
  } catch ( Exception $e ) {
2146
+ $this->ctc()->debug( 'Pack failed -- ' . $e->getMessage(), __FUNCTION__, __CLASS__ );
2147
  }
2148
  }
2149
 
2158
  $this->packer->reset( $this->packer->decode( $packed ) );
2159
  $array = $this->packer->unpack();
2160
  } catch ( Exception $e ) {
2161
+ $this->ctc()->debug( 'Unpack failed -- ' . $e->getMessage(), __FUNCTION__, __CLASS__ );
2162
+ return FALSE;
2163
  }
2164
  $unpacked = array();
2165
  // iterate array and replace tokens
includes/classes/Core.php CHANGED
@@ -14,7 +14,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
14
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
15
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
16
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
17
- define( 'CHLD_THM_CFG_VERSION', '2.2.9' );
18
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
19
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
20
  define( 'CHLD_THM_CFG_PRO_MIN_VERSION', '2.2.0' );
14
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
15
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
16
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
17
+ define( 'CHLD_THM_CFG_VERSION', '2.3.0' );
18
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
19
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
20
  define( 'CHLD_THM_CFG_PRO_MIN_VERSION', '2.2.0' );
includes/classes/Preview.php CHANGED
@@ -126,6 +126,12 @@ class ChildThemeConfiguratorPreview {
126
  endif;
127
  endforeach;
128
  echo 'END CTC IRREGULAR' . LF;
 
 
 
 
 
 
129
  echo ']]>*/</script>' . LF;
130
  }
131
 
126
  endif;
127
  endforeach;
128
  echo 'END CTC IRREGULAR' . LF;
129
+ if ( defined( 'WP_CACHE' ) && WP_CACHE )
130
+ echo 'HAS_WP_CACHE' . LF;
131
+ if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) )
132
+ echo 'HAS_AUTOPTIMIZE' . LF;
133
+ if ( defined( 'WP_ROCKET_VERSION' ) )
134
+ echo 'HAS_WP_ROCKET' . LF;
135
  echo ']]>*/</script>' . LF;
136
  }
137
 
includes/classes/UI.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
5
  Class: ChildThemeConfiguratorUI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
- Version: 2.2.9
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -29,7 +29,7 @@ class ChildThemeConfiguratorUI {
29
  add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_current_theme' ), 5 );
30
  add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_debug_toggle' ), 100 );
31
  add_action( 'chld_thm_cfg_file_form_buttons', array( $this, 'render_file_form_buttons' ), 10, 1 );
32
- add_action( 'chld_thm_cfg_admin_notices', array( $this, 'get_colors' ) );
33
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
34
  add_filter( 'chld_thm_cfg_localize_array', array( $this, 'filter_localize_array' ) );
35
  add_action( 'all_admin_notices', array( $this, 'all_admin_notices' ) );
@@ -77,6 +77,7 @@ class ChildThemeConfiguratorUI {
77
  return TRUE;
78
  return ( !defined( 'CHLD_THM_CFG_PRO_VERSION' ) );
79
  }
 
80
  function all_admin_notices(){
81
  do_action( 'chld_thm_cfg_admin_notices' );
82
  }
@@ -141,17 +142,18 @@ class ChildThemeConfiguratorUI {
141
 
142
  if ( $theme = $this->ctc()->css->get_prop( 'child' ) ):
143
  $themeuri = trailingslashit( get_theme_root_uri() ) . trailingslashit( $theme );
144
- $files = $this->ctc()->get_files( $theme, 'img' );
 
145
 
146
  $counter = 0;
147
  sort( $files );
148
  ob_start();
149
- foreach ( $files as $file ):
 
150
  $templatefile = preg_replace( '/^images\//', '', $file );
151
  include( CHLD_THM_CFG_DIR . '/includes/forms/image.php' );
152
  endforeach;
153
- $inputs = ob_get_contents();
154
- ob_end_clean();
155
  if ( $counter ) include( CHLD_THM_CFG_DIR . '/includes/forms/images.php' );
156
  endif;
157
  }
@@ -176,8 +178,7 @@ class ChildThemeConfiguratorUI {
176
  if ( !is_readable( $file ) ) $file = $dir . 'en_US.php';
177
  ob_start();
178
  include( $file );
179
- $help_raw = ob_get_contents();
180
- ob_end_clean();
181
  // parse raw html for tokens
182
  preg_match( $regex_sidebar, $help_raw, $sidebar );
183
  preg_match_all( $regex_tab, $help_raw, $tabs );
@@ -255,7 +256,7 @@ class ChildThemeConfiguratorUI {
255
 
256
  wp_enqueue_script( 'chld-thm-cfg-spectrum', CHLD_THM_CFG_URL . 'js/spectrum.min.js', array( 'jquery' ), CHLD_THM_CFG_VERSION, TRUE );
257
  wp_enqueue_script( 'chld-thm-cfg-ctcgrad', CHLD_THM_CFG_URL . 'js/ctcgrad.min.js', array( 'jquery' ), CHLD_THM_CFG_VERSION, TRUE );
258
- wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg' . ( $this->ctc()->is_debug ? '' : '.min' ) . '.js',
259
  //wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg.js',
260
  array(
261
  'jquery-ui-autocomplete',
@@ -267,9 +268,10 @@ class ChildThemeConfiguratorUI {
267
  $localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
268
  'converted' => $this->css()->get_prop( 'converted' ),
269
  'ssl' => is_ssl(),
270
- 'homeurl' => home_url( '/' ) . '?ModPagespeed=off&ao_noptimize=1&preview_ctc=1',
271
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
272
  'theme_uri' => get_theme_root_uri(),
 
273
  'page' => CHLD_THM_CFG_MENU,
274
  'themes' => $this->ctc()->themes,
275
  'source' => apply_filters( 'chld_thm_cfg_source_uri', get_theme_root_uri() . '/'
@@ -316,7 +318,8 @@ class ChildThemeConfiguratorUI {
316
  'anlz4_txt' => __( 'The theme "%s" could not be analyzed because the preview did not render correctly.', 'child-theme-configurator' ),
317
  'anlz5_txt' => sprintf( __( '<p>First, verify you can <a href="%s">preview your home page with the Customizer</a> and try analyzing again.</p><p>If that does not work, try temporarily disabling plugins that <strong>minify CSS</strong> or that <strong>force redirects between HTTP and HTTPS</strong>.</p>', 'child-theme-configurator' ), admin_url( '/customize.php' ) ), // . '?page=' . CHLD_THM_CFG_MENU ),
318
  'anlz6_txt' => __( 'Click to show/hide PHP debug output', 'child-theme-configurator' ),
319
- 'anlz7_txt' => __( "<p>Please contact this Theme's author and report the items inside the box above. You may or may not be able to use this Theme as a Child Theme while these conditions exist.</p><p>It is possible that this theme has specific requirements to work correctly as a child theme. Please make sure you are using the latest version of this theme and check your theme's documentation for more information.</p>", 'child-theme-configurator' ),
 
320
  'anlz8_txt' => __( 'Do Not Activate "%s"! A PHP FATAL ERROR has been detected.', 'child-theme-configurator' ),
321
  'anlz9_txt' => __( 'This theme loads stylesheets after the wp_styles queue.', 'child-theme-configurator' ),
322
  'anlz10_txt' => __( '<p>This makes it difficult for plugins to override these styles. You can try to resolve this using the "Repair header template" option (Step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
@@ -343,6 +346,11 @@ class ChildThemeConfiguratorUI {
343
  'anlz31_txt' => __( 'This child theme was configured using the CTC Pro "Genesis stylesheet handling" method.', 'child-theme-configurator' ),
344
  'anlz32_txt' => __( '<p>This method has been replaced by the "Separate stylesheet" and "Ignore Parent Theme" options ( selected below ) for broader framework compatability.</p>', 'child-theme-configurator' ),
345
  'anlz33_txt' => __( '<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>', 'child-theme-configurator' ),
 
 
 
 
 
346
  ) );
347
  wp_localize_script(
348
  'chld-thm-cfg-admin',
5
  Class: ChildThemeConfiguratorUI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
+ Version: 2.3.0
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
29
  add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_current_theme' ), 5 );
30
  add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_debug_toggle' ), 100 );
31
  add_action( 'chld_thm_cfg_file_form_buttons', array( $this, 'render_file_form_buttons' ), 10, 1 );
32
+ add_action( 'chld_thm_cfg_admin_notices', array( $this, 'get_colors' ) );
33
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
34
  add_filter( 'chld_thm_cfg_localize_array', array( $this, 'filter_localize_array' ) );
35
  add_action( 'all_admin_notices', array( $this, 'all_admin_notices' ) );
77
  return TRUE;
78
  return ( !defined( 'CHLD_THM_CFG_PRO_VERSION' ) );
79
  }
80
+
81
  function all_admin_notices(){
82
  do_action( 'chld_thm_cfg_admin_notices' );
83
  }
142
 
143
  if ( $theme = $this->ctc()->css->get_prop( 'child' ) ):
144
  $themeuri = trailingslashit( get_theme_root_uri() ) . trailingslashit( $theme );
145
+ $themeroot = trailingslashit( get_theme_root() ) . trailingslashit( $theme );
146
+ $files = $this->ctc()->get_files( $theme, 'img' );
147
 
148
  $counter = 0;
149
  sort( $files );
150
  ob_start();
151
+ foreach ( $files as $file ):
152
+ $imagesize = getimagesize( $themeroot . $file ); // added 2.3.0
153
  $templatefile = preg_replace( '/^images\//', '', $file );
154
  include( CHLD_THM_CFG_DIR . '/includes/forms/image.php' );
155
  endforeach;
156
+ $inputs = ob_get_clean();
 
157
  if ( $counter ) include( CHLD_THM_CFG_DIR . '/includes/forms/images.php' );
158
  endif;
159
  }
178
  if ( !is_readable( $file ) ) $file = $dir . 'en_US.php';
179
  ob_start();
180
  include( $file );
181
+ $help_raw = ob_get_clean();
 
182
  // parse raw html for tokens
183
  preg_match( $regex_sidebar, $help_raw, $sidebar );
184
  preg_match_all( $regex_tab, $help_raw, $tabs );
256
 
257
  wp_enqueue_script( 'chld-thm-cfg-spectrum', CHLD_THM_CFG_URL . 'js/spectrum.min.js', array( 'jquery' ), CHLD_THM_CFG_VERSION, TRUE );
258
  wp_enqueue_script( 'chld-thm-cfg-ctcgrad', CHLD_THM_CFG_URL . 'js/ctcgrad.min.js', array( 'jquery' ), CHLD_THM_CFG_VERSION, TRUE );
259
+ wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg' . ( SCRIPT_DEBUG ? '' : '.min' ) . '.js',
260
  //wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg.js',
261
  array(
262
  'jquery-ui-autocomplete',
268
  $localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
269
  'converted' => $this->css()->get_prop( 'converted' ),
270
  'ssl' => is_ssl(),
271
+ 'homeurl' => home_url( '/' ) . '?ModPagespeed=off&' . ( defined( 'WP_ROCKET_VERSION' ) ? '' : 'ao_noptimize=1&' ) . 'preview_ctc=1', // WP Rocket serves cached page when ao_nooptimize is present v2.3.0
272
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
273
  'theme_uri' => get_theme_root_uri(),
274
+ 'theme_dir' => basename( get_theme_root_uri() ),
275
  'page' => CHLD_THM_CFG_MENU,
276
  'themes' => $this->ctc()->themes,
277
  'source' => apply_filters( 'chld_thm_cfg_source_uri', get_theme_root_uri() . '/'
318
  'anlz4_txt' => __( 'The theme "%s" could not be analyzed because the preview did not render correctly.', 'child-theme-configurator' ),
319
  'anlz5_txt' => sprintf( __( '<p>First, verify you can <a href="%s">preview your home page with the Customizer</a> and try analyzing again.</p><p>If that does not work, try temporarily disabling plugins that <strong>minify CSS</strong> or that <strong>force redirects between HTTP and HTTPS</strong>.</p>', 'child-theme-configurator' ), admin_url( '/customize.php' ) ), // . '?page=' . CHLD_THM_CFG_MENU ),
320
  'anlz6_txt' => __( 'Click to show/hide PHP debug output', 'child-theme-configurator' ),
321
+ // php error description modified v2.3.0
322
+ 'anlz7_txt' => __( '<p><strong>PLEASE NOTE:</strong></p><p><em>The analyzer reveals errors that may otherwise go undetected. Unless this is a fatal error, WordPress may appear to work correctly; however, PHP will continue to log the error until it is resolved. Please contact the author of any theme or plugin</em> <strong>mentioned above</strong> <em>and cut/paste the error from the text area.</em> <strong>Do not use a screen capture as it may cut off part of the error text.</strong> <em>Additional information about the error may also be available in the <a href="http://www.childthemeconfigurator.com/child-theme-faqs/" target="_blank">CTC documentation</a>.</em></p>', 'child-theme-configurator' ),
323
  'anlz8_txt' => __( 'Do Not Activate "%s"! A PHP FATAL ERROR has been detected.', 'child-theme-configurator' ),
324
  'anlz9_txt' => __( 'This theme loads stylesheets after the wp_styles queue.', 'child-theme-configurator' ),
325
  'anlz10_txt' => __( '<p>This makes it difficult for plugins to override these styles. You can try to resolve this using the "Repair header template" option (Step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
346
  'anlz31_txt' => __( 'This child theme was configured using the CTC Pro "Genesis stylesheet handling" method.', 'child-theme-configurator' ),
347
  'anlz32_txt' => __( '<p>This method has been replaced by the "Separate stylesheet" and "Ignore Parent Theme" options ( selected below ) for broader framework compatability.</p>', 'child-theme-configurator' ),
348
  'anlz33_txt' => __( '<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>', 'child-theme-configurator' ),
349
+ 'anlzrtl_txt' => __( 'This theme uses a RTL (right-to-left) stylesheet that is not being loaded in the child theme.', 'child-theme-configurator' ), // added 2.3.0
350
+ 'anlzrtl2_txt' => __( 'Use the Web Fonts tab to add a link to the parent RTL stylesheet. See the documentation for more information.</p>', 'child-theme-configurator' ), // added 2.3.0
351
+ 'anlzcache1_txt' => __( 'Both WP Rocket and Autoptimize plugins are enabled.', 'child-theme-configurator' ),
352
+ 'anlzcache2_txt' => __( 'The combination of these two plugins interferes with the Analysis results. Please temporarily deactivate one of them and Analyze again.', 'child-theme-configurator' ),
353
+ 'anlzconfig_txt' => __( '<p><strong>The WordPress configuration file has been modified incorrectly.</strong> Please see <a href="http://www.childthemeconfigurator.com/child-theme-faqs/#constants" target="_blank">this FAQ</a> for more information.</p>', 'child-theme-configurator' ),
354
  ) );
355
  wp_localize_script(
356
  'chld-thm-cfg-admin',
includes/forms/errorstrings.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ $errorstrings = array(
5
+
6
+ '1' => __( 'Zip file creation failed.', 'child-theme-configurator' ),
7
+ '2' => __( 'You do not have permission to configure child themes.', 'child-theme-configurator' ),
8
+ '3' => __( '%s does not exist. Please select a valid Parent Theme.', 'child-theme-configurator' ),
9
+ '4' => __( 'The Functions file is required and cannot be deleted.', 'child-theme-configurator' ),
10
+ '5' => __( 'Please select a valid Parent Theme.', 'child-theme-configurator' ),
11
+ '6' => __( 'Please select a valid Child Theme.', 'child-theme-configurator' ),
12
+ '7' => __( 'Please enter a valid Child Theme directory name.', 'child-theme-configurator' ),
13
+ '8' => __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.', 'child-theme-configurator' ),
14
+ '9' => __( 'Your theme directories are not writable.', 'child-theme-configurator' ), // add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
15
+
16
+ '10' => __( 'Could not upgrade child theme', 'child-theme-configurator' ),
17
+ '11' => __( 'Your stylesheet is not writable.', 'child-theme-configurator' ), // add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
18
+
19
+ '12' => __( 'A closing PHP tag was detected in Child theme functions file so "Parent Stylesheet Handling" option was not configured. Closing PHP at the end of the file is discouraged as it can cause premature HTTP headers. Please edit <code>functions.php</code> to remove the final <code>?&gt;</code> tag and click "Generate/Rebuild Child Theme Files" again.', 'child-theme-configurator' ),
20
+ '13' => __( 'Could not copy file: %s', 'child-theme-configurator' ),
21
+ '14' => __( 'Could not delete %s file.', 'child-theme-configurator' ),
22
+ '15' => __( 'could not copy %s', 'child-theme-configurator' ), //unused
23
+ '16' => __( 'invalid dir: %s', 'child-theme-configurator' ), //unused
24
+ '17' => __( 'deleted: %s != %s files', 'child-theme-configurator' ), //unused
25
+ '18' => __( 'newfiles != files', 'child-theme-configurator' ), //unused
26
+ '19' => __( 'There were errors while resetting permissions.', 'child-theme-configurator' ), // add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
27
+
28
+ '20' => __( 'Could not upload file.', 'child-theme-configurator' ),
29
+ '21' => __( 'Invalid theme root directory.', 'child-theme-configurator' ),
30
+ '22' => __( 'No writable temp directory.', 'child-theme-configurator' ),
31
+ '23' => __( 'PclZip returned zero bytes.', 'child-theme-configurator' ),
32
+ '24' => __( 'Unpack failed -- %s', 'child-theme-configurator' ), // unused
33
+ '25' => __( 'Pack failed -- %s', 'child-theme-configurator' ), //unused
34
+ '26' => __( 'Maximum number of styles exceeded.', 'child-theme-configurator' ),
35
+ '27' => __( 'Error moving file: %s', 'child-theme-configurator' ),
36
+ '28' => __( 'Could not set write permissions.', 'child-theme-configurator' ), // add_action( 'chld_thm_cfg_admin_notices', array( $this, 'writable_notice' ) );
37
+
38
+ );
39
+
40
+ $writable_errors = array(
41
+ 9,
42
+ 11,
43
+ 19,
44
+ 28
45
+ );
includes/forms/image.php CHANGED
@@ -7,6 +7,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
7
  <input class="ctc_checkbox" id="ctc_img_<?php echo ++$counter; ?>"
8
  name="ctc_img[]" type="checkbox"
9
  value="<?php echo $templatefile; ?>" />
10
- <?php echo $templatefile; ?></label>
11
  <br/>
12
  <a href="<?php echo $themeuri . $file; ?>" class="thickbox"><img src="<?php echo $themeuri . $file . '?' . time(); ?>" height="72" width="72" style="max-height:72px;max-width:100%;width:auto;height:auto" /></a></div>
7
  <input class="ctc_checkbox" id="ctc_img_<?php echo ++$counter; ?>"
8
  name="ctc_img[]" type="checkbox"
9
  value="<?php echo $templatefile; ?>" />
10
+ <?php echo $templatefile; if ( is_array( $imagesize ) ): ?> ( <?php echo $imagesize[ 0 ]; ?> x <?php echo $imagesize[ 1 ]; ?> px ) <?php endif; ?></label>
11
  <br/>
12
  <a href="<?php echo $themeuri . $file; ?>" class="thickbox"><img src="<?php echo $themeuri . $file . '?' . time(); ?>" height="72" width="72" style="max-height:72px;max-width:100%;width:auto;height:auto" /></a></div>
includes/forms/notices.php CHANGED
@@ -111,6 +111,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
111
  <?php _e( 'It is a good idea to save a Zip Archive of your Child Theme before using CTC for the first time. Click the "save backup" link ( see Step 2, below ) to export your themes.', 'child-theme-configurator' ); ?>
112
  </p>
113
  </div>
114
- <?php endif; ?>
 
 
115
  <?php endswitch; ?>
116
  </div>
111
  <?php _e( 'It is a good idea to save a Zip Archive of your Child Theme before using CTC for the first time. Click the "save backup" link ( see Step 2, below ) to export your themes.', 'child-theme-configurator' ); ?>
112
  </p>
113
  </div>
114
+ <?php endif;
115
+ break;
116
+ ?>
117
  <?php endswitch; ?>
118
  </div>
includes/forms/query-selector.php CHANGED
@@ -12,7 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
12
  <div class="ctc-input-row clearfix" id="input_row_query">
13
  <div class="ctc-input-cell"> <strong>
14
  <?php _e( '@media Query', 'child-theme-configurator' ); ?>
15
- </strong> <?php _e( '( or "base" )', 'child-theme-configurator' ); ?></div>
16
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
17
  <div class="ctc-input-cell">
18
  <div class="ui-widget">
@@ -23,7 +23,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
23
  <div class="ctc-input-row clearfix" id="input_row_selector">
24
  <div class="ctc-input-cell"> <strong>
25
  <?php _e( 'Selector', 'child-theme-configurator' ); ?>
26
- </strong> <a href="#" class="ctc-rewrite-toggle"></a></div>
27
  <div class="ctc-input-cell" id="ctc_sel_ovrd_selector_selected">&nbsp;</div>
28
  <div class="ctc-input-cell">
29
  <div class="ui-widget">
@@ -71,7 +71,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
71
  </div>
72
  </div>
73
  </div>
74
- <div class="ctc-input-row clearfix" id="input_row_selector">
75
  <div class="ctc-input-cell"> <strong>
76
  <?php _e( 'Order', 'child-theme-configurator' ); ?>
77
  </strong> </div>
12
  <div class="ctc-input-row clearfix" id="input_row_query">
13
  <div class="ctc-input-cell"> <strong>
14
  <?php _e( '@media Query', 'child-theme-configurator' ); ?>
15
+ </strong> <?php _e( '( or "base" )', 'child-theme-configurator' ); ?> <a href="#" class="ctc-rewrite-toggle rewrite-query"></a></div>
16
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
17
  <div class="ctc-input-cell">
18
  <div class="ui-widget">
23
  <div class="ctc-input-row clearfix" id="input_row_selector">
24
  <div class="ctc-input-cell"> <strong>
25
  <?php _e( 'Selector', 'child-theme-configurator' ); ?>
26
+ </strong> <a href="#" class="ctc-rewrite-toggle rewrite-selector"></a></div>
27
  <div class="ctc-input-cell" id="ctc_sel_ovrd_selector_selected">&nbsp;</div>
28
  <div class="ctc-input-cell">
29
  <div class="ui-widget">
71
  </div>
72
  </div>
73
  </div>
74
+ <div class="ctc-input-row clearfix" id="input_row_load_order">
75
  <div class="ctc-input-cell"> <strong>
76
  <?php _e( 'Order', 'child-theme-configurator' ); ?>
77
  </strong> </div>
includes/forms/settings-errors.php CHANGED
@@ -1,60 +1,97 @@
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
- if ( count( $this->ctc()->errors ) ): ?>
 
 
5
 
6
- <div class="error notice is-dismissible">
7
- <ul>
 
 
 
 
 
 
 
 
 
8
  <?php
9
- foreach ( $this->ctc()->errors as $err ):
10
- echo '<li>' . $err . '</li>' . LF;
11
- endforeach; ?>
12
- </ul>
 
 
 
 
 
 
 
 
 
 
13
  </div>
14
  <?php
15
- elseif ( isset( $_GET[ 'updated' ] ) ):
16
- $child_theme = wp_get_theme( $this->ctc()->get( 'child' ) ); ?>
 
 
 
 
17
  <div class="updated notice is-dismissible">
18
- <?php
19
- if ( 4 == $_GET[ 'updated' ] ): ?>
20
- <p> <?php printf( __( 'Child Theme <strong>%s</strong> has been reset. Please configure it using the settings below.', 'child-theme-configurator' ), $child_theme->Name ); ?> </p>
21
- <?php
22
- elseif ( 7 == $_GET[ 'updated' ] ): ?>
23
- <p>
24
- <?php _e( 'Update Key saved successfully.', 'child-theme-configurator' ); ?>
25
- </p>
26
- <?php
27
- elseif ( 8 == $_GET[ 'updated' ] ): ?>
28
- <p>
29
- <?php _e( 'Child Theme files modified successfully.', 'child-theme-configurator' ); ?>
30
- </p>
31
- <?php else: ?>
32
- <p class="ctc-success-response"><?php echo apply_filters( 'chld_thm_cfg_update_msg', sprintf( __( 'Child Theme <strong>%s</strong> has been generated successfully.', 'child-theme-configurator' ), $child_theme->Name ), $this->ctc() ); ?>
33
  <?php
34
- if ( $this->ctc()->is_theme() ): ?>
35
- <strong>
36
- <?php _e( 'IMPORTANT:', 'child-theme-configurator' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  <?php
38
- if ( is_multisite() && !$child_theme->is_allowed() ):
39
- printf( __( 'You must %sNetwork enable%s your child theme.', 'child-theme-configurator' ),
40
- sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
41
- network_admin_url( '/themes.php' ),
42
- __( 'Go to Themes', 'child-theme-configurator' ) ),
43
- '</a>'
44
- );
45
- else:
46
- printf( __( '%sPreview your child theme%s before activating.', 'child-theme-configurator' ),
47
- sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
48
- admin_url( '/customize.php?theme=' . $this->ctc()->css->get_prop( 'child' ) ),
49
- __( 'Live Preview', 'child-theme-configurator' ) ),
50
- '</a>'
51
- );
52
- endif; ?>
53
- </strong></p>
54
- <?php
 
 
 
 
 
 
55
  endif;
56
- endif; ?>
 
 
 
 
 
 
57
  </div>
58
  <?php
59
- endif;
60
-
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
+ if ( $this->errors || isset( $_GET[ 'error' ] ) ):
5
+ include_once( CHLD_THM_CFG_DIR . '/includes/forms/errorstrings.php' );
6
+ $errors = ( array )$this->errors;
7
 
8
+ if ( isset( $_GET[ 'error' ] ) )
9
+ $errors = array_merge( $errors,
10
+ explode( ',', sanitize_text_field( $_GET[ 'error' ] ) )
11
+ );
12
+ ?>
13
+
14
+ <div class="error notice is-dismissible dashicons-before">
15
+ <h4>
16
+ <?php _e( 'CTC encountered an error:', 'child-theme-configurator' ); ?>
17
+ </h4>
18
+ <ul>
19
  <?php
20
+ $writable_error = 0;
21
+ foreach ( $errors as $error ):
22
+ $errs = explode( ':', $error );
23
+ $errkey = array_shift( $errs );
24
+ if ( in_array( $errkey, $writable_errors ) )
25
+ $writable_error = 1;
26
+ if ( $errkey && isset( $errorstrings[ $errkey ] ) ):
27
+ $err = $errorstrings[ $errkey ];
28
+ // accommodate zero, one or two arguments
29
+ printf( '<li>' . $err . '</li>' . LF, array_shift( $errs ), array_shift( $errs ) );
30
+ endif;
31
+ endforeach;
32
+ ?>
33
+ </ul>
34
  </div>
35
  <?php
36
+ if ( $writable_error ):
37
+ $this->render_notices( 'writable' );
38
+ endif;
39
+ elseif ( isset( $_GET[ 'updated' ] ) ):
40
+ $child_theme = wp_get_theme( $this->ctc()->get( 'child' ) );
41
+ ?>
42
  <div class="updated notice is-dismissible">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  <?php
44
+ switch ( $_GET[ 'updated' ] ):
45
+ case '4':
46
+ ?>
47
+ <p>
48
+ <?php printf( __( 'Child Theme <strong>%s</strong> has been reset. Please configure it using the settings below.', 'child-theme-configurator' ), $child_theme->Name ); ?> </p>
49
+ <?php
50
+ break;
51
+ case '7':
52
+ ?>
53
+ <p>
54
+ <?php _e( 'Update Key saved successfully.', 'child-theme-configurator' ); ?>
55
+ </p>
56
+ <?php
57
+ break;
58
+ case '8':
59
+ ?>
60
+ <p>
61
+ <?php _e( 'Child Theme files modified successfully.', 'child-theme-configurator' ); ?>
62
+ </p>
63
  <?php
64
+ break;
65
+ default: ?>
66
+ <p class="ctc-success-response">
67
+ <?php echo apply_filters( 'chld_thm_cfg_update_msg', sprintf( __( 'Child Theme <strong>%s</strong> has been generated successfully.', 'child-theme-configurator' ), $child_theme->Name ), $this->ctc() ); ?>
68
+ <?php
69
+ if ( $this->ctc()->is_theme() ): ?>
70
+ <strong>
71
+ <?php _e( 'IMPORTANT:', 'child-theme-configurator' ); ?>
72
+ <?php
73
+ if ( is_multisite() && !$child_theme->is_allowed() ):
74
+ printf( __( 'You must %sNetwork enable%s your child theme.', 'child-theme-configurator' ),
75
+ sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
76
+ network_admin_url( '/themes.php' ),
77
+ __( 'Go to Themes', 'child-theme-configurator' ) ),
78
+ '</a>'
79
+ );
80
+ else :
81
+ printf( __( '%sPreview your child theme%s before activating.', 'child-theme-configurator' ),
82
+ sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
83
+ admin_url( '/customize.php?theme=' . $this->ctc()->css->get_prop( 'child' ) ),
84
+ __( 'Live Preview', 'child-theme-configurator' ) ),
85
+ '</a>'
86
+ );
87
  endif;
88
+ ?>
89
+ </strong>
90
+ </p>
91
+ <?php
92
+ endif;
93
+ endswitch;
94
+ ?>
95
  </div>
96
  <?php
97
+ endif;
 
includes/forms/tabs.php CHANGED
@@ -19,7 +19,7 @@ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'parent_child_options';
19
  if ( $this->ctc()->is_theme() ):
20
  ?><a id="import_options" href=""
21
  class="nav-tab <?php $this->maybe_disable(); echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
22
- <?php _e( 'Web Fonts', 'child-theme-configurator' ); ?>
23
  </a><?php
24
  endif; ?><a id="view_parnt_options" href=""
25
  class="nav-tab <?php $this->maybe_disable(); echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
19
  if ( $this->ctc()->is_theme() ):
20
  ?><a id="import_options" href=""
21
  class="nav-tab <?php $this->maybe_disable(); echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
22
+ <?php _e( 'Web Fonts & CSS', 'child-theme-configurator' ); ?>
23
  </a><?php
24
  endif; ?><a id="view_parnt_options" href=""
25
  class="nav-tab <?php $this->maybe_disable(); echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
includes/forms/webfonts.php CHANGED
@@ -15,10 +15,15 @@ $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
15
  name="ctc_save_imports" value="<?php _e( 'Save', 'child-theme-configurator' ); ?>" disabled />
16
  </div>
17
  <strong>
18
- <?php _e( 'Linked Stylesheets', 'child-theme-configurator' ); ?>
19
  </strong>
20
  <p><?php _e( 'Use <code>@import url( [path] );</code> to link additional stylesheets. Child Theme Configurator uses the <code>@import</code> keyword to identify them and convert them to <code>&lt;link&gt;</code> tags. <strong>Example:</strong>');?></p>
21
  <p><code>@import url(http://fonts.googleapis.com/css?family=Oswald);</code></p>
 
 
 
 
 
22
  </div>
23
  <div class="ctc-input-cell-wide">
24
  <textarea id="ctc_child_imports" name="ctc_child_imports" wrap="off"><?php
15
  name="ctc_save_imports" value="<?php _e( 'Save', 'child-theme-configurator' ); ?>" disabled />
16
  </div>
17
  <strong>
18
+ <?php _e( 'Additional Linked Stylesheets', 'child-theme-configurator' ); ?>
19
  </strong>
20
  <p><?php _e( 'Use <code>@import url( [path] );</code> to link additional stylesheets. Child Theme Configurator uses the <code>@import</code> keyword to identify them and convert them to <code>&lt;link&gt;</code> tags. <strong>Example:</strong>');?></p>
21
  <p><code>@import url(http://fonts.googleapis.com/css?family=Oswald);</code></p>
22
+ <strong>
23
+ <?php _e( 'RTL (Right-to-Left) Stylesheets', 'child-theme-configurator' ); ?>
24
+ </strong>
25
+ <p><?php _e( 'If RTL is not automatically loading in the child theme, you can link it here. <strong>Example:</strong>');?></p>
26
+ <p><code>@import url(../twentyseventeen/rtl.css);</code></p>
27
  </div>
28
  <div class="ctc-input-cell-wide">
29
  <textarea id="ctc_child_imports" name="ctc_child_imports" wrap="off"><?php
js/chldthmcfg.js CHANGED
@@ -2,7 +2,7 @@
2
  * Script: chldthmcfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 2.2.9
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
@@ -184,22 +184,50 @@
184
  $( panelid ).addClass( 'ctc-option-panel-active' );
185
  },
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  selector_input_toggle: function( obj ) {
188
- //console.log( 'selector_input_toggle: ' + obj );
189
  var self = this,
190
- origval;
191
- if ( $( '#ctc_rewrite_selector' ).length ) {
192
- origval = $( '#ctc_rewrite_selector_orig' ).val();
193
- $( '#ctc_sel_ovrd_selector_selected' ).text( origval );
 
 
 
194
  $( obj ).text( self.getxt( 'rename' ) );
195
  } else {
196
- origval = $( '#ctc_sel_ovrd_selector_selected' ).text();
197
- $( '#ctc_sel_ovrd_selector_selected' ).html(
198
- '<textarea id="ctc_rewrite_selector"' +
199
- ' name="ctc_rewrite_selector" autocomplete="off"></textarea>' +
200
- '<input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig"' +
201
  ' type="hidden" value="' + self.escquo( origval ) + '"/>' );
202
- $( '#ctc_rewrite_selector' ).val( origval );
203
  $( obj ).text( self.getxt( 'cancel' ) );
204
  }
205
  },
@@ -741,7 +769,15 @@
741
  selectFirst: true,
742
  autoFocus: true,
743
  select: function( e, ui ) {
744
- self.set_query( ui.item.value );
 
 
 
 
 
 
 
 
745
  return false;
746
  },
747
  focus: function( e ) {
@@ -762,7 +798,14 @@
762
  selectFirst: true,
763
  autoFocus: true,
764
  select: function( e, ui ) {
765
- self.set_selector( ui.item.value, ui.item.label );
 
 
 
 
 
 
 
766
  return false;
767
  },
768
  focus: function( e ) {
@@ -966,6 +1009,18 @@
966
  self.scrolltop();
967
  },
968
 
 
 
 
 
 
 
 
 
 
 
 
 
969
  set_selector: function( value, label ) {
970
  var self = this;
971
  label = null;
@@ -1003,6 +1058,7 @@
1003
  self.reload = true;
1004
  self.load_selector_values();
1005
  },
 
1006
  /**
1007
  * Retrieve data from server and execute callback on completion
1008
  */
@@ -1075,18 +1131,20 @@
1075
  }
1076
  $( '.save-icon' ).addClass( 'is-active' );
1077
  // add rename selector value if it exists
1078
- $( '#ctc_sel_ovrd_selector_selected' )
1079
- .find( '#ctc_rewrite_selector' ).each( function() {
1080
- newsel = $( '#ctc_rewrite_selector' ).val();
1081
- origsel = $( '#ctc_rewrite_selector_orig' ).val();
1082
- if ( self.is_empty( newsel ) || !newsel.toString().match( /\w/ ) ) {
1083
- newsel = origsel;
1084
- } else {
1085
- postdata.ctc_rewrite_selector = newsel;
1086
- self.reload = true;
 
 
 
1087
  }
1088
  $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1089
- $( '#ctc_sel_ovrd_selector_selected' ).html( newsel );
1090
  } );
1091
  // add wp ajax action to array
1092
  //console.log( $( '#ctc_action' ).val() );
@@ -1222,11 +1280,11 @@
1222
  update: {
1223
  // render individual selector inputs on Query/Selector tab
1224
  qsid: function( res ) {
1225
- //console.log( res );
1226
  var self = this,
1227
  id, html, val, empty;
1228
  self.currqsid = res.key;
1229
  self.currdata = res.data;
 
1230
  //console.log( 'update.qsid: ' + self.currqsid );
1231
  $( '#ctc_sel_ovrd_qsid' ).val( self.currqsid );
1232
  if ( self.is_empty( self.currdata.seq ) ) {
@@ -1241,7 +1299,9 @@
1241
  if ( self.is_empty( self.currdata.value ) ) {
1242
  //console.log( 'qsdata is empty' );
1243
  empty = true;
1244
- $( '#ctc_sel_ovrd_rule_inputs' ).empty();
 
 
1245
  } else {
1246
  //console.log( 'qsdata NOT empty' );
1247
  empty = false;
@@ -1261,22 +1321,23 @@
1261
  //console.log( 'reload menus: ' + ( self.reload ? 'true' : 'false' ) );
1262
  if ( self.reload ) {
1263
  self.load_queries();
 
1264
  self.set_query( self.currdata.query );
1265
  self.load_rules();
1266
  }
1267
  $( '#ctc_sel_ovrd_selector_selected' ).text( self.currdata.selector );
1268
- $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1269
- $( '.ctc-rewrite-toggle' ).show();
1270
- if ( !empty ){
1271
- $( '#ctc_sel_ovrd_rule_header,' +
1272
- '#ctc_sel_ovrd_new_rule,' +
1273
- '#ctc_sel_ovrd_rule_inputs_container,' +
1274
- '#ctc_sel_ovrd_rule_inputs' ).show();
1275
  } else {
1276
- $( '#ctc_sel_ovrd_rule_header,' +
 
1277
  '#ctc_sel_ovrd_new_rule,' +
1278
  '#ctc_sel_ovrd_rule_inputs_container,' +
1279
- '#ctc_sel_ovrd_rule_inputs' ).hide();
 
 
1280
  }
1281
  //self.scrolltop();
1282
  // }
@@ -1802,9 +1863,9 @@
1802
  } );
1803
  },
1804
  parse_page: function( themetype, body ){
1805
-
1806
  var self = this,
1807
- themepath = window.ctcAjax.theme_uri.replace( /^https?:\/\//, '' ),
 
1808
  stylesheet = ( 'child' === themetype ? $.chldthmcfg.currchild : $.chldthmcfg.currparnt ),
1809
  escaped = self.escrgx( $.chldthmcfg.currparnt ) + ( 'child' === themetype ? '|' + self.escrgx( stylesheet ) : '' ),
1810
  regex_link = new RegExp( "<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?" +
@@ -1816,8 +1877,12 @@
1816
  queue,
1817
  csslink;
1818
 
 
1819
  if ( 'child' === themetype ) {
1820
- //console.log( body );
 
 
 
1821
  }
1822
  // retrieve enqueued stylesheet ids
1823
  if ( ( queue = body.match( /BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/ ) ) ) {
@@ -1837,31 +1902,47 @@
1837
  }
1838
  if ( body.match( /CHLD_THM_CFG_IGNORE_PARENT/ ) ) {
1839
  self.analysis[ themetype ].signals.thm_ignoreparnt = 1;
1840
- //console.log( 'thm_ignoreparnt' );
1841
  }
1842
  if ( body.match( /IS_CTC_THEME/ ) ) {
1843
  self.analysis[ themetype ].signals.thm_is_ctc = 1;
1844
- //console.log( 'thm_is_ctc' );
1845
  }
1846
 
1847
  if ( body.match( /NO_CTC_STYLES/ ) ) {
1848
  self.analysis[ themetype ].signals.thm_no_styles = 1;
1849
- //console.log( 'thm_no_styles' );
1850
  }
1851
  if ( body.match( /HAS_CTC_IMPORT/ ) ) {
1852
  self.analysis[ themetype ].signals.thm_has_import = 1;
1853
- //console.log( 'thm_has_import' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1854
  }
1855
 
1856
  // remove comments to avoid flagging conditional stylesheets ( IE compatability, etc. )
1857
  body = body.replace( /<!\-\-[\s\S]*?\-\->/g, '' );
1858
- //console.log( 'PARSE:' );
1859
  while ( ( msg = regex_err.exec( body ) ) ) {
1860
  var errstr = msg[ 0 ].replace( /<.*?>/g, '' );
1861
  self.phperr[ themetype ].push( errstr );
1862
  self.analysis[ themetype ].signals.err_php = 1;
1863
  if ( errstr.match( /Fatal error/i ) ) {
1864
  self.analysis[ themetype ].signals.err_fatal = 1;
 
1865
  }
1866
  //else if ( errstr.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
1867
  //analysis.signals.err_fnf = 1;
@@ -1873,72 +1954,89 @@
1873
  stylesheetpath = csslink[ 4 ],
1874
  linktheme = $.chldthmcfg.currparnt === stylesheettheme ? 'parnt' : 'child',
1875
  noid = 0;
1876
- //console.log( 'stylesheetid: ' + stylesheetid + ' stylesheetpath: ' + stylesheetpath );
1877
  // flag stylesheet links that have no id or are not in wp_styles
1878
  if ( '' === stylesheetid || -1 === $.inArray( stylesheetid, self.analysis[ themetype ].queue ) ) {
1879
  noid = 1;
1880
- //console.log( 'no id for ' + stylesheetpath + '!' );
1881
  } else if ( 0 === stylesheetid.indexOf( 'chld_thm_cfg' ) ) { // handle ctc-generated links
1882
- // console.log( 'ctc link detected: ' + stylesheetid + ' themeloaded: ' + themeloaded );
1883
- if ( stylesheetpath.match( /^ctc\-style([\-\.]min)?\.css$/ ) ) {
1884
- //console.log( 'separate stylesheet detected' );
1885
  themeloaded = 1;
1886
  self.analysis[ themetype ].signals.ctc_sep_loaded = 1; // flag that separate stylesheet has been detected
1887
  } else if ( stylesheetpath.match( /^ctc\-genesis([\-\.]min)?\.css$/ ) ) {
1888
- //console.log( 'genesis stylesheet detected' );
1889
  themeloaded = 1;
1890
  self.analysis[ themetype ].signals.ctc_gen_loaded = 1; // flag that genesis "parent" has been detected
1891
- } else if ( stylesheetid.match( /$chld_thm_cfg_ext/ ) ) {
1892
- self.analysis[ themetype ].signals.ctc_ext_loaded = 1; // flag that external stylesheet link detected
1893
- self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
 
 
 
 
 
 
 
 
 
1894
  } else if ( 'chld_thm_cfg_child' === stylesheetid ) {
1895
  self.analysis[ themetype ].signals.ctc_child_loaded = 1; // flag that ctc child stylesheet link detected
1896
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
 
1897
  } else if ( 'chld_thm_cfg_parent' === stylesheetid ) {
1898
  self.analysis[ themetype ].signals.ctc_parnt_loaded = 1; // flag that ctc parent stylesheet link detected
1899
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
 
1900
  if ( themeloaded ){
1901
- //console.log( 'parent link out of sequence' );
1902
  self.analysis[ themetype ].signals.ctc_parnt_reorder = 1; // flag that ctc parent stylesheet link out of order
1903
  }
1904
  }
1905
  continue;
1906
  }
1907
  // flag main theme stylesheet link
1908
- if ( stylesheetpath.match( /^style([\-\.]min)?\.css$/ ) ) {
1909
- //console.log( linktheme + ' theme stylesheet detected: ' + stylesheettheme + '/' + stylesheetpath );
1910
  themeloaded = 1; // flag that main theme stylesheet has been detected
1911
  // if main theme stylesheet link has no id then it is unregistered ( hard-wired )
1912
  if ( 'parnt' === linktheme ) {
1913
  if ( noid ) {
1914
  self.analysis[ themetype ].signals.thm_parnt_loaded = 'thm_unregistered';
 
1915
  } else {
1916
  self.analysis[ themetype ].signals.thm_parnt_loaded = stylesheetid;
 
1917
  // check that parent stylesheet is loaded before child stylesheet
1918
  if ( 'child' === themetype && self.analysis[ themetype ].signals.thm_child_loaded ) {
1919
  self.analysis[ themetype ].signals.ctc_parnt_reorder = 1;
 
1920
  }
1921
  }
1922
  } else {
1923
  self.analysis[ themetype ].signals.thm_child_loaded = noid ? 'thm_unregistered' : stylesheetid;
 
1924
  }
1925
  if ( noid ) {
1926
  if ( testloaded ) {
1927
  self.analysis[ themetype ].signals.thm_past_wphead = 1;
1928
  self.analysis[ themetype ].deps[ themeloaded ].push( [ 'thm_past_wphead', stylesheetpath ] );
1929
- //console.log( 'Unreachable theme stylesheet detected' );
1930
  } else {
1931
  self.analysis[ themetype ].signals.thm_unregistered = 1;
1932
  self.analysis[ themetype ].deps[ themeloaded ].push( [ 'thm_unregistered', stylesheetpath ] );
1933
- //console.log( 'Unregistered theme stylesheet detected' );
1934
  }
1935
  } else {
1936
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1937
- //console.log( 'Theme stylesheet OK!' );
1938
  }
1939
 
 
 
1940
  } else if ( 'ctc-test.css' === stylesheetpath ) { // flag test stylesheet link
1941
- //console.log( 'end of queue reached' );
1942
  testloaded = 1; // flag that test queue has been detected ( end of wp_head )
1943
  } else {
1944
  var err = null;
@@ -1949,7 +2047,7 @@
1949
  }
1950
  if ( testloaded ) {
1951
  if ( themeloaded ) {
1952
- //console.log( 'Unreachable stylesheet detected!' + stylesheetpath );
1953
  err = 'css_past_wphead';
1954
  } else {
1955
  err = 'dep_past_wphead';
@@ -1969,6 +2067,8 @@
1969
  if ( ! themeloaded ){
1970
  self.analysis[ themetype ].signals.thm_notheme = 1; // flag that no theme stylesheet has been detected
1971
  }
 
 
1972
  },
1973
 
1974
  /**
@@ -1987,13 +2087,15 @@
1987
  errnotice = {
1988
  style: 'notice-warning',
1989
  headline: $.chldthmcfg.getxt( 'anlz3', name ),
1990
- errlist: ''
 
1991
  },
1992
  resubmit = 0,
1993
  resubmitdata= {},
1994
  anlz,
1995
  debugtxt = '',
1996
- dep_inputs;
 
1997
 
1998
  if ( self.analysis[ themetype ].signals.failure ||
1999
  ( self.analysis[ themetype ].signals.thm_noqueue && !self.phperr[ themetype ].length ) ) {
@@ -2010,9 +2112,11 @@
2010
  if ( self.phperr[ themetype ].length ) {
2011
  $.each( self.phperr[ themetype ], function( index, err ) {
2012
  if ( err.match( /Fatal error/i ) ) {
2013
- errnotice.style = 'error';
2014
- errnotice.headline = $.chldthmcfg.getxt( 'anlz8', name );
2015
- }
 
 
2016
  /*
2017
  if ( $.chldthmcfg.existing && err.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
2018
  //console.log( 'Probably using get_stylesheet_directory()' );
@@ -2021,174 +2125,199 @@
2021
  */
2022
  errnotice.errlist += err + "\n";
2023
  } );
 
 
 
 
 
 
 
2024
  errnotice.msg = '<div style="background-color:#ffeebb;padding:6px">' +
2025
  '<div class="ctc-section-toggle" id="ctc_analysis_errs">' +
2026
  $.chldthmcfg.getxt( 'anlz6' ) + '</div>' +
2027
- '<div id="ctc_analysis_errs_content" style="display:none"><textarea>' +
2028
  errnotice.errlist + '</textarea></div></div>' +
2029
- $.chldthmcfg.getxt( 'anlz7' );
2030
  notice.notices.push( errnotice );
2031
  }
2032
- if ( self.analysis[ themetype ].signals.thm_past_wphead || self.analysis[ themetype ].signals.dep_past_wphead ) {
2033
- // || self.analysis[ themetype ].signals.css_past_wphead ){
2034
  notice.notices.push( {
2035
- headline: $.chldthmcfg.getxt( 'anlz9' ),
2036
  style: 'notice-warning',
2037
- msg: $.chldthmcfg.getxt( 'anlz10' )
2038
  } );
2039
- $( '#ctc_repairheader' ).prop( 'checked', true );
2040
- $( '#ctc_repairheader_container' ).show();
2041
- }
2042
- if ( self.analysis[ themetype ].signals.thm_unregistered ) {
2043
- if (
2044
- !self.analysis[ themetype ].signals.ctc_child_loaded &&
2045
- !self.analysis[ themetype ].signals.ctc_sep_loaded ){
2046
- // test for stylesheet enqueue issues
2047
  notice.notices.push( {
2048
- headline: $.chldthmcfg.getxt( 'anlz11' ),
2049
  style: 'notice-warning',
2050
- msg: $.chldthmcfg.getxt( 'anlz12' )
2051
  } );
2052
- $( '#ctc_repairheader_container' ).show();
2053
  $( '#ctc_repairheader' ).prop( 'checked', true );
 
2054
  }
2055
- }
2056
- if ( 'child' === themetype ) {
2057
- if ( self.analysis.child.signals.ctc_parnt_reorder ) {
2058
- //console.log( 'reorder flag detected, resubmitting.' );
2059
- resubmit = 1;
 
 
 
 
 
 
 
 
2060
  }
2061
- if ( !self.analysis.child.signals.ctc_child_loaded &&
2062
- !self.analysis.child.signals.ctc_sep_loaded &&
2063
- !self.analysis.child.signals.thm_child_loaded ){
2064
- notice.notices.push( {
2065
- headline: $.chldthmcfg.getxt( 'anlz13' ),
2066
- style: 'notice-warning',
2067
- msg: $.chldthmcfg.getxt( 'anlz14' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2068
  } );
2069
- resubmit = 1;
2070
  }
2071
- if ( self.analysis[ themetype ].signals.ctc_gen_loaded ) {
 
2072
  notice.notices.push( {
2073
- headline: $.chldthmcfg.getxt( 'anlz31' ),
2074
- msg: $.chldthmcfg.getxt( 'anlz32' ),
2075
  style: 'notice-warning'
2076
  } );
 
 
2077
  }
2078
- if ( !self.analysis.parnt.signals.thm_no_styles &&
2079
- !self.analysis.child.signals.ctc_gen_loaded &&
2080
- !self.analysis.child.signals.thm_parnt_loaded &&
2081
- !self.analysis.child.signals.ctc_parnt_loaded &&
2082
- !self.analysis.child.signals.thm_ignoreparnt &&
2083
- !self.analysis.child.signals.thm_has_import ){
2084
- notice.notices.push( {
2085
- headline: $.chldthmcfg.getxt( 'anlz15' ),
2086
- style: 'notice-warning',
2087
- msg: $.chldthmcfg.getxt( 'anlz16' )
2088
- } );
2089
- resubmit = 1;
2090
  }
2091
- if ( self.analysis.child.signals.thm_unregistered &&
2092
- self.analysis.child.signals.thm_child_loaded &&
2093
- 'thm_unregistered' === self.analysis.child.signals.thm_child_loaded &&
2094
- self.analysis.child.signals.ctc_child_loaded &&
2095
- self.analysis.child.signals.ctc_parnt_loaded ) {
2096
- notice.notices.push( {
2097
- headline: $.chldthmcfg.getxt( 'anlz28' ),
2098
- style: 'notice-warning',
2099
- msg: $.chldthmcfg.getxt( 'anlz29' )
 
2100
  } );
2101
- $( '#ctc_repairheader_container' ).show();
2102
- $( '#ctc_repairheader' ).prop( 'checked', true );
2103
- }
2104
-
2105
- if ( !self.analysis.child.signals.thm_is_ctc &&
2106
- !$( '#ctc_child_type_duplicate' ).is( ':checked' ) ) {
2107
  notice.notices.push( {
2108
- headline: $.chldthmcfg.getxt( 'anlz19' ),
2109
- msg: $.chldthmcfg.getxt( 'anlz20' ),
2110
- style: 'notice-warning'
2111
  } );
 
2112
  }
2113
- }
2114
- // automatically set form inputs based on current analysis
2115
- if ( self.analysis[ themetype ].signals.ctc_sep_loaded || self.analysis[ themetype ].signals.ctc_gen_loaded ){
2116
- //console.log( 'Separate stylesheet detected' );
2117
- $( '#ctc_handling_separate' ).prop( 'checked', true );
2118
- }
2119
- if ( !notice.notices.length ) {
2120
- notice.notices.push( {
2121
- headline: '' + ( 'child' === themetype ? $.chldthmcfg.getxt( 'anlz17' ) : $.chldthmcfg.getxt( 'anlz18' ) ) + '',
2122
- style: 'updated',
2123
- msg: ''
2124
- } );
2125
- }
2126
-
2127
- if ( 'child' === themetype && self.analysis.child.signals.thm_has_import ) {
2128
- notice.notices.push( {
2129
- headline: $.chldthmcfg.getxt( 'anlz21' ),
2130
- msg: $.chldthmcfg.getxt( 'anlz22' ),
2131
- style: 'notice-warning'
2132
- } );
2133
- //console.log( 'Import parent detected' );
2134
- $( '#ctc_enqueue_import' ).prop( 'checked', true );
2135
- }
2136
- if ( self.analysis[ themetype ].signals.thm_ignoreparnt || self.analysis[ themetype ].signals.ctc_gen_loaded ){
2137
- //console.log( 'Ignore parent detected' );
2138
- $( '#ctc_ignoreparnt' ).prop( 'checked', true );
2139
- if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2140
  $( '#ctc_enqueue_none' ).prop( 'checked', true );
2141
  resubmit = 1;
2142
  resubmitdata.ctc_enqueue = 'none';
2143
  }
2144
- } else {
2145
- $( '#ctc_ignoreparnt' ).prop( 'checked', false );
2146
- }
2147
- if ( !self.analysis[ themetype ].signals.ctc_sep_loaded &&
2148
- !self.analysis[ themetype ].signals.ctc_gen_loaded &&
2149
- !self.analysis[ themetype ].signals.ctc_child_loaded &&
2150
- !self.analysis[ themetype ].signals.thm_unregistered &&
2151
- !self.analysis[ themetype ].signals.thm_past_wphead &&
2152
- self.analysis[ themetype ].deps[ 1 ].length ) {
2153
- var sheets = '';
2154
- $.each( self.analysis[ themetype ].deps[ 1 ], function( ndx, el ) {
2155
- if ( el[ 1 ].match( /^style([\-\.]min)?\.css$/ ) ) { return; }
2156
- sheets += '<li>' + el[ 1 ] + "</li>\n";
2157
- } );
2158
- if ( '' !== sheets ) {
2159
- sheets = "<ul class='howto' style='padding-left:1em'>\n" + sheets + "</ul>\n";
2160
- notice.notices.push( {
2161
- headline: $.chldthmcfg.getxt( 'anlz23' ),
2162
- msg: sheets + $.chldthmcfg.getxt( 'anlz24' ),
2163
- style: 'updated'
2164
- } );
2165
  }
2166
  }
2167
- if ( 'child' === themetype && self.analysis[ themetype ].signals.thm_parnt_loaded ) {
2168
- //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2169
- notice.notices.push( {
2170
- headline: $.chldthmcfg.getxt( 'anlz25' ),
2171
- msg: $.chldthmcfg.getxt( 'anlz26' ),
2172
- style: 'updated'
2173
- } );
2174
- //}
2175
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
2176
- resubmit = 1;
2177
- resubmitdata.ctc_enqueue = 'none';
2178
- }
2179
- // if no parent styles, no need to enqueue
2180
- if ( self.analysis.parnt.signals.thm_no_styles ) {
2181
- //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2182
- notice.notices.push( {
2183
- headline: $.chldthmcfg.getxt( 'anlz27' ),
2184
- msg: $.chldthmcfg.getxt( 'anlz26' ),
2185
- style: 'updated'
2186
- } );
2187
- //}
2188
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
2189
- resubmit = 1;
2190
- resubmitdata.ctc_enqueue = 'none';
2191
- }
2192
  }
2193
 
2194
  /**
2
  * Script: chldthmcfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 2.3.0
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
184
  $( panelid ).addClass( 'ctc-option-panel-active' );
185
  },
186
 
187
+ /**
188
+ * show or hide rewrite toggle on certain conditions
189
+ * added v2.3.0
190
+ */
191
+ maybe_show_rewrite: function(){
192
+ var self = this,
193
+ inputtype,
194
+ value;
195
+ $( '.ctc-rewrite-toggle' ).each( function( ndx, el ){
196
+ inputtype = $( el ).hasClass( 'rewrite-query' ) ? 'query' : 'selector';
197
+ value = $( '#ctc_sel_ovrd_' + inputtype + '_selected' ).text();
198
+ //console.log( 'maybe_show_rewrite inputtype: ' + inputtype + ' value: ' + value );
199
+ if ( value.match( /^[\s\u00A0]*$/ ) ){
200
+ $( el ).hide();
201
+ } else {
202
+ $( el ).text( self.getxt( 'rename' ) );
203
+ $( el ).show();
204
+ }
205
+ } );
206
+ },
207
+
208
+ /**
209
+ * toggle query/selector rename input
210
+ * modified v2.3.0
211
+ */
212
  selector_input_toggle: function( obj ) {
213
+ //console.log( 'selector_input_toggle: ' + $( obj ).attr( 'id' ) );
214
  var self = this,
215
+ origval,
216
+ inputtype = $( obj ).hasClass( 'rewrite-query' ) ? 'query' : 'selector',
217
+ input = 'ctc_rewrite_' + inputtype,
218
+ orig = 'ctc_sel_ovrd_' + inputtype + '_selected';
219
+ if ( $( '#' + input ).length ) {
220
+ origval = $( '#' + input + '_orig' ).val();
221
+ $( '#' + orig ).empty().text( origval );
222
  $( obj ).text( self.getxt( 'rename' ) );
223
  } else {
224
+ origval = $( '#' + orig ).text();
225
+ $( '#' + orig ).html(
226
+ '<textarea id="' + input + '"' +
227
+ ' name="' + input + '" autocomplete="off"></textarea>' +
228
+ '<input id="' + input + '_orig" name="' + input + '_orig"' +
229
  ' type="hidden" value="' + self.escquo( origval ) + '"/>' );
230
+ $( '#' + input ).val( origval );
231
  $( obj ).text( self.getxt( 'cancel' ) );
232
  }
233
  },
769
  selectFirst: true,
770
  autoFocus: true,
771
  select: function( e, ui ) {
772
+ if ( $( '#ctc_rewrite_query' ).length ){
773
+ // copy selected to rewrite input if active
774
+ $( '#ctc_rewrite_query' ).val( ui.item.value );
775
+ $( '#ctc_sel_ovrd_query' ).val( '' );
776
+ } else {
777
+ // otherwise set query
778
+ self.set_query( ui.item.value );
779
+ self.reset_qsid();
780
+ }
781
  return false;
782
  },
783
  focus: function( e ) {
798
  selectFirst: true,
799
  autoFocus: true,
800
  select: function( e, ui ) {
801
+ if ( $( '#ctc_rewrite_selector' ).length ){
802
+ // copy selected to rewrite input if active
803
+ $( '#ctc_rewrite_selector' ).val( ui.item.label );
804
+ $( '#ctc_sel_ovrd_selector' ).val( '' );
805
+ } else {
806
+ // otherwise set selector
807
+ self.set_selector( ui.item.value, ui.item.label );
808
+ }
809
  return false;
810
  },
811
  focus: function( e ) {
1009
  self.scrolltop();
1010
  },
1011
 
1012
+ /**
1013
+ * reset all qsid inputs
1014
+ * added v2.3.0
1015
+ */
1016
+ reset_qsid: function(){
1017
+ //console.log( 'resetting all qsid inputs...' );
1018
+ self.currqsid = null;
1019
+ $( '#ctc_sel_ovrd_rule_inputs' ).empty();
1020
+ $( '#ctc_sel_ovrd_new_rule,#input_row_load_order,#ctc_sel_ovrd_rule_inputs_container' ).hide().find( '.ctc-child-value' ).remove();
1021
+ $( '.ctc-rewrite-toggle' ).hide();
1022
+ },
1023
+
1024
  set_selector: function( value, label ) {
1025
  var self = this;
1026
  label = null;
1058
  self.reload = true;
1059
  self.load_selector_values();
1060
  },
1061
+
1062
  /**
1063
  * Retrieve data from server and execute callback on completion
1064
  */
1131
  }
1132
  $( '.save-icon' ).addClass( 'is-active' );
1133
  // add rename selector value if it exists
1134
+ $.each( [ 'query', 'selector' ], function( ndx, el ){
1135
+ if ( $( '#ctc_rewrite_' + el ).length ){
1136
+
1137
+ newsel = $( '#ctc_rewrite_' + el ).val();
1138
+ origsel = $( '#ctc_rewrite_' + el + '_orig' ).val();
1139
+ if ( self.is_empty( newsel ) || !newsel.toString().match( /\w/ ) ) {
1140
+ newsel = origsel;
1141
+ } else {
1142
+ postdata[ 'ctc_rewrite_' + el ] = newsel;
1143
+ self.reload = true;
1144
+ }
1145
+ $( '#ctc_sel_ovrd_' + el + '_selected' ).html( newsel );
1146
  }
1147
  $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
 
1148
  } );
1149
  // add wp ajax action to array
1150
  //console.log( $( '#ctc_action' ).val() );
1280
  update: {
1281
  // render individual selector inputs on Query/Selector tab
1282
  qsid: function( res ) {
 
1283
  var self = this,
1284
  id, html, val, empty;
1285
  self.currqsid = res.key;
1286
  self.currdata = res.data;
1287
+ //console.log( 'update: ' + self.reload );
1288
  //console.log( 'update.qsid: ' + self.currqsid );
1289
  $( '#ctc_sel_ovrd_qsid' ).val( self.currqsid );
1290
  if ( self.is_empty( self.currdata.seq ) ) {
1299
  if ( self.is_empty( self.currdata.value ) ) {
1300
  //console.log( 'qsdata is empty' );
1301
  empty = true;
1302
+ $( '#ctc_sel_ovrd_rule_inputs' ).empty();
1303
+ // prune empty selectors after clearing data to prune
1304
+ self.load_selectors();
1305
  } else {
1306
  //console.log( 'qsdata NOT empty' );
1307
  empty = false;
1321
  //console.log( 'reload menus: ' + ( self.reload ? 'true' : 'false' ) );
1322
  if ( self.reload ) {
1323
  self.load_queries();
1324
+ self.load_selectors();
1325
  self.set_query( self.currdata.query );
1326
  self.load_rules();
1327
  }
1328
  $( '#ctc_sel_ovrd_selector_selected' ).text( self.currdata.selector );
1329
+
1330
+ self.maybe_show_rewrite();
1331
+ if ( empty ){
1332
+ self.reset_qsid();
 
 
 
1333
  } else {
1334
+ $(
1335
+ '#ctc_sel_ovrd_rule_header,' +
1336
  '#ctc_sel_ovrd_new_rule,' +
1337
  '#ctc_sel_ovrd_rule_inputs_container,' +
1338
+ '#ctc_sel_ovrd_rule_inputs,' +
1339
+ '#input_row_load_order'
1340
+ ).fadeIn();
1341
  }
1342
  //self.scrolltop();
1343
  // }
1863
  } );
1864
  },
1865
  parse_page: function( themetype, body ){
 
1866
  var self = this,
1867
+ themepath = window.ctcAjax.theme_dir,
1868
+ //themepath = window.ctcAjax.theme_uri.replace( /^https?:\/\//, '' ),
1869
  stylesheet = ( 'child' === themetype ? $.chldthmcfg.currchild : $.chldthmcfg.currparnt ),
1870
  escaped = self.escrgx( $.chldthmcfg.currparnt ) + ( 'child' === themetype ? '|' + self.escrgx( stylesheet ) : '' ),
1871
  regex_link = new RegExp( "<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?" +
1877
  queue,
1878
  csslink;
1879
 
1880
+ // console.log( 'parsing page: ' + themetype );
1881
  if ( 'child' === themetype ) {
1882
+ var parts = body.match( /^[\s\S]*?<head>([\s\S]*?)<\/head>/ );
1883
+ if ( parts ){
1884
+ // console.log( parts[ 1 ] );
1885
+ }
1886
  }
1887
  // retrieve enqueued stylesheet ids
1888
  if ( ( queue = body.match( /BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/ ) ) ) {
1902
  }
1903
  if ( body.match( /CHLD_THM_CFG_IGNORE_PARENT/ ) ) {
1904
  self.analysis[ themetype ].signals.thm_ignoreparnt = 1;
1905
+ // console.log( 'signal: thm_ignoreparnt' );
1906
  }
1907
  if ( body.match( /IS_CTC_THEME/ ) ) {
1908
  self.analysis[ themetype ].signals.thm_is_ctc = 1;
1909
+ // console.log( 'signal: thm_is_ctc' );
1910
  }
1911
 
1912
  if ( body.match( /NO_CTC_STYLES/ ) ) {
1913
  self.analysis[ themetype ].signals.thm_no_styles = 1;
1914
+ // console.log( 'signal: thm_no_styles' );
1915
  }
1916
  if ( body.match( /HAS_CTC_IMPORT/ ) ) {
1917
  self.analysis[ themetype ].signals.thm_has_import = 1;
1918
+ // console.log( 'signal: thm_has_import' );
1919
+ }
1920
+
1921
+ if ( body.match( /HAS_WP_CACHE/ ) ) {
1922
+ self.analysis[ themetype ].signals.thm_has_cache = 1;
1923
+ // console.log( 'signal: thm_has_cache' );
1924
+ }
1925
+
1926
+ if ( body.match( /HAS_WP_ROCKET/ ) ) {
1927
+ self.analysis[ themetype ].signals.thm_has_wprocket = 1;
1928
+ // console.log( 'signal: thm_has_wprocket' );
1929
+ }
1930
+
1931
+ if ( body.match( /HAS_AUTOPTIMIZE/ ) ) {
1932
+ self.analysis[ themetype ].signals.thm_has_autoptimize = 1;
1933
+ // console.log( 'signal: thm_has_autoptimize' );
1934
  }
1935
 
1936
  // remove comments to avoid flagging conditional stylesheets ( IE compatability, etc. )
1937
  body = body.replace( /<!\-\-[\s\S]*?\-\->/g, '' );
1938
+ // console.log( 'PARSE: ' + regex_link );
1939
  while ( ( msg = regex_err.exec( body ) ) ) {
1940
  var errstr = msg[ 0 ].replace( /<.*?>/g, '' );
1941
  self.phperr[ themetype ].push( errstr );
1942
  self.analysis[ themetype ].signals.err_php = 1;
1943
  if ( errstr.match( /Fatal error/i ) ) {
1944
  self.analysis[ themetype ].signals.err_fatal = 1;
1945
+ // console.log( 'signal: err_fatal' );
1946
  }
1947
  //else if ( errstr.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
1948
  //analysis.signals.err_fnf = 1;
1954
  stylesheetpath = csslink[ 4 ],
1955
  linktheme = $.chldthmcfg.currparnt === stylesheettheme ? 'parnt' : 'child',
1956
  noid = 0;
1957
+ // console.log( 'stylesheetid: ' + stylesheetid + ' stylesheetpath: ' + stylesheetpath );
1958
  // flag stylesheet links that have no id or are not in wp_styles
1959
  if ( '' === stylesheetid || -1 === $.inArray( stylesheetid, self.analysis[ themetype ].queue ) ) {
1960
  noid = 1;
1961
+ // console.log( 'no id for ' + stylesheetpath + ' in ' + themetype + '!' );
1962
  } else if ( 0 === stylesheetid.indexOf( 'chld_thm_cfg' ) ) { // handle ctc-generated links
1963
+ // console.log( 'ctc link detected: ' + stylesheetid + ' in ' + themetype );
1964
+ if ( stylesheetpath.match( /^ctc\-style.*?\.css$/ ) ) {
1965
+ // console.log( 'separate stylesheet detected' );
1966
  themeloaded = 1;
1967
  self.analysis[ themetype ].signals.ctc_sep_loaded = 1; // flag that separate stylesheet has been detected
1968
  } else if ( stylesheetpath.match( /^ctc\-genesis([\-\.]min)?\.css$/ ) ) {
1969
+ // console.log( 'genesis stylesheet detected' );
1970
  themeloaded = 1;
1971
  self.analysis[ themetype ].signals.ctc_gen_loaded = 1; // flag that genesis "parent" has been detected
1972
+ } else if ( stylesheetid.match( /^chld_thm_cfg_ext/ ) ) {
1973
+ // console.log( 'external stylesheet detected' );
1974
+ // rtl test added v2.3.0
1975
+ if ( stylesheetpath.match( /rtl.*?\.css$/ ) ) {
1976
+ // console.log( 'flagging as RTL' );
1977
+ self.analysis[ themetype ].signals.thm_rtl = 1;
1978
+ // do not set dependency because all users may not use rtl
1979
+ } else {
1980
+ // console.log( 'adding external stylesheet dependency' );
1981
+ self.analysis[ themetype ].signals.ctc_ext_loaded = 1; // flag that external stylesheet link detected
1982
+ self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1983
+ }
1984
  } else if ( 'chld_thm_cfg_child' === stylesheetid ) {
1985
  self.analysis[ themetype ].signals.ctc_child_loaded = 1; // flag that ctc child stylesheet link detected
1986
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1987
+ // console.log( 'signal: ctc_child_loaded' );
1988
  } else if ( 'chld_thm_cfg_parent' === stylesheetid ) {
1989
  self.analysis[ themetype ].signals.ctc_parnt_loaded = 1; // flag that ctc parent stylesheet link detected
1990
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1991
+ // console.log( 'signal: ctc_parnt_loaded' );
1992
  if ( themeloaded ){
1993
+ // console.log( 'parent link out of sequence' );
1994
  self.analysis[ themetype ].signals.ctc_parnt_reorder = 1; // flag that ctc parent stylesheet link out of order
1995
  }
1996
  }
1997
  continue;
1998
  }
1999
  // flag main theme stylesheet link
2000
+ if ( stylesheetpath.match( /^style.*?\.css$/ ) ) {
2001
+ // console.log( linktheme + ' theme stylesheet detected: ' + stylesheettheme + '/' + stylesheetpath );
2002
  themeloaded = 1; // flag that main theme stylesheet has been detected
2003
  // if main theme stylesheet link has no id then it is unregistered ( hard-wired )
2004
  if ( 'parnt' === linktheme ) {
2005
  if ( noid ) {
2006
  self.analysis[ themetype ].signals.thm_parnt_loaded = 'thm_unregistered';
2007
+ // console.log( 'signal: thm_parnt_loaded: thm_unregistered' );
2008
  } else {
2009
  self.analysis[ themetype ].signals.thm_parnt_loaded = stylesheetid;
2010
+ // console.log( 'signal: thm_parnt_loaded: ' + stylesheetid );
2011
  // check that parent stylesheet is loaded before child stylesheet
2012
  if ( 'child' === themetype && self.analysis[ themetype ].signals.thm_child_loaded ) {
2013
  self.analysis[ themetype ].signals.ctc_parnt_reorder = 1;
2014
+ // console.log( 'signal: ctc_parnt_reorder' );
2015
  }
2016
  }
2017
  } else {
2018
  self.analysis[ themetype ].signals.thm_child_loaded = noid ? 'thm_unregistered' : stylesheetid;
2019
+ // console.log( 'signal: thm_child_loaded: ' + self.analysis[ themetype ].signals.thm_child_loaded );
2020
  }
2021
  if ( noid ) {
2022
  if ( testloaded ) {
2023
  self.analysis[ themetype ].signals.thm_past_wphead = 1;
2024
  self.analysis[ themetype ].deps[ themeloaded ].push( [ 'thm_past_wphead', stylesheetpath ] );
2025
+ // console.log( 'signal: thm_past_wphead (Unreachable theme stylesheet detected ' + stylesheetpath );
2026
  } else {
2027
  self.analysis[ themetype ].signals.thm_unregistered = 1;
2028
  self.analysis[ themetype ].deps[ themeloaded ].push( [ 'thm_unregistered', stylesheetpath ] );
2029
+ // console.log( 'signal: thm_unregistered (Unregistered theme stylesheet detected) ' + stylesheetpath );
2030
  }
2031
  } else {
2032
  self.analysis[ themetype ].deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
2033
+ // console.log( 'Theme stylesheet OK! ' + stylesheetid + ' ' + stylesheetpath );
2034
  }
2035
 
2036
+ } else if ( stylesheetpath.match( /rtl.*?\.css$/ ) ) {
2037
+ self.analysis[ themetype ].signals.thm_rtl = 1;
2038
  } else if ( 'ctc-test.css' === stylesheetpath ) { // flag test stylesheet link
2039
+ // console.log( 'end of queue reached' );
2040
  testloaded = 1; // flag that test queue has been detected ( end of wp_head )
2041
  } else {
2042
  var err = null;
2047
  }
2048
  if ( testloaded ) {
2049
  if ( themeloaded ) {
2050
+ // console.log( 'Unreachable stylesheet detected!' + stylesheetpath );
2051
  err = 'css_past_wphead';
2052
  } else {
2053
  err = 'dep_past_wphead';
2067
  if ( ! themeloaded ){
2068
  self.analysis[ themetype ].signals.thm_notheme = 1; // flag that no theme stylesheet has been detected
2069
  }
2070
+ // console.log( 'analysis of ' + themetype + ':' );
2071
+ // console.log( self.analysis[ themetype ] );
2072
  },
2073
 
2074
  /**
2087
  errnotice = {
2088
  style: 'notice-warning',
2089
  headline: $.chldthmcfg.getxt( 'anlz3', name ),
2090
+ errlist: '',
2091
+ msg: $.chldthmcfg.getxt( 'anlz7' )
2092
  },
2093
  resubmit = 0,
2094
  resubmitdata= {},
2095
  anlz,
2096
  debugtxt = '',
2097
+ dep_inputs,
2098
+ errflags = {};
2099
 
2100
  if ( self.analysis[ themetype ].signals.failure ||
2101
  ( self.analysis[ themetype ].signals.thm_noqueue && !self.phperr[ themetype ].length ) ) {
2112
  if ( self.phperr[ themetype ].length ) {
2113
  $.each( self.phperr[ themetype ], function( index, err ) {
2114
  if ( err.match( /Fatal error/i ) ) {
2115
+ errflags.fatal = 1;
2116
+ }
2117
+ if ( err.match( /Constant \w+ already defined in .+?wp-config.php/i ) ){
2118
+ errflags.config = 1;
2119
+ }
2120
  /*
2121
  if ( $.chldthmcfg.existing && err.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
2122
  //console.log( 'Probably using get_stylesheet_directory()' );
2125
  */
2126
  errnotice.errlist += err + "\n";
2127
  } );
2128
+ if ( errflags.fatal ){
2129
+ errnotice.style = 'error';
2130
+ errnotice.headline = $.chldthmcfg.getxt( 'anlz8', name );
2131
+ }
2132
+ if ( errflags.config ){
2133
+ errnotice.msg = $.chldthmcfg.getxt( 'anlzconfig', name ) + errnotice.msg;
2134
+ }
2135
  errnotice.msg = '<div style="background-color:#ffeebb;padding:6px">' +
2136
  '<div class="ctc-section-toggle" id="ctc_analysis_errs">' +
2137
  $.chldthmcfg.getxt( 'anlz6' ) + '</div>' +
2138
+ '<div id="ctc_analysis_errs_content"><textarea>' +
2139
  errnotice.errlist + '</textarea></div></div>' +
2140
+ errnotice.msg;
2141
  notice.notices.push( errnotice );
2142
  }
2143
+ // check for wp rocket + autoptimize combo & skip other analysis
2144
+ if ( self.analysis[ themetype ].signals.thm_has_wprocket && self.analysis[ themetype ].signals.thm_has_autoptimize ){
2145
  notice.notices.push( {
2146
+ headline: $.chldthmcfg.getxt( 'anlzcache1' ),
2147
  style: 'notice-warning',
2148
+ msg: $.chldthmcfg.getxt( 'anlzcache2' )
2149
  } );
2150
+ } else if ( !self.analysis[ themetype ].signals.thm_noqueue ) { // !errflags.fatal &&
2151
+ if ( self.analysis[ themetype ].signals.thm_past_wphead || self.analysis[ themetype ].signals.dep_past_wphead ) {
2152
+ // || self.analysis[ themetype ].signals.css_past_wphead ){
 
 
 
 
 
2153
  notice.notices.push( {
2154
+ headline: $.chldthmcfg.getxt( 'anlz9' ),
2155
  style: 'notice-warning',
2156
+ msg: $.chldthmcfg.getxt( 'anlz10' )
2157
  } );
 
2158
  $( '#ctc_repairheader' ).prop( 'checked', true );
2159
+ $( '#ctc_repairheader_container' ).show();
2160
  }
2161
+ if ( self.analysis[ themetype ].signals.thm_unregistered ) {
2162
+ if (
2163
+ !self.analysis[ themetype ].signals.ctc_child_loaded &&
2164
+ !self.analysis[ themetype ].signals.ctc_sep_loaded ){
2165
+ // test for stylesheet enqueue issues
2166
+ notice.notices.push( {
2167
+ headline: $.chldthmcfg.getxt( 'anlz11' ),
2168
+ style: 'notice-warning',
2169
+ msg: $.chldthmcfg.getxt( 'anlz12' )
2170
+ } );
2171
+ $( '#ctc_repairheader_container' ).show();
2172
+ $( '#ctc_repairheader' ).prop( 'checked', true );
2173
+ }
2174
  }
2175
+ if ( 'child' === themetype ) {
2176
+ if ( self.analysis.child.signals.ctc_parnt_reorder ) {
2177
+ // console.log( 'reorder flag detected, resubmitting.' );
2178
+ resubmit = 1;
2179
+ }
2180
+ if ( !self.analysis.child.signals.ctc_child_loaded &&
2181
+ !self.analysis.child.signals.ctc_sep_loaded &&
2182
+ !self.analysis.child.signals.thm_child_loaded ){
2183
+ notice.notices.push( {
2184
+ headline: $.chldthmcfg.getxt( 'anlz13' ),
2185
+ style: 'notice-warning',
2186
+ msg: $.chldthmcfg.getxt( 'anlz14' )
2187
+ } );
2188
+ resubmit = 1;
2189
+ }
2190
+ if ( self.analysis[ themetype ].signals.ctc_gen_loaded ) {
2191
+ notice.notices.push( {
2192
+ headline: $.chldthmcfg.getxt( 'anlz31' ),
2193
+ msg: $.chldthmcfg.getxt( 'anlz32' ),
2194
+ style: 'notice-warning'
2195
+ } );
2196
+ }
2197
+ if ( !self.analysis.parnt.signals.thm_no_styles &&
2198
+ !self.analysis.child.signals.ctc_gen_loaded &&
2199
+ !self.analysis.child.signals.thm_parnt_loaded &&
2200
+ !self.analysis.child.signals.ctc_parnt_loaded &&
2201
+ !self.analysis.child.signals.thm_ignoreparnt &&
2202
+ !self.analysis.child.signals.thm_has_import ){
2203
+ notice.notices.push( {
2204
+ headline: $.chldthmcfg.getxt( 'anlz15' ),
2205
+ style: 'notice-warning',
2206
+ msg: $.chldthmcfg.getxt( 'anlz16' )
2207
+ } );
2208
+ resubmit = 1;
2209
+ }
2210
+ if ( self.analysis.child.signals.thm_unregistered &&
2211
+ self.analysis.child.signals.thm_child_loaded &&
2212
+ 'thm_unregistered' === self.analysis.child.signals.thm_child_loaded &&
2213
+ self.analysis.child.signals.ctc_child_loaded &&
2214
+ self.analysis.child.signals.ctc_parnt_loaded ) {
2215
+ notice.notices.push( {
2216
+ headline: $.chldthmcfg.getxt( 'anlz28' ),
2217
+ style: 'notice-warning',
2218
+ msg: $.chldthmcfg.getxt( 'anlz29' )
2219
+ } );
2220
+ $( '#ctc_repairheader_container' ).show();
2221
+ $( '#ctc_repairheader' ).prop( 'checked', true );
2222
+ }
2223
+
2224
+ if ( !self.analysis.child.signals.thm_is_ctc &&
2225
+ !$( '#ctc_child_type_duplicate' ).is( ':checked' ) ) {
2226
+ notice.notices.push( {
2227
+ headline: $.chldthmcfg.getxt( 'anlz19' ),
2228
+ msg: $.chldthmcfg.getxt( 'anlz20' ),
2229
+ style: 'notice-warning'
2230
+ } );
2231
+ }
2232
+ if ( !self.analysis.child.signals.thm_rtl &&
2233
+ self.analysis.parnt.signals.thm_rtl ) {
2234
+ notice.notices.push( {
2235
+ headline: $.chldthmcfg.getxt( 'anlzrtl' ),
2236
+ msg: $.chldthmcfg.getxt( 'anlzrtl2' ),
2237
+ style: 'notice-warning'
2238
+ } );
2239
+ }
2240
+
2241
+ }
2242
+ // automatically set form inputs based on current analysis
2243
+ if ( self.analysis[ themetype ].signals.ctc_sep_loaded || self.analysis[ themetype ].signals.ctc_gen_loaded ){
2244
+ //console.log( 'Separate stylesheet detected' );
2245
+ $( '#ctc_handling_separate' ).prop( 'checked', true );
2246
+ }
2247
+ if ( !notice.notices.length ) {
2248
+ notice.notices.push( {
2249
+ headline: '' + ( 'child' === themetype ? $.chldthmcfg.getxt( 'anlz17' ) : $.chldthmcfg.getxt( 'anlz18' ) ) + '',
2250
+ style: 'updated',
2251
+ msg: ''
2252
  } );
 
2253
  }
2254
+
2255
+ if ( 'child' === themetype && self.analysis.child.signals.thm_has_import ) {
2256
  notice.notices.push( {
2257
+ headline: $.chldthmcfg.getxt( 'anlz21' ),
2258
+ msg: $.chldthmcfg.getxt( 'anlz22' ),
2259
  style: 'notice-warning'
2260
  } );
2261
+ //console.log( 'Import parent detected' );
2262
+ $( '#ctc_enqueue_import' ).prop( 'checked', true );
2263
  }
2264
+ if ( self.analysis[ themetype ].signals.thm_ignoreparnt || self.analysis[ themetype ].signals.ctc_gen_loaded ){
2265
+ //console.log( 'Ignore parent detected' );
2266
+ $( '#ctc_ignoreparnt' ).prop( 'checked', true );
2267
+ if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2268
+ $( '#ctc_enqueue_none' ).prop( 'checked', true );
2269
+ resubmit = 1;
2270
+ resubmitdata.ctc_enqueue = 'none';
2271
+ }
2272
+ } else {
2273
+ $( '#ctc_ignoreparnt' ).prop( 'checked', false );
 
 
2274
  }
2275
+ if ( !self.analysis[ themetype ].signals.ctc_sep_loaded &&
2276
+ !self.analysis[ themetype ].signals.ctc_gen_loaded &&
2277
+ !self.analysis[ themetype ].signals.ctc_child_loaded &&
2278
+ !self.analysis[ themetype ].signals.thm_unregistered &&
2279
+ !self.analysis[ themetype ].signals.thm_past_wphead &&
2280
+ self.analysis[ themetype ].deps[ 1 ].length ) {
2281
+ var sheets = '';
2282
+ $.each( self.analysis[ themetype ].deps[ 1 ], function( ndx, el ) {
2283
+ if ( el[ 1 ].match( /^style.*?\.css$/ ) ) { return; }
2284
+ sheets += '<li>' + el[ 1 ] + "</li>\n";
2285
  } );
2286
+ if ( '' !== sheets ) {
2287
+ sheets = "<ul class='howto' style='padding-left:1em'>\n" + sheets + "</ul>\n";
 
 
 
 
2288
  notice.notices.push( {
2289
+ headline: $.chldthmcfg.getxt( 'anlz23' ),
2290
+ msg: sheets + $.chldthmcfg.getxt( 'anlz24' ),
2291
+ style: 'updated'
2292
  } );
2293
+ }
2294
  }
2295
+ if ( 'child' === themetype && self.analysis[ themetype ].signals.thm_parnt_loaded ) {
2296
+ //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2297
+ notice.notices.push( {
2298
+ headline: $.chldthmcfg.getxt( 'anlz25' ),
2299
+ msg: $.chldthmcfg.getxt( 'anlz26' ),
2300
+ style: 'updated'
2301
+ } );
2302
+ //}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2303
  $( '#ctc_enqueue_none' ).prop( 'checked', true );
2304
  resubmit = 1;
2305
  resubmitdata.ctc_enqueue = 'none';
2306
  }
2307
+ // if no parent styles, no need to enqueue
2308
+ if ( self.analysis.parnt.signals.thm_no_styles ) {
2309
+ //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2310
+ notice.notices.push( {
2311
+ headline: $.chldthmcfg.getxt( 'anlz27' ),
2312
+ msg: $.chldthmcfg.getxt( 'anlz26' ),
2313
+ style: 'updated'
2314
+ } );
2315
+ //}
2316
+ $( '#ctc_enqueue_none' ).prop( 'checked', true );
2317
+ resubmit = 1;
2318
+ resubmitdata.ctc_enqueue = 'none';
 
 
 
 
 
 
 
 
 
2319
  }
2320
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2321
  }
2322
 
2323
  /**
js/chldthmcfg.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e){"use strict";e.chldthmcfg={escquo:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},getname:function(t){var c=this,n="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;return c.is_empty(window.ctcAjax.themes[t][n])?"":window.ctcAjax.themes[t][n].Name},frascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},toascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e,t){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if("undefined"!=typeof t&&"0"===e||0===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var c in e)if(e.hasOwnProperty(c))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(window.ctcAjax.themes,function(a,i){return e.each(i,function(e,i){return i=null,e.toLowerCase()!==t.toLowerCase()||"parnt"!==a&&"new"!==c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/g,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c):"",a=e("#ctc_theme_child").length&&!t.is_empty(e("#ctc_theme_child").val())?e("#ctc_theme_child").val().toString().replace(c):n,i=e("input[name=ctc_child_type]:checked").val(),s=[];return"new"===i&&(a=n),t.theme_exists(a,i)&&s.push(t.getxt("theme_exists").toString().replace(/%s/,a)),t.is_empty(a)&&s.push(t.getxt("inval_theme")),s.length?(t.set_notice({error:s}),!1):"reset"===i?!!confirm(t.getxt("load")):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",a=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?n:c+"-child",i=a,s=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?e.chldthmcfg.getname("child"):e.chldthmcfg.getname("parnt")+" Child",l="",r="",o="00";t.theme_exists(i,"new");)l=t.is_empty(l)?2:l+1,r=o.substring(0,o.length-l.toString().length)+l.toString(),i=a+r;t.testslug=i,t.testname=s+(r.length?" "+r:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.escquo(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},coalesce_inputs:function(t){var c=this,n=e(t).attr("id"),a=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,i=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),s=i.find(".ctc-swatch").first(),l={parent:{},child:{}},r={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return i.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,i,s=e(this).attr("id"),d=s.toString().match(a),u=d[2],h=d[3],p="undefined"==typeof d[4]?"":d[4],m=d[7],g=d[5],f="undefined"==typeof d[7]?"":d[8],y="parent"===h?e(this).text().replace(/!$/,""):"seq"!==p&&"ctc_delete_query_selector"===n?"":e(this).val(),v="seq"===p?!1:"ctc_"+u+"_child_"+p+"_i_"+g+"_"+m;if("child"===h&&(c.is_empty(e(this).data("color"))||(y=c.color_text(e(this).data("color")),e(this).data("color",null)),_[s]=y,v&&(_[v]=e("#"+v).is(":checked")?1:0)),""!==y)if(c.is_empty(f))if(t=p.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!y.match(/none/)){var w=new RegExp(c.border_regx+c.color_regx,"i");i=y.toString().match(w),c.is_empty(i)||(i.shift(),l[h][p+"-width"]=i.shift()||"",i.shift(),l[h][p+"-style"]=i.shift()||"",l[h][p+"-color"]=i.shift()||"")}else if("background-image"!==p||y.match(/none/))"seq"!==p&&(l[h][p]=y);else if(y.toString().match(/url\(/))l[h]["background-image"]=c.image_url(h,y);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");i=y.toString().match(x),!c.is_empty(i)&&i.length>2?(i.shift(),r[h].origin=i.shift()||"top",r[h].start=i.shift()||"transparent",r[h].end=i.shift()||"transparent",o[h]=!0):l[h]["background-image"]=y}else switch(f){case"_border_width":l[h][p+"-width"]="none"===y?0:y;break;case"_border_style":l[h][p+"-style"]=y;break;case"_border_color":l[h][p+"-color"]=y;break;case"_background_url":l[h]["background-image"]=c.image_url(h,y);break;case"_background_color":l[h]["background-color"]=y;break;case"_background_color1":r[h].start=y,o[h]=!0;break;case"_background_color2":r[h].end=y,o[h]=!0;break;case"_background_origin":r[h].origin=y,o[h]=!0}}),"undefined"==typeof s||c.is_empty(s.attr("id"))||(s.removeAttr("style"),o.parent&&s.ctcgrad(r.parent.origin,[r.parent.start,r.parent.end]),s.css(l.parent),s.attr("id").toString().match(/parent/)||(o.child&&s.ctcgrad(r.child.origin,[r.child.start,r.child.end]),s.css(l.child)),s.css({"z-index":-1})),_},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c,n=this,a={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i,s=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(s),n.is_empty(c)&&(c=[]),a.names=["_border_width","_border_style","_border_color"],i=c.shift(),a.values[0]=c.shift()||"",c.shift(),a.values[1]=c.shift()||"",c.shift(),a.values[2]=c.shift()||""}else if(e.toString().match(/^background\-image/))if(a.names=["_background_url","_background_origin","_background_color1","_background_color2"],a.values=["","","",""],n.is_empty(t)||t.toString().match(/(url|none)/))a.values[0]=t;else{var l,r;c=t.toString().split(/:/),a.values[1]=c.shift()||"",a.values[2]=c.shift()||"",l=c.shift()||"",a.values[3]=c.shift()||"",r=c.shift()||"",a.orig=[a.values[1],a.values[2],a.values[3]].join(" ")}return a},image_url:function(e,t){var c,n=this,a=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),i=n.is_empty(a)?null:a[1],s=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return i?c=i.toString().match(/^(data:|https?:|\/)/)?t:"url("+s+i+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.currquery)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.currquery)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.currqsid)},get_queries:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var a=this,i={},s=n?c.child.pop():null;return e.each(["parnt","child"],function(t,l){a.is_empty(c[l])||e.each(c[l],function(e,t){n?parseInt(t[2])>=parseInt(s[2])&&(s[2]=parseInt(t[2])+1):(a.is_empty(i[t[2]])&&(i[t[2]]={}),i[t[2]][l]=t)})}),n&&(i[s[2]]={parnt:[],child:s}),i},input_row:function(t,c,n,a,i){var s=this,l="";if(!s.is_empty(a)&&!s.is_empty(a.value)&&!s.is_empty(a.value[c])){var r=a.value[c],o=s.merge_ruleval_arrays(c,r,i);e.each(o,function(i,r){var o=s.decode_value(c,s.is_empty(r.parnt)?"":r.parnt[0]),_=s.is_empty(r.parnt)||s.is_empty(r.parnt[1],1)?0:1,d=s.decode_value(c,s.is_empty(r.child)?"":r.child[0]),u=s.is_empty(r.child)||s.is_empty(r.child[1],1)?0:1;if(l+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',l+="ovrd"===n?c.replace(/\d+/g,s.frascii):a.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+s.getxt("edit")+"</a> "+(s.is_empty(o.orig)?s.getxt("child_only"):""),l+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+i+'">'+(s.is_empty(o.orig)?"[no value]":o.orig+(_?s.getxt("important"):""))+'</div><div class="ctc-input-cell">',!s.is_empty(o.names)){e.each(o.names,function(e,a){a=s.is_empty(a)?"":a,l+='<div class="ctc-child-input-cell ctc-clear">';var r,o="ctc_"+n+"_child_"+c+"_"+t+"_"+i+a;!1===(r=d.values.shift())&&(r=""),l+=(s.is_empty(a)?"":s.getxt(a)+":<br/>")+'<input type="text" id="'+o+'" name="'+o+'" class="ctc-child-value'+((a+c).toString().match(/color/)?" color-picker":"")+(a.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+s.escquo(r)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+i;l+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+s.getxt("important")+"</label>"}l+="</div>","ovrd"!==n&&(l+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+i+'_swatch">'+s.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+i+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+i+'" name="ctc_save_'+c+"_"+t+"_"+i+'" value="Save" /></div>'),l+="</div><!-- end input row -->\n"})}return l},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=!c.is_empty(window.ctcAjax.palette);try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:!!n,showSelectionPalette:!!n,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+window.ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(){c.coalesce_inputs(this)}).on("keyup",function(){var t=this,n=c.addhash(e(this).val());e(t).val(n),clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(t),e(t).spectrum("set",n)},500))})}catch(a){c.jquery_exception(a,"Spectrum Color Picker")}},addhash:function(e){return e.replace(/^#?([a-f0-9]{3,6}.*)/,"#$1")},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Property Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault();var a,i,s=n.item.label.replace(/[^\w\-]/g,t.toascii);return t.is_empty(t.currdata.value)&&(t.currdata.value={}),t.is_empty(t.currdata.value[n.item.label])&&(t.currdata.value[n.item.label]={}),t.is_empty(t.currdata.value[n.item.label].child)&&(t.currdata.value[n.item.label].child=[]),t.currdata.value[n.item.label].child.push(["",0,1,1]),a=e(t.input_row(t.currqsid,s,"ovrd",t.currdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(a),e("#ctc_new_rule_menu").val(""),a.find('input[type="text"]').each(function(c,n){i||(i=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),i&&e(i).focus(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property Menu")}},set_theme_params:function(t,c){e("#ctc_child_author").val(window.ctcAjax.themes[t][c].Author),e("#ctc_child_version").val(window.ctcAjax.themes[t][c].Version),e("#ctc_child_authoruri").val(window.ctcAjax.themes[t][c].AuthorURI),e("#ctc_child_themeuri").val(window.ctcAjax.themes[t][c].ThemeURI),e("#ctc_child_descr").val(window.ctcAjax.themes[t][c].Descr),e("#ctc_child_tags").val(window.ctcAjax.themes[t][c].Tags)},update_form:function(){var t,c=this;e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug").slideUp("fast"),e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_theme_child").length&&!e("#ctc_child_type_new").is(":checked")?(t=e("#ctc_theme_child").val(),c.existing=1,c.currparnt=window.ctcAjax.themes.child[t].Template,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(c.getname("parnt")),c.set_theme_params("child",t),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_child_template").val(c.testslug),e("#ctc_child_name").val(c.testname),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Duplicate Child Theme")):e("#ctc_child_type_reset").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("3"),e("#ctc_configure_submit").slideDown("fast"),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").hide(),e("#ctc_enqueue_none").prop("checked",!0),e("#ctc_load_styles").val("Reset Child Theme to Previous State")):(e("#ctc_child_template").val(""),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_child_name").val(c.getname("child")),e("#ctc_load_styles").val("Configure Child Theme")),e("#input_row_existing_theme_option").slideDown("fast"),e("#input_row_new_theme_option").slideUp("fast")):(c.existing=0,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(e.chldthmcfg.getname("parnt")),c.set_theme_params("parnt",c.currparnt),e("#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug").slideUp("fast"),e("#input_row_new_theme_option").slideDown("fast"),e("#ctc_child_name").val(c.testname),e("#ctc_child_template").val(c.testslug),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Create New Child Theme"))},set_notice:function(t){var c,n=this,a="";n.is_empty(t)||e.each(t,function(t,c){a+='<div class="'+t+' notice is-dismissible dashicons-before"><ul>\n',e(c).each(function(e,t){a+="<li>"+t.toString()+"</li>\n"}),a+="</ul></div>"}),c=e(a),e("#ctc_error_notice").html(c),n.bind_dismiss(c),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(e){var t=this;t.currparnt=e.value,t.update_form()},set_child_menu:function(e){var t=this;t.currchild=e.value,t.update_form()},set_query:function(t){var c=this;return c.is_empty(t)?!1:(c.currquery=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors(),void c.scrolltop())},set_selector:function(t,c){var n=this;return c=null,n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.currqsid=t,n.reload=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t),void n.scrolltop())},set_qsid:function(t){var c=this;c.currqsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload=!0,c.load_selector_values()},query_css:function(t,c,n){var a=this,i={ctc_query_obj:t,ctc_query_key:c},s="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){i["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(s+" .ctc-status-icon").remove(),e(s).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),i.action=a.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",i._wpnonce=e("#_wpnonce").val(),a.ajax_post(t,i)},save:function(t){var c,n,a,i,s,l=this,r={},o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),r.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(r.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(r.ctc_sel_ovrd_query=n.text()),l.reload=!0):(a=e("#ctc_child_imports"))&&"ctc_save_imports"===o?r.ctc_child_imports=a.val():"ctc_is_debug"===o?r.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:r=l.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){i=e("#ctc_rewrite_selector").val(),s=e("#ctc_rewrite_selector_orig").val(),l.is_empty(i)||!i.toString().match(/\w/)?i=s:(r.ctc_rewrite_selector=i,l.reload=!0),e(".ctc-rewrite-toggle").text(l.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(i)}),r.action=l.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",r._wpnonce=e("#_wpnonce").val(),l.ajax_post("qsid",r)},ajax_post:function(t,c,n){var a=this;e.ajax({url:window.ctcAjax.ajaxurl,data:c,dataType:a.is_empty(n)?"json":n,type:"POST"}).done(function(e){a.handle_success(t,e)}).fail(function(){a.handle_failure(t)}).always(function(){a.jqueryerr.length&&a.jquery_notice()})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"===t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,a=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jqueryerr.push("<code><small>"+t+": "+e.message+a+n+"</small></code>")},jquery_notice:function(t){t=null;var c=this,n=[],a=[];c.jqueryerr.length&&(e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var t=e(this).prop("src");c.is_empty(t)||!t.match(/jquery(\.min|\.js|\-?ui)/i)||t.match(/load\-scripts.php/)||n.push("<code><small>"+t.split(/\?/)[0]+"</small></code>")}),a.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),a.push(c.jqueryerr.join("<br/>")),n.length&&a.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),a.push(c.getxt("plugin"))),c.set_notice({error:a})},update:{qsid:function(t){var c,n,a,i,s=this;s.currqsid=t.key,s.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(s.currqsid),s.is_empty(s.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+s.currqsid,a=parseInt(s.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+a+'" />',e("#ctc_child_load_order_container").html(n)),s.is_empty(s.currdata.value)?(i=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(i=!1,n="",e.each(s.currdata.value,function(e,t){t=null,n+=s.input_row(s.currqsid,e,"ovrd",s.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){s.setup_spectrum(this)}),s.coalesce_inputs("#ctc_child_all_0_swatch")),s.reload&&(s.load_queries(),s.set_query(s.currdata.query),s.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(s.currdata.selector),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e(".ctc-rewrite-toggle").show(),i?e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").hide():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").show()},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),a='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var i=c.decode_value(n,t);a+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+i.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),a+="</div>\n"),e("#ctc_rule_value_inputs").html(a).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c,n,a=this,i="";a.is_empty(t.data)||e.each(t.data,function(n,s){c=n,e.each(s,function(c,s){i+='<h4 class="ctc-query-heading">'+c+"</h4>\n",a.is_empty(s)||e.each(s,function(e,c){i+=a.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(i).find(".color-picker").each(function(){a.setup_spectrum(this)}),e(n).find(".ctc-swatch").each(function(){a.coalesce_inputs(this)})},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_box").val(e("#ctc_debug_box").val()+t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)},dismiss:function(){}},bind_dismiss:function(t){var c=this,n=e(t),a=e('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),i=window.commonL10n.dismiss||"";a.find(".screen-reader-text").text(i),n.append(a),a.on("click.wp-dismiss-notice",function(e){e.preventDefault(),c.dismiss_notice(t)})},dismiss_notice:function(t){e(t).fadeTo(100,0,function(){e(this).slideUp(100,function(){e(this).remove()})})},reset_handling:function(){e("#parnt_analysis_notice .notice, #child_analysis_notice .notice").slideUp(),e("#ctc_enqueue_enqueue").prop("checked",!0),e("#ctc_handling_primary").prop("checked",!0),e("#ctc_ignoreparnt").prop("checked",!1),e("#ctc_repairheader").prop("checked",!1)},init:function(){var t=this;if(!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>"),a=c.value.replace(/[^\w\-]/g,"");return e("#ctc_theme_option_"+a).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.reset_handling(),t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(window.ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.reset_handling(),t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.currparnt=e("#ctc_theme_parnt").val(),t.currchild=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",e("#ctc_main").on("click",".ctc-section-toggle",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .notice-warning, .updated, .error").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#ctc_main").on("click",".ctc-upgrade-notice .notice-dismiss",function(){var c={action:"ctc_dismiss",_wpnonce:e("#_wpnonce").val()};t.ajax_post("dismiss",c)}),t.is_empty(t.jqueryerr)&&(e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n,a,i=e(this).attr("id").toString().replace("_close",""),s=i.toString().match(/_([^_]+)_(\d+)$/);e("#"+i+"_container").is(":hidden")&&(t.is_empty(s[1])||t.is_empty(s[2])||(n=s[1],a=s[2],t.query_css("val_qry",a,{rule:n}))),e("#"+i+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+i+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_main").on("click",".ctc-backup-theme",function(c){c.preventDefault(),t.existing?e("#ctc_export_theme").val(t.currchild):e("#ctc_export_theme").val(t.currparnt),e("#ctc_export_theme_form").submit()}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"===c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){if(c.preventDefault(),e(c.target).hasClass("ctc-disabled"))return!1;e(".ctc-query-icon,.ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e("#view_child_options, #view_parnt_options").on("click",function(c){return e(c.target).hasClass("ajax-pending")||e(c.target).hasClass("ctc-disabled")?!1:(e(c.target).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){c.preventDefault();var n=e("#ctc_save_query_selector");return n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}),e("#ctc_rule_value_form").on("submit",function(e){return e.preventDefault(),!1}),e("#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset").on("focus click",function(){t.reset_handling(),t.update_form()}),e("#ctc_is_debug").on("change",function(){e(this).is(":checked")?e("#ctc_debug_box").length||e("#ctc_debug_container").html('<textarea id="ctc_debug_box"></textarea>'):e("#ctc_debug_box").remove(),t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),t.update_form()),t.jqueryerr.length&&t.jquery_notice()},testslug:"",testname:"",reload:!1,currquery:"base",currqsid:null,currdata:{},currparnt:"",currchild:"",existing:!1,jqueryerr:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmanalyze={escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},show_loading:function(t,c){var n=e.chldthmcfg.existing?"child":"parnt",a=c?c:e.chldthmcfg.getname(n),i='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+a+"...</strong>";self.noticediv="",e("#"+n+"_analysis_notice").html(i)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},setssl:function(e){return e.replace(/^https?/,window.ctcAjax.ssl?"https":"http")},analyze_theme:function(t){var c=this,n=Math.floor(e.now()/1e3),a="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,i="&template="+encodeURIComponent(e.chldthmcfg.currparnt)+"&stylesheet="+encodeURIComponent(a)+"&now="+n,s=c.setssl(window.ctcAjax.homeurl),l=s+i;c.analysis[t].url=l,e.get(l,function(n){c.parse_page(t,n),e(document).trigger("analysisdone")}).fail(function(n,i,s){c.analysis[t].signals.xhrgeterr=s,e.ajax({url:window.ctcAjax.ajaxurl,data:{action:"ctc_analyze",stylesheet:a,template:e.chldthmcfg.currparnt,_wpnonce:e("#_wpnonce").val()},dataType:"json",type:"POST"}).done(function(n){n.signals.httperr?(c.analysis[t].signals.failure=1,c.analysis[t].signals.httperr=n.signals.httperr):c.parse_page(t,n.body),e(document).trigger("analysisdone")}).fail(function(n,a,i){c.analysis[t].signals.failure=1,c.analysis[t].signals.xhrajaxerr=i,e(document).trigger("analysisdone")})})},parse_page:function(t,c){var n,a,i,s=this,l=window.ctcAjax.theme_uri.replace(/^https?:\/\//,""),r="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,o=s.escrgx(e.chldthmcfg.currparnt)+("child"===t?"|"+s.escrgx(r):""),_=new RegExp("<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?"+s.escrgx(l)+"/("+o+")/([^\"']+\\.css)(\\?[^\"']+)?[\"'][^>]+>","gi"),d=/<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,u=0,h=0;
2
- for((a=c.match(/BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/))?s.analysis[t].queue=a[1].split(/\n/):(s.analysis[t].queue=[],s.analysis[t].signals.thm_noqueue=1),(a=c.match(/BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/))?s.analysis[t].irreg=a[1].split(/\n/):s.analysis[t].irreg=[],c.match(/CHLD_THM_CFG_IGNORE_PARENT/)&&(s.analysis[t].signals.thm_ignoreparnt=1),c.match(/IS_CTC_THEME/)&&(s.analysis[t].signals.thm_is_ctc=1),c.match(/NO_CTC_STYLES/)&&(s.analysis[t].signals.thm_no_styles=1),c.match(/HAS_CTC_IMPORT/)&&(s.analysis[t].signals.thm_has_import=1),c=c.replace(/<!\-\-[\s\S]*?\-\->/g,"");n=d.exec(c);){var p=n[0].replace(/<.*?>/g,"");s.phperr[t].push(p),s.analysis[t].signals.err_php=1,p.match(/Fatal error/i)&&(s.analysis[t].signals.err_fatal=1)}for(;i=_.exec(c);){var m=s.trmcss(i[2]),g=i[3],f=i[4],y=e.chldthmcfg.currparnt===g?"parnt":"child",v=0;if(""===m||-1===e.inArray(m,s.analysis[t].queue))v=1;else if(0===m.indexOf("chld_thm_cfg")){f.match(/^ctc\-style([\-\.]min)?\.css$/)?(u=1,s.analysis[t].signals.ctc_sep_loaded=1):f.match(/^ctc\-genesis([\-\.]min)?\.css$/)?(u=1,s.analysis[t].signals.ctc_gen_loaded=1):m.match(/$chld_thm_cfg_ext/)?(s.analysis[t].signals.ctc_ext_loaded=1,s.analysis[t].deps[u].push([m,f])):"chld_thm_cfg_child"===m?(s.analysis[t].signals.ctc_child_loaded=1,s.analysis[t].deps[u].push([m,f])):"chld_thm_cfg_parent"===m&&(s.analysis[t].signals.ctc_parnt_loaded=1,s.analysis[t].deps[u].push([m,f]),u&&(s.analysis[t].signals.ctc_parnt_reorder=1));continue}if(f.match(/^style([\-\.]min)?\.css$/))u=1,"parnt"===y?v?s.analysis[t].signals.thm_parnt_loaded="thm_unregistered":(s.analysis[t].signals.thm_parnt_loaded=m,"child"===t&&s.analysis[t].signals.thm_child_loaded&&(s.analysis[t].signals.ctc_parnt_reorder=1)):s.analysis[t].signals.thm_child_loaded=v?"thm_unregistered":m,v?h?(s.analysis[t].signals.thm_past_wphead=1,s.analysis[t].deps[u].push(["thm_past_wphead",f])):(s.analysis[t].signals.thm_unregistered=1,s.analysis[t].deps[u].push(["thm_unregistered",f])):s.analysis[t].deps[u].push([m,f]);else if("ctc-test.css"===f)h=1;else{var w=null;v&&(w="dep_unregistered"),h&&(w=u?"css_past_wphead":"dep_past_wphead"),w?(s.analysis[t].signals[w]=1,m=w):s.dependencies[m]=f,s.analysis[t].deps[u].push([m,f])}}u||(s.analysis[t].signals.thm_notheme=1)},css_notice:function(){var t,c,n=this,a=e.chldthmcfg.existing?"child":"parnt",i=e.chldthmcfg.getname(a),s="",l={notices:[]},r={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",i),errlist:""},o=0,_={},d="";if(n.analysis[a].signals.failure||n.analysis[a].signals.thm_noqueue&&!n.phperr[a].length)d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[a].url+'" target="_new">').replace(/%2/,"</a>"),l.notices.push({headline:e.chldthmcfg.getxt("anlz4",i),msg:e.chldthmcfg.getxt("anlz5")+d,style:"notice-warning"});else{if(n.phperr[a].length&&(e.each(n.phperr[a],function(t,c){c.match(/Fatal error/i)&&(r.style="error",r.headline=e.chldthmcfg.getxt("anlz8",i)),r.errlist+=c+"\n"}),r.msg='<div style="background-color:#ffeebb;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_errs">'+e.chldthmcfg.getxt("anlz6")+'</div><div id="ctc_analysis_errs_content" style="display:none"><textarea>'+r.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),l.notices.push(r)),(n.analysis[a].signals.thm_past_wphead||n.analysis[a].signals.dep_past_wphead)&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz9"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz10")}),e("#ctc_repairheader").prop("checked",!0),e("#ctc_repairheader_container").show()),n.analysis[a].signals.thm_unregistered&&(n.analysis[a].signals.ctc_child_loaded||n.analysis[a].signals.ctc_sep_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz11"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz12")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0))),"child"===a&&(n.analysis.child.signals.ctc_parnt_reorder&&(o=1),n.analysis.child.signals.ctc_child_loaded||n.analysis.child.signals.ctc_sep_loaded||n.analysis.child.signals.thm_child_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),n.analysis[a].signals.ctc_gen_loaded&&l.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),n.analysis.parnt.signals.thm_no_styles||n.analysis.child.signals.ctc_gen_loaded||n.analysis.child.signals.thm_parnt_loaded||n.analysis.child.signals.ctc_parnt_loaded||n.analysis.child.signals.thm_ignoreparnt||n.analysis.child.signals.thm_has_import||(l.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),n.analysis.child.signals.thm_unregistered&&n.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===n.analysis.child.signals.thm_child_loaded&&n.analysis.child.signals.ctc_child_loaded&&n.analysis.child.signals.ctc_parnt_loaded&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz28"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz29")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0)),n.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||l.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(n.analysis[a].signals.ctc_sep_loaded||n.analysis[a].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),l.notices.length||l.notices.push({headline:""+("child"===a?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===a&&n.analysis.child.signals.thm_has_import&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),n.analysis[a].signals.thm_ignoreparnt||n.analysis[a].signals.ctc_gen_loaded?(e("#ctc_ignoreparnt").prop("checked",!0),e("#ctc_enqueue_none").is(":checked")||(e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")):e("#ctc_ignoreparnt").prop("checked",!1),!n.analysis[a].signals.ctc_sep_loaded&&!n.analysis[a].signals.ctc_gen_loaded&&!n.analysis[a].signals.ctc_child_loaded&&!n.analysis[a].signals.thm_unregistered&&!n.analysis[a].signals.thm_past_wphead&&n.analysis[a].deps[1].length){var u="";e.each(n.analysis[a].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(u+="<li>"+t[1]+"</li>\n")}),""!==u&&(u="<ul class='howto' style='padding-left:1em'>\n"+u+"</ul>\n",l.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:u+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===a&&n.analysis[a].signals.thm_parnt_loaded&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz25"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none"),n.analysis.parnt.signals.thm_no_styles&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz27"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")}return s=encodeURIComponent(JSON.stringify(n.analysis)),e('input[name="ctc_analysis"]').val(s),_.ctc_analysis=s,n.is_success()&&o&&!n.resubmitting?(n.resubmitting=1,void n.resubmit(_)):(n.resubmitting=0,n.hide_loading(),e.each(l.notices,function(t,c){var n=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(n),n.hide().appendTo("#"+a+"_analysis_notice").slideDown()}),t='<div style="background-color:#ddd;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_obj">'+e.chldthmcfg.getxt("anlz30")+'</div><div id="ctc_analysis_obj_content" style="display:none"><textarea style="font-family:monospace;font-size:10px">'+JSON.stringify(n.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+a+"_analysis_notice"),c="",e.each(n.dependencies,function(t,n){n&&(c+='<label><input class="ctc_checkbox ctc-themeonly" id="ctc_forcedep_'+t+'" name="ctc_forcedep[]" type="checkbox" value="'+t+'" autocomplete="off" '+(-1!==e.inArray(t,window.ctcAjax.forcedep)?"checked":"")+" />"+t+"</label><br/>\n")}),c.length?(e("#ctc_dependencies").html(c),e("#ctc_dependencies_container").show()):(e("#ctc_dependencies").empty(),e("#ctc_dependencies_container").hide()),e("#ctc_child_type_reset").is(":checked")||(e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit").slideDown("fast"),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("8"),e("#ctc_copy_theme_mods").find("input").prop("checked",!1)):(e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_copy_theme_mods").slideDown("fast")),e("#ctc_child_type_duplicate").is(":checked")||e("#ctc_child_type_new").is(":checked")?(e("#input_row_theme_slug").hide(),e("#input_row_new_theme_slug").slideDown("fast")):(e("#input_row_new_theme_slug").hide(),e("#input_row_theme_slug").slideDown("fast"))),void 0)},resubmit:function(t){var c=this;c.hide_loading(),c.show_loading(!0),t.action="ctc_update",t._wpnonce=e("#_wpnonce").val(),e.ajax({url:window.ctcAjax.ajaxurl,data:t,type:"POST"}).done(function(){c.hide_loading(),c.do_analysis()}).fail(function(){c.hide_loading()})},do_analysis:function(){var t=this;t.analysis={parnt:{deps:[[],[]],signals:{failure:0},queue:[],irreg:[]},child:{deps:[[],[]],signals:{failure:0},queue:[],irreg:[]}},t.phperr={parnt:[],child:[]},t.dependencies={},t.done=0,t.show_loading(!1),t.analyze_theme("parnt"),e.chldthmcfg.existing&&t.analyze_theme("child")},init:function(){var t=this;e(document).on("analysisdone",function(){t.done++,t.done>e.chldthmcfg.existing&&(t.done=0,t.css_notice())}),e("#ctc_main").on("click",".ctc-analyze-theme",function(){t.is_success()&&e.chldthmcfg.dismiss_notice(e(".ctc-success-response").parent(".notice")),t.do_analysis()}),t.is_success()&&!window.ctcAjax.pluginmode&&t.do_analysis()},analysis:{},done:0,resubmitting:0,dependencies:{},is_success:function(){return e(".ctc-success-response").length}},e("#request-filesystem-credentials-form").length||(e.chldthmcfg.init(),e.chldthmanalyze.init())}(jQuery);
1
+ !function(e){"use strict";e.chldthmcfg={escquo:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},getname:function(t){var c=this,n="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;return c.is_empty(window.ctcAjax.themes[t][n])?"":window.ctcAjax.themes[t][n].Name},frascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},toascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e,t){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if("undefined"!=typeof t&&"0"===e||0===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var c in e)if(e.hasOwnProperty(c))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(window.ctcAjax.themes,function(a,s){return e.each(s,function(e,s){return s=null,e.toLowerCase()!==t.toLowerCase()||"parnt"!==a&&"new"!==c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/g,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c):"",a=e("#ctc_theme_child").length&&!t.is_empty(e("#ctc_theme_child").val())?e("#ctc_theme_child").val().toString().replace(c):n,s=e("input[name=ctc_child_type]:checked").val(),i=[];return"new"===s&&(a=n),t.theme_exists(a,s)&&i.push(t.getxt("theme_exists").toString().replace(/%s/,a)),t.is_empty(a)&&i.push(t.getxt("inval_theme")),i.length?(t.set_notice({error:i}),!1):"reset"===s?!!confirm(t.getxt("load")):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",a=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?n:c+"-child",s=a,i=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?e.chldthmcfg.getname("child"):e.chldthmcfg.getname("parnt")+" Child",l="",r="",o="00";t.theme_exists(s,"new");)l=t.is_empty(l)?2:l+1,r=o.substring(0,o.length-l.toString().length)+l.toString(),s=a+r;t.testslug=s,t.testname=i+(r.length?" "+r:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},maybe_show_rewrite:function(){var t,c,n=this;e(".ctc-rewrite-toggle").each(function(a,s){t=e(s).hasClass("rewrite-query")?"query":"selector",c=e("#ctc_sel_ovrd_"+t+"_selected").text(),c.match(/^[\s\u00A0]*$/)?e(s).hide():(e(s).text(n.getxt("rename")),e(s).show())})},selector_input_toggle:function(t){var c,n=this,a=e(t).hasClass("rewrite-query")?"query":"selector",s="ctc_rewrite_"+a,i="ctc_sel_ovrd_"+a+"_selected";e("#"+s).length?(c=e("#"+s+"_orig").val(),e("#"+i).empty().text(c),e(t).text(n.getxt("rename"))):(c=e("#"+i).text(),e("#"+i).html('<textarea id="'+s+'" name="'+s+'" autocomplete="off"></textarea><input id="'+s+'_orig" name="'+s+'_orig" type="hidden" value="'+n.escquo(c)+'"/>'),e("#"+s).val(c),e(t).text(n.getxt("cancel")))},coalesce_inputs:function(t){var c=this,n=e(t).attr("id"),a=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,s=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),i=s.find(".ctc-swatch").first(),l={parent:{},child:{}},r={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return s.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,s,i=e(this).attr("id"),d=i.toString().match(a),u=d[2],h=d[3],p="undefined"==typeof d[4]?"":d[4],m=d[7],g=d[5],f="undefined"==typeof d[7]?"":d[8],y="parent"===h?e(this).text().replace(/!$/,""):"seq"!==p&&"ctc_delete_query_selector"===n?"":e(this).val(),v="seq"===p?!1:"ctc_"+u+"_child_"+p+"_i_"+g+"_"+m;if("child"===h&&(c.is_empty(e(this).data("color"))||(y=c.color_text(e(this).data("color")),e(this).data("color",null)),_[i]=y,v&&(_[v]=e("#"+v).is(":checked")?1:0)),""!==y)if(c.is_empty(f))if(t=p.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!y.match(/none/)){var w=new RegExp(c.border_regx+c.color_regx,"i");s=y.toString().match(w),c.is_empty(s)||(s.shift(),l[h][p+"-width"]=s.shift()||"",s.shift(),l[h][p+"-style"]=s.shift()||"",l[h][p+"-color"]=s.shift()||"")}else if("background-image"!==p||y.match(/none/))"seq"!==p&&(l[h][p]=y);else if(y.toString().match(/url\(/))l[h]["background-image"]=c.image_url(h,y);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");s=y.toString().match(x),!c.is_empty(s)&&s.length>2?(s.shift(),r[h].origin=s.shift()||"top",r[h].start=s.shift()||"transparent",r[h].end=s.shift()||"transparent",o[h]=!0):l[h]["background-image"]=y}else switch(f){case"_border_width":l[h][p+"-width"]="none"===y?0:y;break;case"_border_style":l[h][p+"-style"]=y;break;case"_border_color":l[h][p+"-color"]=y;break;case"_background_url":l[h]["background-image"]=c.image_url(h,y);break;case"_background_color":l[h]["background-color"]=y;break;case"_background_color1":r[h].start=y,o[h]=!0;break;case"_background_color2":r[h].end=y,o[h]=!0;break;case"_background_origin":r[h].origin=y,o[h]=!0}}),"undefined"==typeof i||c.is_empty(i.attr("id"))||(i.removeAttr("style"),o.parent&&i.ctcgrad(r.parent.origin,[r.parent.start,r.parent.end]),i.css(l.parent),i.attr("id").toString().match(/parent/)||(o.child&&i.ctcgrad(r.child.origin,[r.child.start,r.child.end]),i.css(l.child)),i.css({"z-index":-1})),_},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c,n=this,a={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s,i=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(i),n.is_empty(c)&&(c=[]),a.names=["_border_width","_border_style","_border_color"],s=c.shift(),a.values[0]=c.shift()||"",c.shift(),a.values[1]=c.shift()||"",c.shift(),a.values[2]=c.shift()||""}else if(e.toString().match(/^background\-image/))if(a.names=["_background_url","_background_origin","_background_color1","_background_color2"],a.values=["","","",""],n.is_empty(t)||t.toString().match(/(url|none)/))a.values[0]=t;else{var l,r;c=t.toString().split(/:/),a.values[1]=c.shift()||"",a.values[2]=c.shift()||"",l=c.shift()||"",a.values[3]=c.shift()||"",r=c.shift()||"",a.orig=[a.values[1],a.values[2],a.values[3]].join(" ")}return a},image_url:function(e,t){var c,n=this,a=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),s=n.is_empty(a)?null:a[1],i=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return s?c=s.toString().match(/^(data:|https?:|\/)/)?t:"url("+i+s+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.currquery)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.currquery)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.currqsid)},get_queries:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],a=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){a.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var a=this,s={},i=n?c.child.pop():null;return e.each(["parnt","child"],function(t,l){a.is_empty(c[l])||e.each(c[l],function(e,t){n?parseInt(t[2])>=parseInt(i[2])&&(i[2]=parseInt(t[2])+1):(a.is_empty(s[t[2]])&&(s[t[2]]={}),s[t[2]][l]=t)})}),n&&(s[i[2]]={parnt:[],child:i}),s},input_row:function(t,c,n,a,s){var i=this,l="";if(!i.is_empty(a)&&!i.is_empty(a.value)&&!i.is_empty(a.value[c])){var r=a.value[c],o=i.merge_ruleval_arrays(c,r,s);e.each(o,function(s,r){var o=i.decode_value(c,i.is_empty(r.parnt)?"":r.parnt[0]),_=i.is_empty(r.parnt)||i.is_empty(r.parnt[1],1)?0:1,d=i.decode_value(c,i.is_empty(r.child)?"":r.child[0]),u=i.is_empty(r.child)||i.is_empty(r.child[1],1)?0:1;if(l+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',l+="ovrd"===n?c.replace(/\d+/g,i.frascii):a.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+i.getxt("edit")+"</a> "+(i.is_empty(o.orig)?i.getxt("child_only"):""),l+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+s+'">'+(i.is_empty(o.orig)?"[no value]":o.orig+(_?i.getxt("important"):""))+'</div><div class="ctc-input-cell">',!i.is_empty(o.names)){e.each(o.names,function(e,a){a=i.is_empty(a)?"":a,l+='<div class="ctc-child-input-cell ctc-clear">';var r,o="ctc_"+n+"_child_"+c+"_"+t+"_"+s+a;!1===(r=d.values.shift())&&(r=""),l+=(i.is_empty(a)?"":i.getxt(a)+":<br/>")+'<input type="text" id="'+o+'" name="'+o+'" class="ctc-child-value'+((a+c).toString().match(/color/)?" color-picker":"")+(a.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+i.escquo(r)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+s;l+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+i.getxt("important")+"</label>"}l+="</div>","ovrd"!==n&&(l+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+s+'_swatch">'+i.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+s+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+s+'" name="ctc_save_'+c+"_"+t+"_"+s+'" value="Save" /></div>'),l+="</div><!-- end input row -->\n"})}return l},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=!c.is_empty(window.ctcAjax.palette);try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:!!n,showSelectionPalette:!!n,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+window.ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(){c.coalesce_inputs(this)}).on("keyup",function(){var t=this,n=c.addhash(e(this).val());e(t).val(n),clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(t),e(t).spectrum("set",n)},500))})}catch(a){c.jquery_exception(a,"Spectrum Color Picker")}},addhash:function(e){return e.replace(/^#?([a-f0-9]{3,6}.*)/,"#$1")},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(c,n){return e("#ctc_rewrite_query").length?(e("#ctc_rewrite_query").val(n.item.value),e("#ctc_sel_ovrd_query").val("")):(t.set_query(n.item.value),t.reset_qsid()),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(c,n){return e("#ctc_rewrite_selector").length?(e("#ctc_rewrite_selector").val(n.item.label),e("#ctc_sel_ovrd_selector").val("")):t.set_selector(n.item.value,n.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Property Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault();var a,s,i=n.item.label.replace(/[^\w\-]/g,t.toascii);return t.is_empty(t.currdata.value)&&(t.currdata.value={}),t.is_empty(t.currdata.value[n.item.label])&&(t.currdata.value[n.item.label]={}),t.is_empty(t.currdata.value[n.item.label].child)&&(t.currdata.value[n.item.label].child=[]),t.currdata.value[n.item.label].child.push(["",0,1,1]),a=e(t.input_row(t.currqsid,i,"ovrd",t.currdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(a),e("#ctc_new_rule_menu").val(""),a.find('input[type="text"]').each(function(c,n){s||(s=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),s&&e(s).focus(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property Menu")}},set_theme_params:function(t,c){e("#ctc_child_author").val(window.ctcAjax.themes[t][c].Author),e("#ctc_child_version").val(window.ctcAjax.themes[t][c].Version),e("#ctc_child_authoruri").val(window.ctcAjax.themes[t][c].AuthorURI),e("#ctc_child_themeuri").val(window.ctcAjax.themes[t][c].ThemeURI),e("#ctc_child_descr").val(window.ctcAjax.themes[t][c].Descr),e("#ctc_child_tags").val(window.ctcAjax.themes[t][c].Tags)},update_form:function(){var t,c=this;e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug").slideUp("fast"),e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_theme_child").length&&!e("#ctc_child_type_new").is(":checked")?(t=e("#ctc_theme_child").val(),c.existing=1,c.currparnt=window.ctcAjax.themes.child[t].Template,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(c.getname("parnt")),c.set_theme_params("child",t),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_child_template").val(c.testslug),e("#ctc_child_name").val(c.testname),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Duplicate Child Theme")):e("#ctc_child_type_reset").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("3"),e("#ctc_configure_submit").slideDown("fast"),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").hide(),e("#ctc_enqueue_none").prop("checked",!0),e("#ctc_load_styles").val("Reset Child Theme to Previous State")):(e("#ctc_child_template").val(""),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_child_name").val(c.getname("child")),e("#ctc_load_styles").val("Configure Child Theme")),e("#input_row_existing_theme_option").slideDown("fast"),e("#input_row_new_theme_option").slideUp("fast")):(c.existing=0,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(e.chldthmcfg.getname("parnt")),c.set_theme_params("parnt",c.currparnt),e("#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug").slideUp("fast"),e("#input_row_new_theme_option").slideDown("fast"),e("#ctc_child_name").val(c.testname),e("#ctc_child_template").val(c.testslug),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Create New Child Theme"))},set_notice:function(t){var c,n=this,a="";n.is_empty(t)||e.each(t,function(t,c){a+='<div class="'+t+' notice is-dismissible dashicons-before"><ul>\n',e(c).each(function(e,t){a+="<li>"+t.toString()+"</li>\n"}),a+="</ul></div>"}),c=e(a),e("#ctc_error_notice").html(c),n.bind_dismiss(c),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(e){var t=this;t.currparnt=e.value,t.update_form()},set_child_menu:function(e){var t=this;t.currchild=e.value,t.update_form()},set_query:function(t){var c=this;return c.is_empty(t)?!1:(c.currquery=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors(),void c.scrolltop())},reset_qsid:function(){self.currqsid=null,e("#ctc_sel_ovrd_rule_inputs").empty(),e("#ctc_sel_ovrd_new_rule,#input_row_load_order,#ctc_sel_ovrd_rule_inputs_container").hide().find(".ctc-child-value").remove(),e(".ctc-rewrite-toggle").hide()},set_selector:function(t,c){var n=this;return c=null,n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.currqsid=t,n.reload=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t),void n.scrolltop())},set_qsid:function(t){var c=this;c.currqsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload=!0,c.load_selector_values()},query_css:function(t,c,n){var a=this,s={ctc_query_obj:t,ctc_query_key:c},i="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){s["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(i+" .ctc-status-icon").remove(),e(i).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),s.action=a.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",s._wpnonce=e("#_wpnonce").val(),a.ajax_post(t,s)},save:function(t){var c,n,a,s,i,l=this,r={},o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),r.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(r.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(r.ctc_sel_ovrd_query=n.text()),l.reload=!0):(a=e("#ctc_child_imports"))&&"ctc_save_imports"===o?r.ctc_child_imports=a.val():"ctc_is_debug"===o?r.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:r=l.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e.each(["query","selector"],function(t,c){e("#ctc_rewrite_"+c).length&&(s=e("#ctc_rewrite_"+c).val(),i=e("#ctc_rewrite_"+c+"_orig").val(),l.is_empty(s)||!s.toString().match(/\w/)?s=i:(r["ctc_rewrite_"+c]=s,l.reload=!0),e("#ctc_sel_ovrd_"+c+"_selected").html(s)),e(".ctc-rewrite-toggle").text(l.getxt("rename"))}),r.action=l.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",r._wpnonce=e("#_wpnonce").val(),l.ajax_post("qsid",r)},ajax_post:function(t,c,n){var a=this;e.ajax({url:window.ctcAjax.ajaxurl,data:c,dataType:a.is_empty(n)?"json":n,type:"POST"}).done(function(e){a.handle_success(t,e)}).fail(function(){a.handle_failure(t)}).always(function(){a.jqueryerr.length&&a.jquery_notice()})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"===t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,a=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jqueryerr.push("<code><small>"+t+": "+e.message+a+n+"</small></code>")},jquery_notice:function(t){t=null;var c=this,n=[],a=[];c.jqueryerr.length&&(e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var t=e(this).prop("src");c.is_empty(t)||!t.match(/jquery(\.min|\.js|\-?ui)/i)||t.match(/load\-scripts.php/)||n.push("<code><small>"+t.split(/\?/)[0]+"</small></code>")}),a.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),a.push(c.jqueryerr.join("<br/>")),n.length&&a.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),a.push(c.getxt("plugin"))),c.set_notice({error:a})},update:{qsid:function(t){var c,n,a,s,i=this;i.currqsid=t.key,i.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(i.currqsid),i.is_empty(i.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+i.currqsid,a=parseInt(i.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+a+'" />',e("#ctc_child_load_order_container").html(n)),i.is_empty(i.currdata.value)?(s=!0,e("#ctc_sel_ovrd_rule_inputs").empty(),i.load_selectors()):(s=!1,n="",e.each(i.currdata.value,function(e,t){t=null,n+=i.input_row(i.currqsid,e,"ovrd",i.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){i.setup_spectrum(this)}),i.coalesce_inputs("#ctc_child_all_0_swatch")),i.reload&&(i.load_queries(),i.load_selectors(),i.set_query(i.currdata.query),i.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(i.currdata.selector),i.maybe_show_rewrite(),s?i.reset_qsid():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,#input_row_load_order").fadeIn()},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),a='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var s=c.decode_value(n,t);a+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+s.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),a+="</div>\n"),e("#ctc_rule_value_inputs").html(a).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c,n,a=this,s="";a.is_empty(t.data)||e.each(t.data,function(n,i){c=n,e.each(i,function(c,i){s+='<h4 class="ctc-query-heading">'+c+"</h4>\n",a.is_empty(i)||e.each(i,function(e,c){s+=a.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(s).find(".color-picker").each(function(){a.setup_spectrum(this)}),e(n).find(".ctc-swatch").each(function(){a.coalesce_inputs(this)})},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_box").val(e("#ctc_debug_box").val()+t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)},dismiss:function(){}},bind_dismiss:function(t){var c=this,n=e(t),a=e('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),s=window.commonL10n.dismiss||"";a.find(".screen-reader-text").text(s),n.append(a),a.on("click.wp-dismiss-notice",function(e){e.preventDefault(),c.dismiss_notice(t)})},dismiss_notice:function(t){e(t).fadeTo(100,0,function(){e(this).slideUp(100,function(){e(this).remove()})})},reset_handling:function(){e("#parnt_analysis_notice .notice, #child_analysis_notice .notice").slideUp(),e("#ctc_enqueue_enqueue").prop("checked",!0),e("#ctc_handling_primary").prop("checked",!0),e("#ctc_ignoreparnt").prop("checked",!1),e("#ctc_repairheader").prop("checked",!1)},init:function(){var t=this;if(!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>"),a=c.value.replace(/[^\w\-]/g,"");return e("#ctc_theme_option_"+a).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.reset_handling(),t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(window.ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.reset_handling(),t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.currparnt=e("#ctc_theme_parnt").val(),t.currchild=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",e("#ctc_main").on("click",".ctc-section-toggle",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .notice-warning, .updated, .error").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#ctc_main").on("click",".ctc-upgrade-notice .notice-dismiss",function(){var c={action:"ctc_dismiss",_wpnonce:e("#_wpnonce").val()};t.ajax_post("dismiss",c)}),t.is_empty(t.jqueryerr)&&(e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n,a,s=e(this).attr("id").toString().replace("_close",""),i=s.toString().match(/_([^_]+)_(\d+)$/);e("#"+s+"_container").is(":hidden")&&(t.is_empty(i[1])||t.is_empty(i[2])||(n=i[1],a=i[2],t.query_css("val_qry",a,{rule:n}))),e("#"+s+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+s+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_main").on("click",".ctc-backup-theme",function(c){c.preventDefault(),t.existing?e("#ctc_export_theme").val(t.currchild):e("#ctc_export_theme").val(t.currparnt),e("#ctc_export_theme_form").submit()}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"===c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){if(c.preventDefault(),e(c.target).hasClass("ctc-disabled"))return!1;e(".ctc-query-icon,.ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e("#view_child_options, #view_parnt_options").on("click",function(c){return e(c.target).hasClass("ajax-pending")||e(c.target).hasClass("ctc-disabled")?!1:(e(c.target).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){c.preventDefault();var n=e("#ctc_save_query_selector");return n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}),e("#ctc_rule_value_form").on("submit",function(e){return e.preventDefault(),!1}),e("#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset").on("focus click",function(){t.reset_handling(),t.update_form()}),e("#ctc_is_debug").on("change",function(){e(this).is(":checked")?e("#ctc_debug_box").length||e("#ctc_debug_container").html('<textarea id="ctc_debug_box"></textarea>'):e("#ctc_debug_box").remove(),t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),t.update_form()),t.jqueryerr.length&&t.jquery_notice()},testslug:"",testname:"",reload:!1,currquery:"base",currqsid:null,currdata:{},currparnt:"",currchild:"",existing:!1,jqueryerr:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmanalyze={escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},show_loading:function(t,c){var n=e.chldthmcfg.existing?"child":"parnt",a=c?c:e.chldthmcfg.getname(n),s='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+a+"...</strong>";self.noticediv="",e("#"+n+"_analysis_notice").html(s)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},setssl:function(e){return e.replace(/^https?/,window.ctcAjax.ssl?"https":"http")},analyze_theme:function(t){var c=this,n=Math.floor(e.now()/1e3),a="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,s="&template="+encodeURIComponent(e.chldthmcfg.currparnt)+"&stylesheet="+encodeURIComponent(a)+"&now="+n,i=c.setssl(window.ctcAjax.homeurl),l=i+s;c.analysis[t].url=l,e.get(l,function(n){c.parse_page(t,n),e(document).trigger("analysisdone")}).fail(function(n,s,i){c.analysis[t].signals.xhrgeterr=i,e.ajax({url:window.ctcAjax.ajaxurl,data:{action:"ctc_analyze",stylesheet:a,template:e.chldthmcfg.currparnt,
2
+ _wpnonce:e("#_wpnonce").val()},dataType:"json",type:"POST"}).done(function(n){n.signals.httperr?(c.analysis[t].signals.failure=1,c.analysis[t].signals.httperr=n.signals.httperr):c.parse_page(t,n.body),e(document).trigger("analysisdone")}).fail(function(n,a,s){c.analysis[t].signals.failure=1,c.analysis[t].signals.xhrajaxerr=s,e(document).trigger("analysisdone")})})},parse_page:function(t,c){var n,a,s,i=this,l=window.ctcAjax.theme_dir,r="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,o=i.escrgx(e.chldthmcfg.currparnt)+("child"===t?"|"+i.escrgx(r):""),_=new RegExp("<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?"+i.escrgx(l)+"/("+o+")/([^\"']+\\.css)(\\?[^\"']+)?[\"'][^>]+>","gi"),d=/<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,u=0,h=0;if("child"===t){c.match(/^[\s\S]*?<head>([\s\S]*?)<\/head>/)}for((a=c.match(/BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/))?i.analysis[t].queue=a[1].split(/\n/):(i.analysis[t].queue=[],i.analysis[t].signals.thm_noqueue=1),(a=c.match(/BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/))?i.analysis[t].irreg=a[1].split(/\n/):i.analysis[t].irreg=[],c.match(/CHLD_THM_CFG_IGNORE_PARENT/)&&(i.analysis[t].signals.thm_ignoreparnt=1),c.match(/IS_CTC_THEME/)&&(i.analysis[t].signals.thm_is_ctc=1),c.match(/NO_CTC_STYLES/)&&(i.analysis[t].signals.thm_no_styles=1),c.match(/HAS_CTC_IMPORT/)&&(i.analysis[t].signals.thm_has_import=1),c.match(/HAS_WP_CACHE/)&&(i.analysis[t].signals.thm_has_cache=1),c.match(/HAS_WP_ROCKET/)&&(i.analysis[t].signals.thm_has_wprocket=1),c.match(/HAS_AUTOPTIMIZE/)&&(i.analysis[t].signals.thm_has_autoptimize=1),c=c.replace(/<!\-\-[\s\S]*?\-\->/g,"");n=d.exec(c);){var p=n[0].replace(/<.*?>/g,"");i.phperr[t].push(p),i.analysis[t].signals.err_php=1,p.match(/Fatal error/i)&&(i.analysis[t].signals.err_fatal=1)}for(;s=_.exec(c);){var m=i.trmcss(s[2]),g=s[3],f=s[4],y=e.chldthmcfg.currparnt===g?"parnt":"child",v=0;if(""===m||-1===e.inArray(m,i.analysis[t].queue))v=1;else if(0===m.indexOf("chld_thm_cfg")){f.match(/^ctc\-style.*?\.css$/)?(u=1,i.analysis[t].signals.ctc_sep_loaded=1):f.match(/^ctc\-genesis([\-\.]min)?\.css$/)?(u=1,i.analysis[t].signals.ctc_gen_loaded=1):m.match(/^chld_thm_cfg_ext/)?f.match(/rtl.*?\.css$/)?i.analysis[t].signals.thm_rtl=1:(i.analysis[t].signals.ctc_ext_loaded=1,i.analysis[t].deps[u].push([m,f])):"chld_thm_cfg_child"===m?(i.analysis[t].signals.ctc_child_loaded=1,i.analysis[t].deps[u].push([m,f])):"chld_thm_cfg_parent"===m&&(i.analysis[t].signals.ctc_parnt_loaded=1,i.analysis[t].deps[u].push([m,f]),u&&(i.analysis[t].signals.ctc_parnt_reorder=1));continue}if(f.match(/^style.*?\.css$/))u=1,"parnt"===y?v?i.analysis[t].signals.thm_parnt_loaded="thm_unregistered":(i.analysis[t].signals.thm_parnt_loaded=m,"child"===t&&i.analysis[t].signals.thm_child_loaded&&(i.analysis[t].signals.ctc_parnt_reorder=1)):i.analysis[t].signals.thm_child_loaded=v?"thm_unregistered":m,v?h?(i.analysis[t].signals.thm_past_wphead=1,i.analysis[t].deps[u].push(["thm_past_wphead",f])):(i.analysis[t].signals.thm_unregistered=1,i.analysis[t].deps[u].push(["thm_unregistered",f])):i.analysis[t].deps[u].push([m,f]);else if(f.match(/rtl.*?\.css$/))i.analysis[t].signals.thm_rtl=1;else if("ctc-test.css"===f)h=1;else{var w=null;v&&(w="dep_unregistered"),h&&(w=u?"css_past_wphead":"dep_past_wphead"),w?(i.analysis[t].signals[w]=1,m=w):i.dependencies[m]=f,i.analysis[t].deps[u].push([m,f])}}u||(i.analysis[t].signals.thm_notheme=1)},css_notice:function(){var t,c,n=this,a=e.chldthmcfg.existing?"child":"parnt",s=e.chldthmcfg.getname(a),i="",l={notices:[]},r={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",s),errlist:"",msg:e.chldthmcfg.getxt("anlz7")},o=0,_={},d="",u={};if(n.analysis[a].signals.failure||n.analysis[a].signals.thm_noqueue&&!n.phperr[a].length)d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[a].url+'" target="_new">').replace(/%2/,"</a>"),l.notices.push({headline:e.chldthmcfg.getxt("anlz4",s),msg:e.chldthmcfg.getxt("anlz5")+d,style:"notice-warning"});else if(n.phperr[a].length&&(e.each(n.phperr[a],function(e,t){t.match(/Fatal error/i)&&(u.fatal=1),t.match(/Constant \w+ already defined in .+?wp-config.php/i)&&(u.config=1),r.errlist+=t+"\n"}),u.fatal&&(r.style="error",r.headline=e.chldthmcfg.getxt("anlz8",s)),u.config&&(r.msg=e.chldthmcfg.getxt("anlzconfig",s)+r.msg),r.msg='<div style="background-color:#ffeebb;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_errs">'+e.chldthmcfg.getxt("anlz6")+'</div><div id="ctc_analysis_errs_content"><textarea>'+r.errlist+"</textarea></div></div>"+r.msg,l.notices.push(r)),n.analysis[a].signals.thm_has_wprocket&&n.analysis[a].signals.thm_has_autoptimize)l.notices.push({headline:e.chldthmcfg.getxt("anlzcache1"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlzcache2")});else if(!n.analysis[a].signals.thm_noqueue){if((n.analysis[a].signals.thm_past_wphead||n.analysis[a].signals.dep_past_wphead)&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz9"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz10")}),e("#ctc_repairheader").prop("checked",!0),e("#ctc_repairheader_container").show()),n.analysis[a].signals.thm_unregistered&&(n.analysis[a].signals.ctc_child_loaded||n.analysis[a].signals.ctc_sep_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz11"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz12")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0))),"child"===a&&(n.analysis.child.signals.ctc_parnt_reorder&&(o=1),n.analysis.child.signals.ctc_child_loaded||n.analysis.child.signals.ctc_sep_loaded||n.analysis.child.signals.thm_child_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),n.analysis[a].signals.ctc_gen_loaded&&l.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),n.analysis.parnt.signals.thm_no_styles||n.analysis.child.signals.ctc_gen_loaded||n.analysis.child.signals.thm_parnt_loaded||n.analysis.child.signals.ctc_parnt_loaded||n.analysis.child.signals.thm_ignoreparnt||n.analysis.child.signals.thm_has_import||(l.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),n.analysis.child.signals.thm_unregistered&&n.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===n.analysis.child.signals.thm_child_loaded&&n.analysis.child.signals.ctc_child_loaded&&n.analysis.child.signals.ctc_parnt_loaded&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz28"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz29")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0)),n.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||l.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"}),!n.analysis.child.signals.thm_rtl&&n.analysis.parnt.signals.thm_rtl&&l.notices.push({headline:e.chldthmcfg.getxt("anlzrtl"),msg:e.chldthmcfg.getxt("anlzrtl2"),style:"notice-warning"})),(n.analysis[a].signals.ctc_sep_loaded||n.analysis[a].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),l.notices.length||l.notices.push({headline:""+("child"===a?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===a&&n.analysis.child.signals.thm_has_import&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),n.analysis[a].signals.thm_ignoreparnt||n.analysis[a].signals.ctc_gen_loaded?(e("#ctc_ignoreparnt").prop("checked",!0),e("#ctc_enqueue_none").is(":checked")||(e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")):e("#ctc_ignoreparnt").prop("checked",!1),!n.analysis[a].signals.ctc_sep_loaded&&!n.analysis[a].signals.ctc_gen_loaded&&!n.analysis[a].signals.ctc_child_loaded&&!n.analysis[a].signals.thm_unregistered&&!n.analysis[a].signals.thm_past_wphead&&n.analysis[a].deps[1].length){var h="";e.each(n.analysis[a].deps[1],function(e,t){t[1].match(/^style.*?\.css$/)||(h+="<li>"+t[1]+"</li>\n")}),""!==h&&(h="<ul class='howto' style='padding-left:1em'>\n"+h+"</ul>\n",l.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:h+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===a&&n.analysis[a].signals.thm_parnt_loaded&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz25"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none"),n.analysis.parnt.signals.thm_no_styles&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz27"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")}return i=encodeURIComponent(JSON.stringify(n.analysis)),e('input[name="ctc_analysis"]').val(i),_.ctc_analysis=i,n.is_success()&&o&&!n.resubmitting?(n.resubmitting=1,void n.resubmit(_)):(n.resubmitting=0,n.hide_loading(),e.each(l.notices,function(t,c){var n=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(n),n.hide().appendTo("#"+a+"_analysis_notice").slideDown()}),t='<div style="background-color:#ddd;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_obj">'+e.chldthmcfg.getxt("anlz30")+'</div><div id="ctc_analysis_obj_content" style="display:none"><textarea style="font-family:monospace;font-size:10px">'+JSON.stringify(n.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+a+"_analysis_notice"),c="",e.each(n.dependencies,function(t,n){n&&(c+='<label><input class="ctc_checkbox ctc-themeonly" id="ctc_forcedep_'+t+'" name="ctc_forcedep[]" type="checkbox" value="'+t+'" autocomplete="off" '+(-1!==e.inArray(t,window.ctcAjax.forcedep)?"checked":"")+" />"+t+"</label><br/>\n")}),c.length?(e("#ctc_dependencies").html(c),e("#ctc_dependencies_container").show()):(e("#ctc_dependencies").empty(),e("#ctc_dependencies_container").hide()),e("#ctc_child_type_reset").is(":checked")||(e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit").slideDown("fast"),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("8"),e("#ctc_copy_theme_mods").find("input").prop("checked",!1)):(e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_copy_theme_mods").slideDown("fast")),e("#ctc_child_type_duplicate").is(":checked")||e("#ctc_child_type_new").is(":checked")?(e("#input_row_theme_slug").hide(),e("#input_row_new_theme_slug").slideDown("fast")):(e("#input_row_new_theme_slug").hide(),e("#input_row_theme_slug").slideDown("fast"))),void 0)},resubmit:function(t){var c=this;c.hide_loading(),c.show_loading(!0),t.action="ctc_update",t._wpnonce=e("#_wpnonce").val(),e.ajax({url:window.ctcAjax.ajaxurl,data:t,type:"POST"}).done(function(){c.hide_loading(),c.do_analysis()}).fail(function(){c.hide_loading()})},do_analysis:function(){var t=this;t.analysis={parnt:{deps:[[],[]],signals:{failure:0},queue:[],irreg:[]},child:{deps:[[],[]],signals:{failure:0},queue:[],irreg:[]}},t.phperr={parnt:[],child:[]},t.dependencies={},t.done=0,t.show_loading(!1),t.analyze_theme("parnt"),e.chldthmcfg.existing&&t.analyze_theme("child")},init:function(){var t=this;e(document).on("analysisdone",function(){t.done++,t.done>e.chldthmcfg.existing&&(t.done=0,t.css_notice())}),e("#ctc_main").on("click",".ctc-analyze-theme",function(){t.is_success()&&e.chldthmcfg.dismiss_notice(e(".ctc-success-response").parent(".notice")),t.do_analysis()}),t.is_success()&&!window.ctcAjax.pluginmode&&t.do_analysis()},analysis:{},done:0,resubmitting:0,dependencies:{},is_success:function(){return e(".ctc-success-response").length}},e("#request-filesystem-credentials-form").length||(e.chldthmcfg.init(),e.chldthmanalyze.init())}(jQuery);
lang/child-theme-configurator.pot CHANGED
@@ -1,234 +1,164 @@
1
- # Copyright (C) 2017 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Child Theme Configurator 2.2.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2017-01-20 13:19:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: includes/classes/Admin.php:395
16
- msgid "Zip file creation failed."
17
- msgstr ""
18
-
19
- #: includes/classes/Admin.php:421
20
- msgid "The Functions file is required and cannot be deleted."
21
- msgstr ""
22
-
23
- #: includes/classes/Admin.php:501
24
- msgid "You do not have permission to configure child themes."
25
- msgstr ""
26
-
27
- #: includes/classes/Admin.php:534
28
- msgid "%s does not exist. Please select a valid Parent Theme."
29
- msgstr ""
30
-
31
- #: includes/classes/Admin.php:537
32
- msgid "Please select a valid Parent Theme."
33
- msgstr ""
34
-
35
- #: includes/classes/Admin.php:542
36
- msgid "Please select a valid Child Theme."
37
- msgstr ""
38
-
39
- #: includes/classes/Admin.php:546
40
- msgid "Please enter a valid Child Theme directory name."
41
- msgstr ""
42
-
43
- #: includes/classes/Admin.php:551
44
- msgid ""
45
- "<strong>%s</strong> exists. Please enter a different Child Theme template "
46
- "name."
47
- msgstr ""
48
-
49
- #: includes/classes/Admin.php:570
50
- msgid "Your theme directories are not writable."
51
- msgstr ""
52
-
53
- #: includes/classes/Admin.php:651
54
- msgid "Could not upgrade child theme"
55
- msgstr ""
56
-
57
- #: includes/classes/Admin.php:733
58
- msgid "Your stylesheet is not writable."
59
- msgstr ""
60
-
61
- #: includes/classes/Admin.php:1317
62
- msgid "Could not set write permissions."
63
- msgstr ""
64
-
65
- #: includes/classes/Admin.php:1418
66
- msgid "There were errors while resetting permissions."
67
- msgstr ""
68
-
69
- #: includes/classes/Admin.php:1492
70
- msgid "Could not upload file."
71
- msgstr ""
72
-
73
- #: includes/classes/Admin.php:1518
74
- msgid "Invalid theme root directory."
75
- msgstr ""
76
-
77
- #: includes/classes/Admin.php:1530
78
- msgid "No writable temp directory."
79
- msgstr ""
80
-
81
- #: includes/classes/Admin.php:1560
82
- msgid "PclZip returned zero bytes."
83
- msgstr ""
84
-
85
- #. #-#-#-#-# child-theme-configurator.pot (Child Theme Configurator 2.2.3) #-#-#-#-#
86
  #. Plugin Name of the plugin/theme
87
- #: includes/classes/Core.php:94 includes/classes/Core.php:105
88
  #: includes/forms/main.php:35
89
  msgid "Child Theme Configurator"
90
  msgstr ""
91
 
92
- #: includes/classes/Core.php:95 includes/classes/Core.php:106
93
- #: includes/classes/Core.php:117
94
  msgid "Child Themes"
95
  msgstr ""
96
 
97
- #: includes/classes/Core.php:135
98
  msgid "Child Theme Configurator requires WordPress version %s or later."
99
  msgstr ""
100
 
101
- #: includes/classes/UI.php:35
102
  msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
103
  msgstr ""
104
 
105
- #: includes/classes/UI.php:98
106
  msgid ""
107
  "The Theme editor has been disabled. Template files must be edited offline."
108
  msgstr ""
109
 
110
- #: includes/classes/UI.php:102
111
  msgid "Click here to edit template files using the Theme Editor"
112
  msgstr ""
113
 
114
- #: includes/classes/UI.php:269
115
  msgid "URL/None"
116
  msgstr ""
117
 
118
- #: includes/classes/UI.php:270
119
  msgid "Origin"
120
  msgstr ""
121
 
122
- #: includes/classes/UI.php:271
123
  msgid "Color 1"
124
  msgstr ""
125
 
126
- #: includes/classes/UI.php:272
127
  msgid "Color 2"
128
  msgstr ""
129
 
130
- #: includes/classes/UI.php:273
131
  msgid "Width/None"
132
  msgstr ""
133
 
134
- #: includes/classes/UI.php:274
135
  msgid "Style"
136
  msgstr ""
137
 
138
- #: includes/classes/UI.php:275
139
  msgid "Color"
140
  msgstr ""
141
 
142
- #: includes/classes/UI.php:277
143
  msgid ""
144
  "Are you sure you wish to RESET? This will destroy any work you have done in "
145
  "the Configurator."
146
  msgstr ""
147
 
148
- #: includes/classes/UI.php:278
149
  msgid "<span style=\"font-size:10px\">!</span>"
150
  msgstr ""
151
 
152
- #: includes/classes/UI.php:279 includes/forms/rule-value.php:33
153
  msgid "Selectors"
154
  msgstr ""
155
 
156
- #: includes/classes/UI.php:280
157
  msgid "Close"
158
  msgstr ""
159
 
160
- #: includes/classes/UI.php:281
161
  msgid "Edit Selector"
162
  msgstr ""
163
 
164
- #: includes/classes/UI.php:282
165
  msgid "Cancel"
166
  msgstr ""
167
 
168
- #: includes/classes/UI.php:283
169
  msgid "Rename"
170
  msgstr ""
171
 
172
- #: includes/classes/UI.php:284
173
  msgid "The stylesheet cannot be displayed."
174
  msgstr ""
175
 
176
- #: includes/classes/UI.php:285
177
  msgid "(Child Only)"
178
  msgstr ""
179
 
180
- #: includes/classes/UI.php:286
181
  msgid "Please enter a valid Child Theme."
182
  msgstr ""
183
 
184
- #: includes/classes/UI.php:287
185
  msgid "Please enter a valid Child Theme name."
186
  msgstr ""
187
 
188
- #: includes/classes/UI.php:288
189
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
190
  msgstr ""
191
 
192
- #: includes/classes/UI.php:289
193
  msgid "The page could not be loaded correctly."
194
  msgstr ""
195
 
196
- #: includes/classes/UI.php:290
197
  msgid ""
198
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
199
  msgstr ""
200
 
201
- #: includes/classes/UI.php:291
202
  msgid "Deactivating or replacing plugins may resolve this issue."
203
  msgstr ""
204
 
205
- #: includes/classes/UI.php:292
206
  msgid "%sWhy am I seeing this?%s"
207
  msgstr ""
208
 
209
- #: includes/classes/UI.php:295
210
  msgid "No Styles Available. Check Parent/Child settings."
211
  msgstr ""
212
 
213
- #: includes/classes/UI.php:296
214
  msgid "Updating"
215
  msgstr ""
216
 
217
- #: includes/classes/UI.php:297
218
  msgid "Checking"
219
  msgstr ""
220
 
221
- #: includes/classes/UI.php:298
222
  msgid "The theme \"%s\" generated unexpected PHP debug output."
223
  msgstr ""
224
 
225
- #: includes/classes/UI.php:299
226
  msgid ""
227
  "The theme \"%s\" could not be analyzed because the preview did not render "
228
  "correctly."
229
  msgstr ""
230
 
231
- #: includes/classes/UI.php:300
232
  msgid ""
233
  "<p>First, verify you can <a href=\"%s\">preview your home page with the "
234
  "Customizer</a> and try analyzing again.</p><p>If that does not work, try "
@@ -236,42 +166,45 @@ msgid ""
236
  "<strong>force redirects between HTTP and HTTPS</strong>.</p>"
237
  msgstr ""
238
 
239
- #: includes/classes/UI.php:301
240
  msgid "Click to show/hide PHP debug output"
241
  msgstr ""
242
 
243
- #: includes/classes/UI.php:302
244
  msgid ""
245
- "<p>Please contact this Theme's author and report the items inside the box "
246
- "above. You may or may not be able to use this Theme as a Child Theme while "
247
- "these conditions exist.</p><p>It is possible that this theme has specific "
248
- "requirements to work correctly as a child theme. Please make sure you are "
249
- "using the latest version of this theme and check your theme's documentation "
250
- "for more information.</p>"
 
 
 
251
  msgstr ""
252
 
253
- #: includes/classes/UI.php:303
254
  msgid "Do Not Activate \"%s\"! A PHP FATAL ERROR has been detected."
255
  msgstr ""
256
 
257
- #: includes/classes/UI.php:304
258
  msgid "This theme loads stylesheets after the wp_styles queue."
259
  msgstr ""
260
 
261
- #: includes/classes/UI.php:305
262
  msgid ""
263
  "<p>This makes it difficult for plugins to override these styles. You can try "
264
  "to resolve this using the \"Repair header template\" option (Step 6, "
265
  "\"Additional handling options\", below).</p>"
266
  msgstr ""
267
 
268
- #: includes/classes/UI.php:306
269
  msgid ""
270
  "This theme loads the parent theme's <code>style.css</code> file outside the "
271
  "wp_styles queue."
272
  msgstr ""
273
 
274
- #: includes/classes/UI.php:307
275
  msgid ""
276
  "<p>This is common with older themes but requires the use of <code>@import</"
277
  "code>, which is no longer recommended. You can try to resolve this using the "
@@ -279,41 +212,41 @@ msgid ""
279
  "\", below).</p>"
280
  msgstr ""
281
 
282
- #: includes/classes/UI.php:308
283
  msgid "This child theme does not load a Configurator stylesheet."
284
  msgstr ""
285
 
286
- #: includes/classes/UI.php:309
287
  msgid ""
288
  "<p>If you want to customize styles using this plugin, please click "
289
  "\"Configure Child Theme\" again to add this to the settings.</p>"
290
  msgstr ""
291
 
292
- #: includes/classes/UI.php:310
293
  msgid ""
294
  "This child theme uses the parent stylesheet but does not load the parent "
295
  "theme's <code>style.css</code> file."
296
  msgstr ""
297
 
298
- #: includes/classes/UI.php:311
299
  msgid ""
300
  "<p>Please select a stylesheet handling method or check \"Ignore parent theme "
301
  "stylesheets\" (see step 6, below).</p>"
302
  msgstr ""
303
 
304
- #: includes/classes/UI.php:312
305
  msgid "This child theme appears to be functioning correctly."
306
  msgstr ""
307
 
308
- #: includes/classes/UI.php:313
309
  msgid "This theme appears OK to use as a Child theme."
310
  msgstr ""
311
 
312
- #: includes/classes/UI.php:314
313
  msgid "This Child Theme has not been configured for this plugin."
314
  msgstr ""
315
 
316
- #: includes/classes/UI.php:315
317
  msgid ""
318
  "<p>The Configurator makes significant modifications to the child theme, "
319
  "including stylesheet changes and additional php functions. Please consider "
@@ -321,81 +254,112 @@ msgid ""
321
  "original as a backup.</p>"
322
  msgstr ""
323
 
324
- #: includes/classes/UI.php:316
325
  msgid ""
326
  "This child theme uses <code>@import</code> to load the parent theme's "
327
  "<code>style.css</code> file."
328
  msgstr ""
329
 
330
- #: includes/classes/UI.php:317
331
  msgid ""
332
  "<p>Please consider selecting \"Use the WordPress style queue\" for the "
333
  "parent stylesheet handling option (see step 6, below).</p>"
334
  msgstr ""
335
 
336
- #: includes/classes/UI.php:318
337
  msgid ""
338
  "This theme loads additional stylesheets after the <code>style.css</code> "
339
  "file:"
340
  msgstr ""
341
 
342
- #: includes/classes/UI.php:319
343
  msgid ""
344
  "<p>Consider saving new custom styles to a \"Separate stylesheet\" (see step "
345
  "5, below) so that you can customize these styles.</p>"
346
  msgstr ""
347
 
348
- #: includes/classes/UI.php:320
349
  msgid ""
350
  "The parent theme's <code>style.css</code> file is being loaded automatically."
351
  msgstr ""
352
 
353
- #: includes/classes/UI.php:321
354
  msgid ""
355
  "<p>The Configurator selected \"Do not add any parent stylesheet handling\" "
356
  "for the \"Parent stylesheet handling\" option (see step 6, below).</p>"
357
  msgstr ""
358
 
359
- #: includes/classes/UI.php:322
360
  msgid ""
361
  "This theme does not require the parent theme's <code>style.css</code> file "
362
  "for its appearance."
363
  msgstr ""
364
 
365
- #: includes/classes/UI.php:323
366
- msgid "This Child Theme was configured with an earlier version."
 
367
  msgstr ""
368
 
369
- #: includes/classes/UI.php:324
370
  msgid ""
371
- "<p>The selected stylesheet handling method is no longer used. Please update "
372
- "the configuration using the \"Repair header template\" option (see step 6, "
373
- "\"Additional handling options\", below).</p>"
374
  msgstr ""
375
 
376
- #: includes/classes/UI.php:325
377
  msgid ""
378
  "Click to show/hide raw analysis data. Please include contents below with any "
379
  "support requests."
380
  msgstr ""
381
 
382
- #: includes/classes/UI.php:326
383
  msgid ""
384
  "This child theme was configured using the CTC Pro \"Genesis stylesheet "
385
  "handling\" method."
386
  msgstr ""
387
 
388
- #: includes/classes/UI.php:327
389
  msgid ""
390
  "<p>This method has been replaced by the \"Separate stylesheet\" and \"Ignore "
391
  "Parent Theme\" options ( selected below ) for broader framework "
392
  "compatability.</p>"
393
  msgstr ""
394
 
395
- #: includes/classes/UI.php:328
396
  msgid "<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>"
397
  msgstr ""
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  #: includes/classes/Upgrade.php:60
400
  msgid "Enter your Update Key"
401
  msgstr ""
@@ -595,7 +559,7 @@ msgstr ""
595
  msgid "Tutorial Videos"
596
  msgstr ""
597
 
598
- #: includes/forms/addl_tabs.php:8
599
  msgid "Upgrade"
600
  msgstr ""
601
 
@@ -615,6 +579,125 @@ msgstr ""
615
  msgid "Debug"
616
  msgstr ""
617
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  #: includes/forms/file-form-buttons.php:9
619
  msgid "Make Selected Writable"
620
  msgstr ""
@@ -837,131 +920,131 @@ msgid ""
837
  "export your themes."
838
  msgstr ""
839
 
840
- #: includes/forms/parent-child.php:22
841
  msgid "Select an action:"
842
  msgstr ""
843
 
844
- #: includes/forms/parent-child.php:30
845
  msgid "CREATE a new Child Theme"
846
  msgstr ""
847
 
848
- #: includes/forms/parent-child.php:33
849
  msgid ""
850
  "Install a new customizable child theme using an installed theme as a parent."
851
  msgstr ""
852
 
853
- #: includes/forms/parent-child.php:46
854
  msgid "CONFIGURE an existing Child Theme"
855
  msgstr ""
856
 
857
- #: includes/forms/parent-child.php:49
858
  msgid ""
859
  "Set up a previously installed child theme for use with the Configurator or "
860
  "to modify current settings."
861
  msgstr ""
862
 
863
- #: includes/forms/parent-child.php:60
864
  msgid "DUPLICATE an existing Child Theme"
865
  msgstr ""
866
 
867
- #: includes/forms/parent-child.php:63
868
  msgid ""
869
  "Make a complete copy of an existing Child Theme in a new directory, "
870
  "including any menus, widgets and other Customizer settings. The option to "
871
  "copy the Parent Theme settings (step 8, below) is disabled with this action."
872
  msgstr ""
873
 
874
- #: includes/forms/parent-child.php:74
875
  msgid ""
876
  "RESET an existing Child Theme (this will destroy any work you have done in "
877
  "the Configurator)"
878
  msgstr ""
879
 
880
- #: includes/forms/parent-child.php:77
881
  msgid ""
882
  "Revert the Child theme stylesheet and functions files to their state before "
883
  "the initial configuration or last reset. Additional child theme files will "
884
  "not be removed, but you can delete them under the Files tab."
885
  msgstr ""
886
 
887
- #: includes/forms/parent-child.php:88
888
  msgid "Select a Parent Theme:"
889
  msgstr ""
890
 
891
- #: includes/forms/parent-child.php:92 includes/forms/parent-child.php:120
892
  msgid "Click here to save a backup of the selected theme."
893
  msgstr ""
894
 
895
- #: includes/forms/parent-child.php:98 includes/forms/parent-child.php:126
896
  msgid "Analyze"
897
  msgstr ""
898
 
899
- #: includes/forms/parent-child.php:102
900
  msgid "Analyze Parent Theme"
901
  msgstr ""
902
 
903
- #: includes/forms/parent-child.php:105 includes/forms/parent-child.php:133
904
  msgid ""
905
  "Click \"Analyze\" to determine stylesheet dependencies and other potential "
906
  "issues."
907
  msgstr ""
908
 
909
- #: includes/forms/parent-child.php:116
910
  msgid "Select a Child Theme:"
911
  msgstr ""
912
 
913
- #: includes/forms/parent-child.php:130
914
  msgid "Analyze Child Theme"
915
  msgstr ""
916
 
917
- #: includes/forms/parent-child.php:145
918
  msgid "Name the new theme directory:"
919
  msgstr ""
920
 
921
- #: includes/forms/parent-child.php:149
922
  msgid "Directory Name"
923
  msgstr ""
924
 
925
- #: includes/forms/parent-child.php:153 includes/forms/parent-child.php:402
926
  msgid "NOTE:"
927
  msgstr ""
928
 
929
- #: includes/forms/parent-child.php:155
930
  msgid ""
931
  "This is NOT the name of the Child Theme. You can customize the name, "
932
  "description, etc. in step 7, below."
933
  msgstr ""
934
 
935
- #: includes/forms/parent-child.php:162
936
  msgid "Verify Child Theme directory:"
937
  msgstr ""
938
 
939
- #: includes/forms/parent-child.php:172
940
  msgid ""
941
  "For verification only (you cannot modify the directory of an existing Child "
942
  "Theme)."
943
  msgstr ""
944
 
945
- #: includes/forms/parent-child.php:185
946
  msgid "Select where to save new styles:"
947
  msgstr ""
948
 
949
- #: includes/forms/parent-child.php:194
950
  msgid "Primary Stylesheet (style.css)"
951
  msgstr ""
952
 
953
- #: includes/forms/parent-child.php:197
954
  msgid ""
955
  "Save new custom styles directly to the Child Theme primary stylesheet, "
956
  "replacing the existing values. The primary stylesheet will load in the order "
957
  "set by the theme."
958
  msgstr ""
959
 
960
- #: includes/forms/parent-child.php:209
961
  msgid "Separate Stylesheet"
962
  msgstr ""
963
 
964
- #: includes/forms/parent-child.php:212
965
  msgid ""
966
  "Save new custom styles to a separate stylesheet and combine any existing "
967
  "child theme styles with the parent to form baseline. Select this option if "
@@ -970,75 +1053,75 @@ msgid ""
970
  "the primary stylesheet."
971
  msgstr ""
972
 
973
- #: includes/forms/parent-child.php:220
974
  msgid "Click to expand"
975
  msgstr ""
976
 
977
- #: includes/forms/parent-child.php:222
978
  msgid "Select Parent Theme stylesheet handling:"
979
  msgstr ""
980
 
981
- #: includes/forms/parent-child.php:236
982
  msgid "Use the WordPress style queue."
983
  msgstr ""
984
 
985
- #: includes/forms/parent-child.php:242
986
  msgid ""
987
  "Let the Configurator determine the appropriate actions and dependencies and "
988
  "update the functions file automatically."
989
  msgstr ""
990
 
991
- #: includes/forms/parent-child.php:248
992
  msgid "Use <code>@import</code> in the child theme stylesheet."
993
  msgstr ""
994
 
995
- #: includes/forms/parent-child.php:254
996
  msgid ""
997
  "Only use this option if the parent stylesheet cannot be loaded using the "
998
  "WordPress style queue. Using <code>@import</code> is not recommended."
999
  msgstr ""
1000
 
1001
- #: includes/forms/parent-child.php:260
1002
  msgid "Do not add any parent stylesheet handling."
1003
  msgstr ""
1004
 
1005
- #: includes/forms/parent-child.php:263
1006
  msgid ""
1007
  "Select this option if this theme already handles the parent theme stylesheet "
1008
  "or if the parent theme's <code>style.css</code> file is not used for its "
1009
  "appearance."
1010
  msgstr ""
1011
 
1012
- #: includes/forms/parent-child.php:270
1013
  msgid "Advanced handling options"
1014
  msgstr ""
1015
 
1016
- #: includes/forms/parent-child.php:277
1017
  msgid "Ignore parent theme stylesheets."
1018
  msgstr ""
1019
 
1020
- #: includes/forms/parent-child.php:278
1021
  msgid ""
1022
  "Do not load or parse the parent theme styles. Only use this option if the "
1023
- "Child Theme uses a Framework like Genesis and only uses child theme "
1024
- "stylesheets for its appearance."
1025
  msgstr ""
1026
 
1027
- #: includes/forms/parent-child.php:288
1028
  msgid "Repair the header template in the child theme."
1029
  msgstr ""
1030
 
1031
- #: includes/forms/parent-child.php:289
1032
  msgid ""
1033
  "Let the Configurator (try to) resolve any stylesheet issues listed above. "
1034
  "This can fix many, but not all, common problems."
1035
  msgstr ""
1036
 
1037
- #: includes/forms/parent-child.php:299
1038
  msgid "Remove stylesheet dependencies"
1039
  msgstr ""
1040
 
1041
- #: includes/forms/parent-child.php:302
1042
  msgid ""
1043
  "By default, the order of stylesheets that load prior to the primary "
1044
  "stylesheet is preserved by treating them as dependencies. In some cases, "
@@ -1046,88 +1129,88 @@ msgid ""
1046
  "necessary, dependency can be removed for specific stylesheets below."
1047
  msgstr ""
1048
 
1049
- #: includes/forms/parent-child.php:312
1050
  msgid "Customize the Child Theme Name, Description, Author, Version, etc.:"
1051
  msgstr ""
1052
 
1053
- #: includes/forms/parent-child.php:316
1054
  msgid "Show/Hide Child Theme Attributes"
1055
  msgstr ""
1056
 
1057
- #: includes/forms/parent-child.php:316
1058
  msgid "Click to toggle form"
1059
  msgstr ""
1060
 
1061
- #: includes/forms/parent-child.php:321
1062
  msgid "Child Theme Name"
1063
  msgstr ""
1064
 
1065
- #: includes/forms/parent-child.php:325
1066
  msgid "Theme Name"
1067
  msgstr ""
1068
 
1069
- #: includes/forms/parent-child.php:331 includes/forms/parent-child.php:335
1070
  msgid "Theme Website"
1071
  msgstr ""
1072
 
1073
- #: includes/forms/parent-child.php:341 includes/forms/parent-child.php:345
1074
  msgid "Author"
1075
  msgstr ""
1076
 
1077
- #: includes/forms/parent-child.php:351 includes/forms/parent-child.php:355
1078
  msgid "Author Website"
1079
  msgstr ""
1080
 
1081
- #: includes/forms/parent-child.php:361
1082
  msgid "Theme Description"
1083
  msgstr ""
1084
 
1085
- #: includes/forms/parent-child.php:365
1086
  msgid "Description"
1087
  msgstr ""
1088
 
1089
- #: includes/forms/parent-child.php:371
1090
  msgid "Theme Tags"
1091
  msgstr ""
1092
 
1093
- #: includes/forms/parent-child.php:375
1094
  msgid "Tags"
1095
  msgstr ""
1096
 
1097
- #: includes/forms/parent-child.php:381 includes/forms/parent-child.php:385
1098
  msgid "Version"
1099
  msgstr ""
1100
 
1101
- #: includes/forms/parent-child.php:394
1102
  msgid ""
1103
  "Copy Menus, Widgets and other Customizer Settings from the Parent Theme to "
1104
  "the Child Theme:"
1105
  msgstr ""
1106
 
1107
- #: includes/forms/parent-child.php:404
1108
  msgid ""
1109
  "This option replaces the Child Theme's existing Menus, Widgets and other "
1110
  "Customizer Settings with those from the Parent Theme. You should only need "
1111
  "to use this option the first time you configure a Child Theme."
1112
  msgstr ""
1113
 
1114
- #: includes/forms/parent-child.php:415 includes/forms/parent-child.php:467
1115
  msgid "Click to run the Configurator:"
1116
  msgstr ""
1117
 
1118
- #: includes/forms/parent-child.php:419
1119
  msgid "Configure Child Theme"
1120
  msgstr ""
1121
 
1122
- #: includes/forms/parent-child.php:441
1123
  msgid "Parse Plugin stylesheets:"
1124
  msgstr ""
1125
 
1126
- #: includes/forms/parent-child.php:446
1127
  msgid "Select the plugin stylesheets you wish to customize below."
1128
  msgstr ""
1129
 
1130
- #: includes/forms/parent-child.php:471
1131
  msgid "Configure Plugin Styles"
1132
  msgstr ""
1133
 
@@ -1232,41 +1315,45 @@ msgstr ""
1232
  msgid "Value"
1233
  msgstr ""
1234
 
1235
- #: includes/forms/settings-errors.php:20
 
 
 
 
1236
  msgid ""
1237
  "Child Theme <strong>%s</strong> has been reset. Please configure it using "
1238
  "the settings below."
1239
  msgstr ""
1240
 
1241
- #: includes/forms/settings-errors.php:24
1242
  msgid "Update Key saved successfully."
1243
  msgstr ""
1244
 
1245
- #: includes/forms/settings-errors.php:29
1246
  msgid "Child Theme files modified successfully."
1247
  msgstr ""
1248
 
1249
- #: includes/forms/settings-errors.php:32
1250
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
1251
  msgstr ""
1252
 
1253
- #: includes/forms/settings-errors.php:36
1254
  msgid "IMPORTANT:"
1255
  msgstr ""
1256
 
1257
- #: includes/forms/settings-errors.php:39
1258
  msgid "You must %sNetwork enable%s your child theme."
1259
  msgstr ""
1260
 
1261
- #: includes/forms/settings-errors.php:42 includes/forms/themepreview.php:20
1262
  msgid "Go to Themes"
1263
  msgstr ""
1264
 
1265
- #: includes/forms/settings-errors.php:46
1266
  msgid "%sPreview your child theme%s before activating."
1267
  msgstr ""
1268
 
1269
- #: includes/forms/settings-errors.php:49 includes/forms/themepreview.php:18
1270
  msgid "Live Preview"
1271
  msgstr ""
1272
 
@@ -1283,7 +1370,7 @@ msgid "Property/ Value"
1283
  msgstr ""
1284
 
1285
  #: includes/forms/tabs.php:22
1286
- msgid "Web Fonts"
1287
  msgstr ""
1288
 
1289
  #: includes/forms/tabs.php:26
@@ -1319,7 +1406,7 @@ msgid "Not Network Enabled"
1319
  msgstr ""
1320
 
1321
  #: includes/forms/webfonts.php:18
1322
- msgid "Linked Stylesheets"
1323
  msgstr ""
1324
 
1325
  #: includes/forms/webfonts.php:20
@@ -1330,6 +1417,16 @@ msgid ""
1330
  "strong>"
1331
  msgstr ""
1332
 
 
 
 
 
 
 
 
 
 
 
1333
  #: includes/forms/zipform.php:6
1334
  msgid "Export Child Theme"
1335
  msgstr ""
1
+ # Copyright (C) 2018 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 2.3.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2018-05-23 23:45:57+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #. #-#-#-#-# child-theme-configurator.pot (Child Theme Configurator 2.3.0) #-#-#-#-#
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  #. Plugin Name of the plugin/theme
17
+ #: includes/classes/Core.php:97 includes/classes/Core.php:108
18
  #: includes/forms/main.php:35
19
  msgid "Child Theme Configurator"
20
  msgstr ""
21
 
22
+ #: includes/classes/Core.php:98 includes/classes/Core.php:109
23
+ #: includes/classes/Core.php:120
24
  msgid "Child Themes"
25
  msgstr ""
26
 
27
+ #: includes/classes/Core.php:138
28
  msgid "Child Theme Configurator requires WordPress version %s or later."
29
  msgstr ""
30
 
31
+ #: includes/classes/UI.php:36
32
  msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
33
  msgstr ""
34
 
35
+ #: includes/classes/UI.php:116
36
  msgid ""
37
  "The Theme editor has been disabled. Template files must be edited offline."
38
  msgstr ""
39
 
40
+ #: includes/classes/UI.php:120
41
  msgid "Click here to edit template files using the Theme Editor"
42
  msgstr ""
43
 
44
+ #: includes/classes/UI.php:288
45
  msgid "URL/None"
46
  msgstr ""
47
 
48
+ #: includes/classes/UI.php:289
49
  msgid "Origin"
50
  msgstr ""
51
 
52
+ #: includes/classes/UI.php:290
53
  msgid "Color 1"
54
  msgstr ""
55
 
56
+ #: includes/classes/UI.php:291
57
  msgid "Color 2"
58
  msgstr ""
59
 
60
+ #: includes/classes/UI.php:292
61
  msgid "Width/None"
62
  msgstr ""
63
 
64
+ #: includes/classes/UI.php:293
65
  msgid "Style"
66
  msgstr ""
67
 
68
+ #: includes/classes/UI.php:294
69
  msgid "Color"
70
  msgstr ""
71
 
72
+ #: includes/classes/UI.php:296
73
  msgid ""
74
  "Are you sure you wish to RESET? This will destroy any work you have done in "
75
  "the Configurator."
76
  msgstr ""
77
 
78
+ #: includes/classes/UI.php:297
79
  msgid "<span style=\"font-size:10px\">!</span>"
80
  msgstr ""
81
 
82
+ #: includes/classes/UI.php:298 includes/forms/rule-value.php:33
83
  msgid "Selectors"
84
  msgstr ""
85
 
86
+ #: includes/classes/UI.php:299
87
  msgid "Close"
88
  msgstr ""
89
 
90
+ #: includes/classes/UI.php:300
91
  msgid "Edit Selector"
92
  msgstr ""
93
 
94
+ #: includes/classes/UI.php:301
95
  msgid "Cancel"
96
  msgstr ""
97
 
98
+ #: includes/classes/UI.php:302
99
  msgid "Rename"
100
  msgstr ""
101
 
102
+ #: includes/classes/UI.php:303
103
  msgid "The stylesheet cannot be displayed."
104
  msgstr ""
105
 
106
+ #: includes/classes/UI.php:304
107
  msgid "(Child Only)"
108
  msgstr ""
109
 
110
+ #: includes/classes/UI.php:305
111
  msgid "Please enter a valid Child Theme."
112
  msgstr ""
113
 
114
+ #: includes/classes/UI.php:306
115
  msgid "Please enter a valid Child Theme name."
116
  msgstr ""
117
 
118
+ #: includes/classes/UI.php:307
119
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
120
  msgstr ""
121
 
122
+ #: includes/classes/UI.php:308
123
  msgid "The page could not be loaded correctly."
124
  msgstr ""
125
 
126
+ #: includes/classes/UI.php:309
127
  msgid ""
128
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
129
  msgstr ""
130
 
131
+ #: includes/classes/UI.php:310
132
  msgid "Deactivating or replacing plugins may resolve this issue."
133
  msgstr ""
134
 
135
+ #: includes/classes/UI.php:311
136
  msgid "%sWhy am I seeing this?%s"
137
  msgstr ""
138
 
139
+ #: includes/classes/UI.php:314
140
  msgid "No Styles Available. Check Parent/Child settings."
141
  msgstr ""
142
 
143
+ #: includes/classes/UI.php:315
144
  msgid "Updating"
145
  msgstr ""
146
 
147
+ #: includes/classes/UI.php:316
148
  msgid "Checking"
149
  msgstr ""
150
 
151
+ #: includes/classes/UI.php:317
152
  msgid "The theme \"%s\" generated unexpected PHP debug output."
153
  msgstr ""
154
 
155
+ #: includes/classes/UI.php:318
156
  msgid ""
157
  "The theme \"%s\" could not be analyzed because the preview did not render "
158
  "correctly."
159
  msgstr ""
160
 
161
+ #: includes/classes/UI.php:319
162
  msgid ""
163
  "<p>First, verify you can <a href=\"%s\">preview your home page with the "
164
  "Customizer</a> and try analyzing again.</p><p>If that does not work, try "
166
  "<strong>force redirects between HTTP and HTTPS</strong>.</p>"
167
  msgstr ""
168
 
169
+ #: includes/classes/UI.php:320
170
  msgid "Click to show/hide PHP debug output"
171
  msgstr ""
172
 
173
+ #: includes/classes/UI.php:322
174
  msgid ""
175
+ "<p><strong>PLEASE NOTE:</strong></p><p><em>The analyzer reveals errors that "
176
+ "may otherwise go undetected. Unless this is a fatal error, WordPress may "
177
+ "appear to work correctly; however, PHP will continue to log the error until "
178
+ "it is resolved. Please contact the author of any theme or plugin</em> "
179
+ "<strong>mentioned above</strong> <em>and cut/paste the error from the text "
180
+ "area.</em> <strong>Do not use a screen capture as it may cut off part of the "
181
+ "error text.</strong> <em>Additional information about the error may also be "
182
+ "available in the <a href=\"http://www.childthemeconfigurator.com/child-theme-"
183
+ "faqs/\" target=\"_blank\">CTC documentation</a>.</em></p>"
184
  msgstr ""
185
 
186
+ #: includes/classes/UI.php:323
187
  msgid "Do Not Activate \"%s\"! A PHP FATAL ERROR has been detected."
188
  msgstr ""
189
 
190
+ #: includes/classes/UI.php:324
191
  msgid "This theme loads stylesheets after the wp_styles queue."
192
  msgstr ""
193
 
194
+ #: includes/classes/UI.php:325
195
  msgid ""
196
  "<p>This makes it difficult for plugins to override these styles. You can try "
197
  "to resolve this using the \"Repair header template\" option (Step 6, "
198
  "\"Additional handling options\", below).</p>"
199
  msgstr ""
200
 
201
+ #: includes/classes/UI.php:326
202
  msgid ""
203
  "This theme loads the parent theme's <code>style.css</code> file outside the "
204
  "wp_styles queue."
205
  msgstr ""
206
 
207
+ #: includes/classes/UI.php:327
208
  msgid ""
209
  "<p>This is common with older themes but requires the use of <code>@import</"
210
  "code>, which is no longer recommended. You can try to resolve this using the "
212
  "\", below).</p>"
213
  msgstr ""
214
 
215
+ #: includes/classes/UI.php:328
216
  msgid "This child theme does not load a Configurator stylesheet."
217
  msgstr ""
218
 
219
+ #: includes/classes/UI.php:329
220
  msgid ""
221
  "<p>If you want to customize styles using this plugin, please click "
222
  "\"Configure Child Theme\" again to add this to the settings.</p>"
223
  msgstr ""
224
 
225
+ #: includes/classes/UI.php:330
226
  msgid ""
227
  "This child theme uses the parent stylesheet but does not load the parent "
228
  "theme's <code>style.css</code> file."
229
  msgstr ""
230
 
231
+ #: includes/classes/UI.php:331
232
  msgid ""
233
  "<p>Please select a stylesheet handling method or check \"Ignore parent theme "
234
  "stylesheets\" (see step 6, below).</p>"
235
  msgstr ""
236
 
237
+ #: includes/classes/UI.php:332
238
  msgid "This child theme appears to be functioning correctly."
239
  msgstr ""
240
 
241
+ #: includes/classes/UI.php:333
242
  msgid "This theme appears OK to use as a Child theme."
243
  msgstr ""
244
 
245
+ #: includes/classes/UI.php:334
246
  msgid "This Child Theme has not been configured for this plugin."
247
  msgstr ""
248
 
249
+ #: includes/classes/UI.php:335
250
  msgid ""
251
  "<p>The Configurator makes significant modifications to the child theme, "
252
  "including stylesheet changes and additional php functions. Please consider "
254
  "original as a backup.</p>"
255
  msgstr ""
256
 
257
+ #: includes/classes/UI.php:336
258
  msgid ""
259
  "This child theme uses <code>@import</code> to load the parent theme's "
260
  "<code>style.css</code> file."
261
  msgstr ""
262
 
263
+ #: includes/classes/UI.php:337
264
  msgid ""
265
  "<p>Please consider selecting \"Use the WordPress style queue\" for the "
266
  "parent stylesheet handling option (see step 6, below).</p>"
267
  msgstr ""
268
 
269
+ #: includes/classes/UI.php:338
270
  msgid ""
271
  "This theme loads additional stylesheets after the <code>style.css</code> "
272
  "file:"
273
  msgstr ""
274
 
275
+ #: includes/classes/UI.php:339
276
  msgid ""
277
  "<p>Consider saving new custom styles to a \"Separate stylesheet\" (see step "
278
  "5, below) so that you can customize these styles.</p>"
279
  msgstr ""
280
 
281
+ #: includes/classes/UI.php:340
282
  msgid ""
283
  "The parent theme's <code>style.css</code> file is being loaded automatically."
284
  msgstr ""
285
 
286
+ #: includes/classes/UI.php:341
287
  msgid ""
288
  "<p>The Configurator selected \"Do not add any parent stylesheet handling\" "
289
  "for the \"Parent stylesheet handling\" option (see step 6, below).</p>"
290
  msgstr ""
291
 
292
+ #: includes/classes/UI.php:342
293
  msgid ""
294
  "This theme does not require the parent theme's <code>style.css</code> file "
295
  "for its appearance."
296
  msgstr ""
297
 
298
+ #: includes/classes/UI.php:343
299
+ msgid ""
300
+ "This Child Theme was configured to accomodate a hard-coded stylesheet link."
301
  msgstr ""
302
 
303
+ #: includes/classes/UI.php:344
304
  msgid ""
305
+ "<p>This workaround was used in earlier versions of CTC and can be eliminated "
306
+ "by using the \"Repair header template\" option (see step 6, \"Additional "
307
+ "handling options\", below).</p>"
308
  msgstr ""
309
 
310
+ #: includes/classes/UI.php:345
311
  msgid ""
312
  "Click to show/hide raw analysis data. Please include contents below with any "
313
  "support requests."
314
  msgstr ""
315
 
316
+ #: includes/classes/UI.php:346
317
  msgid ""
318
  "This child theme was configured using the CTC Pro \"Genesis stylesheet "
319
  "handling\" method."
320
  msgstr ""
321
 
322
+ #: includes/classes/UI.php:347
323
  msgid ""
324
  "<p>This method has been replaced by the \"Separate stylesheet\" and \"Ignore "
325
  "Parent Theme\" options ( selected below ) for broader framework "
326
  "compatability.</p>"
327
  msgstr ""
328
 
329
+ #: includes/classes/UI.php:348
330
  msgid "<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>"
331
  msgstr ""
332
 
333
+ #: includes/classes/UI.php:349
334
+ msgid ""
335
+ "This theme uses a RTL (right-to-left) stylesheet that is not being loaded in "
336
+ "the child theme."
337
+ msgstr ""
338
+
339
+ #: includes/classes/UI.php:350
340
+ msgid ""
341
+ "Use the Web Fonts tab to add a link to the parent RTL stylesheet. See the "
342
+ "documentation for more information.</p>"
343
+ msgstr ""
344
+
345
+ #: includes/classes/UI.php:351
346
+ msgid "Both WP Rocket and Autoptimize plugins are enabled."
347
+ msgstr ""
348
+
349
+ #: includes/classes/UI.php:352
350
+ msgid ""
351
+ "The combination of these two plugins interferes with the Analysis results. "
352
+ "Please temporarily deactivate one of them and Analyze again."
353
+ msgstr ""
354
+
355
+ #: includes/classes/UI.php:353
356
+ msgid ""
357
+ "<p><strong>The WordPress configuration file has been modified incorrectly.</"
358
+ "strong> Please see <a href=\"http://www.childthemeconfigurator.com/child-"
359
+ "theme-faqs/#constants\" target=\"_blank\">this FAQ</a> for more information."
360
+ "</p>"
361
+ msgstr ""
362
+
363
  #: includes/classes/Upgrade.php:60
364
  msgid "Enter your Update Key"
365
  msgstr ""
559
  msgid "Tutorial Videos"
560
  msgstr ""
561
 
562
+ #: includes/forms/addl_tabs.php:7
563
  msgid "Upgrade"
564
  msgstr ""
565
 
579
  msgid "Debug"
580
  msgstr ""
581
 
582
+ #: includes/forms/errorstrings.php:6
583
+ msgid "Zip file creation failed."
584
+ msgstr ""
585
+
586
+ #: includes/forms/errorstrings.php:7
587
+ msgid "You do not have permission to configure child themes."
588
+ msgstr ""
589
+
590
+ #: includes/forms/errorstrings.php:8
591
+ msgid "%s does not exist. Please select a valid Parent Theme."
592
+ msgstr ""
593
+
594
+ #: includes/forms/errorstrings.php:9
595
+ msgid "The Functions file is required and cannot be deleted."
596
+ msgstr ""
597
+
598
+ #: includes/forms/errorstrings.php:10
599
+ msgid "Please select a valid Parent Theme."
600
+ msgstr ""
601
+
602
+ #: includes/forms/errorstrings.php:11
603
+ msgid "Please select a valid Child Theme."
604
+ msgstr ""
605
+
606
+ #: includes/forms/errorstrings.php:12
607
+ msgid "Please enter a valid Child Theme directory name."
608
+ msgstr ""
609
+
610
+ #: includes/forms/errorstrings.php:13
611
+ msgid ""
612
+ "<strong>%s</strong> exists. Please enter a different Child Theme template "
613
+ "name."
614
+ msgstr ""
615
+
616
+ #: includes/forms/errorstrings.php:14
617
+ msgid "Your theme directories are not writable."
618
+ msgstr ""
619
+
620
+ #: includes/forms/errorstrings.php:16
621
+ msgid "Could not upgrade child theme"
622
+ msgstr ""
623
+
624
+ #: includes/forms/errorstrings.php:17
625
+ msgid "Your stylesheet is not writable."
626
+ msgstr ""
627
+
628
+ #: includes/forms/errorstrings.php:19
629
+ msgid ""
630
+ "A closing PHP tag was detected in Child theme functions file so \"Parent "
631
+ "Stylesheet Handling\" option was not configured. Closing PHP at the end of "
632
+ "the file is discouraged as it can cause premature HTTP headers. Please edit "
633
+ "<code>functions.php</code> to remove the final <code>?&gt;</code> tag and "
634
+ "click \"Generate/Rebuild Child Theme Files\" again."
635
+ msgstr ""
636
+
637
+ #: includes/forms/errorstrings.php:20
638
+ msgid "Could not copy file: %s"
639
+ msgstr ""
640
+
641
+ #: includes/forms/errorstrings.php:21
642
+ msgid "Could not delete %s file."
643
+ msgstr ""
644
+
645
+ #: includes/forms/errorstrings.php:22
646
+ msgid "could not copy %s"
647
+ msgstr ""
648
+
649
+ #: includes/forms/errorstrings.php:23
650
+ msgid "invalid dir: %s"
651
+ msgstr ""
652
+
653
+ #: includes/forms/errorstrings.php:24
654
+ msgid "deleted: %s != %s files"
655
+ msgstr ""
656
+
657
+ #: includes/forms/errorstrings.php:25
658
+ msgid "newfiles != files"
659
+ msgstr ""
660
+
661
+ #: includes/forms/errorstrings.php:26
662
+ msgid "There were errors while resetting permissions."
663
+ msgstr ""
664
+
665
+ #: includes/forms/errorstrings.php:28
666
+ msgid "Could not upload file."
667
+ msgstr ""
668
+
669
+ #: includes/forms/errorstrings.php:29
670
+ msgid "Invalid theme root directory."
671
+ msgstr ""
672
+
673
+ #: includes/forms/errorstrings.php:30
674
+ msgid "No writable temp directory."
675
+ msgstr ""
676
+
677
+ #: includes/forms/errorstrings.php:31
678
+ msgid "PclZip returned zero bytes."
679
+ msgstr ""
680
+
681
+ #: includes/forms/errorstrings.php:32
682
+ msgid "Unpack failed -- %s"
683
+ msgstr ""
684
+
685
+ #: includes/forms/errorstrings.php:33
686
+ msgid "Pack failed -- %s"
687
+ msgstr ""
688
+
689
+ #: includes/forms/errorstrings.php:34
690
+ msgid "Maximum number of styles exceeded."
691
+ msgstr ""
692
+
693
+ #: includes/forms/errorstrings.php:35
694
+ msgid "Error moving file: %s"
695
+ msgstr ""
696
+
697
+ #: includes/forms/errorstrings.php:36
698
+ msgid "Could not set write permissions."
699
+ msgstr ""
700
+
701
  #: includes/forms/file-form-buttons.php:9
702
  msgid "Make Selected Writable"
703
  msgstr ""
920
  "export your themes."
921
  msgstr ""
922
 
923
+ #: includes/forms/parent-child.php:19
924
  msgid "Select an action:"
925
  msgstr ""
926
 
927
+ #: includes/forms/parent-child.php:27
928
  msgid "CREATE a new Child Theme"
929
  msgstr ""
930
 
931
+ #: includes/forms/parent-child.php:30
932
  msgid ""
933
  "Install a new customizable child theme using an installed theme as a parent."
934
  msgstr ""
935
 
936
+ #: includes/forms/parent-child.php:43
937
  msgid "CONFIGURE an existing Child Theme"
938
  msgstr ""
939
 
940
+ #: includes/forms/parent-child.php:46
941
  msgid ""
942
  "Set up a previously installed child theme for use with the Configurator or "
943
  "to modify current settings."
944
  msgstr ""
945
 
946
+ #: includes/forms/parent-child.php:57
947
  msgid "DUPLICATE an existing Child Theme"
948
  msgstr ""
949
 
950
+ #: includes/forms/parent-child.php:60
951
  msgid ""
952
  "Make a complete copy of an existing Child Theme in a new directory, "
953
  "including any menus, widgets and other Customizer settings. The option to "
954
  "copy the Parent Theme settings (step 8, below) is disabled with this action."
955
  msgstr ""
956
 
957
+ #: includes/forms/parent-child.php:71
958
  msgid ""
959
  "RESET an existing Child Theme (this will destroy any work you have done in "
960
  "the Configurator)"
961
  msgstr ""
962
 
963
+ #: includes/forms/parent-child.php:74
964
  msgid ""
965
  "Revert the Child theme stylesheet and functions files to their state before "
966
  "the initial configuration or last reset. Additional child theme files will "
967
  "not be removed, but you can delete them under the Files tab."
968
  msgstr ""
969
 
970
+ #: includes/forms/parent-child.php:85
971
  msgid "Select a Parent Theme:"
972
  msgstr ""
973
 
974
+ #: includes/forms/parent-child.php:89 includes/forms/parent-child.php:117
975
  msgid "Click here to save a backup of the selected theme."
976
  msgstr ""
977
 
978
+ #: includes/forms/parent-child.php:95 includes/forms/parent-child.php:123
979
  msgid "Analyze"
980
  msgstr ""
981
 
982
+ #: includes/forms/parent-child.php:99
983
  msgid "Analyze Parent Theme"
984
  msgstr ""
985
 
986
+ #: includes/forms/parent-child.php:102 includes/forms/parent-child.php:130
987
  msgid ""
988
  "Click \"Analyze\" to determine stylesheet dependencies and other potential "
989
  "issues."
990
  msgstr ""
991
 
992
+ #: includes/forms/parent-child.php:113
993
  msgid "Select a Child Theme:"
994
  msgstr ""
995
 
996
+ #: includes/forms/parent-child.php:127
997
  msgid "Analyze Child Theme"
998
  msgstr ""
999
 
1000
+ #: includes/forms/parent-child.php:142
1001
  msgid "Name the new theme directory:"
1002
  msgstr ""
1003
 
1004
+ #: includes/forms/parent-child.php:146
1005
  msgid "Directory Name"
1006
  msgstr ""
1007
 
1008
+ #: includes/forms/parent-child.php:150 includes/forms/parent-child.php:399
1009
  msgid "NOTE:"
1010
  msgstr ""
1011
 
1012
+ #: includes/forms/parent-child.php:152
1013
  msgid ""
1014
  "This is NOT the name of the Child Theme. You can customize the name, "
1015
  "description, etc. in step 7, below."
1016
  msgstr ""
1017
 
1018
+ #: includes/forms/parent-child.php:159
1019
  msgid "Verify Child Theme directory:"
1020
  msgstr ""
1021
 
1022
+ #: includes/forms/parent-child.php:169
1023
  msgid ""
1024
  "For verification only (you cannot modify the directory of an existing Child "
1025
  "Theme)."
1026
  msgstr ""
1027
 
1028
+ #: includes/forms/parent-child.php:182
1029
  msgid "Select where to save new styles:"
1030
  msgstr ""
1031
 
1032
+ #: includes/forms/parent-child.php:191
1033
  msgid "Primary Stylesheet (style.css)"
1034
  msgstr ""
1035
 
1036
+ #: includes/forms/parent-child.php:194
1037
  msgid ""
1038
  "Save new custom styles directly to the Child Theme primary stylesheet, "
1039
  "replacing the existing values. The primary stylesheet will load in the order "
1040
  "set by the theme."
1041
  msgstr ""
1042
 
1043
+ #: includes/forms/parent-child.php:206
1044
  msgid "Separate Stylesheet"
1045
  msgstr ""
1046
 
1047
+ #: includes/forms/parent-child.php:209
1048
  msgid ""
1049
  "Save new custom styles to a separate stylesheet and combine any existing "
1050
  "child theme styles with the parent to form baseline. Select this option if "
1053
  "the primary stylesheet."
1054
  msgstr ""
1055
 
1056
+ #: includes/forms/parent-child.php:217
1057
  msgid "Click to expand"
1058
  msgstr ""
1059
 
1060
+ #: includes/forms/parent-child.php:219
1061
  msgid "Select Parent Theme stylesheet handling:"
1062
  msgstr ""
1063
 
1064
+ #: includes/forms/parent-child.php:233
1065
  msgid "Use the WordPress style queue."
1066
  msgstr ""
1067
 
1068
+ #: includes/forms/parent-child.php:239
1069
  msgid ""
1070
  "Let the Configurator determine the appropriate actions and dependencies and "
1071
  "update the functions file automatically."
1072
  msgstr ""
1073
 
1074
+ #: includes/forms/parent-child.php:245
1075
  msgid "Use <code>@import</code> in the child theme stylesheet."
1076
  msgstr ""
1077
 
1078
+ #: includes/forms/parent-child.php:251
1079
  msgid ""
1080
  "Only use this option if the parent stylesheet cannot be loaded using the "
1081
  "WordPress style queue. Using <code>@import</code> is not recommended."
1082
  msgstr ""
1083
 
1084
+ #: includes/forms/parent-child.php:257
1085
  msgid "Do not add any parent stylesheet handling."
1086
  msgstr ""
1087
 
1088
+ #: includes/forms/parent-child.php:260
1089
  msgid ""
1090
  "Select this option if this theme already handles the parent theme stylesheet "
1091
  "or if the parent theme's <code>style.css</code> file is not used for its "
1092
  "appearance."
1093
  msgstr ""
1094
 
1095
+ #: includes/forms/parent-child.php:267
1096
  msgid "Advanced handling options"
1097
  msgstr ""
1098
 
1099
+ #: includes/forms/parent-child.php:274
1100
  msgid "Ignore parent theme stylesheets."
1101
  msgstr ""
1102
 
1103
+ #: includes/forms/parent-child.php:275
1104
  msgid ""
1105
  "Do not load or parse the parent theme styles. Only use this option if the "
1106
+ "Child Theme uses a Framework like Genesis and uses <em>only child theme "
1107
+ "stylesheets</em> for its appearance."
1108
  msgstr ""
1109
 
1110
+ #: includes/forms/parent-child.php:285
1111
  msgid "Repair the header template in the child theme."
1112
  msgstr ""
1113
 
1114
+ #: includes/forms/parent-child.php:286
1115
  msgid ""
1116
  "Let the Configurator (try to) resolve any stylesheet issues listed above. "
1117
  "This can fix many, but not all, common problems."
1118
  msgstr ""
1119
 
1120
+ #: includes/forms/parent-child.php:296
1121
  msgid "Remove stylesheet dependencies"
1122
  msgstr ""
1123
 
1124
+ #: includes/forms/parent-child.php:299
1125
  msgid ""
1126
  "By default, the order of stylesheets that load prior to the primary "
1127
  "stylesheet is preserved by treating them as dependencies. In some cases, "
1129
  "necessary, dependency can be removed for specific stylesheets below."
1130
  msgstr ""
1131
 
1132
+ #: includes/forms/parent-child.php:309
1133
  msgid "Customize the Child Theme Name, Description, Author, Version, etc.:"
1134
  msgstr ""
1135
 
1136
+ #: includes/forms/parent-child.php:313
1137
  msgid "Show/Hide Child Theme Attributes"
1138
  msgstr ""
1139
 
1140
+ #: includes/forms/parent-child.php:313
1141
  msgid "Click to toggle form"
1142
  msgstr ""
1143
 
1144
+ #: includes/forms/parent-child.php:318
1145
  msgid "Child Theme Name"
1146
  msgstr ""
1147
 
1148
+ #: includes/forms/parent-child.php:322
1149
  msgid "Theme Name"
1150
  msgstr ""
1151
 
1152
+ #: includes/forms/parent-child.php:328 includes/forms/parent-child.php:332
1153
  msgid "Theme Website"
1154
  msgstr ""
1155
 
1156
+ #: includes/forms/parent-child.php:338 includes/forms/parent-child.php:342
1157
  msgid "Author"
1158
  msgstr ""
1159
 
1160
+ #: includes/forms/parent-child.php:348 includes/forms/parent-child.php:352
1161
  msgid "Author Website"
1162
  msgstr ""
1163
 
1164
+ #: includes/forms/parent-child.php:358
1165
  msgid "Theme Description"
1166
  msgstr ""
1167
 
1168
+ #: includes/forms/parent-child.php:362
1169
  msgid "Description"
1170
  msgstr ""
1171
 
1172
+ #: includes/forms/parent-child.php:368
1173
  msgid "Theme Tags"
1174
  msgstr ""
1175
 
1176
+ #: includes/forms/parent-child.php:372
1177
  msgid "Tags"
1178
  msgstr ""
1179
 
1180
+ #: includes/forms/parent-child.php:378 includes/forms/parent-child.php:382
1181
  msgid "Version"
1182
  msgstr ""
1183
 
1184
+ #: includes/forms/parent-child.php:391
1185
  msgid ""
1186
  "Copy Menus, Widgets and other Customizer Settings from the Parent Theme to "
1187
  "the Child Theme:"
1188
  msgstr ""
1189
 
1190
+ #: includes/forms/parent-child.php:401
1191
  msgid ""
1192
  "This option replaces the Child Theme's existing Menus, Widgets and other "
1193
  "Customizer Settings with those from the Parent Theme. You should only need "
1194
  "to use this option the first time you configure a Child Theme."
1195
  msgstr ""
1196
 
1197
+ #: includes/forms/parent-child.php:412 includes/forms/parent-child.php:464
1198
  msgid "Click to run the Configurator:"
1199
  msgstr ""
1200
 
1201
+ #: includes/forms/parent-child.php:416
1202
  msgid "Configure Child Theme"
1203
  msgstr ""
1204
 
1205
+ #: includes/forms/parent-child.php:438
1206
  msgid "Parse Plugin stylesheets:"
1207
  msgstr ""
1208
 
1209
+ #: includes/forms/parent-child.php:443
1210
  msgid "Select the plugin stylesheets you wish to customize below."
1211
  msgstr ""
1212
 
1213
+ #: includes/forms/parent-child.php:468
1214
  msgid "Configure Plugin Styles"
1215
  msgstr ""
1216
 
1315
  msgid "Value"
1316
  msgstr ""
1317
 
1318
+ #: includes/forms/settings-errors.php:16
1319
+ msgid "CTC encountered an error:"
1320
+ msgstr ""
1321
+
1322
+ #: includes/forms/settings-errors.php:48
1323
  msgid ""
1324
  "Child Theme <strong>%s</strong> has been reset. Please configure it using "
1325
  "the settings below."
1326
  msgstr ""
1327
 
1328
+ #: includes/forms/settings-errors.php:54
1329
  msgid "Update Key saved successfully."
1330
  msgstr ""
1331
 
1332
+ #: includes/forms/settings-errors.php:61
1333
  msgid "Child Theme files modified successfully."
1334
  msgstr ""
1335
 
1336
+ #: includes/forms/settings-errors.php:67
1337
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
1338
  msgstr ""
1339
 
1340
+ #: includes/forms/settings-errors.php:71
1341
  msgid "IMPORTANT:"
1342
  msgstr ""
1343
 
1344
+ #: includes/forms/settings-errors.php:74
1345
  msgid "You must %sNetwork enable%s your child theme."
1346
  msgstr ""
1347
 
1348
+ #: includes/forms/settings-errors.php:77 includes/forms/themepreview.php:20
1349
  msgid "Go to Themes"
1350
  msgstr ""
1351
 
1352
+ #: includes/forms/settings-errors.php:81
1353
  msgid "%sPreview your child theme%s before activating."
1354
  msgstr ""
1355
 
1356
+ #: includes/forms/settings-errors.php:84 includes/forms/themepreview.php:18
1357
  msgid "Live Preview"
1358
  msgstr ""
1359
 
1370
  msgstr ""
1371
 
1372
  #: includes/forms/tabs.php:22
1373
+ msgid "Web Fonts & CSS"
1374
  msgstr ""
1375
 
1376
  #: includes/forms/tabs.php:26
1406
  msgstr ""
1407
 
1408
  #: includes/forms/webfonts.php:18
1409
+ msgid "Additional Linked Stylesheets"
1410
  msgstr ""
1411
 
1412
  #: includes/forms/webfonts.php:20
1417
  "strong>"
1418
  msgstr ""
1419
 
1420
+ #: includes/forms/webfonts.php:23
1421
+ msgid "RTL (Right-to-Left) Stylesheets"
1422
+ msgstr ""
1423
+
1424
+ #: includes/forms/webfonts.php:25
1425
+ msgid ""
1426
+ "If RTL is not automatically loading in the child theme, you can link it "
1427
+ "here. <strong>Example:</strong>"
1428
+ msgstr ""
1429
+
1430
  #: includes/forms/zipform.php:6
1431
  msgid "Export Child Theme"
1432
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,9 @@ Contributors: lilaeamedia
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
  Tags: child, theme, child theme, child themes, custom styles, customize styles, customize theme, css, responsive, css editor, child theme editor, child theme generator, child theme creator, style, stylesheet, customizer, childtheme, childthemes
5
  Requires at least: 4.0
 
6
  Tested up to: 4.9
7
- Stable tag: 2.2.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -287,41 +288,36 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
287
  7. Files tab
288
 
289
  == Changelog ==
290
- = 2.2.9 =
291
- Modified preview to include all registered stylesheets in queue
292
- Disable Autoptimize in preview
293
- = 2.2.8.1 =
294
- Added support for General Sibling Selector (~)
295
- = 2.2.8 =
 
 
 
 
 
 
 
 
 
296
  * Fixed CSS class loading FALSE for dictionaries on fresh install
297
  * Fixed using wrong nonce for plugin mode preview (Pro)
298
  * Fixed error thrown when packing negative integers (Pro)
299
-
300
- = 2.2.7 =
301
  * Disable Pagespeed in preview
302
-
303
- = 2.2.6 =
304
  * Fixed Preview and Analyzer for some child theme configurations by removing nonce requirement
305
  * Fixed header not being repaired on first pass with "Repair Header" selected
306
  * Fixed styles being pruned before new "Raw CSS" styles are added
307
-
308
- = 2.2.4.1 =
309
  * Fix bug in parent dependencies
310
-
311
- = 2.2.4 =
312
  * Fix bug where stylesheet dependency arrays are not being initialized
313
  * Add action hook to extend copy theme settings feature
314
  * Display non active tabs, enable upgrade/register before config data is created
315
-
316
- = 2.2.3 =
317
  * Show raw results after Analysis to help debugging
318
  * Fix javascript not escaping quotes in input fields
319
  * Restored original ajax preview and added fallback method for cross-domain preview
320
-
321
- = 2.2.1 =
322
  * Fix in javascript affecting Pro users
323
-
324
- = 2.2.0 =
325
  * Cross domain Parse error
326
  * Showing "reconfigure" message on new install
327
  * Manual upgrade Pro from plugin
@@ -331,10 +327,8 @@ Added support for General Sibling Selector (~)
331
  * Identify and handle imported stylesheets, convert to links
332
  * Fixes related to testing if CTC Pro is installed
333
 
334
- = 2.1.1 =
335
  * change packer class to use standard < 5.4 array syntax
336
-
337
- = 2.1.0 =
338
  * Loading dictionaries on demand
339
  * Reversed key/value dictionary structure for huge memory improvement
340
  * Added packer class to flatten multidim arrays for huge memory improvement
@@ -344,36 +338,24 @@ Added support for General Sibling Selector (~)
344
  * Move html output to separate view includes
345
  * Move theme mod routines to own functions
346
 
347
- = 2.0.6 =
348
  * Fix: preview not parsing parent styles correctly when minimized.
349
  * Fix: cast argument to array in sort functions.
350
  * Updated Child Theme Configurator language template.
351
-
352
- = 2.0.5 =
353
  * Updated child theme preview class to use is_theme_active and other methods to eliminate conflicts with Jetpack and any other plugin that references the customize manager.
354
-
355
- = 2.0.4 =
356
  * Updated child theme preview class to send origin headers and run customize_preview_init action along with some other actions.
357
-
358
- = 2.0.3 =
359
  * Added logic conditions in preview class to help prevent Analyzer from failing in some cases
360
  * Enabled theme zip file export for any selected theme independent of theme currently loaded in Configurator
361
  * Fixed bugs present with servers not running Apache with SuExec
362
  * Fixed issue with Windows servers that do not return C: with filesystem paths
363
-
364
- = 2.0.2 =
365
  * Automatically set priority of enqueue hook based on value from parent theme
366
  * Made file scan routine more efficient
367
  * Support for background-image as base64 data
368
  * Tweaked analyzer signals
369
-
370
- = 2.0.1 =
371
  * Updated language template and de_DE files
372
  * Fix: case where child stylesheet link was not being added resulting in "This child theme does not load a Configurator stylesheet" notice
373
  * Fix: fatal error in debug mode
374
  * Minor bug fixes
375
-
376
- = 2.0.0 =
377
  * New Theme Analyzer automatically checks for issues and determines correct settings
378
  * Step by step setup of Parent/Child settings
379
  * Simplified parent stylesheet handling options
@@ -383,117 +365,73 @@ Added support for General Sibling Selector (~)
383
  * Parses parent theme files and only displays templates that can be be overridden by child themes
384
  * Numerous minor bug fixes
385
 
386
- = 1.7.9.1 =
387
  * Fix: regression bug in 1.7.9 causing new property menu to fail
388
-
389
- = 1.7.9 =
390
  * Fix: use nonce when retrieving front-end html to parse default additional stylesheets
391
  * Refactored classes to make Child Theme Configurator more lightweight on front end
392
-
393
- = 1.7.8 =
394
  * Fix: disable autoload on configuration data options
395
  * Fix: normalize media query and add to menu when added via raw css
396
-
397
- = 1.7.7 =
398
  * Fix: Margin and Padding shorthand generated incorrectly.
399
-
400
- = 1.7.6.1 =
401
  * Addressed case where parent or child theme is in subdirectory.
402
  * Minimized admin CSS.
403
-
404
- = 1.7.6 =
405
  * Sanitize child theme slug
406
  * Remove cascade load order comments from generated CSS
407
  * Set admin background to prevent theme override
408
-
409
- = 1.7.5.1 =
410
  * Refactored background normalization function to better follow CSS specification.
411
  * Check child theme exists function case-insensitive.
412
  * Changed chldthmcfg.init() call to fire on load instead of .ready() to prevent JS conflicts
413
-
414
- = 1.7.5 =
415
  * Uses spectrum color picker to support transparency and named colors.
416
  * Refactored entire system to support fallback values for any property.
417
  * Fix path when duplicating child theme on first run
418
  * New Feature: "delete child values" button - easily revert custom styles in child theme stylesheet
419
-
420
- = 1.7.4.2 =
421
  * Will not write child theme stylesheet if error detected in functions.php
422
-
423
- = 1.7.4.1 =
424
  * Fixed minified JS
425
-
426
- = 1.7.4 =
427
  * Restored multisite admin menu link under Tools by popular demand
428
  * Automatically Network enables new child theme on creation
429
  * Fix for FTP notice - now uses PHP_OS constant to detect win vs nix
430
  * Added duplicate child theme feature
431
-
432
- = 1.7.3 =
433
- * 1.7.3.1 added dismiss option to warnings by popular demand.
434
  * Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.
435
  * Added "Enqueue both parent and child stylesheets" option to enable child theme overrides without using @import.
436
  * Added checks for hard-coded link tags in header template to help resolve incorrect stylesheet load order.
437
  * Fix: "Enqueue child stylesheet" now passes correct value.
438
-
439
- = 1.7.2.1 =
440
  * Fix: hide called before iris init
441
  * Fix: @import not being written on rebuild/configure
442
  * Fix: min height on property/value panel
443
  * Only prune child theme selectors on rename
444
-
445
- = 1.7.1 =
446
  * Removed conflicting wistia javascript link
447
-
448
- = 1.7.0 =
449
  * New Feature: Enqueue child theme stylesheet option for themes that do not load it.
450
  * New Feature: Child Theme and Author website, description and tag fields.
451
  * Fix: Redesigned UI Javascript using jQuery objects for better browser memory management.
452
  * Fix: Child Theme Stylesheet version is timestamped to force browser reload after changes.
453
 
454
- = 1.6.5.2 =
455
  * Fix: Empty functions file created causing inserted markers to be output to browser.
456
  * Fix: check for closed PHP tag in functions file prior to inserting markers
457
-
458
- = 1.6.5.1 =
459
  * Fix: undefined constant LILAEAMEDIA_URL
460
  * Fix: logic to determine whether to display config notice
461
-
462
- = 1.6.5 =
463
  * Fix: incorrect path generation and validation on Windows servers
464
  * Added error handling and notification to prevent jQuery conflicts and out of memory conditions
465
  * Fix: removed max-height on property/value overlay
466
  * Added debug option
467
-
468
- = 1.6.4 =
469
  * New Feature: Copy selector button for Raw CSS textarea on Query/Selector tab.
470
  * Fix: Menus rendering incorrectly for RTL locales
471
  * Fix: Border-top etc. not being written correctly to stylesheet
472
  * Fix: Refactored ajax semaphore logic and flow
473
-
474
- = 1.6.3 =
475
  * New Feature: Better child theme handling for multisite. Moved interface to Themes menu and check for network enabled.
476
  * Fix: Restrict child theme configurator access to install_themes capability
477
  * Fix: Preview links to Themes admin if not network enabled to prevent 'Cheatin, uh?' error.
478
  * Fix: only users with "install_themes" capability have access to Child Theme Configurator. This resolves permission issues with both multisite and single site installs. **MULTISITE USERS:** The Admin HAS MOVED to Network Admin > Themes > Child Themes for better handling for multisite (network) installs.
479
-
480
- = 1.6.2.1 =
481
  * Fix: Regular expression introduced in version 1.6.2 parses selectors incorrectly.
482
-
483
- = 1.6.2 =
484
  * Fix: replaced wp_normalize_path with class method to support legacy WP versions
485
  * Fix: support for multiple layered background images
486
  * Fix: background:none being parsed into gradient origin parameter
487
  * Fix: support for data URIs
488
  * Fix: support for *= and ^= notation in selectors
489
-
490
- = 1.6.1 =
491
  * Fix: add check if theme uses hard-wired stylesheet link and alert to use @import instead of link option
492
  * Fix: conflicts with using jQuery UI from CDN - using local version of 1.11.2 Widget/Menu/Selectmenu instead
493
  * Fix: using wp-color-picker handle instead of iris as dependency to make sure wpColorPicker() methods are loaded
494
  * Fix: copy parent theme widgets logic is different when child theme is active
495
-
496
- = 1.6.0 =
497
  * New Feature: option to load parent stylesheet using wp_enqueue_style (link), @import or none.
498
  * Thanks to cmwwebfx and Shapeshifter3 for pushing me on this
499
  * New Feature: automatically-generated slug and name
@@ -504,75 +442,47 @@ Added support for General Sibling Selector (~)
504
  * Fix: parent CSS preview to correctly display all parsed parent stylesheets in sequence
505
  * Fix: Refactored throughout for maintainability
506
 
507
- = 1.5.4 =
508
  * New Feature: Load imported stylesheets into the CTC admin so web fonts can be previewed.
509
  * Set preview swatch to z-index -1 to prevent it from covering up the controls
510
  * Spread config data across multiple option records to prevent out of memory errors with large stylesheets.
511
  * Do not automatically select Bootstrap CSS files as additional stylesheets to (greatly) reduce overhead.
512
  * Add jQuery UI styles that are no longer being loaded by default in the WP admin (autoselect menus).
513
-
514
- = 1.5.3 =
515
  * Fixed a bug in the way zero values are handled that was breaking css output in certain situations
516
  * Added regex filter for non-printable (e.g., null) characters in input strings
517
-
518
- = 1.5.2.2 =
519
  * Fixed a bug introduced in v1.5.2(.1) that copied all of the parent styles to the child theme stylesheet. This should only be an issue for 'background-image' styles that reference images in the parent theme and do not have child theme overrides.
520
  * Rolled back changes to the javascript controller that introduced a number of type errors.
521
  * Tweaked preview ajax call to handle ssl.
522
-
523
- = 1.5.2.1 =
524
  * Automatically set additional stylesheets to parse based on parent theme links in head.
525
  * Render parent CSS including additional stylesheets
526
-
527
- = 1.5.1 =
528
  * Added copy option to Parent/Child tab to assign menu locations, sidebars/widgets, custom header, background, and other options to new Child Themes.
529
-
530
- = 1.5.0 =
531
  * Refactored CTC to use the WP_Filesystem API.
532
  * Non suExec configurations will now require user credentials to add, remove or update Child Theme files.
533
  * Added the ability for you to make the files writable while editing and then make them read-only when you are done.
534
  * You can also set your credentials in wp-config.php: http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
535
 
536
- = 1.4.8 =
537
  * Removed backreference in main CSS parser regex due to high memory usage.
538
-
539
- = 1.4.7 =
540
  * Fixed uninitialized variable in files UI.
541
-
542
- = 1.4.6 =
543
  * Feature: export child themes as zip archive
544
  * Added transform to list of vendor properties
545
  * Bug fixed: parser not loading multiple instances of same @media rulesets
546
  * Refactored uploader to use wp core functions for compatibility and security
547
  * Increased CHLD_THM_CFG_MAX_RECURSE_LOOPS to 1000 to accommodate complex parent frameworks
548
-
549
- = 1.4.5.2 =
550
  * Fix: javascript bug
551
-
552
- = 1.4.5.1 =
553
  * Fix: regression bug - sanitizing broke raw input selectors
554
-
555
- = 1.4.5 =
556
  * Fix: escape quotes in text inputs. This has bugged me for a while now.
557
  * Fix: Escape backslash for octal content values. Thanks Laurent for reporting this.
558
  * Fix: Normalize colors to lowercase and short form when possible to prevent duplicate entries in the data
559
-
560
- = 1.4.4 =
561
  * Refactored the way CTC caches updates and returns them to the UI controller to reduce memory consumption.
562
  * Prevent out of memory fatals when generating new child themes.
563
  * Changed "Scan Parent for Additional Stylesheets" to individual checkbox options for each file with a toggle to show/hide in the Parent/Child tab.
564
  * Added automatic update of form when Parent Theme is changed.
565
  * Pre-populate Parent/Child form when parent slug is passed to CTC options.
566
-
567
- = 1.4.3 =
568
  * updated parser to match selectors containing parentheses and empty media rulesets
569
-
570
- = 1.4.2 =
571
  * Tweaked the Files tab options and added check for DISALLOW_FILE_EDIT
572
  * Removed automatic @import rules for additional stylesheets that are loaded.
573
  * Fixed bug caused by new jQuery .css function handling of empty css values (preview swatch).
574
-
575
- = 1.4.0 =
576
  * New Feature: Theme Files tab:
577
  * Copy parent templates to child themes to be edited using the Theme Editor.
578
  * Remove child theme templates.
@@ -580,65 +490,35 @@ Added support for General Sibling Selector (~)
580
  * Remove child theme images.
581
  * Upload child theme screenshot.
582
 
583
- = 1.3.5 =
584
  * Fixes a bug with the way the @import data is stored that threw errors on php 5.3 and corrupted v1.3.2 @import data.
585
-
586
- = 1.3.3 =
587
  * New Feature: option to scan parent theme for additional stylesheets. This allows CTC to be used with themes such as "Responsive" by CyberChimps.
588
  * New Feature: automatically copies parent theme screenshot to child.
589
-
590
- = 1.3.2 =
591
  * Fixed unquoted regex pattern in file path security check function. Thanks to buzcuz for reporting this.
592
-
593
- = 1.3.1 =
594
  * Updated help tab content. Added additional sanitization of source and target file paths.
595
-
596
- = 1.3.0 =
597
  * Changed CSS preview to retrieve directly from WordPress Admin instead of remote http GET to prevent caching issues.
598
  * Added loading icon for CSS preview.
599
  * Fixed JS type error on backup toggle.
600
  * Improved extensibility throughout.
601
 
602
- = 1.2.3 =
603
  * Replace PHP short tags with standard codes.
604
-
605
- = 1.2.2 =
606
  * New Features: You can now rename selectors in place from the Query/Selector panel. Made stylesheet backup optional. Bugs fixed: Incorrect parsing of background position when '0', fixed type error when background image url value is removed.
607
-
608
- = 1.2.1 =
609
  * Bugs fixed: "star hack" properties no longer throwing js error. Important flag now works on borders and gradients.
610
-
611
- = 1.2.0 =
612
  * New features: Link to Query/Selector tab from specific Property/Value selector, new property focus on adding new property. Bugs fixed: clear Query/Selector inputs when loaded selector is empty, use latest min.js script.
613
 
614
- = 1.1.9 =
615
  * Added check for writability before attempting to create child theme files to avoid fatal error on servers not running suEXEC. Fixed a bug in the ctc_update_cache function that was throwing a fatal JS error when new media queries were saved via the Raw CSS input. Configurator now adds functions.php file to child theme when it does not exist.
616
-
617
- = 1.1.8 =
618
  * Added reorder sequence and important flag functionality. Fixed bug where multiple inputs with same selector/property combo were assigned the same id. Fixed bug in the shorthand encoding routine.
619
-
620
- = 1.1.7 =
621
  * Added tutorial video to help tabs.
622
-
623
- = 1.1.6 =
624
  * Added call to reset_updates() before update_option() to prevent serialization errors.
625
-
626
- = 1.1.5 =
627
  * Query/Selector panel now defaults to 'base'
628
  * Fixed bug causing background-image with full urls (http://) to be parsed as gradients
629
  * Fixed bug causing property menu to throw error when selector has no properties
630
-
631
- = 1.1.4 =
632
  * Fixed sort bug in shorthand parser that was returning properties in wrong order
633
-
634
- = 1.1.3 =
635
  * Fixed bug that assumed lowercase only for theme slugs. (Thanks to timk)
636
  * Fixed update redirect to execute on first run
637
-
638
- = 1.1.2 =
639
  * Small bug fix to javascript (casting number to string)
640
-
641
- = 1.1.1 =
642
  * Fixed major bug where inputs containing '0' were being ignored
643
  * Removed "no leading digits" requirement for theme slug
644
  * Change query sort function to keep parent order of queries without device width rules
@@ -648,8 +528,6 @@ Added support for General Sibling Selector (~)
648
  * Fixed duplicate "new property" bug on Query/Selector panel
649
  * added timestamp to backup file
650
  * Added encode_shorthand function to recombine margin/padding values when all 4 sides are present
651
-
652
- = 1.1.0 =
653
  * Corrected parsing for certain backgrounds and gradients (e.g., supports hsla color syntax)
654
  * Handle empty selectors
655
  * Ajax load for menus and updates
@@ -660,7 +538,7 @@ Added support for General Sibling Selector (~)
660
  * Initial release.
661
 
662
  == Upgrade Notice ==
663
- 2.2.8 Several bug fixes. See changelog for details.
664
 
665
  == Query/Selector Tab ==
666
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
  Tags: child, theme, child theme, child themes, custom styles, customize styles, customize theme, css, responsive, css editor, child theme editor, child theme generator, child theme creator, style, stylesheet, customizer, childtheme, childthemes
5
  Requires at least: 4.0
6
+ Requires PHP: 5.6.36
7
  Tested up to: 4.9
8
+ Stable tag: 2.3.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
288
  7. Files tab
289
 
290
  == Changelog ==
291
+
292
+ = 2.3.0 =
293
+ * Added ability to rename @media query
294
+ * Added height/Width for theme images on Files Tab
295
+ * Added test for RTL in Analyzer
296
+ * Added test cases for WP Rocket and AutOptimize plugins in Analyzer
297
+ * Added redirect for error condition after configurator POST
298
+ * Clarified descriptions for certain Analyzer signal conditions
299
+ * Set priority of child theme css hook to force load after parent
300
+ * Remove pruned selectors from menu
301
+
302
+ = 2.2.x =
303
+ * Modified preview to include all registered stylesheets in queue
304
+ * Disable Autoptimize in preview
305
+ * Added support for General Sibling Selector (~)
306
  * Fixed CSS class loading FALSE for dictionaries on fresh install
307
  * Fixed using wrong nonce for plugin mode preview (Pro)
308
  * Fixed error thrown when packing negative integers (Pro)
 
 
309
  * Disable Pagespeed in preview
 
 
310
  * Fixed Preview and Analyzer for some child theme configurations by removing nonce requirement
311
  * Fixed header not being repaired on first pass with "Repair Header" selected
312
  * Fixed styles being pruned before new "Raw CSS" styles are added
 
 
313
  * Fix bug in parent dependencies
 
 
314
  * Fix bug where stylesheet dependency arrays are not being initialized
315
  * Add action hook to extend copy theme settings feature
316
  * Display non active tabs, enable upgrade/register before config data is created
 
 
317
  * Show raw results after Analysis to help debugging
318
  * Fix javascript not escaping quotes in input fields
319
  * Restored original ajax preview and added fallback method for cross-domain preview
 
 
320
  * Fix in javascript affecting Pro users
 
 
321
  * Cross domain Parse error
322
  * Showing "reconfigure" message on new install
323
  * Manual upgrade Pro from plugin
327
  * Identify and handle imported stylesheets, convert to links
328
  * Fixes related to testing if CTC Pro is installed
329
 
330
+ = 2.1.x =
331
  * change packer class to use standard < 5.4 array syntax
 
 
332
  * Loading dictionaries on demand
333
  * Reversed key/value dictionary structure for huge memory improvement
334
  * Added packer class to flatten multidim arrays for huge memory improvement
338
  * Move html output to separate view includes
339
  * Move theme mod routines to own functions
340
 
341
+ = 2.0.x =
342
  * Fix: preview not parsing parent styles correctly when minimized.
343
  * Fix: cast argument to array in sort functions.
344
  * Updated Child Theme Configurator language template.
 
 
345
  * Updated child theme preview class to use is_theme_active and other methods to eliminate conflicts with Jetpack and any other plugin that references the customize manager.
 
 
346
  * Updated child theme preview class to send origin headers and run customize_preview_init action along with some other actions.
 
 
347
  * Added logic conditions in preview class to help prevent Analyzer from failing in some cases
348
  * Enabled theme zip file export for any selected theme independent of theme currently loaded in Configurator
349
  * Fixed bugs present with servers not running Apache with SuExec
350
  * Fixed issue with Windows servers that do not return C: with filesystem paths
 
 
351
  * Automatically set priority of enqueue hook based on value from parent theme
352
  * Made file scan routine more efficient
353
  * Support for background-image as base64 data
354
  * Tweaked analyzer signals
 
 
355
  * Updated language template and de_DE files
356
  * Fix: case where child stylesheet link was not being added resulting in "This child theme does not load a Configurator stylesheet" notice
357
  * Fix: fatal error in debug mode
358
  * Minor bug fixes
 
 
359
  * New Theme Analyzer automatically checks for issues and determines correct settings
360
  * Step by step setup of Parent/Child settings
361
  * Simplified parent stylesheet handling options
365
  * Parses parent theme files and only displays templates that can be be overridden by child themes
366
  * Numerous minor bug fixes
367
 
368
+ = 1.7.x =
369
  * Fix: regression bug in 1.7.9 causing new property menu to fail
 
 
370
  * Fix: use nonce when retrieving front-end html to parse default additional stylesheets
371
  * Refactored classes to make Child Theme Configurator more lightweight on front end
 
 
372
  * Fix: disable autoload on configuration data options
373
  * Fix: normalize media query and add to menu when added via raw css
 
 
374
  * Fix: Margin and Padding shorthand generated incorrectly.
 
 
375
  * Addressed case where parent or child theme is in subdirectory.
376
  * Minimized admin CSS.
 
 
377
  * Sanitize child theme slug
378
  * Remove cascade load order comments from generated CSS
379
  * Set admin background to prevent theme override
 
 
380
  * Refactored background normalization function to better follow CSS specification.
381
  * Check child theme exists function case-insensitive.
382
  * Changed chldthmcfg.init() call to fire on load instead of .ready() to prevent JS conflicts
 
 
383
  * Uses spectrum color picker to support transparency and named colors.
384
  * Refactored entire system to support fallback values for any property.
385
  * Fix path when duplicating child theme on first run
386
  * New Feature: "delete child values" button - easily revert custom styles in child theme stylesheet
 
 
387
  * Will not write child theme stylesheet if error detected in functions.php
 
 
388
  * Fixed minified JS
 
 
389
  * Restored multisite admin menu link under Tools by popular demand
390
  * Automatically Network enables new child theme on creation
391
  * Fix for FTP notice - now uses PHP_OS constant to detect win vs nix
392
  * Added duplicate child theme feature
393
+ * added dismiss option to warnings by popular demand.
 
 
394
  * Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.
395
  * Added "Enqueue both parent and child stylesheets" option to enable child theme overrides without using @import.
396
  * Added checks for hard-coded link tags in header template to help resolve incorrect stylesheet load order.
397
  * Fix: "Enqueue child stylesheet" now passes correct value.
 
 
398
  * Fix: hide called before iris init
399
  * Fix: @import not being written on rebuild/configure
400
  * Fix: min height on property/value panel
401
  * Only prune child theme selectors on rename
 
 
402
  * Removed conflicting wistia javascript link
 
 
403
  * New Feature: Enqueue child theme stylesheet option for themes that do not load it.
404
  * New Feature: Child Theme and Author website, description and tag fields.
405
  * Fix: Redesigned UI Javascript using jQuery objects for better browser memory management.
406
  * Fix: Child Theme Stylesheet version is timestamped to force browser reload after changes.
407
 
408
+ = 1.6.x =
409
  * Fix: Empty functions file created causing inserted markers to be output to browser.
410
  * Fix: check for closed PHP tag in functions file prior to inserting markers
 
 
411
  * Fix: undefined constant LILAEAMEDIA_URL
412
  * Fix: logic to determine whether to display config notice
 
 
413
  * Fix: incorrect path generation and validation on Windows servers
414
  * Added error handling and notification to prevent jQuery conflicts and out of memory conditions
415
  * Fix: removed max-height on property/value overlay
416
  * Added debug option
 
 
417
  * New Feature: Copy selector button for Raw CSS textarea on Query/Selector tab.
418
  * Fix: Menus rendering incorrectly for RTL locales
419
  * Fix: Border-top etc. not being written correctly to stylesheet
420
  * Fix: Refactored ajax semaphore logic and flow
 
 
421
  * New Feature: Better child theme handling for multisite. Moved interface to Themes menu and check for network enabled.
422
  * Fix: Restrict child theme configurator access to install_themes capability
423
  * Fix: Preview links to Themes admin if not network enabled to prevent 'Cheatin, uh?' error.
424
  * Fix: only users with "install_themes" capability have access to Child Theme Configurator. This resolves permission issues with both multisite and single site installs. **MULTISITE USERS:** The Admin HAS MOVED to Network Admin > Themes > Child Themes for better handling for multisite (network) installs.
 
 
425
  * Fix: Regular expression introduced in version 1.6.2 parses selectors incorrectly.
 
 
426
  * Fix: replaced wp_normalize_path with class method to support legacy WP versions
427
  * Fix: support for multiple layered background images
428
  * Fix: background:none being parsed into gradient origin parameter
429
  * Fix: support for data URIs
430
  * Fix: support for *= and ^= notation in selectors
 
 
431
  * Fix: add check if theme uses hard-wired stylesheet link and alert to use @import instead of link option
432
  * Fix: conflicts with using jQuery UI from CDN - using local version of 1.11.2 Widget/Menu/Selectmenu instead
433
  * Fix: using wp-color-picker handle instead of iris as dependency to make sure wpColorPicker() methods are loaded
434
  * Fix: copy parent theme widgets logic is different when child theme is active
 
 
435
  * New Feature: option to load parent stylesheet using wp_enqueue_style (link), @import or none.
436
  * Thanks to cmwwebfx and Shapeshifter3 for pushing me on this
437
  * New Feature: automatically-generated slug and name
442
  * Fix: parent CSS preview to correctly display all parsed parent stylesheets in sequence
443
  * Fix: Refactored throughout for maintainability
444
 
445
+ = 1.5.x =
446
  * New Feature: Load imported stylesheets into the CTC admin so web fonts can be previewed.
447
  * Set preview swatch to z-index -1 to prevent it from covering up the controls
448
  * Spread config data across multiple option records to prevent out of memory errors with large stylesheets.
449
  * Do not automatically select Bootstrap CSS files as additional stylesheets to (greatly) reduce overhead.
450
  * Add jQuery UI styles that are no longer being loaded by default in the WP admin (autoselect menus).
 
 
451
  * Fixed a bug in the way zero values are handled that was breaking css output in certain situations
452
  * Added regex filter for non-printable (e.g., null) characters in input strings
 
 
453
  * Fixed a bug introduced in v1.5.2(.1) that copied all of the parent styles to the child theme stylesheet. This should only be an issue for 'background-image' styles that reference images in the parent theme and do not have child theme overrides.
454
  * Rolled back changes to the javascript controller that introduced a number of type errors.
455
  * Tweaked preview ajax call to handle ssl.
 
 
456
  * Automatically set additional stylesheets to parse based on parent theme links in head.
457
  * Render parent CSS including additional stylesheets
 
 
458
  * Added copy option to Parent/Child tab to assign menu locations, sidebars/widgets, custom header, background, and other options to new Child Themes.
 
 
459
  * Refactored CTC to use the WP_Filesystem API.
460
  * Non suExec configurations will now require user credentials to add, remove or update Child Theme files.
461
  * Added the ability for you to make the files writable while editing and then make them read-only when you are done.
462
  * You can also set your credentials in wp-config.php: http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants
463
 
464
+ = 1.4.x =
465
  * Removed backreference in main CSS parser regex due to high memory usage.
 
 
466
  * Fixed uninitialized variable in files UI.
 
 
467
  * Feature: export child themes as zip archive
468
  * Added transform to list of vendor properties
469
  * Bug fixed: parser not loading multiple instances of same @media rulesets
470
  * Refactored uploader to use wp core functions for compatibility and security
471
  * Increased CHLD_THM_CFG_MAX_RECURSE_LOOPS to 1000 to accommodate complex parent frameworks
 
 
472
  * Fix: javascript bug
 
 
473
  * Fix: regression bug - sanitizing broke raw input selectors
 
 
474
  * Fix: escape quotes in text inputs. This has bugged me for a while now.
475
  * Fix: Escape backslash for octal content values. Thanks Laurent for reporting this.
476
  * Fix: Normalize colors to lowercase and short form when possible to prevent duplicate entries in the data
 
 
477
  * Refactored the way CTC caches updates and returns them to the UI controller to reduce memory consumption.
478
  * Prevent out of memory fatals when generating new child themes.
479
  * Changed "Scan Parent for Additional Stylesheets" to individual checkbox options for each file with a toggle to show/hide in the Parent/Child tab.
480
  * Added automatic update of form when Parent Theme is changed.
481
  * Pre-populate Parent/Child form when parent slug is passed to CTC options.
 
 
482
  * updated parser to match selectors containing parentheses and empty media rulesets
 
 
483
  * Tweaked the Files tab options and added check for DISALLOW_FILE_EDIT
484
  * Removed automatic @import rules for additional stylesheets that are loaded.
485
  * Fixed bug caused by new jQuery .css function handling of empty css values (preview swatch).
 
 
486
  * New Feature: Theme Files tab:
487
  * Copy parent templates to child themes to be edited using the Theme Editor.
488
  * Remove child theme templates.
490
  * Remove child theme images.
491
  * Upload child theme screenshot.
492
 
493
+ = 1.3.x =
494
  * Fixes a bug with the way the @import data is stored that threw errors on php 5.3 and corrupted v1.3.2 @import data.
 
 
495
  * New Feature: option to scan parent theme for additional stylesheets. This allows CTC to be used with themes such as "Responsive" by CyberChimps.
496
  * New Feature: automatically copies parent theme screenshot to child.
 
 
497
  * Fixed unquoted regex pattern in file path security check function. Thanks to buzcuz for reporting this.
 
 
498
  * Updated help tab content. Added additional sanitization of source and target file paths.
 
 
499
  * Changed CSS preview to retrieve directly from WordPress Admin instead of remote http GET to prevent caching issues.
500
  * Added loading icon for CSS preview.
501
  * Fixed JS type error on backup toggle.
502
  * Improved extensibility throughout.
503
 
504
+ = 1.2.x =
505
  * Replace PHP short tags with standard codes.
 
 
506
  * New Features: You can now rename selectors in place from the Query/Selector panel. Made stylesheet backup optional. Bugs fixed: Incorrect parsing of background position when '0', fixed type error when background image url value is removed.
 
 
507
  * Bugs fixed: "star hack" properties no longer throwing js error. Important flag now works on borders and gradients.
 
 
508
  * New features: Link to Query/Selector tab from specific Property/Value selector, new property focus on adding new property. Bugs fixed: clear Query/Selector inputs when loaded selector is empty, use latest min.js script.
509
 
510
+ = 1.1.x =
511
  * Added check for writability before attempting to create child theme files to avoid fatal error on servers not running suEXEC. Fixed a bug in the ctc_update_cache function that was throwing a fatal JS error when new media queries were saved via the Raw CSS input. Configurator now adds functions.php file to child theme when it does not exist.
 
 
512
  * Added reorder sequence and important flag functionality. Fixed bug where multiple inputs with same selector/property combo were assigned the same id. Fixed bug in the shorthand encoding routine.
 
 
513
  * Added tutorial video to help tabs.
 
 
514
  * Added call to reset_updates() before update_option() to prevent serialization errors.
 
 
515
  * Query/Selector panel now defaults to 'base'
516
  * Fixed bug causing background-image with full urls (http://) to be parsed as gradients
517
  * Fixed bug causing property menu to throw error when selector has no properties
 
 
518
  * Fixed sort bug in shorthand parser that was returning properties in wrong order
 
 
519
  * Fixed bug that assumed lowercase only for theme slugs. (Thanks to timk)
520
  * Fixed update redirect to execute on first run
 
 
521
  * Small bug fix to javascript (casting number to string)
 
 
522
  * Fixed major bug where inputs containing '0' were being ignored
523
  * Removed "no leading digits" requirement for theme slug
524
  * Change query sort function to keep parent order of queries without device width rules
528
  * Fixed duplicate "new property" bug on Query/Selector panel
529
  * added timestamp to backup file
530
  * Added encode_shorthand function to recombine margin/padding values when all 4 sides are present
 
 
531
  * Corrected parsing for certain backgrounds and gradients (e.g., supports hsla color syntax)
532
  * Handle empty selectors
533
  * Ajax load for menus and updates
538
  * Initial release.
539
 
540
  == Upgrade Notice ==
541
+ 2.3.0 Several bug fixes and functionality improvements. See changelog for details.
542
 
543
  == Query/Selector Tab ==
544