Astra Starter Sites - Version 2.0.0

Version Description

Download this release

Release Info

Developer vrundakansara
Plugin Icon Astra Starter Sites
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.4.5 to 2.0.0

Files changed (83) hide show
  1. astra-sites.php +7 -7
  2. inc/assets/css/admin-rtl.css +2814 -0
  3. inc/assets/css/admin.css +2424 -401
  4. inc/assets/css/elementor-admin-common-rtl.css +247 -0
  5. inc/assets/css/elementor-admin-common.css +247 -0
  6. inc/assets/css/elementor-admin-dark-rtl.css +109 -0
  7. inc/assets/css/elementor-admin-dark.css +109 -0
  8. inc/assets/css/elementor-admin-rtl.css +1114 -0
  9. inc/assets/css/elementor-admin.css +1114 -0
  10. inc/assets/css/images-rtl.css +541 -0
  11. inc/assets/css/images.css +541 -0
  12. inc/assets/css/install-theme-rtl.css +21 -0
  13. inc/assets/css/integration-rtl.css +304 -0
  14. inc/assets/css/integration.css +304 -0
  15. inc/assets/fonts/astra-sites.eot +0 -0
  16. inc/assets/fonts/astra-sites.svg +16 -0
  17. inc/assets/fonts/astra-sites.ttf +0 -0
  18. inc/assets/fonts/astra-sites.woff +0 -0
  19. inc/assets/images/arrow-blue.svg +12 -0
  20. inc/assets/images/beaver-builder.png +0 -0
  21. inc/assets/images/empty-collection.svg +91 -0
  22. inc/assets/images/logo.svg +20 -0
  23. inc/assets/images/placeholder.png +0 -0
  24. inc/assets/images/sites-screenshot.jpg +0 -0
  25. inc/assets/js/admin-page.js +2738 -953
  26. inc/assets/js/astra-sites-api.js +43 -11
  27. inc/assets/js/dist/common.js +292 -0
  28. inc/assets/js/dist/index.js +352 -0
  29. inc/assets/js/elementor-admin-page.js +1605 -0
  30. inc/assets/js/history.js +1 -0
  31. inc/assets/js/install-theme.js +8 -12
  32. inc/assets/js/src/content.js +22 -0
  33. inc/assets/js/src/frame.js +52 -0
  34. inc/assets/js/src/index.js +88 -0
  35. inc/assets/js/src/search.js +87 -0
  36. inc/classes/class-astra-sites-elementor-images.php +94 -0
  37. inc/classes/class-astra-sites-elementor-pages.php +102 -0
  38. inc/classes/class-astra-sites-importer-log.php +162 -53
  39. inc/classes/class-astra-sites-importer.php +111 -131
  40. inc/classes/class-astra-sites-page.php +564 -83
  41. inc/classes/class-astra-sites-white-label.php +50 -11
  42. inc/classes/class-astra-sites-wp-cli.php +33 -12
  43. inc/classes/class-astra-sites.php +1308 -154
  44. inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php +7 -5
  45. inc/classes/compatibility/class-astra-sites-compatibility.php +1 -4
  46. inc/classes/compatibility/elementor/class-astra-sites-compatibility-elementor.php +11 -9
  47. inc/classes/compatibility/sfwd-lms/class-astra-sites-compatibility-sfwd-lms.php +2 -2
  48. inc/classes/compatibility/so-widgets-bundle/class-astra-sites-compatibility-so-widgets.php +0 -86
  49. inc/classes/compatibility/woocommerce/class-astra-sites-compatibility-woocommerce.php +2 -2
  50. inc/classes/functions.php +31 -0
  51. inc/config/paths.js +21 -0
  52. inc/config/webpack.config.dev.js +88 -0
  53. inc/config/webpack.config.prod.js +92 -0
  54. inc/importers/batch-processing/class-astra-sites-batch-processing-beaver-builder.php +40 -14
  55. inc/importers/batch-processing/class-astra-sites-batch-processing-brizy.php +18 -11
  56. inc/importers/batch-processing/class-astra-sites-batch-processing-elementor.php +40 -28
  57. inc/importers/batch-processing/class-astra-sites-batch-processing-gutenberg.php +66 -4
  58. inc/importers/batch-processing/class-astra-sites-batch-processing-importer.php +372 -0
  59. inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php +1 -1
  60. inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php +1 -1
  61. inc/importers/batch-processing/class-astra-sites-batch-processing.php +637 -4
  62. inc/importers/batch-processing/helpers/class-astra-sites-image-importer.php +17 -11
  63. inc/importers/batch-processing/helpers/class-wp-background-process-astra-single.php +71 -0
  64. inc/importers/batch-processing/helpers/class-wp-background-process-astra-site-importer.php +97 -0
  65. inc/importers/batch-processing/helpers/class-wp-background-process.php +11 -4
  66. inc/importers/class-astra-customizer-import.php +11 -9
  67. inc/importers/class-astra-site-options-import.php +10 -10
  68. inc/importers/class-astra-sites-helper.php +9 -9
  69. inc/importers/{class-widgets-importer.php → class-astra-widget-importer.php} +74 -69
  70. inc/importers/wxr-importer/class-astra-wxr-importer.php +65 -25
  71. inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php +20 -8
  72. inc/importers/wxr-importer/{class-logger.php → class-wp-importer-logger.php} +31 -22
  73. inc/importers/wxr-importer/class-wxr-import-info.php +74 -5
  74. inc/importers/wxr-importer/class-wxr-importer.php +730 -485
  75. inc/includes/admin-page.php +666 -307
  76. inc/includes/image-templates.php +135 -0
  77. inc/includes/templates.php +538 -0
  78. inc/includes/white-label.php +2 -2
  79. inc/json/astra-blocks-1.json +1 -0
  80. inc/json/astra-blocks-2.json +1 -0
  81. inc/json/astra-blocks-3.json +1 -0
  82. inc/json/astra-blocks-categories.json +1 -0
  83. inc/json/astra-sites-and-pages-page-1.json +1 -0
astra-sites.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
- * Plugin Name: Astra Starter Sites
4
- * Plugin URI: http://www.wpastra.com/pro/
5
- * Description: Import free sites build with Astra theme.
6
- * Version: 1.4.5
7
  * Author: Brainstorm Force
8
- * Author URI: http://www.brainstormforce.com
9
  * Text Domain: astra-sites
10
  *
11
  * @package Astra Sites
@@ -15,11 +15,11 @@
15
  * Set constants.
16
  */
17
  if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
- define( 'ASTRA_SITES_NAME', __( 'Astra Sites', 'astra-sites' ) );
19
  }
20
 
21
  if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
- define( 'ASTRA_SITES_VER', '1.4.5' );
23
  }
24
 
25
  if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
1
  <?php
2
  /**
3
+ * Plugin Name: Starter Templates
4
+ * Plugin URI: https://wpastra.com/
5
+ * Description: Starter Templates is all in one solution for complete starter sites, single page templates, blocks & images. This plugin offers the premium library of ready templates & provides quick access to beautiful Pixabay images that can be imported in your website easily.
6
+ * Version: 2.0.0
7
  * Author: Brainstorm Force
8
+ * Author URI: https://www.brainstormforce.com
9
  * Text Domain: astra-sites
10
  *
11
  * @package Astra Sites
15
  * Set constants.
16
  */
17
  if ( ! defined( 'ASTRA_SITES_NAME' ) ) {
18
+ define( 'ASTRA_SITES_NAME', __( 'Starter Templates', 'astra-sites' ) );
19
  }
20
 
21
  if ( ! defined( 'ASTRA_SITES_VER' ) ) {
22
+ define( 'ASTRA_SITES_VER', '2.0.0' );
23
  }
24
 
25
  if ( ! defined( 'ASTRA_SITES_FILE' ) ) {
inc/assets/css/admin-rtl.css ADDED
@@ -0,0 +1,2814 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'icomoon';
3
+ src: url('../fonts/astra-sites.eot?9i8jex');
4
+ src: url('../fonts/astra-sites.eot?9i8jex#iefix') format('embedded-opentype'),
5
+ url('../fonts/astra-sites.ttf?9i8jex') format('truetype'),
6
+ url('../fonts/astra-sites.woff?9i8jex') format('woff'),
7
+ url('../fonts/astra-sites.svg?9i8jex#icomoon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="icon-"], [class*=" icon-"] {
13
+ /* use !important to prevent issues with browser extensions that change fonts */
14
+ font-family: 'icomoon' !important;
15
+ speak: none;
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ font-variant: normal;
19
+ text-transform: none;
20
+ line-height: 1;
21
+
22
+ /* Better Font Rendering =========== */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ .icon-search:before {
28
+ content: "\e900";
29
+ }
30
+ .icon-heart:before {
31
+ content: "\e901";
32
+ }
33
+ .icon-refresh:before {
34
+ content: "\e902";
35
+ }
36
+ .icon-chevron-left:before {
37
+ content: "\e904";
38
+ }
39
+ .icon-file:before {
40
+ content: "\e903";
41
+ }
42
+ .icon-layers:before {
43
+ content: "\e905";
44
+ }
45
+
46
+ .favorite-filters-wrap a {
47
+ font-size: 1rem;
48
+ }
49
+
50
+ .wrap .status,
51
+ .wrap .site-type {
52
+ position: absolute;
53
+ z-index: 1;
54
+ text-transform: uppercase;
55
+ color: #fff;
56
+ top: 15px;
57
+ left: 16px;
58
+ font-size: 10px;
59
+ letter-spacing: .7px;
60
+ font-weight: 500;
61
+ padding: 0.2em .7em;
62
+ border-radius: 4px;
63
+ }
64
+
65
+ .astra-sites-autocomplete-result {
66
+ position: absolute;
67
+ top: 46px !important;
68
+ right: 0;
69
+ left: 0;
70
+ bottom: 0;
71
+ }
72
+
73
+ .astra-sites-autocomplete-result .ui-autocomplete {
74
+ text-align: right;
75
+ right: 0 !important;
76
+ left: 0 !important;
77
+ width: calc( 100% - 2px ) !important;
78
+ z-index: 999999;
79
+ top: 0 !important;
80
+ }
81
+
82
+ .ast-white-label-flag {
83
+ opacity: 0;
84
+ visibility: hidden;
85
+ }
86
+
87
+ .single-site-footer .dashicons-editor-help {
88
+ cursor: pointer;
89
+ display: inline-block;
90
+ }
91
+
92
+ .preview-page-from-search-result .astra-sites-import-plugins .dashicons,
93
+ .astra-sites-page-import-popup .astra-sites-import-plugins .dashicons {
94
+ display: none;
95
+ }
96
+ .ast-sites-ps-msg {
97
+ bottom: 10px;
98
+ position: absolute;
99
+ color: #777;
100
+ margin-left: 1em;
101
+ }
102
+ #astra-sites__category-filter {
103
+ display: inline-block;
104
+ }
105
+ #astra-sites__category-filter .astra-sites__category-filter-anchor {
106
+ height: 44px;
107
+ position: relative;
108
+ cursor: pointer;
109
+ display: flex;
110
+ padding: 0 12px 0 12px;
111
+ border: 0;
112
+ width: 97px;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ font-weight: 500;
116
+ border-radius: 0 6px 6px 0;
117
+ }
118
+ #astra-sites__category-filter .astra-sites__category-filter-anchor:after {
119
+ position: absolute;
120
+ content: "";
121
+ border-right: 2px solid #555;
122
+ border-top: 2px solid #555;
123
+ padding: 3px;
124
+ left: 14px;
125
+ top: 38%;
126
+ -moz-transform: rotate(135deg);
127
+ -ms-transform: rotate(135deg);
128
+ -o-transform: rotate(135deg);
129
+ -webkit-transform: rotate(135deg);
130
+ transform: rotate(135deg);
131
+ }
132
+ #astra-sites__category-filter .ast-sites__filter-wrap-checkbox.first-wrap {
133
+ padding-top: 15px;
134
+ margin-top: 15px;
135
+ border-top: 1px solid #eee;
136
+ }
137
+ #astra-sites__category-filter ul.astra-sites__category-filter-items {
138
+ display: none;
139
+ margin: 0;
140
+ position: absolute;
141
+ width: 98px;
142
+ top: 40px;
143
+ box-sizing: content-box;
144
+ border: 1px solid #e4e4e4;
145
+ margin-top: 10px;
146
+ min-width: 70px;
147
+ background-color: #fff;
148
+ border-radius: 6px;
149
+ box-shadow: 0 3px 6px rgba(0,0,0,.1);
150
+ padding: 15px;
151
+ -webkit-transform-origin: 50% 0;
152
+ transform-origin: 50% 0;
153
+ -webkit-transition: all .2s ease;
154
+ transition: all .2s ease;
155
+ }
156
+ #astra-sites__category-filter li.ast-sites__filter-wrap.category-active:before {
157
+ content: "✓";
158
+ color: #1E8CBE;
159
+ position: absolute;
160
+ right: -15px;
161
+ font-size: 15px;
162
+ }
163
+
164
+ .astra-sites__category-filter-items label {
165
+ vertical-align: top;
166
+ }
167
+ #astra-sites__category-filter ul.astra-sites__category-filter-items li {
168
+ list-style: none;
169
+ margin-bottom: 8px;
170
+ margin-right: 14px;
171
+ cursor: pointer;
172
+ position: relative;
173
+ font-weight: 500;
174
+ }
175
+ #astra-sites__category-filter ul.astra-sites__category-filter-items li.ast-sites__filter-wrap-checkbox {
176
+ margin-right: 0;
177
+ }
178
+ #astra-sites .astra-theme:hover .inner {
179
+ transform: translate(0, -1px);
180
+ box-shadow: 0 6px 14px 0 rgba(0,0,0,.12)
181
+ }
182
+ #astra-sites .astra-theme .inner {
183
+ position: relative;
184
+ border-radius: 2px;
185
+ overflow: initial;
186
+ border: 1px solid #ddd;
187
+ transition: all 0.4s;
188
+ }
189
+ #single-pages .inner {
190
+ border: 1px solid #e2e2e2;
191
+ transition: all 250ms cubic-bezier(0.02, 0.01, 0.47, 1);
192
+ }
193
+ #single-pages .current_page .inner,
194
+ #single-pages .inner:hover {
195
+ box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
196
+ }
197
+ #astra-sites-admin.wrap .status,
198
+ #astra-sites-admin.wrap .site-type.premium {
199
+ background: #0073aa;
200
+ border: 2px solid #ffffff;
201
+ top: 17px;
202
+ left: 18px;
203
+ }
204
+ #astra-sites-admin .filter-links .current {
205
+ border-bottom: none;
206
+ color: #23282d;
207
+ }
208
+ #wp-filter-search-input {
209
+ font-weight: 400;
210
+ width: 100%;
211
+ opacity: 1;
212
+ height: 46px;
213
+ background: #fff;
214
+ line-height: 32px;
215
+ border-radius: 6px 0 0 6px;
216
+ font-size: 13px;
217
+ padding: 5px 20px;
218
+ border: 1px solid #DDDDDD;
219
+ border-right: 1px solid #DDDDDD;
220
+ box-shadow: none;
221
+ }
222
+ .appearance_page_starter-templates .search-form:hover,
223
+ .appearance_page_starter-templates .search-form:focus {
224
+ box-shadow: 0 1px 4px 0 rgba(32,33,36,0.18);
225
+ }
226
+ #astra-sites-filters .ui-widget.ui-widget-content {
227
+ border-top-right-radius: 0;
228
+ border-top-left-radius: 0;
229
+ border-bottom-right-radius: 6px;
230
+ border-bottom-left-radius: 6px;
231
+ border: 1px solid rgba(32,33,36,0.18);
232
+ border-top: none;
233
+ overflow: hidden;
234
+ box-shadow: 0 3px 4px 0 rgba(32,33,36,0.18);
235
+ background: transparent;
236
+ padding-top: 10px;
237
+ padding-bottom: 10px;
238
+ background: #fff;
239
+ }
240
+
241
+ #astra-sites-filters .ui-autocomplete li,
242
+ #astra-sites-filters .ui-autocomplete li:focus,
243
+ #astra-sites-filters .ui-autocomplete li:hover {
244
+ outline: none;
245
+ }
246
+ #astra-sites-filters .ui-autocomplete li {
247
+ padding: 3px 20px;
248
+ text-transform: capitalize;
249
+ }
250
+ #astra-sites-filters .ui-autocomplete li:hover {
251
+ background-color: #eeeeee;
252
+ }
253
+ .appearance_page_starter-templates .wp-filter .search-form.searching #astra-sites__category-filter {
254
+ border-bottom-right-radius: 0;
255
+ }
256
+ .searching #wp-filter-search-input {
257
+ border-bottom-left-radius: 0;
258
+ }
259
+ #astra-sites-filters .ui-autocomplete .ui-state-active {
260
+ background: #c0c0c0;
261
+ border-color: #c0c0c0;
262
+ margin: 0;
263
+ }
264
+ #wp-filter-search-input.has-input + .search-icon {
265
+ display: none;
266
+ }
267
+ .appearance_page_starter-templates .search-icon {
268
+ position: absolute;
269
+ top: 0;
270
+ left: 0;
271
+ color: #C3C3C3;
272
+ padding: 15px 12px 12px 19px;
273
+ }
274
+ .appearance_page_starter-templates .search-icon:before {
275
+ vertical-align: middle;
276
+ }
277
+ #astra-sites-admin .filter-links li > a {
278
+ border-bottom: none;
279
+ font-size: 12px;
280
+ padding: 2px 0;
281
+ text-transform: uppercase;
282
+ letter-spacing: 0.3px;
283
+ font-weight: 500;
284
+ }
285
+ #astra-sites-admin .filter-links li > a:focus {
286
+ box-shadow: none;
287
+ }
288
+ #astra-sites-admin .theme-actions {
289
+ box-shadow: none;
290
+ right: 0;
291
+ border-right: none;
292
+ background: #fafafa;
293
+ padding: 0;
294
+ margin-left: 20%;
295
+ }
296
+ .searching .pages-count,
297
+ .searching .page-title {
298
+ display: block;
299
+ }
300
+ .searching .no-pages .theme-name {
301
+ min-height: 36px;
302
+ }
303
+ #astra-sites-admin .theme-browser .theme .theme-name {
304
+ height: auto;
305
+ width: 90%;
306
+ align-self: center;
307
+ box-shadow: none;
308
+ background: none;
309
+ padding: 14px 15px;
310
+ font-size: 14px;
311
+ font-weight: 600;
312
+ display: flex;
313
+ align-items: center;
314
+ justify-content: space-between;
315
+ }
316
+ #astra-sites-admin .theme-id-container {
317
+ background: #fff;
318
+ border: none;
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: center;
322
+ border-bottom-right-radius: 2px;
323
+ border-bottom-left-radius: 2px;
324
+ border-top: 1px solid #eeeeee;
325
+ }
326
+ #astra-sites-admin .sites-page-count {
327
+ color: #888;
328
+ font-size: 12px;
329
+ display: block;
330
+ margin-top: 5px;
331
+ }
332
+ #astra-sites-admin .theme-action-wrap {
333
+ width: 100%;
334
+ padding: 8px 15px;
335
+ }
336
+ .filters-wrap-page-categories {
337
+ margin-left: 10px;
338
+ }
339
+ #astra-sites-admin .favorite-filters-wrap .filter-links a {
340
+ border: none;
341
+ }
342
+ .favorite-filters-wrap .current .dashicons {
343
+ color: #c34444;
344
+ }
345
+ .favorite-filters-wrap .dashicons {
346
+ color: #71777c;
347
+ font-size: 18px;
348
+ line-height: 18px;
349
+ width: 17px;
350
+ height: 17px;
351
+ }
352
+ .theme-browser .theme:hover,
353
+ .theme-browser .theme:focus {
354
+ cursor: initial;
355
+ }
356
+ .theme-browser .theme .inner:hover,
357
+ .theme-browser .theme .inner:focus {
358
+ cursor: pointer;
359
+ }
360
+
361
+ .searching .theme-browser .theme .inner:hover .type {
362
+ opacity: 1;
363
+ visibility: visible;
364
+ }
365
+
366
+ .astra-sites-sync-library-button.updating-message {
367
+ animation: rotation 2s infinite linear;
368
+ }
369
+
370
+ .astra-sites-sync-library,
371
+ .favorite-filters-title {
372
+ width: 10%;
373
+ padding: 15px 5px;
374
+ align-self: center;
375
+ justify-content: center;
376
+ text-align: center;
377
+ margin-right: 5px;
378
+ }
379
+ .astra-sites-sync-library a,
380
+ .favorite-filters-title a {
381
+ color: #666;
382
+ cursor: pointer;
383
+ }
384
+
385
+ .favorite-action-wrap {
386
+ padding-left: 15px;
387
+ padding-right: 10px;
388
+ }
389
+
390
+ .favorite-action-wrap i {
391
+ color: #666666;
392
+ height: 18px;
393
+ width: 18px;
394
+ font-size: 16px;
395
+ line-height: 1.5;
396
+ transition-property: border, background, color;
397
+ transition-duration: .05s;
398
+ transition-timing-function: ease-in-out;
399
+ }
400
+ .theme-id-container .icon-star {
401
+ padding: 0 0 0 15px;
402
+ }
403
+ .wrap .status {
404
+ right: -0.5em;
405
+ }
406
+ .wrap .status.publish,
407
+ .wrap .site-type.free {
408
+ display: none;
409
+ }
410
+
411
+ .astra-sites-activate-license .astra-sites-import-content,
412
+ .astra-sites-get-agency-bundle .astra-sites-import-content {
413
+ height: auto;
414
+ }
415
+ .astra-sites-import-content {
416
+ display: block;
417
+ padding: 10px 35px 20px 35px;
418
+ background: #f1f3f5;
419
+ height: 200px;
420
+ overflow: auto;
421
+ position: relative;
422
+ }
423
+
424
+ .astra-sites-activate-license .astra-sites-import-content {
425
+ padding: 20px 35px 30px 35px;
426
+ }
427
+
428
+ .astra-sites-import-content .install-theme-info {
429
+ display: block;
430
+ padding: 0;
431
+ }
432
+
433
+ .install-theme-info .site-type {
434
+ display: none;
435
+ }
436
+
437
+ .theme {
438
+ position: relative;
439
+ }
440
+ .wrap .astra-sites-preview .site-type.premium {
441
+ display: block;
442
+ display: none;
443
+ position: relative;
444
+ margin: 0.5em 0em 1em 0em;
445
+ top: 0;
446
+ right: 0;
447
+ text-align: center;
448
+ }
449
+
450
+ .theme-details-read-more.open {
451
+ margin: 0.5em 0 0 0;
452
+ }
453
+
454
+ .astra-sites-preview .theme-screenshot {
455
+ width: 100%;
456
+ }
457
+
458
+ .install-theme-info .site-type.premium {
459
+ display: none;
460
+ }
461
+
462
+ /**
463
+ * Required Plugins
464
+ */
465
+ .required-plugins.loading {
466
+ text-align: center;
467
+ }
468
+ .required-plugins button {
469
+ float: left;
470
+ }
471
+ .required-plugins .plugin-card {
472
+ float: none;
473
+ width: 100%;
474
+ border: none;
475
+ margin: 0 0 0.8em 0;
476
+ display: flex;
477
+ justify-content: space-between;
478
+ align-items: center;
479
+ transition: background ease 0.8s;
480
+ }
481
+ .required-plugins .plugin-card.plugin-card-update-failed {
482
+ flex-wrap: wrap;
483
+ }
484
+ .required-plugins .spinner {
485
+ float: none;
486
+ margin: 0;
487
+ }
488
+
489
+ .expanded .wp-full-overlay-footer {
490
+ height: 111px;
491
+ }
492
+
493
+ .wp-full-overlay-footer .view-site,
494
+ .wp-full-overlay-footer .go-pro,
495
+ .wp-full-overlay-footer .astra-demo-import {
496
+ width: 100%;
497
+ text-align: center;
498
+ }
499
+
500
+ .wp-core-ui .wp-full-overlay-footer .button.button-hero,
501
+ .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
502
+ padding: 0 10px 1px;
503
+ }
504
+
505
+ .wp-full-overlay-footer .installing:before {
506
+ vertical-align: text-bottom;
507
+ }
508
+
509
+ .astra-sites-advanced-options-wrap h4 {
510
+ margin: 1em 0 0.5em 0;
511
+ padding: 0.5em 0;
512
+ transition: all ease 0.3s;
513
+ }
514
+
515
+ /**
516
+ * Read more link
517
+ */
518
+ .wp-core-ui .theme-details-read-more:focus,
519
+ .wp-core-ui .theme-details-read-more:hover {
520
+ outline: none;
521
+ box-shadow: none;
522
+ }
523
+ .wp-core-ui .theme-details-read-more {
524
+ margin: 10px 0;
525
+ display: none;
526
+ text-decoration: none;
527
+ }
528
+
529
+ /**
530
+ * Go pro.
531
+ */
532
+ .wp-core-ui .go-pro.button[disabled] {
533
+ background-color: #fcb92c !important;
534
+ color: white !important;
535
+ box-shadow: -1px 0 #eab23a !important;
536
+ text-shadow: -1px 0 #6b4e13 !important;
537
+ border-color: #e2a932 !important;
538
+ cursor: pointer;
539
+ }
540
+ .wp-core-ui .view-site .dashicons,
541
+ .wp-core-ui .go-pro .dashicons {
542
+ font-size: 1rem;
543
+ vertical-align: middle;
544
+ }
545
+
546
+ /**
547
+ * Errors
548
+ */
549
+ .plugin-card-update-failed .notice {
550
+ margin-top: 1.5em;
551
+ }
552
+
553
+ .no-themes {
554
+ margin-top: 40px;
555
+ }
556
+
557
+ .no-themes p {
558
+ font-size: 15px;
559
+ }
560
+
561
+ .no-themes .left-margin {
562
+ margin-right: 30px;
563
+ }
564
+
565
+ /**
566
+ *
567
+ */
568
+ .astra-sites-preview .wp-full-overlay-sidebar-content {
569
+ bottom: 100px;
570
+ }
571
+
572
+ .footer-import-button-wrap {
573
+ padding: 10px 20px;
574
+ }
575
+
576
+ .footer-import-button-wrap .button {
577
+ margin: 0;
578
+ }
579
+
580
+ .astra-sites-preview.expanded .wp-full-overlay-footer {
581
+ right: initial;
582
+ }
583
+
584
+ /**
585
+ * Menu Page
586
+ */
587
+ .astra-sites-title {
588
+ float: right;
589
+ font-size: 20px;
590
+ font-weight: 400;
591
+ margin: 0;
592
+ padding: 0;
593
+ color: #444;
594
+ }
595
+
596
+ #astra-sites-admin #single-pages .site-single .theme-name {
597
+ font-weight: 500;
598
+ font-size: 13px;
599
+ padding: 8px 14px;
600
+ background: #fff;
601
+ }
602
+
603
+ .astra-sites-logo-wrap {
604
+ width: 42px;
605
+ height: 42px;
606
+ }
607
+
608
+ .astra-sites-logo-wrap a,
609
+ .astra-sites-logo-wrap img {
610
+ width: inherit;
611
+ height: inherit;
612
+ display: inline-block;
613
+ }
614
+
615
+ /**
616
+ * API Error
617
+ */
618
+ .astra-api-error {
619
+ margin: 0 0 0.5em 0;
620
+ }
621
+
622
+ /**
623
+ * Grid
624
+ */
625
+ .appearance_page_starter-templates .wp-filter .search-form {
626
+ margin-right: 1em;
627
+ position: relative;
628
+ display: flex;
629
+ border-bottom: 1px solid #ccc;
630
+ }
631
+ .appearance_page_starter-templates .wp-filter .search-form #astra-sites__category-filter {
632
+ border: 1px solid #DDDDDD;
633
+ border-left: 0;
634
+ border-radius: 0 6px 6px 0;
635
+ }
636
+ .appearance_page_starter-templates .wp-filter .search-form input[type="search"] {
637
+ width: 20px;
638
+ font-size: 13px;
639
+ padding: 5px 10px;
640
+ opacity: 0;
641
+ -webkit-transition: width ease 0.3s;
642
+ -moz-transition: width ease 0.3s;
643
+ transition: width ease 0.3s;
644
+ }
645
+ .filter-count {
646
+ min-width: 3em;
647
+ margin-left: 14px;
648
+ }
649
+ .astra-site-preview-on {
650
+ overflow: hidden;
651
+ }
652
+
653
+ .filters-wrap {
654
+ display: inline-block;
655
+ }
656
+ .spinner-wrap {
657
+ text-align: center;
658
+ }
659
+ .spinner-wrap .spinner {
660
+ float: none;
661
+ }
662
+ .hide-me {
663
+ display: none !important;
664
+ }
665
+ #site-pages {
666
+ position: fixed;
667
+ right: 0;
668
+ left: 0;
669
+ margin: 0 195px 0 20px;
670
+ z-index: 10;
671
+ }
672
+
673
+ .folded #site-pages {
674
+ margin-right: 73px;
675
+ }
676
+
677
+ .install-theme-info > .notice {
678
+ margin: 5px 0 10px 0;
679
+ }
680
+
681
+ .astra-sites-suggestions:before {
682
+ border: 5px dashed #ccc;
683
+ position: absolute;
684
+ right: 0;
685
+ left: 0;
686
+ top: 0;
687
+ bottom: 0px;
688
+ }
689
+
690
+ .astra-sites-suggestions {
691
+ min-height: 390px;
692
+ border: none !important;
693
+ }
694
+
695
+ .astra-sites-suggestions a {
696
+ border: none;
697
+ outline: none;
698
+ }
699
+
700
+ .astra-sites-suggestions .inner {
701
+ border: 6px solid #ffffff !important;
702
+ background: #f1f1f1;
703
+ color: #63676b;
704
+ padding: 58% 10% 80% 10%;
705
+ text-align: center;
706
+ position: absolute;
707
+ right: 0;
708
+ left: 0;
709
+ top: 0;
710
+ bottom: 0;
711
+ cursor: auto;
712
+ }
713
+
714
+ .astra-sites-suggestions .inner a {
715
+ color: #00b9eb;
716
+ }
717
+
718
+ .astra-sites-suggestions p {
719
+ font-size: 1rem;
720
+ margin: 0;
721
+ }
722
+
723
+ .astra-notice {
724
+ margin: 2em 0em 0em 2em;
725
+ }
726
+
727
+ .no-themes .description {
728
+ display: block;
729
+ }
730
+
731
+ /**
732
+ * Responsive Button UI
733
+ */
734
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
735
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
736
+ color: #0073aa;
737
+ }
738
+ .astra-sites-preview .wp-full-overlay-footer .devices button:before {
739
+ color: #c1c1c1;
740
+ }
741
+ .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
742
+ background-color: transparent;
743
+ }
744
+ .astra-sites-preview .wp-full-overlay-footer .devices button {
745
+ border: none;
746
+ }
747
+ .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
748
+ .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
749
+ border-bottom-color: transparent;
750
+ background-color: transparent;
751
+ }
752
+ .not-click-able {
753
+ pointer-events: none !important;
754
+ }
755
+ body.page-builder-selected .select-page-builder,
756
+ body.loading-content .select-page-builder {
757
+ display: none;
758
+ }
759
+ .select-page-builder .up-arrow {
760
+ -webkit-transform: rotate(-90deg);
761
+ -moz-transform: rotate(-90deg);
762
+ -ms-transform: rotate(-90deg);
763
+ transform: rotate(-90deg);
764
+ display: inline-block;
765
+ font-size: 1.5em;
766
+ color: #797979;
767
+ vertical-align: middle;
768
+ margin-left: 10px;
769
+ -webkit-transition: all linear 0.6s;
770
+ -moz-transition: all linear 0.6s;
771
+ -ms-transition: all linear 0.6s;
772
+ transition: all linear 0.6s;
773
+ -webkit-animation-duration: 1s;
774
+ animation-duration: 1s;
775
+ -webkit-animation-fill-mode: both;
776
+ animation-fill-mode: both;
777
+ -webkit-animation-timing-function: ease-in-out;
778
+ animation-timing-function: ease-in-out;
779
+ animation-iteration-count: infinite;
780
+ -webkit-animation-iteration-count: infinite;
781
+ animation-name: bounce;
782
+ -moz-animation-name: bounce;
783
+ }
784
+ .select-page-builder {
785
+ margin-right: 6em;
786
+ }
787
+
788
+ .select-page-builder img {
789
+ max-width: 100%;
790
+ }
791
+
792
+ .select-page-builder .note-wrap {
793
+ position: absolute;
794
+ padding: 40px 0;
795
+ margin-right: 170px;
796
+ left: 0;
797
+ right: 0;
798
+ }
799
+
800
+ .select-page-builder h3 {
801
+ margin: 0;
802
+ font-size: 2em;
803
+ }
804
+ .select-page-builder {
805
+ margin: -20px -5px 0 0;
806
+ position: absolute;
807
+ }
808
+ .select-page-builder .note {
809
+ margin-right: 1.5em;
810
+ }
811
+
812
+ @keyframes bounce {
813
+ 0%,
814
+ 100%,
815
+ 20%,
816
+ 50%,
817
+ 80% {
818
+ -webkit-transform: translateY(-0px) rotate(-90deg);
819
+ -moz-transform: translateY(-0px) rotate(-90deg);
820
+ -ms-transform: translateY(-0px) rotate(-90deg);
821
+ transform: translateY(-0px) rotate(-90deg);
822
+ }
823
+ 40% {
824
+ -webkit-transform: translateY(-2px) rotate(-90deg);
825
+ -moz-transform: translateY(-2px) rotate(-90deg);
826
+ -ms-transform: translateY(-2px) rotate(-90deg);
827
+ transform: translateY(-2px) rotate(-90deg);
828
+ }
829
+ 60% {
830
+ -webkit-transform: translateY(-1px) rotate(-90deg);
831
+ -moz-transform: translateY(-1px) rotate(-90deg);
832
+ -ms-transform: translateY(-1px) rotate(-90deg);
833
+ transform: translateY(-1px) rotate(-90deg);
834
+ }
835
+ }
836
+
837
+ /**
838
+ * Processing Animation
839
+ */
840
+ .astra-demo-import.disabled {
841
+ pointer-events: none;
842
+ }
843
+ .astra-demo-import.button.updating-message:before,
844
+ .astra-demo-import.button.installing:before {
845
+ -webkit-animation: cssAnimation .72s ease infinite;
846
+ -moz-animation: cssAnimation .72s ease infinite;
847
+ -o-animation: cssAnimation .72s ease infinite;
848
+ -ms-animation: cssAnimation .72s ease infinite;
849
+ animation: cssAnimation .72s ease infinite;
850
+ }
851
+
852
+ @-webkit-keyframes cssAnimation {
853
+ from {
854
+ -webkit-transform: rotate(0);
855
+ -moz-transform: rotate(0);
856
+ -o-transform: rotate(0);
857
+ -ms-transform: rotate(0);
858
+ transform: rotate(0);
859
+ }
860
+ to {
861
+ -webkit-transform: rotate(-360deg);
862
+ -moz-transform: rotate(-360deg);
863
+ -o-transform: rotate(-360deg);
864
+ -ms-transform: rotate(-360deg);
865
+ transform: rotate(-360deg);
866
+ }
867
+ }
868
+ @-moz-keyframes cssAnimation {
869
+ from {
870
+ -webkit-transform: rotate(0);
871
+ -moz-transform: rotate(0);
872
+ -o-transform: rotate(0);
873
+ -ms-transform: rotate(0);
874
+ transform: rotate(0);
875
+ }
876
+ to {
877
+ -webkit-transform: rotate(-360deg);
878
+ -moz-transform: rotate(-360deg);
879
+ -o-transform: rotate(-360deg);
880
+ -ms-transform: rotate(-360deg);
881
+ transform: rotate(-360deg);
882
+ }
883
+ }
884
+ @-o-keyframes cssAnimation {
885
+ from {
886
+ -webkit-transform: rotate(0);
887
+ -moz-transform: rotate(0);
888
+ -o-transform: rotate(0);
889
+ -ms-transform: rotate(0);
890
+ transform: rotate(0);
891
+ }
892
+ to {
893
+ -webkit-transform: rotate(-360deg);
894
+ -moz-transform: rotate(-360deg);
895
+ -o-transform: rotate(-360deg);
896
+ -ms-transform: rotate(-360deg);
897
+ transform: rotate(-360deg);
898
+ }
899
+ }
900
+
901
+ #astra-sites-filters .wp-filter {
902
+ display: flex;
903
+ justify-content: space-between;
904
+ align-items: center;
905
+ }
906
+
907
+ .astra-pages-title {
908
+ color: #9e9e9e;
909
+ text-decoration: none;
910
+ font-weight: 500;
911
+ position: relative;
912
+ }
913
+ .single-site-pages-header .count {
914
+ opacity: 0.7;
915
+ }
916
+
917
+ .single-site-pages-header .astra-site-title {
918
+ font-size: 22px;
919
+ }
920
+ .astra-site-down {
921
+ padding: 1em 2em;
922
+ margin-top: 1em;
923
+ }
924
+
925
+ #astra-sites-menu-page .menu {
926
+ padding: 0;
927
+ }
928
+
929
+ .astra-sites-nav-items a:hover,
930
+ .astra-sites-nav-items a:focus {
931
+ outline: none;
932
+ border: none;
933
+ box-shadow: none;
934
+ }
935
+
936
+ .astra-sites-nav-items a {
937
+ background: #f1f1f1;
938
+ color: #4e555d;
939
+ font-size: 14px;
940
+ text-decoration: none;
941
+ padding: 21px 43px 24px 20px;
942
+ font-weight: 500;
943
+ }
944
+
945
+ .astra-sites-nav-items a:before {
946
+ content: "\f105";
947
+ }
948
+
949
+ #astra-sites-filters .search-form {
950
+ font-weight: normal;
951
+ border: none;
952
+ margin: 0;
953
+ border-radius: 6px;
954
+ display: flex;
955
+ align-items: center;
956
+ height: 46px;
957
+ }
958
+
959
+ .astra-sites-nav-items a:before {
960
+ font-family: dashicons;
961
+ display: inline-block;
962
+ line-height: 1;
963
+ font-weight: 400;
964
+ font-style: normal;
965
+ speak: none;
966
+ text-decoration: inherit;
967
+ text-transform: none;
968
+ text-rendering: auto;
969
+ -webkit-font-smoothing: antialiased;
970
+ -moz-osx-font-smoothing: grayscale;
971
+ font-size: 17px;
972
+ vertical-align: top;
973
+ text-align: center;
974
+ transition: color 0.1s ease-in;
975
+ position: absolute;
976
+ margin-right: -22px;
977
+ font-weight: normal;
978
+ }
979
+ .nav-tab-wrapper .button {
980
+ height: 30px;
981
+ }
982
+ .back-to-layout:before {
983
+ background: #fff;
984
+ color: #777;
985
+ padding: 3px;
986
+ border-radius: 100%;
987
+ font-size: 13px;
988
+ border: 1px solid #777;
989
+ }
990
+
991
+ .back-to-layout:hover:before {
992
+ background: #f7f7f7;
993
+ border-color: #0073aa;
994
+ color: #0073aa;
995
+ }
996
+
997
+ .back-to-layout {
998
+ border-left: 1px solid #eeeeee;
999
+ padding: 20px 14px;
1000
+ text-align: center;
1001
+ cursor: pointer;
1002
+ visibility: hidden;
1003
+ opacity: 0;
1004
+ font-size: 24px;
1005
+ line-height: normal;
1006
+ }
1007
+
1008
+ .back-to-layout:hover {
1009
+ background-color: #f7f7f7;
1010
+ }
1011
+
1012
+ .astra-sites-no-search-result .back-to-layout,
1013
+ .astra-sites-showing-favorites .back-to-layout,
1014
+ .astra-previewing-single-pages .back-to-layout {
1015
+ visibility: visible;
1016
+ opacity: 1;
1017
+ }
1018
+ .logo {
1019
+ cursor: pointer;
1020
+ }
1021
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
1022
+ border-left: 1px solid #dddddd;
1023
+ padding: 13px 20px 14px 20px;
1024
+ }
1025
+ #astra-sites-menu-page .nav-tab-wrapper .logo,
1026
+ #astra-sites-menu-page .form {
1027
+ display: flex;
1028
+ align-items: center;
1029
+ }
1030
+
1031
+ #astra-sites-menu-page .nav-tab-wrapper {
1032
+ display: flex;
1033
+ justify-content: space-between;
1034
+ border: none;
1035
+ background: #fff;
1036
+ padding: 0;
1037
+ align-items: center;
1038
+ box-shadow: -25px 0 30px rgba(28, 39, 60, 0.09);
1039
+ border-bottom: 1px solid #dddddd;
1040
+ position: fixed;
1041
+ top: 32px;
1042
+ left: 0;
1043
+ right: 0;
1044
+ margin-right: 160px;
1045
+ z-index: 88;
1046
+ }
1047
+ .theme-name .title,
1048
+ .theme-name .type {
1049
+ transition: all 0.4s linear;
1050
+ }
1051
+ .searching .theme-name .type {
1052
+ padding: 4px 8px;
1053
+ }
1054
+ .theme-name .type {
1055
+ font-size: 12px;
1056
+ opacity: 0;
1057
+ visibility: hidden;
1058
+ color: #555;
1059
+ border: 1px solid #cccccc;
1060
+ background: #f7f7f7;
1061
+ vertical-align: top;
1062
+ border-radius: 2px;
1063
+ font-weight: normal;
1064
+ }
1065
+ .theme-name .type .dashicons {
1066
+ font-size: 16px;
1067
+ }
1068
+ .favorite-filters-wrap {
1069
+ border-left: 1px solid #dddddd;
1070
+ padding: 10px;
1071
+ }
1072
+
1073
+ .header-actions a {
1074
+ text-decoration: none;
1075
+ font-size: 18px;
1076
+ line-height: 1;
1077
+ height: 15px;
1078
+ width: 18px;
1079
+ }
1080
+ .header-actions .filter-links li > a:hover,
1081
+ .header-actions .filter-links li > a:focus {
1082
+ outline: none;
1083
+ }
1084
+ .filter-links li > .astra-sites-show-favorite-button.current:hover,
1085
+ .filter-links li > .astra-sites-show-favorite-button.current,
1086
+ .filter-links li > .astra-sites-show-favorite-button:hover,
1087
+ .filter-links li > .astra-sites-show-favorite-button:focus,
1088
+ .astra-sites-show-favorite-button.active {
1089
+ color: transparent;
1090
+ }
1091
+ .filter-links li > .astra-sites-show-favorite-button.current:hover .icon-heart,
1092
+ .filter-links li > .astra-sites-show-favorite-button.current .icon-heart,
1093
+ .filter-links li > .astra-sites-show-favorite-button:hover .icon-heart,
1094
+ .astra-sites-show-favorite-button.active .icon-heart {
1095
+ color: #c34444;
1096
+ }
1097
+
1098
+ .icon-heart {
1099
+ color: #666;
1100
+ }
1101
+ .header-actions a:focus {
1102
+ box-shadow: none;
1103
+ }
1104
+ #astra-sites-filters {
1105
+ flex: 1;
1106
+ }
1107
+
1108
+ #astra-sites-filters .wp-filter {
1109
+ margin-top: 0;
1110
+ justify-content: center;
1111
+ box-shadow: none;
1112
+ border: none;
1113
+ margin-bottom: 0;
1114
+ background: transparent;
1115
+ padding: 0;
1116
+ }
1117
+
1118
+ .is-favorite .favorite-action-wrap i {
1119
+ color : #c34444;
1120
+ }
1121
+
1122
+ .astra-sites-no-sites,
1123
+ .astra-sites-no-favorites {
1124
+ padding: 7em 0;
1125
+ }
1126
+
1127
+ .astra-sites-no-sites h3,
1128
+ .astra-sites-no-favorites h3 {
1129
+ font-size: 1.3rem;
1130
+ font-weight: normal;
1131
+ margin-top: 0;
1132
+ text-align: center;
1133
+ margin-bottom: 3em;
1134
+ color: #666;
1135
+ }
1136
+
1137
+ .astra-sites-no-sites .back-to-layout-button {
1138
+ margin-top: 25px;
1139
+ }
1140
+
1141
+ .back-to-layout-button {
1142
+ margin-top: 15px;
1143
+ }
1144
+
1145
+ .empty-collection-part {
1146
+ width: 220px;
1147
+ }
1148
+
1149
+ .astra-sites-no-sites .arrow-img,
1150
+ .astra-sites-no-favorites .arrow-img {
1151
+ width: 56px;
1152
+ margin-bottom: 1em;
1153
+ transform: rotate(18deg);
1154
+ }
1155
+
1156
+ .astra-sites-no-sites .content,
1157
+ .astra-sites-no-favorites .content {
1158
+ display: flex;
1159
+ align-items: center;
1160
+ }
1161
+
1162
+ .astra-sites-no-sites .description,
1163
+ .astra-sites-no-favorites .description {
1164
+ margin-right: 3em;
1165
+ }
1166
+
1167
+ .astra-sites-no-sites .inner,
1168
+ .astra-sites-no-favorites .inner {
1169
+ margin: 0 auto;
1170
+ width: 610px;
1171
+ }
1172
+
1173
+ /**
1174
+ * Welcome Screen
1175
+ */
1176
+ .astra-sites-welcome {
1177
+ position: relative;
1178
+ max-height: 100vh;
1179
+ height: calc( 100vh - 32px );
1180
+ }
1181
+ .appearance_page_starter-templates.astra-sites-change-page-builder #wpbody-content {
1182
+ padding: 0;
1183
+ }
1184
+ .astra-sites-welcome a {
1185
+ text-decoration: none;
1186
+ color: inherit;
1187
+ }
1188
+ .astra-sites-welcome a:focus,
1189
+ .astra-sites-welcome a {
1190
+ outline: none;
1191
+ box-shadow: none;
1192
+ }
1193
+ .astra-sites-welcome .header img {
1194
+ width: 30px;
1195
+ }
1196
+ .astra-sites-welcome .logo {
1197
+ display: flex;
1198
+ align-items: center;
1199
+ cursor: default;
1200
+ }
1201
+ .astra-sites-welcome .close {
1202
+ position: absolute;
1203
+ left: 0;
1204
+ top: 0;
1205
+ bottom: 0;
1206
+ width: 20px;
1207
+ text-align: center;
1208
+ padding: 15px;
1209
+ cursor: pointer;
1210
+ border-right: 1px solid #eee;
1211
+ color: #aaa;
1212
+ }
1213
+
1214
+ .astra-sites-welcome .close:hover {
1215
+ color: #0073aa;
1216
+ }
1217
+
1218
+ .astra-sites-welcome .close .dashicons {
1219
+ height: auto;
1220
+ width: auto;
1221
+ vertical-align: middle;
1222
+ font-size: 22px;
1223
+ }
1224
+
1225
+ .astra-sites-welcome .header {
1226
+ text-align: right;
1227
+ padding: 10px 15px;
1228
+ display: flex;
1229
+ align-items: center;
1230
+ border-bottom: 1px solid #e5e5e5;
1231
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
1232
+ justify-content: space-between;
1233
+ position: relative;
1234
+ }
1235
+ .astra-sites-welcome .header .title {
1236
+ margin: 0 10px 0 0;
1237
+ font-size: 13px;
1238
+ text-transform: uppercase;
1239
+ }
1240
+ .ast-importing-wrap {
1241
+ display: none;
1242
+ }
1243
+ .astra-sites-welcome .inner-wrap {
1244
+ position: absolute;
1245
+ right: 50%;
1246
+ top: 40%;
1247
+ transform: translate(50%, -40%);
1248
+ border-radius: 2px;
1249
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1250
+ border: 1px solid #e5e5e5;
1251
+ overflow: hidden;
1252
+ }
1253
+ .astra-sites-welcome .inner {
1254
+ vertical-align: middle;
1255
+ margin: 0 auto;
1256
+ display: inline-block;
1257
+ width: 750px;
1258
+ background: #fff;
1259
+ text-align: center;
1260
+ }
1261
+
1262
+ .astra-sites-welcome h1 {
1263
+ margin-top: 0;
1264
+ font-size: 2em;
1265
+ margin-bottom: 1em;
1266
+ }
1267
+
1268
+ .astra-sites-welcome p {
1269
+ font-size: 14px;
1270
+ }
1271
+
1272
+ #astra-sites-welcome-form {
1273
+ padding: 6em 4em 2em 4em;
1274
+ }
1275
+
1276
+ .astra-sites-welcome select {
1277
+ padding: 5px;
1278
+ height: 100%;
1279
+ }
1280
+
1281
+ .astra-sites-welcome .submit {
1282
+ text-align: center;
1283
+ margin: 0;
1284
+ padding: 0;
1285
+ margin-right: .5em;
1286
+ }
1287
+
1288
+ .astra-sites-welcome .disabled {
1289
+ pointer-events: none;
1290
+ }
1291
+
1292
+ .astra-site-page-builder {
1293
+ opacity: 0;
1294
+ visibility: hidden;
1295
+ }
1296
+
1297
+ .required-plugins-list,
1298
+ .astra-sites-third-party-required-plugins {
1299
+ margin-right: 16px;
1300
+ margin-top: .5em;
1301
+ margin-bottom: .5em;
1302
+ list-style-type: disc;
1303
+ }
1304
+
1305
+ .astra-sites-tooltip-message {
1306
+ margin-right: 24px;
1307
+ }
1308
+
1309
+ .astra-sites-third-party-required-plugins .plugin-card,
1310
+ .required-plugins-list .plugin-card {
1311
+ background: transparent;
1312
+ border: none;
1313
+ margin: 0;
1314
+ line-height: 2;
1315
+ float: none;
1316
+ width: 100%;
1317
+ }
1318
+
1319
+ .required-plugins-list .spinner {
1320
+ float: none;
1321
+ margin: 0;
1322
+ }
1323
+
1324
+ .astra-site-import-process-wrap {
1325
+ display: flex;
1326
+ align-items: center;
1327
+ margin-top: -2px;
1328
+ z-index: 999999;
1329
+ position: relative;
1330
+ overflow: hidden;
1331
+ }
1332
+
1333
+ .astra-sites-result-preview .astra-site-import-process-wrap progress {
1334
+ background: #eeeeee;
1335
+ }
1336
+
1337
+ .astra-sites-result-preview .astra-site-import-process-wrap progress::-webkit-progress-value {
1338
+ background: #0185ba;
1339
+ }
1340
+
1341
+ .astra-site-import-process-wrap progress {
1342
+ padding: 0px;
1343
+ border: 0 none;
1344
+ background: #0085bd;
1345
+ border-radius: 5px;
1346
+ height: 4px;
1347
+ flex: 1;
1348
+ }
1349
+
1350
+ .astra-sites-result-preview .dashicons {
1351
+ vertical-align: middle;
1352
+ font-size: 1rem;
1353
+ }
1354
+
1355
+ .astra-site-import-process-wrap progress::-webkit-progress-value {
1356
+ background: #00679b;
1357
+ }
1358
+
1359
+ .astra-site-import-process-wrap progress::-webkit-progress-bar {
1360
+ background: transparent;
1361
+ }
1362
+
1363
+ .theme-browser .theme .theme-screenshot {
1364
+ filter: blur(0);
1365
+ transition: filter 400ms linear;
1366
+ }
1367
+ .theme-browser .theme .site-preview > .theme-screenshot {
1368
+ background-position: center top;
1369
+ background-size: 100%;
1370
+ background-repeat: no-repeat;
1371
+ border-top-right-radius: 2px;
1372
+ border-top-left-radius: 2px;
1373
+ overflow: hidden;
1374
+ background-color: #e5e5e5;
1375
+ }
1376
+
1377
+ .astra-sites-tooltip-icon {
1378
+ cursor: pointer;
1379
+ }
1380
+
1381
+ .astra-sites-preview .disabled {
1382
+ pointer-events: none;
1383
+ }
1384
+
1385
+ .astra-sites-preview input[type="checkbox"].disabled {
1386
+ background: #eeeeee;
1387
+ opacity: 1;
1388
+ color: #fff;
1389
+ box-shadow: none;
1390
+ border-color: #b4b9be;
1391
+ }
1392
+
1393
+ .astra-sites-tooltip-icon .dashicons {
1394
+ color: #757575;
1395
+ font-size: 15px;
1396
+ vertical-align: middle;
1397
+ height: auto;
1398
+ }
1399
+ #astra-sites-admin {
1400
+ margin-left: 25px;
1401
+ margin-right: 25px;
1402
+ margin-top: 40px;
1403
+ }
1404
+ .astra-previewing-single-pages #wpfooter {
1405
+ display: none;
1406
+ }
1407
+ .astra-previewing-single-pages #astra-sites-admin {
1408
+ margin-top: 115px;
1409
+ }
1410
+ #astra-sites-welcome-form-inline select {
1411
+ text-align-last: left;
1412
+ }
1413
+
1414
+ #astra-sites-welcome-form-inline option {
1415
+ direction: ltr;
1416
+ }
1417
+ #astra-sites-admin .filter-links li > a:first-child {
1418
+ margin-right: 0;
1419
+ }
1420
+ #astra-sites-welcome-form-inline {
1421
+ margin-right: 0;
1422
+ border-radius: 3px;
1423
+ padding: 0px 5px 2px 5px;
1424
+ outline: 2px solid transparent;
1425
+ outline-offset: 0;
1426
+ background: #ffffff;
1427
+ color: #72777c;
1428
+ font-weight: normal;
1429
+ font-size: 13px;
1430
+ line-height: 26px;
1431
+ height: 28px;
1432
+ cursor: pointer;
1433
+ }
1434
+
1435
+ #astra-sites-welcome-form-inline select,
1436
+ #astra-sites-welcome-form-inline select:focus {
1437
+ border: none;
1438
+ outline: none;
1439
+ box-shadow: none;
1440
+ color: #72777c;
1441
+ }
1442
+
1443
+ #astra-sites-menu-page .wp-full-overlay-main:before {
1444
+ content: '';
1445
+ display: none;
1446
+ }
1447
+
1448
+ .theme-screenshot-wrap {
1449
+ overflow: hidden;
1450
+ max-height: 300px;
1451
+ margin: 15px 0;
1452
+ border: 1px solid #ccc;
1453
+ }
1454
+
1455
+ .astra-sites-preview .install-theme-info .theme-screenshot {
1456
+ width: 100%;
1457
+ border: none;
1458
+ margin: 0;
1459
+ }
1460
+
1461
+ #astra-sites-welcome-form .title {
1462
+ font-size: 14px;
1463
+ font-weight: 500;
1464
+ margin-top: 5px;
1465
+ }
1466
+
1467
+ #astra-sites-welcome-form #submit {
1468
+ padding: 0em 4rem;
1469
+ }
1470
+
1471
+ .page-builders {
1472
+ margin: 35px 0;
1473
+ }
1474
+
1475
+ .page-builders li {
1476
+ cursor: pointer;
1477
+ display: inline-block;
1478
+ padding: 1.2em;
1479
+ }
1480
+
1481
+ .page-builders [type=radio] {
1482
+ position: absolute;
1483
+ opacity: 0;
1484
+ width: 0;
1485
+ height: 0;
1486
+ }
1487
+
1488
+ .page-builders [type=radio] + img.active,
1489
+ .page-builders [type=radio] + img:hover {
1490
+ transform: translateY(-1px);
1491
+ box-shadow: 0 2px 6px rgba(0, 115, 170, 0.18);
1492
+ border-color: #0073aa;
1493
+ }
1494
+
1495
+ .page-builders [type=radio] + img {
1496
+ cursor: pointer;
1497
+ border: 1px solid #dcdcdc;
1498
+ border-radius: 4px;
1499
+ transition: all linear 0.2s;
1500
+ height: 100px;
1501
+ padding: 6px;
1502
+ }
1503
+
1504
+ .astra-demo-import.button.updating-message:before,
1505
+ .astra-demo-import.button.installing:before {
1506
+ vertical-align: text-top;
1507
+ margin: 0 0 0 5px;
1508
+ }
1509
+
1510
+ .current-importing-status-wrap hr {
1511
+ border-color: #f1f1f1;
1512
+ }
1513
+
1514
+ .astra-sites-result-preview {
1515
+ position: absolute;
1516
+ right: 0;
1517
+ left: 0;
1518
+ top: 0;
1519
+ bottom: 0;
1520
+ background: #fff;
1521
+ overflow-y: auto;
1522
+ }
1523
+
1524
+ .astra-sites-result-preview .button {
1525
+ margin-top: 1em;
1526
+ }
1527
+
1528
+ .preview-page-from-search-result #astra-sites-tooltip-plugins-settings,
1529
+ .astra-sites-page-import-popup #astra-sites-tooltip-plugins-settings {
1530
+ display: block !important;
1531
+ }
1532
+
1533
+ .astra-sites-result-preview h3 {
1534
+ font-size: 1.3em;
1535
+ margin: 0;
1536
+ }
1537
+ .astra-sites-result-preview .heading {
1538
+ background: #ffffff;
1539
+ padding: 16px 35px;
1540
+ margin-top: 0;
1541
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
1542
+ margin-bottom: 10px;
1543
+ display: flex;
1544
+ justify-content: space-between;
1545
+ }
1546
+ .astra-sites-result-preview .close {
1547
+ position: absolute;
1548
+ left: 0;
1549
+ top: 0;
1550
+ bottom: 0;
1551
+ height: 53px;
1552
+ line-height: 53px;
1553
+ width: 53px;
1554
+ cursor: pointer;
1555
+ border-right: 1px solid #eee;
1556
+ color: #aaa;
1557
+ font-size: 22px;
1558
+ }
1559
+ .astra-sites-result-preview .close:hover {
1560
+ color: #0073aa;
1561
+ }
1562
+ .astra-sites-result-preview .overlay {
1563
+ background: rgba(0, 0, 0, 0.7);
1564
+ filter: alpha(opacity=70);
1565
+ position: fixed;
1566
+ top: 0;
1567
+ left: 0;
1568
+ bottom: 0;
1569
+ right: 0;
1570
+ z-index: 100050;
1571
+ }
1572
+ .astra-sites-result-preview .inner {
1573
+ margin: 0 auto;
1574
+ width: 660px;
1575
+ max-height: 420px;
1576
+ -webkit-transform: translate(50%, -50%);
1577
+ -ms-transform: translate(50%, -50%);
1578
+ transform: translate(50%, -50%);
1579
+ -webkit-box-sizing: border-box;
1580
+ -moz-box-sizing: border-box;
1581
+ box-sizing: border-box;
1582
+ position: fixed;
1583
+ background-color: #f1f3f5;
1584
+ z-index: 100059;
1585
+ text-align: right;
1586
+ top: 50%;
1587
+ right: 50%;
1588
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
1589
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
1590
+ border-radius: 2px;
1591
+ }
1592
+ .astra-sites-result-preview .button {
1593
+ line-height: 40px;
1594
+ }
1595
+
1596
+ #single-pages .astra-theme {
1597
+ padding: 0;
1598
+ }
1599
+
1600
+ .astra-sites-import-content > p:first-child,
1601
+ .ast-importing-wrap > p:first-child {
1602
+ margin-top: 0;
1603
+ }
1604
+
1605
+ .current-importing-status {
1606
+ background: #fff;
1607
+ padding: 1.3em;
1608
+ }
1609
+
1610
+ .appearance_page_starter-templates .rotating {
1611
+ height: auto;
1612
+ animation: rotation 2s infinite linear;
1613
+ width: auto;
1614
+ color: #c1c1c1;
1615
+ }
1616
+
1617
+ .agency-ribbons {
1618
+ color: #ffffff;
1619
+ text-align: center;
1620
+ display: inline-block;
1621
+ position: absolute;
1622
+ z-index: 9;
1623
+ top: -7px;
1624
+ text-transform: uppercase;
1625
+ font-weight: 600;
1626
+ font-size: 9.5px;
1627
+ letter-spacing: 0.2px;
1628
+ left: -7px;
1629
+ border-radius: 2px;
1630
+ line-height: 15px;
1631
+ padding: 5px 9px;
1632
+ background-color: #007cba;
1633
+ cursor: default;
1634
+ }
1635
+
1636
+ .theme-browser .theme:hover .theme-actions,
1637
+ .theme-browser .theme.focus .theme-actions,
1638
+ .theme-browser .theme:focus .theme-actions {
1639
+ opacity: 0;
1640
+ }
1641
+
1642
+ .theme-browser .theme .theme-screenshot:after {
1643
+ padding-top: 118%;
1644
+ }
1645
+
1646
+ @-webkit-keyframes rotation {
1647
+ from {
1648
+ -webkit-transform: rotate(0deg);
1649
+ }
1650
+ to {
1651
+ -webkit-transform: rotate(-359deg);
1652
+ }
1653
+ }
1654
+ .import-time {
1655
+ display: inline-block;
1656
+ background: #0185ba;
1657
+ color: #fff;
1658
+ padding: 2px 10px;
1659
+ border-radius: 3px;
1660
+ animation: astra-scale 0.5s alternate infinite ease-in;
1661
+ }
1662
+
1663
+ .theme-browser .theme:hover .theme-actions,
1664
+ .theme-browser .theme.focus .theme-actions,
1665
+ .theme-browser .theme:focus .theme-actions {
1666
+ opacity: 0;
1667
+ }
1668
+ @keyframes astra-scale {
1669
+ 0% {transform: scale(1);}
1670
+ 100% {transform: scale(1.03);}
1671
+ }
1672
+
1673
+ .current-importing-status p {
1674
+ margin: 0;
1675
+ }
1676
+
1677
+ @media (min-width: 960px) and (max-width: 1020px) {
1678
+ #astra-sites-admin .theme-action-wrap {
1679
+ padding: 5px;
1680
+ width: 100%;
1681
+ }
1682
+ }
1683
+
1684
+ @media (min-width: 781px) and (max-width: 920px) {
1685
+ #astra-sites-admin .theme-action-wrap {
1686
+ padding: 5px;
1687
+ width: 100%;
1688
+ }
1689
+ .theme-browser .theme .theme-actions button:first-child {
1690
+ margin-bottom: 5px;
1691
+ }
1692
+ }
1693
+
1694
+ .theme-browser .theme .site-preview > .theme-screenshot.two:hover,
1695
+ .theme-browser .theme .site-preview > .theme-screenshot.three:hover {
1696
+ background-position: center top;
1697
+ }
1698
+
1699
+ .theme-browser .theme .theme-screenshot.two,
1700
+ .theme-browser .theme .theme-screenshot.three {
1701
+ position: absolute;
1702
+ top: 0;
1703
+ left: 0;
1704
+ right: 0px;
1705
+ }
1706
+
1707
+ .theme-browser .theme .theme-screenshot.two {
1708
+ width: calc(100% - 10px);
1709
+ opacity: .8;
1710
+ right: 0px;
1711
+ transform: translate(-5px, -5px);
1712
+ }
1713
+
1714
+ .theme-browser .theme .theme-screenshot.three {
1715
+ width: calc(100% - 20px);
1716
+ opacity: .4;
1717
+ transform: translate(-10px, -10px);
1718
+ }
1719
+
1720
+ .theme-browser .theme {
1721
+ box-shadow: 0 1px 7px 0 rgba(0, 0, 0, 0.08);
1722
+ margin: 0 0 3.6% 3%;
1723
+ border: none;
1724
+ }
1725
+
1726
+ .single-site {
1727
+ display: flex;
1728
+ }
1729
+
1730
+ .single-site-pages {
1731
+ overflow-y: auto;
1732
+ height: 100vh;
1733
+ max-height: calc(100vh - 280px);
1734
+ }
1735
+
1736
+ .single-site-pages::-webkit-scrollbar {
1737
+ width: 5px;
1738
+ background-color: #f1f1f1;
1739
+ }
1740
+
1741
+ .single-site-pages::-webkit-scrollbar-thumb {
1742
+ border-radius: 0;
1743
+ background-color: #d8d8d8;
1744
+ }
1745
+
1746
+ .single-site-pages::-webkit-scrollbar-track {
1747
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
1748
+ width: 20px;
1749
+ }
1750
+
1751
+
1752
+ .astra-sites-import-content::-webkit-scrollbar,
1753
+ .single-site-preview::-webkit-scrollbar {
1754
+ width: 5px;
1755
+ background-color: #f1f1f1;
1756
+ }
1757
+
1758
+ .astra-sites-import-content::-webkit-scrollbar-thumb,
1759
+ .single-site-preview::-webkit-scrollbar-thumb {
1760
+ border-radius: 0;
1761
+ background-color: #d8d8d8;
1762
+ }
1763
+
1764
+ .astra-sites-import-content::-webkit-scrollbar-track,
1765
+ .single-site-preview::-webkit-scrollbar-track {
1766
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
1767
+ width: 20px;
1768
+ }
1769
+
1770
+ .single-site-preview {
1771
+ margin-left: 4em;
1772
+ max-height: calc(100vh - 280px);
1773
+ height: 100vh;
1774
+ overflow-y: auto;
1775
+ border-radius: 2px;
1776
+ box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.12);
1777
+ }
1778
+
1779
+ .single-site-preview img {
1780
+ width: 100%;
1781
+ vertical-align: middle;
1782
+ }
1783
+
1784
+ .single-site-footer {
1785
+ position: fixed;
1786
+ padding: 15px 35px 15px 50px;
1787
+ bottom: 0;
1788
+ background: #fff;
1789
+ left: 0;
1790
+ right: 0;
1791
+ margin-right: 160px;
1792
+ z-index: 88;
1793
+ box-shadow: 0 -2px 8px rgba( 0, 0, 0, 0.05);
1794
+ }
1795
+
1796
+ .folded #astra-sites-menu-page .nav-tab-wrapper,
1797
+ .folded .single-site-footer {
1798
+ margin-right: 36px;
1799
+ }
1800
+
1801
+ .site-action-buttons-wrap {
1802
+ display: flex;
1803
+ justify-content: space-between;
1804
+ }
1805
+
1806
+ .single-site-pages-header {
1807
+ display: flex;
1808
+ justify-content: space-between;
1809
+ align-items: center;
1810
+ margin: 0 0 32px 0;
1811
+ }
1812
+
1813
+ .astra-site-title {
1814
+ margin: 0;
1815
+ }
1816
+
1817
+ .astra-pages-title-wrap {
1818
+ margin: 0 0 30px 0;
1819
+ display: flex;
1820
+ justify-content: space-between;
1821
+ }
1822
+
1823
+ .single-site-preview-wrap {
1824
+ width: 55%;
1825
+ }
1826
+
1827
+ .single-site-pages-wrap {
1828
+ width: 45%;
1829
+ }
1830
+
1831
+ /**
1832
+ * 3 Grid for Pages
1833
+ */
1834
+ @media only screen and (min-width: 1640px) {
1835
+ .theme-browser #site-pages .theme {
1836
+ width: 31.06%;
1837
+ margin: 0 0 3% 3%;
1838
+ }
1839
+ }
1840
+
1841
+ @media only screen and (min-width: 1640px) {
1842
+ .theme-browser #site-pages .theme:nth-child(3n) {
1843
+ margin-left: 0;
1844
+ }
1845
+ }
1846
+ #single-pages .astra-theme {
1847
+ border: none;
1848
+ }
1849
+
1850
+ #single-pages .current_page .inner {
1851
+ border-color: #5b9dd9;
1852
+ border-radius: 2px;
1853
+ }
1854
+ .theme-browser #site-pages .theme {
1855
+ margin: 0 0 3.4% 3.4%;
1856
+ border-radius: 2px;
1857
+ border: none;
1858
+ box-shadow: none;
1859
+ }
1860
+ .theme-browser #single-pages .site-single .theme-screenshot:after {
1861
+ padding-top: 100%;
1862
+ }
1863
+
1864
+ .site-action-buttons-wrap .dashicons {
1865
+ vertical-align: sub;
1866
+ font-size: 1rem;
1867
+ margin-right: .2em;
1868
+ }
1869
+
1870
+ .single-site-footer .dashicons-editor-help {
1871
+ font-size: 20px;
1872
+ color: #555d66;
1873
+ margin-right: 10px;
1874
+ }
1875
+ .site-action-buttons-right {
1876
+ display: flex;
1877
+ align-items: center;
1878
+ }
1879
+ .astra-sites-result-preview.astra-sites-import-complete .inner {
1880
+ overflow: hidden;
1881
+ height: auto;
1882
+ }
1883
+
1884
+ .site-action-buttons-wrap .button.button-primary.button-hero {
1885
+ box-shadow: none;
1886
+ }
1887
+ .wp-core-ui .astra-sites-result-preview .button.button-hero,
1888
+ .wp-core-ui .astra-sites-result-preview .button.button-hero:focus,
1889
+ .site-action-buttons-wrap .button.button-hero,
1890
+ .site-action-buttons-wrap .button.button-hero:focus {
1891
+ font-size: 13px;
1892
+ height: 34px;
1893
+ min-height: 34px;
1894
+ line-height: 33px;
1895
+ padding: 0 20px;
1896
+ box-shadow: none;
1897
+ }
1898
+
1899
+ .astra-hide-site {
1900
+ display: none;
1901
+ }
1902
+
1903
+ .astra-sites-no-sites .button.astra-sites-back,
1904
+ .astra-sites-no-favorites .button.astra-sites-back {
1905
+ box-shadow: none;
1906
+ height: 30px;
1907
+ }
1908
+
1909
+ .astra-sites-no-sites h3 {
1910
+ font-size: 1.3rem;
1911
+ font-weight: normal;
1912
+ color: #666;
1913
+ margin-top: 0;
1914
+ }
1915
+
1916
+ .astra-sites-import-plugins .disabled {
1917
+ pointer-events: none;
1918
+ }
1919
+ .theme-browser .theme .site-preview > .theme-screenshot.loading,
1920
+ .theme-browser .theme .theme-screenshot.loading {
1921
+ animation-duration: 2s;
1922
+ animation-fill-mode: forwards;
1923
+ animation-iteration-count: infinite;
1924
+ animation-name: image-placeholder;
1925
+ animation-timing-function: linear;
1926
+ background: #f6f7f8;
1927
+ background: linear-gradient(to left, #fafafa 8%, #f4f4f4 38%, #fafafa 54%);
1928
+ position: relative;
1929
+ }
1930
+ @keyframes image-placeholder{
1931
+ 0%{
1932
+ background-position: -150px 0;
1933
+ }
1934
+ 100%{
1935
+ background-position: 150px 0;
1936
+ }
1937
+ }
1938
+ .searching .theme-browser .theme .theme-screenshot.loading {
1939
+ opacity: .5;
1940
+ }
1941
+ .searching .theme-browser .theme .theme-screenshot {
1942
+ filter: blur(0);
1943
+ }
1944
+ .inner {
1945
+ overflow: hidden;
1946
+ }
1947
+ .site-import-layout-button.disabled {
1948
+ pointer-events: none;
1949
+ }
1950
+
1951
+ .theme-browser .themes {
1952
+ clear: both;
1953
+ margin: -1%;
1954
+ }
1955
+
1956
+
1957
+ @media only screen and (min-width: 768px) {
1958
+ .theme-browser .theme {
1959
+ width: 25%;
1960
+ padding: 1.1%;
1961
+ margin: 0 0em 1em 0;
1962
+ box-shadow: none;
1963
+ }
1964
+ }
1965
+
1966
+ @media only screen and (min-width: 1640px) {
1967
+ .theme-browser .theme:nth-child(3n) {
1968
+ margin-left: 0;
1969
+ }
1970
+ .theme-browser .theme:nth-child(4n) {
1971
+ margin-left: 0;
1972
+ }
1973
+ }
1974
+
1975
+ #astra-sites-filters .search-form {
1976
+ position: relative;
1977
+ }
1978
+
1979
+ .filters-wrap-page-categories {
1980
+ position: absolute;
1981
+ background: #fff;
1982
+ padding: 10px;
1983
+ z-index: 999;
1984
+ border: 1px solid #ccc;
1985
+ border-top: none;
1986
+ left: 0;
1987
+ right: 0;
1988
+ margin: 0;
1989
+ visibility: hidden;
1990
+ opacity: 0;
1991
+ }
1992
+
1993
+ .filters-wrap-page-categories.show {
1994
+ visibility: visible;
1995
+ opacity: 1;
1996
+ }
1997
+
1998
+ .filters-wrap-page-categories .filter-links li {
1999
+ display: list-item;
2000
+ }
2001
+
2002
+ #astra-sites-admin .filter-links .current {
2003
+ border: none;
2004
+ }
2005
+
2006
+ .filters-wrap-page-categories .filter-links {
2007
+ display: block;
2008
+ }
2009
+
2010
+ .filters-wrap-page-categories .filter-links li > a {
2011
+ display: block;
2012
+ margin: 0 5px 5px 0;
2013
+ }
2014
+
2015
+ .page-builder-icon .page-builders {
2016
+ position: absolute;
2017
+ top: 100%;
2018
+ background: #fff;
2019
+ z-index: 10;
2020
+ margin: 0;
2021
+ border: 1px solid #ddd;
2022
+ opacity: 0;
2023
+ visibility: hidden;
2024
+ box-shadow: 0px 9px 21px 0px rgba(0, 0, 0, 0.2);
2025
+ border-bottom-right-radius: 3px;
2026
+ border-bottom-left-radius: 3px;
2027
+ right: -1px;
2028
+ left: 0px;
2029
+ }
2030
+ .page-builder-icon.active .page-builders {
2031
+ opacity: 1;
2032
+ visibility: visible;
2033
+ }
2034
+ .page-builder-icon .page-builders img {
2035
+ height: 17px;
2036
+ width: 17px;
2037
+ border-radius: 50%;
2038
+ margin-left: 10px;
2039
+ }
2040
+
2041
+ .page-builder-icon .page-builders li {
2042
+ display: flex;
2043
+ padding: 10px 15px;
2044
+ margin: 0;
2045
+ }
2046
+
2047
+ .page-builder-icon {
2048
+ display: inline-block;
2049
+ font-size: 12px;
2050
+ padding: 23px 10px;
2051
+ width: 164px;
2052
+ position: relative;
2053
+ cursor: pointer;
2054
+ }
2055
+
2056
+ .page-builder-icon img {
2057
+ height: auto;
2058
+ width: 22px;
2059
+ border-radius: 50%;
2060
+ margin-left: 8px;
2061
+ }
2062
+
2063
+ .selected-page-builder {
2064
+ display: flex;
2065
+ justify-content: center;
2066
+ align-items: center;
2067
+ }
2068
+
2069
+ .selected-page-builder .dashicons {
2070
+ margin-right: 2px;
2071
+ }
2072
+
2073
+ .page-builder-icon .page-builders .active,
2074
+ .page-builder-icon .page-builders li:hover {
2075
+ background-color: #f7f7f7;
2076
+ }
2077
+
2078
+ .appearance_page_starter-templates .astra-sites-sync-library-message {
2079
+ margin-right: 25px;
2080
+ margin-left: 25px;
2081
+ }
2082
+
2083
+ .astra-sites-sync-library-message.notice .notice-dismiss:before {
2084
+ font-size: 14px;
2085
+ }
2086
+
2087
+ .astra-loading-wrap {
2088
+ position: absolute;
2089
+ right: 50%;
2090
+ top: 50%;
2091
+ transform: translate(60%, -60%);
2092
+ }
2093
+
2094
+ .astra-previewing-single-pages #wpbody-content {
2095
+ position: fixed;
2096
+ }
2097
+
2098
+ .appearance_page_starter-templates div#setting-error-tgmpa,
2099
+ .appearance_page_starter-templates .update-nag,
2100
+ .appearance_page_starter-templates .notice,
2101
+ .appearance_page_starter-templates div.error {
2102
+ display: none;
2103
+ }
2104
+
2105
+ .appearance_page_starter-templates .astra-sites-notice {
2106
+ display: block;
2107
+ }
2108
+
2109
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message.success,
2110
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message.notice-success {
2111
+ display: none !important;
2112
+ }
2113
+
2114
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message {
2115
+ top: 85px;
2116
+ display: block !important;
2117
+ width: calc( 100% - 270px );
2118
+ }
2119
+
2120
+ .astra-previewing-single-pages.folded #wpbody-content > .notice.astra-sites-sync-library-message {
2121
+ width: calc( 100% - 150px );
2122
+ }
2123
+
2124
+ .appearance_page_starter-templates.astra-previewing-single-pages #wpbody-content {
2125
+ padding-top: 0;
2126
+ }
2127
+
2128
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2129
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2130
+ display: inline-block !important;
2131
+ top: 90px;
2132
+ left: 0;
2133
+ width: calc( 100% - 260px ) !important;
2134
+ }
2135
+
2136
+ .folded.astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2137
+ .folded.astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2138
+ width: calc( 100% - 140px ) !important;
2139
+ }
2140
+
2141
+ .appearance_page_starter-templates #wpbody-content {
2142
+ padding-top: 80px;
2143
+ }
2144
+
2145
+ .appearance_page_starter-templates.auto-fold #wpcontent {
2146
+ padding-right: 0;
2147
+ }
2148
+
2149
+ .pages-count,
2150
+ .page-title {
2151
+ font-weight: 300;
2152
+ font-size: 13px;
2153
+ display: none;
2154
+ }
2155
+
2156
+ .site-pages-not-import-notice {
2157
+ clear: both;
2158
+ }
2159
+
2160
+ .astra-loading-icon,
2161
+ .astra-loading-icon:after {
2162
+ border-radius: 50%;
2163
+ width: 20px;
2164
+ height: 20px;
2165
+ }
2166
+ .astra-loading-icon {
2167
+ border-top: 3px solid rgb(192, 192, 192);
2168
+ border-left: 3px solid rgb(192, 192, 192);
2169
+ border-bottom: 3px solid rgb(192, 192, 192);
2170
+ border-right: 3px solid #0185ba;
2171
+ -webkit-transform: translateZ(0);
2172
+ -ms-transform: translateZ(0);
2173
+ transform: translateZ(0);
2174
+ -webkit-animation: load8 1.1s infinite linear;
2175
+ animation: load8 1.1s infinite linear;
2176
+ }
2177
+ @-webkit-keyframes load8 {
2178
+ 0% {
2179
+ -webkit-transform: rotate(0deg);
2180
+ transform: rotate(0deg);
2181
+ }
2182
+ 100% {
2183
+ -webkit-transform: rotate(-360deg);
2184
+ transform: rotate(-360deg);
2185
+ }
2186
+ }
2187
+ @keyframes load8 {
2188
+ 0% {
2189
+ -webkit-transform: rotate(0deg);
2190
+ transform: rotate(0deg);
2191
+ }
2192
+ 100% {
2193
+ -webkit-transform: rotate(-360deg);
2194
+ transform: rotate(-360deg);
2195
+ }
2196
+ }
2197
+
2198
+ .preparing .install-theme-info {
2199
+ display: none !important;
2200
+ }
2201
+
2202
+ #astra-sites.temp .placeholder-site .theme-id-container .title {
2203
+ background: #f1f1f1;
2204
+ }
2205
+
2206
+ #astra-sites.temp .placeholder-site .theme-id-container .site-title {
2207
+ color: transparent;
2208
+ }
2209
+
2210
+ .ast-sites__filter-wrap-checkbox input[type="radio"].active:before {
2211
+ content: "";
2212
+ border-radius: 50%;
2213
+ width: 0.5rem;
2214
+ height: 0.5rem;
2215
+ margin: 0.1875rem;
2216
+ background-color: #1e8cbe;
2217
+ line-height: 1.14285714;
2218
+ float: right;
2219
+ display: inline-block;
2220
+ vertical-align: middle;
2221
+ speak: none;
2222
+ -webkit-font-smoothing: antialiased;
2223
+ -moz-osx-font-smoothing: grayscale;
2224
+ }
2225
+
2226
+ @media screen and (min-width: 783px and max-width: 1180px) {
2227
+
2228
+ .folded #astra-sites-menu-page .nav-tab-wrapper {
2229
+ margin-right: 36px;
2230
+ top: 32px;
2231
+ }
2232
+ #astra-sites-filters .search-form {
2233
+ width: 100%;
2234
+ }
2235
+ #astra-sites .theme {
2236
+ width: 50%;
2237
+ }
2238
+
2239
+ #astra-sites .theme:nth-child(odd) {
2240
+ margin: 0;
2241
+ }
2242
+ .theme-browser #site-pages .theme {
2243
+ width: 46%;
2244
+ }
2245
+ }
2246
+ @media screen and (max-width: 782px) {
2247
+ .ast-sites__filter-wrap-checkbox input[type="radio"] {
2248
+ height: 1rem;
2249
+ width: 1rem;
2250
+ }
2251
+ .ast-sites__filter-wrap-checkbox input[type="radio"]:checked:before {
2252
+ margin: .25rem;
2253
+ height: 0.4rem;
2254
+ width: 0.4rem;
2255
+ }
2256
+
2257
+ .folded #astra-sites-menu-page .nav-tab-wrapper {
2258
+ top: 46px;
2259
+ margin-right: 0;
2260
+ }
2261
+
2262
+ .page-builder-title {
2263
+ display: none;
2264
+ }
2265
+
2266
+ .page-builder-icon {
2267
+ width: 100px;
2268
+ }
2269
+
2270
+ .page-builder-icon .page-builders {
2271
+ width: 140px;
2272
+ margin-right: -20px;
2273
+ }
2274
+ .single-site-footer {
2275
+ margin-right: 0;
2276
+ }
2277
+ }
2278
+ @media only screen and (max-width: 768px) {
2279
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2280
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2281
+ top: 0;
2282
+ width: auto !important;
2283
+ }
2284
+ }
2285
+ @media only screen and (max-width: 767px) {
2286
+ .appearance_page_starter-templates #wpbody-content {
2287
+ padding-top: 0;
2288
+ }
2289
+
2290
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
2291
+ padding: 10px;
2292
+ }
2293
+
2294
+ .back-to-layout {
2295
+ padding: 20px 5px;
2296
+ }
2297
+
2298
+ .astra-previewing-single-pages #astra-sites-admin {
2299
+ margin-top: 55px;
2300
+ }
2301
+ }
2302
+ @media only screen and (max-width: 1120px) {
2303
+ .theme-browser .theme:nth-child(odd) {
2304
+ margin-left: 0;
2305
+ }
2306
+ }
2307
+ @media only screen and (min-width: 780px) and (max-width: 1200px) {
2308
+ .theme-browser .theme:nth-child(odd) {
2309
+ margin-left: 0;
2310
+ }
2311
+ .theme-browser .theme {
2312
+ width: 33.33%;
2313
+ }
2314
+ }
2315
+ @media only screen and (min-width: 780px) and (max-width: 962px) {
2316
+ #astra-sites-menu-page .nav-tab-wrapper {
2317
+ margin-right: 36px;
2318
+ }
2319
+ }
2320
+ @media only screen and (min-width: 1200px) {
2321
+ #astra-sites-filters .search-form {
2322
+ width: 600px;
2323
+ margin: 0 auto;
2324
+ }
2325
+ }
2326
+ @media only screen and (min-width: 1000px) and (max-width: 1200px) {
2327
+ .theme-browser #site-pages .theme:nth-child(3n) {
2328
+ margin-left: 0;
2329
+ }
2330
+
2331
+ .theme-browser #site-pages .theme {
2332
+ width: 30.33%;
2333
+ }
2334
+ }
2335
+
2336
+ @media only screen and (min-width: 780px) and (max-width: 999px) {
2337
+ .theme-browser #site-pages .theme:nth-child(2n) {
2338
+ margin-left: 0;
2339
+ }
2340
+
2341
+ .theme-browser #site-pages .theme {
2342
+ width: 48%;
2343
+ }
2344
+ }
2345
+
2346
+ @media only screen and (max-width: 960px) {
2347
+ #site-pages {
2348
+ position: relative;
2349
+ margin: 0 0 0 70px;
2350
+ }
2351
+ }
2352
+ @media only screen and (max-width: 1200px) {
2353
+ .back-to-layout {
2354
+ margin-left: 20px;
2355
+ }
2356
+ }
2357
+ @media screen and (max-width: 600px) {
2358
+ #astra-sites-filters .search-form {
2359
+ width: auto;
2360
+ }
2361
+ }
2362
+ @media screen and (max-width: 782px) {
2363
+ #astra-sites-menu-page .nav-tab-wrapper {
2364
+ margin: 0;
2365
+ top: 46px;
2366
+ }
2367
+ #site-pages {
2368
+ margin: 0;
2369
+ }
2370
+ .theme-browser #site-pages .theme {
2371
+ width: 46%;
2372
+ }
2373
+ .single-site-footer {
2374
+ padding: 10px 20px;
2375
+ }
2376
+ .single-site {
2377
+ flex-direction: column;
2378
+ }
2379
+
2380
+ .single-site-preview-wrap {
2381
+ width: 100%;
2382
+ }
2383
+
2384
+ .single-site-preview {
2385
+ margin: 0;
2386
+ height: 40vh;
2387
+ }
2388
+
2389
+ .single-site-pages-wrap {
2390
+ width: 100%;
2391
+ margin-top: 3em;
2392
+ }
2393
+ }
2394
+
2395
+ .astra-sites__category-filter-items {
2396
+ z-index: 99;
2397
+ }
2398
+
2399
+ @media only screen and (min-width: 780px) and (max-width: 962px) {
2400
+ .single-site-footer {
2401
+ margin-right: 38px;
2402
+ }
2403
+ }
2404
+ @media screen and (min-width: 481px) {
2405
+ .hide-on-desktop {
2406
+ display: none;
2407
+ }
2408
+ .astra-sites__category-filter-items {
2409
+ z-index: 99;
2410
+ }
2411
+ }
2412
+ @media screen and (max-width: 480px) {
2413
+ #astra-sites-admin .astra-sites-popup .inner,
2414
+ .astra-sites-result-preview .inner {
2415
+ width: 95%;
2416
+ }
2417
+ .single-site-footer .button {
2418
+ text-align: center;
2419
+ width: 100%;
2420
+ }
2421
+ .single-site-pages {
2422
+ overflow: initial;
2423
+ }
2424
+
2425
+ #astra-sites-filters.hide-on-desktop {
2426
+ box-shadow: -25px 0 30px rgba(28, 39, 60, 0.09);
2427
+ border-bottom: 1px solid #dddddd;
2428
+ background: #fff;
2429
+ padding: 10px;
2430
+ }
2431
+
2432
+ #astra-sites-menu-page .form {
2433
+ flex: 1;
2434
+ }
2435
+
2436
+ .favorite-filters-wrap {
2437
+ flex: 1;
2438
+ text-align: left;
2439
+ padding: 5px 10px;
2440
+ }
2441
+
2442
+ .back-to-layout {padding: 13px 10px;}
2443
+
2444
+ .page-builder-icon {
2445
+ padding: 18px 15px 18px 8px;
2446
+ }
2447
+
2448
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
2449
+ padding: 14px 10px;
2450
+ }
2451
+
2452
+ #astra-sites__category-filter .astra-sites__category-filter-anchor {
2453
+ width: 90px;
2454
+ }
2455
+
2456
+ .header-actions li > a {
2457
+ margin: 0 7px;
2458
+ }
2459
+
2460
+ .astra-previewing-single-pages #wpbody-content {
2461
+ position: relative;
2462
+ }
2463
+
2464
+ .astra-sites-no-sites .content, .astra-sites-no-favorites .content {
2465
+ flex-direction: column;
2466
+ }
2467
+
2468
+ .astra-sites-no-sites .inner, .astra-sites-no-favorites .inner {
2469
+ width: auto;
2470
+ }
2471
+
2472
+ .site-action-buttons-right {
2473
+ flex-direction: column;
2474
+ align-items: flex-start;
2475
+ }
2476
+
2477
+ .site-import-layout-button {
2478
+ margin-right: 0 !important;
2479
+ }
2480
+
2481
+ .astra-sites-no-sites .content, .astra-sites-no-favorites .content {
2482
+ flex-direction: column;
2483
+ }
2484
+
2485
+ .astra-sites-no-sites .inner, .astra-sites-no-favorites .inner {
2486
+ width: auto;
2487
+ }
2488
+
2489
+ .hide-on-mobile {
2490
+ display: none;
2491
+ }
2492
+ .astra-sites-logo-wrap {
2493
+ width: 30px;
2494
+ height: 30px;
2495
+ }
2496
+
2497
+ .header-actions li > a {
2498
+ margin: 0 5px;
2499
+ }
2500
+
2501
+ .page-builder-icon {
2502
+ width: auto;
2503
+ }
2504
+
2505
+ .page-builder-icon .page-builders {
2506
+ margin-right: -95%;
2507
+ }
2508
+
2509
+ #astra-sites-menu-page .nav-tab-wrapper {position: relative;top: 0;right: 0;}
2510
+
2511
+ .theme-browser .theme:nth-child(odd) {
2512
+ margin-left: 0;
2513
+ }
2514
+
2515
+ #astra-sites-admin {
2516
+ margin-top: 30px;
2517
+ margin-right: 20px;
2518
+ margin-left: 20px;
2519
+ }
2520
+ .appearance_page_starter-templates.auto-fold #wpcontent {
2521
+ padding-right: 0;
2522
+ }
2523
+
2524
+ .back-to-layout {
2525
+ margin-left: 10px;
2526
+ }
2527
+
2528
+ .single-site-footer {
2529
+ position: relative;
2530
+ margin-right: -20px;
2531
+ }
2532
+
2533
+ #wpbody-content {
2534
+ padding-bottom: 30px;
2535
+ }
2536
+
2537
+ .site-action-buttons-wrap {
2538
+ flex-direction: column;
2539
+ }
2540
+
2541
+ .site-action-buttons-wrap > .button:first-child {
2542
+ margin-bottom: 5px;
2543
+ }
2544
+
2545
+ .appearance_page_starter-templates .astra-sites-sync-library-message {
2546
+ margin: 10px;
2547
+ }
2548
+ }
2549
+
2550
+ #astra-sites-filters .section-left {
2551
+ flex: 1;
2552
+ }
2553
+
2554
+ #astra-sites-filters .search-form {
2555
+ float: none;
2556
+ }
2557
+
2558
+ /**
2559
+ * Popup
2560
+ */
2561
+
2562
+ .ast-actioms-wrap {
2563
+ padding: 1em 2.9em 1em 1em;
2564
+ z-index: 30;
2565
+ box-sizing: border-box;
2566
+ border-top: 1px solid #dcdcdc;
2567
+ }
2568
+ .wp-core-ui .ast-actioms-wrap .button,
2569
+ .wp-core-ui .ast-actioms-wrap .button:focus {
2570
+ font-size: 13px;
2571
+ height: 36px;
2572
+ min-height: 36px;
2573
+ line-height: 34px;
2574
+ padding: 0 20px;
2575
+ box-shadow: none;
2576
+ }
2577
+ .ast-actioms-wrap .button {
2578
+ margin: 0;
2579
+ }
2580
+ .ast-actioms-wrap .button {
2581
+ margin-left: .5em;
2582
+ }
2583
+ .astra-site-contents > li {
2584
+ margin-bottom: 12px;
2585
+ }
2586
+
2587
+ .astra-sites-popup {
2588
+ position: absolute;
2589
+ right: 0;
2590
+ left: 0;
2591
+ top: 0;
2592
+ bottom: 0;
2593
+ background: #fff;
2594
+ overflow-y: auto;
2595
+ }
2596
+
2597
+ .astra-sites-popup .dashicons {
2598
+ vertical-align: middle;
2599
+ font-size: 1rem;
2600
+ }
2601
+ .astra-sites-popup .button {
2602
+ margin-top: 1em;
2603
+ }
2604
+
2605
+ .astra-sites-popup h3 {
2606
+ font-size: 1.4em;
2607
+ margin: 0;
2608
+ }
2609
+ .astra-sites-popup .heading {
2610
+ background: #ffffff;
2611
+ padding: 16px 35px;
2612
+ margin-top: 0;
2613
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
2614
+ margin-bottom: 10px;
2615
+ display: flex;
2616
+ justify-content: space-between;
2617
+ }
2618
+ .astra-sites-popup .close {
2619
+ position: absolute;
2620
+ left: 0;
2621
+ top: 0;
2622
+ bottom: 0;
2623
+ height: 53px;
2624
+ line-height: 53px;
2625
+ width: 53px;
2626
+ cursor: pointer;
2627
+ border-right: 1px solid #eee;
2628
+ color: #aaa;
2629
+ font-size: 21px;
2630
+ }
2631
+ .astra-sites-popup .close:hover {
2632
+ color: #444;
2633
+ }
2634
+ .astra-sites-popup .overlay {
2635
+ background: rgba(0, 0, 0, 0.7);
2636
+ filter: alpha(opacity=70);
2637
+ position: fixed;
2638
+ top: 0;
2639
+ left: 0;
2640
+ bottom: 0;
2641
+ right: 0;
2642
+ z-index: 100050;
2643
+ }
2644
+ .astra-sites-popup .inner {
2645
+ margin: 0 auto;
2646
+ width: 660px;
2647
+ max-height: 420px;
2648
+ -webkit-transform: translate(50%, -50%);
2649
+ -ms-transform: translate(50%, -50%);
2650
+ transform: translate(50%, -50%);
2651
+ -webkit-box-sizing: border-box;
2652
+ -moz-box-sizing: border-box;
2653
+ box-sizing: border-box;
2654
+ position: fixed;
2655
+ background-color: #f3f3f3;
2656
+ z-index: 100059;
2657
+ text-align: right;
2658
+ top: 50%;
2659
+ right: 50%;
2660
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
2661
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
2662
+ border-radius: 2px;
2663
+ }
2664
+ .astra-sites-popup .button {
2665
+ line-height: 40px;
2666
+ }
2667
+
2668
+ .ast-sites__search-title {
2669
+ padding: 0 1.1%;
2670
+ font-size: 18px;
2671
+ margin-bottom: 10px;
2672
+ }
2673
+
2674
+ .ast-sites__search-wrap {
2675
+ display:flex;
2676
+ flex-wrap: wrap;
2677
+ }
2678
+
2679
+ /**
2680
+ * License Form
2681
+ */
2682
+ #astra-pro-sites-license-form p:first-child {
2683
+ margin-top: 0;
2684
+ }
2685
+
2686
+ #astra-pro-sites-license-form p {
2687
+ margin: .3em 0;
2688
+ }
2689
+
2690
+ #astra-pro-sites-license-form .bsf-license-key-registration {
2691
+ margin-top: 1em;
2692
+ }
2693
+
2694
+ #astra-pro-sites-license-form .inner {
2695
+ position: relative;
2696
+ box-shadow: none;
2697
+ height: auto;
2698
+ width: auto;
2699
+ min-height: auto;
2700
+ transition: none;
2701
+ top: 0;
2702
+ right: 0;
2703
+ transform: none;
2704
+ }
2705
+
2706
+ #astra-pro-sites-license-form h3 {
2707
+ display: none;
2708
+ }
2709
+
2710
+ #astra-pro-sites-license-form .astra-product-license {
2711
+ line-height: normal;
2712
+ margin-top: 0;
2713
+ margin-right: 0.5em;
2714
+ padding: .45em;
2715
+ }
2716
+
2717
+ #astra-pro-sites-license-form .license-form-field {
2718
+ float: right;
2719
+ width: 100%;
2720
+ width: calc( 100% - 140px );
2721
+ }
2722
+
2723
+ #astra-pro-sites-license-form .regular-text {
2724
+ width: 100%;
2725
+ }
2726
+
2727
+ #astra-pro-sites-license-form .submit-button-wrap p {
2728
+ margin-top: 1em;
2729
+ }
2730
+
2731
+ .appearance_page_starter-templates.astra-sites-change-page-builder .astra-sites-notice {
2732
+ display: none;
2733
+ }
2734
+
2735
+ .astra-sites-log p:first-child {
2736
+ margin-top: 0;
2737
+ }
2738
+
2739
+ .astra-sites-log p:last-child {
2740
+ margin-bottom: 0;
2741
+ }
2742
+
2743
+ .astra-sites-log .batch-log {
2744
+ background: #fff;
2745
+ padding: 2em;
2746
+ margin-bottom: 1em;
2747
+ }
2748
+
2749
+ .astra-sites-log table td {
2750
+ vertical-align: top;
2751
+ padding: 15px;
2752
+ text-align: right;
2753
+ }
2754
+
2755
+ .white-label-enabled .astra-sites-logo-wrap {
2756
+ width: auto;
2757
+ display: flex;
2758
+ align-items: center;
2759
+ font-size: 1.2rem;
2760
+ font-weight: 500;
2761
+ }
2762
+
2763
+ .appearance_page_starter-templates .notice.astra-sites-must-notices {
2764
+ display: block;
2765
+ }
2766
+
2767
+ .astra-previewing-single-pages.appearance_page_starter-templates .notice.astra-sites-must-notices {
2768
+ display: none;
2769
+ }
2770
+
2771
+ #astra-pro-sites-license-form .astra-pro-sites-fail-message {
2772
+ color: #F44336;
2773
+ }
2774
+
2775
+ #astra-pro-sites-license-form .bsf-current-license-success-astra-pro-sites,
2776
+ #astra-pro-sites-license-form .bsf-current-license-error-astra-pro-sites {
2777
+ display: none;
2778
+ }
2779
+
2780
+ .bsf-current-license-error-astra-pro-sites,
2781
+ .bsf-current-license-success-astra-pro-sites {
2782
+ display: block;
2783
+ margin-bottom: 0.5em;
2784
+ }
2785
+
2786
+ .astra-pro-sites-license-form-status-success .astra-product-license {
2787
+ display: none;
2788
+ }
2789
+
2790
+ #astra-pro-sites-license-form.astra-pro-sites-license-form-status-success .license-form-field {
2791
+ width: calc( 100% - 2px );
2792
+ }
2793
+
2794
+ #astra-pro-sites-license-form .astra-pro-sites-success-message {
2795
+ color: #008000;
2796
+ }
2797
+
2798
+ .bsf-current-license-error-astra-pro-sites {
2799
+ color: #F44336;
2800
+ }
2801
+
2802
+ .skip-and-import .astra-site-contents {
2803
+ list-style-type: circle;
2804
+ margin-right: 1.7em;
2805
+ }
2806
+
2807
+ .astra-site-contents .astra-theme-module {
2808
+ margin-right: 2em;
2809
+ }
2810
+
2811
+ .dont-use-astra-theme .plugin-card-astra-addon,
2812
+ .required-plugins-count-1.dont-use-astra-theme .astra-sites-import-plugins {
2813
+ display: none;
2814
+ }
inc/assets/css/admin.css CHANGED
@@ -1,108 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .wrap .status,
2
  .wrap .site-type {
3
- position: absolute;
4
  z-index: 1;
5
- color: #fff;
6
- padding: 0.5em 1em;
7
- top: -0.5em;
8
  text-transform: uppercase;
 
 
 
 
 
 
 
 
9
  }
10
- .wrap .status,
11
- .wrap .site-type.premium {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  background: #0073aa;
 
 
 
13
  }
14
- .wrap .status {
15
- left: -0.5em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
- .wrap .site-type.premium {
18
- right: -0.5em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  .wrap .status.publish,
22
  .wrap .site-type.free {
23
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  .install-theme-info .site-type {
27
- display: none;
28
  }
29
 
30
  .theme {
31
- position: relative;
32
  }
33
  .wrap .astra-sites-preview .site-type.premium {
34
- display: block;
35
- display: none;
36
- position: relative;
37
- margin: 0.5em 0em 1em 0em;
38
- top: 0;
39
- left: 0;
40
- text-align: center;
41
  }
42
 
43
  .theme-details-read-more.open {
44
- margin: 0.5em 0 0 0;
45
  }
46
 
47
  .astra-sites-preview .theme-screenshot {
48
- width: 100%;
49
  }
50
 
51
  .install-theme-info .site-type.premium {
52
- display: none;
53
  }
54
 
55
  /**
56
  * Required Plugins
57
  */
58
  .required-plugins.loading {
59
- text-align: center;
60
  }
61
  .required-plugins button {
62
- float: right;
63
  }
64
  .required-plugins .plugin-card {
65
- float: none;
66
- width: 100%;
67
- border: none;
68
- margin: 0 0 0.8em 0;
69
- display: flex;
70
- justify-content: space-between;
71
- align-items: center;
72
- transition: background ease 0.8s;
73
  }
74
  .required-plugins .plugin-card.plugin-card-update-failed {
75
- flex-wrap: wrap;
76
  }
77
  .required-plugins .spinner {
78
- float: none;
79
- margin: 0;
80
  }
81
 
82
  .expanded .wp-full-overlay-footer {
83
- height: 111px;
84
  }
85
 
86
  .wp-full-overlay-footer .view-site,
87
  .wp-full-overlay-footer .go-pro,
88
  .wp-full-overlay-footer .astra-demo-import {
89
- width: 100%;
90
- text-align: center;
91
  }
92
 
93
  .wp-core-ui .wp-full-overlay-footer .button.button-hero,
94
  .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
95
- padding: 0 10px 1px;
96
  }
97
 
98
  .wp-full-overlay-footer .installing:before {
99
- vertical-align: text-bottom;
100
  }
101
 
102
  .astra-sites-advanced-options-wrap h4 {
103
- margin: 1em 0 0.5em 0;
104
- padding: 0.5em 0;
105
- transition: all ease 0.3s;
106
  }
107
 
108
  /**
@@ -110,64 +517,64 @@
110
  */
111
  .wp-core-ui .theme-details-read-more:focus,
112
  .wp-core-ui .theme-details-read-more:hover {
113
- outline: none;
114
- box-shadow: none;
115
  }
116
  .wp-core-ui .theme-details-read-more {
117
- margin: 10px 0;
118
- display: none;
119
- text-decoration: none;
120
  }
121
 
122
  /**
123
  * Go pro.
124
  */
125
  .wp-core-ui .go-pro.button[disabled] {
126
- background-color: #fcb92c !important;
127
- color: white !important;
128
- box-shadow: 1px 0 #eab23a !important;
129
- text-shadow: 1px 0 #6b4e13 !important;
130
- border-color: #e2a932 !important;
131
- cursor: pointer;
132
  }
133
  .wp-core-ui .view-site .dashicons,
134
  .wp-core-ui .go-pro .dashicons {
135
- font-size: 1rem;
136
- vertical-align: middle;
137
  }
138
 
139
  /**
140
  * Errors
141
  */
142
  .plugin-card-update-failed .notice {
143
- margin-top: 1.5em;
144
  }
145
 
146
  .no-themes {
147
- margin-top: 40px;
148
  }
149
 
150
  .no-themes p {
151
- font-size: 15px;
152
  }
153
 
154
  .no-themes .left-margin {
155
- margin-left: 30px;
156
  }
157
 
158
  /**
159
  *
160
  */
161
  .astra-sites-preview .wp-full-overlay-sidebar-content {
162
- bottom: 100px;
163
  }
164
 
165
  .footer-import-button-wrap {
166
- padding: 10px 20px;
167
  }
168
 
169
  .footer-import-button-wrap .button {
170
- margin: 0;
171
  }
172
 
173
  .astra-sites-preview.expanded .wp-full-overlay-footer {
@@ -178,123 +585,147 @@
178
  * Menu Page
179
  */
180
  .astra-sites-title {
181
- float: left;
182
- font-size: 23px;
183
  font-weight: 400;
184
- margin: 0 0 6px 0px;
185
  padding: 0;
186
- line-height: 29px;
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
188
 
189
- #astra-sites-menu-page {
190
- margin-top: 10px;
 
 
 
191
  }
192
 
193
  /**
194
  * API Error
195
  */
196
  .astra-api-error {
197
- margin: 0 0 0.5em 0;
198
  }
199
 
200
  /**
201
  * Grid
202
  */
203
- .wp-filter .search-form {
204
- margin-left: 1em;
205
- }
206
- .wp-filter .search-form input[type="search"] {
207
- width: 200px;
208
- font-size: 13px;
209
- padding: 5px 10px;
210
- }
211
- .section-left {
212
- display: inline-block;
213
- }
214
- .section-right {
215
- float: right;
 
 
 
 
 
 
216
  }
217
  .filter-count {
218
- min-width: 3em;
 
219
  }
220
  .astra-site-preview-on {
221
- overflow: hidden;
222
- }
223
-
224
- .appearance_page_astra-sites .notice {
225
- margin-left: 0;
226
- width: auto;
227
- float: none;
228
- margin-right: 220px;
229
  }
230
 
231
  .filters-wrap {
232
- display: inline-block;
233
  }
234
  .spinner-wrap {
235
- text-align: center;
236
  }
237
  .spinner-wrap .spinner {
238
- float: none;
239
  }
240
  .hide-me {
241
- display: none !important;
242
  }
243
- #astra-sites-admin {
244
- height: 100vh;
 
 
 
 
245
  }
 
 
 
 
 
246
  .install-theme-info > .notice {
247
- margin: 5px 0 10px 0;
248
  }
249
 
250
  .astra-sites-suggestions:before {
251
- border: 5px dashed #ccc;
252
- position: absolute;
253
- left: 0;
254
- right: 0;
255
- top: 0;
256
- bottom: 0px;
257
  }
258
 
259
  .astra-sites-suggestions {
260
- min-height: 280px;
261
- border: none !important;
262
  }
263
 
264
  .astra-sites-suggestions a {
265
- border: none;
266
- outline: none;
267
  }
268
 
269
  .astra-sites-suggestions .inner {
270
- border: 6px solid #24282e !important;
271
- padding: 27% 10% 50% 10%;
272
- text-align: center;
273
- position: absolute;
274
- left: 0;
275
- right: 0;
276
- top: 0;
277
- background: #33383d;
278
- bottom: 0;
279
- color: #eee;
280
- cursor: auto;
281
  }
282
 
283
  .astra-sites-suggestions .inner a {
284
- color: #00b9eb;
285
  }
286
 
287
  .astra-sites-suggestions p {
288
- font-size: 1rem;
289
- margin: 0;
290
  }
291
 
292
  .astra-notice {
293
- margin: 2em 2em 0em 0em;
294
  }
295
 
296
  .no-themes .description {
297
- display: block;
298
  }
299
 
300
  /**
@@ -302,80 +733,80 @@
302
  */
303
  .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
304
  .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
305
- color: #0073aa;
306
  }
307
  .astra-sites-preview .wp-full-overlay-footer .devices button:before {
308
- color: #c1c1c1;
309
  }
310
  .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
311
- background-color: transparent;
312
  }
313
  .astra-sites-preview .wp-full-overlay-footer .devices button {
314
- border: none;
315
  }
316
  .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
317
  .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
318
- border-bottom-color: transparent;
319
- background-color: transparent;
320
  }
321
  .not-click-able {
322
- pointer-events: none !important;
323
  }
324
  body.page-builder-selected .select-page-builder,
325
  body.loading-content .select-page-builder {
326
- display: none;
327
  }
328
  .select-page-builder .up-arrow {
329
- -webkit-transform: rotate(90deg);
330
- -moz-transform: rotate(90deg);
331
- -ms-transform: rotate(90deg);
332
- transform: rotate(90deg);
333
- display: inline-block;
334
- font-size: 1.5em;
335
- color: #797979;
336
- vertical-align: middle;
337
- margin-right: 10px;
338
- -webkit-transition: all linear 0.6s;
339
- -moz-transition: all linear 0.6s;
340
- -ms-transition: all linear 0.6s;
341
- transition: all linear 0.6s;
342
- -webkit-animation-duration: 1s;
343
- animation-duration: 1s;
344
- -webkit-animation-fill-mode: both;
345
- animation-fill-mode: both;
346
- -webkit-animation-timing-function: ease-in-out;
347
- animation-timing-function: ease-in-out;
348
- animation-iteration-count: infinite;
349
- -webkit-animation-iteration-count: infinite;
350
- animation-name: bounce;
351
- -moz-animation-name: bounce;
352
  }
353
  .select-page-builder {
354
- margin-left: 6em;
355
  }
356
 
357
  .select-page-builder img {
358
- max-width: 100%;
359
  }
360
 
361
  .select-page-builder .note-wrap {
362
- position: absolute;
363
- padding: 40px 0;
364
- margin-left: 170px;
365
- right: 0;
366
- left: 0;
367
  }
368
 
369
  .select-page-builder h3 {
370
- margin: 0;
371
- font-size: 2em;
372
  }
373
  .select-page-builder {
374
- margin: -20px 0 0 -5px;
375
- position: absolute;
376
  }
377
  .select-page-builder .note {
378
- margin-left: 1.5em;
379
  }
380
 
381
  @keyframes bounce {
@@ -384,22 +815,22 @@ body.loading-content .select-page-builder {
384
  20%,
385
  50%,
386
  80% {
387
- -webkit-transform: translateY(-0px) rotate(90deg);
388
- -moz-transform: translateY(-0px) rotate(90deg);
389
- -ms-transform: translateY(-0px) rotate(90deg);
390
- transform: translateY(-0px) rotate(90deg);
391
  }
392
  40% {
393
- -webkit-transform: translateY(-2px) rotate(90deg);
394
- -moz-transform: translateY(-2px) rotate(90deg);
395
- -ms-transform: translateY(-2px) rotate(90deg);
396
- transform: translateY(-2px) rotate(90deg);
397
  }
398
  60% {
399
- -webkit-transform: translateY(-1px) rotate(90deg);
400
- -moz-transform: translateY(-1px) rotate(90deg);
401
- -ms-transform: translateY(-1px) rotate(90deg);
402
- transform: translateY(-1px) rotate(90deg);
403
  }
404
  }
405
 
@@ -407,154 +838,487 @@ body.loading-content .select-page-builder {
407
  * Processing Animation
408
  */
409
  .astra-demo-import.disabled {
410
- pointer-events: none;
411
  }
412
  .astra-demo-import.button.updating-message:before,
413
  .astra-demo-import.button.installing:before {
414
- -webkit-animation: cssAnimation .72s ease infinite;
415
- -moz-animation: cssAnimation .72s ease infinite;
416
- -o-animation: cssAnimation .72s ease infinite;
417
- -ms-animation: cssAnimation .72s ease infinite;
418
- animation: cssAnimation .72s ease infinite;
419
  }
420
 
421
  @-webkit-keyframes cssAnimation {
422
- from {
423
- -webkit-transform: rotate(0);
424
- -moz-transform: rotate(0);
425
- -o-transform: rotate(0);
426
- -ms-transform: rotate(0);
427
- transform: rotate(0);
428
- }
429
- to {
430
- -webkit-transform: rotate(360deg);
431
- -moz-transform: rotate(360deg);
432
- -o-transform: rotate(360deg);
433
- -ms-transform: rotate(360deg);
434
- transform: rotate(360deg);
435
- }
436
  }
437
  @-moz-keyframes cssAnimation {
438
- from {
439
- -webkit-transform: rotate(0);
440
- -moz-transform: rotate(0);
441
- -o-transform: rotate(0);
442
- -ms-transform: rotate(0);
443
- transform: rotate(0);
444
- }
445
- to {
446
- -webkit-transform: rotate(360deg);
447
- -moz-transform: rotate(360deg);
448
- -o-transform: rotate(360deg);
449
- -ms-transform: rotate(360deg);
450
- transform: rotate(360deg);
451
- }
452
  }
453
  @-o-keyframes cssAnimation {
454
- from {
455
- -webkit-transform: rotate(0);
456
- -moz-transform: rotate(0);
457
- -o-transform: rotate(0);
458
- -ms-transform: rotate(0);
459
- transform: rotate(0);
460
- }
461
- to {
462
- -webkit-transform: rotate(360deg);
463
- -moz-transform: rotate(360deg);
464
- -o-transform: rotate(360deg);
465
- -ms-transform: rotate(360deg);
466
- transform: rotate(360deg);
467
- }
468
  }
469
 
470
- #astra-sites-filters {
471
- display: inline-block;
472
- width: 100%;
 
473
  }
474
 
475
- .astra-site-down {
476
- padding: 1em 2em;
477
- margin-top: 1em;
 
 
478
  }
479
-
480
- #astra-sites-menu-page .nav-tab-wrapper {
481
- border: none;
482
  }
483
 
484
- #astra-sites-filters .wp-filter {
485
- margin-top: 0;
 
 
 
 
486
  }
487
 
488
- /**
489
- * Welcome Screen
490
- */
491
- .astra-sites-welcome {
492
- padding: 10em 0;
493
- text-align: center;
494
  }
495
- .astra-sites-welcome .inner {
496
- margin: 0 auto;
497
- display: inline-block;
498
- max-width: 700px;
499
- background: #fff;
500
- padding: 3em;
501
  }
502
 
503
- .astra-sites-welcome h1 {
504
- font-size: 2.5em;
505
- margin-bottom: 1em;
 
 
 
 
506
  }
507
 
508
- .astra-sites-welcome p {
509
- font-size: 1rem;
510
  }
511
 
512
- .astra-sites-welcome select {
513
- padding: 5px;
514
- height: 100%;
 
 
 
 
 
515
  }
516
 
517
- .astra-sites-welcome .submit {
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  text-align: center;
519
- margin: 0;
520
- padding: 0;
521
- margin-left: .5em;
 
 
 
 
 
 
 
 
 
 
 
 
522
  }
523
 
524
- .astra-sites-welcome .disabled {
525
- pointer-events: none;
 
 
526
  }
527
 
528
- .astra-site-page-builder {
529
- opacity: 0;
530
- visibility: hidden;
 
 
 
 
 
 
531
  }
532
 
533
- .astra-sites-third-party-required-plugins-wrap .notice {
534
- margin: 0;
535
  }
536
 
537
- .required-plugins-list,
538
- .astra-sites-third-party-required-plugins {
539
- margin-left: 2em;
540
- margin-top: .5em;
541
- margin-bottom: .5em;
542
- list-style-type: disc;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  }
544
 
545
  .astra-sites-third-party-required-plugins .plugin-card,
546
  .required-plugins-list .plugin-card {
547
- background: transparent;
548
- border: none;
549
- margin: 0;
550
- line-height: 2;
551
- float: none;
552
- width: 100%;
553
  }
554
 
555
  .required-plugins-list .spinner {
556
- float: none;
557
- margin: 0;
558
  }
559
 
560
  .astra-site-import-process-wrap {
@@ -563,7 +1327,6 @@ body.loading-content .select-page-builder {
563
  margin-top: -2px;
564
  z-index: 999999;
565
  position: relative;
566
- border-radius: 3px;
567
  overflow: hidden;
568
  }
569
 
@@ -585,7 +1348,8 @@ body.loading-content .select-page-builder {
585
  }
586
 
587
  .astra-sites-result-preview .dashicons {
588
- vertical-align: text-bottom;
 
589
  }
590
 
591
  .astra-site-import-process-wrap progress::-webkit-progress-value {
@@ -596,196 +1360,1455 @@ body.loading-content .select-page-builder {
596
  background: transparent;
597
  }
598
 
599
- .theme-browser .theme .site-preview > .theme-screenshot {
600
- transition: all linear 5s;
601
- background-position: center top;
602
- background-size: cover;
603
- background-repeat: no-repeat;
604
  }
605
- .theme-browser .theme .site-preview > .theme-screenshot:hover {
606
- background-position: center bottom;
607
- background-size: cover;
 
 
 
 
 
608
  }
609
 
610
  .astra-sites-tooltip-icon {
611
- cursor: pointer;
612
  }
613
 
614
  .astra-sites-preview .disabled {
615
- pointer-events: none;
616
  }
617
 
618
  .astra-sites-preview input[type="checkbox"].disabled {
619
- background: #eeeeee;
620
- opacity: 1;
621
- color: #fff;
622
- box-shadow: none;
623
- border-color: #b4b9be;
624
  }
625
 
626
  .astra-sites-tooltip-icon .dashicons {
627
- color: #757575;
628
- font-size: 15px;
629
- vertical-align: middle;
630
- height: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  }
632
 
 
 
 
 
 
 
633
  #astra-sites-welcome-form-inline {
634
- position: absolute;
635
- right: 1em;
636
- top: 0;
637
- border-radius: 0;
638
- line-height: 1.7;
639
- padding: 0px 5px 2px 5px;
640
- outline: 2px solid transparent;
641
- outline-offset: 0;
642
- background: #fafafa;
643
- border: 1px solid #ccc;
644
- color: #72777c;
645
- font-weight: normal;
646
- font-size: 10px;
647
- font-size: 13px;
648
- line-height: 26px;
649
- height: 28px;
650
- cursor: pointer;
651
  }
652
 
653
  #astra-sites-welcome-form-inline select,
654
  #astra-sites-welcome-form-inline select:focus {
655
- border: none;
656
- outline: none;
657
- box-shadow: none;
658
- color: #72777c;
659
  }
660
 
661
  #astra-sites-menu-page .wp-full-overlay-main:before {
662
- content: '';
663
- display: none;
664
  }
665
 
666
  .theme-screenshot-wrap {
667
- overflow: hidden;
668
- max-height: 300px;
669
- margin: 15px 0;
670
- border: 1px solid #ccc;
671
  }
672
 
673
  .astra-sites-preview .install-theme-info .theme-screenshot {
674
- width: 100%;
675
- border: none;
676
- margin: 0;
677
- }
 
 
 
 
 
 
678
 
679
  #astra-sites-welcome-form #submit {
680
- padding: 0em 4rem;
 
 
 
 
681
  }
682
 
683
  .page-builders li {
684
- cursor: pointer;
685
- display: inline-block;
686
- padding: 1em;
687
  }
688
 
689
- .page-builders [type=radio] {
690
- position: absolute;
691
- opacity: 0;
692
- width: 0;
693
- height: 0;
 
 
 
 
 
 
 
694
  }
695
 
696
  .page-builders [type=radio] + img {
697
- cursor: pointer;
698
- opacity: .9;
699
- border: 3px solid transparent;
700
- border-radius: 10px;
701
  transition: all linear 0.2s;
 
 
702
  }
703
 
704
- .page-builders [type=radio]:hover + img,
705
- .page-builders [type=radio]:checked + img {
706
- opacity: 1;
 
707
  }
708
 
709
- .astra-sites-page-builder-notice {
710
- text-align: center;
711
- margin: 1em 0 2em 0;
712
  }
713
 
714
- .current-importing-status-wrap {
715
- font-size: 1rem;
 
 
 
 
 
 
716
  }
717
 
718
- .current-importing-status-wrap hr {
719
- border-color: #f1f1f1;
720
  }
721
 
722
- .astra-sites-result-preview {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
723
  position: absolute;
724
- left: 0;
725
  right: 0;
726
  top: 0;
727
  bottom: 0;
728
- background: #fff;
729
- overflow-y: auto;
 
 
 
 
 
730
  }
731
-
732
- .astra-sites-result-preview .button {
733
- margin-top: 1em;
 
 
 
 
 
 
 
 
 
734
  }
735
-
736
  .astra-sites-result-preview .inner {
737
- margin: 0 auto;
738
- max-width: 700px;
739
- padding: 5em 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
740
  }
741
-
742
- .astra-sites-result-preview h2 {
743
- font-size: 2rem;
744
  }
745
 
746
- .astra-sites-result-preview p {
747
- font-size: 1rem;
748
  }
749
 
750
- .current-importing-status {
751
- font-size: 1rem;
752
- background: #eeeeee;
753
- padding: 1em 1.5em;
754
  }
755
 
756
- .current-importing-status-title {
757
- margin-bottom: .5em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  }
759
 
760
- .appearance_page_astra-sites .rotating {
761
- height: auto;
762
- animation: rotation 2s infinite linear;
763
- width: auto;
764
- color: #c1c1c1;
765
  }
766
 
767
  @-webkit-keyframes rotation {
768
- from {
769
- -webkit-transform: rotate(0deg);
770
- }
771
- to {
772
- -webkit-transform: rotate(359deg);
773
- }
774
  }
775
  .import-time {
776
- display: inline-block;
777
- background: #0185ba;
778
- color: #fff;
779
- padding: 2px 10px;
780
- border-radius: 3px;
781
- animation: astra-scale 0.5s alternate infinite ease-in;
782
  }
783
 
 
 
 
 
 
784
  @keyframes astra-scale {
785
  0% {transform: scale(1);}
786
  100% {transform: scale(1.03);}
787
  }
788
 
789
  .current-importing-status p {
790
- margin: 0;
791
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'icomoon';
3
+ src: url('../fonts/astra-sites.eot?9i8jex');
4
+ src: url('../fonts/astra-sites.eot?9i8jex#iefix') format('embedded-opentype'),
5
+ url('../fonts/astra-sites.ttf?9i8jex') format('truetype'),
6
+ url('../fonts/astra-sites.woff?9i8jex') format('woff'),
7
+ url('../fonts/astra-sites.svg?9i8jex#icomoon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="icon-"], [class*=" icon-"] {
13
+ /* use !important to prevent issues with browser extensions that change fonts */
14
+ font-family: 'icomoon' !important;
15
+ speak: none;
16
+ font-style: normal;
17
+ font-weight: normal;
18
+ font-variant: normal;
19
+ text-transform: none;
20
+ line-height: 1;
21
+
22
+ /* Better Font Rendering =========== */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ }
26
+
27
+ .icon-search:before {
28
+ content: "\e900";
29
+ }
30
+ .icon-heart:before {
31
+ content: "\e901";
32
+ }
33
+ .icon-refresh:before {
34
+ content: "\e902";
35
+ }
36
+ .icon-chevron-left:before {
37
+ content: "\e904";
38
+ }
39
+ .icon-file:before {
40
+ content: "\e903";
41
+ }
42
+ .icon-layers:before {
43
+ content: "\e905";
44
+ }
45
+
46
+ .favorite-filters-wrap a {
47
+ font-size: 1rem;
48
+ }
49
+
50
  .wrap .status,
51
  .wrap .site-type {
52
+ position: absolute;
53
  z-index: 1;
 
 
 
54
  text-transform: uppercase;
55
+ color: #fff;
56
+ top: 15px;
57
+ right: 16px;
58
+ font-size: 10px;
59
+ letter-spacing: .7px;
60
+ font-weight: 500;
61
+ padding: 0.2em .7em;
62
+ border-radius: 4px;
63
  }
64
+
65
+ .astra-sites-autocomplete-result {
66
+ position: absolute;
67
+ top: 46px !important;
68
+ left: 0;
69
+ right: 0;
70
+ bottom: 0;
71
+ }
72
+
73
+ .astra-sites-autocomplete-result .ui-autocomplete {
74
+ text-align: left;
75
+ left: 0 !important;
76
+ right: 0 !important;
77
+ width: calc( 100% - 2px ) !important;
78
+ z-index: 999999;
79
+ top: 0 !important;
80
+ }
81
+
82
+ .ast-white-label-flag {
83
+ opacity: 0;
84
+ visibility: hidden;
85
+ }
86
+
87
+ .single-site-footer .dashicons-editor-help {
88
+ cursor: pointer;
89
+ display: inline-block;
90
+ }
91
+
92
+ .preview-page-from-search-result .astra-sites-import-plugins .dashicons,
93
+ .astra-sites-page-import-popup .astra-sites-import-plugins .dashicons {
94
+ display: none;
95
+ }
96
+ .ast-sites-ps-msg {
97
+ bottom: 10px;
98
+ position: absolute;
99
+ color: #777;
100
+ margin-right: 1em;
101
+ }
102
+ #astra-sites__category-filter {
103
+ display: inline-block;
104
+ }
105
+ #astra-sites__category-filter .astra-sites__category-filter-anchor {
106
+ height: 44px;
107
+ position: relative;
108
+ cursor: pointer;
109
+ display: flex;
110
+ padding: 0 12px 0 12px;
111
+ border: 0;
112
+ width: 97px;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ font-weight: 500;
116
+ border-radius: 6px 0 0 6px;
117
+ }
118
+ #astra-sites__category-filter .astra-sites__category-filter-anchor:after {
119
+ position: absolute;
120
+ content: "";
121
+ border-left: 2px solid #555;
122
+ border-top: 2px solid #555;
123
+ padding: 3px;
124
+ right: 14px;
125
+ top: 38%;
126
+ -moz-transform: rotate(-135deg);
127
+ -ms-transform: rotate(-135deg);
128
+ -o-transform: rotate(-135deg);
129
+ -webkit-transform: rotate(-135deg);
130
+ transform: rotate(-135deg);
131
+ }
132
+ #astra-sites__category-filter .ast-sites__filter-wrap-checkbox.first-wrap {
133
+ padding-top: 15px;
134
+ margin-top: 15px;
135
+ border-top: 1px solid #eee;
136
+ }
137
+ #astra-sites__category-filter ul.astra-sites__category-filter-items {
138
+ display: none;
139
+ margin: 0;
140
+ position: absolute;
141
+ width: 98px;
142
+ top: 40px;
143
+ box-sizing: content-box;
144
+ border: 1px solid #e4e4e4;
145
+ margin-top: 10px;
146
+ min-width: 70px;
147
+ background-color: #fff;
148
+ border-radius: 6px;
149
+ box-shadow: 0 3px 6px rgba(0,0,0,.1);
150
+ padding: 15px;
151
+ -webkit-transform-origin: 50% 0;
152
+ transform-origin: 50% 0;
153
+ -webkit-transition: all .2s ease;
154
+ transition: all .2s ease;
155
+ }
156
+ #astra-sites__category-filter li.ast-sites__filter-wrap.category-active:before {
157
+ content: "✓";
158
+ color: #1E8CBE;
159
+ position: absolute;
160
+ left: -15px;
161
+ font-size: 15px;
162
+ }
163
+
164
+ .astra-sites__category-filter-items label {
165
+ vertical-align: top;
166
+ }
167
+ #astra-sites__category-filter ul.astra-sites__category-filter-items li {
168
+ list-style: none;
169
+ margin-bottom: 8px;
170
+ margin-left: 14px;
171
+ cursor: pointer;
172
+ position: relative;
173
+ font-weight: 500;
174
+ }
175
+ #astra-sites__category-filter ul.astra-sites__category-filter-items li.ast-sites__filter-wrap-checkbox {
176
+ margin-left: 0;
177
+ }
178
+ #astra-sites .astra-theme:hover .inner {
179
+ transform: translate(0, -1px);
180
+ box-shadow: 0 6px 14px 0 rgba(0,0,0,.12)
181
+ }
182
+ #astra-sites .astra-theme .inner {
183
+ position: relative;
184
+ border-radius: 2px;
185
+ overflow: initial;
186
+ border: 1px solid #ddd;
187
+ transition: all 0.4s;
188
+ }
189
+ #single-pages .inner {
190
+ border: 1px solid #e2e2e2;
191
+ transition: all 250ms cubic-bezier(0.02, 0.01, 0.47, 1);
192
+ }
193
+ #single-pages .current_page .inner,
194
+ #single-pages .inner:hover {
195
+ box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
196
+ }
197
+ #astra-sites-admin.wrap .status,
198
+ #astra-sites-admin.wrap .site-type.premium {
199
  background: #0073aa;
200
+ border: 2px solid #ffffff;
201
+ top: 17px;
202
+ right: 18px;
203
  }
204
+ #astra-sites-admin .filter-links .current {
205
+ border-bottom: none;
206
+ color: #23282d;
207
+ }
208
+ #wp-filter-search-input {
209
+ font-weight: 400;
210
+ width: 100%;
211
+ opacity: 1;
212
+ height: 46px;
213
+ background: #fff;
214
+ line-height: 32px;
215
+ border-radius: 0 6px 6px 0;
216
+ font-size: 13px;
217
+ padding: 5px 20px;
218
+ border: 1px solid #DDDDDD;
219
+ border-left: 1px solid #DDDDDD;
220
+ box-shadow: none;
221
+ }
222
+ .appearance_page_starter-templates .search-form:hover,
223
+ .appearance_page_starter-templates .search-form:focus {
224
+ box-shadow: 0 1px 4px 0 rgba(32,33,36,0.18);
225
+ }
226
+ #astra-sites-filters .ui-widget.ui-widget-content {
227
+ border-top-left-radius: 0;
228
+ border-top-right-radius: 0;
229
+ border-bottom-left-radius: 6px;
230
+ border-bottom-right-radius: 6px;
231
+ border: 1px solid rgba(32,33,36,0.18);
232
+ border-top: none;
233
+ overflow: hidden;
234
+ box-shadow: 0 3px 4px 0 rgba(32,33,36,0.18);
235
+ background: transparent;
236
+ padding-top: 10px;
237
+ padding-bottom: 10px;
238
+ background: #fff;
239
+ }
240
+
241
+ #astra-sites-filters .ui-autocomplete li,
242
+ #astra-sites-filters .ui-autocomplete li:focus,
243
+ #astra-sites-filters .ui-autocomplete li:hover {
244
+ outline: none;
245
+ }
246
+ #astra-sites-filters .ui-autocomplete li {
247
+ padding: 3px 20px;
248
+ text-transform: capitalize;
249
+ }
250
+ #astra-sites-filters .ui-autocomplete li:hover {
251
+ background-color: #eeeeee;
252
+ }
253
+ .appearance_page_starter-templates .wp-filter .search-form.searching #astra-sites__category-filter {
254
+ border-bottom-left-radius: 0;
255
+ }
256
+ .searching #wp-filter-search-input {
257
+ border-bottom-right-radius: 0;
258
+ }
259
+ #astra-sites-filters .ui-autocomplete .ui-state-active {
260
+ background: #c0c0c0;
261
+ border-color: #c0c0c0;
262
+ margin: 0;
263
+ }
264
+ #wp-filter-search-input.has-input + .search-icon {
265
+ display: none;
266
+ }
267
+ .appearance_page_starter-templates .search-icon {
268
+ position: absolute;
269
+ top: 0;
270
+ right: 0;
271
+ color: #C3C3C3;
272
+ padding: 15px 19px 12px 12px;
273
+ }
274
+ .appearance_page_starter-templates .search-icon:before {
275
+ vertical-align: middle;
276
+ }
277
+ #astra-sites-admin .filter-links li > a {
278
+ border-bottom: none;
279
+ font-size: 12px;
280
+ padding: 2px 0;
281
+ text-transform: uppercase;
282
+ letter-spacing: 0.3px;
283
+ font-weight: 500;
284
+ }
285
+ #astra-sites-admin .filter-links li > a:focus {
286
+ box-shadow: none;
287
+ }
288
+ #astra-sites-admin .theme-actions {
289
+ box-shadow: none;
290
+ left: 0;
291
+ border-left: none;
292
+ background: #fafafa;
293
+ padding: 0;
294
+ margin-right: 20%;
295
+ }
296
+ .searching .pages-count,
297
+ .searching .page-title {
298
+ display: block;
299
+ }
300
+ .searching .no-pages .theme-name {
301
+ min-height: 36px;
302
  }
303
+ #astra-sites-admin .theme-browser .theme .theme-name {
304
+ height: auto;
305
+ width: 90%;
306
+ align-self: center;
307
+ box-shadow: none;
308
+ background: none;
309
+ padding: 14px 15px;
310
+ font-size: 14px;
311
+ font-weight: 600;
312
+ display: flex;
313
+ align-items: center;
314
+ justify-content: space-between;
315
+ }
316
+ #astra-sites-admin .theme-id-container {
317
+ background: #fff;
318
+ border: none;
319
+ display: flex;
320
+ align-items: center;
321
+ justify-content: center;
322
+ border-bottom-left-radius: 2px;
323
+ border-bottom-right-radius: 2px;
324
+ border-top: 1px solid #eeeeee;
325
+ }
326
+ #astra-sites-admin .sites-page-count {
327
+ color: #888;
328
+ font-size: 12px;
329
+ display: block;
330
+ margin-top: 5px;
331
+ }
332
+ #astra-sites-admin .theme-action-wrap {
333
+ width: 100%;
334
+ padding: 8px 15px;
335
+ }
336
+ .filters-wrap-page-categories {
337
+ margin-right: 10px;
338
+ }
339
+ #astra-sites-admin .favorite-filters-wrap .filter-links a {
340
+ border: none;
341
+ }
342
+ .favorite-filters-wrap .current .dashicons {
343
+ color: #c34444;
344
+ }
345
+ .favorite-filters-wrap .dashicons {
346
+ color: #71777c;
347
+ font-size: 18px;
348
+ line-height: 18px;
349
+ width: 17px;
350
+ height: 17px;
351
+ }
352
+ .theme-browser .theme:hover,
353
+ .theme-browser .theme:focus {
354
+ cursor: initial;
355
+ }
356
+ .theme-browser .theme .inner:hover,
357
+ .theme-browser .theme .inner:focus {
358
+ cursor: pointer;
359
+ }
360
+
361
+ .searching .theme-browser .theme .inner:hover .type {
362
+ opacity: 1;
363
+ visibility: visible;
364
+ }
365
+
366
+ .astra-sites-sync-library-button.updating-message {
367
+ animation: rotation 2s infinite linear;
368
  }
369
 
370
+ .astra-sites-sync-library,
371
+ .favorite-filters-title {
372
+ width: 10%;
373
+ padding: 15px 5px;
374
+ align-self: center;
375
+ justify-content: center;
376
+ text-align: center;
377
+ margin-left: 5px;
378
+ }
379
+ .astra-sites-sync-library a,
380
+ .favorite-filters-title a {
381
+ color: #666;
382
+ cursor: pointer;
383
+ }
384
+
385
+ .favorite-action-wrap {
386
+ padding-right: 15px;
387
+ padding-left: 10px;
388
+ }
389
+
390
+ .favorite-action-wrap i {
391
+ color: #666666;
392
+ height: 18px;
393
+ width: 18px;
394
+ font-size: 16px;
395
+ line-height: 1.5;
396
+ transition-property: border, background, color;
397
+ transition-duration: .05s;
398
+ transition-timing-function: ease-in-out;
399
+ }
400
+ .theme-id-container .icon-star {
401
+ padding: 0 15px 0 0;
402
+ }
403
+ .wrap .status {
404
+ left: -0.5em;
405
+ }
406
  .wrap .status.publish,
407
  .wrap .site-type.free {
408
+ display: none;
409
+ }
410
+
411
+ .astra-sites-activate-license .astra-sites-import-content,
412
+ .astra-sites-get-agency-bundle .astra-sites-import-content {
413
+ height: auto;
414
+ }
415
+ .astra-sites-import-content {
416
+ display: block;
417
+ padding: 10px 35px 20px 35px;
418
+ background: #f1f3f5;
419
+ height: 200px;
420
+ overflow: auto;
421
+ position: relative;
422
+ }
423
+
424
+ .astra-sites-activate-license .astra-sites-import-content {
425
+ padding: 20px 35px 30px 35px;
426
+ }
427
+
428
+ .astra-sites-import-content .install-theme-info {
429
+ display: block;
430
+ padding: 0;
431
  }
432
 
433
  .install-theme-info .site-type {
434
+ display: none;
435
  }
436
 
437
  .theme {
438
+ position: relative;
439
  }
440
  .wrap .astra-sites-preview .site-type.premium {
441
+ display: block;
442
+ display: none;
443
+ position: relative;
444
+ margin: 0.5em 0em 1em 0em;
445
+ top: 0;
446
+ left: 0;
447
+ text-align: center;
448
  }
449
 
450
  .theme-details-read-more.open {
451
+ margin: 0.5em 0 0 0;
452
  }
453
 
454
  .astra-sites-preview .theme-screenshot {
455
+ width: 100%;
456
  }
457
 
458
  .install-theme-info .site-type.premium {
459
+ display: none;
460
  }
461
 
462
  /**
463
  * Required Plugins
464
  */
465
  .required-plugins.loading {
466
+ text-align: center;
467
  }
468
  .required-plugins button {
469
+ float: right;
470
  }
471
  .required-plugins .plugin-card {
472
+ float: none;
473
+ width: 100%;
474
+ border: none;
475
+ margin: 0 0 0.8em 0;
476
+ display: flex;
477
+ justify-content: space-between;
478
+ align-items: center;
479
+ transition: background ease 0.8s;
480
  }
481
  .required-plugins .plugin-card.plugin-card-update-failed {
482
+ flex-wrap: wrap;
483
  }
484
  .required-plugins .spinner {
485
+ float: none;
486
+ margin: 0;
487
  }
488
 
489
  .expanded .wp-full-overlay-footer {
490
+ height: 111px;
491
  }
492
 
493
  .wp-full-overlay-footer .view-site,
494
  .wp-full-overlay-footer .go-pro,
495
  .wp-full-overlay-footer .astra-demo-import {
496
+ width: 100%;
497
+ text-align: center;
498
  }
499
 
500
  .wp-core-ui .wp-full-overlay-footer .button.button-hero,
501
  .wp-core-ui .wp-full-overlay-footer .button-group.button-hero .button {
502
+ padding: 0 10px 1px;
503
  }
504
 
505
  .wp-full-overlay-footer .installing:before {
506
+ vertical-align: text-bottom;
507
  }
508
 
509
  .astra-sites-advanced-options-wrap h4 {
510
+ margin: 1em 0 0.5em 0;
511
+ padding: 0.5em 0;
512
+ transition: all ease 0.3s;
513
  }
514
 
515
  /**
517
  */
518
  .wp-core-ui .theme-details-read-more:focus,
519
  .wp-core-ui .theme-details-read-more:hover {
520
+ outline: none;
521
+ box-shadow: none;
522
  }
523
  .wp-core-ui .theme-details-read-more {
524
+ margin: 10px 0;
525
+ display: none;
526
+ text-decoration: none;
527
  }
528
 
529
  /**
530
  * Go pro.
531
  */
532
  .wp-core-ui .go-pro.button[disabled] {
533
+ background-color: #fcb92c !important;
534
+ color: white !important;
535
+ box-shadow: 1px 0 #eab23a !important;
536
+ text-shadow: 1px 0 #6b4e13 !important;
537
+ border-color: #e2a932 !important;
538
+ cursor: pointer;
539
  }
540
  .wp-core-ui .view-site .dashicons,
541
  .wp-core-ui .go-pro .dashicons {
542
+ font-size: 1rem;
543
+ vertical-align: middle;
544
  }
545
 
546
  /**
547
  * Errors
548
  */
549
  .plugin-card-update-failed .notice {
550
+ margin-top: 1.5em;
551
  }
552
 
553
  .no-themes {
554
+ margin-top: 40px;
555
  }
556
 
557
  .no-themes p {
558
+ font-size: 15px;
559
  }
560
 
561
  .no-themes .left-margin {
562
+ margin-left: 30px;
563
  }
564
 
565
  /**
566
  *
567
  */
568
  .astra-sites-preview .wp-full-overlay-sidebar-content {
569
+ bottom: 100px;
570
  }
571
 
572
  .footer-import-button-wrap {
573
+ padding: 10px 20px;
574
  }
575
 
576
  .footer-import-button-wrap .button {
577
+ margin: 0;
578
  }
579
 
580
  .astra-sites-preview.expanded .wp-full-overlay-footer {
585
  * Menu Page
586
  */
587
  .astra-sites-title {
588
+ float: left;
589
+ font-size: 20px;
590
  font-weight: 400;
591
+ margin: 0;
592
  padding: 0;
593
+ color: #444;
594
+ }
595
+
596
+ #astra-sites-admin #single-pages .site-single .theme-name {
597
+ font-weight: 500;
598
+ font-size: 13px;
599
+ padding: 8px 14px;
600
+ background: #fff;
601
+ }
602
+
603
+ .astra-sites-logo-wrap {
604
+ width: 42px;
605
+ height: 42px;
606
  }
607
 
608
+ .astra-sites-logo-wrap a,
609
+ .astra-sites-logo-wrap img {
610
+ width: inherit;
611
+ height: inherit;
612
+ display: inline-block;
613
  }
614
 
615
  /**
616
  * API Error
617
  */
618
  .astra-api-error {
619
+ margin: 0 0 0.5em 0;
620
  }
621
 
622
  /**
623
  * Grid
624
  */
625
+ .appearance_page_starter-templates .wp-filter .search-form {
626
+ margin-left: 1em;
627
+ position: relative;
628
+ display: flex;
629
+ border-bottom: 1px solid #ccc;
630
+ }
631
+ .appearance_page_starter-templates .wp-filter .search-form #astra-sites__category-filter {
632
+ border: 1px solid #DDDDDD;
633
+ border-right: 0;
634
+ border-radius: 6px 0 0 6px;
635
+ }
636
+ .appearance_page_starter-templates .wp-filter .search-form input[type="search"] {
637
+ width: 20px;
638
+ font-size: 13px;
639
+ padding: 5px 10px;
640
+ opacity: 0;
641
+ -webkit-transition: width ease 0.3s;
642
+ -moz-transition: width ease 0.3s;
643
+ transition: width ease 0.3s;
644
  }
645
  .filter-count {
646
+ min-width: 3em;
647
+ margin-right: 14px;
648
  }
649
  .astra-site-preview-on {
650
+ overflow: hidden;
 
 
 
 
 
 
 
651
  }
652
 
653
  .filters-wrap {
654
+ display: inline-block;
655
  }
656
  .spinner-wrap {
657
+ text-align: center;
658
  }
659
  .spinner-wrap .spinner {
660
+ float: none;
661
  }
662
  .hide-me {
663
+ display: none !important;
664
  }
665
+ #site-pages {
666
+ position: fixed;
667
+ left: 0;
668
+ right: 0;
669
+ margin: 0 20px 0 195px;
670
+ z-index: 10;
671
  }
672
+
673
+ .folded #site-pages {
674
+ margin-left: 73px;
675
+ }
676
+
677
  .install-theme-info > .notice {
678
+ margin: 5px 0 10px 0;
679
  }
680
 
681
  .astra-sites-suggestions:before {
682
+ border: 5px dashed #ccc;
683
+ position: absolute;
684
+ left: 0;
685
+ right: 0;
686
+ top: 0;
687
+ bottom: 0px;
688
  }
689
 
690
  .astra-sites-suggestions {
691
+ min-height: 390px;
692
+ border: none !important;
693
  }
694
 
695
  .astra-sites-suggestions a {
696
+ border: none;
697
+ outline: none;
698
  }
699
 
700
  .astra-sites-suggestions .inner {
701
+ border: 6px solid #ffffff !important;
702
+ background: #f1f1f1;
703
+ color: #63676b;
704
+ padding: 58% 10% 80% 10%;
705
+ text-align: center;
706
+ position: absolute;
707
+ left: 0;
708
+ right: 0;
709
+ top: 0;
710
+ bottom: 0;
711
+ cursor: auto;
712
  }
713
 
714
  .astra-sites-suggestions .inner a {
715
+ color: #00b9eb;
716
  }
717
 
718
  .astra-sites-suggestions p {
719
+ font-size: 1rem;
720
+ margin: 0;
721
  }
722
 
723
  .astra-notice {
724
+ margin: 2em 2em 0em 0em;
725
  }
726
 
727
  .no-themes .description {
728
+ display: block;
729
  }
730
 
731
  /**
733
  */
734
  .astra-sites-preview .wp-full-overlay-footer .devices button.active:before,
735
  .astra-sites-preview .wp-full-overlay-footer .devices button:hover:before {
736
+ color: #0073aa;
737
  }
738
  .astra-sites-preview .wp-full-overlay-footer .devices button:before {
739
+ color: #c1c1c1;
740
  }
741
  .astra-sites-preview .wp-full-overlay-footer .devices button:hover {
742
+ background-color: transparent;
743
  }
744
  .astra-sites-preview .wp-full-overlay-footer .devices button {
745
+ border: none;
746
  }
747
  .astra-sites-preview .wp-full-overlay-footer .devices button:focus,
748
  .astra-sites-preview .wp-full-overlay-footer .devices button.active:hover {
749
+ border-bottom-color: transparent;
750
+ background-color: transparent;
751
  }
752
  .not-click-able {
753
+ pointer-events: none !important;
754
  }
755
  body.page-builder-selected .select-page-builder,
756
  body.loading-content .select-page-builder {
757
+ display: none;
758
  }
759
  .select-page-builder .up-arrow {
760
+ -webkit-transform: rotate(90deg);
761
+ -moz-transform: rotate(90deg);
762
+ -ms-transform: rotate(90deg);
763
+ transform: rotate(90deg);
764
+ display: inline-block;
765
+ font-size: 1.5em;
766
+ color: #797979;
767
+ vertical-align: middle;
768
+ margin-right: 10px;
769
+ -webkit-transition: all linear 0.6s;
770
+ -moz-transition: all linear 0.6s;
771
+ -ms-transition: all linear 0.6s;
772
+ transition: all linear 0.6s;
773
+ -webkit-animation-duration: 1s;
774
+ animation-duration: 1s;
775
+ -webkit-animation-fill-mode: both;
776
+ animation-fill-mode: both;
777
+ -webkit-animation-timing-function: ease-in-out;
778
+ animation-timing-function: ease-in-out;
779
+ animation-iteration-count: infinite;
780
+ -webkit-animation-iteration-count: infinite;
781
+ animation-name: bounce;
782
+ -moz-animation-name: bounce;
783
  }
784
  .select-page-builder {
785
+ margin-left: 6em;
786
  }
787
 
788
  .select-page-builder img {
789
+ max-width: 100%;
790
  }
791
 
792
  .select-page-builder .note-wrap {
793
+ position: absolute;
794
+ padding: 40px 0;
795
+ margin-left: 170px;
796
+ right: 0;
797
+ left: 0;
798
  }
799
 
800
  .select-page-builder h3 {
801
+ margin: 0;
802
+ font-size: 2em;
803
  }
804
  .select-page-builder {
805
+ margin: -20px 0 0 -5px;
806
+ position: absolute;
807
  }
808
  .select-page-builder .note {
809
+ margin-left: 1.5em;
810
  }
811
 
812
  @keyframes bounce {
815
  20%,
816
  50%,
817
  80% {
818
+ -webkit-transform: translateY(-0px) rotate(90deg);
819
+ -moz-transform: translateY(-0px) rotate(90deg);
820
+ -ms-transform: translateY(-0px) rotate(90deg);
821
+ transform: translateY(-0px) rotate(90deg);
822
  }
823
  40% {
824
+ -webkit-transform: translateY(-2px) rotate(90deg);
825
+ -moz-transform: translateY(-2px) rotate(90deg);
826
+ -ms-transform: translateY(-2px) rotate(90deg);
827
+ transform: translateY(-2px) rotate(90deg);
828
  }
829
  60% {
830
+ -webkit-transform: translateY(-1px) rotate(90deg);
831
+ -moz-transform: translateY(-1px) rotate(90deg);
832
+ -ms-transform: translateY(-1px) rotate(90deg);
833
+ transform: translateY(-1px) rotate(90deg);
834
  }
835
  }
836
 
838
  * Processing Animation
839
  */
840
  .astra-demo-import.disabled {
841
+ pointer-events: none;
842
  }
843
  .astra-demo-import.button.updating-message:before,
844
  .astra-demo-import.button.installing:before {
845
+ -webkit-animation: cssAnimation .72s ease infinite;
846
+ -moz-animation: cssAnimation .72s ease infinite;
847
+ -o-animation: cssAnimation .72s ease infinite;
848
+ -ms-animation: cssAnimation .72s ease infinite;
849
+ animation: cssAnimation .72s ease infinite;
850
  }
851
 
852
  @-webkit-keyframes cssAnimation {
853
+ from {
854
+ -webkit-transform: rotate(0);
855
+ -moz-transform: rotate(0);
856
+ -o-transform: rotate(0);
857
+ -ms-transform: rotate(0);
858
+ transform: rotate(0);
859
+ }
860
+ to {
861
+ -webkit-transform: rotate(360deg);
862
+ -moz-transform: rotate(360deg);
863
+ -o-transform: rotate(360deg);
864
+ -ms-transform: rotate(360deg);
865
+ transform: rotate(360deg);
866
+ }
867
  }
868
  @-moz-keyframes cssAnimation {
869
+ from {
870
+ -webkit-transform: rotate(0);
871
+ -moz-transform: rotate(0);
872
+ -o-transform: rotate(0);
873
+ -ms-transform: rotate(0);
874
+ transform: rotate(0);
875
+ }
876
+ to {
877
+ -webkit-transform: rotate(360deg);
878
+ -moz-transform: rotate(360deg);
879
+ -o-transform: rotate(360deg);
880
+ -ms-transform: rotate(360deg);
881
+ transform: rotate(360deg);
882
+ }
883
  }
884
  @-o-keyframes cssAnimation {
885
+ from {
886
+ -webkit-transform: rotate(0);
887
+ -moz-transform: rotate(0);
888
+ -o-transform: rotate(0);
889
+ -ms-transform: rotate(0);
890
+ transform: rotate(0);
891
+ }
892
+ to {
893
+ -webkit-transform: rotate(360deg);
894
+ -moz-transform: rotate(360deg);
895
+ -o-transform: rotate(360deg);
896
+ -ms-transform: rotate(360deg);
897
+ transform: rotate(360deg);
898
+ }
899
  }
900
 
901
+ #astra-sites-filters .wp-filter {
902
+ display: flex;
903
+ justify-content: space-between;
904
+ align-items: center;
905
  }
906
 
907
+ .astra-pages-title {
908
+ color: #9e9e9e;
909
+ text-decoration: none;
910
+ font-weight: 500;
911
+ position: relative;
912
  }
913
+ .single-site-pages-header .count {
914
+ opacity: 0.7;
 
915
  }
916
 
917
+ .single-site-pages-header .astra-site-title {
918
+ font-size: 22px;
919
+ }
920
+ .astra-site-down {
921
+ padding: 1em 2em;
922
+ margin-top: 1em;
923
  }
924
 
925
+ #astra-sites-menu-page .menu {
926
+ padding: 0;
 
 
 
 
927
  }
928
+
929
+ .astra-sites-nav-items a:hover,
930
+ .astra-sites-nav-items a:focus {
931
+ outline: none;
932
+ border: none;
933
+ box-shadow: none;
934
  }
935
 
936
+ .astra-sites-nav-items a {
937
+ background: #f1f1f1;
938
+ color: #4e555d;
939
+ font-size: 14px;
940
+ text-decoration: none;
941
+ padding: 21px 20px 24px 43px;
942
+ font-weight: 500;
943
  }
944
 
945
+ .astra-sites-nav-items a:before {
946
+ content: "\f105";
947
  }
948
 
949
+ #astra-sites-filters .search-form {
950
+ font-weight: normal;
951
+ border: none;
952
+ margin: 0;
953
+ border-radius: 6px;
954
+ display: flex;
955
+ align-items: center;
956
+ height: 46px;
957
  }
958
 
959
+ .astra-sites-nav-items a:before {
960
+ font-family: dashicons;
961
+ display: inline-block;
962
+ line-height: 1;
963
+ font-weight: 400;
964
+ font-style: normal;
965
+ speak: none;
966
+ text-decoration: inherit;
967
+ text-transform: none;
968
+ text-rendering: auto;
969
+ -webkit-font-smoothing: antialiased;
970
+ -moz-osx-font-smoothing: grayscale;
971
+ font-size: 17px;
972
+ vertical-align: top;
973
  text-align: center;
974
+ transition: color 0.1s ease-in;
975
+ position: absolute;
976
+ margin-left: -22px;
977
+ font-weight: normal;
978
+ }
979
+ .nav-tab-wrapper .button {
980
+ height: 30px;
981
+ }
982
+ .back-to-layout:before {
983
+ background: #fff;
984
+ color: #777;
985
+ padding: 3px;
986
+ border-radius: 100%;
987
+ font-size: 13px;
988
+ border: 1px solid #777;
989
  }
990
 
991
+ .back-to-layout:hover:before {
992
+ background: #f7f7f7;
993
+ border-color: #0073aa;
994
+ color: #0073aa;
995
  }
996
 
997
+ .back-to-layout {
998
+ border-right: 1px solid #eeeeee;
999
+ padding: 20px 14px;
1000
+ text-align: center;
1001
+ cursor: pointer;
1002
+ visibility: hidden;
1003
+ opacity: 0;
1004
+ font-size: 24px;
1005
+ line-height: normal;
1006
  }
1007
 
1008
+ .back-to-layout:hover {
1009
+ background-color: #f7f7f7;
1010
  }
1011
 
1012
+ .astra-sites-no-search-result .back-to-layout,
1013
+ .astra-sites-showing-favorites .back-to-layout,
1014
+ .astra-previewing-single-pages .back-to-layout {
1015
+ visibility: visible;
1016
+ opacity: 1;
1017
+ }
1018
+ .logo {
1019
+ cursor: pointer;
1020
+ }
1021
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
1022
+ border-right: 1px solid #dddddd;
1023
+ padding: 13px 20px 14px 20px;
1024
+ }
1025
+ #astra-sites-menu-page .nav-tab-wrapper .logo,
1026
+ #astra-sites-menu-page .form {
1027
+ display: flex;
1028
+ align-items: center;
1029
+ }
1030
+
1031
+ #astra-sites-menu-page .nav-tab-wrapper {
1032
+ display: flex;
1033
+ justify-content: space-between;
1034
+ border: none;
1035
+ background: #fff;
1036
+ padding: 0;
1037
+ align-items: center;
1038
+ box-shadow: 25px 0 30px rgba(28, 39, 60, 0.09);
1039
+ border-bottom: 1px solid #dddddd;
1040
+ position: fixed;
1041
+ top: 32px;
1042
+ right: 0;
1043
+ left: 0;
1044
+ margin-left: 160px;
1045
+ z-index: 88;
1046
+ }
1047
+ .theme-name .title,
1048
+ .theme-name .type {
1049
+ transition: all 0.4s linear;
1050
+ }
1051
+ .searching .theme-name .type {
1052
+ padding: 4px 8px;
1053
+ }
1054
+ .theme-name .type {
1055
+ font-size: 12px;
1056
+ opacity: 0;
1057
+ visibility: hidden;
1058
+ color: #555;
1059
+ border: 1px solid #cccccc;
1060
+ background: #f7f7f7;
1061
+ vertical-align: top;
1062
+ border-radius: 2px;
1063
+ font-weight: normal;
1064
+ }
1065
+ .theme-name .type .dashicons {
1066
+ font-size: 16px;
1067
+ }
1068
+ .favorite-filters-wrap {
1069
+ border-right: 1px solid #dddddd;
1070
+ padding: 10px;
1071
+ }
1072
+
1073
+ .header-actions a {
1074
+ text-decoration: none;
1075
+ font-size: 18px;
1076
+ line-height: 1;
1077
+ height: 15px;
1078
+ width: 18px;
1079
+ }
1080
+ .header-actions .filter-links li > a:hover,
1081
+ .header-actions .filter-links li > a:focus {
1082
+ outline: none;
1083
+ }
1084
+ .filter-links li > .astra-sites-show-favorite-button.current:hover,
1085
+ .filter-links li > .astra-sites-show-favorite-button.current,
1086
+ .filter-links li > .astra-sites-show-favorite-button:hover,
1087
+ .filter-links li > .astra-sites-show-favorite-button:focus,
1088
+ .astra-sites-show-favorite-button.active {
1089
+ color: transparent;
1090
+ }
1091
+ .filter-links li > .astra-sites-show-favorite-button.current:hover .icon-heart,
1092
+ .filter-links li > .astra-sites-show-favorite-button.current .icon-heart,
1093
+ .filter-links li > .astra-sites-show-favorite-button:hover .icon-heart,
1094
+ .astra-sites-show-favorite-button.active .icon-heart {
1095
+ color: #c34444;
1096
+ }
1097
+
1098
+ .icon-heart {
1099
+ color: #666;
1100
+ }
1101
+ .header-actions a:focus {
1102
+ box-shadow: none;
1103
+ }
1104
+ #astra-sites-filters {
1105
+ flex: 1;
1106
+ }
1107
+
1108
+ #astra-sites-filters .wp-filter {
1109
+ margin-top: 0;
1110
+ justify-content: center;
1111
+ box-shadow: none;
1112
+ border: none;
1113
+ margin-bottom: 0;
1114
+ background: transparent;
1115
+ padding: 0;
1116
+ }
1117
+
1118
+ .is-favorite .favorite-action-wrap i {
1119
+ color : #c34444;
1120
+ }
1121
+
1122
+ .astra-sites-no-sites,
1123
+ .astra-sites-no-favorites {
1124
+ padding: 7em 0;
1125
+ }
1126
+
1127
+ .astra-sites-no-sites h3,
1128
+ .astra-sites-no-favorites h3 {
1129
+ font-size: 1.3rem;
1130
+ font-weight: normal;
1131
+ margin-top: 0;
1132
+ text-align: center;
1133
+ margin-bottom: 3em;
1134
+ color: #666;
1135
+ }
1136
+
1137
+ .astra-sites-no-sites .back-to-layout-button {
1138
+ margin-top: 25px;
1139
+ }
1140
+
1141
+ .back-to-layout-button {
1142
+ margin-top: 15px;
1143
+ }
1144
+
1145
+ .empty-collection-part {
1146
+ width: 220px;
1147
+ }
1148
+
1149
+ .astra-sites-no-sites .arrow-img,
1150
+ .astra-sites-no-favorites .arrow-img {
1151
+ width: 56px;
1152
+ margin-bottom: 1em;
1153
+ transform: rotate(-18deg);
1154
+ }
1155
+
1156
+ .astra-sites-no-sites .content,
1157
+ .astra-sites-no-favorites .content {
1158
+ display: flex;
1159
+ align-items: center;
1160
+ }
1161
+
1162
+ .astra-sites-no-sites .description,
1163
+ .astra-sites-no-favorites .description {
1164
+ margin-left: 3em;
1165
+ }
1166
+
1167
+ .astra-sites-no-sites .inner,
1168
+ .astra-sites-no-favorites .inner {
1169
+ margin: 0 auto;
1170
+ width: 610px;
1171
+ }
1172
+
1173
+ /**
1174
+ * Welcome Screen
1175
+ */
1176
+ .astra-sites-welcome {
1177
+ position: relative;
1178
+ max-height: 100vh;
1179
+ height: calc( 100vh - 32px );
1180
+ }
1181
+ .appearance_page_starter-templates.astra-sites-change-page-builder #wpbody-content {
1182
+ padding: 0;
1183
+ }
1184
+ .astra-sites-welcome a {
1185
+ text-decoration: none;
1186
+ color: inherit;
1187
+ }
1188
+ .astra-sites-welcome a:focus,
1189
+ .astra-sites-welcome a {
1190
+ outline: none;
1191
+ box-shadow: none;
1192
+ }
1193
+ .astra-sites-welcome .header img {
1194
+ width: 30px;
1195
+ }
1196
+ .astra-sites-welcome .logo {
1197
+ display: flex;
1198
+ align-items: center;
1199
+ cursor: default;
1200
+ }
1201
+ .astra-sites-welcome .close {
1202
+ position: absolute;
1203
+ right: 0;
1204
+ top: 0;
1205
+ bottom: 0;
1206
+ width: 20px;
1207
+ text-align: center;
1208
+ padding: 15px;
1209
+ cursor: pointer;
1210
+ border-left: 1px solid #eee;
1211
+ color: #aaa;
1212
+ }
1213
+
1214
+ .astra-sites-welcome .close:hover {
1215
+ color: #0073aa;
1216
+ }
1217
+
1218
+ .astra-sites-welcome .close .dashicons {
1219
+ height: auto;
1220
+ width: auto;
1221
+ vertical-align: middle;
1222
+ font-size: 22px;
1223
+ }
1224
+
1225
+ .astra-sites-welcome .header {
1226
+ text-align: left;
1227
+ padding: 10px 15px;
1228
+ display: flex;
1229
+ align-items: center;
1230
+ border-bottom: 1px solid #e5e5e5;
1231
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
1232
+ justify-content: space-between;
1233
+ position: relative;
1234
+ }
1235
+ .astra-sites-welcome .header .title {
1236
+ margin: 0 0 0 10px;
1237
+ font-size: 13px;
1238
+ text-transform: uppercase;
1239
+ }
1240
+ .ast-importing-wrap {
1241
+ display: none;
1242
+ }
1243
+ .astra-sites-welcome .inner-wrap {
1244
+ position: absolute;
1245
+ left: 50%;
1246
+ top: 40%;
1247
+ transform: translate(-50%, -40%);
1248
+ border-radius: 2px;
1249
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
1250
+ border: 1px solid #e5e5e5;
1251
+ overflow: hidden;
1252
+ }
1253
+ .astra-sites-welcome .inner {
1254
+ vertical-align: middle;
1255
+ margin: 0 auto;
1256
+ display: inline-block;
1257
+ width: 750px;
1258
+ background: #fff;
1259
+ text-align: center;
1260
+ }
1261
+
1262
+ .astra-sites-welcome h1 {
1263
+ margin-top: 0;
1264
+ font-size: 2em;
1265
+ margin-bottom: 1em;
1266
+ }
1267
+
1268
+ .astra-sites-welcome p {
1269
+ font-size: 14px;
1270
+ }
1271
+
1272
+ #astra-sites-welcome-form {
1273
+ padding: 6em 4em 2em 4em;
1274
+ }
1275
+
1276
+ .astra-sites-welcome select {
1277
+ padding: 5px;
1278
+ height: 100%;
1279
+ }
1280
+
1281
+ .astra-sites-welcome .submit {
1282
+ text-align: center;
1283
+ margin: 0;
1284
+ padding: 0;
1285
+ margin-left: .5em;
1286
+ }
1287
+
1288
+ .astra-sites-welcome .disabled {
1289
+ pointer-events: none;
1290
+ }
1291
+
1292
+ .astra-site-page-builder {
1293
+ opacity: 0;
1294
+ visibility: hidden;
1295
+ }
1296
+
1297
+ .required-plugins-list,
1298
+ .astra-sites-third-party-required-plugins {
1299
+ margin-left: 16px;
1300
+ margin-top: .5em;
1301
+ margin-bottom: .5em;
1302
+ list-style-type: disc;
1303
+ }
1304
+
1305
+ .astra-sites-tooltip-message {
1306
+ margin-left: 24px;
1307
  }
1308
 
1309
  .astra-sites-third-party-required-plugins .plugin-card,
1310
  .required-plugins-list .plugin-card {
1311
+ background: transparent;
1312
+ border: none;
1313
+ margin: 0;
1314
+ line-height: 2;
1315
+ float: none;
1316
+ width: 100%;
1317
  }
1318
 
1319
  .required-plugins-list .spinner {
1320
+ float: none;
1321
+ margin: 0;
1322
  }
1323
 
1324
  .astra-site-import-process-wrap {
1327
  margin-top: -2px;
1328
  z-index: 999999;
1329
  position: relative;
 
1330
  overflow: hidden;
1331
  }
1332
 
1348
  }
1349
 
1350
  .astra-sites-result-preview .dashicons {
1351
+ vertical-align: middle;
1352
+ font-size: 1rem;
1353
  }
1354
 
1355
  .astra-site-import-process-wrap progress::-webkit-progress-value {
1360
  background: transparent;
1361
  }
1362
 
1363
+ .theme-browser .theme .theme-screenshot {
1364
+ filter: blur(0);
1365
+ transition: filter 400ms linear;
 
 
1366
  }
1367
+ .theme-browser .theme .site-preview > .theme-screenshot {
1368
+ background-position: center top;
1369
+ background-size: 100%;
1370
+ background-repeat: no-repeat;
1371
+ border-top-left-radius: 2px;
1372
+ border-top-right-radius: 2px;
1373
+ overflow: hidden;
1374
+ background-color: #e5e5e5;
1375
  }
1376
 
1377
  .astra-sites-tooltip-icon {
1378
+ cursor: pointer;
1379
  }
1380
 
1381
  .astra-sites-preview .disabled {
1382
+ pointer-events: none;
1383
  }
1384
 
1385
  .astra-sites-preview input[type="checkbox"].disabled {
1386
+ background: #eeeeee;
1387
+ opacity: 1;
1388
+ color: #fff;
1389
+ box-shadow: none;
1390
+ border-color: #b4b9be;
1391
  }
1392
 
1393
  .astra-sites-tooltip-icon .dashicons {
1394
+ color: #757575;
1395
+ font-size: 15px;
1396
+ vertical-align: middle;
1397
+ height: auto;
1398
+ }
1399
+ #astra-sites-admin {
1400
+ margin-right: 25px;
1401
+ margin-left: 25px;
1402
+ margin-top: 40px;
1403
+ }
1404
+ .astra-previewing-single-pages #wpfooter {
1405
+ display: none;
1406
+ }
1407
+ .astra-previewing-single-pages #astra-sites-admin {
1408
+ margin-top: 115px;
1409
+ }
1410
+ #astra-sites-welcome-form-inline select {
1411
+ text-align-last: right;
1412
  }
1413
 
1414
+ #astra-sites-welcome-form-inline option {
1415
+ direction: rtl;
1416
+ }
1417
+ #astra-sites-admin .filter-links li > a:first-child {
1418
+ margin-left: 0;
1419
+ }
1420
  #astra-sites-welcome-form-inline {
1421
+ margin-left: 0;
1422
+ border-radius: 3px;
1423
+ padding: 0px 5px 2px 5px;
1424
+ outline: 2px solid transparent;
1425
+ outline-offset: 0;
1426
+ background: #ffffff;
1427
+ color: #72777c;
1428
+ font-weight: normal;
1429
+ font-size: 13px;
1430
+ line-height: 26px;
1431
+ height: 28px;
1432
+ cursor: pointer;
 
 
 
 
 
1433
  }
1434
 
1435
  #astra-sites-welcome-form-inline select,
1436
  #astra-sites-welcome-form-inline select:focus {
1437
+ border: none;
1438
+ outline: none;
1439
+ box-shadow: none;
1440
+ color: #72777c;
1441
  }
1442
 
1443
  #astra-sites-menu-page .wp-full-overlay-main:before {
1444
+ content: '';
1445
+ display: none;
1446
  }
1447
 
1448
  .theme-screenshot-wrap {
1449
+ overflow: hidden;
1450
+ max-height: 300px;
1451
+ margin: 15px 0;
1452
+ border: 1px solid #ccc;
1453
  }
1454
 
1455
  .astra-sites-preview .install-theme-info .theme-screenshot {
1456
+ width: 100%;
1457
+ border: none;
1458
+ margin: 0;
1459
+ }
1460
+
1461
+ #astra-sites-welcome-form .title {
1462
+ font-size: 14px;
1463
+ font-weight: 500;
1464
+ margin-top: 5px;
1465
+ }
1466
 
1467
  #astra-sites-welcome-form #submit {
1468
+ padding: 0em 4rem;
1469
+ }
1470
+
1471
+ .page-builders {
1472
+ margin: 35px 0;
1473
  }
1474
 
1475
  .page-builders li {
1476
+ cursor: pointer;
1477
+ display: inline-block;
1478
+ padding: 1.2em;
1479
  }
1480
 
1481
+ .page-builders [type=radio] {
1482
+ position: absolute;
1483
+ opacity: 0;
1484
+ width: 0;
1485
+ height: 0;
1486
+ }
1487
+
1488
+ .page-builders [type=radio] + img.active,
1489
+ .page-builders [type=radio] + img:hover {
1490
+ transform: translateY(-1px);
1491
+ box-shadow: 0 2px 6px rgba(0, 115, 170, 0.18);
1492
+ border-color: #0073aa;
1493
  }
1494
 
1495
  .page-builders [type=radio] + img {
1496
+ cursor: pointer;
1497
+ border: 1px solid #dcdcdc;
1498
+ border-radius: 4px;
 
1499
  transition: all linear 0.2s;
1500
+ height: 100px;
1501
+ padding: 6px;
1502
  }
1503
 
1504
+ .astra-demo-import.button.updating-message:before,
1505
+ .astra-demo-import.button.installing:before {
1506
+ vertical-align: text-top;
1507
+ margin: 0 5px 0 0;
1508
  }
1509
 
1510
+ .current-importing-status-wrap hr {
1511
+ border-color: #f1f1f1;
 
1512
  }
1513
 
1514
+ .astra-sites-result-preview {
1515
+ position: absolute;
1516
+ left: 0;
1517
+ right: 0;
1518
+ top: 0;
1519
+ bottom: 0;
1520
+ background: #fff;
1521
+ overflow-y: auto;
1522
  }
1523
 
1524
+ .astra-sites-result-preview .button {
1525
+ margin-top: 1em;
1526
  }
1527
 
1528
+ .preview-page-from-search-result #astra-sites-tooltip-plugins-settings,
1529
+ .astra-sites-page-import-popup #astra-sites-tooltip-plugins-settings {
1530
+ display: block !important;
1531
+ }
1532
+
1533
+ .astra-sites-result-preview h3 {
1534
+ font-size: 1.3em;
1535
+ margin: 0;
1536
+ }
1537
+ .astra-sites-result-preview .heading {
1538
+ background: #ffffff;
1539
+ padding: 16px 35px;
1540
+ margin-top: 0;
1541
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
1542
+ margin-bottom: 10px;
1543
+ display: flex;
1544
+ justify-content: space-between;
1545
+ }
1546
+ .astra-sites-result-preview .close {
1547
  position: absolute;
 
1548
  right: 0;
1549
  top: 0;
1550
  bottom: 0;
1551
+ height: 53px;
1552
+ line-height: 53px;
1553
+ width: 53px;
1554
+ cursor: pointer;
1555
+ border-left: 1px solid #eee;
1556
+ color: #aaa;
1557
+ font-size: 22px;
1558
  }
1559
+ .astra-sites-result-preview .close:hover {
1560
+ color: #0073aa;
1561
+ }
1562
+ .astra-sites-result-preview .overlay {
1563
+ background: rgba(0, 0, 0, 0.7);
1564
+ filter: alpha(opacity=70);
1565
+ position: fixed;
1566
+ top: 0;
1567
+ right: 0;
1568
+ bottom: 0;
1569
+ left: 0;
1570
+ z-index: 100050;
1571
  }
 
1572
  .astra-sites-result-preview .inner {
1573
+ margin: 0 auto;
1574
+ width: 660px;
1575
+ max-height: 420px;
1576
+ -webkit-transform: translate(-50%, -50%);
1577
+ -ms-transform: translate(-50%, -50%);
1578
+ transform: translate(-50%, -50%);
1579
+ -webkit-box-sizing: border-box;
1580
+ -moz-box-sizing: border-box;
1581
+ box-sizing: border-box;
1582
+ position: fixed;
1583
+ background-color: #f1f3f5;
1584
+ z-index: 100059;
1585
+ text-align: left;
1586
+ top: 50%;
1587
+ left: 50%;
1588
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
1589
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
1590
+ border-radius: 2px;
1591
  }
1592
+ .astra-sites-result-preview .button {
1593
+ line-height: 40px;
 
1594
  }
1595
 
1596
+ #single-pages .astra-theme {
1597
+ padding: 0;
1598
  }
1599
 
1600
+ .astra-sites-import-content > p:first-child,
1601
+ .ast-importing-wrap > p:first-child {
1602
+ margin-top: 0;
 
1603
  }
1604
 
1605
+ .current-importing-status {
1606
+ background: #fff;
1607
+ padding: 1.3em;
1608
+ }
1609
+
1610
+ .appearance_page_starter-templates .rotating {
1611
+ height: auto;
1612
+ animation: rotation 2s infinite linear;
1613
+ width: auto;
1614
+ color: #c1c1c1;
1615
+ }
1616
+
1617
+ .agency-ribbons {
1618
+ color: #ffffff;
1619
+ text-align: center;
1620
+ display: inline-block;
1621
+ position: absolute;
1622
+ z-index: 9;
1623
+ top: -7px;
1624
+ text-transform: uppercase;
1625
+ font-weight: 600;
1626
+ font-size: 9.5px;
1627
+ letter-spacing: 0.2px;
1628
+ right: -7px;
1629
+ border-radius: 2px;
1630
+ line-height: 15px;
1631
+ padding: 5px 9px;
1632
+ background-color: #007cba;
1633
+ cursor: default;
1634
+ }
1635
+
1636
+ .theme-browser .theme:hover .theme-actions,
1637
+ .theme-browser .theme.focus .theme-actions,
1638
+ .theme-browser .theme:focus .theme-actions {
1639
+ opacity: 0;
1640
  }
1641
 
1642
+ .theme-browser .theme .theme-screenshot:after {
1643
+ padding-top: 118%;
 
 
 
1644
  }
1645
 
1646
  @-webkit-keyframes rotation {
1647
+ from {
1648
+ -webkit-transform: rotate(0deg);
1649
+ }
1650
+ to {
1651
+ -webkit-transform: rotate(359deg);
1652
+ }
1653
  }
1654
  .import-time {
1655
+ display: inline-block;
1656
+ background: #0185ba;
1657
+ color: #fff;
1658
+ padding: 2px 10px;
1659
+ border-radius: 3px;
1660
+ animation: astra-scale 0.5s alternate infinite ease-in;
1661
  }
1662
 
1663
+ .theme-browser .theme:hover .theme-actions,
1664
+ .theme-browser .theme.focus .theme-actions,
1665
+ .theme-browser .theme:focus .theme-actions {
1666
+ opacity: 0;
1667
+ }
1668
  @keyframes astra-scale {
1669
  0% {transform: scale(1);}
1670
  100% {transform: scale(1.03);}
1671
  }
1672
 
1673
  .current-importing-status p {
1674
+ margin: 0;
1675
+ }
1676
+
1677
+ @media (min-width: 960px) and (max-width: 1020px) {
1678
+ #astra-sites-admin .theme-action-wrap {
1679
+ padding: 5px;
1680
+ width: 100%;
1681
+ }
1682
+ }
1683
+
1684
+ @media (min-width: 781px) and (max-width: 920px) {
1685
+ #astra-sites-admin .theme-action-wrap {
1686
+ padding: 5px;
1687
+ width: 100%;
1688
+ }
1689
+ .theme-browser .theme .theme-actions button:first-child {
1690
+ margin-bottom: 5px;
1691
+ }
1692
+ }
1693
+
1694
+ .theme-browser .theme .site-preview > .theme-screenshot.two:hover,
1695
+ .theme-browser .theme .site-preview > .theme-screenshot.three:hover {
1696
+ background-position: center top;
1697
+ }
1698
+
1699
+ .theme-browser .theme .theme-screenshot.two,
1700
+ .theme-browser .theme .theme-screenshot.three {
1701
+ position: absolute;
1702
+ top: 0;
1703
+ right: 0;
1704
+ left: 0px;
1705
+ }
1706
+
1707
+ .theme-browser .theme .theme-screenshot.two {
1708
+ width: calc(100% - 10px);
1709
+ opacity: .8;
1710
+ left: 0px;
1711
+ transform: translate(5px, -5px);
1712
+ }
1713
+
1714
+ .theme-browser .theme .theme-screenshot.three {
1715
+ width: calc(100% - 20px);
1716
+ opacity: .4;
1717
+ transform: translate(10px, -10px);
1718
+ }
1719
+
1720
+ .theme-browser .theme {
1721
+ box-shadow: 0 1px 7px 0 rgba(0, 0, 0, 0.08);
1722
+ margin: 0 3% 3.6% 0;
1723
+ border: none;
1724
+ }
1725
+
1726
+ .single-site {
1727
+ display: flex;
1728
+ }
1729
+
1730
+ .single-site-pages {
1731
+ overflow-y: auto;
1732
+ height: 100vh;
1733
+ max-height: calc(100vh - 280px);
1734
+ }
1735
+
1736
+ .single-site-pages::-webkit-scrollbar {
1737
+ width: 5px;
1738
+ background-color: #f1f1f1;
1739
+ }
1740
+
1741
+ .single-site-pages::-webkit-scrollbar-thumb {
1742
+ border-radius: 0;
1743
+ background-color: #d8d8d8;
1744
+ }
1745
+
1746
+ .single-site-pages::-webkit-scrollbar-track {
1747
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
1748
+ width: 20px;
1749
+ }
1750
+
1751
+
1752
+ .astra-sites-import-content::-webkit-scrollbar,
1753
+ .single-site-preview::-webkit-scrollbar {
1754
+ width: 5px;
1755
+ background-color: #f1f1f1;
1756
+ }
1757
+
1758
+ .astra-sites-import-content::-webkit-scrollbar-thumb,
1759
+ .single-site-preview::-webkit-scrollbar-thumb {
1760
+ border-radius: 0;
1761
+ background-color: #d8d8d8;
1762
+ }
1763
+
1764
+ .astra-sites-import-content::-webkit-scrollbar-track,
1765
+ .single-site-preview::-webkit-scrollbar-track {
1766
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
1767
+ width: 20px;
1768
+ }
1769
+
1770
+ .single-site-preview {
1771
+ margin-right: 4em;
1772
+ max-height: calc(100vh - 280px);
1773
+ height: 100vh;
1774
+ overflow-y: auto;
1775
+ border-radius: 2px;
1776
+ box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.12);
1777
+ }
1778
+
1779
+ .single-site-preview img {
1780
+ width: 100%;
1781
+ vertical-align: middle;
1782
+ }
1783
+
1784
+ .single-site-footer {
1785
+ position: fixed;
1786
+ padding: 15px 50px 15px 35px;
1787
+ bottom: 0;
1788
+ background: #fff;
1789
+ right: 0;
1790
+ left: 0;
1791
+ margin-left: 160px;
1792
+ z-index: 88;
1793
+ box-shadow: 0 -2px 8px rgba( 0, 0, 0, 0.05);
1794
+ }
1795
+
1796
+ .folded #astra-sites-menu-page .nav-tab-wrapper,
1797
+ .folded .single-site-footer {
1798
+ margin-left: 36px;
1799
+ }
1800
+
1801
+ .site-action-buttons-wrap {
1802
+ display: flex;
1803
+ justify-content: space-between;
1804
+ }
1805
+
1806
+ .single-site-pages-header {
1807
+ display: flex;
1808
+ justify-content: space-between;
1809
+ align-items: center;
1810
+ margin: 0 0 32px 0;
1811
+ }
1812
+
1813
+ .astra-site-title {
1814
+ margin: 0;
1815
+ }
1816
+
1817
+ .astra-pages-title-wrap {
1818
+ margin: 0 0 30px 0;
1819
+ display: flex;
1820
+ justify-content: space-between;
1821
+ }
1822
+
1823
+ .single-site-preview-wrap {
1824
+ width: 55%;
1825
+ }
1826
+
1827
+ .single-site-pages-wrap {
1828
+ width: 45%;
1829
+ }
1830
+
1831
+ /**
1832
+ * 3 Grid for Pages
1833
+ */
1834
+ @media only screen and (min-width: 1640px) {
1835
+ .theme-browser #site-pages .theme {
1836
+ width: 31.06%;
1837
+ margin: 0 3% 3% 0;
1838
+ }
1839
+ }
1840
+
1841
+ @media only screen and (min-width: 1640px) {
1842
+ .theme-browser #site-pages .theme:nth-child(3n) {
1843
+ margin-right: 0;
1844
+ }
1845
+ }
1846
+ #single-pages .astra-theme {
1847
+ border: none;
1848
+ }
1849
+
1850
+ #single-pages .current_page .inner {
1851
+ border-color: #5b9dd9;
1852
+ border-radius: 2px;
1853
+ }
1854
+ .theme-browser #site-pages .theme {
1855
+ margin: 0 3.4% 3.4% 0;
1856
+ border-radius: 2px;
1857
+ border: none;
1858
+ box-shadow: none;
1859
+ }
1860
+ .theme-browser #single-pages .site-single .theme-screenshot:after {
1861
+ padding-top: 100%;
1862
+ }
1863
+
1864
+ .site-action-buttons-wrap .dashicons {
1865
+ vertical-align: sub;
1866
+ font-size: 1rem;
1867
+ margin-left: .2em;
1868
+ }
1869
+
1870
+ .single-site-footer .dashicons-editor-help {
1871
+ font-size: 20px;
1872
+ color: #555d66;
1873
+ margin-left: 10px;
1874
+ }
1875
+ .site-action-buttons-right {
1876
+ display: flex;
1877
+ align-items: center;
1878
+ }
1879
+ .astra-sites-result-preview.astra-sites-import-complete .inner {
1880
+ overflow: hidden;
1881
+ height: auto;
1882
+ }
1883
+
1884
+ .site-action-buttons-wrap .button.button-primary.button-hero {
1885
+ box-shadow: none;
1886
+ }
1887
+ .wp-core-ui .astra-sites-result-preview .button.button-hero,
1888
+ .wp-core-ui .astra-sites-result-preview .button.button-hero:focus,
1889
+ .site-action-buttons-wrap .button.button-hero,
1890
+ .site-action-buttons-wrap .button.button-hero:focus {
1891
+ font-size: 13px;
1892
+ height: 34px;
1893
+ min-height: 34px;
1894
+ line-height: 33px;
1895
+ padding: 0 20px;
1896
+ box-shadow: none;
1897
+ }
1898
+
1899
+ .astra-hide-site {
1900
+ display: none;
1901
+ }
1902
+
1903
+ .astra-sites-no-sites .button.astra-sites-back,
1904
+ .astra-sites-no-favorites .button.astra-sites-back {
1905
+ box-shadow: none;
1906
+ height: 30px;
1907
+ }
1908
+
1909
+ .astra-sites-no-sites h3 {
1910
+ font-size: 1.3rem;
1911
+ font-weight: normal;
1912
+ color: #666;
1913
+ margin-top: 0;
1914
+ }
1915
+
1916
+ .astra-sites-import-plugins .disabled {
1917
+ pointer-events: none;
1918
+ }
1919
+ .theme-browser .theme .site-preview > .theme-screenshot.loading,
1920
+ .theme-browser .theme .theme-screenshot.loading {
1921
+ animation-duration: 2s;
1922
+ animation-fill-mode: forwards;
1923
+ animation-iteration-count: infinite;
1924
+ animation-name: image-placeholder;
1925
+ animation-timing-function: linear;
1926
+ background: #f6f7f8;
1927
+ background: linear-gradient(to right, #fafafa 8%, #f4f4f4 38%, #fafafa 54%);
1928
+ position: relative;
1929
+ }
1930
+ @keyframes image-placeholder{
1931
+ 0%{
1932
+ background-position: -150px 0;
1933
+ }
1934
+ 100%{
1935
+ background-position: 150px 0;
1936
+ }
1937
+ }
1938
+ .searching .theme-browser .theme .theme-screenshot.loading {
1939
+ opacity: .5;
1940
+ }
1941
+ .searching .theme-browser .theme .theme-screenshot {
1942
+ filter: blur(0);
1943
+ }
1944
+ .inner {
1945
+ overflow: hidden;
1946
+ }
1947
+ .site-import-layout-button.disabled {
1948
+ pointer-events: none;
1949
+ }
1950
+
1951
+ .theme-browser .themes {
1952
+ clear: both;
1953
+ margin: -1%;
1954
+ }
1955
+
1956
+
1957
+ @media only screen and (min-width: 768px) {
1958
+ .theme-browser .theme {
1959
+ width: 25%;
1960
+ padding: 1.1%;
1961
+ margin: 0 0 1em 0em;
1962
+ box-shadow: none;
1963
+ }
1964
+ }
1965
+
1966
+ @media only screen and (min-width: 1640px) {
1967
+ .theme-browser .theme:nth-child(3n) {
1968
+ margin-right: 0;
1969
+ }
1970
+ .theme-browser .theme:nth-child(4n) {
1971
+ margin-right: 0;
1972
+ }
1973
+ }
1974
+
1975
+ #astra-sites-filters .search-form {
1976
+ position: relative;
1977
+ }
1978
+
1979
+ .filters-wrap-page-categories {
1980
+ position: absolute;
1981
+ background: #fff;
1982
+ padding: 10px;
1983
+ z-index: 999;
1984
+ border: 1px solid #ccc;
1985
+ border-top: none;
1986
+ right: 0;
1987
+ left: 0;
1988
+ margin: 0;
1989
+ visibility: hidden;
1990
+ opacity: 0;
1991
+ }
1992
+
1993
+ .filters-wrap-page-categories.show {
1994
+ visibility: visible;
1995
+ opacity: 1;
1996
+ }
1997
+
1998
+ .filters-wrap-page-categories .filter-links li {
1999
+ display: list-item;
2000
+ }
2001
+
2002
+ #astra-sites-admin .filter-links .current {
2003
+ border: none;
2004
+ }
2005
+
2006
+ .filters-wrap-page-categories .filter-links {
2007
+ display: block;
2008
+ }
2009
+
2010
+ .filters-wrap-page-categories .filter-links li > a {
2011
+ display: block;
2012
+ margin: 0 0 5px 5px;
2013
+ }
2014
+
2015
+ .page-builder-icon .page-builders {
2016
+ position: absolute;
2017
+ top: 100%;
2018
+ background: #fff;
2019
+ z-index: 10;
2020
+ margin: 0;
2021
+ border: 1px solid #ddd;
2022
+ opacity: 0;
2023
+ visibility: hidden;
2024
+ box-shadow: 0px 9px 21px 0px rgba(0, 0, 0, 0.2);
2025
+ border-bottom-left-radius: 3px;
2026
+ border-bottom-right-radius: 3px;
2027
+ left: -1px;
2028
+ right: 0px;
2029
+ }
2030
+ .page-builder-icon.active .page-builders {
2031
+ opacity: 1;
2032
+ visibility: visible;
2033
+ }
2034
+ .page-builder-icon .page-builders img {
2035
+ height: 17px;
2036
+ width: 17px;
2037
+ border-radius: 50%;
2038
+ margin-right: 10px;
2039
+ }
2040
+
2041
+ .page-builder-icon .page-builders li {
2042
+ display: flex;
2043
+ padding: 10px 15px;
2044
+ margin: 0;
2045
+ }
2046
+
2047
+ .page-builder-icon {
2048
+ display: inline-block;
2049
+ font-size: 12px;
2050
+ padding: 23px 10px;
2051
+ width: 164px;
2052
+ position: relative;
2053
+ cursor: pointer;
2054
+ }
2055
+
2056
+ .page-builder-icon img {
2057
+ height: auto;
2058
+ width: 22px;
2059
+ border-radius: 50%;
2060
+ margin-right: 8px;
2061
+ }
2062
+
2063
+ .selected-page-builder {
2064
+ display: flex;
2065
+ justify-content: center;
2066
+ align-items: center;
2067
+ }
2068
+
2069
+ .selected-page-builder .dashicons {
2070
+ margin-left: 2px;
2071
+ }
2072
+
2073
+ .page-builder-icon .page-builders .active,
2074
+ .page-builder-icon .page-builders li:hover {
2075
+ background-color: #f7f7f7;
2076
+ }
2077
+
2078
+ .appearance_page_starter-templates .astra-sites-sync-library-message {
2079
+ margin-left: 25px;
2080
+ margin-right: 25px;
2081
+ }
2082
+
2083
+ .astra-sites-sync-library-message.notice .notice-dismiss:before {
2084
+ font-size: 14px;
2085
+ }
2086
+
2087
+ .astra-loading-wrap {
2088
+ position: absolute;
2089
+ left: 50%;
2090
+ top: 50%;
2091
+ transform: translate(-60%, -60%);
2092
+ }
2093
+
2094
+ .astra-previewing-single-pages #wpbody-content {
2095
+ position: fixed;
2096
+ }
2097
+
2098
+ .appearance_page_starter-templates div#setting-error-tgmpa,
2099
+ .appearance_page_starter-templates .update-nag,
2100
+ .appearance_page_starter-templates .notice,
2101
+ .appearance_page_starter-templates div.error {
2102
+ display: none;
2103
+ }
2104
+
2105
+ .appearance_page_starter-templates .astra-sites-notice {
2106
+ display: block;
2107
+ }
2108
+
2109
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message.success,
2110
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message.notice-success {
2111
+ display: none !important;
2112
+ }
2113
+
2114
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message {
2115
+ top: 85px;
2116
+ display: block !important;
2117
+ width: calc( 100% - 270px );
2118
+ }
2119
+
2120
+ .astra-previewing-single-pages.folded #wpbody-content > .notice.astra-sites-sync-library-message {
2121
+ width: calc( 100% - 150px );
2122
+ }
2123
+
2124
+ .appearance_page_starter-templates.astra-previewing-single-pages #wpbody-content {
2125
+ padding-top: 0;
2126
+ }
2127
+
2128
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2129
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2130
+ display: inline-block !important;
2131
+ top: 90px;
2132
+ right: 0;
2133
+ width: calc( 100% - 260px ) !important;
2134
+ }
2135
+
2136
+ .folded.astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2137
+ .folded.astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2138
+ width: calc( 100% - 140px ) !important;
2139
+ }
2140
+
2141
+ .appearance_page_starter-templates #wpbody-content {
2142
+ padding-top: 80px;
2143
+ }
2144
+
2145
+ .appearance_page_starter-templates.auto-fold #wpcontent {
2146
+ padding-left: 0;
2147
+ }
2148
+
2149
+ .pages-count,
2150
+ .page-title {
2151
+ font-weight: 300;
2152
+ font-size: 13px;
2153
+ display: none;
2154
+ }
2155
+
2156
+ .site-pages-not-import-notice {
2157
+ clear: both;
2158
+ }
2159
+
2160
+ .astra-loading-icon,
2161
+ .astra-loading-icon:after {
2162
+ border-radius: 50%;
2163
+ width: 20px;
2164
+ height: 20px;
2165
+ }
2166
+ .astra-loading-icon {
2167
+ border-top: 3px solid rgb(192, 192, 192);
2168
+ border-right: 3px solid rgb(192, 192, 192);
2169
+ border-bottom: 3px solid rgb(192, 192, 192);
2170
+ border-left: 3px solid #0185ba;
2171
+ -webkit-transform: translateZ(0);
2172
+ -ms-transform: translateZ(0);
2173
+ transform: translateZ(0);
2174
+ -webkit-animation: load8 1.1s infinite linear;
2175
+ animation: load8 1.1s infinite linear;
2176
+ }
2177
+ @-webkit-keyframes load8 {
2178
+ 0% {
2179
+ -webkit-transform: rotate(0deg);
2180
+ transform: rotate(0deg);
2181
+ }
2182
+ 100% {
2183
+ -webkit-transform: rotate(360deg);
2184
+ transform: rotate(360deg);
2185
+ }
2186
+ }
2187
+ @keyframes load8 {
2188
+ 0% {
2189
+ -webkit-transform: rotate(0deg);
2190
+ transform: rotate(0deg);
2191
+ }
2192
+ 100% {
2193
+ -webkit-transform: rotate(360deg);
2194
+ transform: rotate(360deg);
2195
+ }
2196
+ }
2197
+
2198
+ .preparing .install-theme-info {
2199
+ display: none !important;
2200
+ }
2201
+
2202
+ #astra-sites.temp .placeholder-site .theme-id-container .title {
2203
+ background: #f1f1f1;
2204
+ }
2205
+
2206
+ #astra-sites.temp .placeholder-site .theme-id-container .site-title {
2207
+ color: transparent;
2208
+ }
2209
+
2210
+ .ast-sites__filter-wrap-checkbox input[type="radio"].active:before {
2211
+ content: "";
2212
+ border-radius: 50%;
2213
+ width: 0.5rem;
2214
+ height: 0.5rem;
2215
+ margin: 0.1875rem;
2216
+ background-color: #1e8cbe;
2217
+ line-height: 1.14285714;
2218
+ float: left;
2219
+ display: inline-block;
2220
+ vertical-align: middle;
2221
+ speak: none;
2222
+ -webkit-font-smoothing: antialiased;
2223
+ -moz-osx-font-smoothing: grayscale;
2224
+ }
2225
+
2226
+ @media screen and (min-width: 783px and max-width: 1180px) {
2227
+
2228
+ .folded #astra-sites-menu-page .nav-tab-wrapper {
2229
+ margin-left: 36px;
2230
+ top: 32px;
2231
+ }
2232
+ #astra-sites-filters .search-form {
2233
+ width: 100%;
2234
+ }
2235
+ #astra-sites .theme {
2236
+ width: 50%;
2237
+ }
2238
+
2239
+ #astra-sites .theme:nth-child(odd) {
2240
+ margin: 0;
2241
+ }
2242
+ .theme-browser #site-pages .theme {
2243
+ width: 46%;
2244
+ }
2245
+ }
2246
+ @media screen and (max-width: 782px) {
2247
+ .ast-sites__filter-wrap-checkbox input[type="radio"] {
2248
+ height: 1rem;
2249
+ width: 1rem;
2250
+ }
2251
+ .ast-sites__filter-wrap-checkbox input[type="radio"]:checked:before {
2252
+ margin: .25rem;
2253
+ height: 0.4rem;
2254
+ width: 0.4rem;
2255
+ }
2256
+
2257
+ .folded #astra-sites-menu-page .nav-tab-wrapper {
2258
+ top: 46px;
2259
+ margin-left: 0;
2260
+ }
2261
+
2262
+ .page-builder-title {
2263
+ display: none;
2264
+ }
2265
+
2266
+ .page-builder-icon {
2267
+ width: 100px;
2268
+ }
2269
+
2270
+ .page-builder-icon .page-builders {
2271
+ width: 140px;
2272
+ margin-left: -20px;
2273
+ }
2274
+ .single-site-footer {
2275
+ margin-left: 0;
2276
+ }
2277
+ }
2278
+ @media only screen and (max-width: 768px) {
2279
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-message,
2280
+ .astra-previewing-single-pages #wpbody-content > .notice.astra-sites-sync-library-start-message {
2281
+ top: 0;
2282
+ width: auto !important;
2283
+ }
2284
+ }
2285
+ @media only screen and (max-width: 767px) {
2286
+ .appearance_page_starter-templates #wpbody-content {
2287
+ padding-top: 0;
2288
+ }
2289
+
2290
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
2291
+ padding: 10px;
2292
+ }
2293
+
2294
+ .back-to-layout {
2295
+ padding: 20px 5px;
2296
+ }
2297
+
2298
+ .astra-previewing-single-pages #astra-sites-admin {
2299
+ margin-top: 55px;
2300
+ }
2301
+ }
2302
+ @media only screen and (max-width: 1120px) {
2303
+ .theme-browser .theme:nth-child(odd) {
2304
+ margin-right: 0;
2305
+ }
2306
+ }
2307
+ @media only screen and (min-width: 780px) and (max-width: 1200px) {
2308
+ .theme-browser .theme:nth-child(odd) {
2309
+ margin-right: 0;
2310
+ }
2311
+ .theme-browser .theme {
2312
+ width: 33.33%;
2313
+ }
2314
+ }
2315
+ @media only screen and (min-width: 780px) and (max-width: 962px) {
2316
+ #astra-sites-menu-page .nav-tab-wrapper {
2317
+ margin-left: 36px;
2318
+ }
2319
+ }
2320
+ @media only screen and (min-width: 1200px) {
2321
+ #astra-sites-filters .search-form {
2322
+ width: 600px;
2323
+ margin: 0 auto;
2324
+ }
2325
+ }
2326
+ @media only screen and (min-width: 1000px) and (max-width: 1200px) {
2327
+ .theme-browser #site-pages .theme:nth-child(3n) {
2328
+ margin-right: 0;
2329
+ }
2330
+
2331
+ .theme-browser #site-pages .theme {
2332
+ width: 30.33%;
2333
+ }
2334
+ }
2335
+
2336
+ @media only screen and (min-width: 780px) and (max-width: 999px) {
2337
+ .theme-browser #site-pages .theme:nth-child(2n) {
2338
+ margin-right: 0;
2339
+ }
2340
+
2341
+ .theme-browser #site-pages .theme {
2342
+ width: 48%;
2343
+ }
2344
+ }
2345
+
2346
+ @media only screen and (max-width: 960px) {
2347
+ #site-pages {
2348
+ position: relative;
2349
+ margin: 0 70px 0 0;
2350
+ }
2351
+ }
2352
+ @media only screen and (max-width: 1200px) {
2353
+ .back-to-layout {
2354
+ margin-right: 20px;
2355
+ }
2356
+ }
2357
+ @media screen and (max-width: 600px) {
2358
+ #astra-sites-filters .search-form {
2359
+ width: auto;
2360
+ }
2361
+ }
2362
+ @media screen and (max-width: 782px) {
2363
+ #astra-sites-menu-page .nav-tab-wrapper {
2364
+ margin: 0;
2365
+ top: 46px;
2366
+ }
2367
+ #site-pages {
2368
+ margin: 0;
2369
+ }
2370
+ .theme-browser #site-pages .theme {
2371
+ width: 46%;
2372
+ }
2373
+ .single-site-footer {
2374
+ padding: 10px 20px;
2375
+ }
2376
+ .single-site {
2377
+ flex-direction: column;
2378
+ }
2379
+
2380
+ .single-site-preview-wrap {
2381
+ width: 100%;
2382
+ }
2383
+
2384
+ .single-site-preview {
2385
+ margin: 0;
2386
+ height: 40vh;
2387
+ }
2388
+
2389
+ .single-site-pages-wrap {
2390
+ width: 100%;
2391
+ margin-top: 3em;
2392
+ }
2393
+ }
2394
+
2395
+ .astra-sites__category-filter-items {
2396
+ z-index: 99;
2397
+ }
2398
+
2399
+ @media only screen and (min-width: 780px) and (max-width: 962px) {
2400
+ .single-site-footer {
2401
+ margin-left: 38px;
2402
+ }
2403
+ }
2404
+ @media screen and (min-width: 481px) {
2405
+ .hide-on-desktop {
2406
+ display: none;
2407
+ }
2408
+ .astra-sites__category-filter-items {
2409
+ z-index: 99;
2410
+ }
2411
+ }
2412
+ @media screen and (max-width: 480px) {
2413
+ #astra-sites-admin .astra-sites-popup .inner,
2414
+ .astra-sites-result-preview .inner {
2415
+ width: 95%;
2416
+ }
2417
+ .single-site-footer .button {
2418
+ text-align: center;
2419
+ width: 100%;
2420
+ }
2421
+ .single-site-pages {
2422
+ overflow: initial;
2423
+ }
2424
+
2425
+ #astra-sites-filters.hide-on-desktop {
2426
+ box-shadow: 25px 0 30px rgba(28, 39, 60, 0.09);
2427
+ border-bottom: 1px solid #dddddd;
2428
+ background: #fff;
2429
+ padding: 10px;
2430
+ }
2431
+
2432
+ #astra-sites-menu-page .form {
2433
+ flex: 1;
2434
+ }
2435
+
2436
+ .favorite-filters-wrap {
2437
+ flex: 1;
2438
+ text-align: right;
2439
+ padding: 5px 10px;
2440
+ }
2441
+
2442
+ .back-to-layout {padding: 13px 10px;}
2443
+
2444
+ .page-builder-icon {
2445
+ padding: 18px 8px 18px 15px;
2446
+ }
2447
+
2448
+ #astra-sites-menu-page .nav-tab-wrapper .logo {
2449
+ padding: 14px 10px;
2450
+ }
2451
+
2452
+ #astra-sites__category-filter .astra-sites__category-filter-anchor {
2453
+ width: 90px;
2454
+ }
2455
+
2456
+ .header-actions li > a {
2457
+ margin: 0 7px;
2458
+ }
2459
+
2460
+ .astra-previewing-single-pages #wpbody-content {
2461
+ position: relative;
2462
+ }
2463
+
2464
+ .astra-sites-no-sites .content, .astra-sites-no-favorites .content {
2465
+ flex-direction: column;
2466
+ }
2467
+
2468
+ .astra-sites-no-sites .inner, .astra-sites-no-favorites .inner {
2469
+ width: auto;
2470
+ }
2471
+
2472
+ .site-action-buttons-right {
2473
+ flex-direction: column;
2474
+ align-items: flex-start;
2475
+ }
2476
+
2477
+ .site-import-layout-button {
2478
+ margin-left: 0 !important;
2479
+ }
2480
+
2481
+ .astra-sites-no-sites .content, .astra-sites-no-favorites .content {
2482
+ flex-direction: column;
2483
+ }
2484
+
2485
+ .astra-sites-no-sites .inner, .astra-sites-no-favorites .inner {
2486
+ width: auto;
2487
+ }
2488
+
2489
+ .hide-on-mobile {
2490
+ display: none;
2491
+ }
2492
+ .astra-sites-logo-wrap {
2493
+ width: 30px;
2494
+ height: 30px;
2495
+ }
2496
+
2497
+ .header-actions li > a {
2498
+ margin: 0 5px;
2499
+ }
2500
+
2501
+ .page-builder-icon {
2502
+ width: auto;
2503
+ }
2504
+
2505
+ .page-builder-icon .page-builders {
2506
+ margin-left: -95%;
2507
+ }
2508
+
2509
+ #astra-sites-menu-page .nav-tab-wrapper {position: relative;top: 0;left: 0;}
2510
+
2511
+ .theme-browser .theme:nth-child(odd) {
2512
+ margin-right: 0;
2513
+ }
2514
+
2515
+ #astra-sites-admin {
2516
+ margin-top: 30px;
2517
+ margin-left: 20px;
2518
+ margin-right: 20px;
2519
+ }
2520
+ .appearance_page_starter-templates.auto-fold #wpcontent {
2521
+ padding-left: 0;
2522
+ }
2523
+
2524
+ .back-to-layout {
2525
+ margin-right: 10px;
2526
+ }
2527
+
2528
+ .single-site-footer {
2529
+ position: relative;
2530
+ margin-left: -20px;
2531
+ }
2532
+
2533
+ #wpbody-content {
2534
+ padding-bottom: 30px;
2535
+ }
2536
+
2537
+ .site-action-buttons-wrap {
2538
+ flex-direction: column;
2539
+ }
2540
+
2541
+ .site-action-buttons-wrap > .button:first-child {
2542
+ margin-bottom: 5px;
2543
+ }
2544
+
2545
+ .appearance_page_starter-templates .astra-sites-sync-library-message {
2546
+ margin: 10px;
2547
+ }
2548
+ }
2549
+
2550
+ #astra-sites-filters .section-left {
2551
+ flex: 1;
2552
+ }
2553
+
2554
+ #astra-sites-filters .search-form {
2555
+ float: none;
2556
+ }
2557
+
2558
+ /**
2559
+ * Popup
2560
+ */
2561
+
2562
+ .ast-actioms-wrap {
2563
+ padding: 1em 1em 1em 2.9em;
2564
+ z-index: 30;
2565
+ box-sizing: border-box;
2566
+ border-top: 1px solid #dcdcdc;
2567
+ }
2568
+ .wp-core-ui .ast-actioms-wrap .button,
2569
+ .wp-core-ui .ast-actioms-wrap .button:focus {
2570
+ font-size: 13px;
2571
+ height: 36px;
2572
+ min-height: 36px;
2573
+ line-height: 34px;
2574
+ padding: 0 20px;
2575
+ box-shadow: none;
2576
+ }
2577
+ .ast-actioms-wrap .button {
2578
+ margin: 0;
2579
+ }
2580
+ .ast-actioms-wrap .button {
2581
+ margin-right: .5em;
2582
+ }
2583
+ .astra-site-contents > li {
2584
+ margin-bottom: 12px;
2585
+ }
2586
+
2587
+ .astra-sites-popup {
2588
+ position: absolute;
2589
+ left: 0;
2590
+ right: 0;
2591
+ top: 0;
2592
+ bottom: 0;
2593
+ background: #fff;
2594
+ overflow-y: auto;
2595
+ }
2596
+
2597
+ .astra-sites-popup .dashicons {
2598
+ vertical-align: middle;
2599
+ font-size: 1rem;
2600
+ }
2601
+ .astra-sites-popup .button {
2602
+ margin-top: 1em;
2603
+ }
2604
+
2605
+ .astra-sites-popup h3 {
2606
+ font-size: 1.4em;
2607
+ margin: 0;
2608
+ }
2609
+ .astra-sites-popup .heading {
2610
+ background: #ffffff;
2611
+ padding: 16px 35px;
2612
+ margin-top: 0;
2613
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
2614
+ margin-bottom: 10px;
2615
+ display: flex;
2616
+ justify-content: space-between;
2617
+ }
2618
+ .astra-sites-popup .close {
2619
+ position: absolute;
2620
+ right: 0;
2621
+ top: 0;
2622
+ bottom: 0;
2623
+ height: 53px;
2624
+ line-height: 53px;
2625
+ width: 53px;
2626
+ cursor: pointer;
2627
+ border-left: 1px solid #eee;
2628
+ color: #aaa;
2629
+ font-size: 21px;
2630
+ }
2631
+ .astra-sites-popup .close:hover {
2632
+ color: #444;
2633
+ }
2634
+ .astra-sites-popup .overlay {
2635
+ background: rgba(0, 0, 0, 0.7);
2636
+ filter: alpha(opacity=70);
2637
+ position: fixed;
2638
+ top: 0;
2639
+ right: 0;
2640
+ bottom: 0;
2641
+ left: 0;
2642
+ z-index: 100050;
2643
+ }
2644
+ .astra-sites-popup .inner {
2645
+ margin: 0 auto;
2646
+ width: 660px;
2647
+ max-height: 420px;
2648
+ -webkit-transform: translate(-50%, -50%);
2649
+ -ms-transform: translate(-50%, -50%);
2650
+ transform: translate(-50%, -50%);
2651
+ -webkit-box-sizing: border-box;
2652
+ -moz-box-sizing: border-box;
2653
+ box-sizing: border-box;
2654
+ position: fixed;
2655
+ background-color: #f3f3f3;
2656
+ z-index: 100059;
2657
+ text-align: left;
2658
+ top: 50%;
2659
+ left: 50%;
2660
+ -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
2661
+ box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
2662
+ border-radius: 2px;
2663
+ }
2664
+ .astra-sites-popup .button {
2665
+ line-height: 40px;
2666
+ }
2667
+
2668
+ .ast-sites__search-title {
2669
+ padding: 0 1.1%;
2670
+ font-size: 18px;
2671
+ margin-bottom: 10px;
2672
+ }
2673
+
2674
+ .ast-sites__search-wrap {
2675
+ display:flex;
2676
+ flex-wrap: wrap;
2677
+ }
2678
+
2679
+ /**
2680
+ * License Form
2681
+ */
2682
+ #astra-pro-sites-license-form p:first-child {
2683
+ margin-top: 0;
2684
+ }
2685
+
2686
+ #astra-pro-sites-license-form p {
2687
+ margin: .3em 0;
2688
+ }
2689
+
2690
+ #astra-pro-sites-license-form .bsf-license-key-registration {
2691
+ margin-top: 1em;
2692
+ }
2693
+
2694
+ #astra-pro-sites-license-form .inner {
2695
+ position: relative;
2696
+ box-shadow: none;
2697
+ height: auto;
2698
+ width: auto;
2699
+ min-height: auto;
2700
+ transition: none;
2701
+ top: 0;
2702
+ left: 0;
2703
+ transform: none;
2704
+ }
2705
+
2706
+ #astra-pro-sites-license-form h3 {
2707
+ display: none;
2708
+ }
2709
+
2710
+ #astra-pro-sites-license-form .astra-product-license {
2711
+ line-height: normal;
2712
+ margin-top: 0;
2713
+ margin-left: 0.5em;
2714
+ padding: .45em;
2715
+ }
2716
+
2717
+ #astra-pro-sites-license-form .license-form-field {
2718
+ float: left;
2719
+ width: 100%;
2720
+ width: calc( 100% - 140px );
2721
+ }
2722
+
2723
+ #astra-pro-sites-license-form .regular-text {
2724
+ width: 100%;
2725
+ }
2726
+
2727
+ #astra-pro-sites-license-form .submit-button-wrap p {
2728
+ margin-top: 1em;
2729
+ }
2730
+
2731
+ .appearance_page_starter-templates.astra-sites-change-page-builder .astra-sites-notice {
2732
+ display: none;
2733
+ }
2734
+
2735
+ .astra-sites-log p:first-child {
2736
+ margin-top: 0;
2737
+ }
2738
+
2739
+ .astra-sites-log p:last-child {
2740
+ margin-bottom: 0;
2741
+ }
2742
+
2743
+ .astra-sites-log .batch-log {
2744
+ background: #fff;
2745
+ padding: 2em;
2746
+ margin-bottom: 1em;
2747
+ }
2748
+
2749
+ .astra-sites-log table td {
2750
+ vertical-align: top;
2751
+ padding: 15px;
2752
+ text-align: left;
2753
+ }
2754
+
2755
+ .white-label-enabled .astra-sites-logo-wrap {
2756
+ width: auto;
2757
+ display: flex;
2758
+ align-items: center;
2759
+ font-size: 1.2rem;
2760
+ font-weight: 500;
2761
+ }
2762
+
2763
+ .appearance_page_starter-templates .notice.astra-sites-must-notices {
2764
+ display: block;
2765
+ }
2766
+
2767
+ .astra-previewing-single-pages.appearance_page_starter-templates .notice.astra-sites-must-notices {
2768
+ display: none;
2769
+ }
2770
+
2771
+ #astra-pro-sites-license-form .astra-pro-sites-fail-message {
2772
+ color: #F44336;
2773
+ }
2774
+
2775
+ #astra-pro-sites-license-form .bsf-current-license-success-astra-pro-sites,
2776
+ #astra-pro-sites-license-form .bsf-current-license-error-astra-pro-sites {
2777
+ display: none;
2778
+ }
2779
+
2780
+ .bsf-current-license-error-astra-pro-sites,
2781
+ .bsf-current-license-success-astra-pro-sites {
2782
+ display: block;
2783
+ margin-bottom: 0.5em;
2784
+ }
2785
+
2786
+ .astra-pro-sites-license-form-status-success .astra-product-license {
2787
+ display: none;
2788
+ }
2789
+
2790
+ #astra-pro-sites-license-form.astra-pro-sites-license-form-status-success .license-form-field {
2791
+ width: calc( 100% - 2px );
2792
+ }
2793
+
2794
+ #astra-pro-sites-license-form .astra-pro-sites-success-message {
2795
+ color: #008000;
2796
+ }
2797
+
2798
+ .bsf-current-license-error-astra-pro-sites {
2799
+ color: #F44336;
2800
+ }
2801
+
2802
+ .skip-and-import .astra-site-contents {
2803
+ list-style-type: circle;
2804
+ margin-left: 1.7em;
2805
+ }
2806
+
2807
+ .astra-site-contents .astra-theme-module {
2808
+ margin-left: 2em;
2809
+ }
2810
+
2811
+ .dont-use-astra-theme .plugin-card-astra-addon,
2812
+ .required-plugins-count-1.dont-use-astra-theme .astra-sites-import-plugins {
2813
+ display: none;
2814
+ }
inc/assets/css/elementor-admin-common-rtl.css ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .dialog-widget-content {
2
+ background-color: #fff;
3
+ position: absolute;
4
+ -webkit-border-radius: 3px;
5
+ border-radius: 3px;
6
+ -webkit-box-shadow: -2px 8px 23px 3px rgba(0, 0, 0, 0.2);
7
+ box-shadow: -2px 8px 23px 3px rgba(0, 0, 0, 0.2);
8
+ overflow: hidden;
9
+ }
10
+
11
+ .dialog-message {
12
+ font-size: 12px;
13
+ line-height: 1.5;
14
+ -webkit-box-sizing: border-box;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .dialog-type-lightbox {
19
+ position: fixed;
20
+ height: 100%;
21
+ width: 100%;
22
+ top: 0;
23
+ right: 0;
24
+ background-color: rgba(0, 0, 0, 0.8);
25
+ z-index: 9999;
26
+ -webkit-user-select: none;
27
+ -moz-user-select: none;
28
+ -ms-user-select: none;
29
+ user-select: none;
30
+ }
31
+
32
+ .dialog-type-lightbox .dialog-widget-content {
33
+ margin: auto;
34
+ }
35
+
36
+ .dialog-type-lightbox .dialog-header {
37
+ font-size: 15px;
38
+ color: #495157;
39
+ padding: 30px 0 10px;
40
+ font-weight: 500;
41
+ }
42
+
43
+ .dialog-type-lightbox .dialog-message {
44
+ padding: 0 30px 30px;
45
+ min-height: 50px;
46
+ }
47
+
48
+ .dialog-type-lightbox:not(.elementor-popup-modal) .dialog-header,
49
+ .dialog-type-lightbox:not(.elementor-popup-modal) .dialog-message {
50
+ text-align: center;
51
+ }
52
+
53
+ .dialog-type-lightbox .dialog-buttons-wrapper {
54
+ border-top: 1px solid #e6e9ec;
55
+ text-align: center;
56
+ }
57
+
58
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button {
59
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
60
+ width: 50%;
61
+ border: none;
62
+ background: none;
63
+ font-size: 15px;
64
+ cursor: pointer;
65
+ padding: 13px 0;
66
+ outline: 0;
67
+ }
68
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button:hover {
69
+ background-color: #f4f6f7; }
70
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button.dialog-ok {
71
+ color: #b01b1b; }
72
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button.dialog-take_over {
73
+ color: #39b54a; }
74
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button:active {
75
+ background-color: rgba(230, 233, 236, 0.5); }
76
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button::-moz-focus-inner {
77
+ border: 0; }
78
+
79
+ .ast-sites-modal .dialog-widget-content {
80
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
81
+ background-color: #f1f3f5;
82
+ width: 100%; }
83
+ @media (max-width: 1439px) {
84
+ .ast-sites-modal .dialog-widget-content {
85
+ max-width: 990px; } }
86
+ @media (min-width: 1440px) {
87
+ .ast-sites-modal .dialog-widget-content {
88
+ max-width: 1200px; } }
89
+
90
+ .ast-sites-modal .dialog-header {
91
+ padding: 0;
92
+ background-color: #fff;
93
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
94
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
95
+ position: relative;
96
+ z-index: 1; }
97
+
98
+ .ast-sites-modal .dialog-buttons-wrapper {
99
+ background-color: #fff;
100
+ border: none;
101
+ display: none;
102
+ -webkit-box-pack: end;
103
+ -webkit-justify-content: flex-end;
104
+ -ms-flex-pack: end;
105
+ justify-content: flex-end;
106
+ padding: 5px;
107
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
108
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
109
+ position: relative; }
110
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button {
111
+ height: 40px;
112
+ margin-right: 5px; }
113
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button-success {
114
+ padding: 12px 36px;
115
+ color: #fff;
116
+ width: initial;
117
+ font-size: 15px; }
118
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button-success:hover {
119
+ background-color: #39b54a; }
120
+
121
+ .ast-sites-modal .dialog-message {
122
+ height: 750px;
123
+ max-height: 85vh;
124
+ overflow: auto;
125
+ padding-top: 25px; }
126
+
127
+ .ast-sites-modal .dialog-content {
128
+ height: 100%; }
129
+
130
+ .ast-sites-modal .dialog-loading {
131
+ display: none; }
132
+
133
+ .ast-sites-modal__header {
134
+ display: -webkit-box;
135
+ display: -webkit-flex;
136
+ display: -ms-flexbox;
137
+ display: flex;
138
+ -webkit-box-align: center;
139
+ -webkit-align-items: center;
140
+ -ms-flex-align: center;
141
+ align-items: center;
142
+ -webkit-box-pack: justify;
143
+ -webkit-justify-content: space-between;
144
+ -ms-flex-pack: justify;
145
+ justify-content: space-between;
146
+ height: 50px; }
147
+ .ast-sites-modal__header__logo {
148
+ line-height: 1;
149
+ text-transform: uppercase;
150
+ font-weight: bold;
151
+ cursor: pointer; }
152
+ .ast-sites-modal__header__logo-area {
153
+ text-align: right;
154
+ padding-right: 15px; }
155
+ .ast-sites-modal__header__logo-area > * {
156
+ display: -webkit-box;
157
+ display: -webkit-flex;
158
+ display: -ms-flexbox;
159
+ display: flex;
160
+ -webkit-box-align: center;
161
+ -webkit-align-items: center;
162
+ -ms-flex-align: center;
163
+ align-items: center; }
164
+ .ast-sites-modal__header__logo__icon-wrapper {
165
+ padding: 4px 7px 6px;
166
+ background-image: -webkit-linear-gradient(-225deg, #f2295b, #434363);
167
+ background-image: -o-linear-gradient(-225deg, #f2295b, #434363);
168
+ background-image: linear-gradient(135deg, #f2295b, #434363);
169
+ -webkit-border-radius: 2px;
170
+ border-radius: 2px;
171
+ margin-left: 10px; }
172
+ .ast-sites-modal__header__logo__title {
173
+ padding-top: 2px; }
174
+ .ast-sites-modal__header__logo i {
175
+ color: #fff;
176
+ font-size: 10px; }
177
+ .ast-sites-modal__header__items-area {
178
+ display: -webkit-box;
179
+ display: -webkit-flex;
180
+ display: -ms-flexbox;
181
+ display: flex;
182
+ -webkit-box-orient: horizontal;
183
+ -webkit-box-direction: reverse;
184
+ -webkit-flex-direction: row-reverse;
185
+ -ms-flex-direction: row-reverse;
186
+ flex-direction: row-reverse; }
187
+ .ast-sites-modal__header__item {
188
+ position: relative;
189
+ display: -webkit-box;
190
+ display: -webkit-flex;
191
+ display: -ms-flexbox;
192
+ display: flex;
193
+ -webkit-box-align: center;
194
+ -webkit-align-items: center;
195
+ -ms-flex-align: center;
196
+ align-items: center;
197
+ -webkit-box-pack: center;
198
+ -webkit-justify-content: center;
199
+ -ms-flex-pack: center;
200
+ justify-content: center;
201
+ -webkit-box-sizing: content-box;
202
+ box-sizing: content-box; }
203
+ .ast-sites-modal__header__item > i {
204
+ font-size: 20px;
205
+ -webkit-transition: all 0.3s;
206
+ -o-transition: all 0.3s;
207
+ transition: all 0.3s;
208
+ cursor: pointer; }
209
+ .ast-sites-modal__header__item > i:not(:hover) {
210
+ color: #a4afb7; }
211
+ .ast-sites-modal__header__close--normal {
212
+ width: 45px;
213
+ border-right: 1px solid #e6e9ec; }
214
+ .ast-sites-modal__header__close--normal i {
215
+ font-size: 18px; }
216
+ .ast-sites-modal__header__close--skip {
217
+ padding: 10px;
218
+ padding-right: 20px;
219
+ margin-left: 10px;
220
+ color: #fff;
221
+ background-color: #a4afb7;
222
+ font-size: 11px;
223
+ font-weight: normal;
224
+ line-height: 1;
225
+ text-transform: uppercase;
226
+ -webkit-border-radius: 2px;
227
+ border-radius: 2px;
228
+ cursor: pointer; }
229
+ .ast-sites-modal__header__close--skip > i {
230
+ font-size: inherit;
231
+ padding-right: 10px;
232
+ margin-right: 15px;
233
+ border-right: 1px solid; }
234
+ .ast-sites-modal__header__close--skip > i:not(:hover) {
235
+ color: #fff; }
236
+
237
+ .ast-sites-modal__sidebar {
238
+ width: 25%;
239
+ background-color: rgba(255, 255, 255, 0.3); }
240
+
241
+ .ast-sites-modal__content {
242
+ -webkit-box-flex: 1;
243
+ -webkit-flex-grow: 1;
244
+ -ms-flex-positive: 1;
245
+ flex-grow: 1;
246
+ -webkit-box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
247
+ box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05); }
inc/assets/css/elementor-admin-common.css ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .dialog-widget-content {
2
+ background-color: #fff;
3
+ position: absolute;
4
+ -webkit-border-radius: 3px;
5
+ border-radius: 3px;
6
+ -webkit-box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
7
+ box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
8
+ overflow: hidden;
9
+ }
10
+
11
+ .dialog-message {
12
+ font-size: 12px;
13
+ line-height: 1.5;
14
+ -webkit-box-sizing: border-box;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .dialog-type-lightbox {
19
+ position: fixed;
20
+ height: 100%;
21
+ width: 100%;
22
+ top: 0;
23
+ left: 0;
24
+ background-color: rgba(0, 0, 0, 0.8);
25
+ z-index: 9999;
26
+ -webkit-user-select: none;
27
+ -moz-user-select: none;
28
+ -ms-user-select: none;
29
+ user-select: none;
30
+ }
31
+
32
+ .dialog-type-lightbox .dialog-widget-content {
33
+ margin: auto;
34
+ }
35
+
36
+ .dialog-type-lightbox .dialog-header {
37
+ font-size: 15px;
38
+ color: #495157;
39
+ padding: 30px 0 10px;
40
+ font-weight: 500;
41
+ }
42
+
43
+ .dialog-type-lightbox .dialog-message {
44
+ padding: 0 30px 30px;
45
+ min-height: 50px;
46
+ }
47
+
48
+ .dialog-type-lightbox:not(.elementor-popup-modal) .dialog-header,
49
+ .dialog-type-lightbox:not(.elementor-popup-modal) .dialog-message {
50
+ text-align: center;
51
+ }
52
+
53
+ .dialog-type-lightbox .dialog-buttons-wrapper {
54
+ border-top: 1px solid #e6e9ec;
55
+ text-align: center;
56
+ }
57
+
58
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button {
59
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
60
+ width: 50%;
61
+ border: none;
62
+ background: none;
63
+ font-size: 15px;
64
+ cursor: pointer;
65
+ padding: 13px 0;
66
+ outline: 0;
67
+ }
68
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button:hover {
69
+ background-color: #f4f6f7; }
70
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button.dialog-ok {
71
+ color: #b01b1b; }
72
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button.dialog-take_over {
73
+ color: #39b54a; }
74
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button:active {
75
+ background-color: rgba(230, 233, 236, 0.5); }
76
+ .dialog-type-lightbox .dialog-buttons-wrapper > .dialog-button::-moz-focus-inner {
77
+ border: 0; }
78
+
79
+ .ast-sites-modal .dialog-widget-content {
80
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
81
+ background-color: #f1f3f5;
82
+ width: 100%; }
83
+ @media (max-width: 1439px) {
84
+ .ast-sites-modal .dialog-widget-content {
85
+ max-width: 990px; } }
86
+ @media (min-width: 1440px) {
87
+ .ast-sites-modal .dialog-widget-content {
88
+ max-width: 1200px; } }
89
+
90
+ .ast-sites-modal .dialog-header {
91
+ padding: 0;
92
+ background-color: #fff;
93
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
94
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
95
+ position: relative;
96
+ z-index: 1; }
97
+
98
+ .ast-sites-modal .dialog-buttons-wrapper {
99
+ background-color: #fff;
100
+ border: none;
101
+ display: none;
102
+ -webkit-box-pack: end;
103
+ -webkit-justify-content: flex-end;
104
+ -ms-flex-pack: end;
105
+ justify-content: flex-end;
106
+ padding: 5px;
107
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
108
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
109
+ position: relative; }
110
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button {
111
+ height: 40px;
112
+ margin-left: 5px; }
113
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button-success {
114
+ padding: 12px 36px;
115
+ color: #fff;
116
+ width: initial;
117
+ font-size: 15px; }
118
+ .ast-sites-modal .dialog-buttons-wrapper .elementor-button-success:hover {
119
+ background-color: #39b54a; }
120
+
121
+ .ast-sites-modal .dialog-message {
122
+ height: 750px;
123
+ max-height: 85vh;
124
+ overflow: auto;
125
+ padding-top: 25px; }
126
+
127
+ .ast-sites-modal .dialog-content {
128
+ height: 100%; }
129
+
130
+ .ast-sites-modal .dialog-loading {
131
+ display: none; }
132
+
133
+ .ast-sites-modal__header {
134
+ display: -webkit-box;
135
+ display: -webkit-flex;
136
+ display: -ms-flexbox;
137
+ display: flex;
138
+ -webkit-box-align: center;
139
+ -webkit-align-items: center;
140
+ -ms-flex-align: center;
141
+ align-items: center;
142
+ -webkit-box-pack: justify;
143
+ -webkit-justify-content: space-between;
144
+ -ms-flex-pack: justify;
145
+ justify-content: space-between;
146
+ height: 50px; }
147
+ .ast-sites-modal__header__logo {
148
+ line-height: 1;
149
+ text-transform: uppercase;
150
+ font-weight: bold;
151
+ cursor: pointer; }
152
+ .ast-sites-modal__header__logo-area {
153
+ text-align: left;
154
+ padding-left: 15px; }
155
+ .ast-sites-modal__header__logo-area > * {
156
+ display: -webkit-box;
157
+ display: -webkit-flex;
158
+ display: -ms-flexbox;
159
+ display: flex;
160
+ -webkit-box-align: center;
161
+ -webkit-align-items: center;
162
+ -ms-flex-align: center;
163
+ align-items: center; }
164
+ .ast-sites-modal__header__logo__icon-wrapper {
165
+ padding: 4px 7px 6px;
166
+ background-image: -webkit-linear-gradient(225deg, #f2295b, #434363);
167
+ background-image: -o-linear-gradient(225deg, #f2295b, #434363);
168
+ background-image: linear-gradient(-135deg, #f2295b, #434363);
169
+ -webkit-border-radius: 2px;
170
+ border-radius: 2px;
171
+ margin-right: 10px; }
172
+ .ast-sites-modal__header__logo__title {
173
+ padding-top: 2px; }
174
+ .ast-sites-modal__header__logo i {
175
+ color: #fff;
176
+ font-size: 10px; }
177
+ .ast-sites-modal__header__items-area {
178
+ display: -webkit-box;
179
+ display: -webkit-flex;
180
+ display: -ms-flexbox;
181
+ display: flex;
182
+ -webkit-box-orient: horizontal;
183
+ -webkit-box-direction: reverse;
184
+ -webkit-flex-direction: row-reverse;
185
+ -ms-flex-direction: row-reverse;
186
+ flex-direction: row-reverse; }
187
+ .ast-sites-modal__header__item {
188
+ position: relative;
189
+ display: -webkit-box;
190
+ display: -webkit-flex;
191
+ display: -ms-flexbox;
192
+ display: flex;
193
+ -webkit-box-align: center;
194
+ -webkit-align-items: center;
195
+ -ms-flex-align: center;
196
+ align-items: center;
197
+ -webkit-box-pack: center;
198
+ -webkit-justify-content: center;
199
+ -ms-flex-pack: center;
200
+ justify-content: center;
201
+ -webkit-box-sizing: content-box;
202
+ box-sizing: content-box; }
203
+ .ast-sites-modal__header__item > i {
204
+ font-size: 20px;
205
+ -webkit-transition: all 0.3s;
206
+ -o-transition: all 0.3s;
207
+ transition: all 0.3s;
208
+ cursor: pointer; }
209
+ .ast-sites-modal__header__item > i:not(:hover) {
210
+ color: #a4afb7; }
211
+ .ast-sites-modal__header__close--normal {
212
+ width: 45px;
213
+ border-left: 1px solid #e6e9ec; }
214
+ .ast-sites-modal__header__close--normal i {
215
+ font-size: 18px; }
216
+ .ast-sites-modal__header__close--skip {
217
+ padding: 10px;
218
+ padding-left: 20px;
219
+ margin-right: 10px;
220
+ color: #fff;
221
+ background-color: #a4afb7;
222
+ font-size: 11px;
223
+ font-weight: normal;
224
+ line-height: 1;
225
+ text-transform: uppercase;
226
+ -webkit-border-radius: 2px;
227
+ border-radius: 2px;
228
+ cursor: pointer; }
229
+ .ast-sites-modal__header__close--skip > i {
230
+ font-size: inherit;
231
+ padding-left: 10px;
232
+ margin-left: 15px;
233
+ border-left: 1px solid; }
234
+ .ast-sites-modal__header__close--skip > i:not(:hover) {
235
+ color: #fff; }
236
+
237
+ .ast-sites-modal__sidebar {
238
+ width: 25%;
239
+ background-color: rgba(255, 255, 255, 0.3); }
240
+
241
+ .ast-sites-modal__content {
242
+ -webkit-box-flex: 1;
243
+ -webkit-flex-grow: 1;
244
+ -ms-flex-positive: 1;
245
+ flex-grow: 1;
246
+ -webkit-box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
247
+ box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05); }
inc/assets/css/elementor-admin-dark-rtl.css ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-library-template-inner,
2
+ .ast-sites-dark-mode #ast-sites-modal .inner,
3
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-library-template:not(.elementor-template-library-template-page) .elementor-template-library-template-footer,
4
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter {
5
+ background-color: #404349;
6
+ }
7
+
8
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites__sync-wrap:hover span,
9
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__close--normal:hover i,
10
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout:hover i {
11
+ color: #ffffff;
12
+ }
13
+
14
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter {
15
+ border-color: #7d7e82;
16
+ }
17
+
18
+ .ast-sites-dark-mode .select2-container--default .select2-selection--single .select2-selection__arrow b {
19
+ border-color: #E0E1E3 transparent transparent transparent;
20
+ }
21
+
22
+
23
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar,
24
+ .ast-sites-dark-mode #ast-sites-modal .single-site-pages::-webkit-scrollbar {
25
+ background-color: #34383C;
26
+ }
27
+
28
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-thumb,
29
+ .ast-sites-dark-mode #ast-sites-modal .single-site-pages::-webkit-scrollbar-thumb {
30
+ background-color: #7d7e82;
31
+ }
32
+
33
+ .ast-sites-dark-mode .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
34
+ border-color: transparent transparent #E0E1E3 transparent;
35
+ }
36
+
37
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-floating-notice-wrap {
38
+ background: #404349;
39
+ }
40
+
41
+ .ast-sites-dark-mode #ast-sites-modal .notice-dismiss:before {
42
+ color: #E0E1E3;
43
+ }
44
+
45
+ .ast-sites-dark-mode #ast-sites-modal .dialog-widget-content,
46
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item,
47
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-sync-library-button,
48
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__item > i:not(:hover),
49
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter,
50
+ .ast-sites-dark-mode.astra-sites__elementor-open #ast-sites-modal .select2-container--default .select2-selection__rendered,
51
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-no-sites h3,
52
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout,
53
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip .dashicons-editor-help {
54
+ color: #E0E1E3;
55
+ }
56
+
57
+ .ast-sites-dark-mode #ast-sites-modal .dialog-widget-content,
58
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-no-sites .inner {
59
+ background-color: #34383C;
60
+ }
61
+
62
+ .ast-sites-dark-mode #ast-sites-modal .dialog-header {
63
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
64
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
65
+ }
66
+
67
+ .ast-sites-dark-mode #ast-sites-modal.dialog-type-lightbox .dialog-header,
68
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input,
69
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:hover,
70
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:focus,
71
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:active {
72
+ background-color: #26292C;
73
+ }
74
+
75
+ .ast-sites-dark-mode #ast-sites-modal .ast-tooltip-wrap::before {
76
+ border: 8px solid #7d7e82;
77
+ border-bottom-style: solid;
78
+ border-right-color: transparent;
79
+ border-left-color: transparent;
80
+ border-top: none;
81
+ }
82
+
83
+ .ast-sites-dark-mode #ast-sites-modal .ast-tooltip-wrap {
84
+ background: #7d7e82;
85
+ }
86
+
87
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input {
88
+ border-color: #7d7e82;
89
+ }
90
+
91
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__logo,
92
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout,
93
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip {
94
+ border-left: 1px solid #32363A;
95
+ }
96
+
97
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item,
98
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites__sync-wrap,
99
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__close--normal,
100
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip {
101
+ border-right: 1px solid #32363A;
102
+ }
103
+
104
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item.elementor-active {
105
+ background-image: -webkit-gradient(linear, right top, right bottom, from(#26292C), to(#4C4F56));
106
+ background-image: -webkit-linear-gradient(top, #26292C, #4C4F56);
107
+ background-image: -o-linear-gradient(top, #26292C, #4C4F56);
108
+ background-image: linear-gradient(to bottom, #26292C, #4C4F56);
109
+ }
inc/assets/css/elementor-admin-dark.css ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-library-template-inner,
2
+ .ast-sites-dark-mode #ast-sites-modal .inner,
3
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-library-template:not(.elementor-template-library-template-page) .elementor-template-library-template-footer,
4
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter {
5
+ background-color: #404349;
6
+ }
7
+
8
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites__sync-wrap:hover span,
9
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__close--normal:hover i,
10
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout:hover i {
11
+ color: #ffffff;
12
+ }
13
+
14
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter {
15
+ border-color: #7d7e82;
16
+ }
17
+
18
+ .ast-sites-dark-mode .select2-container--default .select2-selection--single .select2-selection__arrow b {
19
+ border-color: #E0E1E3 transparent transparent transparent;
20
+ }
21
+
22
+
23
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar,
24
+ .ast-sites-dark-mode #ast-sites-modal .single-site-pages::-webkit-scrollbar {
25
+ background-color: #34383C;
26
+ }
27
+
28
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-thumb,
29
+ .ast-sites-dark-mode #ast-sites-modal .single-site-pages::-webkit-scrollbar-thumb {
30
+ background-color: #7d7e82;
31
+ }
32
+
33
+ .ast-sites-dark-mode .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
34
+ border-color: transparent transparent #E0E1E3 transparent;
35
+ }
36
+
37
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-floating-notice-wrap {
38
+ background: #404349;
39
+ }
40
+
41
+ .ast-sites-dark-mode #ast-sites-modal .notice-dismiss:before {
42
+ color: #E0E1E3;
43
+ }
44
+
45
+ .ast-sites-dark-mode #ast-sites-modal .dialog-widget-content,
46
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item,
47
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-sync-library-button,
48
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__item > i:not(:hover),
49
+ .ast-sites-dark-mode #ast-sites-modal .astra-blocks-filter,
50
+ .ast-sites-dark-mode.astra-sites__elementor-open #ast-sites-modal .select2-container--default .select2-selection__rendered,
51
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-no-sites h3,
52
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout,
53
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip .dashicons-editor-help {
54
+ color: #E0E1E3;
55
+ }
56
+
57
+ .ast-sites-dark-mode #ast-sites-modal .dialog-widget-content,
58
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-no-sites .inner {
59
+ background-color: #34383C;
60
+ }
61
+
62
+ .ast-sites-dark-mode #ast-sites-modal .dialog-header {
63
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
64
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
65
+ }
66
+
67
+ .ast-sites-dark-mode #ast-sites-modal.dialog-type-lightbox .dialog-header,
68
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input,
69
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:hover,
70
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:focus,
71
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input:active {
72
+ background-color: #26292C;
73
+ }
74
+
75
+ .ast-sites-dark-mode #ast-sites-modal .ast-tooltip-wrap::before {
76
+ border: 8px solid #7d7e82;
77
+ border-bottom-style: solid;
78
+ border-left-color: transparent;
79
+ border-right-color: transparent;
80
+ border-top: none;
81
+ }
82
+
83
+ .ast-sites-dark-mode #ast-sites-modal .ast-tooltip-wrap {
84
+ background: #7d7e82;
85
+ }
86
+
87
+ .ast-sites-dark-mode #ast-sites-modal #wp-filter-search-input {
88
+ border-color: #7d7e82;
89
+ }
90
+
91
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__logo,
92
+ .ast-sites-dark-mode #ast-sites-modal .back-to-layout,
93
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip {
94
+ border-right: 1px solid #32363A;
95
+ }
96
+
97
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item,
98
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites__sync-wrap,
99
+ .ast-sites-dark-mode #ast-sites-modal .ast-sites-modal__header__close--normal,
100
+ .ast-sites-dark-mode #ast-sites-modal .astra-sites-tooltip {
101
+ border-left: 1px solid #32363A;
102
+ }
103
+
104
+ .ast-sites-dark-mode #ast-sites-modal .elementor-template-library-menu-item.elementor-active {
105
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#26292C), to(#4C4F56));
106
+ background-image: -webkit-linear-gradient(top, #26292C, #4C4F56);
107
+ background-image: -o-linear-gradient(top, #26292C, #4C4F56);
108
+ background-image: linear-gradient(to bottom, #26292C, #4C4F56);
109
+ }
inc/assets/css/elementor-admin-rtl.css ADDED
@@ -0,0 +1,1114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-add-new-section .elementor-add-ast-site-button:not(.ast-elementor-white-label) {
2
+ margin-right: 5px;
3
+ background-image: url( '../images/logo.svg' );
4
+ background-repeat: no-repeat;
5
+ background-position: center center;
6
+ background-size: contain;
7
+ }
8
+
9
+ .elementor-add-ast-site-button:not(.ast-elementor-white-label) .eicon-folder {
10
+ opacity: 0;
11
+ }
12
+
13
+ .elementor-add-new-section .elementor-add-ast-site-button.ast-elementor-white-label {
14
+ margin-right: 5px;
15
+ background-color: #6d7882;
16
+ }
17
+
18
+ .elementor-add-new-section .elementor-add-ast-site-button i.fa {
19
+ visibility: hidden
20
+ }
21
+
22
+ #ast-sites-modal {
23
+ display: none;
24
+ }
25
+
26
+ #ast-sites-modal .agency-icon {
27
+ width: 20px;
28
+ }
29
+
30
+ #ast-sites-modal.dialog-type-lightbox .dialog-header {
31
+ padding: 0;
32
+ }
33
+
34
+ #ast-sites-modal .ast-sites-modal__header__logo__text-wrapper {
35
+ width: auto;
36
+ padding: 0;
37
+ padding-left: 12px;
38
+ }
39
+
40
+ #ast-sites-modal .ast-sites-modal__header__logo__icon-wrapper {
41
+ background-image: url( '../images/logo.svg' );
42
+ -webkit-border-radius: 2px;
43
+ background-repeat: no-repeat;
44
+ background-position: center center;
45
+ background-size: contain;
46
+ width: 30px;
47
+ height: 30px;
48
+ padding: 4px 7px 6px;
49
+ -webkit-border-radius: 2px;
50
+ border-radius: 2px;
51
+ margin-left: 15px;
52
+ }
53
+
54
+ #ast-sites-modal .astra-blocks-category-wrap {
55
+ text-align: right;
56
+ padding: 0 10px 15px 10px;
57
+ display: flex;
58
+ justify-content: space-between;
59
+ }
60
+
61
+ #ast-sites-modal .astra-blocks-filter {
62
+ background: #fff;
63
+ width: 150px;
64
+ padding-right: 5px;
65
+ padding-left: 20px;
66
+ height: 28px;
67
+ color: #6d7882;
68
+ }
69
+
70
+ #ast-sites-modal .astra-blocks-category-inner-wrap .select2-container {
71
+ width: 150px !important;
72
+ }
73
+
74
+ #ast-sites-modal .required-plugins-list li.plugin-card-head {
75
+ list-style-type: none;
76
+ border-bottom: 1px solid #e4e7ea;
77
+ padding-bottom: 12px;
78
+ margin-bottom: 7px;
79
+ margin-right: -16px;
80
+ }
81
+
82
+ #ast-sites-modal .required-plugins-list li.plugin-card-head.no-plugin {
83
+ list-style-type: none;
84
+ border-bottom: none;
85
+ padding-bottom: 0;
86
+ margin-bottom: 0;
87
+ margin-right: -16px;
88
+ }
89
+
90
+ #ast-sites-modal .required-plugins-list {
91
+ margin: 0;
92
+ padding: 0;
93
+ margin-right: 16px;
94
+ margin-top: .5em;
95
+ margin-bottom: .5em;
96
+ list-style-type: disc;
97
+ }
98
+
99
+ #ast-sites-modal .astra-sites-library-template:not(:hover) .elementor-template-library-template-preview,
100
+ #ast-sites-modal .inner:not(:hover) .elementor-template-library-template-preview {
101
+ opacity: 0;
102
+ }
103
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-preview,
104
+ #ast-sites-modal .inner .elementor-template-library-template-preview {
105
+ position: absolute;
106
+ top: 0;
107
+ right: 0;
108
+ width: 100%;
109
+ height: 100%;
110
+ background-color: rgba(0, 0, 0, 0.5);
111
+ -webkit-transition: opacity .2s;
112
+ -o-transition: opacity .2s;
113
+ transition: opacity .2s;
114
+ cursor: pointer;
115
+ }
116
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-preview i,
117
+ #ast-sites-modal .inner .elementor-template-library-template-preview i {
118
+ color: #d5dadf;
119
+ position: absolute;
120
+ top: 50%;
121
+ right: 50%;
122
+ -webkit-transform: translateX(50%) translateY(-50%);
123
+ -ms-transform: translateX(50%) translateY(-50%);
124
+ transform: translateX(50%) translateY(-50%);
125
+ font-size: 24px;
126
+ }
127
+ #ast-sites-modal .astra-sites-library-template:not(.elementor-template-library-template-page) .elementor-template-library-template-footer {
128
+ padding: 7px;
129
+ padding-right: 5px;
130
+ background-color: #fff;
131
+ -webkit-transition: -webkit-transform .2s;
132
+ transition: -webkit-transform .2s;
133
+ -o-transition: transform .2s;
134
+ transition: transform .2s;
135
+ transition: transform .2s, -webkit-transform .2s;
136
+ }
137
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-footer {
138
+ display: -webkit-box;
139
+ display: -webkit-flex;
140
+ display: -ms-flexbox;
141
+ display: flex;
142
+ -webkit-box-pack: justify;
143
+ -webkit-justify-content: space-between;
144
+ -ms-flex-pack: justify;
145
+ justify-content: space-between;
146
+ margin-top: 4px;
147
+ font-size: 11px;
148
+ line-height: 1;
149
+ }
150
+ #ast-sites-modal .theme-browser .theme .theme-screenshot:after {
151
+ padding-top: 200px;
152
+ }
153
+ #ast-sites-modal .required-plugins-list li {
154
+ list-style-type: disc;
155
+ }
156
+ #ast-sites-modal .ast-tooltip-wrap {
157
+ position: absolute;
158
+ right: 0px;
159
+ top: 61px;
160
+ background: #fff;
161
+ box-shadow: 0 3px 10px rgba(25, 30, 35, 0.12);
162
+ padding: 14px;
163
+ border-radius: 2px;
164
+ opacity: 0;
165
+ }
166
+
167
+ #ast-sites-modal .ast-tooltip-wrap::before {
168
+ border: 8px solid #fff;
169
+ content: "";
170
+ position: absolute;
171
+ height: 0;
172
+ width: 0;
173
+ line-height: 0;
174
+ top: -8px;
175
+ right: 28%;
176
+ border-bottom-style: solid;
177
+ border-right-color: transparent;
178
+ border-left-color: transparent;
179
+ border-top: none;
180
+ margin-right: -10px;
181
+ }
182
+
183
+ #ast-sites-modal .ast-tooltip-wrap.ast-show-tooltip {
184
+ display: block;
185
+ }
186
+
187
+ #ast-sites-modal .ast-tooltip-wrap {
188
+ display: none;
189
+ }
190
+
191
+ #ast-sites-modal .required-plugins-list {
192
+ text-align: right;
193
+ font-size: 12px;
194
+ font-weight: 300;
195
+ }
196
+
197
+ #ast-sites-modal .dialog-background-lightbox {
198
+ position: fixed;
199
+ height: 100%;
200
+ width: 100%;
201
+ top: 0;
202
+ right: 0;
203
+ z-index: 1;
204
+ -webkit-user-select: none;
205
+ -moz-user-select: none;
206
+ -ms-user-select: none;
207
+ user-select: none;
208
+ }
209
+
210
+ #ast-sites-modal .dialog-widget-content {
211
+ background-color: #f1f3f5;
212
+ width: 95vw;
213
+ height: 760px;
214
+ max-width: 1200px;
215
+ max-height: 95vh;
216
+ overflow-y: auto;
217
+ overflow-x: hidden;
218
+ top: 50%;
219
+ right: 50%;
220
+ transform: translate(50%, -50%);
221
+ z-index: 9999;
222
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
223
+ width: 100%;
224
+ }
225
+
226
+ #ast-sites-modal .select2-search__field {
227
+ width: 93% !important
228
+ }
229
+
230
+ #ast-sites-modal .dialog-header {
231
+ padding: 0;
232
+ background-color: #fff;
233
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
234
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
235
+ position: relative;
236
+ z-index: 1;
237
+ }
238
+
239
+ #ast-sites-modal .dialog-buttons-wrapper {
240
+ background-color: #fff;
241
+ border: none;
242
+ display: none;
243
+ -webkit-box-pack: end;
244
+ -webkit-justify-content: flex-end;
245
+ -ms-flex-pack: end;
246
+ justify-content: flex-end;
247
+ padding: 5px;
248
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
249
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
250
+ position: relative;
251
+ }
252
+
253
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button {
254
+ height: 40px;
255
+ margin-right: 5px;
256
+ }
257
+
258
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button-success {
259
+ padding: 12px 36px;
260
+ color: #fff;
261
+ width: initial;
262
+ font-size: 15px;
263
+ }
264
+
265
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button-success:hover {
266
+ background-color: #39b54a;
267
+ }
268
+
269
+ #ast-sites-modal .astra-sites-content-wrap {
270
+ height: 706px;
271
+ max-height: 85vh;
272
+ overflow: auto;
273
+ padding-top: 15px;
274
+ }
275
+
276
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar,
277
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar {
278
+ width: 5px;
279
+ background-color: #f1f1f1;
280
+ }
281
+
282
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-thumb,
283
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar-thumb {
284
+ border-radius: 0;
285
+ background-color: #aaaaaa;
286
+ }
287
+
288
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-track,
289
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar-track {
290
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
291
+ width: 20px;
292
+ }
293
+
294
+ #ast-sites-modal .dialog-content {
295
+ height: 100%;
296
+ }
297
+
298
+ #ast-sites-modal .dialog-loading {
299
+ display: none;
300
+ }
301
+
302
+ #ast-sites-modal .astra-sites-search-wrap {
303
+ padding: 0 30px 20px;
304
+ margin-right: 1em;
305
+ }
306
+
307
+ #ast-sites-modal .ast-sites-modal__header {
308
+ display: -webkit-box;
309
+ display: -webkit-flex;
310
+ display: -ms-flexbox;
311
+ display: flex;
312
+ -webkit-box-align: center;
313
+ -webkit-align-items: center;
314
+ -ms-flex-align: center;
315
+ align-items: center;
316
+ -webkit-box-pack: justify;
317
+ -webkit-justify-content: space-between;
318
+ -ms-flex-pack: justify;
319
+ justify-content: space-between;
320
+ height: 54px;
321
+ }
322
+
323
+ #ast-sites-modal .ast-sites-modal__header__logo {
324
+ line-height: 1;
325
+ text-transform: uppercase;
326
+ font-weight: bold;
327
+ cursor: pointer;
328
+ border-left: 1px solid #e6e9ec;
329
+ }
330
+
331
+ #ast-sites-modal .back-to-layout:before {
332
+ line-height: 21px;
333
+ width: 21px;
334
+ height: 21px;
335
+ }
336
+
337
+ #ast-sites-modal .ast-sites-modal__header__logo-area {
338
+ text-align: right;
339
+ padding-right: 12px;
340
+ display: -webkit-box;
341
+ display: -webkit-flex;
342
+ display: -ms-flexbox;
343
+ display: flex;
344
+ width: 150px;
345
+ }
346
+
347
+ #ast-sites-modal .elementor-template-library-header-menu {
348
+ width: 100%;
349
+ display: flex;
350
+ display: -webkit-box;
351
+ display: -webkit-flex;
352
+ display: -ms-flexbox;
353
+ text-align: center;
354
+ color: #6d7882;
355
+ font-size: 13px;
356
+ }
357
+
358
+ #ast-sites-modal .ast-sites-modal__options .elementor-template-library-header-menu {
359
+ height: 54px;
360
+ }
361
+
362
+ #ast-sites-modal .astra-sites__sync-wrap {
363
+ padding: 20px;
364
+ border-right: 1px solid #e6e9ec;
365
+ cursor: pointer;
366
+ }
367
+
368
+ #ast-sites-modal .astra-sites__sync-wrap:hover span {
369
+ color: #6d7882;
370
+ }
371
+
372
+ #ast-sites-modal .back-to-layout:hover {
373
+ background-color: transparent;
374
+ }
375
+
376
+ #ast-sites-modal .back-to-layout i {
377
+ font-size: 24px;
378
+ width: 24px;
379
+ height: 24px;
380
+ }
381
+
382
+ #ast-sites-modal .theme-browser .theme {
383
+ width: 20%;
384
+ padding: 15px;
385
+ margin: 0;
386
+ }
387
+
388
+ #ast-sites-modal .dialog-message {
389
+ height: calc( 100% - 30px );
390
+ padding: 10px 30px 30px 30px;
391
+ }
392
+
393
+ #ast-sites-modal .dialog-lightbox-content-block .theme {
394
+ width: 33.3%;
395
+ }
396
+
397
+ #ast-sites-modal .dialog-lightbox-content-block.theme-browser .theme .theme-screenshot:after {
398
+ padding-top: 40%;
399
+ }
400
+
401
+ #ast-sites-modal .ast-sites-modal__header__logo-area > * {
402
+ display: -webkit-box;
403
+ display: -webkit-flex;
404
+ display: -ms-flexbox;
405
+ display: flex;
406
+ -webkit-box-align: center;
407
+ -webkit-align-items: center;
408
+ -ms-flex-align: center;
409
+ align-items: center;
410
+ }
411
+
412
+ #ast-sites-modal .ast-sites-modal__header__logo__title {
413
+ padding-top: 2px;
414
+ }
415
+
416
+ #ast-sites-modal .ast-sites-modal__header__logo i {
417
+ color: #fff;
418
+ font-size: 10px;
419
+ }
420
+
421
+ #ast-sites-modal .ast-sites-modal__header__items-area {
422
+ display: -webkit-box;
423
+ display: -webkit-flex;
424
+ display: -ms-flexbox;
425
+ display: flex;
426
+ -webkit-box-orient: horizontal;
427
+ -webkit-box-direction: reverse;
428
+ -webkit-flex-direction: row-reverse;
429
+ -ms-flex-direction: row-reverse;
430
+ flex-direction: row-reverse;
431
+ }
432
+
433
+ #ast-sites-modal .ast-sites-modal__header__item {
434
+ position: relative;
435
+ display: -webkit-box;
436
+ display: -webkit-flex;
437
+ display: -ms-flexbox;
438
+ display: flex;
439
+ -webkit-box-align: center;
440
+ -webkit-align-items: center;
441
+ -ms-flex-align: center;
442
+ align-items: center;
443
+ -webkit-box-pack: center;
444
+ -webkit-justify-content: center;
445
+ -ms-flex-pack: center;
446
+ justify-content: center;
447
+ -webkit-box-sizing: content-box;
448
+ box-sizing: content-box;
449
+ cursor: pointer;
450
+ }
451
+
452
+ #ast-sites-modal .ast-sites-modal__header__close--normal .dashicons {
453
+ color: #aaa;
454
+ font-size: 22px;
455
+ }
456
+
457
+ #ast-sites-modal .ast-sites-modal__header__item > i {
458
+ font-size: 20px;
459
+ -webkit-transition: all 0.3s;
460
+ -o-transition: all 0.3s;
461
+ transition: all 0.3s;
462
+ }
463
+
464
+ #ast-sites-modal .ast-sites-modal__header__item > i:not(:hover) {
465
+ color: #a4afb7;
466
+ }
467
+
468
+ #ast-sites-modal .ast-sites-modal__header__close--normal {
469
+ width: 54px;
470
+ height: 54px;
471
+ border-right: 1px solid #e6e9ec;
472
+ }
473
+
474
+ #ast-sites-modal .ast-sites-modal__header__close--normal:hover i {
475
+ color: #6d7882;
476
+ }
477
+
478
+ #ast-sites-modal .ast-sites-modal__header__close--normal i {
479
+ font-size: 18px;
480
+ }
481
+
482
+ #ast-sites-modal .ast-sites-modal__header__close--skip {
483
+ padding: 10px;
484
+ padding-right: 20px;
485
+ margin-left: 10px;
486
+ color: #fff;
487
+ background-color: #a4afb7;
488
+ font-size: 11px;
489
+ font-weight: normal;
490
+ line-height: 1;
491
+ text-transform: uppercase;
492
+ -webkit-border-radius: 2px;
493
+ border-radius: 2px;
494
+ cursor: pointer;
495
+ }
496
+
497
+ #ast-sites-modal .ast-sites-modal__header__close--skip > i {
498
+ font-size: inherit;
499
+ padding-right: 10px;
500
+ margin-right: 15px;
501
+ border-right: 1px solid;
502
+ }
503
+
504
+ #ast-sites-modal .ast-sites-modal__header__close--skip > i:not(:hover) {
505
+ color: #fff;
506
+ }
507
+
508
+ #ast-sites-modal .ast-sites-modal__sidebar {
509
+ width: 25%;
510
+ background-color: rgba(255, 255, 255, 0.3);
511
+ }
512
+
513
+ #ast-sites-modal .ast-sites-modal__content {
514
+ -webkit-box-flex: 1;
515
+ -webkit-flex-grow: 1;
516
+ -ms-flex-positive: 1;
517
+ flex-grow: 1;
518
+ -webkit-box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
519
+ box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
520
+ }
521
+
522
+ .theme-browser .theme {
523
+ cursor: pointer;
524
+ float: right;
525
+ margin: 0 0 4% 4%;
526
+ position: relative;
527
+ width: 30.6%;
528
+ border: 1px solid #ddd;
529
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
530
+ box-sizing: border-box;
531
+ }
532
+
533
+ #ast-sites-modal .inner {
534
+ position: relative;
535
+ padding: 8px 8px 0 8px;
536
+ background: #fff;
537
+ overflow: initial;
538
+ -webkit-box-shadow: 0 1px 20px 0 rgba(0, 0, 0, 0.07);
539
+ box-shadow: 0 1px 20px 0 rgba(0, 0, 0, 0.07);
540
+ -webkit-border-radius: 3px;
541
+ border-radius: 3px;
542
+ }
543
+
544
+ #ast-sites-modal .astra-sites-no-sites .description {
545
+ font-size: 13px;
546
+ margin: 0;
547
+ }
548
+
549
+ #ast-sites-modal .astra-sites-no-sites .description a,
550
+ #ast-sites-modal .ast-tooltip-inner-wrap a {
551
+ color: #0073aa;
552
+ }
553
+
554
+ #ast-sites-modal .astra-sites-no-sites .description a:hover,
555
+ #ast-sites-modal .astra-sites-no-sites .description a:active,
556
+ #ast-sites-modal .astra-sites-no-sites .description a:focus,
557
+ #ast-sites-modal .ast-tooltip-inner-wrap a:hover,
558
+ #ast-sites-modal .ast-tooltip-inner-wrap a:active,
559
+ #ast-sites-modal .ast-tooltip-inner-wrap a:focus {
560
+ color: #00a0d2;
561
+ }
562
+
563
+ #ast-sites-modal .astra-sites-no-sites .content {
564
+ justify-content: center;
565
+ }
566
+
567
+ #ast-sites-modal .astra-sites-no-sites .inner {
568
+ background: transparent;
569
+ box-shadow: none;
570
+ }
571
+
572
+ #ast-sites-modal .astra-sites-no-sites .button.astra-sites-back {
573
+ display: inline-block;
574
+ text-decoration: none;
575
+ font-size: 13px;
576
+ line-height: 26px;
577
+ height: 28px;
578
+ margin: 0;
579
+ padding: 0 10px 1px;
580
+ cursor: pointer;
581
+ border-width: 1px;
582
+ border-style: solid;
583
+ -webkit-appearance: none;
584
+ border-radius: 3px;
585
+ white-space: nowrap;
586
+ box-sizing: border-box;
587
+ background: #fafafa;
588
+ border-color: #999;
589
+ color: #23282d;
590
+ }
591
+
592
+ #ast-sites-modal .astra-sites-no-sites h3 {
593
+ margin-bottom: 1.2em;
594
+ }
595
+
596
+ .theme-browser .theme .theme-screenshot:after {
597
+ content: "";
598
+ display: block;
599
+ padding-top: 66.66666%;
600
+ }
601
+
602
+ #ast-sites-modal .theme-name {
603
+ height: auto;
604
+ width: calc( 100% - 1em );
605
+ align-self: center;
606
+ box-shadow: none;
607
+ background: none;
608
+ padding: 7px;
609
+ padding-right: 0;
610
+ font-size: 11px;
611
+ font-weight: normal;
612
+ text-align: right;
613
+ }
614
+
615
+ #ast-sites-modal .theme-browser {
616
+ display: -webkit-box;
617
+ display: -ms-flexbox;
618
+ display: flex;
619
+ -ms-flex-wrap: wrap;
620
+ flex-wrap: wrap;
621
+ }
622
+
623
+ #ast-sites-modal .astra-sites-no-sites {
624
+ width: 100%;
625
+ }
626
+
627
+ #ast-sites-modal .elementor-template-library-menu-item {
628
+ line-height: 1em;
629
+ width: 108px;
630
+ padding: 18px 0;
631
+ display: inline-block;
632
+ border-right: 1px solid #e6e9ec;
633
+ }
634
+
635
+ #ast-sites-modal .elementor-template-library-menu-item:hover {
636
+ color: #6d7882;
637
+ }
638
+
639
+ #ast-sites-modal .elementor-template-library-menu-item span {
640
+ margin-left: 10px;
641
+ font-size: 16px;
642
+ }
643
+
644
+ #ast-sites-modal .astra-sites-sync-library-button span {
645
+ font-size: 16px;
646
+ }
647
+
648
+ #ast-sites-modal .elementor-template-library-menu-item.elementor-active {
649
+ border-bottom: 4px solid #0073aa;
650
+ background-image: linear-gradient(to bottom, #f1f3f5, #fff);
651
+ color: #6d7882;
652
+ }
653
+
654
+ #ast-sites-modal .theme-preview,
655
+ #ast-sites-modal .theme-preview-block {
656
+ display: none;
657
+ margin: 0 1.3%;
658
+ margin-top: 10px;
659
+ }
660
+
661
+ #ast-sites-modal .ast-validate {
662
+ font-size: 13px;
663
+ line-height: 1.5;
664
+ }
665
+
666
+ #ast-sites-modal .ast-library-template-insert.action-done:before {
667
+ content: "\f147";
668
+ display: inline-block;
669
+ margin-left: 10px;
670
+ font: normal 20px/1 'dashicons';
671
+ -webkit-font-smoothing: antialiased;
672
+ -moz-osx-font-smoothing: grayscale;
673
+ vertical-align: middle;
674
+ }
675
+
676
+ #ast-sites-modal .ast-import-elementor-template.action-done:after {
677
+ content: "\f504";
678
+ display: inline-block;
679
+ margin-right: 10px;
680
+ font: normal 20px/1 'dashicons';
681
+ -webkit-font-smoothing: antialiased;
682
+ -moz-osx-font-smoothing: grayscale;
683
+ vertical-align: middle;
684
+ }
685
+
686
+ #ast-sites-modal .ast-library-template-insert.installing:before,
687
+ #ast-sites-modal .ast-import-elementor-template.installing:before {
688
+ content: "\f463";
689
+ display: inline-block;
690
+ margin-left: 10px;
691
+ font: normal 20px/1 'dashicons';
692
+ -webkit-font-smoothing: antialiased;
693
+ -moz-osx-font-smoothing: grayscale;
694
+ vertical-align: middle;
695
+ -webkit-animation: cssAnimation .72s ease infinite;
696
+ -moz-animation: cssAnimation .72s ease infinite;
697
+ -o-animation: cssAnimation .72s ease infinite;
698
+ -ms-animation: cssAnimation .72s ease infinite;
699
+ animation: cssAnimation .72s ease infinite;
700
+ }
701
+
702
+ @-webkit-keyframes cssAnimation {
703
+ from {
704
+ -webkit-transform: rotate(0);
705
+ -moz-transform: rotate(0);
706
+ -o-transform: rotate(0);
707
+ -ms-transform: rotate(0);
708
+ transform: rotate(0);
709
+ }
710
+ to {
711
+ -webkit-transform: rotate(-360deg);
712
+ -moz-transform: rotate(-360deg);
713
+ -o-transform: rotate(-360deg);
714
+ -ms-transform: rotate(-360deg);
715
+ transform: rotate(-360deg);
716
+ }
717
+ }
718
+ @-moz-keyframes cssAnimation {
719
+ from {
720
+ -webkit-transform: rotate(0);
721
+ -moz-transform: rotate(0);
722
+ -o-transform: rotate(0);
723
+ -ms-transform: rotate(0);
724
+ transform: rotate(0);
725
+ }
726
+ to {
727
+ -webkit-transform: rotate(-360deg);
728
+ -moz-transform: rotate(-360deg);
729
+ -o-transform: rotate(-360deg);
730
+ -ms-transform: rotate(-360deg);
731
+ transform: rotate(-360deg);
732
+ }
733
+ }
734
+ @-o-keyframes cssAnimation {
735
+ from {
736
+ -webkit-transform: rotate(0);
737
+ -moz-transform: rotate(0);
738
+ -o-transform: rotate(0);
739
+ -ms-transform: rotate(0);
740
+ transform: rotate(0);
741
+ }
742
+ to {
743
+ -webkit-transform: rotate(-360deg);
744
+ -moz-transform: rotate(-360deg);
745
+ -o-transform: rotate(-360deg);
746
+ -ms-transform: rotate(-360deg);
747
+ transform: rotate(-360deg);
748
+ }
749
+ }
750
+
751
+ #ast-sites-modal .astra-sites-library-template {
752
+ position: relative;
753
+ width: 33.333%;
754
+ overflow: hidden;
755
+ padding: 15px;
756
+ margin: 0;
757
+ cursor: pointer;
758
+ }
759
+
760
+ #ast-sites-modal .elementor-template-library-template-body {
761
+ display: -webkit-box;
762
+ display: -ms-flexbox;
763
+ display: flex;
764
+ position: relative;
765
+ }
766
+
767
+ #ast-sites-modal .elementor-template-library-template-body img {
768
+ width:100%;
769
+ }
770
+
771
+ #ast-sites-modal .astra-sites-library-template-inner {
772
+ margin: 0;
773
+ -webkit-border-radius: 2px;
774
+ border-radius: 2px;
775
+ -webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,.07);
776
+ box-shadow: 0 1px 20px 0 rgba(0,0,0,.07);
777
+ padding: 8px 8px 0 8px;
778
+ background: #fff;
779
+ position: relative;
780
+ }
781
+
782
+ #ast-sites-modal .elementor-template-library-template-remote:not(.elementor-template-library-template-page) {
783
+ display: inline-table;
784
+ }
785
+
786
+ #ast-sites-modal .theme-preview img,
787
+ #ast-sites-modal .theme-preview-block img {
788
+ width: 100%;
789
+ }
790
+
791
+ #ast-sites-modal .dialog-lightbox-back {
792
+ background: #fff;
793
+ padding: 10px 10px;
794
+ text-align: right;
795
+ margin-bottom: 20px;
796
+ }
797
+
798
+ #ast-sites-modal .dialog-lightbox-back span {
799
+ cursor: pointer;
800
+ font-weight: bold;
801
+ }
802
+
803
+ #ast-sites-modal .ast-sites-modal__header__menu-area {
804
+ position: relative;
805
+ display: -webkit-box;
806
+ display: -webkit-flex;
807
+ display: -ms-flexbox;
808
+ display: flex;
809
+ -webkit-box-align: center;
810
+ -webkit-align-items: center;
811
+ -ms-flex-align: center;
812
+ align-items: center;
813
+ margin-left: 140px;
814
+ margin-right: 50px;
815
+ flex: 1;
816
+ }
817
+
818
+ #ast-sites-modal .back-to-layout {
819
+ height: 54px;
820
+ padding: 14px;
821
+ }
822
+
823
+ #ast-sites-modal .search-form {
824
+ width: 100%;
825
+ font-weight: normal;
826
+ border: none;
827
+ margin: 0;
828
+ border-radius: 6px;
829
+ position: relative;
830
+ }
831
+ #ast-sites-modal .icon-search {
832
+ position: absolute;
833
+ left: 0;
834
+ top: 0;
835
+ color: #C3C3C3;
836
+ padding: 15px 12px 12px 19px;
837
+ }
838
+ #ast-sites-modal ::-webkit-input-placeholder {
839
+ color: #72777c;
840
+ }
841
+ #ast-sites-modal .astra-sites-sync-library-button.updating-message {
842
+ color: #0073aa;
843
+ }
844
+
845
+ #ast-sites-modal #wp-filter-search-input {
846
+ width: 100%;
847
+ opacity: 1;
848
+ background: #fff;
849
+ line-height: 40px;
850
+ border-bottom: 1px solid #ddd;
851
+ border-radius: 6px;
852
+ font-size: 13px;
853
+ padding: 5px 20px;
854
+ border: 1px solid #ddd;
855
+ box-shadow: none;
856
+ height: 40px;
857
+ }
858
+
859
+ #ast-sites-modal #wp-filter-search-input:hover,
860
+ #ast-sites-modal #wp-filter-search-input:focus {
861
+ border: 1px solid #bbb;
862
+ }
863
+
864
+ #ast-sites-modal #wp-filter-search-input.searching {
865
+ border-bottom-right-radius: 0;
866
+ border-bottom-left-radius: 0;
867
+ border-bottom-color: transparent;
868
+ border-color: rgba(223,225,229,0);
869
+ box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28);
870
+ }
871
+
872
+ #ast-sites-modal .single-site-pages-wrap {
873
+ text-align: right;
874
+ }
875
+
876
+ #ast-sites-modal .astra-site-title {
877
+ margin-bottom: 20px;
878
+ text-align: right;
879
+ }
880
+
881
+ #ast-sites-modal .astra-site-contents,
882
+ #ast-sites-modal .astra-sites-import-template,
883
+ #ast-sites-modal .astra-sites-create-page-wrap {
884
+ margin-bottom: 40px;
885
+ }
886
+
887
+ #ast-sites-modal .astra-sites-import-template-notice,
888
+ #ast-sites-modal .astra-sites-create-page-wrap-notice {
889
+ font-size: 15px;
890
+ color: #767676;
891
+ padding: 5px 0 10px;
892
+ }
893
+
894
+ #ast-sites-modal .ast-sites-floating-notice {
895
+ font-size: 13px;
896
+ line-height: 1.5em;
897
+ position: relative;
898
+ }
899
+
900
+ #ast-sites-modal .agency-ribbons {
901
+ top: -5px;
902
+ font-size: 9px;
903
+ left: -5px;
904
+ line-height: 14px;
905
+ padding: 4px 8px;
906
+ }
907
+
908
+ .ast-sites-floating-notice-wrap {
909
+ background: #fff;
910
+ border: 1px solid #ccd0d4;
911
+ border-right-width: 4px;
912
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
913
+ margin: 5px 15px 2px;
914
+ padding: 1px 12px;
915
+ }
916
+
917
+ #ast-sites-modal .notice-dismiss:before {
918
+ background: none;
919
+ color: #72777c;
920
+ content: "\f153";
921
+ display: block;
922
+ font: normal 16px/20px dashicons;
923
+ font-size: 14px;
924
+ speak: none;
925
+ height: 20px;
926
+ text-align: center;
927
+ width: 20px;
928
+ -webkit-font-smoothing: antialiased;
929
+ -moz-osx-font-smoothing: grayscale;
930
+ }
931
+
932
+ #ast-sites-modal .notice-dismiss:hover:before,
933
+ #ast-sites-modal .notice-dismiss:active:before,
934
+ #ast-sites-modal .notice-dismiss:focus:before {
935
+ color: #c00;
936
+ }
937
+
938
+ #ast-sites-modal .ast-sites-floating-notice-wrap.refreshed-notice {
939
+ border-right: 5px solid #46b450;
940
+ }
941
+
942
+ #ast-sites-modal button.notice-dismiss {
943
+ position: absolute;
944
+ top: 0;
945
+ left: 1px;
946
+ border: none;
947
+ margin: 0;
948
+ background: none;
949
+ color: #72777c;
950
+ cursor: pointer;
951
+ padding:0;
952
+ }
953
+
954
+ #ast-sites-modal .button-hero {
955
+ background: #0085ba;
956
+ border-color: #0073aa #006799 #006799;
957
+ box-shadow: 0 1px 0 #006799;
958
+ color: #fff;
959
+ text-decoration: none;
960
+ text-shadow: 0 -1px 1px #006799, -1px 0 1px #006799, 0 1px 1px #006799, 1px 0 1px #006799;
961
+ cursor: pointer;
962
+ border-width: 1px;
963
+ border-style: solid;
964
+ -webkit-appearance: none;
965
+ border-radius: 3px;
966
+ white-space: nowrap;
967
+ box-sizing: border-box;
968
+ }
969
+
970
+ #ast-sites-modal .button-hero.site-preview-button {
971
+ color: #555;
972
+ border-color: #cccccc;
973
+ background: #f7f7f7;
974
+ box-shadow: 0 1px 0 #cccccc;
975
+ vertical-align: top;
976
+ text-shadow: none;
977
+ }
978
+
979
+ #ast-sites-modal form {
980
+ display: flex;
981
+ }
982
+
983
+ #ast-sites-modal form .ast-importer-create-button {
984
+ margin-right: 10px;
985
+ }
986
+
987
+ #ast-sites-modal form input {
988
+ width: 50%;
989
+ padding: 10px 20px;
990
+ }
991
+
992
+ #ast-sites-modal .astra-sites-import-template-action .button {
993
+ display: inline-block;
994
+ cursor: pointer;
995
+ }
996
+
997
+ #ast-sites-modal .ast-library-template-insert {
998
+ margin-left: 15px;
999
+ }
1000
+
1001
+ #ast-sites-modal .astra-sites-import-template-action .button-hero.disabled {
1002
+ color: #66c6e4 !important;
1003
+ background: #008ec2 !important;
1004
+ border-color: #007cb2 !important;
1005
+ box-shadow: none !important;
1006
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
1007
+ cursor: default;
1008
+ }
1009
+
1010
+ #ast-sites-modal .single-site-footer {
1011
+ margin-right: 0;
1012
+ padding-left: 15px;
1013
+ padding-right: 30px;
1014
+ }
1015
+
1016
+ #ast-sites-modal .single-site-preview {
1017
+ margin-left: 0;
1018
+ max-height: calc( 100vh - 160px );
1019
+ height: auto;
1020
+ }
1021
+
1022
+ #ast-sites-modal .ast-sites-floating-notice-wrap {
1023
+ margin: -5px 45px -5px 35px;
1024
+ margin-top: 0px !important;
1025
+ background: #ffffff;
1026
+ padding: 8px 15px;
1027
+ border-right: 4px solid #00a0d2;
1028
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
1029
+ border-radius: 2px;
1030
+ vertical-align: middle;
1031
+ z-index: 99999;
1032
+ text-align: right;
1033
+ margin-top: -10px;
1034
+ display: none;
1035
+ }
1036
+
1037
+ #ast-sites-modal .ast-sites-floating-notice-wrap.slide-out {
1038
+ display: none;
1039
+ }
1040
+
1041
+ #ast-sites-modal .ast-sites-floating-notice-wrap.slide-in {
1042
+ display: block;
1043
+ }
1044
+
1045
+ @keyframes slide-in {
1046
+ 100% { transform: translateX(0%); }
1047
+ }
1048
+
1049
+ @-webkit-keyframes slide-in {
1050
+ 100% { -webkit-transform: translateX(0%); }
1051
+ }
1052
+
1053
+ @keyframes slide-out {
1054
+ 0% { transform: translateX(0%); }
1055
+ 100% { transform: translateX(-120%); }
1056
+ }
1057
+
1058
+ @-webkit-keyframes slide-out {
1059
+ 0% { -webkit-transform: translateX(0%); }
1060
+ 100% { -webkit-transform: translateX(-120%); }
1061
+ }
1062
+
1063
+ #ast-sites-modal .single-site-preview-wrap {
1064
+ width: 100%;
1065
+ }
1066
+
1067
+ #ast-sites-modal .astra-sites-tooltip {
1068
+ margin-right: 15px;
1069
+ margin-left: 15px;
1070
+ padding-right: 15px;
1071
+ padding-left:15px;
1072
+ height: 54px;
1073
+ border-right: 1px solid #e6e9ec;
1074
+ border-left: 1px solid #e6e9ec;
1075
+ opacity: 0;
1076
+ }
1077
+
1078
+ #ast-sites-modal .astra-sites-tooltip-icon {
1079
+ line-height: 54px;
1080
+ }
1081
+
1082
+ #ast-sites-modal .astra-sites-tooltip .dashicons-editor-help {
1083
+ font-size: 20px;
1084
+ color: #555d66;
1085
+ }
1086
+
1087
+ #ast-sites-modal .astra-preview-actions-inner-wrap {
1088
+ position: relative;
1089
+ }
1090
+
1091
+ #ast-sites-modal .astra-preview-actions-wrap {
1092
+ margin-left: 15px;
1093
+ }
1094
+
1095
+ #ast-sites-modal .site-action-buttons-wrap .dashicons {
1096
+ margin-right: 0;
1097
+ }
1098
+
1099
+ #ast-sites-modal .position-left-last {
1100
+ margin-left: auto;
1101
+ }
1102
+
1103
+ @media (max-width: 768px) {
1104
+ #ast-sites-modal .theme-browser .theme {
1105
+ width: 33.33%;
1106
+ box-shadow: none;
1107
+ }
1108
+ #ast-sites-modal .position-left-last {
1109
+ width: 120px;
1110
+ }
1111
+ #ast-sites-modal .ast-sites-modal__header__menu-area {
1112
+ margin: 0 10px;
1113
+ }
1114
+ }
inc/assets/css/elementor-admin.css ADDED
@@ -0,0 +1,1114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-add-new-section .elementor-add-ast-site-button:not(.ast-elementor-white-label) {
2
+ margin-left: 5px;
3
+ background-image: url( '../images/logo.svg' );
4
+ background-repeat: no-repeat;
5
+ background-position: center center;
6
+ background-size: contain;
7
+ }
8
+
9
+ .elementor-add-ast-site-button:not(.ast-elementor-white-label) .eicon-folder {
10
+ opacity: 0;
11
+ }
12
+
13
+ .elementor-add-new-section .elementor-add-ast-site-button.ast-elementor-white-label {
14
+ margin-left: 5px;
15
+ background-color: #6d7882;
16
+ }
17
+
18
+ .elementor-add-new-section .elementor-add-ast-site-button i.fa {
19
+ visibility: hidden
20
+ }
21
+
22
+ #ast-sites-modal {
23
+ display: none;
24
+ }
25
+
26
+ #ast-sites-modal .agency-icon {
27
+ width: 20px;
28
+ }
29
+
30
+ #ast-sites-modal.dialog-type-lightbox .dialog-header {
31
+ padding: 0;
32
+ }
33
+
34
+ #ast-sites-modal .ast-sites-modal__header__logo__text-wrapper {
35
+ width: auto;
36
+ padding: 0;
37
+ padding-right: 12px;
38
+ }
39
+
40
+ #ast-sites-modal .ast-sites-modal__header__logo__icon-wrapper {
41
+ background-image: url( '../images/logo.svg' );
42
+ -webkit-border-radius: 2px;
43
+ background-repeat: no-repeat;
44
+ background-position: center center;
45
+ background-size: contain;
46
+ width: 30px;
47
+ height: 30px;
48
+ padding: 4px 7px 6px;
49
+ -webkit-border-radius: 2px;
50
+ border-radius: 2px;
51
+ margin-right: 15px;
52
+ }
53
+
54
+ #ast-sites-modal .astra-blocks-category-wrap {
55
+ text-align: left;
56
+ padding: 0 10px 15px 10px;
57
+ display: flex;
58
+ justify-content: space-between;
59
+ }
60
+
61
+ #ast-sites-modal .astra-blocks-filter {
62
+ background: #fff;
63
+ width: 150px;
64
+ padding-left: 5px;
65
+ padding-right: 20px;
66
+ height: 28px;
67
+ color: #6d7882;
68
+ }
69
+
70
+ #ast-sites-modal .astra-blocks-category-inner-wrap .select2-container {
71
+ width: 150px !important;
72
+ }
73
+
74
+ #ast-sites-modal .required-plugins-list li.plugin-card-head {
75
+ list-style-type: none;
76
+ border-bottom: 1px solid #e4e7ea;
77
+ padding-bottom: 12px;
78
+ margin-bottom: 7px;
79
+ margin-left: -16px;
80
+ }
81
+
82
+ #ast-sites-modal .required-plugins-list li.plugin-card-head.no-plugin {
83
+ list-style-type: none;
84
+ border-bottom: none;
85
+ padding-bottom: 0;
86
+ margin-bottom: 0;
87
+ margin-left: -16px;
88
+ }
89
+
90
+ #ast-sites-modal .required-plugins-list {
91
+ margin: 0;
92
+ padding: 0;
93
+ margin-left: 16px;
94
+ margin-top: .5em;
95
+ margin-bottom: .5em;
96
+ list-style-type: disc;
97
+ }
98
+
99
+ #ast-sites-modal .astra-sites-library-template:not(:hover) .elementor-template-library-template-preview,
100
+ #ast-sites-modal .inner:not(:hover) .elementor-template-library-template-preview {
101
+ opacity: 0;
102
+ }
103
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-preview,
104
+ #ast-sites-modal .inner .elementor-template-library-template-preview {
105
+ position: absolute;
106
+ top: 0;
107
+ left: 0;
108
+ width: 100%;
109
+ height: 100%;
110
+ background-color: rgba(0, 0, 0, 0.5);
111
+ -webkit-transition: opacity .2s;
112
+ -o-transition: opacity .2s;
113
+ transition: opacity .2s;
114
+ cursor: pointer;
115
+ }
116
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-preview i,
117
+ #ast-sites-modal .inner .elementor-template-library-template-preview i {
118
+ color: #d5dadf;
119
+ position: absolute;
120
+ top: 50%;
121
+ left: 50%;
122
+ -webkit-transform: translateX(-50%) translateY(-50%);
123
+ -ms-transform: translateX(-50%) translateY(-50%);
124
+ transform: translateX(-50%) translateY(-50%);
125
+ font-size: 24px;
126
+ }
127
+ #ast-sites-modal .astra-sites-library-template:not(.elementor-template-library-template-page) .elementor-template-library-template-footer {
128
+ padding: 7px;
129
+ padding-left: 5px;
130
+ background-color: #fff;
131
+ -webkit-transition: -webkit-transform .2s;
132
+ transition: -webkit-transform .2s;
133
+ -o-transition: transform .2s;
134
+ transition: transform .2s;
135
+ transition: transform .2s, -webkit-transform .2s;
136
+ }
137
+ #ast-sites-modal .astra-sites-library-template .elementor-template-library-template-footer {
138
+ display: -webkit-box;
139
+ display: -webkit-flex;
140
+ display: -ms-flexbox;
141
+ display: flex;
142
+ -webkit-box-pack: justify;
143
+ -webkit-justify-content: space-between;
144
+ -ms-flex-pack: justify;
145
+ justify-content: space-between;
146
+ margin-top: 4px;
147
+ font-size: 11px;
148
+ line-height: 1;
149
+ }
150
+ #ast-sites-modal .theme-browser .theme .theme-screenshot:after {
151
+ padding-top: 200px;
152
+ }
153
+ #ast-sites-modal .required-plugins-list li {
154
+ list-style-type: disc;
155
+ }
156
+ #ast-sites-modal .ast-tooltip-wrap {
157
+ position: absolute;
158
+ left: 0px;
159
+ top: 61px;
160
+ background: #fff;
161
+ box-shadow: 0 3px 10px rgba(25, 30, 35, 0.12);
162
+ padding: 14px;
163
+ border-radius: 2px;
164
+ opacity: 0;
165
+ }
166
+
167
+ #ast-sites-modal .ast-tooltip-wrap::before {
168
+ border: 8px solid #fff;
169
+ content: "";
170
+ position: absolute;
171
+ height: 0;
172
+ width: 0;
173
+ line-height: 0;
174
+ top: -8px;
175
+ left: 28%;
176
+ border-bottom-style: solid;
177
+ border-left-color: transparent;
178
+ border-right-color: transparent;
179
+ border-top: none;
180
+ margin-left: -10px;
181
+ }
182
+
183
+ #ast-sites-modal .ast-tooltip-wrap.ast-show-tooltip {
184
+ display: block;
185
+ }
186
+
187
+ #ast-sites-modal .ast-tooltip-wrap {
188
+ display: none;
189
+ }
190
+
191
+ #ast-sites-modal .required-plugins-list {
192
+ text-align: left;
193
+ font-size: 12px;
194
+ font-weight: 300;
195
+ }
196
+
197
+ #ast-sites-modal .dialog-background-lightbox {
198
+ position: fixed;
199
+ height: 100%;
200
+ width: 100%;
201
+ top: 0;
202
+ left: 0;
203
+ z-index: 1;
204
+ -webkit-user-select: none;
205
+ -moz-user-select: none;
206
+ -ms-user-select: none;
207
+ user-select: none;
208
+ }
209
+
210
+ #ast-sites-modal .dialog-widget-content {
211
+ background-color: #f1f3f5;
212
+ width: 95vw;
213
+ height: 760px;
214
+ max-width: 1200px;
215
+ max-height: 95vh;
216
+ overflow-y: auto;
217
+ overflow-x: hidden;
218
+ top: 50%;
219
+ left: 50%;
220
+ transform: translate(-50%, -50%);
221
+ z-index: 9999;
222
+ font-family: Roboto, Arial, Helvetica, Verdana, sans-serif;
223
+ width: 100%;
224
+ }
225
+
226
+ #ast-sites-modal .select2-search__field {
227
+ width: 93% !important
228
+ }
229
+
230
+ #ast-sites-modal .dialog-header {
231
+ padding: 0;
232
+ background-color: #fff;
233
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
234
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
235
+ position: relative;
236
+ z-index: 1;
237
+ }
238
+
239
+ #ast-sites-modal .dialog-buttons-wrapper {
240
+ background-color: #fff;
241
+ border: none;
242
+ display: none;
243
+ -webkit-box-pack: end;
244
+ -webkit-justify-content: flex-end;
245
+ -ms-flex-pack: end;
246
+ justify-content: flex-end;
247
+ padding: 5px;
248
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
249
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
250
+ position: relative;
251
+ }
252
+
253
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button {
254
+ height: 40px;
255
+ margin-left: 5px;
256
+ }
257
+
258
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button-success {
259
+ padding: 12px 36px;
260
+ color: #fff;
261
+ width: initial;
262
+ font-size: 15px;
263
+ }
264
+
265
+ #ast-sites-modal .dialog-buttons-wrapper .elementor-button-success:hover {
266
+ background-color: #39b54a;
267
+ }
268
+
269
+ #ast-sites-modal .astra-sites-content-wrap {
270
+ height: 706px;
271
+ max-height: 85vh;
272
+ overflow: auto;
273
+ padding-top: 15px;
274
+ }
275
+
276
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar,
277
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar {
278
+ width: 5px;
279
+ background-color: #f1f1f1;
280
+ }
281
+
282
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-thumb,
283
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar-thumb {
284
+ border-radius: 0;
285
+ background-color: #aaaaaa;
286
+ }
287
+
288
+ #ast-sites-modal .astra-sites-content-wrap::-webkit-scrollbar-track,
289
+ #ast-sites-modal .single-site-pages::-webkit-scrollbar-track {
290
+ -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,.3);
291
+ width: 20px;
292
+ }
293
+
294
+ #ast-sites-modal .dialog-content {
295
+ height: 100%;
296
+ }
297
+
298
+ #ast-sites-modal .dialog-loading {
299
+ display: none;
300
+ }
301
+
302
+ #ast-sites-modal .astra-sites-search-wrap {
303
+ padding: 0 30px 20px;
304
+ margin-left: 1em;
305
+ }
306
+
307
+ #ast-sites-modal .ast-sites-modal__header {
308
+ display: -webkit-box;
309
+ display: -webkit-flex;
310
+ display: -ms-flexbox;
311
+ display: flex;
312
+ -webkit-box-align: center;
313
+ -webkit-align-items: center;
314
+ -ms-flex-align: center;
315
+ align-items: center;
316
+ -webkit-box-pack: justify;
317
+ -webkit-justify-content: space-between;
318
+ -ms-flex-pack: justify;
319
+ justify-content: space-between;
320
+ height: 54px;
321
+ }
322
+
323
+ #ast-sites-modal .ast-sites-modal__header__logo {
324
+ line-height: 1;
325
+ text-transform: uppercase;
326
+ font-weight: bold;
327
+ cursor: pointer;
328
+ border-right: 1px solid #e6e9ec;
329
+ }
330
+
331
+ #ast-sites-modal .back-to-layout:before {
332
+ line-height: 21px;
333
+ width: 21px;
334
+ height: 21px;
335
+ }
336
+
337
+ #ast-sites-modal .ast-sites-modal__header__logo-area {
338
+ text-align: left;
339
+ padding-left: 12px;
340
+ display: -webkit-box;
341
+ display: -webkit-flex;
342
+ display: -ms-flexbox;
343
+ display: flex;
344
+ width: 150px;
345
+ }
346
+
347
+ #ast-sites-modal .elementor-template-library-header-menu {
348
+ width: 100%;
349
+ display: flex;
350
+ display: -webkit-box;
351
+ display: -webkit-flex;
352
+ display: -ms-flexbox;
353
+ text-align: center;
354
+ color: #6d7882;
355
+ font-size: 13px;
356
+ }
357
+
358
+ #ast-sites-modal .ast-sites-modal__options .elementor-template-library-header-menu {
359
+ height: 54px;
360
+ }
361
+
362
+ #ast-sites-modal .astra-sites__sync-wrap {
363
+ padding: 20px;
364
+ border-left: 1px solid #e6e9ec;
365
+ cursor: pointer;
366
+ }
367
+
368
+ #ast-sites-modal .astra-sites__sync-wrap:hover span {
369
+ color: #6d7882;
370
+ }
371
+
372
+ #ast-sites-modal .back-to-layout:hover {
373
+ background-color: transparent;
374
+ }
375
+
376
+ #ast-sites-modal .back-to-layout i {
377
+ font-size: 24px;
378
+ width: 24px;
379
+ height: 24px;
380
+ }
381
+
382
+ #ast-sites-modal .theme-browser .theme {
383
+ width: 20%;
384
+ padding: 15px;
385
+ margin: 0;
386
+ }
387
+
388
+ #ast-sites-modal .dialog-message {
389
+ height: calc( 100% - 30px );
390
+ padding: 10px 30px 30px 30px;
391
+ }
392
+
393
+ #ast-sites-modal .dialog-lightbox-content-block .theme {
394
+ width: 33.3%;
395
+ }
396
+
397
+ #ast-sites-modal .dialog-lightbox-content-block.theme-browser .theme .theme-screenshot:after {
398
+ padding-top: 40%;
399
+ }
400
+
401
+ #ast-sites-modal .ast-sites-modal__header__logo-area > * {
402
+ display: -webkit-box;
403
+ display: -webkit-flex;
404
+ display: -ms-flexbox;
405
+ display: flex;
406
+ -webkit-box-align: center;
407
+ -webkit-align-items: center;
408
+ -ms-flex-align: center;
409
+ align-items: center;
410
+ }
411
+
412
+ #ast-sites-modal .ast-sites-modal__header__logo__title {
413
+ padding-top: 2px;
414
+ }
415
+
416
+ #ast-sites-modal .ast-sites-modal__header__logo i {
417
+ color: #fff;
418
+ font-size: 10px;
419
+ }
420
+
421
+ #ast-sites-modal .ast-sites-modal__header__items-area {
422
+ display: -webkit-box;
423
+ display: -webkit-flex;
424
+ display: -ms-flexbox;
425
+ display: flex;
426
+ -webkit-box-orient: horizontal;
427
+ -webkit-box-direction: reverse;
428
+ -webkit-flex-direction: row-reverse;
429
+ -ms-flex-direction: row-reverse;
430
+ flex-direction: row-reverse;
431
+ }
432
+
433
+ #ast-sites-modal .ast-sites-modal__header__item {
434
+ position: relative;
435
+ display: -webkit-box;
436
+ display: -webkit-flex;
437
+ display: -ms-flexbox;
438
+ display: flex;
439
+ -webkit-box-align: center;
440
+ -webkit-align-items: center;
441
+ -ms-flex-align: center;
442
+ align-items: center;
443
+ -webkit-box-pack: center;
444
+ -webkit-justify-content: center;
445
+ -ms-flex-pack: center;
446
+ justify-content: center;
447
+ -webkit-box-sizing: content-box;
448
+ box-sizing: content-box;
449
+ cursor: pointer;
450
+ }
451
+
452
+ #ast-sites-modal .ast-sites-modal__header__close--normal .dashicons {
453
+ color: #aaa;
454
+ font-size: 22px;
455
+ }
456
+
457
+ #ast-sites-modal .ast-sites-modal__header__item > i {
458
+ font-size: 20px;
459
+ -webkit-transition: all 0.3s;
460
+ -o-transition: all 0.3s;
461
+ transition: all 0.3s;
462
+ }
463
+
464
+ #ast-sites-modal .ast-sites-modal__header__item > i:not(:hover) {
465
+ color: #a4afb7;
466
+ }
467
+
468
+ #ast-sites-modal .ast-sites-modal__header__close--normal {
469
+ width: 54px;
470
+ height: 54px;
471
+ border-left: 1px solid #e6e9ec;
472
+ }
473
+
474
+ #ast-sites-modal .ast-sites-modal__header__close--normal:hover i {
475
+ color: #6d7882;
476
+ }
477
+
478
+ #ast-sites-modal .ast-sites-modal__header__close--normal i {
479
+ font-size: 18px;
480
+ }
481
+
482
+ #ast-sites-modal .ast-sites-modal__header__close--skip {
483
+ padding: 10px;
484
+ padding-left: 20px;
485
+ margin-right: 10px;
486
+ color: #fff;
487
+ background-color: #a4afb7;
488
+ font-size: 11px;
489
+ font-weight: normal;
490
+ line-height: 1;
491
+ text-transform: uppercase;
492
+ -webkit-border-radius: 2px;
493
+ border-radius: 2px;
494
+ cursor: pointer;
495
+ }
496
+
497
+ #ast-sites-modal .ast-sites-modal__header__close--skip > i {
498
+ font-size: inherit;
499
+ padding-left: 10px;
500
+ margin-left: 15px;
501
+ border-left: 1px solid;
502
+ }
503
+
504
+ #ast-sites-modal .ast-sites-modal__header__close--skip > i:not(:hover) {
505
+ color: #fff;
506
+ }
507
+
508
+ #ast-sites-modal .ast-sites-modal__sidebar {
509
+ width: 25%;
510
+ background-color: rgba(255, 255, 255, 0.3);
511
+ }
512
+
513
+ #ast-sites-modal .ast-sites-modal__content {
514
+ -webkit-box-flex: 1;
515
+ -webkit-flex-grow: 1;
516
+ -ms-flex-positive: 1;
517
+ flex-grow: 1;
518
+ -webkit-box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
519
+ box-shadow: 0 0 13px inset rgba(0, 0, 0, 0.05);
520
+ }
521
+
522
+ .theme-browser .theme {
523
+ cursor: pointer;
524
+ float: left;
525
+ margin: 0 4% 4% 0;
526
+ position: relative;
527
+ width: 30.6%;
528
+ border: 1px solid #ddd;
529
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.1);
530
+ box-sizing: border-box;
531
+ }
532
+
533
+ #ast-sites-modal .inner {
534
+ position: relative;
535
+ padding: 8px 8px 0 8px;
536
+ background: #fff;
537
+ overflow: initial;
538
+ -webkit-box-shadow: 0 1px 20px 0 rgba(0, 0, 0, 0.07);
539
+ box-shadow: 0 1px 20px 0 rgba(0, 0, 0, 0.07);
540
+ -webkit-border-radius: 3px;
541
+ border-radius: 3px;
542
+ }
543
+
544
+ #ast-sites-modal .astra-sites-no-sites .description {
545
+ font-size: 13px;
546
+ margin: 0;
547
+ }
548
+
549
+ #ast-sites-modal .astra-sites-no-sites .description a,
550
+ #ast-sites-modal .ast-tooltip-inner-wrap a {
551
+ color: #0073aa;
552
+ }
553
+
554
+ #ast-sites-modal .astra-sites-no-sites .description a:hover,
555
+ #ast-sites-modal .astra-sites-no-sites .description a:active,
556
+ #ast-sites-modal .astra-sites-no-sites .description a:focus,
557
+ #ast-sites-modal .ast-tooltip-inner-wrap a:hover,
558
+ #ast-sites-modal .ast-tooltip-inner-wrap a:active,
559
+ #ast-sites-modal .ast-tooltip-inner-wrap a:focus {
560
+ color: #00a0d2;
561
+ }
562
+
563
+ #ast-sites-modal .astra-sites-no-sites .content {
564
+ justify-content: center;
565
+ }
566
+
567
+ #ast-sites-modal .astra-sites-no-sites .inner {
568
+ background: transparent;
569
+ box-shadow: none;
570
+ }
571
+
572
+ #ast-sites-modal .astra-sites-no-sites .button.astra-sites-back {
573
+ display: inline-block;
574
+ text-decoration: none;
575
+ font-size: 13px;
576
+ line-height: 26px;
577
+ height: 28px;
578
+ margin: 0;
579
+ padding: 0 10px 1px;
580
+ cursor: pointer;
581
+ border-width: 1px;
582
+ border-style: solid;
583
+ -webkit-appearance: none;
584
+ border-radius: 3px;
585
+ white-space: nowrap;
586
+ box-sizing: border-box;
587
+ background: #fafafa;
588
+ border-color: #999;
589
+ color: #23282d;
590
+ }
591
+
592
+ #ast-sites-modal .astra-sites-no-sites h3 {
593
+ margin-bottom: 1.2em;
594
+ }
595
+
596
+ .theme-browser .theme .theme-screenshot:after {
597
+ content: "";
598
+ display: block;
599
+ padding-top: 66.66666%;
600
+ }
601
+
602
+ #ast-sites-modal .theme-name {
603
+ height: auto;
604
+ width: calc( 100% - 1em );
605
+ align-self: center;
606
+ box-shadow: none;
607
+ background: none;
608
+ padding: 7px;
609
+ padding-left: 0;
610
+ font-size: 11px;
611
+ font-weight: normal;
612
+ text-align: left;
613
+ }
614
+
615
+ #ast-sites-modal .theme-browser {
616
+ display: -webkit-box;
617
+ display: -ms-flexbox;
618
+ display: flex;
619
+ -ms-flex-wrap: wrap;
620
+ flex-wrap: wrap;
621
+ }
622
+
623
+ #ast-sites-modal .astra-sites-no-sites {
624
+ width: 100%;
625
+ }
626
+
627
+ #ast-sites-modal .elementor-template-library-menu-item {
628
+ line-height: 1em;
629
+ width: 108px;
630
+ padding: 18px 0;
631
+ display: inline-block;
632
+ border-left: 1px solid #e6e9ec;
633
+ }
634
+
635
+ #ast-sites-modal .elementor-template-library-menu-item:hover {
636
+ color: #6d7882;
637
+ }
638
+
639
+ #ast-sites-modal .elementor-template-library-menu-item span {
640
+ margin-right: 10px;
641
+ font-size: 16px;
642
+ }
643
+
644
+ #ast-sites-modal .astra-sites-sync-library-button span {
645
+ font-size: 16px;
646
+ }
647
+
648
+ #ast-sites-modal .elementor-template-library-menu-item.elementor-active {
649
+ border-bottom: 4px solid #0073aa;
650
+ background-image: linear-gradient(to bottom, #f1f3f5, #fff);
651
+ color: #6d7882;
652
+ }
653
+
654
+ #ast-sites-modal .theme-preview,
655
+ #ast-sites-modal .theme-preview-block {
656
+ display: none;
657
+ margin: 0 1.3%;
658
+ margin-top: 10px;
659
+ }
660
+
661
+ #ast-sites-modal .ast-validate {
662
+ font-size: 13px;
663
+ line-height: 1.5;
664
+ }
665
+
666
+ #ast-sites-modal .ast-library-template-insert.action-done:before {
667
+ content: "\f147";
668
+ display: inline-block;
669
+ margin-right: 10px;
670
+ font: normal 20px/1 'dashicons';
671
+ -webkit-font-smoothing: antialiased;
672
+ -moz-osx-font-smoothing: grayscale;
673
+ vertical-align: middle;
674
+ }
675
+
676
+ #ast-sites-modal .ast-import-elementor-template.action-done:after {
677
+ content: "\f504";
678
+ display: inline-block;
679
+ margin-left: 10px;
680
+ font: normal 20px/1 'dashicons';
681
+ -webkit-font-smoothing: antialiased;
682
+ -moz-osx-font-smoothing: grayscale;
683
+ vertical-align: middle;
684
+ }
685
+
686
+ #ast-sites-modal .ast-library-template-insert.installing:before,
687
+ #ast-sites-modal .ast-import-elementor-template.installing:before {
688
+ content: "\f463";
689
+ display: inline-block;
690
+ margin-right: 10px;
691
+ font: normal 20px/1 'dashicons';
692
+ -webkit-font-smoothing: antialiased;
693
+ -moz-osx-font-smoothing: grayscale;
694
+ vertical-align: middle;
695
+ -webkit-animation: cssAnimation .72s ease infinite;
696
+ -moz-animation: cssAnimation .72s ease infinite;
697
+ -o-animation: cssAnimation .72s ease infinite;
698
+ -ms-animation: cssAnimation .72s ease infinite;
699
+ animation: cssAnimation .72s ease infinite;
700
+ }
701
+
702
+ @-webkit-keyframes cssAnimation {
703
+ from {
704
+ -webkit-transform: rotate(0);
705
+ -moz-transform: rotate(0);
706
+ -o-transform: rotate(0);
707
+ -ms-transform: rotate(0);
708
+ transform: rotate(0);
709
+ }
710
+ to {
711
+ -webkit-transform: rotate(360deg);
712
+ -moz-transform: rotate(360deg);
713
+ -o-transform: rotate(360deg);
714
+ -ms-transform: rotate(360deg);
715
+ transform: rotate(360deg);
716
+ }
717
+ }
718
+ @-moz-keyframes cssAnimation {
719
+ from {
720
+ -webkit-transform: rotate(0);
721
+ -moz-transform: rotate(0);
722
+ -o-transform: rotate(0);
723
+ -ms-transform: rotate(0);
724
+ transform: rotate(0);
725
+ }
726
+ to {
727
+ -webkit-transform: rotate(360deg);
728
+ -moz-transform: rotate(360deg);
729
+ -o-transform: rotate(360deg);
730
+ -ms-transform: rotate(360deg);
731
+ transform: rotate(360deg);
732
+ }
733
+ }
734
+ @-o-keyframes cssAnimation {
735
+ from {
736
+ -webkit-transform: rotate(0);
737
+ -moz-transform: rotate(0);
738
+ -o-transform: rotate(0);
739
+ -ms-transform: rotate(0);
740
+ transform: rotate(0);
741
+ }
742
+ to {
743
+ -webkit-transform: rotate(360deg);
744
+ -moz-transform: rotate(360deg);
745
+ -o-transform: rotate(360deg);
746
+ -ms-transform: rotate(360deg);
747
+ transform: rotate(360deg);
748
+ }
749
+ }
750
+
751
+ #ast-sites-modal .astra-sites-library-template {
752
+ position: relative;
753
+ width: 33.333%;
754
+ overflow: hidden;
755
+ padding: 15px;
756
+ margin: 0;
757
+ cursor: pointer;
758
+ }
759
+
760
+ #ast-sites-modal .elementor-template-library-template-body {
761
+ display: -webkit-box;
762
+ display: -ms-flexbox;
763
+ display: flex;
764
+ position: relative;
765
+ }
766
+
767
+ #ast-sites-modal .elementor-template-library-template-body img {
768
+ width:100%;
769
+ }
770
+
771
+ #ast-sites-modal .astra-sites-library-template-inner {
772
+ margin: 0;
773
+ -webkit-border-radius: 2px;
774
+ border-radius: 2px;
775
+ -webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,.07);
776
+ box-shadow: 0 1px 20px 0 rgba(0,0,0,.07);
777
+ padding: 8px 8px 0 8px;
778
+ background: #fff;
779
+ position: relative;
780
+ }
781
+
782
+ #ast-sites-modal .elementor-template-library-template-remote:not(.elementor-template-library-template-page) {
783
+ display: inline-table;
784
+ }
785
+
786
+ #ast-sites-modal .theme-preview img,
787
+ #ast-sites-modal .theme-preview-block img {
788
+ width: 100%;
789
+ }
790
+
791
+ #ast-sites-modal .dialog-lightbox-back {
792
+ background: #fff;
793
+ padding: 10px 10px;
794
+ text-align: left;
795
+ margin-bottom: 20px;
796
+ }
797
+
798
+ #ast-sites-modal .dialog-lightbox-back span {
799
+ cursor: pointer;
800
+ font-weight: bold;
801
+ }
802
+
803
+ #ast-sites-modal .ast-sites-modal__header__menu-area {
804
+ position: relative;
805
+ display: -webkit-box;
806
+ display: -webkit-flex;
807
+ display: -ms-flexbox;
808
+ display: flex;
809
+ -webkit-box-align: center;
810
+ -webkit-align-items: center;
811
+ -ms-flex-align: center;
812
+ align-items: center;
813
+ margin-right: 140px;
814
+ margin-left: 50px;
815
+ flex: 1;
816
+ }
817
+
818
+ #ast-sites-modal .back-to-layout {
819
+ height: 54px;
820
+ padding: 14px;
821
+ }
822
+
823
+ #ast-sites-modal .search-form {
824
+ width: 100%;
825
+ font-weight: normal;
826
+ border: none;
827
+ margin: 0;
828
+ border-radius: 6px;
829
+ position: relative;
830
+ }
831
+ #ast-sites-modal .icon-search {
832
+ position: absolute;
833
+ right: 0;
834
+ top: 0;
835
+ color: #C3C3C3;
836
+ padding: 15px 19px 12px 12px;
837
+ }
838
+ #ast-sites-modal ::-webkit-input-placeholder {
839
+ color: #72777c;
840
+ }
841
+ #ast-sites-modal .astra-sites-sync-library-button.updating-message {
842
+ color: #0073aa;
843
+ }
844
+
845
+ #ast-sites-modal #wp-filter-search-input {
846
+ width: 100%;
847
+ opacity: 1;
848
+ background: #fff;
849
+ line-height: 40px;
850
+ border-bottom: 1px solid #ddd;
851
+ border-radius: 6px;
852
+ font-size: 13px;
853
+ padding: 5px 20px;
854
+ border: 1px solid #ddd;
855
+ box-shadow: none;
856
+ height: 40px;
857
+ }
858
+
859
+ #ast-sites-modal #wp-filter-search-input:hover,
860
+ #ast-sites-modal #wp-filter-search-input:focus {
861
+ border: 1px solid #bbb;
862
+ }
863
+
864
+ #ast-sites-modal #wp-filter-search-input.searching {
865
+ border-bottom-left-radius: 0;
866
+ border-bottom-right-radius: 0;
867
+ border-bottom-color: transparent;
868
+ border-color: rgba(223,225,229,0);
869
+ box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28);
870
+ }
871
+
872
+ #ast-sites-modal .single-site-pages-wrap {
873
+ text-align: left;
874
+ }
875
+
876
+ #ast-sites-modal .astra-site-title {
877
+ margin-bottom: 20px;
878
+ text-align: left;
879
+ }
880
+
881
+ #ast-sites-modal .astra-site-contents,
882
+ #ast-sites-modal .astra-sites-import-template,
883
+ #ast-sites-modal .astra-sites-create-page-wrap {
884
+ margin-bottom: 40px;
885
+ }
886
+
887
+ #ast-sites-modal .astra-sites-import-template-notice,
888
+ #ast-sites-modal .astra-sites-create-page-wrap-notice {
889
+ font-size: 15px;
890
+ color: #767676;
891
+ padding: 5px 0 10px;
892
+ }
893
+
894
+ #ast-sites-modal .ast-sites-floating-notice {
895
+ font-size: 13px;
896
+ line-height: 1.5em;
897
+ position: relative;
898
+ }
899
+
900
+ #ast-sites-modal .agency-ribbons {
901
+ top: -5px;
902
+ font-size: 9px;
903
+ right: -5px;
904
+ line-height: 14px;
905
+ padding: 4px 8px;
906
+ }
907
+
908
+ .ast-sites-floating-notice-wrap {
909
+ background: #fff;
910
+ border: 1px solid #ccd0d4;
911
+ border-left-width: 4px;
912
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
913
+ margin: 5px 15px 2px;
914
+ padding: 1px 12px;
915
+ }
916
+
917
+ #ast-sites-modal .notice-dismiss:before {
918
+ background: none;
919
+ color: #72777c;
920
+ content: "\f153";
921
+ display: block;
922
+ font: normal 16px/20px dashicons;
923
+ font-size: 14px;
924
+ speak: none;
925
+ height: 20px;
926
+ text-align: center;
927
+ width: 20px;
928
+ -webkit-font-smoothing: antialiased;
929
+ -moz-osx-font-smoothing: grayscale;
930
+ }
931
+
932
+ #ast-sites-modal .notice-dismiss:hover:before,
933
+ #ast-sites-modal .notice-dismiss:active:before,
934
+ #ast-sites-modal .notice-dismiss:focus:before {
935
+ color: #c00;
936
+ }
937
+
938
+ #ast-sites-modal .ast-sites-floating-notice-wrap.refreshed-notice {
939
+ border-left: 5px solid #46b450;
940
+ }
941
+
942
+ #ast-sites-modal button.notice-dismiss {
943
+ position: absolute;
944
+ top: 0;
945
+ right: 1px;
946
+ border: none;
947
+ margin: 0;
948
+ background: none;
949
+ color: #72777c;
950
+ cursor: pointer;
951
+ padding:0;
952
+ }
953
+
954
+ #ast-sites-modal .button-hero {
955
+ background: #0085ba;
956
+ border-color: #0073aa #006799 #006799;
957
+ box-shadow: 0 1px 0 #006799;
958
+ color: #fff;
959
+ text-decoration: none;
960
+ text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
961
+ cursor: pointer;
962
+ border-width: 1px;
963
+ border-style: solid;
964
+ -webkit-appearance: none;
965
+ border-radius: 3px;
966
+ white-space: nowrap;
967
+ box-sizing: border-box;
968
+ }
969
+
970
+ #ast-sites-modal .button-hero.site-preview-button {
971
+ color: #555;
972
+ border-color: #cccccc;
973
+ background: #f7f7f7;
974
+ box-shadow: 0 1px 0 #cccccc;
975
+ vertical-align: top;
976
+ text-shadow: none;
977
+ }
978
+
979
+ #ast-sites-modal form {
980
+ display: flex;
981
+ }
982
+
983
+ #ast-sites-modal form .ast-importer-create-button {
984
+ margin-left: 10px;
985
+ }
986
+
987
+ #ast-sites-modal form input {
988
+ width: 50%;
989
+ padding: 10px 20px;
990
+ }
991
+
992
+ #ast-sites-modal .astra-sites-import-template-action .button {
993
+ display: inline-block;
994
+ cursor: pointer;
995
+ }
996
+
997
+ #ast-sites-modal .ast-library-template-insert {
998
+ margin-right: 15px;
999
+ }
1000
+
1001
+ #ast-sites-modal .astra-sites-import-template-action .button-hero.disabled {
1002
+ color: #66c6e4 !important;
1003
+ background: #008ec2 !important;
1004
+ border-color: #007cb2 !important;
1005
+ box-shadow: none !important;
1006
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
1007
+ cursor: default;
1008
+ }
1009
+
1010
+ #ast-sites-modal .single-site-footer {
1011
+ margin-left: 0;
1012
+ padding-right: 15px;
1013
+ padding-left: 30px;
1014
+ }
1015
+
1016
+ #ast-sites-modal .single-site-preview {
1017
+ margin-right: 0;
1018
+ max-height: calc( 100vh - 160px );
1019
+ height: auto;
1020
+ }
1021
+
1022
+ #ast-sites-modal .ast-sites-floating-notice-wrap {
1023
+ margin: -5px 35px -5px 45px;
1024
+ margin-top: 0px !important;
1025
+ background: #ffffff;
1026
+ padding: 8px 15px;
1027
+ border-left: 4px solid #00a0d2;
1028
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
1029
+ border-radius: 2px;
1030
+ vertical-align: middle;
1031
+ z-index: 99999;
1032
+ text-align: left;
1033
+ margin-top: -10px;
1034
+ display: none;
1035
+ }
1036
+
1037
+ #ast-sites-modal .ast-sites-floating-notice-wrap.slide-out {
1038
+ display: none;
1039
+ }
1040
+
1041
+ #ast-sites-modal .ast-sites-floating-notice-wrap.slide-in {
1042
+ display: block;
1043
+ }
1044
+
1045
+ @keyframes slide-in {
1046
+ 100% { transform: translateX(0%); }
1047
+ }
1048
+
1049
+ @-webkit-keyframes slide-in {
1050
+ 100% { -webkit-transform: translateX(0%); }
1051
+ }
1052
+
1053
+ @keyframes slide-out {
1054
+ 0% { transform: translateX(0%); }
1055
+ 100% { transform: translateX(120%); }
1056
+ }
1057
+
1058
+ @-webkit-keyframes slide-out {
1059
+ 0% { -webkit-transform: translateX(0%); }
1060
+ 100% { -webkit-transform: translateX(120%); }
1061
+ }
1062
+
1063
+ #ast-sites-modal .single-site-preview-wrap {
1064
+ width: 100%;
1065
+ }
1066
+
1067
+ #ast-sites-modal .astra-sites-tooltip {
1068
+ margin-left: 15px;
1069
+ margin-right: 15px;
1070
+ padding-left: 15px;
1071
+ padding-right:15px;
1072
+ height: 54px;
1073
+ border-left: 1px solid #e6e9ec;
1074
+ border-right: 1px solid #e6e9ec;
1075
+ opacity: 0;
1076
+ }
1077
+
1078
+ #ast-sites-modal .astra-sites-tooltip-icon {
1079
+ line-height: 54px;
1080
+ }
1081
+
1082
+ #ast-sites-modal .astra-sites-tooltip .dashicons-editor-help {
1083
+ font-size: 20px;
1084
+ color: #555d66;
1085
+ }
1086
+
1087
+ #ast-sites-modal .astra-preview-actions-inner-wrap {
1088
+ position: relative;
1089
+ }
1090
+
1091
+ #ast-sites-modal .astra-preview-actions-wrap {
1092
+ margin-right: 15px;
1093
+ }
1094
+
1095
+ #ast-sites-modal .site-action-buttons-wrap .dashicons {
1096
+ margin-left: 0;
1097
+ }
1098
+
1099
+ #ast-sites-modal .position-left-last {
1100
+ margin-right: auto;
1101
+ }
1102
+
1103
+ @media (max-width: 768px) {
1104
+ #ast-sites-modal .theme-browser .theme {
1105
+ width: 33.33%;
1106
+ box-shadow: none;
1107
+ }
1108
+ #ast-sites-modal .position-left-last {
1109
+ width: 120px;
1110
+ }
1111
+ #ast-sites-modal .ast-sites-modal__header__menu-area {
1112
+ margin: 0 10px;
1113
+ }
1114
+ }
inc/assets/css/images-rtl.css ADDED
@@ -0,0 +1,541 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'icomoon';
3
+ src: url('../fonts/astra-sites.eot?9i8jex');
4
+ src: url('../fonts/astra-sites.eot?9i8jex#iefix') format('embedded-opentype'),
5
+ url('../fonts/astra-sites.ttf?9i8jex') format('truetype'),
6
+ url('../fonts/astra-sites.woff?9i8jex') format('woff'),
7
+ url('../fonts/astra-sites.svg?9i8jex#icomoon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="icon-"], [class*=" icon-"] {
13
+ font-family: 'icomoon' !important;
14
+ speak: none;
15
+ font-style: normal;
16
+ font-weight: normal;
17
+ font-variant: normal;
18
+ text-transform: none;
19
+ line-height: 1;
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
+ }
23
+
24
+ .icon-chevron-left:before {
25
+ content: "\e904";
26
+ }
27
+
28
+ .icon-search:before {
29
+ content: "\e900";
30
+ }
31
+
32
+ .ast-attachments-browser .ast-image__search.has-input + .search-icon {
33
+ display: none;
34
+ }
35
+
36
+ .ast-attachments-browser .search-icon {
37
+ position: absolute;
38
+ top: 0;
39
+ left: 0;
40
+ color: #666;
41
+ opacity: 0.3;
42
+ padding: 11px;
43
+ }
44
+
45
+ .ast-attachments-browser .ast-image__skeleton {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ }
49
+
50
+ .ast-attachments-browser .ast-image__search-wrap {
51
+ position: relative;
52
+ display: flex;
53
+ }
54
+
55
+ .ast-attachments-browser input.ast-image__search {
56
+ line-height: 1.8em;
57
+ width: 620px;
58
+ height: 35px;
59
+ background: #fff;
60
+ border-color: #d5dadf;
61
+ }
62
+
63
+ .ast-attachments-browser .ast-image__list-wrap.loaded .ast-image__list-img-wrap {
64
+ opacity: 1;
65
+ }
66
+
67
+ .ast-attachments-browser .ast-image__list-wrap.loaded .imported.ast-image__list-inner-wrap:before {
68
+ display: block;
69
+ }
70
+
71
+ .ast-attachments-browser .ast-image__list-img-overlay span {
72
+ position: absolute;
73
+ bottom: 0;
74
+ right: 0;
75
+ color: #fff;
76
+ padding: 10px;
77
+ font-size: 13px;
78
+ width: calc( 100% - 20px );
79
+ text-align: right;
80
+ text-transform: capitalize;
81
+ }
82
+
83
+ .ast-attachments-browser .ast-image__list-img-wrap {
84
+ display: flex;
85
+ opacity: 0;
86
+ position: relative;
87
+ }
88
+
89
+ .ast-attachments-browser .ast-image__list-img-wrap:hover {
90
+ transform: translateY(-1px);
91
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
92
+ }
93
+
94
+ .ast-attachments-browser .ast-image__list-img-overlay {
95
+ position: absolute;
96
+ top: 0;
97
+ right: 0;
98
+ width: 100%;
99
+ height: 100%;
100
+ background: rgba( 0, 0, 0, 0.4 );
101
+ opacity: 0;
102
+ transition: opacity 0.5s, visibility 0s 0.5s;
103
+ cursor: pointer;
104
+ }
105
+
106
+ .ast-attachments-browser .ast-image__list-inner-wrap:hover .ast-image__list-img-overlay {
107
+ opacity: 1;
108
+ }
109
+
110
+ .ast-attachments-browser .ast-image__filter-wrap {
111
+ display: flex;
112
+ align-items: flex-end;
113
+ }
114
+
115
+ .ast-attachments-browser .ast-attachments-search-wrap {
116
+ padding: 10px 20px;
117
+ border-bottom: 1px solid #ddd;
118
+ display: flex;
119
+ height: 36px;
120
+ justify-content: space-between;
121
+ align-items: center;
122
+ padding-left: 0px;
123
+ }
124
+
125
+ .ast-attachments-browser .ast-image__filter {
126
+ display: flex;
127
+ padding: 0;
128
+ margin: 0;
129
+ list-style-type: none;
130
+ }
131
+
132
+ .ast-attachments-browser .ast-image__filter li {
133
+ padding: 0 8px;
134
+ margin: 0;
135
+ }
136
+
137
+ .ast-attachments-browser .ast-image__filter li:first-child {
138
+ padding-right: 0;
139
+ }
140
+
141
+ .ast-attachments-browser .ast-image__filter li select {
142
+ height: 35px;
143
+ width: auto;
144
+ }
145
+
146
+ .ast-attachments-browser .ast-image__skeleton-inner-wrap {
147
+ overflow-y: scroll;
148
+ height: inherit;
149
+ padding: 10px;
150
+ padding-bottom: 0;
151
+ height: inherit;
152
+ }
153
+
154
+ .ast-attachments-browser .button.ast-image__validate-btn {
155
+ height: 38px;
156
+ line-height: 37px;
157
+ padding: 0 15px 2px;
158
+ }
159
+
160
+ .ast-attachments-browser.preview-mode .ast-image__skeleton-inner-wrap {
161
+ overflow-y: auto;
162
+ }
163
+
164
+ .ast-attachments-browser .ast-image__list-wrap {
165
+ width: 20%;
166
+ padding: 0;
167
+ margin: 0;
168
+ }
169
+ .ast-attachments-browser .ast-image__skeleton-wrap {
170
+ height: 100%;
171
+ }
172
+
173
+ .ast-attachments-browser .ast-image__list-inner-wrap {
174
+ padding: 10px;
175
+ }
176
+
177
+ .ast-attachments-browser .ast-image__list-inner-wrap img {
178
+ width: 100%;
179
+ height: auto;
180
+ }
181
+
182
+ .ast-attachments-browser .single-site-wrap {
183
+ display: flex;
184
+ }
185
+
186
+ .ast-attachments-browser .single-site {
187
+ width: 100%;
188
+ display: flex;
189
+ }
190
+
191
+ .ast-attachments-browser .single-site-preview {
192
+ height: auto;
193
+ margin-left: 0;
194
+ max-height: calc(100vh - 280px);
195
+ overflow-y: auto;
196
+ border-radius: 2px;
197
+ box-shadow: none;
198
+ }
199
+
200
+ .ast-attachments-browser .single-site-preview img {
201
+ vertical-align: middle;
202
+ }
203
+
204
+ .ast-attachments-browser .ast-image__preview-skeleton {
205
+ padding: 10px;
206
+ }
207
+
208
+ .ast-attachments-browser .single-site-preview img,
209
+ .ast-attachments-browser .single-site-preview-wrap {
210
+ width: 100%;
211
+ }
212
+
213
+ .ast-attachments-browser .imported.ast-image__list-inner-wrap:before {
214
+ content: 'IMPORTED';
215
+ background: rgba(0,0,0,0.5);
216
+ color: #fff;
217
+ top:20px;
218
+ right:0;
219
+ width: auto;
220
+ height: auto;
221
+ padding: 5px;
222
+ margin: 0 20px 0 10px;
223
+ z-index: 9;
224
+ position: absolute;
225
+ display: none;
226
+ }
227
+
228
+ .ast-attachments-browser .ast-image__go-back {
229
+ font-weight: 600;
230
+ font-size: 12px;
231
+ cursor: pointer;
232
+ display: flex;
233
+ align-items: center;
234
+ }
235
+
236
+ .ast-attachments-browser .ast-image__go-back i {
237
+ font-size: 14px;
238
+ height: 14px;
239
+ width: 14px;
240
+ vertical-align: middle;
241
+ }
242
+
243
+ .ast-attachments-browser .ast-image__go-back-text {
244
+ padding-right: 5px;
245
+ }
246
+
247
+ .ast-attachments-browser .ast-image__save-wrap {
248
+ padding: 0 20px;
249
+ }
250
+
251
+ .ast-attachments-browser .ast-image__loader-wrap {
252
+ display: none;
253
+ margin: 0 auto;
254
+ min-height: 58px;
255
+ line-height: 58px;
256
+ width: 160px;
257
+ text-align: center;
258
+ position: absolute;
259
+ right: 50%;
260
+ bottom: 0;
261
+ transform: translateX(50%);
262
+ }
263
+
264
+ .ast-attachments-browser .ast-image__loader-wrap > div {
265
+ width: 18px;
266
+ height: 18px;
267
+ background-color: #0085ba;
268
+ -webkit-border-radius: 100%;
269
+ border-radius: 100%;
270
+ display: inline-block;
271
+ -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
272
+ animation: sk-bouncedelay 1.4s infinite ease-in-out both;
273
+ }
274
+
275
+ .ast-attachments-browser .ast-image__loader-wrap .ast-image__loader-1 {
276
+ -webkit-animation-delay: -0.32s;
277
+ animation-delay: -0.32s;
278
+ }
279
+
280
+ .ast-attachments-browser .ast-image__loader-wrap .ast-image__loader-2 {
281
+ -webkit-animation-delay: -0.16s;
282
+ animation-delay: -0.16s;
283
+ }
284
+
285
+ .ast-attachments-browser .ast-image__license-heading {
286
+ margin: 0;
287
+ text-align: center;
288
+ font-size: 1.4em;
289
+ font-weight: 600;
290
+ margin-top: 0;
291
+ color: #23282d;
292
+ }
293
+
294
+ .ast-attachments-browser .ast-image__license-description {
295
+ font-size: 13px;
296
+ line-height: 1.5;
297
+ margin: 2em 4em;
298
+ color: #444;
299
+ }
300
+
301
+ .ast-attachments-browser .ast-image__license-get-wrap {
302
+ font-size: 1em;
303
+ margin-top: 40px;
304
+ padding: 18px;
305
+ border-top: 1px solid #eae5e5
306
+ }
307
+
308
+ .ast-attachments-browser .ast-image__license-input-wrap {
309
+ margin-bottom: 20px;
310
+ }
311
+
312
+ .ast-attachments-browser .ast-image__license-get-wrap h4 {
313
+ color: #444;
314
+ margin: 0;
315
+ }
316
+
317
+ .ast-attachments-browser .astra-sites-no-sites {
318
+ width: 100%;
319
+ padding: 7em 0;
320
+ }
321
+
322
+ .ast-attachments-browser .astra-sites-no-sites h3 {
323
+ font-size: 1.3rem;
324
+ font-weight: normal;
325
+ color: #666;
326
+ margin-top: 0;
327
+ text-align: center;
328
+ margin-bottom: 3em;
329
+ }
330
+
331
+ .ast-attachments-browser .ast-image__license-heading-wrap {
332
+ background: #fff;
333
+ margin-bottom: 50px;
334
+ padding: 16px 35px;
335
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
336
+ border-radius: 2px 2px 0 0;
337
+ }
338
+
339
+ .ast-attachments-browser .ast-image__license-wrap {
340
+ position: absolute;
341
+ background: #fcfcfc;
342
+ top: 50%;
343
+ right: 50%;
344
+ transform: translateX(50%)translateY(-40%);
345
+ width: 600px;
346
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
347
+ text-align: center;
348
+ border-radius: 2px;
349
+ }
350
+
351
+ .ast-attachments-browser .ast-image__license-input-inner-wrap {
352
+ display: inline-grid;
353
+ position: relative;
354
+ }
355
+
356
+ .ast-attachments-browser .ast-image__license-input-inner-wrap .ast-image__license-msg {
357
+ padding: 5px 10px;
358
+ border: 1px solid #CC3333;
359
+ border-radius: 2px;
360
+ text-align: right;
361
+ margin-left: 10px;
362
+ margin-top: 5px;
363
+ margin-left: 10px;
364
+ margin-right: 0;
365
+ display: none;
366
+ color: #CC3333;
367
+ background: #FFEEEE;
368
+ }
369
+
370
+ .ast-attachments-browser .ast-image__license-msg i {
371
+ margin-left: 5px;
372
+ }
373
+
374
+ .ast-attachments-browser .ast-image__license-msg span {
375
+ vertical-align: middle;
376
+ }
377
+
378
+ .ast-attachments-browser input.ast-image__license {
379
+ margin-left: 10px;
380
+ width: 300px;
381
+ height: 40px;
382
+ padding-right: 13px;
383
+ border-color: #d6d6d6;
384
+ }
385
+
386
+ .ast-attachments-browser li.ast-image__license-edit-key {
387
+ display: flex;
388
+ justify-content: center;
389
+ margin-right: 5px;
390
+ align-items: center;
391
+ border-right: 1px solid #ededed;
392
+ padding: 0 15px;
393
+ }
394
+
395
+ .ast-attachments-browser .ast-image__license-edit-key + div {
396
+ padding: 0 10px;
397
+ }
398
+
399
+ .ast-attachments-browser li.ast-image__license-edit-key a:focus {
400
+ box-shadow: none;
401
+ }
402
+
403
+ .ast-attachments-browser .ast-image-valid-license {
404
+ height: 40px;
405
+ position: absolute;
406
+ left: 20px;
407
+ top: 0;
408
+ color: green;
409
+ display: flex;
410
+ align-items: center;
411
+ }
412
+
413
+ .ast-attachments-browser .ast-image__browse-images {
414
+ cursor: pointer;
415
+ }
416
+
417
+ .ast-attachments-browser .ast-image__save.installing:before {
418
+ content: "\f463";
419
+ display: inline-block;
420
+ font: normal 20px/1 'dashicons';
421
+ -webkit-font-smoothing: antialiased;
422
+ -moz-osx-font-smoothing: grayscale;
423
+ vertical-align: middle;
424
+ -webkit-animation: cssAnimation .72s ease infinite;
425
+ -moz-animation: cssAnimation .72s ease infinite;
426
+ -o-animation: cssAnimation .72s ease infinite;
427
+ -ms-animation: cssAnimation .72s ease infinite;
428
+ animation: cssAnimation .72s ease infinite;
429
+ color: #fff;
430
+ margin: 0;
431
+ padding: 0;
432
+ margin-left: 10px;
433
+ vertical-align: middle;
434
+ }
435
+
436
+ @-webkit-keyframes cssAnimation {
437
+ from {
438
+ -webkit-transform: rotate(0);
439
+ -moz-transform: rotate(0);
440
+ -o-transform: rotate(0);
441
+ -ms-transform: rotate(0);
442
+ transform: rotate(0);
443
+ }
444
+ to {
445
+ -webkit-transform: rotate(-360deg);
446
+ -moz-transform: rotate(-360deg);
447
+ -o-transform: rotate(-360deg);
448
+ -ms-transform: rotate(-360deg);
449
+ transform: rotate(-360deg);
450
+ }
451
+ }
452
+ @-moz-keyframes cssAnimation {
453
+ from {
454
+ -webkit-transform: rotate(0);
455
+ -moz-transform: rotate(0);
456
+ -o-transform: rotate(0);
457
+ -ms-transform: rotate(0);
458
+ transform: rotate(0);
459
+ }
460
+ to {
461
+ -webkit-transform: rotate(-360deg);
462
+ -moz-transform: rotate(-360deg);
463
+ -o-transform: rotate(-360deg);
464
+ -ms-transform: rotate(-360deg);
465
+ transform: rotate(-360deg);
466
+ }
467
+ }
468
+ @-o-keyframes cssAnimation {
469
+ from {
470
+ -webkit-transform: rotate(0);
471
+ -moz-transform: rotate(0);
472
+ -o-transform: rotate(0);
473
+ -ms-transform: rotate(0);
474
+ transform: rotate(0);
475
+ }
476
+ to {
477
+ -webkit-transform: rotate(-360deg);
478
+ -moz-transform: rotate(-360deg);
479
+ -o-transform: rotate(-360deg);
480
+ -ms-transform: rotate(-360deg);
481
+ transform: rotate(-360deg);
482
+ }
483
+ }
484
+
485
+ @-webkit-keyframes sk-bouncedelay {
486
+ 0%,
487
+ 80%,
488
+ 100% {
489
+ -webkit-transform: scale(0);
490
+ transform: scale(0);
491
+ }
492
+ 40% {
493
+ -webkit-transform: scale(1);
494
+ transform: scale(1);
495
+ }
496
+ }
497
+
498
+ @keyframes sk-bouncedelay {
499
+ 0%,
500
+ 80%,
501
+ 100% {
502
+ -webkit-transform: scale(0);
503
+ transform: scale(0);
504
+ }
505
+ 40% {
506
+ -webkit-transform: scale(1);
507
+ transform: scale(1);
508
+ }
509
+ }
510
+
511
+ @media (max-width: 767px) {
512
+ .ast-attachments-browser .ast-image__list-wrap {
513
+ width: 33.33%;
514
+ }
515
+ .ast-attachments-browser:not(.preview-mode) .ast-attachments-search-wrap {
516
+ display: inline-block;
517
+ height: 76px;
518
+ width: 100%;
519
+ }
520
+ .ast-attachments-browser .search-icon {
521
+ right: 265px;
522
+ }
523
+ .ast-attachments-browser .imported.ast-image__list-inner-wrap:before {
524
+ top: 15px;
525
+ padding: 4px;
526
+ margin: 0 15px 0 5px;
527
+ font-size: 11px;
528
+ }
529
+ }
530
+
531
+ @media (min-width: 768px) and (max-width: 1024px) {
532
+ .ast-attachments-browser .ast-image__list-wrap {
533
+ width: 33.33%;
534
+ }
535
+ .ast-attachments-browser .ast-image__filter li select {
536
+ width: 100px;
537
+ }
538
+ .ast-attachments-browser input.ast-image__search {
539
+ width: 240px;
540
+ }
541
+ }
inc/assets/css/images.css ADDED
@@ -0,0 +1,541 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'icomoon';
3
+ src: url('../fonts/astra-sites.eot?9i8jex');
4
+ src: url('../fonts/astra-sites.eot?9i8jex#iefix') format('embedded-opentype'),
5
+ url('../fonts/astra-sites.ttf?9i8jex') format('truetype'),
6
+ url('../fonts/astra-sites.woff?9i8jex') format('woff'),
7
+ url('../fonts/astra-sites.svg?9i8jex#icomoon') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ [class^="icon-"], [class*=" icon-"] {
13
+ font-family: 'icomoon' !important;
14
+ speak: none;
15
+ font-style: normal;
16
+ font-weight: normal;
17
+ font-variant: normal;
18
+ text-transform: none;
19
+ line-height: 1;
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
+ }
23
+
24
+ .icon-chevron-left:before {
25
+ content: "\e904";
26
+ }
27
+
28
+ .icon-search:before {
29
+ content: "\e900";
30
+ }
31
+
32
+ .ast-attachments-browser .ast-image__search.has-input + .search-icon {
33
+ display: none;
34
+ }
35
+
36
+ .ast-attachments-browser .search-icon {
37
+ position: absolute;
38
+ top: 0;
39
+ right: 0;
40
+ color: #666;
41
+ opacity: 0.3;
42
+ padding: 11px;
43
+ }
44
+
45
+ .ast-attachments-browser .ast-image__skeleton {
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ }
49
+
50
+ .ast-attachments-browser .ast-image__search-wrap {
51
+ position: relative;
52
+ display: flex;
53
+ }
54
+
55
+ .ast-attachments-browser input.ast-image__search {
56
+ line-height: 1.8em;
57
+ width: 620px;
58
+ height: 35px;
59
+ background: #fff;
60
+ border-color: #d5dadf;
61
+ }
62
+
63
+ .ast-attachments-browser .ast-image__list-wrap.loaded .ast-image__list-img-wrap {
64
+ opacity: 1;
65
+ }
66
+
67
+ .ast-attachments-browser .ast-image__list-wrap.loaded .imported.ast-image__list-inner-wrap:before {
68
+ display: block;
69
+ }
70
+
71
+ .ast-attachments-browser .ast-image__list-img-overlay span {
72
+ position: absolute;
73
+ bottom: 0;
74
+ left: 0;
75
+ color: #fff;
76
+ padding: 10px;
77
+ font-size: 13px;
78
+ width: calc( 100% - 20px );
79
+ text-align: left;
80
+ text-transform: capitalize;
81
+ }
82
+
83
+ .ast-attachments-browser .ast-image__list-img-wrap {
84
+ display: flex;
85
+ opacity: 0;
86
+ position: relative;
87
+ }
88
+
89
+ .ast-attachments-browser .ast-image__list-img-wrap:hover {
90
+ transform: translateY(-1px);
91
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
92
+ }
93
+
94
+ .ast-attachments-browser .ast-image__list-img-overlay {
95
+ position: absolute;
96
+ top: 0;
97
+ left: 0;
98
+ width: 100%;
99
+ height: 100%;
100
+ background: rgba( 0, 0, 0, 0.4 );
101
+ opacity: 0;
102
+ transition: opacity 0.5s, visibility 0s 0.5s;
103
+ cursor: pointer;
104
+ }
105
+
106
+ .ast-attachments-browser .ast-image__list-inner-wrap:hover .ast-image__list-img-overlay {
107
+ opacity: 1;
108
+ }
109
+
110
+ .ast-attachments-browser .ast-image__filter-wrap {
111
+ display: flex;
112
+ align-items: flex-end;
113
+ }
114
+
115
+ .ast-attachments-browser .ast-attachments-search-wrap {
116
+ padding: 10px 20px;
117
+ border-bottom: 1px solid #ddd;
118
+ display: flex;
119
+ height: 36px;
120
+ justify-content: space-between;
121
+ align-items: center;
122
+ padding-right: 0px;
123
+ }
124
+
125
+ .ast-attachments-browser .ast-image__filter {
126
+ display: flex;
127
+ padding: 0;
128
+ margin: 0;
129
+ list-style-type: none;
130
+ }
131
+
132
+ .ast-attachments-browser .ast-image__filter li {
133
+ padding: 0 8px;
134
+ margin: 0;
135
+ }
136
+
137
+ .ast-attachments-browser .ast-image__filter li:first-child {
138
+ padding-left: 0;
139
+ }
140
+
141
+ .ast-attachments-browser .ast-image__filter li select {
142
+ height: 35px;
143
+ width: auto;
144
+ }
145
+
146
+ .ast-attachments-browser .ast-image__skeleton-inner-wrap {
147
+ overflow-y: scroll;
148
+ height: inherit;
149
+ padding: 10px;
150
+ padding-bottom: 0;
151
+ height: inherit;
152
+ }
153
+
154
+ .ast-attachments-browser .button.ast-image__validate-btn {
155
+ height: 38px;
156
+ line-height: 37px;
157
+ padding: 0 15px 2px;
158
+ }
159
+
160
+ .ast-attachments-browser.preview-mode .ast-image__skeleton-inner-wrap {
161
+ overflow-y: auto;
162
+ }
163
+
164
+ .ast-attachments-browser .ast-image__list-wrap {
165
+ width: 20%;
166
+ padding: 0;
167
+ margin: 0;
168
+ }
169
+ .ast-attachments-browser .ast-image__skeleton-wrap {
170
+ height: 100%;
171
+ }
172
+
173
+ .ast-attachments-browser .ast-image__list-inner-wrap {
174
+ padding: 10px;
175
+ }
176
+
177
+ .ast-attachments-browser .ast-image__list-inner-wrap img {
178
+ width: 100%;
179
+ height: auto;
180
+ }
181
+
182
+ .ast-attachments-browser .single-site-wrap {
183
+ display: flex;
184
+ }
185
+
186
+ .ast-attachments-browser .single-site {
187
+ width: 100%;
188
+ display: flex;
189
+ }
190
+
191
+ .ast-attachments-browser .single-site-preview {
192
+ height: auto;
193
+ margin-right: 0;
194
+ max-height: calc(100vh - 280px);
195
+ overflow-y: auto;
196
+ border-radius: 2px;
197
+ box-shadow: none;
198
+ }
199
+
200
+ .ast-attachments-browser .single-site-preview img {
201
+ vertical-align: middle;
202
+ }
203
+
204
+ .ast-attachments-browser .ast-image__preview-skeleton {
205
+ padding: 10px;
206
+ }
207
+
208
+ .ast-attachments-browser .single-site-preview img,
209
+ .ast-attachments-browser .single-site-preview-wrap {
210
+ width: 100%;
211
+ }
212
+
213
+ .ast-attachments-browser .imported.ast-image__list-inner-wrap:before {
214
+ content: 'IMPORTED';
215
+ background: rgba(0,0,0,0.5);
216
+ color: #fff;
217
+ top:20px;
218
+ left:0;
219
+ width: auto;
220
+ height: auto;
221
+ padding: 5px;
222
+ margin: 0 10px 0 20px;
223
+ z-index: 9;
224
+ position: absolute;
225
+ display: none;
226
+ }
227
+
228
+ .ast-attachments-browser .ast-image__go-back {
229
+ font-weight: 600;
230
+ font-size: 12px;
231
+ cursor: pointer;
232
+ display: flex;
233
+ align-items: center;
234
+ }
235
+
236
+ .ast-attachments-browser .ast-image__go-back i {
237
+ font-size: 14px;
238
+ height: 14px;
239
+ width: 14px;
240
+ vertical-align: middle;
241
+ }
242
+
243
+ .ast-attachments-browser .ast-image__go-back-text {
244
+ padding-left: 5px;
245
+ }
246
+
247
+ .ast-attachments-browser .ast-image__save-wrap {
248
+ padding: 0 20px;
249
+ }
250
+
251
+ .ast-attachments-browser .ast-image__loader-wrap {
252
+ display: none;
253
+ margin: 0 auto;
254
+ min-height: 58px;
255
+ line-height: 58px;
256
+ width: 160px;
257
+ text-align: center;
258
+ position: absolute;
259
+ left: 50%;
260
+ bottom: 0;
261
+ transform: translateX(-50%);
262
+ }
263
+
264
+ .ast-attachments-browser .ast-image__loader-wrap > div {
265
+ width: 18px;
266
+ height: 18px;
267
+ background-color: #0085ba;
268
+ -webkit-border-radius: 100%;
269
+ border-radius: 100%;
270
+ display: inline-block;
271
+ -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
272
+ animation: sk-bouncedelay 1.4s infinite ease-in-out both;
273
+ }
274
+
275
+ .ast-attachments-browser .ast-image__loader-wrap .ast-image__loader-1 {
276
+ -webkit-animation-delay: -0.32s;
277
+ animation-delay: -0.32s;
278
+ }
279
+
280
+ .ast-attachments-browser .ast-image__loader-wrap .ast-image__loader-2 {
281
+ -webkit-animation-delay: -0.16s;
282
+ animation-delay: -0.16s;
283
+ }
284
+
285
+ .ast-attachments-browser .ast-image__license-heading {
286
+ margin: 0;
287
+ text-align: center;
288
+ font-size: 1.4em;
289
+ font-weight: 600;
290
+ margin-top: 0;
291
+ color: #23282d;
292
+ }
293
+
294
+ .ast-attachments-browser .ast-image__license-description {
295
+ font-size: 13px;
296
+ line-height: 1.5;
297
+ margin: 2em 4em;
298
+ color: #444;
299
+ }
300
+
301
+ .ast-attachments-browser .ast-image__license-get-wrap {
302
+ font-size: 1em;
303
+ margin-top: 40px;
304
+ padding: 18px;
305
+ border-top: 1px solid #eae5e5
306
+ }
307
+
308
+ .ast-attachments-browser .ast-image__license-input-wrap {
309
+ margin-bottom: 20px;
310
+ }
311
+
312
+ .ast-attachments-browser .ast-image__license-get-wrap h4 {
313
+ color: #444;
314
+ margin: 0;
315
+ }
316
+
317
+ .ast-attachments-browser .astra-sites-no-sites {
318
+ width: 100%;
319
+ padding: 7em 0;
320
+ }
321
+
322
+ .ast-attachments-browser .astra-sites-no-sites h3 {
323
+ font-size: 1.3rem;
324
+ font-weight: normal;
325
+ color: #666;
326
+ margin-top: 0;
327
+ text-align: center;
328
+ margin-bottom: 3em;
329
+ }
330
+
331
+ .ast-attachments-browser .ast-image__license-heading-wrap {
332
+ background: #fff;
333
+ margin-bottom: 50px;
334
+ padding: 16px 35px;
335
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
336
+ border-radius: 2px 2px 0 0;
337
+ }
338
+
339
+ .ast-attachments-browser .ast-image__license-wrap {
340
+ position: absolute;
341
+ background: #fcfcfc;
342
+ top: 50%;
343
+ left: 50%;
344
+ transform: translateX(-50%)translateY(-40%);
345
+ width: 600px;
346
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
347
+ text-align: center;
348
+ border-radius: 2px;
349
+ }
350
+
351
+ .ast-attachments-browser .ast-image__license-input-inner-wrap {
352
+ display: inline-grid;
353
+ position: relative;
354
+ }
355
+
356
+ .ast-attachments-browser .ast-image__license-input-inner-wrap .ast-image__license-msg {
357
+ padding: 5px 10px;
358
+ border: 1px solid #CC3333;
359
+ border-radius: 2px;
360
+ text-align: left;
361
+ margin-right: 10px;
362
+ margin-top: 5px;
363
+ margin-right: 10px;
364
+ margin-left: 0;
365
+ display: none;
366
+ color: #CC3333;
367
+ background: #FFEEEE;
368
+ }
369
+
370
+ .ast-attachments-browser .ast-image__license-msg i {
371
+ margin-right: 5px;
372
+ }
373
+
374
+ .ast-attachments-browser .ast-image__license-msg span {
375
+ vertical-align: middle;
376
+ }
377
+
378
+ .ast-attachments-browser input.ast-image__license {
379
+ margin-right: 10px;
380
+ width: 300px;
381
+ height: 40px;
382
+ padding-left: 13px;
383
+ border-color: #d6d6d6;
384
+ }
385
+
386
+ .ast-attachments-browser li.ast-image__license-edit-key {
387
+ display: flex;
388
+ justify-content: center;
389
+ margin-left: 5px;
390
+ align-items: center;
391
+ border-left: 1px solid #ededed;
392
+ padding: 0 15px;
393
+ }
394
+
395
+ .ast-attachments-browser .ast-image__license-edit-key + div {
396
+ padding: 0 10px;
397
+ }
398
+
399
+ .ast-attachments-browser li.ast-image__license-edit-key a:focus {
400
+ box-shadow: none;
401
+ }
402
+
403
+ .ast-attachments-browser .ast-image-valid-license {
404
+ height: 40px;
405
+ position: absolute;
406
+ right: 20px;
407
+ top: 0;
408
+ color: green;
409
+ display: flex;
410
+ align-items: center;
411
+ }
412
+
413
+ .ast-attachments-browser .ast-image__browse-images {
414
+ cursor: pointer;
415
+ }
416
+
417
+ .ast-attachments-browser .ast-image__save.installing:before {
418
+ content: "\f463";
419
+ display: inline-block;
420
+ font: normal 20px/1 'dashicons';
421
+ -webkit-font-smoothing: antialiased;
422
+ -moz-osx-font-smoothing: grayscale;
423
+ vertical-align: middle;
424
+ -webkit-animation: cssAnimation .72s ease infinite;
425
+ -moz-animation: cssAnimation .72s ease infinite;
426
+ -o-animation: cssAnimation .72s ease infinite;
427
+ -ms-animation: cssAnimation .72s ease infinite;
428
+ animation: cssAnimation .72s ease infinite;
429
+ color: #fff;
430
+ margin: 0;
431
+ padding: 0;
432
+ margin-right: 10px;
433
+ vertical-align: middle;
434
+ }
435
+
436
+ @-webkit-keyframes cssAnimation {
437
+ from {
438
+ -webkit-transform: rotate(0);
439
+ -moz-transform: rotate(0);
440
+ -o-transform: rotate(0);
441
+ -ms-transform: rotate(0);
442
+ transform: rotate(0);
443
+ }
444
+ to {
445
+ -webkit-transform: rotate(360deg);
446
+ -moz-transform: rotate(360deg);
447
+ -o-transform: rotate(360deg);
448
+ -ms-transform: rotate(360deg);
449
+ transform: rotate(360deg);
450
+ }
451
+ }
452
+ @-moz-keyframes cssAnimation {
453
+ from {
454
+ -webkit-transform: rotate(0);
455
+ -moz-transform: rotate(0);
456
+ -o-transform: rotate(0);
457
+ -ms-transform: rotate(0);
458
+ transform: rotate(0);
459
+ }
460
+ to {
461
+ -webkit-transform: rotate(360deg);
462
+ -moz-transform: rotate(360deg);
463
+ -o-transform: rotate(360deg);
464
+ -ms-transform: rotate(360deg);
465
+ transform: rotate(360deg);
466
+ }
467
+ }
468
+ @-o-keyframes cssAnimation {
469
+ from {
470
+ -webkit-transform: rotate(0);
471
+ -moz-transform: rotate(0);
472
+ -o-transform: rotate(0);
473
+ -ms-transform: rotate(0);
474
+ transform: rotate(0);
475
+ }
476
+ to {
477
+ -webkit-transform: rotate(360deg);
478
+ -moz-transform: rotate(360deg);
479
+ -o-transform: rotate(360deg);
480
+ -ms-transform: rotate(360deg);
481
+ transform: rotate(360deg);
482
+ }
483
+ }
484
+
485
+ @-webkit-keyframes sk-bouncedelay {
486
+ 0%,
487
+ 80%,
488
+ 100% {
489
+ -webkit-transform: scale(0);
490
+ transform: scale(0);
491
+ }
492
+ 40% {
493
+ -webkit-transform: scale(1);
494
+ transform: scale(1);
495
+ }
496
+ }
497
+
498
+ @keyframes sk-bouncedelay {
499
+ 0%,
500
+ 80%,
501
+ 100% {
502
+ -webkit-transform: scale(0);
503
+ transform: scale(0);
504
+ }
505
+ 40% {
506
+ -webkit-transform: scale(1);
507
+ transform: scale(1);
508
+ }
509
+ }
510
+
511
+ @media (max-width: 767px) {
512
+ .ast-attachments-browser .ast-image__list-wrap {
513
+ width: 33.33%;
514
+ }
515
+ .ast-attachments-browser:not(.preview-mode) .ast-attachments-search-wrap {
516
+ display: inline-block;
517
+ height: 76px;
518
+ width: 100%;
519
+ }
520
+ .ast-attachments-browser .search-icon {
521
+ left: 265px;
522
+ }
523
+ .ast-attachments-browser .imported.ast-image__list-inner-wrap:before {
524
+ top: 15px;
525
+ padding: 4px;
526
+ margin: 0 5px 0 15px;
527
+ font-size: 11px;
528
+ }
529
+ }
530
+
531
+ @media (min-width: 768px) and (max-width: 1024px) {
532
+ .ast-attachments-browser .ast-image__list-wrap {
533
+ width: 33.33%;
534
+ }
535
+ .ast-attachments-browser .ast-image__filter li select {
536
+ width: 100px;
537
+ }
538
+ .ast-attachments-browser input.ast-image__search {
539
+ width: 240px;
540
+ }
541
+ }
inc/assets/css/install-theme-rtl.css ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .processing:before {
2
+ margin: 0 0px 0px 3px;
3
+ }
4
+ .processing:before {
5
+ animation: rotation 2s infinite linear;
6
+ }
7
+ .processing:before {
8
+ color: #f56e28;
9
+ content: "\f463";
10
+ }
11
+ .processing:before {
12
+ display: inline-block;
13
+ font: normal 20px/1 dashicons;
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale;
16
+ vertical-align: top;
17
+ }
18
+ #astra-theme-activation-nag a {
19
+ box-shadow: none;
20
+ outline: none;
21
+ }
inc/assets/css/integration-rtl.css ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .notice:not(.ast-img-notice) {
2
+ display: none;
3
+ }
4
+ .ast-img-flex {
5
+ -js-display: flex;
6
+ display: -webkit-box;
7
+ display: -webkit-flex;
8
+ display: -moz-box;
9
+ display: -ms-flexbox;
10
+ display: flex;
11
+ -webkit-box-align: center;
12
+ -webkit-align-items: center;
13
+ -moz-box-align: center;
14
+ -ms-flex-align: center;
15
+ align-items: center;
16
+ -webkit-flex-wrap: wrap;
17
+ -ms-flex-wrap: wrap;
18
+ flex-wrap: wrap;
19
+ -webkit-align-content: center;
20
+ -ms-flex-line-pack: center;
21
+ align-content: center;
22
+ }
23
+
24
+ .form-field p.ast-img-p {
25
+ margin: 1em 0;
26
+ }
27
+
28
+ .ast-img-container{
29
+ max-width: 1200px;
30
+ margin: 0 auto;
31
+ padding: 0 20px;
32
+ box-sizing: border-box;
33
+ }
34
+ .form-wrap .ast-img-response-warning {
35
+ display: block;
36
+ color: #d02222;
37
+ }
38
+ .form-wrap .ast-img-google-error-response {
39
+ margin-top: 5px;
40
+ display: block;
41
+ }
42
+ .form-wrap .ast-img-google-error-response .ast-img-response-warning {
43
+ display: inline-block;
44
+ }
45
+ .form-wrap .ast-img-response-success {
46
+ display: block;
47
+ color: #2dbe15;
48
+ }
49
+ .postbox .inside .form-wrap .ast-img-integration-heading {
50
+ font-size: 15px;
51
+ font-weight: 600;
52
+ }
53
+ #ast-img-menu-page .ast-img-notice {
54
+ max-width: 860px;
55
+ margin: 0 auto;
56
+ }
57
+
58
+ .ast-img-menu-page-wrapper a {
59
+ text-decoration: none;
60
+ }
61
+
62
+ .ast-img-general-form-wrap {
63
+ width: 680px;
64
+ }
65
+
66
+ .ast-img-bulk-actions-wrap {
67
+ flex: auto;
68
+ text-align: left;
69
+ }
70
+
71
+ .ast-img-general-list .inside {
72
+ padding: 0;
73
+ margin: 0;
74
+ }
75
+
76
+ .ast-img-list-section .ast-img-widget-list li {
77
+ -js-display: flex;
78
+ display: -webkit-box;
79
+ display: -webkit-flex;
80
+ display: -moz-box;
81
+ display: -ms-flexbox;
82
+ display: flex;
83
+ -webkit-box-align: center;
84
+ -webkit-align-items: center;
85
+ -moz-box-align: center;
86
+ -ms-flex-align: center;
87
+ align-items: center;
88
+ -webkit-flex-wrap: wrap;
89
+ -ms-flex-wrap: wrap;
90
+ flex-wrap: wrap;
91
+ -webkit-align-content: center;
92
+ -ms-flex-line-pack: center;
93
+ align-content: center;
94
+ padding: 10px 12px;
95
+ -moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
96
+ -webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
97
+ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
98
+ margin-bottom: 0;
99
+ }
100
+
101
+ .ast-img-list-section .ast-img-widget-list li:nth-child(even) {
102
+ background-color: #fbfbfb;
103
+ }
104
+
105
+ .ast-img-list-section .ast-img-widget-list .activate {
106
+ border-right: 3px solid #008ec2;
107
+ padding-right: 12px;
108
+ }
109
+
110
+ .ast-img-widget-list a {
111
+ text-decoration: none;
112
+ }
113
+
114
+ .ast-img-widget-link-wrapper {
115
+ -js-display: flex;
116
+ display: -webkit-box;
117
+ display: -webkit-flex;
118
+ display: -moz-box;
119
+ display: -ms-flexbox;
120
+ display: flex;
121
+ -webkit-box-align: center;
122
+ -webkit-align-items: center;
123
+ -moz-box-align: center;
124
+ -ms-flex-align: center;
125
+ align-items: center;
126
+ -webkit-flex-wrap: wrap;
127
+ -ms-flex-wrap: wrap;
128
+ flex-wrap: wrap;
129
+ -webkit-align-content: center;
130
+ -ms-flex-line-pack: center;
131
+ align-content: center;
132
+ display: -webkit-flex;
133
+ -webkit-flex-direction: row-reverse;
134
+ flex-direction: row-reverse;
135
+ flex: auto;
136
+ }
137
+
138
+ .ast-img-widget-list li a:before {
139
+ display: inline-block;
140
+ margin-left: 2px;
141
+ font: normal 20px/1 'dashicons';
142
+ -webkit-font-smoothing: antialiased;
143
+ -moz-osx-font-smoothing: grayscale;
144
+ vertical-align: top;
145
+ }
146
+
147
+ .ast-img-widget-link-wrapper a:nth-child(even) {
148
+ margin: 0 10px;
149
+ }
150
+
151
+ .ast-img-container .postbox .hndle {
152
+ background: #f7f7f7;
153
+ border-bottom: 2px solid #e6e6e6;
154
+ }
155
+ .ast-img-container .postbox ul {
156
+ margin: 0;
157
+ }
158
+ .ast-img-widget-list a {
159
+ line-height: 1.6;
160
+ }
161
+ .ast-img-widget-list a:focus {
162
+ box-shadow: none;
163
+ }
164
+
165
+ .ast-img-branding-list{
166
+ margin:0;
167
+ }
168
+ .ast-img-menu-page-wrapper .ast-img-container .clear {
169
+ overflow: auto;
170
+ visibility: visible;
171
+ width: auto;
172
+ height: auto;
173
+ }
174
+
175
+ /* Update icon. */
176
+ .ast-img-widget-link-wrapper a.updating-message:before {
177
+ color: #f56e28;
178
+ content: "\f463";
179
+ }
180
+
181
+ /* Spins the update icon. */
182
+ .ast-img-widget-link-wrapper a.updating-message:before {
183
+ -webkit-animation: rotation 2s infinite linear;
184
+ animation: rotation 2s infinite linear;
185
+ }
186
+
187
+ .settings_page_astra-images #wpcontent{
188
+ padding: 0;
189
+ }
190
+
191
+ /* Header */
192
+ .ast-img-menu-page-header.general .ast-img-container,
193
+ .ast-img-menu-page-header.branding .ast-img-container,
194
+ .ast-img-container.ast-img-general,
195
+ .ast-img-container.ast-img-branding-wrapper {
196
+ max-width: 930px;
197
+ }
198
+ .ast-img-title {
199
+ flex: auto;
200
+ align-content: flex-start;
201
+ text-align: right;
202
+ margin: 0;
203
+ }
204
+ .ast-img-title a,
205
+ .ast-img-title span {
206
+ display: block;
207
+ outline: none;
208
+ box-shadow: none;
209
+ font-size: 1.5rem;
210
+ color: #333333;
211
+ font-weight: 500;
212
+ }
213
+
214
+ .ast-img-header-icon {
215
+ width: 50px;
216
+ vertical-align: bottom;
217
+ }
218
+ .ast-img-top-links {
219
+ flex: auto;
220
+ text-align: left;
221
+ font-weight: bold;
222
+ }
223
+ .ast-img-menu-page-header {
224
+ background-color: #fff;
225
+ text-align: center;
226
+ padding: 10px 0;
227
+ margin-bottom: 20px;
228
+ box-shadow: 0 2px 0 #efefef, 0 2px 2px #ececec;
229
+ }
230
+
231
+ /* White Label link*/
232
+ .ast-img-widget-list .ast-img-white-label{
233
+ border-right: 3px solid #008ec2;
234
+ padding-right: 12px;
235
+ }
236
+
237
+ .ast-img-hide-branding #poststuff #post-body.columns-2 {
238
+ margin: 0 auto;
239
+ max-width: 590px;
240
+ }
241
+
242
+ /* Integration */
243
+ .ast-img-integration-wrapper #poststuff {
244
+ width: 640px;
245
+ margin: 0 auto;
246
+ min-width: 640px;
247
+ }
248
+
249
+ .ast-img-integration-form-wrap .form-field select {
250
+ border-style: solid;
251
+ border-width: 1px;
252
+ width: 95%;
253
+ }
254
+
255
+
256
+ /* Spinner */
257
+ .ast-img-button-spinner:before {
258
+ font: normal 20px/.5 dashicons;
259
+ speak: none;
260
+ display: inline-block;
261
+ padding: 0;
262
+ top: 8px;
263
+ right: -4px;
264
+ position: relative;
265
+ vertical-align: top;
266
+ content: "\f463";
267
+ }
268
+
269
+ .ast-img-button-spinner.loading:before {
270
+ -webkit-animation: rotation 1s infinite linear;
271
+ animation: rotation 1s infinite linear;
272
+ }
273
+
274
+ .ast-img-title > a {
275
+ display: flex;
276
+ align-items: center;
277
+ }
278
+ .ast-img-title .ast-img-plugin-version {
279
+ background-color: #e5e5e5;
280
+ border-radius: 3px;
281
+ font-size: 0.5em;
282
+ font-weight: 400;
283
+ margin-right: 10px;
284
+ padding: 2px 7px;
285
+ color: #333;
286
+ }
287
+
288
+ /* New extensions badge */
289
+ #Particles .ast-img-widget-title:after {
290
+ content: "extension";
291
+ color: #fff;
292
+ background: #2ecc71;
293
+ font-size: 0.7em;
294
+ font-weight: 600;
295
+ position: relative;
296
+ padding: 0.3em 0.6em;
297
+ top: -1px;
298
+ right: 12px;
299
+ letter-spacing: 0.5px;
300
+ line-height: 1em;
301
+ text-transform: none;
302
+ text-transform: uppercase !important;
303
+ border-radius: 2px;
304
+ }
inc/assets/css/integration.css ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .notice:not(.ast-img-notice) {
2
+ display: none;
3
+ }
4
+ .ast-img-flex {
5
+ -js-display: flex;
6
+ display: -webkit-box;
7
+ display: -webkit-flex;
8
+ display: -moz-box;
9
+ display: -ms-flexbox;
10
+ display: flex;
11
+ -webkit-box-align: center;
12
+ -webkit-align-items: center;
13
+ -moz-box-align: center;
14
+ -ms-flex-align: center;
15
+ align-items: center;
16
+ -webkit-flex-wrap: wrap;
17
+ -ms-flex-wrap: wrap;
18
+ flex-wrap: wrap;
19
+ -webkit-align-content: center;
20
+ -ms-flex-line-pack: center;
21
+ align-content: center;
22
+ }
23
+
24
+ .form-field p.ast-img-p {
25
+ margin: 1em 0;
26
+ }
27
+
28
+ .ast-img-container{
29
+ max-width: 1200px;
30
+ margin: 0 auto;
31
+ padding: 0 20px;
32
+ box-sizing: border-box;
33
+ }
34
+ .form-wrap .ast-img-response-warning {
35
+ display: block;
36
+ color: #d02222;
37
+ }
38
+ .form-wrap .ast-img-google-error-response {
39
+ margin-top: 5px;
40
+ display: block;
41
+ }
42
+ .form-wrap .ast-img-google-error-response .ast-img-response-warning {
43
+ display: inline-block;
44
+ }
45
+ .form-wrap .ast-img-response-success {
46
+ display: block;
47
+ color: #2dbe15;
48
+ }
49
+ .postbox .inside .form-wrap .ast-img-integration-heading {
50
+ font-size: 15px;
51
+ font-weight: 600;
52
+ }
53
+ #ast-img-menu-page .ast-img-notice {
54
+ max-width: 860px;
55
+ margin: 0 auto;
56
+ }
57
+
58
+ .ast-img-menu-page-wrapper a {
59
+ text-decoration: none;
60
+ }
61
+
62
+ .ast-img-general-form-wrap {
63
+ width: 680px;
64
+ }
65
+
66
+ .ast-img-bulk-actions-wrap {
67
+ flex: auto;
68
+ text-align: right;
69
+ }
70
+
71
+ .ast-img-general-list .inside {
72
+ padding: 0;
73
+ margin: 0;
74
+ }
75
+
76
+ .ast-img-list-section .ast-img-widget-list li {
77
+ -js-display: flex;
78
+ display: -webkit-box;
79
+ display: -webkit-flex;
80
+ display: -moz-box;
81
+ display: -ms-flexbox;
82
+ display: flex;
83
+ -webkit-box-align: center;
84
+ -webkit-align-items: center;
85
+ -moz-box-align: center;
86
+ -ms-flex-align: center;
87
+ align-items: center;
88
+ -webkit-flex-wrap: wrap;
89
+ -ms-flex-wrap: wrap;
90
+ flex-wrap: wrap;
91
+ -webkit-align-content: center;
92
+ -ms-flex-line-pack: center;
93
+ align-content: center;
94
+ padding: 10px 12px;
95
+ -moz-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
96
+ -webkit-box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
97
+ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1) inset;
98
+ margin-bottom: 0;
99
+ }
100
+
101
+ .ast-img-list-section .ast-img-widget-list li:nth-child(even) {
102
+ background-color: #fbfbfb;
103
+ }
104
+
105
+ .ast-img-list-section .ast-img-widget-list .activate {
106
+ border-left: 3px solid #008ec2;
107
+ padding-left: 12px;
108
+ }
109
+
110
+ .ast-img-widget-list a {
111
+ text-decoration: none;
112
+ }
113
+
114
+ .ast-img-widget-link-wrapper {
115
+ -js-display: flex;
116
+ display: -webkit-box;
117
+ display: -webkit-flex;
118
+ display: -moz-box;
119
+ display: -ms-flexbox;
120
+ display: flex;
121
+ -webkit-box-align: center;
122
+ -webkit-align-items: center;
123
+ -moz-box-align: center;
124
+ -ms-flex-align: center;
125
+ align-items: center;
126
+ -webkit-flex-wrap: wrap;
127
+ -ms-flex-wrap: wrap;
128
+ flex-wrap: wrap;
129
+ -webkit-align-content: center;
130
+ -ms-flex-line-pack: center;
131
+ align-content: center;
132
+ display: -webkit-flex;
133
+ -webkit-flex-direction: row-reverse;
134
+ flex-direction: row-reverse;
135
+ flex: auto;
136
+ }
137
+
138
+ .ast-img-widget-list li a:before {
139
+ display: inline-block;
140
+ margin-right: 2px;
141
+ font: normal 20px/1 'dashicons';
142
+ -webkit-font-smoothing: antialiased;
143
+ -moz-osx-font-smoothing: grayscale;
144
+ vertical-align: top;
145
+ }
146
+
147
+ .ast-img-widget-link-wrapper a:nth-child(even) {
148
+ margin: 0 10px;
149
+ }
150
+
151
+ .ast-img-container .postbox .hndle {
152
+ background: #f7f7f7;
153
+ border-bottom: 2px solid #e6e6e6;
154
+ }
155
+ .ast-img-container .postbox ul {
156
+ margin: 0;
157
+ }
158
+ .ast-img-widget-list a {
159
+ line-height: 1.6;
160
+ }
161
+ .ast-img-widget-list a:focus {
162
+ box-shadow: none;
163
+ }
164
+
165
+ .ast-img-branding-list{
166
+ margin:0;
167
+ }
168
+ .ast-img-menu-page-wrapper .ast-img-container .clear {
169
+ overflow: auto;
170
+ visibility: visible;
171
+ width: auto;
172
+ height: auto;
173
+ }
174
+
175
+ /* Update icon. */
176
+ .ast-img-widget-link-wrapper a.updating-message:before {
177
+ color: #f56e28;
178
+ content: "\f463";
179
+ }
180
+
181
+ /* Spins the update icon. */
182
+ .ast-img-widget-link-wrapper a.updating-message:before {
183
+ -webkit-animation: rotation 2s infinite linear;
184
+ animation: rotation 2s infinite linear;
185
+ }
186
+
187
+ .settings_page_astra-images #wpcontent{
188
+ padding: 0;
189
+ }
190
+
191
+ /* Header */
192
+ .ast-img-menu-page-header.general .ast-img-container,
193
+ .ast-img-menu-page-header.branding .ast-img-container,
194
+ .ast-img-container.ast-img-general,
195
+ .ast-img-container.ast-img-branding-wrapper {
196
+ max-width: 930px;
197
+ }
198
+ .ast-img-title {
199
+ flex: auto;
200
+ align-content: flex-start;
201
+ text-align: left;
202
+ margin: 0;
203
+ }
204
+ .ast-img-title a,
205
+ .ast-img-title span {
206
+ display: block;
207
+ outline: none;
208
+ box-shadow: none;
209
+ font-size: 1.5rem;
210
+ color: #333333;
211
+ font-weight: 500;
212
+ }
213
+
214
+ .ast-img-header-icon {
215
+ width: 50px;
216
+ vertical-align: bottom;
217
+ }
218
+ .ast-img-top-links {
219
+ flex: auto;
220
+ text-align: right;
221
+ font-weight: bold;
222
+ }
223
+ .ast-img-menu-page-header {
224
+ background-color: #fff;
225
+ text-align: center;
226
+ padding: 10px 0;
227
+ margin-bottom: 20px;
228
+ box-shadow: 0 2px 0 #efefef, 0 2px 2px #ececec;
229
+ }
230
+
231
+ /* White Label link*/
232
+ .ast-img-widget-list .ast-img-white-label{
233
+ border-left: 3px solid #008ec2;
234
+ padding-left: 12px;
235
+ }
236
+
237
+ .ast-img-hide-branding #poststuff #post-body.columns-2 {
238
+ margin: 0 auto;
239
+ max-width: 590px;
240
+ }
241
+
242
+ /* Integration */
243
+ .ast-img-integration-wrapper #poststuff {
244
+ width: 640px;
245
+ margin: 0 auto;
246
+ min-width: 640px;
247
+ }
248
+
249
+ .ast-img-integration-form-wrap .form-field select {
250
+ border-style: solid;
251
+ border-width: 1px;
252
+ width: 95%;
253
+ }
254
+
255
+
256
+ /* Spinner */
257
+ .ast-img-button-spinner:before {
258
+ font: normal 20px/.5 dashicons;
259
+ speak: none;
260
+ display: inline-block;
261
+ padding: 0;
262
+ top: 8px;
263
+ left: -4px;
264
+ position: relative;
265
+ vertical-align: top;
266
+ content: "\f463";
267
+ }
268
+
269
+ .ast-img-button-spinner.loading:before {
270
+ -webkit-animation: rotation 1s infinite linear;
271
+ animation: rotation 1s infinite linear;
272
+ }
273
+
274
+ .ast-img-title > a {
275
+ display: flex;
276
+ align-items: center;
277
+ }
278
+ .ast-img-title .ast-img-plugin-version {
279
+ background-color: #e5e5e5;
280
+ border-radius: 3px;
281
+ font-size: 0.5em;
282
+ font-weight: 400;
283
+ margin-left: 10px;
284
+ padding: 2px 7px;
285
+ color: #333;
286
+ }
287
+
288
+ /* New extensions badge */
289
+ #Particles .ast-img-widget-title:after {
290
+ content: "extension";
291
+ color: #fff;
292
+ background: #2ecc71;
293
+ font-size: 0.7em;
294
+ font-weight: 600;
295
+ position: relative;
296
+ padding: 0.3em 0.6em;
297
+ top: -1px;
298
+ left: 12px;
299
+ letter-spacing: 0.5px;
300
+ line-height: 1em;
301
+ text-transform: none;
302
+ text-transform: uppercase !important;
303
+ border-radius: 2px;
304
+ }
inc/assets/fonts/astra-sites.eot ADDED
Binary file
inc/assets/fonts/astra-sites.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="1024">
7
+ <font-face units-per-em="1024" ascent="960" descent="-64" />
8
+ <missing-glyph horiz-adv-x="1024" />
9
+ <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="search3" d="M660.48 239.616c-68.622-53.712-156.164-86.131-251.277-86.131-226.216 0-409.6 183.384-409.6 409.6s183.384 409.6 409.6 409.6c226.216 0 409.6-183.384 409.6-409.6 0-95.113-32.419-182.654-86.809-252.177l0.678 0.9 273.92-272.896-72.704-72.704-272.896 273.408zM409.6 256c169.662 0 307.2 137.538 307.2 307.2s-137.538 307.2-307.2 307.2v0c-169.662 0-307.2-137.538-307.2-307.2s137.538-307.2 307.2-307.2v0z" />
11
+ <glyph unicode="&#xe901;" glyph-name="heart" d="M859.008 711.808c37.547-37.589 56.277-86.656 56.277-135.851s-18.773-98.261-56.277-135.765l-347.008-347.008-347.008 347.008c-37.504 37.504-56.235 86.571-56.235 135.808s18.731 98.304 56.235 135.808 86.571 56.235 135.808 56.235 98.304-18.731 135.808-56.235l45.227-45.227c16.683-16.683 43.691-16.683 60.331 0l45.312 45.312c37.504 37.504 86.571 56.235 135.765 56.192s98.261-18.773 135.765-56.277zM919.339 772.139c-54.144 54.144-125.184 81.237-196.096 81.28s-141.952-27.051-196.139-81.195l-15.104-15.147-15.061 15.061c-54.144 54.144-125.227 81.237-196.139 81.237s-141.995-27.093-196.139-81.237-81.237-125.227-81.237-196.139 27.093-141.995 81.237-196.139l377.173-377.173c16.683-16.683 43.691-16.683 60.331 0l377.173 377.173c54.144 54.144 81.237 125.184 81.28 196.096s-27.051 141.952-81.28 196.181z" />
12
+ <glyph unicode="&#xe902;" glyph-name="refresh" d="M189.995 540.416c31.445 88.875 95.872 156.544 174.763 194.219s172.032 45.184 260.864 13.739c50.603-17.92 94.123-46.421 127.275-80.213l120.747-113.493h-148.309c-23.552 0-42.667-19.115-42.667-42.667s19.115-42.667 42.667-42.667h255.872c0.213 0 0.384 0 0.597 0 5.845 0.043 11.435 1.323 16.469 3.499 5.077 2.176 9.771 5.376 13.824 9.6 0.512 0.555 1.024 1.109 1.536 1.664 3.2 3.712 5.675 7.808 7.381 12.16s2.731 9.003 2.944 13.909c0.043 0.64 0.043 1.237 0.043 1.835v256c0 23.552-19.115 42.667-42.667 42.667s-42.667-19.115-42.667-42.667v-157.397l-124.843 117.291c-42.325 43.093-96.896 78.635-159.701 100.864-111.061 39.296-227.627 29.824-326.101-17.152s-179.157-131.669-218.453-242.731c-7.893-22.187 3.755-46.549 25.941-54.443s46.592 3.755 54.443 25.984zM85.333 242.688l126.080-118.485c82.304-82.389 191.573-124.075 300.715-124.117s218.411 41.6 301.739 124.885c47.104 47.104 81.109 102.699 100.736 159.787 7.68 22.272-4.181 46.549-26.496 54.229s-46.549-4.181-54.229-26.496c-15.403-44.8-42.368-89.216-80.341-127.189-66.688-66.645-153.984-99.925-241.365-99.925s-174.677 33.365-242.304 100.949l-119.467 112.341h148.267c23.552 0 42.667 19.115 42.667 42.667s-19.115 42.667-42.667 42.667h-255.872c-0.213 0-0.384 0-0.597 0-5.845-0.043-11.435-1.323-16.469-3.499-5.077-2.176-9.771-5.376-13.824-9.6-0.512-0.555-1.024-1.109-1.536-1.664-3.2-3.712-5.675-7.808-7.381-12.16s-2.731-9.003-2.944-13.909c-0.043-0.64-0.043-1.237-0.043-1.835v-256c0-23.552 19.115-42.667 42.667-42.667s42.667 19.115 42.667 42.667z" />
13
+ <glyph unicode="&#xe903;" glyph-name="file" d="M554.667 896h-298.667c-35.328 0-67.413-14.379-90.496-37.504s-37.504-55.168-37.504-90.496v-682.667c0-35.328 14.379-67.413 37.504-90.496s55.168-37.504 90.496-37.504h512c35.328 0 67.413 14.379 90.496 37.504s37.504 55.168 37.504 90.496v469.333c0 11.776-4.779 22.443-12.501 30.165l-298.667 298.667c-4.096 4.096-8.789 7.168-13.824 9.259-5.205 2.176-10.795 3.243-16.341 3.243zM750.336 597.334h-153.003v153.003zM512 810.667v-256c0-23.552 19.115-42.667 42.667-42.667h256v-426.667c0-11.776-4.736-22.4-12.501-30.165s-18.389-12.501-30.165-12.501h-512c-11.776 0-22.4 4.736-30.165 12.501s-12.501 18.389-12.501 30.165v682.667c0 11.776 4.736 22.4 12.501 30.165s18.389 12.501 30.165 12.501z" />
14
+ <glyph unicode="&#xe904;" glyph-name="chevron-left" d="M670.165 200.832l-225.835 225.835 225.835 225.835c16.683 16.683 16.683 43.691 0 60.331s-43.691 16.683-60.331 0l-256-256c-16.683-16.683-16.683-43.691 0-60.331l256-256c16.683-16.683 43.691-16.683 60.331 0s16.683 43.691 0 60.331z" />
15
+ <glyph unicode="&#xe905;" glyph-name="layers" d="M512 805.632l331.264-165.632-331.264-165.632-331.264 165.632zM492.928 891.478l-426.667-213.333c-21.077-10.539-29.611-36.139-19.072-57.216 4.309-8.661 11.136-15.189 19.072-19.072l426.667-213.333c12.459-6.229 26.453-5.803 38.144 0l426.667 213.333c21.077 10.539 29.611 36.181 19.072 57.259-4.309 8.619-11.179 15.147-19.072 19.072l-426.667 213.333c-12.459 6.229-26.453 5.803-38.144 0zM66.261 175.19l426.667-213.333c12.459-6.229 26.453-5.803 38.144 0l426.667 213.333c21.077 10.539 29.611 36.181 19.072 57.259s-36.181 29.611-57.259 19.072l-407.552-203.819-407.595 203.776c-21.077 10.539-46.72 2.005-57.259-19.072s-2.005-46.72 19.072-57.259zM66.261 388.523l426.667-213.333c12.459-6.229 26.453-5.803 38.144 0l426.667 213.333c21.077 10.539 29.611 36.181 19.072 57.259s-36.181 29.611-57.259 19.072l-407.552-203.819-407.595 203.776c-21.077 10.539-46.72 2.005-57.259-19.072s-2.005-46.72 19.072-57.259z" />
16
+ </font></defs></svg>
inc/assets/fonts/astra-sites.ttf ADDED
Binary file
inc/assets/fonts/astra-sites.woff ADDED
Binary file
inc/assets/images/arrow-blue.svg ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Isolation_Mode" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
5
+ y="0px" width="100px" height="56px" viewBox="0 0 100 56" enable-background="new 0 0 100 56" xml:space="preserve">
6
+ <path fill="#0073AA" d="M97.286,0c-1.499,0-2.714,1.2-2.714,2.683c0,11.211-4.895,23.281-13.095,32.286
7
+ C72.279,45.069,59.701,50.634,46.06,50.634c-8.53,0-17.074-2.393-24.709-6.921c-4.842-2.88-9.193-6.499-12.889-10.726l12.753,0.416
8
+ c1.498,0.049,2.752-1.112,2.801-2.594c0.049-1.48-1.125-2.72-2.623-2.769L3.747,27.465c-1.013-0.412-2.179-0.18-2.953,0.585
9
+ c-0.775,0.768-1.007,1.919-0.587,2.92l0.581,17.438c0.034,1.483,1.276,2.657,2.775,2.624c1.497-0.033,2.687-1.261,2.653-2.742
10
+ c0-0.02,0-0.038-0.002-0.058L5.878,38.171c3.733,3.944,8,7.357,12.679,10.146C27.035,53.344,36.545,56,46.06,56
11
+ c15.199,0,29.213-6.192,39.453-17.44C94.584,28.596,100,15.186,100,2.683C100,1.2,98.786,0,97.286,0L97.286,0z M97.286,0"/>
12
+ </svg>
inc/assets/images/beaver-builder.png DELETED
Binary file
inc/assets/images/empty-collection.svg ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="200px" height="240px" viewBox="0 0 200 240" enable-background="new 0 0 200 240" xml:space="preserve">
6
+ <g>
7
+ <g>
8
+ <path fill="#FFFFFF" d="M196.201,0H3.8C1.7,0,0,1.7,0,3.8v232.5c0,2.1,1.7,3.799,3.8,3.799h192.401c2.1,0,3.799-1.699,3.799-3.799
9
+ V3.8C200,1.7,198.301,0,196.201,0L196.201,0z"/>
10
+ </g>
11
+ </g>
12
+ <g>
13
+ <g>
14
+ <g>
15
+ <path fill="#FF4D4D" d="M170,222.599c-0.199,0-0.5-0.1-0.699-0.299L164,216.999c-0.9-0.799-1.4-1.9-1.4-3.199
16
+ c0-2.301,1.9-4.201,4.201-4.201c1.299,0,2.4,0.5,3.199,1.5c0.801-0.898,2-1.5,3.201-1.5c2.299,0,4.199,1.9,4.199,4.201
17
+ c0,1.199-0.5,2.4-1.5,3.199L170.6,222.3C170.5,222.499,170.301,222.599,170,222.599z M167.1,210.999c-1.699,0-3.1,1.4-3.1,3
18
+ c0,0.9,0.4,1.701,1,2.301l5,4.9l0,0l4.9-4.9c0.699-0.6,1.1-1.4,1.1-2.301c0-1.699-1.4-3-3.1-3c-1.1,0-2,0.5-2.6,1.4l-0.301,0.6
19
+ l-0.299-0.6C169.1,211.499,168.1,210.999,167.1,210.999z"/>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ <g>
24
+ <g>
25
+ <g>
26
+ <path fill="#DDE3E6" d="M106.712,217.599H14.421c-0.818,0-1.5-0.682-1.5-1.501c0-0.817,0.682-1.499,1.5-1.499h92.358
27
+ c0.818,0,1.5,0.682,1.5,1.499C108.211,216.917,107.598,217.599,106.712,217.599z"/>
28
+ </g>
29
+ </g>
30
+ </g>
31
+ <g>
32
+ <g>
33
+ <path fill="#DDE3E6" d="M196.201,0.9c1.6,0,2.799,1.3,2.799,2.8v232.5c0,1.6-1.299,2.799-2.799,2.799H3.8
34
+ c-1.6,0-2.8-1.299-2.8-2.799V3.8C1,2.2,2.3,1,3.8,1L196.201,0.9 M196.201,0H3.8C1.7,0,0,1.7,0,3.8v232.5
35
+ c0,2.1,1.7,3.799,3.8,3.799h192.401c2.1,0,3.799-1.699,3.799-3.799V3.8C200,1.7,198.301,0,196.201,0L196.201,0z"/>
36
+ </g>
37
+ </g>
38
+ <g>
39
+ <rect x="0.899" y="191.399" fill="#DDE3E6" width="198.601" height="1.5"/>
40
+ </g>
41
+ <g>
42
+ <path fill="#DDE3E6" d="M163.801,118.7H36.2c-1.9,0-3.4-1.5-3.4-3.4V38.7c0-1.9,1.5-3.4,3.4-3.4h127.501
43
+ c1.898,0,3.398,1.5,3.398,3.4v76.6C167.1,117.2,165.6,118.7,163.801,118.7z M36.2,37.4c-0.801,0-1.4,0.6-1.4,1.4v76.602
44
+ c0,0.699,0.6,1.398,1.4,1.398h127.501c0.799,0,1.398-0.6,1.398-1.398V38.7c0-0.7-0.6-1.4-1.398-1.4H36.2V37.4z"/>
45
+ </g>
46
+ <g>
47
+ <rect x="33.899" y="172.999" fill="#DDE3E6" width="37.801" height="2.4"/>
48
+ </g>
49
+ <g>
50
+ <path fill="#DDE3E6" d="M69.3,165.8H36.2c-1.9,0-3.4-1.5-3.4-3.4v-28.301c0-1.898,1.5-3.398,3.4-3.398h33.1
51
+ c1.9,0,3.4,1.5,3.4,3.398v28.301C72.7,164.3,71.2,165.8,69.3,165.8z M36.2,132.8c-0.801,0-1.4,0.6-1.4,1.4v28.299
52
+ c0,0.701,0.6,1.4,1.4,1.4h33.1c0.8,0,1.4-0.6,1.4-1.4V134.2c0-0.701-0.601-1.4-1.4-1.4H36.2z"/>
53
+ </g>
54
+ <g>
55
+ <rect x="80.4" y="172.999" fill="#DDE3E6" width="37.801" height="2.4"/>
56
+ </g>
57
+ <g>
58
+ <path fill="#DDE3E6" d="M115.801,165.8H82.7c-1.9,0-3.4-1.5-3.4-3.4v-28.301c0-1.898,1.5-3.398,3.4-3.398h33.101
59
+ c1.9,0,3.4,1.5,3.4,3.398v28.301C119.201,164.3,117.6,165.8,115.801,165.8z M82.7,132.8c-0.8,0-1.4,0.6-1.4,1.4v28.299
60
+ c0,0.701,0.601,1.4,1.4,1.4h33.101c0.799,0,1.4-0.6,1.4-1.4V134.2c0-0.701-0.602-1.4-1.4-1.4H82.7z"/>
61
+ </g>
62
+ <g>
63
+ <rect x="126.701" y="172.999" fill="#DDE3E6" width="37.799" height="2.4"/>
64
+ </g>
65
+ <g>
66
+ <path fill="#DDE3E6" d="M162.1,165.8H129c-1.9,0-3.4-1.5-3.4-3.4v-28.301c0-1.898,1.5-3.398,3.4-3.398h33.1
67
+ c1.9,0,3.4,1.5,3.4,3.398v28.301C165.4,164.3,163.9,165.8,162.1,165.8z M129,132.8c-0.799,0-1.4,0.6-1.4,1.4v28.299
68
+ c0,0.701,0.602,1.4,1.4,1.4h33.1c0.801,0,1.4-0.6,1.4-1.4V134.2c0-0.701-0.6-1.4-1.4-1.4H129z"/>
69
+ </g>
70
+ <g>
71
+ <path fill="#DDE3E6" d="M107.967,65.958c0,2.469-1.98,4.48-4.414,4.48c-2.432,0-4.411-2.009-4.411-4.48s1.979-4.48,4.411-4.48
72
+ C105.986,61.477,107.967,63.489,107.967,65.958L107.967,65.958z M97.314,65.958c0,3.476,2.801,6.308,6.239,6.308
73
+ c3.441,0,6.238-2.831,6.238-6.308c0-3.479-2.797-6.308-6.238-6.308C100.111,59.65,97.314,62.481,97.314,65.958L97.314,65.958z"/>
74
+ <path fill="#DDE3E6" d="M118.678,74.36l-14.094,13.848L87.908,67.983L65.561,96.492l1.697,1.312L87.95,71.406l21.511,26.089
75
+ l1.664-1.357l-5.17-6.271L118.67,77.37c2.984,2.941,13.779,13.59,14.246,14.054l1.523-1.511
76
+ c-0.539-0.535-15.012-14.807-15.012-14.807L118.678,74.36L118.678,74.36z"/>
77
+ </g>
78
+ <g>
79
+ <g>
80
+ <path fill="#DDE3E6" d="M40.214,17.787H11.842c-0.423,0-0.756-0.197-0.756-0.447V9.686c0-0.25,0.333-0.447,0.756-0.447h28.35
81
+ c0.422,0,0.755,0.197,0.755,0.447v7.654C40.946,17.589,40.613,17.787,40.214,17.787z"/>
82
+ </g>
83
+ <g>
84
+ <g>
85
+ <g>
86
+ <rect x="99.244" y="12.763" fill="#DDE3E6" width="89.67" height="1.5"/>
87
+ </g>
88
+ </g>
89
+ </g>
90
+ </g>
91
+ </svg>
inc/assets/images/logo.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="250px" height="250px" viewBox="0 0 250 250" enable-background="new 0 0 250 250" xml:space="preserve">
6
+ <g>
7
+
8
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="12.3491" y1="911.4727" x2="196.6505" y2="745.5269" gradientTransform="matrix(1 0 0 1 21.5 -702.5)">
9
+ <stop offset="0" style="stop-color:#5437DC"/>
10
+ <stop offset="1" style="stop-color:#EE79FF"/>
11
+ </linearGradient>
12
+ <circle fill="url(#SVGID_1_)" cx="126" cy="126" r="124"/>
13
+ </g>
14
+ <g>
15
+ <path fill="#FFFFFF" d="M124.508,57.006c-0.003-0.002-0.005-0.004-0.008-0.006c-20.998,44.329-42.002,88.671-63,133
16
+ c8.999,0,18.001,0,27,0c16.994-34.32,33.993-68.651,50.986-102.972L124.508,57.006z"/>
17
+ </g>
18
+ <path fill="#FFFFFF" d="M152.5,112c-8.666,17.998-17.334,36.002-26,54l-0.5,1h0.5c8.333,0,16.668,0,25,0
19
+ c3.333,7.666,6.667,15.334,10,23c9.666,0,19.334,0,29,0C177.835,164.002,165.166,137.998,152.5,112z"/>
20
+ </svg>
inc/assets/images/placeholder.png ADDED
Binary file
inc/assets/images/sites-screenshot.jpg DELETED
Binary file
inc/assets/js/admin-page.js CHANGED
@@ -29,8 +29,9 @@ var AstraSitesAjaxQueue = (function() {
29
  * @since 1.0.0
30
  */
31
  remove: function(opt) {
32
- if( jQuery.inArray(opt, requests) > -1 )
33
- requests.splice($.inArray(opt, requests), 1);
 
34
  },
35
 
36
  /**
@@ -42,6 +43,7 @@ var AstraSitesAjaxQueue = (function() {
42
  var self = this,
43
  oriSuc;
44
 
 
45
  if( requests.length ) {
46
  oriSuc = requests[0].complete;
47
 
@@ -52,13 +54,12 @@ var AstraSitesAjaxQueue = (function() {
52
  };
53
 
54
  jQuery.ajax(requests[0]);
55
-
56
  } else {
57
-
58
- self.tid = setTimeout(function() {
59
- self.run.apply(self, []);
60
- }, 1000);
61
  }
 
62
  },
63
 
64
  /**
@@ -67,16 +68,50 @@ var AstraSitesAjaxQueue = (function() {
67
  * @since 1.0.0
68
  */
69
  stop: function() {
70
-
71
  requests = [];
72
  clearTimeout(this.tid);
73
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  };
75
 
76
  }());
77
 
78
  (function($){
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  var AstraSSEImport = {
81
  complete: {
82
  posts: 0,
@@ -102,7 +137,8 @@ var AstraSitesAjaxQueue = (function() {
102
  if ( 0 === total || isNaN( total ) ) {
103
  total = 1;
104
  }
105
- var percent = parseInt( complete, 10 ) / total;
 
106
  var progress = Math.round( percent * 100 ) + '%';
107
  var progress_bar = percent * 100;
108
 
@@ -111,7 +147,7 @@ var AstraSitesAjaxQueue = (function() {
111
  for ( var i = 0; i < process_bars.length; i++ ) {
112
  process_bars[i].value = progress_bar;
113
  }
114
- AstraSitesAdmin._log_title( 'Importing Content.. ' + progress );
115
  }
116
  }
117
  },
@@ -134,6 +170,34 @@ var AstraSitesAjaxQueue = (function() {
134
 
135
  AstraSitesAdmin = {
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  reset_remaining_posts: 0,
138
  reset_remaining_wp_forms: 0,
139
  reset_remaining_terms: 0,
@@ -143,61 +207,176 @@ var AstraSitesAjaxQueue = (function() {
143
  site_imported_data: null,
144
 
145
  backup_taken: false,
146
-
147
- current_site: [],
148
- current_screen: '',
149
-
150
  templateData: {},
151
-
152
  log_file : '',
153
  customizer_data : '',
154
  wxr_url : '',
155
  wpforms_url : '',
 
156
  options_data : '',
157
  widgets_data : '',
 
 
158
  import_start_time : '',
159
  import_end_time : '',
 
 
160
 
161
  init: function()
162
  {
163
- this._resetPagedCount();
164
  this._bind();
 
 
 
165
  },
166
 
167
  /**
168
- * Debugging.
169
  *
170
- * @param {mixed} data Mixed data.
171
  */
172
- _log: function( data ) {
173
-
174
- if( astraSitesAdmin.debug ) {
 
175
 
176
- var date = new Date();
177
- var time = date.toLocaleTimeString();
 
 
 
 
 
 
 
 
 
178
 
179
- if (typeof data == 'object') {
180
- console.log('%c ' + JSON.stringify( data ) + ' ' + time, 'background: #ededed; color: #444');
181
- } else {
182
- console.log('%c ' + data + ' ' + time, 'background: #ededed; color: #444');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
 
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
  },
188
 
189
  _log_title: function( data, append ) {
190
 
191
- var markup = '<p>' + data + '</p>';
192
  if (typeof data == 'object' ) {
193
  var markup = '<p>' + JSON.stringify( data ) + '</p>';
194
  }
195
 
 
 
 
 
 
196
  if ( append ) {
197
- $('.current-importing-status-title').append( markup );
198
  } else {
199
- $('.current-importing-status-title').html( markup );
200
  }
 
201
  },
202
 
203
  /**
@@ -209,32 +388,55 @@ var AstraSitesAjaxQueue = (function() {
209
  */
210
  _bind: function()
211
  {
212
- $( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
213
- $( document ).on( 'click' , '.page-builders li', AstraSitesAdmin._toggle_reset_notice );
214
- $( document ).on('click' , '#astra-sites-welcome-form .submit', AstraSitesAdmin._show_page_builder_notice);
215
- $( document ).on('click' , '#astra-sites-welcome-form li', AstraSitesAdmin._show_next_button);
216
- $( document ).on('change' , '#astra-sites-welcome-form-inline select', AstraSitesAdmin._change_page_builder);
217
- $( document ).on('click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
218
- $( document ).on('click' , '.astra-sites-advanced-options-button', AstraSitesAdmin._toggle_advanced_options);
219
-
220
- $( document ).on('click' , '.astra-import-settings', AstraSitesAdmin._import_settings);
221
- $( document ).on('click' , '.devices button', AstraSitesAdmin._previewDevice);
222
- $( document ).on('click' , '.theme-browser .theme-screenshot, .theme-browser .more-details, .theme-browser .install-theme-preview', AstraSitesAdmin._preview);
223
- $( document ).on('click' , '.next-theme', AstraSitesAdmin._nextTheme);
224
- $( document ).on('click' , '.previous-theme', AstraSitesAdmin._previousTheme);
225
- $( document ).on('click' , '.collapse-sidebar', AstraSitesAdmin._collapse);
226
- $( document ).on('click' , '.astra-demo-import', AstraSitesAdmin._importDemo);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
 
228
- $( document ).on('astra-sites-install-and-activate-required-plugins-done' , AstraSitesAdmin._process_import );
 
 
 
 
 
229
 
230
- $( document ).on('click' , '.install-now', AstraSitesAdmin._installNow);
231
- $( document ).on('click' , '.close-full-overlay', AstraSitesAdmin._fullOverlay);
232
- $( document ).on('click' , '.activate-now', AstraSitesAdmin._activateNow);
233
- $( document ).on('wp-plugin-installing' , AstraSitesAdmin._pluginInstalling);
234
- $( document ).on('wp-plugin-install-error' , AstraSitesAdmin._installError);
235
- $( document ).on('wp-plugin-install-success' , AstraSitesAdmin._installSuccess);
236
 
237
- $( document ).on( 'astra-sites-import-set-site-data-done' , AstraSitesAdmin._resetData );
238
  $( document ).on( 'astra-sites-reset-data' , AstraSitesAdmin._backup_before_rest_options );
239
  $( document ).on( 'astra-sites-backup-settings-before-reset-done' , AstraSitesAdmin._reset_customizer_data );
240
  $( document ).on( 'astra-sites-reset-customizer-data-done' , AstraSitesAdmin._reset_site_options );
@@ -243,215 +445,1622 @@ var AstraSitesAjaxQueue = (function() {
243
  $( document ).on( 'astra-sites-delete-terms-done' , AstraSitesAdmin._reset_wp_forms );
244
  $( document ).on( 'astra-sites-delete-wp-forms-done' , AstraSitesAdmin._reset_posts );
245
 
246
- $( document ).on('astra-sites-reset-data-done' , AstraSitesAdmin._recheck_backup_options );
247
- $( document ).on('astra-sites-backup-settings-done' , AstraSitesAdmin._importWPForms );
248
- $( document ).on('astra-sites-import-wpforms-done' , AstraSitesAdmin._importCustomizerSettings );
249
- $( document ).on('astra-sites-import-customizer-settings-done' , AstraSitesAdmin._importXML );
250
- $( document ).on('astra-sites-import-xml-done' , AstraSitesAdmin._importSiteOptions );
251
- $( document ).on('astra-sites-import-options-done' , AstraSitesAdmin._importWidgets );
252
- $( document ).on('astra-sites-import-widgets-done' , AstraSitesAdmin._importEnd );
 
253
 
254
- },
255
 
256
- _show_next_button: function() {
257
- $( this ).parents('.page-builders').find('img').removeClass('wp-ui-highlight');
258
- $( this ).find('img').addClass('wp-ui-highlight');
259
 
260
- $('#submit').parent().removeClass('submit');
261
- $('#submit').removeClass('disabled');
262
- $('.astra-sites-page-builder-notice').hide();
263
- },
 
 
 
 
 
 
 
 
 
 
264
 
265
- _show_page_builder_notice: function() {
266
- $('.astra-sites-page-builder-notice').show();
 
 
 
 
 
 
 
 
 
267
  },
268
 
269
- _change_page_builder: function() {
270
- $(this).closest('form').submit();
 
 
 
 
271
  },
272
 
273
- _toggle_tooltip: function( event ) {
274
- event.preventDefault();
275
- var tip_id = $( this ).data('tip-id') || '';
276
- if( tip_id && $( '#' + tip_id ).length ) {
277
- $( '#' + tip_id ).toggle();
278
  }
279
  },
280
 
281
- _toggle_advanced_options: function( event ) {
282
- event.preventDefault();
283
- $('.astra-sites-advanced-options').toggle();
 
 
 
 
 
 
284
  },
285
 
286
- _resetData: function( event ) {
287
- event.preventDefault();
288
 
289
- if ( $( '.astra-sites-reset-data' ).find('.checkbox').is(':checked') ) {
290
- $(document).trigger( 'astra-sites-reset-data' );
 
 
 
291
  } else {
292
- $(document).trigger( 'astra-sites-reset-data-done' );
 
293
  }
294
  },
295
 
296
- _reset_customizer_data: function() {
297
- $.ajax({
298
- url : astraSitesAdmin.ajaxurl,
299
- type : 'POST',
300
- data : {
301
- action : 'astra-sites-reset-customizer-data',
302
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
303
- },
304
- beforeSend: function() {
305
- AstraSitesAdmin._log_title( 'Reseting Customizer Data..' );
306
- },
307
- })
308
- .fail(function( jqXHR ){
309
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
310
- })
311
- .done(function ( data ) {
312
- AstraSitesAdmin._log_title( 'Complete Resetting Customizer Data..' );
313
- $(document).trigger( 'astra-sites-reset-customizer-data-done' );
314
- });
315
- },
316
 
317
- _reset_site_options: function() {
318
- // Site Options.
319
- $.ajax({
320
- url : astraSitesAdmin.ajaxurl,
321
- type : 'POST',
322
- data : {
323
- action : 'astra-sites-reset-site-options',
324
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
325
- },
326
- beforeSend: function() {
327
- AstraSitesAdmin._log_title( 'Reseting Site Options..' );
328
- },
329
- })
330
- .fail(function( jqXHR ){
331
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
332
- })
333
- .done(function ( data ) {
334
- AstraSitesAdmin._log_title( 'Complete Reseting Site Options..' );
335
- $(document).trigger( 'astra-sites-reset-site-options-done' );
336
- });
337
  },
338
 
339
- _reset_widgets_data: function() {
340
- // Widgets.
341
- $.ajax({
342
- url : astraSitesAdmin.ajaxurl,
343
- type : 'POST',
344
- data : {
345
- action : 'astra-sites-reset-widgets-data',
346
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
347
- },
348
- beforeSend: function() {
349
- AstraSitesAdmin._log_title( 'Reseting Widgets..' );
350
- },
351
- })
352
- .fail(function( jqXHR ){
353
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
354
- })
355
- .done(function ( data ) {
356
- AstraSitesAdmin._log_title( 'Complete Reseting Widgets..' );
357
- $(document).trigger( 'astra-sites-reset-widgets-data-done' );
358
- });
359
- },
360
 
361
- _reset_posts: function() {
362
- if( AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
363
 
364
- AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
 
 
 
 
 
 
365
 
366
- $.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
 
 
 
 
 
367
 
368
- AstraSitesAdmin._log_title( 'Deleting Posts..' );
369
 
370
- AstraSitesAjaxQueue.add({
371
- url: astraSitesAdmin.ajaxurl,
372
- type: 'POST',
373
- data: {
374
- action : 'astra-sites-delete-posts',
375
- post_id : post_id,
376
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
377
- },
378
- success: function( result ){
379
 
380
- if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
381
- AstraSitesAdmin.reset_processed_posts+=1;
382
- }
 
 
383
 
384
- AstraSitesAdmin._log_title( 'Deleting Post ' + AstraSitesAdmin.reset_processed_posts + ' of ' + AstraSitesAdmin.site_imported_data['reset_posts'].length + '<br/>' + result.data );
 
 
385
 
386
- AstraSitesAdmin.reset_remaining_posts-=1;
387
- if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
388
- $(document).trigger( 'astra-sites-delete-posts-done' );
389
- $(document).trigger( 'astra-sites-reset-data-done' );
390
- }
391
- }
392
- });
393
- });
394
- AstraSitesAjaxQueue.run();
395
 
396
- } else {
397
- $(document).trigger( 'astra-sites-delete-posts-done' );
398
- $(document).trigger( 'astra-sites-reset-data-done' );
399
- }
400
  },
401
 
402
- _reset_wp_forms: function() {
403
 
404
- if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
405
- AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
406
 
407
- $.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
408
- AstraSitesAdmin._log_title( 'Deleting WP Forms..' );
409
- AstraSitesAjaxQueue.add({
410
- url: astraSitesAdmin.ajaxurl,
411
- type: 'POST',
412
- data: {
413
- action : 'astra-sites-delete-wp-forms',
414
- post_id : post_id,
415
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
416
- },
417
- success: function( result ){
418
 
419
- if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
420
- AstraSitesAdmin.reset_processed_wp_forms+=1;
421
- }
422
 
423
- AstraSitesAdmin._log_title( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
 
 
 
424
 
425
- AstraSitesAdmin.reset_remaining_wp_forms-=1;
426
- if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
427
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
428
- }
429
- }
430
- });
431
- });
432
- AstraSitesAjaxQueue.run();
433
 
 
 
 
 
434
  } else {
435
- $(document).trigger( 'astra-sites-delete-wp-forms-done' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  }
437
  },
438
 
439
-
440
- _reset_terms: function() {
 
 
 
 
 
 
 
441
 
 
 
 
 
 
 
 
 
 
 
442
 
443
- if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
444
- AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
 
 
 
 
 
 
 
 
 
 
 
445
 
446
- $.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
447
- AstraSitesAdmin._log_title( 'Deleting Terms..' );
448
- AstraSitesAjaxQueue.add({
449
- url: astraSitesAdmin.ajaxurl,
450
- type: 'POST',
451
- data: {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
  action : 'astra-sites-delete-terms',
453
  term_id : term_id,
454
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
455
  },
456
  success: function( result ){
457
  if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
@@ -459,16 +2068,17 @@ var AstraSitesAjaxQueue = (function() {
459
  }
460
 
461
  AstraSitesAdmin._log_title( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
 
462
 
463
  AstraSitesAdmin.reset_remaining_terms-=1;
464
  if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
 
465
  $(document).trigger( 'astra-sites-delete-terms-done' );
466
  }
467
  }
468
  });
469
  });
470
  AstraSitesAjaxQueue.run();
471
-
472
  } else {
473
  $(document).trigger( 'astra-sites-delete-terms-done' );
474
  }
@@ -483,80 +2093,92 @@ var AstraSitesAjaxQueue = (function() {
483
  }
484
  },
485
 
486
- _backup_before_rest_options: function() {
487
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-before-reset-done' );
488
- AstraSitesAdmin.backup_taken = true;
489
- },
490
 
491
- _recheck_backup_options: function() {
492
- AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-done' );
493
- AstraSitesAdmin.backup_taken = true;
494
- },
495
 
496
- _backupOptions: function( trigger_name ) {
497
- $.ajax({
498
- url : astraSitesAdmin.ajaxurl,
499
- type : 'POST',
500
- data : {
501
- action : 'astra-sites-backup-settings',
502
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
503
- },
504
- beforeSend: function() {
505
- AstraSitesAdmin._log_title( 'Processing Customizer Settings Backup..' );
506
- },
507
- })
508
- .fail(function( jqXHR ){
509
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
510
- })
511
- .done(function ( data ) {
512
 
513
- // 1. Pass - Import Customizer Options.
514
- AstraSitesAdmin._log_title( 'Customizer Settings Backup Done..' );
 
515
 
516
- // Custom trigger.
517
- $(document).trigger( trigger_name );
518
- });
519
- },
520
 
521
- _import_settings: function( event ) {
522
- event.preventDefault();
 
 
 
 
 
 
 
 
 
 
 
 
 
523
 
524
- var btn = $(this);
 
 
525
 
526
- btn.addClass('updating-message');
 
 
 
527
 
 
 
 
 
528
 
529
- $.ajax({
530
- url : astraSitesAdmin.ajaxurl,
531
- type : 'POST',
532
- dataType: 'json',
533
- data : {
534
- action : 'astra-sites-import-customizer-settings',
535
- customizer_data : AstraSitesAdmin.current_site['astra-site-customizer-data'],
536
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
537
- },
538
- beforeSend: function() {
539
- AstraSitesAdmin._log_title( 'Importing Customizer Settings..' );
540
- },
541
- })
542
- .fail(function( jqXHR ){
543
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
544
- })
545
- .done(function ( customizer_data ) {
546
 
547
- btn.removeClass( 'updating-message' );
 
 
 
548
 
549
- // 1. Fail - Import Customizer Options.
550
- if( false === customizer_data.success ) {
551
- AstraSitesAdmin._log_title( customizer_data.data );
552
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
554
  // 1. Pass - Import Customizer Options.
555
- AstraSitesAdmin._log_title( 'Imported Customizer Settings..' );
 
 
 
 
 
 
556
 
557
- $(document).trigger( 'astra-sites-import-customizer-settings-done' );
558
- }
559
- });
560
  },
561
 
562
  /**
@@ -565,60 +2187,40 @@ var AstraSitesAjaxQueue = (function() {
565
  _importEnd: function( event ) {
566
 
567
  $.ajax({
568
- url : astraSitesAdmin.ajaxurl,
569
  type : 'POST',
570
  dataType: 'json',
571
  data : {
572
  action : 'astra-sites-import-end',
573
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
574
  },
575
  beforeSend: function() {
 
576
  AstraSitesAdmin._log_title( 'Import Complete!' );
 
577
  }
578
  })
579
  .fail(function( jqXHR ){
580
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
 
 
581
  })
582
- .done(function ( data ) {
 
 
583
 
584
  // 5. Fail - Import Complete.
585
- if( false === data.success ) {
586
- AstraSitesAdmin._log_title( data.data );
587
  } else {
588
 
589
  $('body').removeClass('importing-site');
590
- $('.previous-theme, .next-theme').removeClass('disabled');
591
-
592
- var date = new Date();
593
-
594
- AstraSitesAdmin.import_end_time = new Date();
595
- var diff = ( AstraSitesAdmin.import_end_time.getTime() - AstraSitesAdmin.import_start_time.getTime() );
596
-
597
- var time = '';
598
- var seconds = Math.floor( diff / 1000 );
599
- var minutes = Math.floor( seconds / 60 );
600
- var hours = Math.floor( minutes / 60 );
601
 
602
- minutes = minutes - ( hours * 60 );
603
- seconds = seconds - ( minutes * 60 );
604
-
605
- if( hours ) {
606
- time += hours + ' Hours ';
607
- }
608
- if( minutes ) {
609
- time += minutes + ' Minutes ';
610
- }
611
- if( seconds ) {
612
- time += seconds + ' Seconds';
613
- }
614
-
615
- var output = '<h2>Done 🎉</h2>';
616
- output += '<p>Your starter site has been imported successfully in '+time+'! Now go ahead, customize the text, images, and design to make it yours!</p>';
617
- output += '<p>You can now start making changes according to your requirements.</p>';
618
- output += '<p><a class="button button-primary button-hero" href="'+astraSitesAdmin.siteURL+'" target="_blank">View Site <i class="dashicons dashicons-external"></i></a></p>';
619
 
620
  $('.rotating,.current-importing-status-wrap,.notice-warning').remove();
621
- $('.astra-sites-result-preview .inner').html(output);
622
 
623
  // 5. Pass - Import Complete.
624
  AstraSitesAdmin._importSuccessButton();
@@ -632,32 +2234,36 @@ var AstraSitesAjaxQueue = (function() {
632
  _importWidgets: function( event ) {
633
  if ( AstraSitesAdmin._is_process_widgets() ) {
634
  $.ajax({
635
- url : astraSitesAdmin.ajaxurl,
636
  type : 'POST',
637
  dataType: 'json',
638
  data : {
639
  action : 'astra-sites-import-widgets',
640
  widgets_data : AstraSitesAdmin.widgets_data,
641
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
642
  },
643
  beforeSend: function() {
 
644
  AstraSitesAdmin._log_title( 'Importing Widgets..' );
645
  },
646
  })
647
  .fail(function( jqXHR ){
648
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
 
 
649
  })
650
- .done(function ( widgets_data ) {
 
 
651
 
652
  // 4. Fail - Import Widgets.
653
- if( false === widgets_data.success ) {
654
- AstraSitesAdmin._log_title( widgets_data.data );
655
 
656
  } else {
657
-
658
  // 4. Pass - Import Widgets.
659
- AstraSitesAdmin._log_title( 'Imported Widgets!' );
660
- $(document).trigger( 'astra-sites-import-widgets-done' );
661
  }
662
  });
663
  } else {
@@ -668,39 +2274,44 @@ var AstraSitesAjaxQueue = (function() {
668
  /**
669
  * 3. Import Site Options.
670
  */
671
- _importSiteOptions: function( event ) {
672
 
673
  if ( AstraSitesAdmin._is_process_xml() ) {
674
  $.ajax({
675
- url : astraSitesAdmin.ajaxurl,
676
  type : 'POST',
677
  dataType: 'json',
678
  data : {
679
  action : 'astra-sites-import-options',
680
  options_data : AstraSitesAdmin.options_data,
681
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
682
  },
683
  beforeSend: function() {
 
684
  AstraSitesAdmin._log_title( 'Importing Options..' );
685
  $('.astra-demo-import .percent').html('');
686
  },
687
  })
688
  .fail(function( jqXHR ){
689
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
 
 
690
  })
691
- .done(function ( options_data ) {
692
-
693
  // 3. Fail - Import Site Options.
694
- if( false === options_data.success ) {
695
- AstraSitesAdmin._log_title( options_data );
 
696
  } else {
 
697
 
698
  // 3. Pass - Import Site Options.
699
  $(document).trigger( 'astra-sites-import-options-done' );
700
  }
701
  });
702
  } else {
703
- $(document).trigger( 'astra-sites-import-options-done' );
704
  }
705
  },
706
 
@@ -711,32 +2322,39 @@ var AstraSitesAjaxQueue = (function() {
711
 
712
  if ( AstraSitesAdmin._is_process_xml() ) {
713
  $.ajax({
714
- url : astraSitesAdmin.ajaxurl,
715
  type : 'POST',
716
  dataType: 'json',
717
  data : {
718
  action : 'astra-sites-import-prepare-xml',
719
- wxr_url : AstraSitesAdmin.current_site['astra-site-wxr-path'],
720
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
721
  },
722
  beforeSend: function() {
723
- $('.astra-site-import-process-wrap').show();
724
  AstraSitesAdmin._log_title( 'Importing Content..' );
 
 
725
  },
726
  })
727
  .fail(function( jqXHR ){
728
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
 
 
729
  })
730
- .done(function ( xml_data ) {
731
 
732
- xml_data.data.url = wp.url.addQueryArgs( xml_data.data.url, { _ajax_nonce: astraSitesAdmin._ajax_nonce } )
 
 
733
 
734
  // 2. Fail - Prepare XML Data.
735
- if( false === xml_data.success ) {
736
- AstraSitesAdmin._log_title( xml_data );
737
- var error_msg = xml_data.data.error || xml_data.data;
738
- AstraSitesAdmin._log_title( error_msg );
739
 
 
740
  } else {
741
 
742
  var xml_processing = $('.astra-demo-import').attr( 'data-xml-processing' );
@@ -750,13 +2368,13 @@ var AstraSitesAjaxQueue = (function() {
750
  // 2. Pass - Prepare XML Data.
751
 
752
  // Import XML though Event Source.
753
- AstraSSEImport.data = xml_data.data;
754
  AstraSSEImport.render();
755
 
756
  $('.current-importing-status-description').html('').show();
757
 
758
- $('.astra-sites-result-preview .inner').append('<div class="astra-site-import-process-wrap"><progress class="astra-site-import-process" max="100" value="0"></progress></div>');
759
-
760
  var evtSource = new EventSource( AstraSSEImport.data.url );
761
  evtSource.onmessage = function ( message ) {
762
  var data = JSON.parse( message.data );
@@ -775,12 +2393,16 @@ var AstraSitesAjaxQueue = (function() {
775
  document.getElementsByClassName("astra-site-import-process").value = '100';
776
 
777
  $('.astra-site-import-process-wrap').hide();
 
778
 
779
  $(document).trigger( 'astra-sites-import-xml-done' );
780
 
781
  break;
782
  }
783
  };
 
 
 
784
  evtSource.addEventListener( 'log', function ( message ) {
785
  var data = JSON.parse( message.data );
786
  var message = data.message || '';
@@ -790,14 +2412,20 @@ var AstraSitesAjaxQueue = (function() {
790
  });
791
  $('.current-importing-status-description').html( message );
792
  }
 
793
  });
794
  }
795
  });
796
  } else {
797
  $(document).trigger( 'astra-sites-import-xml-done' );
798
  }
 
799
 
800
-
 
 
 
 
801
  },
802
 
803
  _is_process_xml: function() {
@@ -808,7 +2436,10 @@ var AstraSitesAjaxQueue = (function() {
808
  },
809
 
810
  _is_process_customizer: function() {
811
- if ( $( '.astra-sites-import-customizer' ).find('.checkbox').is(':checked') ) {
 
 
 
812
  return true;
813
  }
814
  return false;
@@ -821,41 +2452,91 @@ var AstraSitesAjaxQueue = (function() {
821
  return false;
822
  },
823
 
824
- /**
825
- * 1. Import WPForms Options.
826
- */
827
- _importWPForms: function( event ) {
828
- if ( AstraSitesAdmin._is_process_customizer() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
829
  $.ajax({
830
- url : astraSitesAdmin.ajaxurl,
831
  type : 'POST',
832
  dataType: 'json',
833
  data : {
834
  action : 'astra-sites-import-wpforms',
835
  wpforms_url : AstraSitesAdmin.wpforms_url,
836
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
837
  },
838
  beforeSend: function() {
 
839
  AstraSitesAdmin._log_title( 'Importing WP Forms..' );
 
840
  },
841
  })
842
  .fail(function( jqXHR ){
843
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
 
 
844
  })
845
- .done(function ( forms ) {
 
846
 
847
  // 1. Fail - Import WPForms Options.
848
- if( false === forms.success ) {
849
- AstraSitesAdmin._log_title( forms.data );
 
850
  } else {
851
-
852
  // 1. Pass - Import Customizer Options.
853
- $(document).trigger( 'astra-sites-import-wpforms-done' );
854
  }
855
  });
 
856
  } else {
857
- $(document).trigger( 'astra-sites-import-wpforms-done' );
858
  }
 
859
  },
860
 
861
  /**
@@ -864,27 +2545,34 @@ var AstraSitesAjaxQueue = (function() {
864
  _importCustomizerSettings: function( event ) {
865
  if ( AstraSitesAdmin._is_process_customizer() ) {
866
  $.ajax({
867
- url : astraSitesAdmin.ajaxurl,
868
  type : 'POST',
869
  dataType: 'json',
870
  data : {
871
  action : 'astra-sites-import-customizer-settings',
872
  customizer_data : AstraSitesAdmin.customizer_data,
873
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
874
  },
875
  beforeSend: function() {
 
 
 
876
  },
877
  })
878
  .fail(function( jqXHR ){
879
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText, true );
 
 
880
  })
881
- .done(function ( customizer_data ) {
 
882
 
883
  // 1. Fail - Import Customizer Options.
884
- if( false === customizer_data.success ) {
885
- AstraSitesAdmin._log_title( customizer_data.data );
 
886
  } else {
887
-
888
  // 1. Pass - Import Customizer Options.
889
  $(document).trigger( 'astra-sites-import-customizer-settings-done' );
890
  }
@@ -897,7 +2585,7 @@ var AstraSitesAjaxQueue = (function() {
897
 
898
  /**
899
  * Import Success Button.
900
- *
901
  * @param {string} data Error message.
902
  */
903
  _importSuccessButton: function() {
@@ -906,98 +2594,32 @@ var AstraSitesAjaxQueue = (function() {
906
  .removeAttr('data-import')
907
  .addClass('view-site')
908
  .removeClass('astra-demo-import')
909
- .text( astraSitesAdmin.strings.viewSite )
910
  .attr('target', '_blank')
911
  .append('<i class="dashicons dashicons-external"></i>')
912
- .attr('href', astraSitesAdmin.siteURL );
913
- },
914
-
915
- /**
916
- * Preview Device
917
- */
918
- _previewDevice: function( event ) {
919
- var device = $( event.currentTarget ).data( 'device' );
920
-
921
- $('.theme-install-overlay')
922
- .removeClass( 'preview-desktop preview-tablet preview-mobile' )
923
- .addClass( 'preview-' + device )
924
- .data( 'current-preview-device', device );
925
-
926
- AstraSitesAdmin._tooglePreviewDeviceButtons( device );
927
- },
928
-
929
- /**
930
- * Toggle Preview Buttons
931
- */
932
- _tooglePreviewDeviceButtons: function( newDevice ) {
933
- var $devices = $( '.wp-full-overlay-footer .devices' );
934
-
935
- $devices.find( 'button' )
936
- .removeClass( 'active' )
937
- .attr( 'aria-pressed', false );
938
-
939
- $devices.find( 'button.preview-' + newDevice )
940
- .addClass( 'active' )
941
- .attr( 'aria-pressed', true );
942
  },
943
 
944
  /**
945
  * Import Error Button.
946
- *
947
  * @param {string} data Error message.
948
  */
949
- _importFailMessage: function( message ) {
950
-
951
- $('.astra-demo-import')
952
- .addClass('go-pro button-primary')
953
- .removeClass('updating-message installing')
954
- .removeAttr('data-import')
955
- .attr('target', '_blank')
956
- .append('<i class="dashicons dashicons-external"></i>')
957
- .removeClass('astra-demo-import');
958
-
959
- AstraSitesAdmin._log_title( message );
960
-
961
- $('.wp-full-overlay-header .go-pro').text( astraSitesAdmin.strings.importFailBtn );
962
- $('.wp-full-overlay-footer .go-pro').text( astraSitesAdmin.strings.importFailBtnLarge )
963
- },
964
-
965
-
966
- /**
967
- * Install Now
968
- */
969
- _installNow: function(event)
970
- {
971
- event.preventDefault();
972
 
973
- var $button = jQuery( event.target ),
974
- $document = jQuery(document);
975
 
976
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
977
- return;
978
- }
979
-
980
- AstraSitesAdmin._log_title( 'Installing Required Plugin..' );
981
-
982
- if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
983
- wp.updates.requestFilesystemCredentials( event );
984
 
985
- $document.on( 'credential-modal-cancel', function() {
986
- var $message = $( '.install-now.updating-message' );
987
-
988
- $message
989
- .removeClass( 'updating-message' )
990
- .text( wp.updates.l10n.installNow );
991
-
992
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
993
- } );
994
  }
 
 
 
995
 
996
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $button.data( 'name' ) ) );
997
-
998
- wp.updates.installPlugin( {
999
- slug: $button.data( 'slug' )
1000
- } );
1001
  },
1002
 
1003
  ucwords: function( str ) {
@@ -1023,49 +2645,47 @@ var AstraSitesAjaxQueue = (function() {
1023
 
1024
  event.preventDefault();
1025
 
1026
-
1027
- var $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val();
1028
-
1029
- var $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1030
-
1031
- // Transform the 'Install' button into an 'Activate' button.
1032
- var $init = $( '.plugin-card-' + response.slug ).data('init');
1033
- var $name = $( '.plugin-card-' + response.slug ).data('name');
1034
 
1035
  // Reset not installed plugins list.
1036
- var pluginsList = astraSitesAdmin.requiredPlugins.notinstalled;
1037
- astraSitesAdmin.requiredPlugins.notinstalled = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1038
 
1039
  // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
1040
  setTimeout( function() {
1041
 
1042
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords($name) );
 
 
 
1043
 
1044
  $.ajax({
1045
- url: astraSitesAdmin.ajaxurl,
1046
  type: 'POST',
1047
  data: {
1048
  'action' : 'astra-required-plugin-activate',
1049
- 'init' : $init,
1050
- 'options' : $siteOptions,
1051
- 'enabledExtensions' : $enabledExtensions,
1052
- '_ajax_nonce' : astraSitesAdmin._ajax_nonce,
1053
  },
1054
  })
1055
  .done(function (result) {
 
1056
 
1057
  if( result.success ) {
1058
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1059
 
1060
- AstraSitesAdmin._log_title( 'Installed Plugin - ' + AstraSitesAdmin.ucwords($name) );
 
1061
 
1062
  // Reset not installed plugins list.
1063
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1064
 
1065
  // Enable Demo Import Button
1066
  AstraSitesAdmin._enable_demo_import_button();
1067
-
1068
  }
 
1069
  });
1070
 
1071
  }, 1200 );
@@ -1077,114 +2697,34 @@ var AstraSitesAjaxQueue = (function() {
1077
  */
1078
  _installError: function( event, response ) {
1079
 
1080
- var $card = $( '.plugin-card-' + response.slug );
1081
- var $name = $card.data('name');
1082
-
1083
- AstraSitesAdmin._log_title( response.errorMessage + ' ' + AstraSitesAdmin.ucwords($name) );
1084
-
1085
-
1086
- $card
1087
- .removeClass( 'button-primary' )
1088
- .addClass( 'disabled' )
1089
- .html( wp.updates.l10n.installFailedShort );
1090
-
1091
- },
1092
-
1093
- /**
1094
- * Installing Plugin
1095
- */
1096
- _pluginInstalling: function(event, args) {
1097
- event.preventDefault();
1098
-
1099
- var $card = $( '.plugin-card-' + args.slug );
1100
- var $name = $card.data('name');
1101
-
1102
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( $name ));
1103
-
1104
- $card.addClass('updating-message');
1105
-
1106
- },
1107
-
1108
- /**
1109
- * Render Demo Preview
1110
- */
1111
- _activateNow: function( eventn ) {
1112
-
1113
  event.preventDefault();
1114
 
1115
- var $button = jQuery( event.target ),
1116
- $init = $button.data( 'init' ),
1117
- $slug = $button.data( 'slug' );
1118
- $name = $button.data( 'name' );
1119
-
1120
- if ( $button.hasClass( 'updating-message' ) || $button.hasClass( 'button-disabled' ) ) {
1121
- return;
1122
- }
1123
-
1124
- AstraSitesAdmin._log_title( 'Activating Plugin - ' + AstraSitesAdmin.ucwords( $name ) );
1125
-
1126
- $button.addClass('updating-message button-primary')
1127
- .html( astraSitesAdmin.strings.btnActivating );
1128
 
1129
- var $siteOptions = jQuery( '.wp-full-overlay-header').find('.astra-site-options').val();
1130
- var $enabledExtensions = jQuery( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1131
 
1132
- $.ajax({
1133
- url: astraSitesAdmin.ajaxurl,
1134
- type: 'POST',
1135
- data: {
1136
- 'action' : 'astra-required-plugin-activate',
1137
- 'init' : $init,
1138
- 'options' : $siteOptions,
1139
- 'enabledExtensions' : $enabledExtensions,
1140
- '_ajax_nonce' : astraSitesAdmin._ajax_nonce,
1141
- },
1142
- })
1143
- .done(function (result) {
1144
-
1145
- if( result.success ) {
1146
-
1147
- AstraSitesAdmin._log_title( 'Activated Plugin - ' + AstraSitesAdmin.ucwords($name) );
1148
-
1149
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1150
-
1151
- // Reset not installed plugins list.
1152
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( $slug, pluginsList );
1153
-
1154
- $button.removeClass( 'button-primary install-now activate-now updating-message' )
1155
- .attr('disabled', 'disabled')
1156
- .addClass('disabled')
1157
- .text( astraSitesAdmin.strings.btnActive );
1158
 
1159
- // Enable Demo Import Button
1160
- AstraSitesAdmin._enable_demo_import_button();
1161
 
1162
- }
1163
-
1164
- })
1165
- .fail(function () {
1166
- });
1167
 
 
1168
  },
1169
 
1170
  /**
1171
- * Full Overlay
1172
  */
1173
- _fullOverlay: function (event) {
1174
  event.preventDefault();
1175
 
1176
- // Import process is started?
1177
- // And Closing the window? Then showing the warning confirm message.
1178
- if( $('body').hasClass('importing-site') && ! confirm( astraSitesAdmin.strings.warningBeforeCloseWindow ) ) {
1179
- return;
1180
- }
1181
 
1182
- $('body').removeClass('importing-site');
1183
- $('.previous-theme, .next-theme').removeClass('disabled');
1184
- $('.theme-install-overlay').css('display', 'none');
1185
- $('.theme-install-overlay').remove();
1186
- $('.theme-preview-on').removeClass('theme-preview-on');
1187
- $('html').removeClass('astra-site-preview-on');
1188
  },
1189
 
1190
  /**
@@ -1192,12 +2732,17 @@ var AstraSitesAjaxQueue = (function() {
1192
  */
1193
  _bulkPluginInstallActivate: function()
1194
  {
1195
- if( 0 === astraSitesAdmin.requiredPlugins.length ) {
1196
  return;
1197
  }
1198
 
1199
- var not_installed = astraSitesAdmin.requiredPlugins.notinstalled || '';
1200
- var activate_plugins = astraSitesAdmin.requiredPlugins.inactive || '';
 
 
 
 
 
1201
 
1202
  // First Install Bulk.
1203
  if( not_installed.length > 0 ) {
@@ -1220,37 +2765,42 @@ var AstraSitesAjaxQueue = (function() {
1220
  */
1221
  _activateAllPlugins: function( activate_plugins ) {
1222
 
1223
- AstraSitesAdmin._log_title( 'Activating Required Plugins..' );
1224
 
1225
  $.each( activate_plugins, function(index, single_plugin) {
1226
 
1227
- var $card = $( '.plugin-card-' + single_plugin.slug ),
1228
- $siteOptions = $( '.wp-full-overlay-header').find('.astra-site-options').val(),
1229
- $enabledExtensions = $( '.wp-full-overlay-header').find('.astra-enabled-extensions').val();
1230
-
1231
-
1232
  AstraSitesAjaxQueue.add({
1233
- url: astraSitesAdmin.ajaxurl,
1234
  type: 'POST',
1235
  data: {
1236
  'action' : 'astra-required-plugin-activate',
1237
  'init' : single_plugin.init,
1238
- 'options' : $siteOptions,
1239
- 'enabledExtensions' : $enabledExtensions,
1240
- '_ajax_nonce' : astraSitesAdmin._ajax_nonce,
 
 
 
 
1241
  },
1242
  success: function( result ){
 
 
1243
 
1244
  if( result.success ) {
1245
-
1246
- var pluginsList = astraSitesAdmin.requiredPlugins.inactive;
1247
 
1248
  // Reset not installed plugins list.
1249
- astraSitesAdmin.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( single_plugin.slug, pluginsList );
1250
 
1251
  // Enable Demo Import Button
1252
  AstraSitesAdmin._enable_demo_import_button();
1253
- } else {
 
 
 
 
 
1254
  }
1255
  }
1256
  });
@@ -1263,20 +2813,22 @@ var AstraSitesAjaxQueue = (function() {
1263
  */
1264
  _installAllPlugins: function( not_installed ) {
1265
 
1266
- AstraSitesAdmin._log_title( 'Installing Required Plugins..' );
1267
-
1268
  $.each( not_installed, function(index, single_plugin) {
1269
 
1270
- AstraSitesAdmin._log_title( 'Installing Plugin - ' + AstraSitesAdmin.ucwords( single_plugin.name ));
1271
-
1272
- var $card = $( '.plugin-card-' + single_plugin.slug );
1273
-
1274
  // Add each plugin activate request in Ajax queue.
1275
  // @see wp-admin/js/updates.js
1276
  wp.updates.queue.push( {
1277
  action: 'install-plugin', // Required action.
1278
  data: {
1279
- slug: single_plugin.slug
 
 
 
 
 
 
 
 
1280
  }
1281
  } );
1282
  });
@@ -1285,407 +2837,416 @@ var AstraSitesAjaxQueue = (function() {
1285
  wp.updates.queueChecker();
1286
  },
1287
 
1288
- /**
1289
- * Fires when a nav item is clicked.
1290
- *
1291
- * @since 1.0
1292
- * @access private
1293
- * @method _importDemo
1294
- */
1295
- _importDemo: function(event) {
1296
  event.preventDefault();
 
 
 
 
1297
 
1298
- var date = new Date();
1299
-
1300
- AstraSitesAdmin.import_start_time = new Date();
1301
-
1302
- var disabled = $(this).attr('data-import');
1303
-
1304
- if ( typeof disabled !== 'undefined' && disabled === 'disabled' || $this.hasClass('disabled') ) {
1305
-
1306
- $('.astra-demo-import').addClass('updating-message installing')
1307
- .text( wp.updates.l10n.installing );
1308
-
1309
- $('.astra-sites-result-preview').show();
1310
- var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
1311
- $('.current-importing-status').html( output );
1312
-
1313
- /**
1314
- * Process Bulk Plugin Install & Activate
1315
- */
1316
- AstraSitesAdmin._bulkPluginInstallActivate();
1317
- }
1318
  },
1319
 
1320
- _process_import: function() {
1321
 
1322
- var $theme = $('.astra-sites-preview').find('.wp-full-overlay-header'),
1323
- apiURL = $theme.data('demo-api') || '';
1324
-
1325
- $('body').addClass('importing-site');
1326
- $('.previous-theme, .next-theme').addClass('disabled');
1327
-
1328
- // Remove all notices before import start.
1329
- $('.install-theme-info > .notice').remove();
1330
-
1331
- $('.astra-demo-import').attr('data-import', 'disabled')
1332
- .addClass('updating-message installing')
1333
- .text( astraSitesAdmin.strings.importingDemo );
1334
-
1335
- // Site Import by API URL.
1336
- if( apiURL ) {
1337
- AstraSitesAdmin._importSite( apiURL );
1338
  }
1339
 
1340
- },
1341
-
1342
- /**
1343
- * Start Import Process by API URL.
1344
- *
1345
- * @param {string} apiURL Site API URL.
1346
- */
1347
- _importSite: function( apiURL ) {
1348
-
1349
- AstraSitesAdmin._log_title( 'Started Importing..' );
1350
-
1351
- // 1. Request Site Import
1352
- $.ajax({
1353
- url : astraSitesAdmin.ajaxurl,
1354
- type : 'POST',
1355
- dataType: 'json',
1356
- data : {
1357
- 'action' : 'astra-sites-import-set-site-data',
1358
- 'api_url' : apiURL,
1359
- '_ajax_nonce' : astraSitesAdmin._ajax_nonce,
1360
- },
1361
- })
1362
- .fail(function( jqXHR ){
1363
- AstraSitesAdmin._log_title( jqXHR.status + ' ' + jqXHR.responseText + ' ' + jqXHR.statusText, true );
1364
- })
1365
- .done(function ( demo_data ) {
1366
 
1367
- // 1. Fail - Request Site Import
1368
- if( false === demo_data.success ) {
1369
- AstraSitesAdmin._importFailMessage( demo_data.data );
1370
- } else {
1371
 
1372
- // Set log file URL.
1373
- if( 'log_file' in demo_data.data ){
1374
- AstraSitesAdmin.log_file_url = decodeURIComponent( demo_data.data.log_file ) || '';
1375
- }
 
 
 
1376
 
1377
- // 1. Pass - Request Site Import
1378
- AstraSitesAdmin.customizer_data = JSON.stringify( demo_data.data['astra-site-customizer-data'] ) || '';
1379
- AstraSitesAdmin.wxr_url = encodeURI( demo_data.data['astra-site-wxr-path'] ) || '';
1380
- AstraSitesAdmin.wpforms_url = encodeURI( demo_data.data['astra-site-wpforms-path'] ) || '';
1381
- AstraSitesAdmin.options_data = JSON.stringify( demo_data.data['astra-site-options-data'] ) || '';
1382
- AstraSitesAdmin.widgets_data = JSON.stringify( demo_data.data['astra-site-widgets-data'] ) || '';
1383
 
1384
- $(document).trigger( 'astra-sites-import-set-site-data-done' );
1385
- }
1386
-
1387
- });
 
 
 
1388
 
 
 
1389
  },
1390
 
1391
  /**
1392
- * Collapse Sidebar.
 
 
 
 
1393
  */
1394
- _collapse: function() {
1395
  event.preventDefault();
1396
 
1397
- overlay = jQuery('.wp-full-overlay');
1398
-
1399
- if (overlay.hasClass('expanded')) {
1400
- overlay.removeClass('expanded');
1401
- overlay.addClass('collapsed');
1402
  return;
1403
  }
1404
 
1405
- if (overlay.hasClass('collapsed')) {
1406
- overlay.removeClass('collapsed');
1407
- overlay.addClass('expanded');
1408
- return;
1409
- }
1410
- },
1411
 
1412
- /**
1413
- * Previous Theme.
1414
- */
1415
- _previousTheme: function (event) {
1416
- event.preventDefault();
1417
 
1418
- currentDemo = jQuery('.theme-preview-on');
1419
- currentDemo.removeClass('theme-preview-on');
1420
- prevDemo = currentDemo.prev('.theme');
1421
- prevDemo.addClass('theme-preview-on');
1422
 
1423
- var site_id = $(this).parents('.wp-full-overlay-header').data('demo-id') || '';
 
 
1424
 
1425
- if( AstraSitesAPI._stored_data ) {
1426
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1427
 
 
 
1428
 
1429
- if( site_data ) {
1430
- // Set current site details.
1431
- AstraSitesAdmin.current_site = site_data;
1432
- }
1433
- }
1434
 
1435
- AstraSitesAdmin._renderDemoPreview(prevDemo);
1436
- },
1437
 
1438
- /**
1439
- * Next Theme.
1440
- */
1441
- _nextTheme: function (event) {
1442
- event.preventDefault();
1443
- currentDemo = jQuery('.theme-preview-on')
1444
- currentDemo.removeClass('theme-preview-on');
1445
- nextDemo = currentDemo.next('.theme');
1446
- nextDemo.addClass('theme-preview-on');
1447
 
1448
- var site_id = $(this).parents('.wp-full-overlay-header').data('demo-id') || '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1449
 
1450
- if( AstraSitesAPI._stored_data ) {
1451
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1452
 
1453
- if( site_data ) {
1454
- // Set current site details.
1455
- AstraSitesAdmin.current_site = site_data;
1456
- }
 
 
 
 
 
1457
  }
1458
 
1459
- AstraSitesAdmin._renderDemoPreview( nextDemo );
1460
  },
1461
 
1462
- _set_current_screen: function( screen ) {
1463
- AstraSitesAdmin.current_screen = screen;
1464
- var old_screen = $('.astra-sites-preview').attr( 'screen' ) || '';
1465
-
1466
-
1467
- if( old_screen ) {
1468
- $('.astra-sites-preview').removeClass( 'screen-' + old_screen );
 
 
 
 
 
1469
  }
1470
 
1471
- $('.astra-sites-preview').attr( 'screen', screen );
1472
- $('.astra-sites-preview').addClass( 'screen-' + screen );
1473
  },
1474
 
1475
- /**
1476
- * Individual Site Preview
1477
- *
1478
- * On click on image, more link & preview button.
1479
- */
1480
- _preview: function( event ) {
1481
 
1482
- event.preventDefault();
1483
 
1484
- var site_id = $(this).parents('.site-single').data('demo-id') || '';
 
1485
 
1486
- if( AstraSitesAPI._stored_data ) {
1487
- var site_data = AstraSitesAdmin._get_site_details( site_id );
1488
 
1489
- if( site_data ) {
1490
- // Set current site details.
1491
- AstraSitesAdmin.current_site = site_data;
1492
 
1493
- // Set current screen.
1494
- AstraSitesAdmin._set_current_screen( 'get-started' );
1495
- }
1496
- }
1497
 
1498
- var self = $(this).parents('.theme');
1499
- self.addClass('theme-preview-on');
1500
 
1501
- $('html').addClass('astra-site-preview-on');
 
 
1502
 
1503
- AstraSitesAdmin._renderDemoPreview( self );
1504
- },
1505
 
1506
- _get_site_details: function( site_id ) {
1507
- var all_sites = AstraSitesAPI._stored_data['astra-sites'] || [];
 
 
1508
 
1509
- if( ! all_sites ) {
1510
- return false;
1511
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1512
 
1513
- var single_site = all_sites.filter(function (site) { return site.id == site_id });
1514
- if( ! single_site ) {
1515
- return false;
1516
- }
1517
 
1518
- if( ! $.isArray( single_site ) ) {
1519
- return false;
 
 
 
 
 
 
 
1520
  }
 
 
 
 
 
 
1521
 
1522
- return single_site[0];
 
 
 
1523
  },
1524
 
1525
  /**
1526
- * Check Next Previous Buttons.
 
 
 
 
1527
  */
1528
- _checkNextPrevButtons: function() {
1529
- currentDemo = jQuery('.theme-preview-on');
1530
- nextDemo = currentDemo.nextAll('.theme').length;
1531
- prevDemo = currentDemo.prevAll('.theme').length;
1532
 
1533
- if (nextDemo == 0) {
1534
- jQuery('.next-theme').addClass('disabled');
1535
- } else if (nextDemo != 0) {
1536
- jQuery('.next-theme').removeClass('disabled');
1537
  }
1538
 
1539
- if (prevDemo == 0) {
1540
- jQuery('.previous-theme').addClass('disabled');
1541
- } else if (prevDemo != 0) {
1542
- jQuery('.previous-theme').removeClass('disabled');
1543
- }
1544
 
1545
- return;
1546
  },
1547
 
1548
- /**
1549
- * Render Demo Preview
1550
- */
1551
- _renderDemoPreview: function(anchor) {
1552
-
1553
- var demoId = anchor.data('demo-id') || '',
1554
- apiURL = anchor.data('demo-api') || '',
1555
- demoType = anchor.data('demo-type') || '',
1556
- demoURL = anchor.data('demo-url') || '',
1557
- screenshot = anchor.data('screenshot') || '',
1558
- demo_name = anchor.data('demo-name') || '',
1559
- demo_slug = anchor.data('demo-slug') || '',
1560
- content = anchor.data('content') || '',
1561
- requiredPlugins = anchor.data('required-plugins') || '',
1562
- astraSiteOptions = anchor.find('.astra-site-options').val() || '';
1563
- astraEnabledExtensions = anchor.find('.astra-enabled-extensions').val() || '';
1564
-
1565
- var template = wp.template('astra-site-preview');
1566
-
1567
- templateData = [{
1568
- id : demoId,
1569
- astra_demo_type : demoType,
1570
- astra_demo_url : demoURL,
1571
- demo_api : apiURL,
1572
- screenshot : screenshot,
1573
- demo_name : demo_name,
1574
- slug : demo_slug,
1575
- content : content,
1576
- required_plugins : JSON.stringify(requiredPlugins),
1577
- astra_site_options : astraSiteOptions,
1578
- astra_enabled_extensions : astraEnabledExtensions,
1579
- }];
1580
-
1581
- // delete any earlier fullscreen preview before we render new one.
1582
- $('.theme-install-overlay').remove();
1583
-
1584
- $('#astra-sites-menu-page').append(template(templateData[0]));
1585
- $('.theme-install-overlay').css('display', 'block');
1586
- AstraSitesAdmin._checkNextPrevButtons();
1587
-
1588
- var desc = $('.theme-details');
1589
- var descHeight = parseInt( desc.outerHeight() );
1590
- var descBtn = $('.theme-details-read-more');
1591
-
1592
- // Check is site imported recently and set flag.
1593
- $.ajax({
1594
- url : astraSitesAdmin.ajaxurl,
1595
- type : 'POST',
1596
- data : {
1597
- action : 'astra-sites-set-reset-data',
1598
- '_ajax_nonce' : astraSitesAdmin._ajax_nonce,
1599
- },
1600
- })
1601
- .done(function ( response ) {
1602
- if( response.success ) {
1603
- AstraSitesAdmin.site_imported_data = response.data;
1604
  }
1605
- });
 
 
 
1606
 
1607
- if( $.isArray( requiredPlugins ) ) {
1608
 
1609
- if( descHeight >= 55 ) {
1610
 
1611
- // Show button.
1612
- descBtn.css( 'display', 'inline-block' );
 
1613
 
1614
- // Set height upto 3 line.
1615
- desc.css( 'height', 57 );
1616
 
1617
- // Button Click.
1618
- descBtn.click(function(event) {
 
 
1619
 
1620
- if( descBtn.hasClass('open') ) {
1621
- desc.animate({ height: 57 },
1622
- 300, function() {
1623
- descBtn.removeClass('open');
1624
- descBtn.html( astraSitesAdmin.strings.DescExpand );
1625
- });
1626
- } else {
1627
- desc.animate({ height: descHeight },
1628
- 300, function() {
1629
- descBtn.addClass('open');
1630
- descBtn.html( astraSitesAdmin.strings.DescCollapse );
1631
- });
1632
- }
1633
 
1634
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1635
  }
 
 
 
1636
 
1637
- // or
1638
- var $pluginsFilter = $( '#plugin-filter' ),
1639
- data = {
1640
- action : 'astra-required-plugins',
1641
- _ajax_nonce : astraSitesAdmin._ajax_nonce,
1642
- required_plugins : requiredPlugins
1643
- };
 
 
1644
 
1645
- // Add disabled class from import button.
1646
- $('.astra-demo-import')
1647
- .addClass('disabled not-click-able')
1648
- .removeAttr('data-import');
1649
 
1650
- $('.required-plugins').addClass('loading').html('<span class="spinner is-active"></span>');
 
1651
 
1652
- // Required Required.
1653
- $.ajax({
1654
- url : astraSitesAdmin.ajaxurl,
1655
- type : 'POST',
1656
- data : data,
1657
- })
1658
- .fail(function( jqXHR ){
1659
 
1660
- // Remove loader.
1661
- $('.required-plugins').removeClass('loading').html('');
1662
 
1663
- })
1664
- .done(function ( response ) {
1665
- required_plugins = response.data['required_plugins'];
 
 
1666
 
1667
  if( response.data['third_party_required_plugins'].length ) {
1668
- $('.astra-demo-import').removeClass('button-primary').addClass('disabled');
 
1669
 
1670
- $('.astra-sites-third-party-required-plugins-wrap').remove();
1671
- var template = wp.template('astra-sites-third-party-required-plugins');
1672
- $('.astra-sites-advanced-options-wrap').html( template( response.data['third_party_required_plugins'] ) );
1673
- } else {
1674
- // Release disabled class from import button.
1675
- $('.astra-demo-import')
1676
- .removeClass('disabled not-click-able')
1677
- .attr('data-import', 'disabled');
1678
  }
1679
 
 
 
 
 
 
 
1680
  // Remove loader.
1681
  $('.required-plugins').removeClass('loading').html('');
1682
  $('.required-plugins-list').html('');
1683
 
 
 
1684
  /**
1685
  * Count remaining plugins.
1686
  * @type number
1687
  */
1688
  var remaining_plugins = 0;
 
 
1689
 
1690
  /**
1691
  * Not Installed
@@ -1698,7 +3259,7 @@ var AstraSitesAjaxQueue = (function() {
1698
  remaining_plugins += parseInt( required_plugins.notinstalled.length );
1699
 
1700
  $( required_plugins.notinstalled ).each(function( index, plugin ) {
1701
- $('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
1702
  });
1703
  }
1704
 
@@ -1713,37 +3274,290 @@ var AstraSitesAjaxQueue = (function() {
1713
  remaining_plugins += parseInt( required_plugins.inactive.length );
1714
 
1715
  $( required_plugins.inactive ).each(function( index, plugin ) {
1716
- $('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
1717
  });
1718
  }
1719
 
1720
- /**
1721
- * Active
1722
- *
1723
- * List of not active required plugins.
1724
- */
1725
- if ( typeof required_plugins.active !== 'undefined' ) {
1726
-
1727
- $( required_plugins.active ).each(function( index, plugin ) {
1728
- $('.required-plugins-list').append('<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>');
1729
- });
1730
  }
1731
 
 
1732
  /**
1733
  * Enable Demo Import Button
1734
  * @type number
1735
  */
1736
- astraSitesAdmin.requiredPlugins = required_plugins;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1737
  });
1738
 
1739
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1740
 
1741
- // Enable Demo Import Button
1742
- AstraSitesAdmin._enable_demo_import_button( demoType );
1743
- $('.astra-sites-advanced-options-wrap').remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1744
  }
1745
 
1746
- return;
 
 
 
 
 
 
 
 
 
 
 
1747
  },
1748
 
1749
  /**
@@ -1759,23 +3573,14 @@ var AstraSitesAjaxQueue = (function() {
1759
 
1760
  case 'free':
1761
 
1762
- var notinstalled = astraSitesAdmin.requiredPlugins.notinstalled || 0;
1763
- var inactive = astraSitesAdmin.requiredPlugins.inactive || 0;
 
 
 
1764
 
1765
  if( notinstalled.length === inactive.length ) {
1766
-
1767
- // XML reader not available notice.
1768
- if( astraSitesAdmin.XMLReaderDisabled ) {
1769
- if( ! $('.install-theme-info .astra-sites-xml-notice').length ) {
1770
- $('.install-theme-info').prepend( astraSitesAdmin.strings.warningXMLReader );
1771
- }
1772
- $('.astra-demo-import')
1773
- .removeClass('installing updating-message')
1774
- .addClass('disabled')
1775
- .text( astraSitesAdmin.strings.importDemo );
1776
- } else {
1777
- $(document).trigger( 'astra-sites-install-and-activate-required-plugins-done' );
1778
- }
1779
  }
1780
  break;
1781
 
@@ -1786,8 +3591,8 @@ var AstraSitesAjaxQueue = (function() {
1786
  .addClass('go-pro button-primary')
1787
  .removeClass('astra-demo-import')
1788
  .attr('target', '_blank')
1789
- .attr('href', astraSitesAdmin.getUpgradeURL + demo_slug )
1790
- .text( astraSitesAdmin.getUpgradeText )
1791
  .append('<i class="dashicons dashicons-external"></i>');
1792
  break;
1793
 
@@ -1798,14 +3603,14 @@ var AstraSitesAjaxQueue = (function() {
1798
  .addClass('go-pro button-primary')
1799
  .removeClass('astra-demo-import')
1800
  .attr('target', '_blank')
1801
- .attr('href', astraSitesAdmin.getProURL )
1802
- .text( astraSitesAdmin.getProText )
1803
  .append('<i class="dashicons dashicons-external"></i>');
1804
 
1805
  $('.wp-full-overlay-header').find('.go-pro').remove();
1806
 
1807
- if( false == astraSitesAdmin.isWhiteLabeled ) {
1808
- if( astraSitesAdmin.isPro ) {
1809
  $('.install-theme-info .theme-details').prepend( wp.template('astra-sites-pro-inactive-site-description') );
1810
  } else {
1811
  $('.install-theme-info .theme-details').prepend( wp.template('astra-sites-pro-site-description') );
@@ -1820,26 +3625,6 @@ var AstraSitesAjaxQueue = (function() {
1820
  /**
1821
  * Update Page Count.
1822
  */
1823
- _updatedPagedCount: function() {
1824
- paged = parseInt(jQuery('body').attr('data-astra-demo-paged'));
1825
- jQuery('body').attr('data-astra-demo-paged', paged + 1);
1826
- window.setTimeout(function () {
1827
- jQuery('body').data('scrolling', false);
1828
- }, 800);
1829
- },
1830
-
1831
- /**
1832
- * Reset Page Count.
1833
- */
1834
- _resetPagedCount: function() {
1835
-
1836
- $('body').addClass('loading-content');
1837
- $('body').attr('data-astra-demo-last-request', '1');
1838
- $('body').attr('data-astra-demo-paged', '1');
1839
- $('body').attr('data-astra-demo-search', '');
1840
- $('body').attr('data-scrolling', false);
1841
-
1842
- },
1843
 
1844
  /**
1845
  * Remove plugin from the queue.
@@ -1859,4 +3644,4 @@ var AstraSitesAjaxQueue = (function() {
1859
  AstraSitesAdmin.init();
1860
  });
1861
 
1862
- })(jQuery);
29
  * @since 1.0.0
30
  */
31
  remove: function(opt) {
32
+ if( jQuery.inArray(opt, requests) > -1 ) {
33
+ requests.splice($.inArray(opt, requests), 1);
34
+ }
35
  },
36
 
37
  /**
43
  var self = this,
44
  oriSuc;
45
 
46
+
47
  if( requests.length ) {
48
  oriSuc = requests[0].complete;
49
 
54
  };
55
 
56
  jQuery.ajax(requests[0]);
 
57
  } else {
58
+ self.tid = setTimeout(function() {
59
+ self.run.apply(self, []);
60
+ }, 1000);
 
61
  }
62
+
63
  },
64
 
65
  /**
68
  * @since 1.0.0
69
  */
70
  stop: function() {
 
71
  requests = [];
72
  clearTimeout(this.tid);
73
+ },
74
+
75
+ /**
76
+ * Debugging.
77
+ *
78
+ * @param {mixed} data Mixed data.
79
+ */
80
+ _log: function( data, level ) {
81
+ var date = new Date();
82
+ var time = date.toLocaleTimeString();
83
+
84
+ var color = '#444';
85
+
86
+ if (typeof data == 'object') {
87
+ console.log( data );
88
+ } else {
89
+ console.log( data + ' ' + time );
90
+ }
91
+ },
92
  };
93
 
94
  }());
95
 
96
  (function($){
97
 
98
+ /** Checking the element is in viewport? */
99
+ $.fn.isInViewport = function() {
100
+
101
+ // If not have the element then return false!
102
+ if( ! $( this ).length ) {
103
+ return false;
104
+ }
105
+
106
+ var elementTop = $( this ).offset().top;
107
+ var elementBottom = elementTop + $( this ).outerHeight();
108
+
109
+ var viewportTop = $( window ).scrollTop();
110
+ var viewportBottom = viewportTop + $( window ).height();
111
+
112
+ return elementBottom > viewportTop && elementTop < viewportBottom;
113
+ };
114
+
115
  var AstraSSEImport = {
116
  complete: {
117
  posts: 0,
137
  if ( 0 === total || isNaN( total ) ) {
138
  total = 1;
139
  }
140
+
141
+ var percent = parseInt( complete, 10 ) / total;
142
  var progress = Math.round( percent * 100 ) + '%';
143
  var progress_bar = percent * 100;
144
 
147
  for ( var i = 0; i < process_bars.length; i++ ) {
148
  process_bars[i].value = progress_bar;
149
  }
150
+ AstraSitesAdmin._log_title( 'Importing Content.. ' + progress, false, false );
151
  }
152
  }
153
  },
170
 
171
  AstraSitesAdmin = {
172
 
173
+ remaining_activate_plugins: [],
174
+ required_plugins_original_list: [],
175
+
176
+ compatibilities: [],
177
+
178
+ skip_and_import_popups: [],
179
+ required_plugins: [],
180
+
181
+ _ref : null,
182
+
183
+ /**
184
+ * _api_params = {
185
+ * 'search' : '',
186
+ * 'per_page' : '',
187
+ * 'astra-site-category' : '',
188
+ * 'astra-site-page-builder' : '',
189
+ * 'page' : '',
190
+ * };
191
+ *
192
+ * E.g. per_page=<page-id>&astra-site-category=<category-ids>&astra-site-page-builder=<page-builder-ids>&page=<page>
193
+ */
194
+ _api_params : {},
195
+ _breakpoint : 768,
196
+ _has_default_page_builder : false,
197
+ _first_time_loaded : true,
198
+
199
+ visited_sites_and_pages: [],
200
+
201
  reset_remaining_posts: 0,
202
  reset_remaining_wp_forms: 0,
203
  reset_remaining_terms: 0,
207
  site_imported_data: null,
208
 
209
  backup_taken: false,
210
+ filter_array: [],
211
+ autocompleteTags: [],
 
 
212
  templateData: {},
213
+ mouseLocation : false,
214
  log_file : '',
215
  customizer_data : '',
216
  wxr_url : '',
217
  wpforms_url : '',
218
+ cartflows_url : '',
219
  options_data : '',
220
  widgets_data : '',
221
+ enabled_extensions : '',
222
+ action_slug : '',
223
  import_start_time : '',
224
  import_end_time : '',
225
+ search_terms : [],
226
+ page_settings_flag : true,
227
 
228
  init: function()
229
  {
230
+ this._show_default_page_builder_sites();
231
  this._bind();
232
+ this._addAutocomplete();
233
+ this._autocomplete();
234
+ this._load_large_images();
235
  },
236
 
237
  /**
238
+ * load large image
239
  *
240
+ * @return {[type]} [description]
241
  */
242
+ _load_large_image: function( el ) {
243
+ if( el.hasClass('loaded') ) {
244
+ return;
245
+ }
246
 
247
+ if( el.parents('.astra-theme').isInViewport() ) {
248
+ var large_img_url = el.data('src') || '';
249
+ var imgLarge = new Image();
250
+ imgLarge.src = large_img_url;
251
+ imgLarge.onload = function () {
252
+ el.removeClass('loading');
253
+ el.addClass('loaded');
254
+ el.css('background-image', 'url(\''+imgLarge.src+'\'' );
255
+ };
256
+ }
257
+ },
258
 
259
+ _load_large_images: function() {
260
+ $('.theme-screenshot').each(function( key, el) {
261
+ AstraSitesAdmin._load_large_image( $(el) );
262
+ });
263
+ },
264
+
265
+ _addAutocomplete: function() {
266
+
267
+ var tags = astraSitesVars.api_sites_and_pages_tags || [];
268
+ var sites = astraSitesVars.default_page_builder_sites || [];
269
+ var strings = [];
270
+
271
+ for( tag_index in tags ) {
272
+ strings.push( AstraSitesAdmin._unescape_lower( tags[ tag_index ]['name'] ) );
273
+ }
274
+
275
+ // Add site title's in autocomplete.
276
+ for( site_id in sites ) {
277
+
278
+ if( astraSitesVars.default_page_builder === sites[ site_id ]['astra-site-page-builder'] ) {
279
+ var title = AstraSitesAdmin._unescape( sites[ site_id ]['title'] );
280
+
281
+ // @todo check why below character not escape with function _.unescape();
282
+ title = title.toLowerCase().replace('&#8211;', '-' );
283
+
284
+ strings.push( title );
285
  }
286
+ }
287
+
288
+ AstraSitesAdmin.autocompleteTags = strings;
289
+ },
290
+
291
+ _autocomplete: function() {
292
+
293
+ var strings = AstraSitesAdmin.autocompleteTags;
294
+ strings = _.uniq( strings );
295
+ strings = _.sortBy( strings );
296
+
297
+ $( "#wp-filter-search-input" ).autocomplete({
298
+ appendTo: ".astra-sites-autocomplete-result",
299
+ classes: {
300
+ "ui-autocomplete": "astra-sites-auto-suggest"
301
+ },
302
+ source: function(request, response) {
303
+ var results = $.ui.autocomplete.filter(strings, request.term);
304
+
305
+ // Show only 10 results.
306
+ response(results.slice(0, 15));
307
+ },
308
+ open: function( event, ui ) {
309
+ $('.search-form').addClass( 'searching' );
310
+ },
311
+ close: function( event, ui ) {
312
+ $('.search-form').removeClass( 'searching' );
313
+ }
314
+ });
315
+
316
+ $( "#wp-filter-search-input" ).focus();
317
+ },
318
+
319
+ /**
320
+ * Debugging.
321
+ *
322
+ * @param {mixed} data Mixed data.
323
+ */
324
+ _log: function( data, level ) {
325
+ var date = new Date();
326
+ var time = date.toLocaleTimeString();
327
 
328
+ var color = '#444';
329
 
330
+ switch( level ) {
331
+ case 'emergency': // color = '#f44336';
332
+ case 'critical': // color = '#f44336';
333
+ case 'alert': // color = '#f44336';
334
+ case 'error': // color = '#f44336';
335
+ if (typeof data == 'object') {
336
+ console.error( data );
337
+ } else {
338
+ console.error( data + ' ' + time );
339
+ }
340
+ break;
341
+ case 'warning': // color = '#ffc107';
342
+ case 'notice': // color = '#ffc107';
343
+ if (typeof data == 'object') {
344
+ console.warn( data );
345
+ } else {
346
+ console.warn( data + ' ' + time );
347
+ }
348
+ break;
349
+ default:
350
+ if (typeof data == 'object') {
351
+ console.log( data );
352
+ } else {
353
+ console.log( data + ' ' + time );
354
+ }
355
+ break;
356
+ // case 'info': color = '#03a9f4';
357
+ // break;
358
+ // case 'debug': color = '#ffc107';
359
  }
360
  },
361
 
362
  _log_title: function( data, append ) {
363
 
364
+ var markup = '<p>' + data + '</p>';
365
  if (typeof data == 'object' ) {
366
  var markup = '<p>' + JSON.stringify( data ) + '</p>';
367
  }
368
 
369
+ var selector = $('.ast-importing-wrap');
370
+ if( $('.current-importing-status-title').length ) {
371
+ selector = $('.current-importing-status-title');
372
+ }
373
+
374
  if ( append ) {
375
+ selector.append( markup );
376
  } else {
377
+ selector.html( markup );
378
  }
379
+
380
  },
381
 
382
  /**
388
  */
389
  _bind: function()
390
  {
391
+ $( window ).on( 'resize scroll' , AstraSitesAdmin._load_large_images);
392
+
393
+ $( '.astra-sites__category-filter-anchor, .astra-sites__category-filter-items' ).hover(function(){
394
+ AstraSitesAdmin.mouseLocation = true;
395
+ }, function(){
396
+ AstraSitesAdmin.mouseLocation = false;
397
+ });
398
+
399
+ $( "body" ).mouseup(function(){
400
+ if( ! AstraSitesAdmin.mouseLocation ) AstraSitesAdmin._closeFilter();
401
+ });
402
+
403
+ // Change page builder.
404
+ $( document ).on( 'click' , '.nav-tab-wrapper .page-builders li', AstraSitesAdmin._ajax_change_page_builder);
405
+ $( document ).on( 'click' , '#astra-sites-welcome-form .page-builders li', AstraSitesAdmin._change_page_builder);
406
+
407
+ // Open & Close Popup.
408
+ $( document ).on( 'click' , '.site-import-cancel, .astra-sites-result-preview .close, .astra-sites-popup .close', AstraSitesAdmin._close_popup );
409
+ $( document ).on( 'click' , '.astra-sites-popup .overlay, .astra-sites-result-preview .overlay', AstraSitesAdmin._close_popup_by_overlay );
410
+
411
+ $( document ).on( 'click', '.ast-sites__filter-wrap-checkbox, .ast-sites__filter-wrap', AstraSitesAdmin._filterClick );
412
+
413
+ // Page.
414
+ $( document ).on( 'click', '.site-import-layout-button', AstraSitesAdmin.show_page_popup_from_sites);
415
+ $( document ).on('click', '#astra-sites .astra-sites-previewing-page .theme-screenshot, #astra-sites .astra-sites-previewing-page .theme-name', AstraSitesAdmin.show_page_popup_from_search );
416
+ $( document ).on( 'click', '.astra-sites-page-import-popup .site-install-site-button, .preview-page-from-search-result .site-install-site-button', AstraSitesAdmin.import_page_process);
417
+ $( document ).on( 'astra-sites-after-site-pages-required-plugins' , AstraSitesAdmin._page_api_call );
418
+
419
+ // Site reset warning.
420
+ $( document ).on( 'click' , '.astra-sites-reset-data .checkbox', AstraSitesAdmin._toggle_reset_notice );
421
+
422
+ // Theme Activation warning.
423
+ $( document ).on( 'click' , '.astra-sites-theme-activation .checkbox', AstraSitesAdmin._toggle_theme_notice );
424
+
425
+ $( document ).on( 'wp-theme-install-success' , AstraSitesAdmin._activateTheme );
426
 
427
+ // Site.
428
+ $( document ).on( 'click' , '.site-import-site-button', AstraSitesAdmin._show_site_popup);
429
+ $( document ).on( 'click' , '.astra-sites-get-agency-bundle-button', AstraSitesAdmin._show_get_agency_bundle_notice);
430
+ $( document ).on( 'click' , '.astra-sites-activate-license-button', AstraSitesAdmin._show_activate_license_notice);
431
+ $( document ).on( 'click' , '.astra-sites-invalid-mini-agency-license-button', AstraSitesAdmin._show_invalid_mini_agency_license);
432
+ $( document ).on( 'click', '.astra-sites-site-import-popup .site-install-site-button', AstraSitesAdmin._resetData);
433
 
434
+ // Skip.
435
+ $( document ).on( 'click', '.astra-sites-skip-and-import-step', AstraSitesAdmin._remove_skip_and_import_popup);
436
+
437
+ // Skip & Import.
438
+ $( document ).on( 'astra-sites-after-astra-sites-required-plugins' , AstraSitesAdmin._start_site_import );
 
439
 
 
440
  $( document ).on( 'astra-sites-reset-data' , AstraSitesAdmin._backup_before_rest_options );
441
  $( document ).on( 'astra-sites-backup-settings-before-reset-done' , AstraSitesAdmin._reset_customizer_data );
442
  $( document ).on( 'astra-sites-reset-customizer-data-done' , AstraSitesAdmin._reset_site_options );
445
  $( document ).on( 'astra-sites-delete-terms-done' , AstraSitesAdmin._reset_wp_forms );
446
  $( document ).on( 'astra-sites-delete-wp-forms-done' , AstraSitesAdmin._reset_posts );
447
 
448
+ $( document ).on( 'astra-sites-reset-data-done' , AstraSitesAdmin._recheck_backup_options );
449
+ $( document ).on( 'astra-sites-backup-settings-done' , AstraSitesAdmin._startImportCartFlows );
450
+ $( document ).on( 'astra-sites-import-cartflows-done' , AstraSitesAdmin._startImportWPForms );
451
+ $( document ).on( 'astra-sites-import-wpforms-done' , AstraSitesAdmin._importCustomizerSettings );
452
+ $( document ).on( 'astra-sites-import-customizer-settings-done' , AstraSitesAdmin._importXML );
453
+ $( document ).on( 'astra-sites-import-xml-done' , AstraSitesAdmin.import_siteOptions );
454
+ $( document ).on( 'astra-sites-import-options-done' , AstraSitesAdmin._importWidgets );
455
+ $( document ).on( 'astra-sites-import-widgets-done' , AstraSitesAdmin._importEnd );
456
 
457
+ $( document ).on( 'click', '.astra-sites__category-filter-anchor', AstraSitesAdmin._toggleFilter );
458
 
459
+ // Tooltip.
460
+ $( document ).on( 'click' , '.astra-sites-tooltip-icon', AstraSitesAdmin._toggle_tooltip);
 
461
 
462
+ // Plugin install & activate.
463
+ $( document ).on( 'wp-plugin-installing' , AstraSitesAdmin._pluginInstalling);
464
+ $( document ).on( 'wp-plugin-install-error' , AstraSitesAdmin._installError);
465
+ $( document ).on( 'wp-plugin-install-success' , AstraSitesAdmin._installSuccess);
466
+
467
+ $( document ).on('click', '#astra-sites .astra-sites-previewing-site .theme-screenshot, #astra-sites .astra-sites-previewing-site .theme-name', AstraSitesAdmin._show_pages );
468
+ $( document ).on('click' , '#single-pages .site-single', AstraSitesAdmin._change_site_preview_screenshot);
469
+ $( document ).on('click' , '.astra-sites-show-favorite-button', AstraSitesAdmin._show_favorite);
470
+
471
+ $( document ).on('click' , '.favorite-action-wrap', AstraSitesAdmin._toggle_favorite);
472
+ $( document ).on('click', '.astra-previewing-single-pages .back-to-layout', AstraSitesAdmin._go_back );
473
+ $( document ).on('click', '.astra-sites-showing-favorites .back-to-layout, .astra-sites-no-search-result .back-to-layout, .logo, .astra-sites-back', AstraSitesAdmin._show_sites );
474
+
475
+ $( document ).on('keydown', AstraSitesAdmin._next_and_previous_sites );
476
 
477
+ $( document ).on('click', '.astra-site-category a', AstraSitesAdmin._filterSites );
478
+
479
+ $( document ).on('click', '.astra-sites-sync-library-button', AstraSitesAdmin._sync_library );
480
+ $( document ).on('click', '.astra-sites-sync-library-message.success .notice-dismiss', AstraSitesAdmin._sync_library_complete );
481
+ $( document ).on('click', '.page-builder-icon', AstraSitesAdmin._toggle_page_builder_list );
482
+ $( document ).on('click', '.showing-page-builders #wpbody-content', AstraSitesAdmin._close_page_builder_list );
483
+ $( document ).on('keyup input' , '#wp-filter-search-input', AstraSitesAdmin._search );
484
+ $( document ).on( 'keyup' , '#wp-filter-search-input', _.debounce(AstraSitesAdmin._searchPost, 1000 ) );
485
+ $( document ).on( 'heartbeat-send', AstraSitesAdmin._sendHeartbeat );
486
+ $( document ).on( 'heartbeat-tick', AstraSitesAdmin._heartbeatDone );
487
+ $( document ).on('click' , '.ui-autocomplete .ui-menu-item', AstraSitesAdmin._show_search_term );
488
  },
489
 
490
+ _heartbeatDone: function( e, data ) {
491
+ // Check for our data, and use it.
492
+ if ( ! data['ast-sites-search-terms'] ) {
493
+ return;
494
+ }
495
+ AstraSitesAdmin.search_terms = [];
496
  },
497
 
498
+ _sendHeartbeat: function( e, data ) {
499
+ // Add additional data to Heartbeat data.
500
+ if ( AstraSitesAdmin.search_terms.length > 0 ) {
501
+ data['ast-sites-search-terms'] = AstraSitesAdmin.search_terms;
 
502
  }
503
  },
504
 
505
+ _searchPost: function( e ) {
506
+ var term = $( this ).val();
507
+ if ( '' === term ) {
508
+ return;
509
+ }
510
+
511
+ if ( ! AstraSitesAdmin.search_terms.includes( term ) ) {
512
+ AstraSitesAdmin.search_terms.push( term.toLowerCase() );
513
+ }
514
  },
515
 
516
+ _toggleFilter: function( e ) {
 
517
 
518
+ var items = $( '.astra-sites__category-filter-items' );
519
+
520
+ if ( items.hasClass( 'visible' ) ) {
521
+ items.removeClass( 'visible' );
522
+ items.hide();
523
  } else {
524
+ items.addClass( 'visible' );
525
+ items.show();
526
  }
527
  },
528
 
529
+ _closeFilter: function( e ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
 
531
+ var items = $( '.astra-sites__category-filter-items' );
532
+ items.removeClass( 'visible' );
533
+ items.hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  },
535
 
536
+ _filterClick: function( e ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
 
538
+ AstraSitesAdmin.filter_array = [];
 
539
 
540
+ if ( $( this ).hasClass( 'ast-sites__filter-wrap' ) ) {
541
+ $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug', $( this ).data( 'slug' ) );
542
+ $( '.astra-sites__category-filter-items' ).find( '.ast-sites__filter-wrap' ).removeClass( 'category-active' );
543
+ $( this ).addClass( 'category-active' );
544
+ $( '.astra-sites__category-filter-anchor' ).text( $( this ).text() );
545
+ $( '.astra-sites__category-filter-anchor' ).trigger( 'click' );
546
+ $( '#wp-filter-search-input' ).val( '' );
547
 
548
+ if( $( '.astra-sites-show-favorite-button' ).hasClass( 'active' ) ) {
549
+ $( '.astra-sites-show-favorite-button' ).removeClass( 'active' );
550
+ $( 'body' ).removeClass( 'astra-sites-showing-favorites' );
551
+ AstraSitesAdmin._clean_url_params( 'favorites' );
552
+ }
553
+ }
554
 
555
+ var $filter_name = $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug' );
556
 
557
+ if ( '' != $filter_name ) {
558
+ AstraSitesAdmin.filter_array.push( $filter_name );
559
+ }
 
 
 
 
 
 
560
 
561
+ if( $( '.ast-sites__filter-wrap-checkbox input[name=ast-sites-radio]:checked' ).length ) {
562
+ $( '.ast-sites__filter-wrap-checkbox input[name=ast-sites-radio]' ).removeClass('active');
563
+ $( '.ast-sites__filter-wrap-checkbox input[name=ast-sites-radio]:checked' ).addClass('active');
564
+ }
565
+ var $filter_type = $( '.ast-sites__filter-wrap-checkbox input[name=ast-sites-radio]:checked' ).val();
566
 
567
+ if ( '' != $filter_type ) {
568
+ AstraSitesAdmin.filter_array.push( $filter_type );
569
+ }
570
 
571
+ AstraSitesAdmin._closeFilter();
572
+ $( '#wp-filter-search-input' ).trigger( 'keyup' );
573
+ },
 
 
 
 
 
 
574
 
575
+ _show_search_term: function() {
576
+ var search_term = $(this).text() || '';
577
+ $('#wp-filter-search-input').val( search_term );
578
+ $('#wp-filter-search-input').trigger( 'keyup' );
579
  },
580
 
581
+ _search: function(event) {
582
 
583
+ var search_input = $( this ),
584
+ search_term = $.trim( search_input.val() ) || '';
585
 
586
+ if( 13 === event.keyCode ) {
587
+ $('.astra-sites-autocomplete-result .ui-autocomplete').hide();
588
+ $('.search-form').removeClass('searching');
589
+ $('#astra-sites-admin').removeClass('searching');
590
+ }
 
 
 
 
 
 
591
 
592
+ $('body').removeClass('astra-sites-no-search-result');
 
 
593
 
594
+ var sites = $('#astra-sites .astra-theme'),
595
+ titles = $('#astra-sites .astra-theme .theme-name'),
596
+ searchTemplateFlag = false,
597
+ items = [];
598
 
599
+ AstraSitesAdmin.close_pages_popup();
 
 
 
 
 
 
 
600
 
601
+ if( search_term.length ) {
602
+ search_input.addClass('has-input');
603
+ $('#astra-sites-admin').addClass('searching');
604
+ searchTemplateFlag = true;
605
  } else {
606
+ search_input.removeClass('has-input');
607
+ $('#astra-sites-admin').removeClass('searching');
608
+ }
609
+
610
+ items = AstraSitesAdmin._get_sites_and_pages_by_search_term( search_term );
611
+
612
+ if( ! AstraSitesAdmin.isEmpty( items ) ) {
613
+ if ( searchTemplateFlag ) {
614
+ AstraSitesAdmin.add_sites_after_search( items );
615
+ } else {
616
+ AstraSitesAdmin.add_sites( items );
617
+ }
618
+ } else {
619
+ if( search_term.length ) {
620
+ $('body').addClass('astra-sites-no-search-result');
621
+ }
622
+ $('#astra-sites').html( wp.template('astra-sites-no-sites') );
623
  }
624
  },
625
 
626
+ /**
627
+ * Change URL
628
+ */
629
+ _changeAndSetURL: function( url_params ) {
630
+ var current_url = window.location.href;
631
+ var current_url_separator = ( window.location.href.indexOf( "?" ) === -1 ) ? "?" : "&";
632
+ var new_url = current_url + current_url_separator + decodeURIComponent( $.param( url_params ) );
633
+ AstraSitesAdmin._changeURL( new_url );
634
+ },
635
 
636
+ /**
637
+ * Clean the URL.
638
+ *
639
+ * @param string url URL string.
640
+ * @return string Change the current URL.
641
+ */
642
+ _changeURL: function( url )
643
+ {
644
+ History.pushState(null, astraSitesVars.whiteLabelName, url);
645
+ },
646
 
647
+ /**
648
+ * Get URL param.
649
+ */
650
+ _getParamFromURL: function(name, url)
651
+ {
652
+ if (!url) url = window.location.href;
653
+ name = name.replace(/[\[\]]/g, "\\$&");
654
+ var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
655
+ results = regex.exec(url);
656
+ if (!results) return null;
657
+ if (!results[2]) return '';
658
+ return decodeURIComponent(results[2].replace(/\+/g, " "));
659
+ },
660
 
661
+ _clean_url_params: function( single_param )
662
+ {
663
+ var url_params = AstraSitesAdmin._getQueryStrings();
664
+ delete url_params[ single_param ];
665
+ delete url_params['']; // Removed extra empty object.
666
+
667
+ var current_url = window.location.href;
668
+ var root_url = current_url.substr(0, current_url.indexOf('?'));
669
+ if( $.isEmptyObject( url_params ) ) {
670
+ var new_url = root_url + decodeURIComponent( $.param( url_params ) );
671
+ } else {
672
+ var current_url_separator = ( root_url.indexOf( "?" ) === -1 ) ? "?" : "&";
673
+ var new_url = root_url + current_url_separator + decodeURIComponent( $.param( url_params ) );
674
+ }
675
+
676
+ AstraSitesAdmin._changeURL( new_url );
677
+ },
678
+
679
+ /**
680
+ * Get query strings.
681
+ *
682
+ * @param string string Query string.
683
+ * @return string Check and return query string.
684
+ */
685
+ _getQueryStrings: function( string )
686
+ {
687
+ return ( string || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0];
688
+ },
689
+
690
+ isEmpty: function(obj) {
691
+ for(var key in obj) {
692
+ if(obj.hasOwnProperty(key))
693
+ return false;
694
+ }
695
+ return true;
696
+ },
697
+
698
+ _unescape: function( input_string ) {
699
+ var title = _.unescape( input_string );
700
+
701
+ // @todo check why below character not escape with function _.unescape();
702
+ title = title.replace('&#8211;', '-' );
703
+ title = title.replace('&#8217;', "'" );
704
+
705
+ return title;
706
+ },
707
+
708
+ _unescape_lower: function( input_string ) {
709
+ var input_string = AstraSitesAdmin._unescape( input_string );
710
+ return input_string.toLowerCase();
711
+ },
712
+
713
+ _get_sites_and_pages_by_search_term: function( search_term ) {
714
+
715
+ var items = [],
716
+ tags_strings = [];
717
+ search_term = search_term.toLowerCase();
718
+
719
+ if ( search_term == '' && AstraSitesAdmin.filter_array.length == 0 ) {
720
+ return astraSitesVars.default_page_builder_sites;
721
+ }
722
+
723
+ var $filter_type = $( '.ast-sites__filter-wrap-checkbox input[name=ast-sites-radio]:checked' ).val();
724
+ var $filter_name = $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug' );
725
+
726
+ for( site_id in astraSitesVars.default_page_builder_sites ) {
727
+
728
+ var current_site = astraSitesVars.default_page_builder_sites[site_id];
729
+ var text_match = true;
730
+ var free_match = true;
731
+ var category_match = true;
732
+ var match_id = '';
733
+
734
+ if ( '' != search_term ) {
735
+ text_match = false;
736
+ }
737
+
738
+ if ( '' != $filter_name ) {
739
+ category_match = false;
740
+ }
741
+
742
+ if ( '' != $filter_type ) {
743
+ free_match = false;
744
+ }
745
+
746
+ // Check in site title.
747
+ if( current_site['title'] ) {
748
+ var site_title = AstraSitesAdmin._unescape_lower( current_site['title'] );
749
+
750
+ if( site_title.toLowerCase().includes( search_term ) ) {
751
+ text_match = true;
752
+ match_id = site_id;
753
+ }
754
+ }
755
+
756
+ // Check in site tags.
757
+ if( Object.keys( current_site['astra-sites-tag'] ).length ) {
758
+ for( site_tag_id in current_site['astra-sites-tag'] ) {
759
+ var tag_title = current_site['astra-sites-tag'][site_tag_id];
760
+ tag_title = AstraSitesAdmin._unescape_lower( tag_title.replace('-', ' ') );
761
+ if( tag_title.toLowerCase().includes( search_term ) ) {
762
+ text_match = true;
763
+ match_id = site_id;
764
+ }
765
+ }
766
+ }
767
+
768
+ for( filter_id in AstraSitesAdmin.filter_array ) {
769
+ var slug = AstraSitesAdmin.filter_array[filter_id];
770
+ if( slug == 'free' && 'free' == current_site['astra-sites-type'] ) {
771
+ free_match = true;
772
+ match_id = site_id;
773
+ }
774
+ if( slug == 'agency' && 'free' != current_site['astra-sites-type'] ) {
775
+ free_match = true;
776
+ match_id = site_id;
777
+ }
778
+ if ( slug != 'free' && slug != 'agency' && undefined != slug ) {
779
+ for( cat_id in current_site['astra-site-category'] ) {
780
+ if( slug.toLowerCase() == current_site['astra-site-category'][cat_id] ) {
781
+ category_match = true;
782
+ match_id = site_id;
783
+ }
784
+ }
785
+ }
786
+ }
787
+
788
+ if ( '' != match_id ) {
789
+ if ( text_match && category_match && free_match ) {
790
+ items[site_id] = current_site;
791
+ items[site_id]['type'] = 'site';
792
+ items[site_id]['site_id'] = site_id;
793
+ items[site_id]['pages-count'] = ( undefined != current_site['pages'] ) ? Object.keys( current_site['pages'] ).length : 0;
794
+ tags_strings.push( AstraSitesAdmin._unescape_lower( current_site['title'] ));
795
+
796
+ for( site_tag_id in current_site['astra-sites-tag'] ) {
797
+ var tag_title = current_site['astra-sites-tag'][site_tag_id];
798
+ tag_title = AstraSitesAdmin._unescape_lower( tag_title.replace('-', ' ') );
799
+ if( tag_title.toLowerCase().includes( search_term ) ) {
800
+ tags_strings.push( AstraSitesAdmin._unescape_lower( tag_title ));
801
+ }
802
+ }
803
+ }
804
+ }
805
+
806
+ if ( search_term != '' ) {
807
+
808
+ // Check in page title.
809
+ if( Object.keys( current_site['pages'] ).length ) {
810
+
811
+ var pages = current_site['pages'];
812
+
813
+ for( page_id in pages ) {
814
+
815
+ var page_text_match = false;
816
+ var page_free_match = true;
817
+ var page_category_match = true;
818
+ var page_match_id = '';
819
+
820
+ if ( '' != $filter_name ) {
821
+ page_category_match = false;
822
+ }
823
+
824
+ if ( '' != $filter_type ) {
825
+ page_free_match = false;
826
+ }
827
+ // Check in site title.
828
+ if( pages[page_id]['title'] ) {
829
+ var page_title = AstraSitesAdmin._unescape_lower( pages[page_id]['title'] );
830
+
831
+ if( page_title.includes( search_term ) ) {
832
+ page_text_match = true;
833
+ page_match_id = page_id;
834
+ }
835
+ }
836
+
837
+ // Check in site tags.
838
+ if( Object.keys( pages[page_id]['astra-sites-tag'] ).length ) {
839
+ for( page_tag_id in pages[page_id]['astra-sites-tag'] ) {
840
+ var tag_title = pages[page_id]['astra-sites-tag'][page_tag_id];
841
+ tag_title = AstraSitesAdmin._unescape_lower( tag_title.replace('-', ' ') );
842
+ if( tag_title.toLowerCase().includes( search_term ) ) {
843
+ page_text_match = true;
844
+ page_match_id = page_id;
845
+ }
846
+ }
847
+ }
848
+
849
+ for( filter_id in AstraSitesAdmin.filter_array ) {
850
+ var pslug = AstraSitesAdmin.filter_array[filter_id];
851
+ if( pslug == 'free' && 'free' == pages[page_id]['astra-sites-type'] ) {
852
+ page_free_match = true;
853
+ page_match_id = page_id;
854
+ }
855
+ if( pslug == 'agency' && 'free' != pages[page_id]['astra-sites-type'] ) {
856
+ page_free_match = true;
857
+ page_match_id = page_id;
858
+ }
859
+ if ( pslug != 'free' && pslug != 'agency' && undefined != pslug ) {
860
+ for( cat_id in current_site['astra-site-category'] ) {
861
+ if( pslug.toLowerCase() == current_site['astra-site-category'][cat_id] ) {
862
+ page_category_match = true;
863
+ page_match_id = page_id;
864
+ }
865
+ }
866
+ }
867
+ }
868
+
869
+ if ( '' != page_match_id ) {
870
+ if ( page_text_match && page_category_match && page_free_match ) {
871
+ items[page_id] = pages[page_id];
872
+ items[page_id]['type'] = 'page';
873
+ items[page_id]['site_id'] = site_id;
874
+ items[page_id]['astra-sites-type'] = current_site['astra-sites-type'] || '';
875
+ items[page_id]['site-title'] = current_site['title'] || '';
876
+ items[page_id]['pages-count'] = 0;
877
+
878
+ tags_strings.push( AstraSitesAdmin._unescape_lower( current_site['title'] ));
879
+
880
+ for( site_tag_id in pages[page_id]['astra-sites-tag'] ) {
881
+ var tag_title = pages[page_id]['astra-sites-tag'][site_tag_id];
882
+ tag_title = AstraSitesAdmin._unescape_lower( tag_title.replace('-', ' ') );
883
+ if( tag_title.toLowerCase().includes( search_term ) ) {
884
+ tags_strings.push( AstraSitesAdmin._unescape_lower( tag_title ) );
885
+ }
886
+ }
887
+ }
888
+ }
889
+ }
890
+ }
891
+ }
892
+ }
893
+
894
+ if ( search_term != '' ) {
895
+ console.groupCollapsed( 'Search for "' + search_term + '"' );
896
+ AstraSitesAdmin._log( items );
897
+ console.groupEnd();
898
+ }
899
+
900
+ if ( tags_strings.length > 0 ) {
901
+ AstraSitesAdmin.autocompleteTags = tags_strings;
902
+ AstraSitesAdmin._autocomplete();
903
+ }
904
+
905
+ return items;
906
+ },
907
+
908
+ _close_page_builder_list: function( event ) {
909
+ event.preventDefault();
910
+ $('body').removeClass( 'showing-page-builders' );
911
+ $('.page-builder-icon').removeClass( 'active' );
912
+ },
913
+
914
+ _toggle_page_builder_list: function( event ) {
915
+ event.preventDefault();
916
+ $(this).toggleClass( 'active' );
917
+ $('body').toggleClass( 'showing-page-builders' );
918
+ },
919
+
920
+ _sync_library_complete: function() {
921
+ $.ajax({
922
+ url : astraSitesVars.ajaxurl,
923
+ type : 'POST',
924
+ data : {
925
+ action : 'astra-sites-update-library-complete',
926
+ },
927
+ }).done(function ( response ) {
928
+ AstraSitesAdmin._log( response );
929
+ console.groupEnd( 'Update Library Request' );
930
+ });
931
+ },
932
+
933
+ _sync_library_with_ajax: function( is_append ) {
934
+
935
+ $.ajax({
936
+ url : astraSitesVars.ajaxurl,
937
+ type : 'POST',
938
+ data : {
939
+ action : 'astra-sites-get-sites-request-count',
940
+ },
941
+ beforeSend: function() {
942
+ console.groupCollapsed( 'Sync Library' );
943
+ AstraSitesAdmin._log( 'Sync Library..' );
944
+ },
945
+ })
946
+ .fail(function( jqXHR ){
947
+ AstraSitesAdmin._log( jqXHR, 'error' );
948
+ AstraSitesAdmin._importFailMessage( jqXHR.status + jqXHR.statusText, 'Site Count Request Failed!' );
949
+ console.groupEnd('Sync Library');
950
+ })
951
+ .done(function ( response ) {
952
+ AstraSitesAdmin._log( response );
953
+ if( response.success ) {
954
+ var total = response.data;
955
+
956
+ AstraSitesAdmin._log( total );
957
+
958
+ for( let i = 1; i <= total; i++ ) {
959
+
960
+ AstraSitesAjaxQueue.add({
961
+ url: astraSitesVars.ajaxurl,
962
+ type: 'POST',
963
+ data: {
964
+ action : 'astra-sites-import-sites',
965
+ page_no : i,
966
+ },
967
+ success: function( result ){
968
+ AstraSitesAdmin._log( result );
969
+
970
+ if( is_append ) {
971
+ if( ! AstraSitesAdmin.isEmpty( result.data ) ) {
972
+
973
+
974
+ var template = wp.template( 'astra-sites-page-builder-sites' );
975
+
976
+ // First fill the placeholders and then append remaining sites.
977
+ if( $('.placeholder-site').length ) {
978
+ for( site_id in result.data ) {
979
+ if( $('.placeholder-site').length ) {
980
+ $('.placeholder-site').first().remove();
981
+ }
982
+ }
983
+ if( $('#astra-sites .site-single:not(.placeholder-site)').length ) {
984
+ $('#astra-sites .site-single:not(.placeholder-site)').last().after( template( result.data ) );
985
+ } else {
986
+ $('#astra-sites').prepend( template( result.data ) );
987
+ }
988
+ } else {
989
+ $('#astra-sites').append( template( result.data ) );
990
+ }
991
+
992
+ astraSitesVars.default_page_builder_sites = $.extend({}, astraSitesVars.default_page_builder_sites, result.data);
993
+
994
+ AstraSitesAdmin._load_large_images();
995
+ $( document ).trigger( 'astra-sites-added-pages' );
996
+ }
997
+
998
+ }
999
+
1000
+ if( i === total && astraSitesVars.strings.syncCompleteMessage ) {
1001
+ console.groupEnd('Sync Library');
1002
+ $('#wpbody-content').find('.astra-sites-sync-library-message').remove();
1003
+ var noticeContent = wp.updates.adminNotice( {
1004
+ className: 'notice astra-sites-notice notice-success is-dismissible astra-sites-sync-library-message',
1005
+ message: astraSitesVars.strings.syncCompleteMessage + ' <button type="button" class="notice-dismiss"><span class="screen-reader-text">'+commonL10n.dismiss+'</span></button>',
1006
+ } );
1007
+ $('#screen-meta').after( noticeContent );
1008
+ $(document).trigger( 'wp-updates-notice-added' );
1009
+
1010
+ $('.astra-sites-sync-library-button').removeClass( 'updating-message');
1011
+ }
1012
+ }
1013
+ });
1014
+ }
1015
+
1016
+ // Run the AJAX queue.
1017
+ AstraSitesAjaxQueue.run();
1018
+ } else {
1019
+ AstraSitesAdmin._importFailMessage( response.data, 'Site Count Request Failed!' );
1020
+ }
1021
+ });
1022
+
1023
+ // Import categories.
1024
+ $.ajax({
1025
+ url : astraSitesVars.ajaxurl,
1026
+ type : 'POST',
1027
+ data : {
1028
+ action : 'astra-sites-import-categories',
1029
+ },
1030
+ beforeSend: function() {
1031
+ console.groupCollapsed( 'Importing Categories' );
1032
+ AstraSitesAdmin._log( 'Importing Categories..' );
1033
+ },
1034
+ })
1035
+ .fail(function( jqXHR ){
1036
+ AstraSitesAdmin._log( jqXHR );
1037
+ AstraSitesAdmin._importFailMessage( jqXHR.status + jqXHR.statusText, 'Category Import Failed!' );
1038
+ console.groupEnd( 'Importing Categories' );
1039
+ }).done(function ( response ) {
1040
+ AstraSitesAdmin._log( response );
1041
+ console.groupEnd( 'Importing Categories' );
1042
+ });
1043
+
1044
+ // Import Site Categories.
1045
+ $.ajax({
1046
+ url : astraSitesVars.ajaxurl,
1047
+ type : 'POST',
1048
+ data : {
1049
+ action : 'astra-sites-import-site-categories',
1050
+ },
1051
+ beforeSend: function() {
1052
+ console.groupCollapsed( 'Importing Site Categories' );
1053
+ AstraSitesAdmin._log( 'Importing Site Categories..' );
1054
+ },
1055
+ })
1056
+ .fail(function( jqXHR ){
1057
+ AstraSitesAdmin._log( jqXHR );
1058
+ AstraSitesAdmin._importFailMessage( jqXHR.status + jqXHR.statusText, 'Category Import Failed!' );
1059
+ console.groupCollapsed( 'Importing Site Categories' );
1060
+ }).done(function ( response ) {
1061
+ AstraSitesAdmin._log( response );
1062
+ console.groupCollapsed( 'Importing Site Categories' );
1063
+ });
1064
+
1065
+ // Import page builders.
1066
+ $.ajax({
1067
+ url : astraSitesVars.ajaxurl,
1068
+ type : 'POST',
1069
+ data : {
1070
+ action : 'astra-sites-import-page-builders',
1071
+ },
1072
+ beforeSend: function() {
1073
+ console.groupCollapsed( 'Importing Page Builders' );
1074
+ AstraSitesAdmin._log( 'Importing Page Builders..' );
1075
+ },
1076
+ })
1077
+ .fail(function( jqXHR ){
1078
+ AstraSitesAdmin._log( jqXHR );
1079
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Page Builder Import Failed!' );
1080
+ console.groupEnd( 'Importing Page Builders' );
1081
+ }).done(function ( response ) {
1082
+ AstraSitesAdmin._log( response );
1083
+ console.groupEnd( 'Importing Page Builders' );
1084
+ });
1085
+
1086
+ // Import Blocks.
1087
+ $.ajax({
1088
+ url : astraSitesVars.ajaxurl,
1089
+ type : 'POST',
1090
+ data : {
1091
+ action : 'astra-sites-import-blocks',
1092
+ },
1093
+ beforeSend: function() {
1094
+ console.groupCollapsed( 'Importing Blocks' );
1095
+ AstraSitesAdmin._log( 'Importing Blocks..' );
1096
+ },
1097
+ })
1098
+ .fail(function( jqXHR ){
1099
+ AstraSitesAdmin._log( jqXHR );
1100
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Block Import Failed!' );
1101
+ console.groupEnd( 'Importing Blocks' );
1102
+ }).done(function ( response ) {
1103
+ AstraSitesAdmin._log( response );
1104
+ console.groupEnd( 'Importing Blocks' );
1105
+ });
1106
+
1107
+ // Import Block Categories.
1108
+ $.ajax({
1109
+ url : astraSitesVars.ajaxurl,
1110
+ type : 'POST',
1111
+ data : {
1112
+ action : 'astra-sites-import-block-categories',
1113
+ },
1114
+ beforeSend: function() {
1115
+ console.groupCollapsed( 'Importing Block Categories' );
1116
+ AstraSitesAdmin._log( 'Importing Block Categories..' );
1117
+ },
1118
+ })
1119
+ .fail(function( jqXHR ){
1120
+ AstraSitesAdmin._log( jqXHR );
1121
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Category Import Failed!' );
1122
+ console.groupEnd( 'Importing Block Categories' );
1123
+ }).done(function ( response ) {
1124
+ AstraSitesAdmin._log( response );
1125
+ console.groupEnd( 'Importing Block Categories' );
1126
+ });
1127
+
1128
+ AstraSitesAdmin._sync_library_complete();
1129
+ },
1130
+
1131
+ _sync_library: function( event ) {
1132
+ event.preventDefault();
1133
+ var button = $(this);
1134
+
1135
+ if( button.hasClass( 'updating-message') ) {
1136
+ return;
1137
+ }
1138
+
1139
+ button.addClass( 'updating-message');
1140
+
1141
+ $('.astra-sites-sync-library-message').remove();
1142
+
1143
+ var noticeContent = wp.updates.adminNotice( {
1144
+ className: 'astra-sites-sync-library-message astra-sites-notice notice notice-info',
1145
+ message: '<span class="message">Syncing template library in the background. The process can take anywhere between 2 to 3 minutes. We will notify you once done.</span> <button type="button" class="notice-dismiss"><span class="screen-reader-text">'+commonL10n.dismiss+'</span></button>',
1146
+ } );
1147
+ $('#screen-meta').after( noticeContent );
1148
+
1149
+ $(document).trigger( 'wp-updates-notice-added' );
1150
+
1151
+ $.ajax({
1152
+ url : astraSitesVars.ajaxurl,
1153
+ type : 'POST',
1154
+ data : {
1155
+ action : 'astra-sites-update-library',
1156
+ },
1157
+ beforeSend: function() {
1158
+ console.groupCollapsed( 'Update Library Request' );
1159
+ AstraSitesAdmin._log( 'Updating Library..' );
1160
+ },
1161
+ })
1162
+ .fail(function( jqXHR ){
1163
+ AstraSitesAdmin._log( jqXHR );
1164
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Sync Library Failed!' );
1165
+ console.groupEnd( 'Update Library Request' );
1166
+ })
1167
+ .done(function ( response ) {
1168
+ console.log( response );
1169
+
1170
+ if( response.success ) {
1171
+ if( 'updated' === response.data ) {
1172
+
1173
+ $('#wpbody-content').find('.astra-sites-sync-library-message').remove();
1174
+ var noticeContent = wp.updates.adminNotice( {
1175
+ className: 'notice astra-sites-notice notice-success is-dismissible astra-sites-sync-library-message',
1176
+ message: astraSitesVars.strings.syncCompleteMessage + ' <button type="button" class="notice-dismiss"><span class="screen-reader-text">'+commonL10n.dismiss+'</span></button>',
1177
+ } );
1178
+ $('#screen-meta').after( noticeContent );
1179
+ $(document).trigger( 'wp-updates-notice-added' );
1180
+ button.removeClass( 'updating-message');
1181
+ AstraSitesAdmin._log( 'Already sync all the sites.' );
1182
+ console.groupEnd( 'Update Library Request' );
1183
+ } else {
1184
+ AstraSitesAdmin._sync_library_with_ajax();
1185
+ }
1186
+ }
1187
+ });
1188
+ },
1189
+
1190
+ _filterSites: function( event ) {
1191
+ event.preventDefault();
1192
+ var current_class = $(this).attr('data-group') || '';
1193
+ $( this ).parents('.filter-links').find('a').removeClass( 'current' );
1194
+ $( this ).addClass( 'current' );
1195
+
1196
+ var search_term = $( this ).text() || '';
1197
+
1198
+ if( current_class ) {
1199
+ if( $('#astra-sites .astra-theme.'+current_class).length ) {
1200
+ $('#wp-filter-search-input').val( search_term );
1201
+
1202
+ // $('#astra-sites .astra-theme').removeClass('astra-show-site astra-hide-site');
1203
+ $('#astra-sites .astra-theme').addClass( 'astra-hide-site' );
1204
+ $('#astra-sites .astra-theme.'+current_class).removeClass( 'astra-hide-site' ).addClass( 'astra-show-site');
1205
+ }
1206
+ } else {
1207
+ $('#astra-sites .astra-theme').removeClass( 'astra-hide-site' ).addClass( 'astra-show-site');
1208
+ }
1209
+
1210
+ $('.filters-wrap-page-categories').removeClass('show');
1211
+ },
1212
+
1213
+ _next_and_previous_sites: function(e) {
1214
+
1215
+ if( ! $('body').hasClass('astra-previewing-single-pages') ) {
1216
+ return;
1217
+ }
1218
+
1219
+ if( e.key === "Escape") {
1220
+ AstraSitesAdmin.close_pages_popup();
1221
+ return;
1222
+ }
1223
+
1224
+ switch(e.which) {
1225
+
1226
+ // Left Key Pressed
1227
+ case 37:
1228
+ if( $('#astra-sites .astra-theme.current').prev().length ) {
1229
+ $('#astra-sites .astra-theme.current').prev().addClass('current').siblings().removeClass('current');
1230
+ var site_id = $('#astra-sites .astra-theme.current').prev().attr('data-site-id') || '';
1231
+ if( site_id ) {
1232
+ AstraSitesAdmin.show_pages_by_site_id( site_id );
1233
+ }
1234
+ }
1235
+ break;
1236
+
1237
+ // Right Key Pressed
1238
+ case 39:
1239
+ if( $('#astra-sites .astra-theme.current').next().length ) {
1240
+ $('#astra-sites .astra-theme.current').next().addClass('current').siblings().removeClass('current');
1241
+ var site_id = $('#astra-sites .astra-theme.current').next().attr('data-site-id') || '';
1242
+ if( site_id ) {
1243
+ AstraSitesAdmin.show_pages_by_site_id( site_id );
1244
+ }
1245
+ }
1246
+ break;
1247
+ }
1248
+
1249
+ },
1250
+
1251
+ show_pages_by_site_id: function( site_id, page_id ) {
1252
+
1253
+ var sites = astraSitesVars.default_page_builder_sites || [];
1254
+
1255
+ var data = sites[site_id];
1256
+
1257
+ if( 'undefined' !== typeof data ) {
1258
+ var site_template = wp.template('astra-sites-single-site-preview');
1259
+
1260
+ if( ! AstraSitesAdmin._getParamFromURL( 'astra-site' ) ) {
1261
+ var url_params = {
1262
+ 'astra-site' : site_id,
1263
+ };
1264
+ AstraSitesAdmin._changeAndSetURL( url_params );
1265
+ }
1266
+
1267
+ $('#astra-sites').hide();
1268
+ $('#site-pages').show().html( site_template( data ) ).removeClass('brizy elementor beaver-builder gutenberg').addClass( astraSitesVars.default_page_builder );
1269
+
1270
+ $('body').addClass('astra-previewing-single-pages');
1271
+ $('#site-pages').attr( 'data-site-id', site_id);
1272
+
1273
+ if( AstraSitesAdmin._getParamFromURL( 'astra-page' ) ) {
1274
+ AstraSitesAdmin._set_preview_screenshot_by_page( $('#single-pages .site-single[data-page-id="'+AstraSitesAdmin._getParamFromURL( 'astra-page' )+'"]') );
1275
+ // Has first item?
1276
+ // Then set default screnshot in preview.
1277
+ } else if( page_id && $('#single-pages .site-single[data-page-id="'+page_id+'"]').length ) {
1278
+ AstraSitesAdmin._set_preview_screenshot_by_page( $('#single-pages .site-single[data-page-id="'+page_id+'"]') );
1279
+ } else if( $('#single-pages .site-single').eq( 0 ).length ) {
1280
+ AstraSitesAdmin._set_preview_screenshot_by_page( $('#single-pages .site-single').eq( 0 ) );
1281
+ }
1282
+
1283
+ if( ! $('#single-pages .site-single').eq( 0 ).length ) {
1284
+ $('.site-import-layout-button').hide();
1285
+ }
1286
+
1287
+ $( document ).trigger( 'astra-sites-added-pages' );
1288
+
1289
+ AstraSitesAdmin._load_large_images();
1290
+ }
1291
+
1292
+ },
1293
+
1294
+ _show_sites: function( event ) {
1295
+
1296
+ event.preventDefault();
1297
+
1298
+ $( '.astra-sites-show-favorite-button' ).removeClass( 'active' );
1299
+ $( 'body' ).removeClass( 'astra-sites-showing-favorites' );
1300
+ $( 'body' ).removeClass( 'astra-sites-no-search-result' );
1301
+ $( '.astra-sites__category-filter-items' ).find( '.ast-sites__filter-wrap' ).removeClass( 'category-active' );
1302
+ $( '.ast-sites__filter-wrap' ).first().addClass( 'category-active' );
1303
+ $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug', '' );
1304
+ AstraSitesAdmin.filter_array = [];
1305
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).attr('checked',false);
1306
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).removeClass( 'active' );
1307
+ $( '#radio-all' ).trigger( 'click' );
1308
+ $( '#radio-all' ).addClass( 'active' );
1309
+ $( '.astra-sites__category-filter-anchor' ).text( 'All' );
1310
+ AstraSitesAdmin._closeFilter();
1311
+ $( '#wp-filter-search-input' ).val( '' );
1312
+ $('#astra-sites-admin').removeClass('searching');
1313
+ AstraSitesAdmin.add_sites( astraSitesVars.default_page_builder_sites );
1314
+ AstraSitesAdmin.close_pages_popup();
1315
+
1316
+ AstraSitesAdmin._clean_url_params( 'favorites' );
1317
+
1318
+ AstraSitesAdmin._load_large_images();
1319
+ },
1320
+
1321
+ /**
1322
+ * Go back to all sites view
1323
+ *
1324
+ * @since 2.0.0
1325
+ * @return null
1326
+ */
1327
+ _go_back: function( event ) {
1328
+
1329
+ event.preventDefault();
1330
+
1331
+ AstraSitesAdmin._clean_url_params( 'search' );
1332
+ AstraSitesAdmin._clean_url_params( 'favorites' );
1333
+ AstraSitesAdmin._clean_url_params( 'license' );
1334
+ AstraSitesAdmin.close_pages_popup();
1335
+ AstraSitesAdmin._load_large_images();
1336
+ },
1337
+
1338
+ close_pages_popup: function( ) {
1339
+ astraSitesVars.cpt_slug = 'astra-sites';
1340
+
1341
+ $('#astra-sites').show();
1342
+ $('#site-pages').hide().html( '' );
1343
+ $('body').removeClass('astra-previewing-single-pages');
1344
+ $('.astra-sites-result-preview').hide();
1345
+
1346
+ $('#astra-sites .astra-theme').removeClass('current');
1347
+
1348
+ AstraSitesAdmin._clean_url_params( 'astra-site' );
1349
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
1350
+ AstraSitesAdmin._clean_url_params( 'license' );
1351
+ },
1352
+
1353
+
1354
+ _toggle_favorite: function( event ) {
1355
+
1356
+ let is_favorite = $( this ).data( 'favorite' );
1357
+ let parent = $( this ).parents( '.astra-theme' );
1358
+ let site_id = parent.data( 'site-id' ).toString();
1359
+ let new_array = Array();
1360
+
1361
+ parent.toggleClass( 'is-favorite' );
1362
+ $( this ).data( 'favorite', ! is_favorite );
1363
+
1364
+ if ( ! is_favorite ) {
1365
+ // Add.
1366
+ for ( value in astraSitesVars.favorite_data ) {
1367
+ new_array.push( astraSitesVars.favorite_data[value] );
1368
+ }
1369
+ new_array.push( site_id );
1370
+ } else {
1371
+ // Remove.
1372
+ for ( value in astraSitesVars.favorite_data ) {
1373
+ if ( site_id != astraSitesVars.favorite_data[value].toString() ) {
1374
+ new_array.push( astraSitesVars.favorite_data[value] );
1375
+ }
1376
+ }
1377
+ }
1378
+ astraSitesVars.favorite_data = new_array;
1379
+
1380
+ // If in favorites preview window and unfavorite the item?
1381
+ if( $( 'body' ).hasClass('astra-sites-showing-favorites') && ! parent.hasClass('is-favorite') ) {
1382
+
1383
+ // Then remove the favorite item from markup.
1384
+ parent.remove();
1385
+
1386
+ // Show Empty Favorite message if there is not item in favorite.
1387
+ if( ! $('#astra-sites .astra-theme').length ) {
1388
+ $('#astra-sites').html( wp.template( 'astra-sites-no-favorites' ) );
1389
+ }
1390
+ }
1391
+
1392
+ $.ajax({
1393
+ url : astraSitesVars.ajaxurl,
1394
+ type : 'POST',
1395
+ dataType: 'json',
1396
+ data : {
1397
+ action : 'astra-sites-favorite',
1398
+ is_favorite : ! is_favorite,
1399
+ site_id : site_id
1400
+ },
1401
+ beforeSend: function() {
1402
+ console.groupCollapsed( 'Toggle Favorite' );
1403
+ AstraSitesAdmin._log( ! is_favorite );
1404
+ },
1405
+ })
1406
+ .fail(function( jqXHR ){
1407
+ AstraSitesAdmin._log( jqXHR );
1408
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Favorite/Unfavorite Failed!' );
1409
+ console.groupEnd();
1410
+ })
1411
+ .done(function ( response ) {
1412
+ AstraSitesAdmin._log( response );
1413
+ console.groupEnd();
1414
+ });
1415
+ },
1416
+
1417
+
1418
+ _show_favorite: function( event ) {
1419
+
1420
+ if( event ) {
1421
+ event.preventDefault();
1422
+ }
1423
+
1424
+ AstraSitesAdmin.close_pages_popup();
1425
+
1426
+ $( '.astra-sites__category-filter-items' ).find( '.ast-sites__filter-wrap' ).removeClass( 'category-active' );
1427
+ $( '.ast-sites__filter-wrap' ).first().addClass( 'category-active' );
1428
+ $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug', '' );
1429
+ AstraSitesAdmin.filter_array = [];
1430
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).attr('checked',false);
1431
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).removeClass( 'active' );
1432
+ $( '#radio-all' ).trigger( 'click' );
1433
+ $( '#radio-all' ).addClass( 'active' );
1434
+ $( '.astra-sites__category-filter-anchor' ).text( 'All' );
1435
+ $( '#wp-filter-search-input' ).val( '' );
1436
+
1437
+ if( $( '.astra-sites-show-favorite-button' ).hasClass( 'active' ) ) {
1438
+ $( '.astra-sites-show-favorite-button' ).removeClass( 'active' );
1439
+ $( 'body' ).removeClass( 'astra-sites-showing-favorites' );
1440
+ AstraSitesAdmin.add_sites( astraSitesVars.default_page_builder_sites );
1441
+ AstraSitesAdmin._clean_url_params( 'favorites' );
1442
+ } else {
1443
+ AstraSitesAdmin._clean_url_params( 'search' );
1444
+ AstraSitesAdmin._clean_url_params( 'astra-site' );
1445
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
1446
+ AstraSitesAdmin._clean_url_params( 'license' );
1447
+ AstraSitesAdmin.close_pages_popup();
1448
+
1449
+ if( ! AstraSitesAdmin._getParamFromURL('favorites') ) {
1450
+ var url_params = {
1451
+ 'favorites' : 'show'
1452
+ };
1453
+ AstraSitesAdmin._changeAndSetURL( url_params );
1454
+ }
1455
+
1456
+ $( '.astra-sites-show-favorite-button' ).addClass( 'active' );
1457
+ $( 'body' ).addClass( 'astra-sites-showing-favorites' );
1458
+ var items = [];
1459
+ for( favorite_id in astraSitesVars.favorite_data ) {
1460
+ var exist_data = astraSitesVars.default_page_builder_sites[astraSitesVars.favorite_data[favorite_id].toString()] || {};
1461
+ if( ! $.isEmptyObject( exist_data ) ) {
1462
+ items[ astraSitesVars.favorite_data[favorite_id].toString() ] = exist_data;
1463
+ }
1464
+ }
1465
+
1466
+ if( ! AstraSitesAdmin.isEmpty( items ) ) {
1467
+ AstraSitesAdmin.add_sites( items );
1468
+ $( document ).trigger( 'astra-sites-added-sites' );
1469
+
1470
+ } else {
1471
+ $('#astra-sites').html( wp.template( 'astra-sites-no-favorites' ) );
1472
+ }
1473
+ }
1474
+
1475
+ },
1476
+
1477
+ _set_preview_screenshot_by_page: function( element ) {
1478
+ var large_img_url = $(element).find( '.theme-screenshot' ).attr( 'data-featured-src' ) || '';
1479
+ var url = $(element).find( '.theme-screenshot' ).attr( 'data-src' ) || '';
1480
+ var page_name = $(element).find('.theme-name').text() || '';
1481
+
1482
+ $( element ).siblings().removeClass( 'current_page' );
1483
+ $( element ).addClass( 'current_page' );
1484
+
1485
+ var page_id = $( element ).attr( 'data-page-id' ) || '';
1486
+ if( page_id ) {
1487
+
1488
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
1489
+
1490
+ var url_params = {
1491
+ 'astra-page' : page_id,
1492
+ };
1493
+ AstraSitesAdmin._changeAndSetURL( url_params );
1494
+ }
1495
+
1496
+ $( '.site-import-layout-button' ).removeClass( 'disabled' );
1497
+ if( page_name ) {
1498
+ $( '.site-import-layout-button' ).text('Import "'+page_name.trim()+'" Template');
1499
+ }
1500
+
1501
+ if( url ) {
1502
+ $('.single-site-preview').animate({
1503
+ scrollTop: 0
1504
+ },0);
1505
+ $('.single-site-preview img').addClass('loading').attr( 'src', url );
1506
+ var imgLarge = new Image();
1507
+ imgLarge.src = large_img_url;
1508
+ imgLarge.onload = function () {
1509
+ $('.single-site-preview img').removeClass('loading');
1510
+ $('.single-site-preview img').attr('src', imgLarge.src );
1511
+ };
1512
+ }
1513
+ },
1514
+
1515
+ /**
1516
+ * Preview Inner Pages for the Site
1517
+ *
1518
+ * @since 2.0.0
1519
+ * @return null
1520
+ */
1521
+ _change_site_preview_screenshot: function( event ) {
1522
+ event.preventDefault();
1523
+
1524
+ var item = $(this);
1525
+
1526
+ AstraSitesAdmin._set_preview_screenshot_by_page( item );
1527
+ },
1528
+
1529
+ _show_pages: function( event ) {
1530
+
1531
+ var perent = $(this).parents('.astra-theme');
1532
+ perent.siblings().removeClass('current');
1533
+ perent.addClass('current');
1534
+
1535
+ var site_id = perent.attr('data-site-id') || '';
1536
+ AstraSitesAdmin.show_pages_by_site_id( site_id );
1537
+ },
1538
+
1539
+ _apiAddParam_status: function() {
1540
+ if( astraSitesVars.sites && astraSitesVars.sites.status ) {
1541
+ AstraSitesAdmin._api_params['status'] = astraSitesVars.sites.status;
1542
+ }
1543
+ },
1544
+
1545
+ // Add 'search'
1546
+ _apiAddParam_search: function() {
1547
+ var search_val = jQuery('#wp-filter-search-input').val() || '';
1548
+ if( '' !== search_val ) {
1549
+ AstraSitesAdmin._api_params['search'] = search_val;
1550
+ }
1551
+ },
1552
+
1553
+ _apiAddParam_per_page: function() {
1554
+ // Add 'per_page'
1555
+ var per_page_val = 30;
1556
+ if( astraSitesVars.sites && astraSitesVars.sites["per-page"] ) {
1557
+ per_page_val = parseInt( astraSitesVars.sites["per-page"] );
1558
+ }
1559
+ AstraSitesAdmin._api_params['per_page'] = per_page_val;
1560
+ },
1561
+
1562
+ _apiAddParam_astra_site_category: function() {
1563
+ // Add 'astra-site-category'
1564
+ var selected_category_id = jQuery( '.filter-links[data-category="' + astraSitesVars.category_slug + '"]' ).find('.current').data('group') || '';
1565
+ if( '' !== selected_category_id && 'all' !== selected_category_id ) {
1566
+ AstraSitesAdmin._api_params[astraSitesVars.category_slug] = selected_category_id;
1567
+ } else if( astraSitesVars.sites && astraSitesVars['categories'].include ) {
1568
+ if( AstraSitesAdmin._isArray( astraSitesVars['categories'].include ) ) {
1569
+ AstraSitesAdmin._api_params[astraSitesVars.category_slug] = astraSitesVars['categories'].include.join(',');
1570
+ } else {
1571
+ AstraSitesAdmin._api_params[astraSitesVars.category_slug] = astraSitesVars['categories'].include;
1572
+ }
1573
+ }
1574
+ },
1575
+
1576
+ _apiAddParam_astra_page_parent_category: function() {
1577
+
1578
+ // Add 'site-pages-parent-category'
1579
+ if ( '' == astraSitesVars.parent_category) {
1580
+ return;
1581
+ }
1582
+
1583
+ var selected_category_id = jQuery( '.filter-links[data-category="' + astraSitesVars.parent_category + '"]' ).find('.current').data('group') || '';
1584
+ if( '' !== selected_category_id && 'all' !== selected_category_id ) {
1585
+ AstraSitesAdmin._api_params[astraSitesVars.parent_category] = selected_category_id;
1586
+ } else if( astraSitesVars.sites && astraSitesVars['categories'].include ) {
1587
+ if( AstraSitesAdmin._isArray( astraSitesVars['categories'].include ) ) {
1588
+ AstraSitesAdmin._api_params[astraSitesVars.parent_category] = astraSitesVars['categories'].include.join(',');
1589
+ } else {
1590
+ AstraSitesAdmin._api_params[astraSitesVars.parent_category] = astraSitesVars['categories'].include;
1591
+ }
1592
+ }
1593
+ },
1594
+
1595
+ _apiAddParam_astra_site_page_builder: function() {
1596
+ // Add 'astra-site-page-builder'
1597
+ var selected_page_builder_id = jQuery( '.filter-links[data-category="' + astraSitesVars.page_builder + '"]' ).find('.current').data('group') || '';
1598
+ if( '' !== selected_page_builder_id && 'all' !== selected_page_builder_id ) {
1599
+ AstraSitesAdmin._api_params[astraSitesVars.page_builder] = selected_page_builder_id;
1600
+ } else if( astraSitesVars.sites && astraSitesVars['page-builders'].include ) {
1601
+ if( AstraSitesAdmin._isArray( astraSitesVars['page-builders'].include ) ) {
1602
+ AstraSitesAdmin._api_params[astraSitesVars.page_builder] = astraSitesVars['page-builders'].include.join(',');
1603
+ } else {
1604
+ AstraSitesAdmin._api_params[astraSitesVars.page_builder] = astraSitesVars['page-builders'].include;
1605
+ }
1606
+ }
1607
+ },
1608
+
1609
+ _apiAddParam_page: function() {
1610
+ // Add 'page'
1611
+ var page_val = parseInt(jQuery('body').attr('data-astra-demo-paged')) || 1;
1612
+ AstraSitesAdmin._api_params['page'] = page_val;
1613
+ },
1614
+
1615
+ _apiAddParam_purchase_key: function() {
1616
+ if( astraSitesVars.sites && astraSitesVars.sites.purchase_key ) {
1617
+ AstraSitesAdmin._api_params['purchase_key'] = astraSitesVars.sites.purchase_key;
1618
+ }
1619
+ },
1620
+
1621
+ _apiAddParam_site_url: function() {
1622
+ if( astraSitesVars.sites && astraSitesVars.sites.site_url ) {
1623
+ AstraSitesAdmin._api_params['site_url'] = astraSitesVars.sites.site_url;
1624
+ }
1625
+ AstraSitesAdmin._api_params['track'] = true;
1626
+ },
1627
+
1628
+ _show_default_page_builder_sites: function() {
1629
+
1630
+ if( ! $('#astra-sites').length ) {
1631
+ return;
1632
+ }
1633
+
1634
+ if( Object.keys( astraSitesVars.default_page_builder_sites ).length ) {
1635
+ var favorites = AstraSitesAdmin._getParamFromURL('favorites');
1636
+ var search_term = AstraSitesAdmin._getParamFromURL('search');
1637
+ if( search_term ) {
1638
+ var items = AstraSitesAdmin._get_sites_and_pages_by_search_term( search_term );
1639
+
1640
+ if( ! AstraSitesAdmin.isEmpty( items ) ) {
1641
+ AstraSitesAdmin.add_sites( items );
1642
+ $('#wp-filter-search-input').val( search_term );
1643
+ } else {
1644
+ $('#astra-sites').html( astraSitesVars.default_page_builder_sites );
1645
+ }
1646
+
1647
+ } else if( favorites ) {
1648
+ AstraSitesAdmin._show_favorite();
1649
+ } else {
1650
+ AstraSitesAdmin.add_sites( astraSitesVars.default_page_builder_sites );
1651
+ }
1652
+
1653
+ // Show single site preview.
1654
+ var site_id = AstraSitesAdmin._getParamFromURL('astra-site');
1655
+
1656
+ if( site_id ) {
1657
+ AstraSitesAdmin.show_pages_by_site_id( site_id );
1658
+ }
1659
+ } else {
1660
+
1661
+ var temp = [];
1662
+ for (var i = 0; i < 8; i++) {
1663
+ temp['id-' + i] = {
1664
+ 'title' : 'Lorem Ipsum',
1665
+ 'class' : 'placeholder-site',
1666
+ };
1667
+ }
1668
+
1669
+ AstraSitesAdmin.add_sites( temp );
1670
+ $('#astra-sites').addClass( 'temp' );
1671
+
1672
+ AstraSitesAdmin._sync_library_with_ajax( true );
1673
+ }
1674
+
1675
+ var show_license = AstraSitesAdmin._getParamFromURL('license');
1676
+ if( show_license ) {
1677
+ AstraSitesAdmin._show_activate_license_notice();
1678
+ }
1679
+ },
1680
+
1681
+ _change_page_builder: function() {
1682
+ var page_builder = $( this ).attr('data-page-builder') || '';
1683
+
1684
+ $( this ).parents('.page-builders').find('img').removeClass('active');
1685
+ $( this ).find('img').addClass('active');
1686
+
1687
+ $.ajax({
1688
+ url : astraSitesVars.ajaxurl,
1689
+ type : 'POST',
1690
+ data : {
1691
+ action : 'astra-sites-change-page-builder',
1692
+ page_builder : page_builder,
1693
+ },
1694
+ beforeSend: function() {
1695
+ console.groupCollapsed( 'Change Page Builder' );
1696
+ AstraSitesAdmin._log( 'Change Page Builder..' );
1697
+ },
1698
+ })
1699
+ .done(function ( response ) {
1700
+ AstraSitesAdmin._log( response );
1701
+ AstraSitesAdmin._clean_url_params( 'astra-site' );
1702
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
1703
+ AstraSitesAdmin._clean_url_params( 'change-page-builder' );
1704
+ AstraSitesAdmin._clean_url_params( 'license' );
1705
+ console.groupEnd();
1706
+ location.reload();
1707
+ });
1708
+ },
1709
+
1710
+ _ajax_change_page_builder: function() {
1711
+
1712
+ var page_builder_slug = $(this).attr('data-page-builder') || '';
1713
+ var page_builder_img = $(this).find('img').attr('src') || '';
1714
+ var page_builder_title = $(this).find('.title').text() || '';
1715
+ if( page_builder_img ) {
1716
+ $('.selected-page-builder').find('img').attr('src', page_builder_img );
1717
+ }
1718
+ if( page_builder_title ) {
1719
+ $('.selected-page-builder').find('.page-builder-title').text( page_builder_title );
1720
+ }
1721
+
1722
+ $('#wp-filter-search-input').val( '' );
1723
+ $('#astra-sites-admin').removeClass('searching');
1724
+ $('body').removeClass('astra-previewing-single-pages');
1725
+
1726
+ if( $('.page-builders [data-page-builder="'+page_builder_slug+'"]').length ) {
1727
+ $('.page-builders [data-page-builder="'+page_builder_slug+'"]').siblings().removeClass('active');
1728
+ $('.page-builders [data-page-builder="'+page_builder_slug+'"]').addClass('active');
1729
+ }
1730
+
1731
+ if( page_builder_slug ) {
1732
+
1733
+ AstraSitesAdmin._clean_url_params( 'astra-site' );
1734
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
1735
+ AstraSitesAdmin._clean_url_params( 'license' );
1736
+
1737
+ $('#astra-sites').show();
1738
+ $('#site-pages').hide();
1739
+
1740
+ $.ajax({
1741
+ url : astraSitesVars.ajaxurl,
1742
+ type : 'POST',
1743
+ data : {
1744
+ action : 'astra-sites-change-page-builder',
1745
+ page_builder : page_builder_slug,
1746
+ },
1747
+ beforeSend: function() {
1748
+ console.groupCollapsed( 'Change Page Builder' );
1749
+ AstraSitesAdmin._log( 'Change Page Builder..' );
1750
+ },
1751
+ })
1752
+ .done(function ( response ) {
1753
+ AstraSitesAdmin._log( response );
1754
+ console.groupEnd();
1755
+ if( response.success ) {
1756
+ $( '.astra-sites__category-filter-items' ).find( '.ast-sites__filter-wrap' ).removeClass( 'category-active' );
1757
+ $( '.ast-sites__filter-wrap' ).first().addClass( 'category-active' );
1758
+ $( '.astra-sites__category-filter-anchor' ).attr( 'data-slug', '' );
1759
+ AstraSitesAdmin.filter_array = [];
1760
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).attr('checked',false);
1761
+ $( '.ast-sites__filter-wrap-checkbox input:radio' ).removeClass( 'active' );
1762
+ $( '#radio-all' ).trigger( 'click' );
1763
+ $( '#radio-all' ).addClass( 'active' );
1764
+ $( '.astra-sites__category-filter-anchor' ).text( 'All' );
1765
+ AstraSitesAdmin._closeFilter();
1766
+
1767
+ astraSitesVars.default_page_builder = page_builder_slug;
1768
+
1769
+ // Set changed page builder data as a default page builder object.
1770
+ astraSitesVars.default_page_builder_sites = response.data;
1771
+ $('.astra-sites-show-favorite-button').removeClass('active');
1772
+ AstraSitesAdmin.add_sites( response.data );
1773
+
1774
+ AstraSitesAdmin._autocomplete();
1775
+ }
1776
+ });
1777
+
1778
+ }
1779
+ },
1780
+
1781
+ add_sites_after_search: function( data ) {
1782
+ var template = wp.template( 'astra-sites-page-builder-sites-search' );
1783
+ $('#astra-sites').html( template( data ) );
1784
+ AstraSitesAdmin._load_large_images();
1785
+ $( document ).trigger( 'astra-sites-added-sites' );
1786
+ },
1787
+
1788
+ add_sites: function( data ) {
1789
+ var template = wp.template( 'astra-sites-page-builder-sites' );
1790
+ $('#astra-sites').html( template( data ) );
1791
+ AstraSitesAdmin._load_large_images();
1792
+ $( document ).trigger( 'astra-sites-added-sites' );
1793
+ },
1794
+
1795
+ _toggle_tooltip: function( event ) {
1796
+ event.preventDefault();
1797
+ var tip_id = $( this ).data('tip-id') || '';
1798
+ if( tip_id && $( '#' + tip_id ).length ) {
1799
+ $( '#' + tip_id ).toggle();
1800
+ }
1801
+ },
1802
+
1803
+ _resetData: function(event) {
1804
+ event.preventDefault();
1805
+
1806
+ AstraSitesAdmin.import_start_time = new Date();
1807
+
1808
+ if( $( this ).hasClass('updating-message') ) {
1809
+ return;
1810
+ }
1811
+
1812
+ $(this).addClass('updating-message installing').text( 'Importing..' );
1813
+ $('body').addClass('importing-site');
1814
+ $('.astra-sites-result-preview .inner > h3').text('We\'re importing your website.');
1815
+ $('.install-theme-info').hide();
1816
+ $('.ast-importing-wrap').show();
1817
+ var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
1818
+ $('.current-importing-status').html( output );
1819
+
1820
+ // Process Theme Activate and Install Process
1821
+ if ( $( '.astra-sites-theme-activation .checkbox' ).is(':checked') ) {
1822
+ var status = $( '.astra-sites-theme-activation .checkbox' ).data('status')
1823
+ AstraSitesAdmin._installAstra( status );
1824
+ }
1825
+
1826
+ $.ajax({
1827
+ url : astraSitesVars.ajaxurl,
1828
+ type : 'POST',
1829
+ data : {
1830
+ action : 'astra-sites-set-reset-data',
1831
+ _ajax_nonce : astraSitesVars._ajax_nonce,
1832
+ },
1833
+ beforeSend: function() {
1834
+ console.groupCollapsed( 'Site Reset Data' );
1835
+ },
1836
+ })
1837
+ .done(function ( response ) {
1838
+ console.log( 'List of Reset Items:' );
1839
+ AstraSitesAdmin._log( response );
1840
+ console.groupEnd();
1841
+ if( response.success ) {
1842
+ AstraSitesAdmin.site_imported_data = response.data;
1843
+
1844
+ // Process Bulk Plugin Install & Activate.
1845
+ AstraSitesAdmin._bulkPluginInstallActivate();
1846
+ }
1847
+ });
1848
+
1849
+ },
1850
+
1851
+ _remove_skip_and_import_popup: function( event ) {
1852
+ event.preventDefault();
1853
+
1854
+ $(this).parents('.skip-and-import').addClass('hide-me visited');
1855
+
1856
+ if( $('.skip-and-import.hide-me').not('.visited').length ) {
1857
+ $('.skip-and-import.hide-me').not('.visited').first().removeClass('hide-me');
1858
+ } else {
1859
+ $('.astra-sites-result-preview .default').removeClass('hide-me');
1860
+
1861
+ if( $('.astra-sites-result-preview').hasClass('import-page') ) {
1862
+
1863
+ AstraSitesAdmin.skip_and_import_popups = [];
1864
+
1865
+ var notinstalled = AstraSitesAdmin.required_plugins.notinstalled || 0;
1866
+ if( ! notinstalled.length ) {
1867
+ AstraSitesAdmin.import_page_process();
1868
+ }
1869
+ }
1870
+ }
1871
+ },
1872
+
1873
+ _start_site_import: function() {
1874
+ if ( AstraSitesAdmin._is_reset_data() ) {
1875
+ $(document).trigger( 'astra-sites-reset-data' );
1876
+ } else {
1877
+ $(document).trigger( 'astra-sites-reset-data-done' );
1878
+ }
1879
+ },
1880
+
1881
+ _reset_customizer_data: function() {
1882
+ $.ajax({
1883
+ url : astraSitesVars.ajaxurl,
1884
+ type : 'POST',
1885
+ data : {
1886
+ action : 'astra-sites-reset-customizer-data',
1887
+ _ajax_nonce : astraSitesVars._ajax_nonce,
1888
+ },
1889
+ beforeSend: function() {
1890
+ console.groupCollapsed( 'Reseting Customizer Data' );
1891
+ AstraSitesAdmin._log_title( 'Reseting Customizer Data..' );
1892
+ // console.log( '# Reseting Customizer Data..' );
1893
+ },
1894
+ })
1895
+ .fail(function( jqXHR ){
1896
+ AstraSitesAdmin._log( jqXHR );
1897
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Reset Customizer Settings Failed!' );
1898
+ console.groupEnd();
1899
+ })
1900
+ .done(function ( data ) {
1901
+ AstraSitesAdmin._log( data );
1902
+ AstraSitesAdmin._log_title( 'Complete Resetting Customizer Data..' );
1903
+ AstraSitesAdmin._log( 'Complete Resetting Customizer Data..' );
1904
+ console.groupEnd();
1905
+ $(document).trigger( 'astra-sites-reset-customizer-data-done' );
1906
+ });
1907
+ },
1908
+
1909
+ _reset_site_options: function() {
1910
+ // Site Options.
1911
+ $.ajax({
1912
+ url : astraSitesVars.ajaxurl,
1913
+ type : 'POST',
1914
+ data : {
1915
+ action : 'astra-sites-reset-site-options',
1916
+ _ajax_nonce : astraSitesVars._ajax_nonce,
1917
+ },
1918
+ beforeSend: function() {
1919
+ console.groupCollapsed( 'Reseting Site Options' );
1920
+ AstraSitesAdmin._log_title( 'Reseting Site Options..' );
1921
+ // console.log( '# Reseting Site Options..' );
1922
+ },
1923
+ })
1924
+ .fail(function( jqXHR ){
1925
+ AstraSitesAdmin._log( jqXHR );
1926
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Reset Site Options Failed!' );
1927
+ console.groupEnd();
1928
+ })
1929
+ .done(function ( data ) {
1930
+ AstraSitesAdmin._log( data );
1931
+ AstraSitesAdmin._log_title( 'Complete Reseting Site Options..' );
1932
+ console.groupEnd();
1933
+ $(document).trigger( 'astra-sites-reset-site-options-done' );
1934
+ });
1935
+ },
1936
+
1937
+ _reset_widgets_data: function() {
1938
+ // Widgets.
1939
+ $.ajax({
1940
+ url : astraSitesVars.ajaxurl,
1941
+ type : 'POST',
1942
+ data : {
1943
+ action : 'astra-sites-reset-widgets-data',
1944
+ _ajax_nonce : astraSitesVars._ajax_nonce,
1945
+ },
1946
+ beforeSend: function() {
1947
+ console.groupCollapsed( 'Reseting Widgets' );
1948
+ AstraSitesAdmin._log_title( 'Reseting Widgets..' );
1949
+ // console.log( '# Reseting Widgets..' );
1950
+ },
1951
+ })
1952
+ .fail(function( jqXHR ){
1953
+ AstraSitesAdmin._log( jqXHR );
1954
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Reset Widgets Data Failed!' );
1955
+ console.groupEnd();
1956
+ })
1957
+ .done(function ( data ) {
1958
+ AstraSitesAdmin._log( data );
1959
+ AstraSitesAdmin._log_title( 'Complete Reseting Widgets..' );
1960
+ console.groupEnd();
1961
+ $(document).trigger( 'astra-sites-reset-widgets-data-done' );
1962
+ });
1963
+ },
1964
+
1965
+ _reset_posts: function() {
1966
+ if( AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
1967
+
1968
+ AstraSitesAdmin.reset_remaining_posts = AstraSitesAdmin.site_imported_data['reset_posts'].length;
1969
+
1970
+ console.groupCollapsed( 'Deleting Posts' );
1971
+ AstraSitesAdmin._log_title( 'Deleting Posts..' );
1972
+
1973
+ $.each( AstraSitesAdmin.site_imported_data['reset_posts'], function(index, post_id) {
1974
+
1975
+ AstraSitesAjaxQueue.add({
1976
+ url: astraSitesVars.ajaxurl,
1977
+ type: 'POST',
1978
+ data: {
1979
+ action : 'astra-sites-delete-posts',
1980
+ post_id : post_id,
1981
+ _ajax_nonce : astraSitesVars._ajax_nonce,
1982
+ },
1983
+ success: function( result ){
1984
+
1985
+ if( AstraSitesAdmin.reset_processed_posts < AstraSitesAdmin.site_imported_data['reset_posts'].length ) {
1986
+ AstraSitesAdmin.reset_processed_posts+=1;
1987
+ }
1988
+
1989
+ AstraSitesAdmin._log_title( 'Deleting Post ' + AstraSitesAdmin.reset_processed_posts + ' of ' + AstraSitesAdmin.site_imported_data['reset_posts'].length + '<br/>' + result.data );
1990
+
1991
+ AstraSitesAdmin.reset_remaining_posts-=1;
1992
+ if( 0 == AstraSitesAdmin.reset_remaining_posts ) {
1993
+ console.groupEnd();
1994
+ $(document).trigger( 'astra-sites-delete-posts-done' );
1995
+ $(document).trigger( 'astra-sites-reset-data-done' );
1996
+ }
1997
+ }
1998
+ });
1999
+ });
2000
+ AstraSitesAjaxQueue.run();
2001
+
2002
+ } else {
2003
+ $(document).trigger( 'astra-sites-delete-posts-done' );
2004
+ $(document).trigger( 'astra-sites-reset-data-done' );
2005
+ }
2006
+ },
2007
+
2008
+ _reset_wp_forms: function() {
2009
+ if( AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
2010
+ AstraSitesAdmin.reset_remaining_wp_forms = AstraSitesAdmin.site_imported_data['reset_wp_forms'].length;
2011
+
2012
+ console.groupCollapsed( 'Deleting WP Forms' );
2013
+ AstraSitesAdmin._log_title( 'Deleting WP Forms..' );
2014
+
2015
+ $.each( AstraSitesAdmin.site_imported_data['reset_wp_forms'], function(index, post_id) {
2016
+ AstraSitesAjaxQueue.add({
2017
+ url: astraSitesVars.ajaxurl,
2018
+ type: 'POST',
2019
+ data: {
2020
+ action : 'astra-sites-delete-wp-forms',
2021
+ post_id : post_id,
2022
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2023
+ },
2024
+ success: function( result ){
2025
+
2026
+ if( AstraSitesAdmin.reset_processed_wp_forms < AstraSitesAdmin.site_imported_data['reset_wp_forms'].length ) {
2027
+ AstraSitesAdmin.reset_processed_wp_forms+=1;
2028
+ }
2029
+
2030
+ AstraSitesAdmin._log_title( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
2031
+ AstraSitesAdmin._log( 'Deleting Form ' + AstraSitesAdmin.reset_processed_wp_forms + ' of ' + AstraSitesAdmin.site_imported_data['reset_wp_forms'].length + '<br/>' + result.data );
2032
+
2033
+ AstraSitesAdmin.reset_remaining_wp_forms-=1;
2034
+ if( 0 == AstraSitesAdmin.reset_remaining_wp_forms ) {
2035
+ console.groupEnd();
2036
+ $(document).trigger( 'astra-sites-delete-wp-forms-done' );
2037
+ }
2038
+ }
2039
+ });
2040
+ });
2041
+ AstraSitesAjaxQueue.run();
2042
+
2043
+ } else {
2044
+ $(document).trigger( 'astra-sites-delete-wp-forms-done' );
2045
+ }
2046
+ },
2047
+
2048
+ _reset_terms: function() {
2049
+
2050
+ if( AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
2051
+ AstraSitesAdmin.reset_remaining_terms = AstraSitesAdmin.site_imported_data['reset_terms'].length;
2052
+
2053
+ console.groupCollapsed( 'Deleting Terms' );
2054
+ AstraSitesAdmin._log_title( 'Deleting Terms..' );
2055
+
2056
+ $.each( AstraSitesAdmin.site_imported_data['reset_terms'], function(index, term_id) {
2057
+ AstraSitesAjaxQueue.add({
2058
+ url: astraSitesVars.ajaxurl,
2059
+ type: 'POST',
2060
+ data: {
2061
  action : 'astra-sites-delete-terms',
2062
  term_id : term_id,
2063
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2064
  },
2065
  success: function( result ){
2066
  if( AstraSitesAdmin.reset_processed_terms < AstraSitesAdmin.site_imported_data['reset_terms'].length ) {
2068
  }
2069
 
2070
  AstraSitesAdmin._log_title( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
2071
+ AstraSitesAdmin._log( 'Deleting Term ' + AstraSitesAdmin.reset_processed_terms + ' of ' + AstraSitesAdmin.site_imported_data['reset_terms'].length + '<br/>' + result.data );
2072
 
2073
  AstraSitesAdmin.reset_remaining_terms-=1;
2074
  if( 0 == AstraSitesAdmin.reset_remaining_terms ) {
2075
+ console.groupEnd();
2076
  $(document).trigger( 'astra-sites-delete-terms-done' );
2077
  }
2078
  }
2079
  });
2080
  });
2081
  AstraSitesAjaxQueue.run();
 
2082
  } else {
2083
  $(document).trigger( 'astra-sites-delete-terms-done' );
2084
  }
2093
  }
2094
  },
2095
 
2096
+ _toggle_theme_notice: function() {
2097
+ var astra_dependent_plugins = [ 'astra-addon' ];
 
 
2098
 
2099
+ if( AstraSitesAdmin.isEmpty( AstraSitesAdmin.required_plugins_original_list ) ) {
2100
+ AstraSitesAdmin.required_plugins_original_list = astraSitesVars.requiredPlugins;
2101
+ }
 
2102
 
2103
+ var plugins = AstraSitesAdmin.required_plugins_original_list;
2104
+
2105
+ $( this ).parents( '.astra-site-contents' ).addClass( 'required-plugins-count-' + $('.astra-sites-import-plugins .required-plugins-list > li').length );
2106
+
2107
+ if ( $( this ).is(':checked') ) {
 
 
 
 
 
 
 
 
 
 
 
2108
 
2109
+ $('#astra-sites-tooltip-theme-activation').hide();
2110
+ $('.astra-site-contents .astra-theme-module').show();
2111
+ $( this ).parents( '.astra-site-contents' ).removeClass( 'dont-use-astra-theme' );
2112
 
2113
+ astraSitesVars.requiredPlugins = plugins;
 
 
 
2114
 
2115
+ } else {
2116
+ $( this ).parents( '.astra-site-contents' ).addClass( 'dont-use-astra-theme' );
2117
+ $('#astra-sites-tooltip-theme-activation').show();
2118
+ $('.astra-site-contents .astra-theme-module').hide();
2119
+
2120
+ var new_plugins = [];
2121
+ for( plugin_group in plugins ) {
2122
+ var temp = [];
2123
+ for( key in plugins[ plugin_group ] ) {
2124
+ if( ! astra_dependent_plugins.includes( plugins[ plugin_group ][ key ].slug ) ) {
2125
+ temp.push( plugins[ plugin_group ][ key ] );
2126
+ }
2127
+ }
2128
+ new_plugins[ plugin_group ] = temp;
2129
+ }
2130
 
2131
+ astraSitesVars.requiredPlugins = new_plugins;
2132
+ }
2133
+ },
2134
 
2135
+ _backup_before_rest_options: function() {
2136
+ AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-before-reset-done' );
2137
+ AstraSitesAdmin.backup_taken = true;
2138
+ },
2139
 
2140
+ _recheck_backup_options: function() {
2141
+ AstraSitesAdmin._backupOptions( 'astra-sites-backup-settings-done' );
2142
+ AstraSitesAdmin.backup_taken = true;
2143
+ },
2144
 
2145
+ _backupOptions: function( trigger_name ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2146
 
2147
+ // Customizer backup is already taken then return.
2148
+ if( AstraSitesAdmin.backup_taken ) {
2149
+ $( document ).trigger( trigger_name );
2150
+ } else {
2151
 
2152
+ $.ajax({
2153
+ url : astraSitesVars.ajaxurl,
2154
+ type : 'POST',
2155
+ data : {
2156
+ action : 'astra-sites-backup-settings',
2157
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2158
+ },
2159
+ beforeSend: function() {
2160
+ console.groupCollapsed( 'Processing Customizer Settings Backup' );
2161
+ AstraSitesAdmin._log_title( 'Processing Customizer Settings Backup..' );
2162
+ // console.log( '# Processing Customizer Settings Backup..' );
2163
+ },
2164
+ })
2165
+ .fail(function( jqXHR ){
2166
+ AstraSitesAdmin._log( jqXHR );
2167
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Backup Customizer Settings Failed!' );
2168
+ console.groupEnd();
2169
+ })
2170
+ .done(function ( data ) {
2171
+ AstraSitesAdmin._log( data );
2172
 
2173
  // 1. Pass - Import Customizer Options.
2174
+ AstraSitesAdmin._log_title( 'Customizer Settings Backup Done..' );
2175
+
2176
+ console.groupEnd();
2177
+ // Custom trigger.
2178
+ $(document).trigger( trigger_name );
2179
+ });
2180
+ }
2181
 
 
 
 
2182
  },
2183
 
2184
  /**
2187
  _importEnd: function( event ) {
2188
 
2189
  $.ajax({
2190
+ url : astraSitesVars.ajaxurl,
2191
  type : 'POST',
2192
  dataType: 'json',
2193
  data : {
2194
  action : 'astra-sites-import-end',
2195
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2196
  },
2197
  beforeSend: function() {
2198
+ console.groupCollapsed( 'Import Complete!' );
2199
  AstraSitesAdmin._log_title( 'Import Complete!' );
2200
+ // console.groupCollapsed( 'Import Complete!' );
2201
  }
2202
  })
2203
  .fail(function( jqXHR ){
2204
+ AstraSitesAdmin._log( jqXHR );
2205
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import Complete Failed!' );
2206
+ console.groupEnd();
2207
  })
2208
+ .done(function ( response ) {
2209
+ AstraSitesAdmin._log( response );
2210
+ console.groupEnd();
2211
 
2212
  // 5. Fail - Import Complete.
2213
+ if( false === response.success ) {
2214
+ AstraSitesAdmin._importFailMessage( response.data, 'Import Complete Failed!' );
2215
  } else {
2216
 
2217
  $('body').removeClass('importing-site');
 
 
 
 
 
 
 
 
 
 
 
2218
 
2219
+ var template = wp.template('astra-sites-site-import-success');
2220
+ $('.astra-sites-result-preview .inner').html( template() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2221
 
2222
  $('.rotating,.current-importing-status-wrap,.notice-warning').remove();
2223
+ $('.astra-sites-result-preview').addClass('astra-sites-result-preview');
2224
 
2225
  // 5. Pass - Import Complete.
2226
  AstraSitesAdmin._importSuccessButton();
2234
  _importWidgets: function( event ) {
2235
  if ( AstraSitesAdmin._is_process_widgets() ) {
2236
  $.ajax({
2237
+ url : astraSitesVars.ajaxurl,
2238
  type : 'POST',
2239
  dataType: 'json',
2240
  data : {
2241
  action : 'astra-sites-import-widgets',
2242
  widgets_data : AstraSitesAdmin.widgets_data,
2243
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2244
  },
2245
  beforeSend: function() {
2246
+ console.groupCollapsed( 'Importing Widgets' );
2247
  AstraSitesAdmin._log_title( 'Importing Widgets..' );
2248
  },
2249
  })
2250
  .fail(function( jqXHR ){
2251
+ AstraSitesAdmin._log( jqXHR );
2252
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import Widgets Failed!' );
2253
+ console.groupEnd();
2254
  })
2255
+ .done(function ( response ) {
2256
+ AstraSitesAdmin._log( response );
2257
+ console.groupEnd();
2258
 
2259
  // 4. Fail - Import Widgets.
2260
+ if( false === response.success ) {
2261
+ AstraSitesAdmin._importFailMessage( response.data, 'Import Widgets Failed!' );
2262
 
2263
  } else {
2264
+
2265
  // 4. Pass - Import Widgets.
2266
+ $(document).trigger( 'astra-sites-import-widgets-done' );
 
2267
  }
2268
  });
2269
  } else {
2274
  /**
2275
  * 3. Import Site Options.
2276
  */
2277
+ import_siteOptions: function( event ) {
2278
 
2279
  if ( AstraSitesAdmin._is_process_xml() ) {
2280
  $.ajax({
2281
+ url : astraSitesVars.ajaxurl,
2282
  type : 'POST',
2283
  dataType: 'json',
2284
  data : {
2285
  action : 'astra-sites-import-options',
2286
  options_data : AstraSitesAdmin.options_data,
2287
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2288
  },
2289
  beforeSend: function() {
2290
+ console.groupCollapsed( 'Importing Options' );
2291
  AstraSitesAdmin._log_title( 'Importing Options..' );
2292
  $('.astra-demo-import .percent').html('');
2293
  },
2294
  })
2295
  .fail(function( jqXHR ){
2296
+ AstraSitesAdmin._log( jqXHR );
2297
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import Site Options Failed!' );
2298
+ console.groupEnd();
2299
  })
2300
+ .done(function ( response ) {
2301
+ AstraSitesAdmin._log( response );
2302
  // 3. Fail - Import Site Options.
2303
+ if( false === response.success ) {
2304
+ AstraSitesAdmin._importFailMessage( response.data, 'Import Site Options Failed!' );
2305
+ console.groupEnd();
2306
  } else {
2307
+ console.groupEnd();
2308
 
2309
  // 3. Pass - Import Site Options.
2310
  $(document).trigger( 'astra-sites-import-options-done' );
2311
  }
2312
  });
2313
  } else {
2314
+ $(document).trigger( 'astra-sites-import-options-done' );
2315
  }
2316
  },
2317
 
2322
 
2323
  if ( AstraSitesAdmin._is_process_xml() ) {
2324
  $.ajax({
2325
+ url : astraSitesVars.ajaxurl,
2326
  type : 'POST',
2327
  dataType: 'json',
2328
  data : {
2329
  action : 'astra-sites-import-prepare-xml',
2330
+ wxr_url : AstraSitesAdmin.wxr_url,
2331
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2332
  },
2333
  beforeSend: function() {
2334
+ console.groupCollapsed( 'Importing Content' );
2335
  AstraSitesAdmin._log_title( 'Importing Content..' );
2336
+ AstraSitesAdmin._log( AstraSitesAdmin.wxr_url );
2337
+ $('.astra-site-import-process-wrap').show();
2338
  },
2339
  })
2340
  .fail(function( jqXHR ){
2341
+ AstraSitesAdmin._log( jqXHR );
2342
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Prepare Import XML Failed!' );
2343
+ console.groupEnd();
2344
  })
2345
+ .done(function ( response ) {
2346
 
2347
+ AstraSitesAdmin._log( response );
2348
+
2349
+ response.data.url = wp.url.addQueryArgs( response.data.url, { _ajax_nonce: astraSitesVars._ajax_nonce } )
2350
 
2351
  // 2. Fail - Prepare XML Data.
2352
+ if( false === response.success ) {
2353
+ var error_msg = response.data.error || response.data;
2354
+
2355
+ AstraSitesAdmin._importFailMessage( 'Some of the files required during the import process are missing.<br/><br/>Please try again after some time.' );
2356
 
2357
+ console.groupEnd();
2358
  } else {
2359
 
2360
  var xml_processing = $('.astra-demo-import').attr( 'data-xml-processing' );
2368
  // 2. Pass - Prepare XML Data.
2369
 
2370
  // Import XML though Event Source.
2371
+ AstraSSEImport.data = response.data;
2372
  AstraSSEImport.render();
2373
 
2374
  $('.current-importing-status-description').html('').show();
2375
 
2376
+ $('.current-importing-status-wrap').append('<div class="astra-site-import-process-wrap"><progress class="astra-site-import-process" max="100" value="0"></progress></div>');
2377
+
2378
  var evtSource = new EventSource( AstraSSEImport.data.url );
2379
  evtSource.onmessage = function ( message ) {
2380
  var data = JSON.parse( message.data );
2393
  document.getElementsByClassName("astra-site-import-process").value = '100';
2394
 
2395
  $('.astra-site-import-process-wrap').hide();
2396
+ console.groupEnd();
2397
 
2398
  $(document).trigger( 'astra-sites-import-xml-done' );
2399
 
2400
  break;
2401
  }
2402
  };
2403
+ evtSource.onerror = function( error ) {
2404
+ AstraSitesAdmin._importFailMessage('', 'Import Process Interrupted');
2405
+ };
2406
  evtSource.addEventListener( 'log', function ( message ) {
2407
  var data = JSON.parse( message.data );
2408
  var message = data.message || '';
2412
  });
2413
  $('.current-importing-status-description').html( message );
2414
  }
2415
+ AstraSitesAdmin._log( message, data.level );
2416
  });
2417
  }
2418
  });
2419
  } else {
2420
  $(document).trigger( 'astra-sites-import-xml-done' );
2421
  }
2422
+ },
2423
 
2424
+ _is_reset_data: function() {
2425
+ if ( $( '.astra-sites-reset-data' ).find('.checkbox').is(':checked') ) {
2426
+ return true;
2427
+ }
2428
+ return false;
2429
  },
2430
 
2431
  _is_process_xml: function() {
2436
  },
2437
 
2438
  _is_process_customizer: function() {
2439
+ var theme_status = $( '.astra-sites-theme-activation .checkbox' ).length ? $( '.astra-sites-theme-activation .checkbox' ).is(':checked') : true;
2440
+ var customizer_status = $( '.astra-sites-import-customizer' ).find('.checkbox').is(':checked');
2441
+
2442
+ if ( theme_status && customizer_status ) {
2443
  return true;
2444
  }
2445
  return false;
2452
  return false;
2453
  },
2454
 
2455
+ _startImportCartFlows: function( event ) {
2456
+ if ( AstraSitesAdmin._is_process_xml() && '' !== AstraSitesAdmin.cartflows_url ) {
2457
+
2458
+ $.ajax({
2459
+ url : astraSitesVars.ajaxurl,
2460
+ type : 'POST',
2461
+ dataType: 'json',
2462
+ data : {
2463
+ action : 'astra-sites-import-cartflows',
2464
+ cartflows_url : AstraSitesAdmin.cartflows_url,
2465
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2466
+ },
2467
+ beforeSend: function() {
2468
+ console.groupCollapsed( 'Importing Flows & Steps' );
2469
+ AstraSitesAdmin._log_title( 'Importing Flows & Steps..' );
2470
+ AstraSitesAdmin._log( AstraSitesAdmin.cartflows_url );
2471
+ },
2472
+ })
2473
+ .fail(function( jqXHR ){
2474
+ AstraSitesAdmin._log( jqXHR );
2475
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import Cartflows Flow Failed!' );
2476
+ console.groupEnd();
2477
+ })
2478
+ .done(function ( response ) {
2479
+ AstraSitesAdmin._log( response );
2480
+
2481
+ // 1. Fail - Import WPForms Options.
2482
+ if( false === response.success ) {
2483
+ AstraSitesAdmin._importFailMessage( response.data, 'Import Cartflows Flow Failed!' );
2484
+ console.groupEnd();
2485
+ } else {
2486
+ console.groupEnd();
2487
+ // 1. Pass - Import Customizer Options.
2488
+ $(document).trigger( AstraSitesAdmin.action_slug + '-import-cartflows-done' );
2489
+ }
2490
+ });
2491
+
2492
+ } else {
2493
+ $(document).trigger( AstraSitesAdmin.action_slug + '-import-cartflows-done' );
2494
+ }
2495
+
2496
+ },
2497
+
2498
+ _startImportWPForms: function( event ) {
2499
+
2500
+ if ( AstraSitesAdmin._is_process_xml() && '' !== AstraSitesAdmin.wpforms_url ) {
2501
+
2502
  $.ajax({
2503
+ url : astraSitesVars.ajaxurl,
2504
  type : 'POST',
2505
  dataType: 'json',
2506
  data : {
2507
  action : 'astra-sites-import-wpforms',
2508
  wpforms_url : AstraSitesAdmin.wpforms_url,
2509
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2510
  },
2511
  beforeSend: function() {
2512
+ console.groupCollapsed( 'Importing WP Forms' );
2513
  AstraSitesAdmin._log_title( 'Importing WP Forms..' );
2514
+ AstraSitesAdmin._log( AstraSitesAdmin.wpforms_url );
2515
  },
2516
  })
2517
  .fail(function( jqXHR ){
2518
+ AstraSitesAdmin._log( jqXHR );
2519
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import WP Forms Failed!' );
2520
+ console.groupEnd();
2521
  })
2522
+ .done(function ( response ) {
2523
+ AstraSitesAdmin._log( response );
2524
 
2525
  // 1. Fail - Import WPForms Options.
2526
+ if( false === response.success ) {
2527
+ AstraSitesAdmin._importFailMessage( response.data, 'Import WP Forms Failed!' );
2528
+ console.groupEnd();
2529
  } else {
2530
+ console.groupEnd();
2531
  // 1. Pass - Import Customizer Options.
2532
+ $(document).trigger( AstraSitesAdmin.action_slug + '-import-wpforms-done' );
2533
  }
2534
  });
2535
+
2536
  } else {
2537
+ $(document).trigger( AstraSitesAdmin.action_slug + '-import-wpforms-done' );
2538
  }
2539
+
2540
  },
2541
 
2542
  /**
2545
  _importCustomizerSettings: function( event ) {
2546
  if ( AstraSitesAdmin._is_process_customizer() ) {
2547
  $.ajax({
2548
+ url : astraSitesVars.ajaxurl,
2549
  type : 'POST',
2550
  dataType: 'json',
2551
  data : {
2552
  action : 'astra-sites-import-customizer-settings',
2553
  customizer_data : AstraSitesAdmin.customizer_data,
2554
+ _ajax_nonce : astraSitesVars._ajax_nonce,
2555
  },
2556
  beforeSend: function() {
2557
+ console.groupCollapsed( 'Importing Customizer Settings');
2558
+ AstraSitesAdmin._log_title( 'Importing Customizer Settings..');
2559
+ AstraSitesAdmin._log( JSON.parse( AstraSitesAdmin.customizer_data ) );
2560
  },
2561
  })
2562
  .fail(function( jqXHR ){
2563
+ AstraSitesAdmin._log( jqXHR );
2564
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Import Customizer Settings Failed!' );
2565
+ console.groupEnd();
2566
  })
2567
+ .done(function ( response ) {
2568
+ AstraSitesAdmin._log( response );
2569
 
2570
  // 1. Fail - Import Customizer Options.
2571
+ if( false === response.success ) {
2572
+ AstraSitesAdmin._importFailMessage( response.data, 'Import Customizer Settings Failed!' );
2573
+ console.groupEnd();
2574
  } else {
2575
+ console.groupEnd();
2576
  // 1. Pass - Import Customizer Options.
2577
  $(document).trigger( 'astra-sites-import-customizer-settings-done' );
2578
  }
2585
 
2586
  /**
2587
  * Import Success Button.
2588
+ *
2589
  * @param {string} data Error message.
2590
  */
2591
  _importSuccessButton: function() {
2594
  .removeAttr('data-import')
2595
  .addClass('view-site')
2596
  .removeClass('astra-demo-import')
2597
+ .text( astraSitesVars.strings.viewSite )
2598
  .attr('target', '_blank')
2599
  .append('<i class="dashicons dashicons-external"></i>')
2600
+ .attr('href', astraSitesVars.siteURL );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2601
  },
2602
 
2603
  /**
2604
  * Import Error Button.
2605
+ *
2606
  * @param {string} data Error message.
2607
  */
2608
+ _importFailMessage: function( message, heading ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2609
 
2610
+ var output = '<p>Your website is facing a temporary issue in connecting the template server.</p>';
2611
+ output += '<p>Read <a href="https://wpastra.com/docs/import-process-interrupted/" target="_blank">article</a> to resolve the issue and continue importing template.</p>';
2612
 
2613
+ heading = heading || 'The import process interrupted';
 
 
 
 
 
 
 
2614
 
2615
+ if( message ) {
2616
+ output += '<p class="current-importing-status">Error: ' + message +'</p>';
 
 
 
 
 
 
 
2617
  }
2618
+
2619
+ $('.astra-sites-import-content').html( output );
2620
+ $('.astra-sites-result-preview .heading h3').html( heading );
2621
 
2622
+ $('.astra-demo-import').removeClass('updating-message installing button-primary').addClass('disabled').text('Import Failed!');
 
 
 
 
2623
  },
2624
 
2625
  ucwords: function( str ) {
2645
 
2646
  event.preventDefault();
2647
 
2648
+ console.groupEnd();
 
 
 
 
 
 
 
2649
 
2650
  // Reset not installed plugins list.
2651
+ var pluginsList = astraSitesVars.requiredPlugins.notinstalled;
2652
+ astraSitesVars.requiredPlugins.notinstalled = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
2653
 
2654
  // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
2655
  setTimeout( function() {
2656
 
2657
+ console.groupCollapsed('Activating Plugin "' + response.name + '"' );
2658
+
2659
+ AstraSitesAdmin._log_title( 'Activating Plugin - ' + response.name );
2660
+ AstraSitesAdmin._log( 'Activating Plugin - ' + response.name );
2661
 
2662
  $.ajax({
2663
+ url: astraSitesVars.ajaxurl,
2664
  type: 'POST',
2665
  data: {
2666
  'action' : 'astra-required-plugin-activate',
2667
+ 'init' : response.init,
2668
+ 'options' : AstraSitesAdmin.options_data,
2669
+ 'enabledExtensions' : AstraSitesAdmin.enabled_extensions,
2670
+ '_ajax_nonce' : astraSitesVars._ajax_nonce,
2671
  },
2672
  })
2673
  .done(function (result) {
2674
+ AstraSitesAdmin._log( result );
2675
 
2676
  if( result.success ) {
2677
+ var pluginsList = astraSitesVars.requiredPlugins.inactive;
2678
 
2679
+ AstraSitesAdmin._log_title( 'Successfully Activated Plugin - ' + response.name );
2680
+ AstraSitesAdmin._log( 'Successfully Activated Plugin - ' + response.name );
2681
 
2682
  // Reset not installed plugins list.
2683
+ astraSitesVars.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
2684
 
2685
  // Enable Demo Import Button
2686
  AstraSitesAdmin._enable_demo_import_button();
 
2687
  }
2688
+ console.groupEnd();
2689
  });
2690
 
2691
  }, 1200 );
2697
  */
2698
  _installError: function( event, response ) {
2699
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2700
  event.preventDefault();
2701
 
2702
+ console.log( event );
2703
+ console.log( response );
 
 
 
 
 
 
 
 
 
 
 
2704
 
2705
+ $('.astra-sites-result-preview .heading h3').text( 'Plugin Installation Failed' );
2706
+ $('.astra-sites-import-content').html( '<p>Plugin "<b>' + response.name + '</b>" installation failed.</p><p>There has been an error on your website. Read an article <a href="https://wpastra.com/docs/starter-templates-plugin-installation-failed/" target="blank">here</a> to solve the issue.</p>' );
2707
 
2708
+ $('.astra-demo-import').removeClass('updating-message installing button-primary').addClass('disabled').text('Import Failed!');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2709
 
2710
+ wp.updates.queue = [];
 
2711
 
2712
+ wp.updates.queueChecker();
 
 
 
 
2713
 
2714
+ console.groupEnd();
2715
  },
2716
 
2717
  /**
2718
+ * Installing Plugin
2719
  */
2720
+ _pluginInstalling: function(event, args) {
2721
  event.preventDefault();
2722
 
2723
+ console.groupCollapsed('Installing Plugin "'+args.name+'"');
2724
+
2725
+ AstraSitesAdmin._log_title( 'Installing Plugin - ' + args.name );
 
 
2726
 
2727
+ console.log( args );
 
 
 
 
 
2728
  },
2729
 
2730
  /**
2732
  */
2733
  _bulkPluginInstallActivate: function()
2734
  {
2735
+ if( 0 === Object.keys( astraSitesVars.requiredPlugins ).length ) {
2736
  return;
2737
  }
2738
 
2739
+ // If has class the skip-plugins then,
2740
+ // Avoid installing 3rd party plugins.
2741
+ var not_installed = astraSitesVars.requiredPlugins.notinstalled || '';
2742
+ if( $('.astra-sites-result-preview').hasClass('skip-plugins') ) {
2743
+ not_installed = [];
2744
+ }
2745
+ var activate_plugins = astraSitesVars.requiredPlugins.inactive || '';
2746
 
2747
  // First Install Bulk.
2748
  if( not_installed.length > 0 ) {
2765
  */
2766
  _activateAllPlugins: function( activate_plugins ) {
2767
 
2768
+ AstraSitesAdmin.remaining_activate_plugins = activate_plugins.length;
2769
 
2770
  $.each( activate_plugins, function(index, single_plugin) {
2771
 
 
 
 
 
 
2772
  AstraSitesAjaxQueue.add({
2773
+ url: astraSitesVars.ajaxurl,
2774
  type: 'POST',
2775
  data: {
2776
  'action' : 'astra-required-plugin-activate',
2777
  'init' : single_plugin.init,
2778
+ 'options' : AstraSitesAdmin.options_data,
2779
+ 'enabledExtensions' : AstraSitesAdmin.enabled_extensions,
2780
+ '_ajax_nonce' : astraSitesVars._ajax_nonce,
2781
+ },
2782
+ beforeSend: function() {
2783
+ console.groupCollapsed( 'Activating Plugin "' + single_plugin.name + '"' );
2784
+ AstraSitesAdmin._log_title( 'Activating Plugin "' + single_plugin.name + '"' );
2785
  },
2786
  success: function( result ){
2787
+ console.log( result );
2788
+ console.groupEnd( 'Activating Plugin "' + single_plugin.name + '"' );
2789
 
2790
  if( result.success ) {
2791
+ var pluginsList = astraSitesVars.requiredPlugins.inactive;
 
2792
 
2793
  // Reset not installed plugins list.
2794
+ astraSitesVars.requiredPlugins.inactive = AstraSitesAdmin._removePluginFromQueue( single_plugin.slug, pluginsList );
2795
 
2796
  // Enable Demo Import Button
2797
  AstraSitesAdmin._enable_demo_import_button();
2798
+ }
2799
+
2800
+ AstraSitesAdmin.remaining_activate_plugins-=1;
2801
+
2802
+ if( 0 === AstraSitesAdmin.remaining_activate_plugins ) {
2803
+ console.groupEnd( 'Activating Required Plugins..' );
2804
  }
2805
  }
2806
  });
2813
  */
2814
  _installAllPlugins: function( not_installed ) {
2815
 
 
 
2816
  $.each( not_installed, function(index, single_plugin) {
2817
 
 
 
 
 
2818
  // Add each plugin activate request in Ajax queue.
2819
  // @see wp-admin/js/updates.js
2820
  wp.updates.queue.push( {
2821
  action: 'install-plugin', // Required action.
2822
  data: {
2823
+ slug: single_plugin.slug,
2824
+ init: single_plugin.init,
2825
+ name: single_plugin.name,
2826
+ success: function() {
2827
+ $( document ).trigger( 'wp-plugin-install-success', [single_plugin] );
2828
+ },
2829
+ error: function() {
2830
+ $( document ).trigger( 'wp-plugin-install-error', [single_plugin] );
2831
+ },
2832
  }
2833
  } );
2834
  });
2837
  wp.updates.queueChecker();
2838
  },
2839
 
2840
+ _show_get_agency_bundle_notice: function(event) {
 
 
 
 
 
 
 
2841
  event.preventDefault();
2842
+ $('.astra-sites-result-preview')
2843
+ .removeClass('astra-sites-activate-license astra-sites-site-import-popup astra-sites-page-import-popup')
2844
+ .addClass('astra-sites-get-agency-bundle')
2845
+ .show();
2846
 
2847
+ var template = wp.template( 'astra-sites-pro-site-description' );
2848
+ var output = '<div class="overlay"></div>';
2849
+ output += '<div class="inner"><div class="heading"><h3>Liked This demo?</h3></div><span class="dashicons close dashicons-no-alt"></span><div class="astra-sites-import-content">';
2850
+ output += '</div></div>';
2851
+ $('.astra-sites-result-preview').html( output );
2852
+ $('.astra-sites-import-content').html( template );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2853
  },
2854
 
2855
+ _show_activate_license_notice: function(event) {
2856
 
2857
+ if( event ) {
2858
+ event.preventDefault();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2859
  }
2860
 
2861
+ if( ! AstraSitesAdmin._getParamFromURL('license') ) {
2862
+ var url_params = {
2863
+ 'license' : 'show'
2864
+ };
2865
+ AstraSitesAdmin._changeAndSetURL( url_params );
2866
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2867
 
2868
+ $('.astra-sites-result-preview')
2869
+ .removeClass('astra-sites-site-import-popup astra-sites-skip-templates astra-sites-page-import-popup')
2870
+ .addClass('astra-sites-activate-license')
2871
+ .show();
2872
 
2873
+ var template = wp.template( 'astra-sites-activate-license' );
2874
+ var output = '<div class="overlay"></div>';
2875
+ output += '<div class="inner"><div class="heading"><h3>Activate License for Premium Templates</h3></div><span class="dashicons close dashicons-no-alt"></span><div class="astra-sites-import-content">';
2876
+ output += '</div></div>';
2877
+ $('.astra-sites-result-preview').html( output );
2878
+ $('.astra-sites-import-content').html( template );
2879
+ },
2880
 
2881
+ _show_invalid_mini_agency_license: function(event) {
2882
+ event.preventDefault();
2883
+ $('.astra-sites-result-preview')
2884
+ .removeClass('astra-sites-activate-license astra-sites-site-import-popup astra-sites-skip-templates astra-sites-page-import-popup')
2885
+ .addClass('astra-sites-invalid-mini-agency-license')
2886
+ .show();
2887
 
2888
+ var template = wp.template( 'astra-sites-invalid-mini-agency-license' );
2889
+ var output = '<div class="overlay"></div>';
2890
+ output += '<div class="inner"><div class="heading"><h3>Not Valid License</h3></div><span class="dashicons close dashicons-no-alt"></span><div class="astra-sites-import-content">';
2891
+ output += '</div></div>';
2892
+ $('.astra-sites-result-preview').html( output );
2893
+ $('.astra-sites-import-content').html( template );
2894
+ },
2895
 
2896
+ _get_id: function( site_id ) {
2897
+ return site_id.replace('id-', '');
2898
  },
2899
 
2900
  /**
2901
+ * Fires when a nav item is clicked.
2902
+ *
2903
+ * @since 1.0
2904
+ * @access private
2905
+ * @method _show_site_popup
2906
  */
2907
+ _show_site_popup: function(event) {
2908
  event.preventDefault();
2909
 
2910
+ if( $( this ).hasClass('updating-message') ) {
 
 
 
 
2911
  return;
2912
  }
2913
 
2914
+ $('.astra-sites-result-preview').addClass('import-site').removeClass('import-page');
 
 
 
 
 
2915
 
2916
+ $('.astra-sites-result-preview')
2917
+ .removeClass('astra-sites-get-agency-bundle preview-page-from-search-result astra-sites-page-import-popup astra-sites-activate-license')
2918
+ .addClass('astra-sites-site-import-popup')
2919
+ .show();
 
2920
 
2921
+ var template = wp.template( 'astra-sites-result-preview' );
2922
+ $('.astra-sites-result-preview').html( template( 'astra-sites' ) ).addClass('preparing');
2923
+ $('.astra-sites-import-content').append( '<div class="astra-loading-wrap"><div class="astra-loading-icon"></div></div>' );
 
2924
 
2925
+ // .attr('data-slug', 'astra-sites');
2926
+ AstraSitesAdmin.action_slug = 'astra-sites';
2927
+ astraSitesVars.cpt_slug = 'astra-sites';
2928
 
2929
+ var site_id = $('#site-pages').attr( 'data-site-id') || '';
2930
+ site_id = AstraSitesAdmin._get_id( site_id );
2931
 
2932
+ // AstraSitesAdmin.required_plugins_list_markup();
2933
+ if( AstraSitesAdmin.visited_sites_and_pages[ site_id ] ) {
2934
 
2935
+ AstraSitesAdmin.templateData = AstraSitesAdmin.visited_sites_and_pages[ site_id ];
 
 
 
 
2936
 
2937
+ AstraSitesAdmin.process_site_data( AstraSitesAdmin.templateData );
2938
+ } else {
2939
 
 
 
 
 
 
 
 
 
 
2940
 
2941
+ // AstraSitesAdmin.templateData
2942
+ // Add Params for API request.
2943
+ AstraSitesAdmin._api_params = {};
2944
+
2945
+ AstraSitesAdmin._apiAddParam_status();
2946
+ // AstraSitesAdmin._apiAddParam_search();
2947
+ // AstraSitesAdmin._apiAddParam_per_page();
2948
+ AstraSitesAdmin._apiAddParam_astra_site_category();
2949
+ // AstraSitesAdmin._apiAddParam_page();
2950
+ AstraSitesAdmin._apiAddParam_astra_site_page_builder();
2951
+ AstraSitesAdmin._apiAddParam_astra_page_parent_category();
2952
+ AstraSitesAdmin._apiAddParam_site_url();
2953
+ AstraSitesAdmin._apiAddParam_purchase_key();
2954
+ var api_post = {
2955
+ id: astraSitesVars.cpt_slug,
2956
+ slug: astraSitesVars.cpt_slug + '/' + site_id + '?' + decodeURIComponent( $.param( AstraSitesAdmin._api_params ) ),
2957
+ };
2958
+ // AstraSitesAPI._api_single_request( api_post, function( data ) {
2959
+ // AstraSitesAdmin.visited_sites_and_pages[ data.id ] = data;
2960
+
2961
+ // AstraSitesAdmin.templateData = data;
2962
+
2963
+ // AstraSitesAdmin.process_site_data( AstraSitesAdmin.templateData );
2964
+ // } );
2965
+
2966
+ $.ajax({
2967
+ url : astraSitesVars.ajaxurl,
2968
+ type : 'POST',
2969
+ data : {
2970
+ action : 'astra-sites-api-request',
2971
+ url : astraSitesVars.cpt_slug + '/' + site_id + '?' + decodeURIComponent( $.param( AstraSitesAdmin._api_params ) ),
2972
+ },
2973
+ beforeSend: function() {
2974
+ console.groupCollapsed('Requesting API');
2975
+ }
2976
+ })
2977
+ .fail(function( jqXHR ){
2978
+ AstraSitesAdmin._log( jqXHR );
2979
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText );
2980
+ console.groupEnd();
2981
+ })
2982
+ .done(function ( response ) {
2983
+ console.log('Template API Response:');
2984
+ AstraSitesAdmin._log( response );
2985
+ console.groupEnd();
2986
+ if( response.success ) {
2987
+ AstraSitesAdmin.visited_sites_and_pages[ response.data.id ] = response.data;
2988
 
2989
+ AstraSitesAdmin.templateData = response.data;
 
2990
 
2991
+ AstraSitesAdmin.process_site_data( AstraSitesAdmin.templateData );
2992
+ } else {
2993
+ $('.astra-sites-result-preview .inner > h3').text('Import Process Interrupted');
2994
+ $('.astra-sites-import-content').find( '.astra-loading-wrap' ).remove();
2995
+ $('.astra-sites-result-preview').removeClass('preparing');
2996
+ $('.astra-sites-import-content').html( wp.template( 'astra-sites-request-failed' ) );
2997
+ $('.astra-demo-import').removeClass('updating-message installing button-primary').addClass('disabled').text('Import Failed!');
2998
+ }
2999
+ });
3000
  }
3001
 
 
3002
  },
3003
 
3004
+ show_popup: function( heading, content, actions, classes ) {
3005
+ if( classes ) {
3006
+ $('.astra-sites-popup').addClass( classes );
3007
+ }
3008
+ if( heading ) {
3009
+ $('.astra-sites-popup .heading h3').html( heading );
3010
+ }
3011
+ if( content ) {
3012
+ $('.astra-sites-popup .astra-sites-import-content').html( content );
3013
+ }
3014
+ if( actions ) {
3015
+ $('.astra-sites-popup .ast-actioms-wrap').html( actions );
3016
  }
3017
 
3018
+ $('.astra-sites-popup').show();
 
3019
  },
3020
 
3021
+ hide_popup: function() {
3022
+ $('.astra-sites-popup').hide();
3023
+ },
 
 
 
3024
 
3025
+ show_page_popup: function() {
3026
 
3027
+ AstraSitesAdmin.process_import_page();
3028
+ },
3029
 
3030
+ process_import_page: function() {
3031
+ AstraSitesAdmin.hide_popup();
3032
 
3033
+ var page_id = AstraSitesAdmin._get_id( $( '#single-pages' ).find('.current_page').attr('data-page-id') ) || '';
3034
+ var site_id = AstraSitesAdmin._get_id( $('#site-pages').attr( 'data-site-id') ) || '';
 
3035
 
3036
+ $('.astra-sites-result-preview')
3037
+ .removeClass('astra-sites-activate-license astra-sites-get-agency-bundle astra-sites-site-import-popup astra-sites-page-import-popup')
3038
+ .addClass('preview-page-from-search-result')
3039
+ .show();
3040
 
3041
+ $('.astra-sites-result-preview').html( wp.template( 'astra-sites-result-preview' ) ).addClass('preparing');
3042
+ $('.astra-sites-import-content').append( '<div class="astra-loading-wrap"><div class="astra-loading-icon"></div></div>' );
3043
 
3044
+ // .attr('data-slug', 'site-pages');
3045
+ AstraSitesAdmin.action_slug = 'site-pages';
3046
+ astraSitesVars.cpt_slug = 'site-pages';
3047
 
3048
+ if( AstraSitesAdmin.visited_sites_and_pages[ page_id ] ) {
 
3049
 
3050
+ AstraSitesAdmin.templateData = AstraSitesAdmin.visited_sites_and_pages[ page_id ];
3051
+
3052
+ AstraSitesAdmin.required_plugins_list_markup( AstraSitesAdmin.templateData['site-pages-required-plugins'] );
3053
+ } else {
3054
 
3055
+ // AstraSitesAdmin.templateData
3056
+ // Add Params for API request.
3057
+ AstraSitesAdmin._api_params = {};
3058
+
3059
+ AstraSitesAdmin._apiAddParam_status();
3060
+ // AstraSitesAdmin._apiAddParam_search();
3061
+ AstraSitesAdmin._apiAddParam_per_page();
3062
+ AstraSitesAdmin._apiAddParam_astra_site_category();
3063
+ // AstraSitesAdmin._apiAddParam_page();
3064
+ AstraSitesAdmin._apiAddParam_astra_site_page_builder();
3065
+ AstraSitesAdmin._apiAddParam_astra_page_parent_category();
3066
+ AstraSitesAdmin._apiAddParam_site_url();
3067
+ AstraSitesAdmin._apiAddParam_purchase_key();
3068
+
3069
+ // Request.
3070
+ $.ajax({
3071
+ url : astraSitesVars.ajaxurl,
3072
+ type : 'POST',
3073
+ data : {
3074
+ action : 'astra-sites-api-request',
3075
+ url : astraSitesVars.cpt_slug + '/' + page_id + '?' + decodeURIComponent( $.param( AstraSitesAdmin._api_params ) ),
3076
+ },
3077
+ beforeSend: function() {
3078
+ console.groupCollapsed( 'Requesting API URL' );
3079
+ AstraSitesAdmin._log( 'Requesting API URL' );
3080
+ }
3081
+ })
3082
+ .fail(function( jqXHR ){
3083
+ AstraSitesAdmin._log( jqXHR );
3084
+ AstraSitesAdmin._importFailMessage( jqXHR.status + ' ' + jqXHR.statusText, 'Page Import API Request Failed!' );
3085
+ console.groupEnd();
3086
+ })
3087
+ .done(function ( response ) {
3088
+ AstraSitesAdmin._log( response );
3089
+ console.groupEnd();
3090
 
3091
+ if( response.success ) {
3092
+ AstraSitesAdmin.visited_sites_and_pages[ response.data.id ] = response.data;
3093
+
3094
+ AstraSitesAdmin.templateData = response.data;
3095
 
3096
+ AstraSitesAdmin.required_plugins_list_markup( AstraSitesAdmin.templateData['site-pages-required-plugins'] );
3097
+ } else {
3098
+ $('.astra-sites-result-preview .inner > h3').text('Import Process Interrupted');
3099
+ $('.astra-sites-import-content').find( '.astra-loading-wrap' ).remove();
3100
+ $('.astra-sites-result-preview').removeClass('preparing');
3101
+ $('.astra-sites-import-content').html( wp.template( 'astra-sites-request-failed' ) );
3102
+ $('.astra-demo-import').removeClass('updating-message installing button-primary').addClass('disabled').text('Import Failed!');
3103
+ }
3104
+ });
3105
  }
3106
+ },
3107
+
3108
+ show_page_popup_from_search: function(event) {
3109
+ event.preventDefault();
3110
+ var page_id = $( this ).parents( '.astra-theme' ).attr( 'data-page-id') || '';
3111
+ var site_id = $( this ).parents( '.astra-theme' ).attr( 'data-site-id') || '';
3112
 
3113
+ // $('.astra-sites-result-preview').show();
3114
+ $('#astra-sites').hide();
3115
+ $('#site-pages').hide();
3116
+ AstraSitesAdmin.show_pages_by_site_id( site_id, page_id );
3117
  },
3118
 
3119
  /**
3120
+ * Fires when a nav item is clicked.
3121
+ *
3122
+ * @since 1.0
3123
+ * @access private
3124
+ * @method show_page_popup
3125
  */
3126
+ show_page_popup_from_sites: function(event) {
3127
+ event.preventDefault();
 
 
3128
 
3129
+ if( $( this ).hasClass('updating-message') ) {
3130
+ return;
 
 
3131
  }
3132
 
3133
+ $('.astra-sites-result-preview').addClass('import-page').removeClass('import-site');
 
 
 
 
3134
 
3135
+ AstraSitesAdmin.show_page_popup();
3136
  },
3137
 
3138
+ // Returns if a value is an array
3139
+ _isArray: function(value) {
3140
+ return value && typeof value === 'object' && value.constructor === Array;
3141
+ },
3142
+
3143
+ add_skip_and_import_popups: function( templates ) {
3144
+ if( Object.keys( templates ).length ) {
3145
+ for( template_id in templates ) {
3146
+ var template = wp.template( template_id );
3147
+ var template_data = templates[template_id] || '';
3148
+ $('.astra-sites-result-preview .inner').append( template( template_data ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3149
  }
3150
+ $('.astra-sites-result-preview .inner > .default').addClass('hide-me');
3151
+ $('.astra-sites-result-preview .inner > .skip-and-import:not(:last-child)').addClass('hide-me');
3152
+ }
3153
+ },
3154
 
3155
+ required_plugins_list_markup: function( requiredPlugins ) {
3156
 
3157
+ // var requiredPlugins = AstraSitesAdmin.templateData['required_plugins'] || '';
3158
 
3159
+ if( '' === requiredPlugins ) {
3160
+ return;
3161
+ }
3162
 
3163
+ // or
3164
+ var $pluginsFilter = $( '#plugin-filter' );
3165
 
3166
+ // Add disabled class from import button.
3167
+ $('.astra-demo-import')
3168
+ .addClass('disabled not-click-able')
3169
+ .removeAttr('data-import');
3170
 
3171
+ $('.required-plugins').addClass('loading').html('<span class="spinner is-active"></span>');
 
 
 
 
 
 
 
 
 
 
 
 
3172
 
3173
+ // Required Required.
3174
+ $.ajax({
3175
+ url : astraSitesVars.ajaxurl,
3176
+ type : 'POST',
3177
+ data : {
3178
+ action : 'astra-required-plugins',
3179
+ _ajax_nonce : astraSitesVars._ajax_nonce,
3180
+ required_plugins : requiredPlugins,
3181
+ options : AstraSitesAdmin.options_data,
3182
+ enabledExtensions : AstraSitesAdmin.enabled_extensions,
3183
+ },
3184
+ beforeSend: function() {
3185
+ console.groupCollapsed( 'Required Plugins' );
3186
+ console.log( 'Required Plugins of Template:' );
3187
+ console.log( requiredPlugins );
3188
  }
3189
+ })
3190
+ .fail(function( jqXHR ){
3191
+ AstraSitesAdmin._log(jqXHR);
3192
 
3193
+ // Remove loader.
3194
+ $('.required-plugins').removeClass('loading').html('');
3195
+ AstraSitesAdmin._importFailMessage( jqXHR.status + jqXHR.statusText, 'Required Plugins Failed!' );
3196
+ console.groupEnd();
3197
+ })
3198
+ .done(function ( response ) {
3199
+ console.log( 'Required Plugin Status From The Site:' );
3200
+ AstraSitesAdmin._log(response);
3201
+ console.groupEnd();
3202
 
3203
+ if( false === response.success ) {
3204
+ AstraSitesAdmin._importFailMessage( response.data, 'Required Plugins Failed!' );
3205
+ } else {
3206
+ required_plugins = response.data['required_plugins'];
3207
 
3208
+ // Set compatibilities.
3209
+ var compatibilities = astraSitesVars.compatibilities;
3210
 
3211
+ AstraSitesAdmin.skip_and_import_popups = [];
 
 
 
 
 
 
3212
 
3213
+ AstraSitesAdmin.required_plugins = response.data['required_plugins'];
 
3214
 
3215
+ if( response.data['update_avilable_plugins'].length ) {
3216
+ compatibilities.warnings['update-available'] = astraSitesVars.compatibilities_data['update-available'];
3217
+ } else {
3218
+ delete compatibilities.warnings['update-available'];
3219
+ }
3220
 
3221
  if( response.data['third_party_required_plugins'].length ) {
3222
+ AstraSitesAdmin.skip_and_import_popups['astra-sites-third-party-required-plugins'] = response.data['third_party_required_plugins'];
3223
+ }
3224
 
3225
+ var is_dynamic_page = $( '#single-pages' ).find('.current_page').attr('data-dynamic-page') || 'no';
3226
+
3227
+ if( ( 'yes' === is_dynamic_page ) && 'site-pages' === AstraSitesAdmin.action_slug ) {
3228
+ AstraSitesAdmin.skip_and_import_popups['astra-sites-dynamic-page'] = '';
 
 
 
 
3229
  }
3230
 
3231
+
3232
+ // Release disabled class from import button.
3233
+ $('.astra-demo-import')
3234
+ .removeClass('disabled not-click-able')
3235
+ .attr('data-import', 'disabled');
3236
+
3237
  // Remove loader.
3238
  $('.required-plugins').removeClass('loading').html('');
3239
  $('.required-plugins-list').html('');
3240
 
3241
+ var output = '';
3242
+
3243
  /**
3244
  * Count remaining plugins.
3245
  * @type number
3246
  */
3247
  var remaining_plugins = 0;
3248
+ var required_plugins_markup = '';
3249
+
3250
 
3251
  /**
3252
  * Not Installed
3259
  remaining_plugins += parseInt( required_plugins.notinstalled.length );
3260
 
3261
  $( required_plugins.notinstalled ).each(function( index, plugin ) {
3262
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
3263
  });
3264
  }
3265
 
3274
  remaining_plugins += parseInt( required_plugins.inactive.length );
3275
 
3276
  $( required_plugins.inactive ).each(function( index, plugin ) {
3277
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
3278
  });
3279
  }
3280
 
3281
+ if ( '' == output ) {
3282
+ $('.astra-sites-result-preview').find('.astra-sites-import-plugins').hide();
3283
+ } else {
3284
+ $('.astra-sites-result-preview').find('.astra-sites-import-plugins').show();
3285
+ $('.astra-sites-result-preview').find('.required-plugins-list').html( output );
 
 
 
 
 
3286
  }
3287
 
3288
+
3289
  /**
3290
  * Enable Demo Import Button
3291
  * @type number
3292
  */
3293
+ astraSitesVars.requiredPlugins = required_plugins;
3294
+
3295
+ $('.astra-sites-import-content').find( '.astra-loading-wrap' ).remove();
3296
+ $('.astra-sites-result-preview').removeClass('preparing');
3297
+
3298
+ // Compatibility.
3299
+ if( Object.keys( compatibilities.errors ).length || Object.keys( compatibilities.warnings ).length || Object.keys( AstraSitesAdmin.skip_and_import_popups ).length ) {
3300
+
3301
+ if( Object.keys( compatibilities.errors ).length || Object.keys( compatibilities.warnings ).length ) {
3302
+ AstraSitesAdmin.skip_and_import_popups['astra-sites-compatibility-messages'] = compatibilities;
3303
+ }
3304
+
3305
+ if( Object.keys( AstraSitesAdmin.skip_and_import_popups ).length ) {
3306
+ AstraSitesAdmin.add_skip_and_import_popups( AstraSitesAdmin.skip_and_import_popups );
3307
+ }
3308
+
3309
+ } else {
3310
+
3311
+ // Avoid plugin activation, for pages only.
3312
+ if( 'site-pages' === AstraSitesAdmin.action_slug ) {
3313
+
3314
+ var notinstalled = astraSitesVars.requiredPlugins.notinstalled || 0;
3315
+ if( ! notinstalled.length ) {
3316
+ AstraSitesAdmin.import_page_process();
3317
+ }
3318
+ }
3319
+ }
3320
+ }
3321
+ console.groupEnd();
3322
+ });
3323
+ },
3324
+
3325
+ import_page_process: function() {
3326
+
3327
+ if( $( '.astra-sites-page-import-popup .site-install-site-button, .preview-page-from-search-result .site-install-site-button' ).hasClass('updating-message') ) {
3328
+ return;
3329
+ }
3330
+
3331
+ $( '.astra-sites-page-import-popup .site-install-site-button, .preview-page-from-search-result .site-install-site-button' ).addClass('updating-message installing').text( 'Importing..' );
3332
+
3333
+ AstraSitesAdmin.import_start_time = new Date();
3334
+
3335
+ $('.astra-sites-result-preview .inner > h3').text('We\'re importing your website.');
3336
+ $('.install-theme-info').hide();
3337
+ $('.ast-importing-wrap').show();
3338
+ var output = '<div class="current-importing-status-title"></div><div class="current-importing-status-description"></div>';
3339
+ $('.current-importing-status').html( output );
3340
+
3341
+ // Process Bulk Plugin Install & Activate.
3342
+ AstraSitesAdmin._bulkPluginInstallActivate();
3343
+ },
3344
+
3345
+ _installAstra: function( status ) {
3346
+
3347
+ var theme_slug = 'astra';
3348
+
3349
+ AstraSitesAdmin._log_title( astraSitesVars.log.themeInstall );
3350
+ AstraSitesAdmin._log( astraSitesVars.log.themeInstall );
3351
+
3352
+ if ( status == 'not-installed' ) {
3353
+ if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
3354
+ wp.updates.requestFilesystemCredentials();
3355
+ }
3356
+ wp.updates.installTheme( {
3357
+ slug: theme_slug
3358
  });
3359
 
3360
+ } else if ( status == 'installed-but-inactive' ) {
3361
+ AstraSitesAdmin._activateTheme();
3362
+ }
3363
+
3364
+ },
3365
+
3366
+ _activateTheme: function( event, response ) {
3367
+
3368
+ // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
3369
+ setTimeout( function() {
3370
+
3371
+ $.ajax({
3372
+ url: astraSitesVars.ajaxurl,
3373
+ type: 'POST',
3374
+ data: {
3375
+ 'action' : 'astra-sites-activate-theme',
3376
+ '_ajax_nonce' : astraSitesVars._ajax_nonce,
3377
+ },
3378
+ beforeSend: function() {
3379
+ console.log( 'Activating Astra Theme..' );
3380
+ }
3381
+ })
3382
+ .done(function (result) {
3383
+ AstraSitesAdmin._log( result );
3384
+ if( result.success ) {
3385
+ AstraSitesAdmin._log_title( result.data.message );
3386
+ AstraSitesAdmin._log( result.data.message );
3387
+ }
3388
+ });
3389
+
3390
+ }, 3000 );
3391
+ },
3392
+
3393
+ _close_popup_by_overlay: function(event) {
3394
+ if ( this === event.target ) {
3395
+ // Import process is started?
3396
+ // And Closing the window? Then showing the warning confirm message.
3397
+ if( $('body').hasClass('importing-site') && ! confirm( astraSitesVars.strings.warningBeforeCloseWindow ) ) {
3398
+ return;
3399
+ }
3400
+
3401
+ $('body').removeClass('importing-site');
3402
+ $('html').removeClass('astra-site-preview-on');
3403
+
3404
+ AstraSitesAdmin._close_popup();
3405
+ AstraSitesAdmin.hide_popup();
3406
+ }
3407
+ },
3408
+
3409
+ /**
3410
+ * Close Popup
3411
+ *
3412
+ * @since 1.0
3413
+ * @access private
3414
+ * @method _importDemo
3415
+ */
3416
+ _close_popup: function() {
3417
+ AstraSitesAdmin._clean_url_params( 'astra-site' );
3418
+ AstraSitesAdmin._clean_url_params( 'astra-page' );
3419
+ AstraSitesAdmin._clean_url_params( 'license' );
3420
+ $('.astra-sites-result-preview').html('').hide();
3421
+
3422
+ AstraSitesAdmin.hide_popup();
3423
+ },
3424
+
3425
+ _page_api_call: function() {
3426
+
3427
+ // Have any skip and import popup in queue then return.
3428
+ if( Object.keys( AstraSitesAdmin.skip_and_import_popups ).length ) {
3429
+ return;
3430
+ }
3431
+
3432
+ // Has API data of pages.
3433
+ if ( null == AstraSitesAdmin.templateData ) {
3434
+ return;
3435
+ }
3436
+
3437
+ AstraSitesAdmin.import_wpform( AstraSitesAdmin.templateData['astra-site-wpforms-path'], function( form_response ) {
3438
+
3439
+ $('body').addClass('importing-site');
3440
+
3441
+ // Import Page Content
3442
+ $('.current-importing-status-wrap').remove();
3443
+ $('.astra-sites-result-preview .inner > h3').text('We are importing page!');
3444
+
3445
+ fetch( AstraSitesAdmin.templateData['astra-page-api-url'] + '?&track=true&site_url=' + astraSitesVars.siteURL ).then(response => {
3446
+ return response.json();
3447
+ }).then(data => {
3448
+
3449
+ // Import Brizy images.
3450
+ if( Object.keys(data.brizy_media).length ) {
3451
+ for( media_key in data.brizy_media ) {
3452
+ AstraSitesAjaxQueue.add({
3453
+ url: astraSitesVars.ajaxurl,
3454
+ type: 'POST',
3455
+ data: {
3456
+ action : 'astra-sites-import-media',
3457
+ media : data.brizy_media[media_key],
3458
+ _ajax_nonce : astraSitesVars._ajax_nonce,
3459
+ },
3460
+ success: function( result ){
3461
+ AstraSitesAdmin._log( result );
3462
+ }
3463
+ });
3464
+ }
3465
+
3466
+ AstraSitesAjaxQueue.run();
3467
+ }
3468
+
3469
+ // Import Single Page.
3470
+ $.ajax({
3471
+ url: astraSitesVars.ajaxurl,
3472
+ type: 'POST',
3473
+ dataType: 'json',
3474
+ data: {
3475
+ 'action' : 'astra-sites-create-page',
3476
+ '_ajax_nonce' : astraSitesVars._ajax_nonce,
3477
+ 'page_settings_flag' : AstraSitesAdmin.page_settings_flag,
3478
+ 'data' : data,
3479
+ },
3480
+ success: function( response ){
3481
+ if( response.success ) {
3482
+ $('body').removeClass('importing-site');
3483
+ $('.rotating,.current-importing-status-wrap,.notice-warning').remove();
3484
+
3485
+ var template = wp.template('astra-sites-page-import-success');
3486
+ $('.astra-sites-result-preview .inner').html( template( response.data ) );
3487
+ } else {
3488
+ AstraSitesAdmin._importFailMessage( response.data, 'Page Rest API Request Failed!' );
3489
+ }
3490
+ }
3491
+ });
3492
+
3493
+ }).catch(err => {
3494
+ AstraSitesAdmin._log( err );
3495
+ AstraSitesAdmin._importFailMessage( response.data, 'Page Rest API Request Failed!' );
3496
+ });
3497
+ });
3498
+ },
3499
+
3500
+ import_wpform: function( wpforms_url, callback ) {
3501
+
3502
+ if ( '' == wpforms_url ) {
3503
+ if( callback && typeof callback == "function"){
3504
+ callback( '' );
3505
+ }
3506
+ return;
3507
+ }
3508
 
3509
+ $.ajax({
3510
+ url : astraSitesVars.ajaxurl,
3511
+ type : 'POST',
3512
+ dataType: 'json',
3513
+ data : {
3514
+ action : 'astra-sites-import-wpforms',
3515
+ wpforms_url : wpforms_url,
3516
+ _ajax_nonce : astraSitesVars._ajax_nonce,
3517
+ },
3518
+ beforeSend: function() {
3519
+ console.groupCollapsed( 'Importing WP Forms' );
3520
+ AstraSitesAdmin._log_title( 'Importing WP Forms..' );
3521
+ },
3522
+ })
3523
+ .fail(function( jqXHR ){
3524
+ AstraSitesAdmin._log( jqXHR );
3525
+ AstraSitesAdmin._importFailMessage( jqXHR.status + jqXHR.statusText, 'Import WP Forms Failed!' );
3526
+ console.groupEnd();
3527
+ })
3528
+ .done(function ( response ) {
3529
+ AstraSitesAdmin._log(response);
3530
+ console.groupEnd();
3531
+
3532
+ // 1. Fail - Import WPForms Options.
3533
+ if( false === response.success ) {
3534
+ AstraSitesAdmin._importFailMessage( response.data, 'Import WP Forms Failed!' );
3535
+ } else {
3536
+ if( callback && typeof callback == "function"){
3537
+ callback( response );
3538
+ }
3539
+ }
3540
+ });
3541
+ },
3542
+
3543
+ process_site_data: function( data ) {
3544
+
3545
+ if( 'log_file' in data ){
3546
+ AstraSitesAdmin.log_file_url = decodeURIComponent( data.log_file ) || '';
3547
  }
3548
 
3549
+ // 1. Pass - Request Site Import
3550
+ AstraSitesAdmin.customizer_data = JSON.stringify( data['astra-site-customizer-data'] ) || '';
3551
+ AstraSitesAdmin.wxr_url = encodeURI( data['astra-site-wxr-path'] ) || '';
3552
+ AstraSitesAdmin.wpforms_url = encodeURI( data['astra-site-wpforms-path'] ) || '';
3553
+ AstraSitesAdmin.cartflows_url = encodeURI( data['astra-site-cartflows-path'] ) || '';
3554
+ AstraSitesAdmin.options_data = JSON.stringify( data['astra-site-options-data'] ) || '';
3555
+ AstraSitesAdmin.enabled_extensions = JSON.stringify( data['astra-enabled-extensions'] ) || '';
3556
+ AstraSitesAdmin.widgets_data = data['astra-site-widgets-data'] || '';
3557
+
3558
+
3559
+ // Required Plugins.
3560
+ AstraSitesAdmin.required_plugins_list_markup( data['required-plugins'] );
3561
  },
3562
 
3563
  /**
3573
 
3574
  case 'free':
3575
 
3576
+ var notinstalled = astraSitesVars.requiredPlugins.notinstalled || 0;
3577
+ var inactive = astraSitesVars.requiredPlugins.inactive || 0;
3578
+ if( $('.astra-sites-result-preview').hasClass('skip-plugins') ) {
3579
+ notinstalled = [];
3580
+ }
3581
 
3582
  if( notinstalled.length === inactive.length ) {
3583
+ $(document).trigger( 'astra-sites-after-'+AstraSitesAdmin.action_slug+'-required-plugins' );
 
 
 
 
 
 
 
 
 
 
 
 
3584
  }
3585
  break;
3586
 
3591
  .addClass('go-pro button-primary')
3592
  .removeClass('astra-demo-import')
3593
  .attr('target', '_blank')
3594
+ .attr('href', astraSitesVars.getUpgradeURL + demo_slug )
3595
+ .text( astraSitesVars.getUpgradeText )
3596
  .append('<i class="dashicons dashicons-external"></i>');
3597
  break;
3598
 
3603
  .addClass('go-pro button-primary')
3604
  .removeClass('astra-demo-import')
3605
  .attr('target', '_blank')
3606
+ .attr('href', astraSitesVars.getProURL )
3607
+ .text( astraSitesVars.getProText )
3608
  .append('<i class="dashicons dashicons-external"></i>');
3609
 
3610
  $('.wp-full-overlay-header').find('.go-pro').remove();
3611
 
3612
+ if( false == astraSitesVars.isWhiteLabeled ) {
3613
+ if( astraSitesVars.isPro ) {
3614
  $('.install-theme-info .theme-details').prepend( wp.template('astra-sites-pro-inactive-site-description') );
3615
  } else {
3616
  $('.install-theme-info .theme-details').prepend( wp.template('astra-sites-pro-site-description') );
3625
  /**
3626
  * Update Page Count.
3627
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3628
 
3629
  /**
3630
  * Remove plugin from the queue.
3644
  AstraSitesAdmin.init();
3645
  });
3646
 
3647
+ })(jQuery);
inc/assets/js/astra-sites-api.js CHANGED
@@ -2,13 +2,6 @@
2
 
3
  AstraSitesAPI = {
4
 
5
- _api_url : astraSitesApi.ApiURL,
6
- _stored_data : {
7
- 'astra-site-category' : [],
8
- 'astra-site-page-builder': [],
9
- 'astra-sites' : [],
10
- },
11
-
12
  /**
13
  * API Request
14
  */
@@ -19,11 +12,11 @@
19
  cache: 'default',
20
  };
21
 
22
- if( astraRenderGrid.headers ) {
23
- params['headers'] = astraRenderGrid.headers;
24
  }
25
 
26
- fetch( AstraSitesAPI._api_url + args.slug, params).then(response => {
27
  if ( response.status === 200 ) {
28
  return response.json().then(items => ({
29
  items : items,
@@ -39,8 +32,47 @@
39
  if( 'object' === typeof data ) {
40
  data['args'] = args;
41
  if( data.args.id ) {
42
- AstraSitesAPI._stored_data[ args.id ] = $.merge( AstraSitesAPI._stored_data[ data.args.id ], data.items );
43
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  if( 'undefined' !== typeof args.trigger && '' !== args.trigger ) {
46
  $(document).trigger( args.trigger, [data] );
2
 
3
  AstraSitesAPI = {
4
 
 
 
 
 
 
 
 
5
  /**
6
  * API Request
7
  */
12
  cache: 'default',
13
  };
14
 
15
+ if( astraSitesVars.headers ) {
16
+ params['headers'] = astraSitesVars.headers;
17
  }
18
 
19
+ fetch( astraSitesVars.ApiURL + args.slug, params).then(response => {
20
  if ( response.status === 200 ) {
21
  return response.json().then(items => ({
22
  items : items,
32
  if( 'object' === typeof data ) {
33
  data['args'] = args;
34
  if( data.args.id ) {
35
+ astraSitesVars.stored_data[ args.id ] = $.merge( astraSitesVars.stored_data[ data.args.id ], data.items );
36
  }
37
+ data['args']['favorites'] = astraSitesVars.favorite_data;
38
+
39
+ if( 'undefined' !== typeof args.trigger && '' !== args.trigger ) {
40
+ $(document).trigger( args.trigger, [data] );
41
+ }
42
+
43
+ if( callback && typeof callback == "function"){
44
+ callback( data );
45
+ }
46
+ }
47
+ });
48
+
49
+ },
50
+
51
+ /**
52
+ * API Request
53
+ */
54
+ _api_single_request: function( args, callback ) {
55
+
56
+ var params = {
57
+ method: 'GET',
58
+ cache: 'default',
59
+ };
60
+
61
+ if( astraSitesVars.headers ) {
62
+ params['headers'] = astraSitesVars.headers;
63
+ }
64
+
65
+ fetch( astraSitesVars.ApiURL + args.slug, params).then(response => {
66
+ if ( response.status === 200 ) {
67
+ return response.json();
68
+ } else {
69
+ $(document).trigger( 'astra-sites-api-request-error' );
70
+ return response.json();
71
+ }
72
+ })
73
+ .then(data => {
74
+ if( 'object' === typeof data ) {
75
+ // data['args']['favorites'] = astraSitesVars.favorite_data;
76
 
77
  if( 'undefined' !== typeof args.trigger && '' !== args.trigger ) {
78
  $(document).trigger( args.trigger, [data] );
inc/assets/js/dist/common.js ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ $scope = {};
4
+
5
+ AstraImageCommon = {
6
+
7
+ images: {},
8
+ image: {},
9
+ action: '',
10
+ offset: 0,
11
+ loadingStatus: true,
12
+ config: {
13
+ key : astraImages.pixabay_api_key,
14
+ q : '',
15
+ lang : 'en',
16
+ image_type : 'all',
17
+ orientation : 'all',
18
+ category : '',
19
+ min_width : 0,
20
+ min_height : 0,
21
+ colors : '',
22
+ editors_choice : false,
23
+ safesearch : false,
24
+ order : 'popular',
25
+ page : $( 'body' ).data( 'page' ),
26
+ per_page : 30,
27
+ callback : '',
28
+ pretty : true
29
+ },
30
+ canSave: false,
31
+ infiniteLoad: false,
32
+ uploader: {},
33
+ file: {},
34
+ frame: {},
35
+ isPreview: false,
36
+ apiStatus: true,
37
+ id : '',
38
+ isValidating: false,
39
+
40
+ init: function() {
41
+ this._bind();
42
+ },
43
+
44
+ /**
45
+ * Binds events for the Astra Sites.
46
+ *
47
+ * @since 1.0.0
48
+ * @access private
49
+ * @method _bind
50
+ */
51
+ _bind: function() {
52
+
53
+ // Triggers.
54
+ $( document ).on( "ast-image__refresh", AstraImageCommon._initImages );
55
+ $( document ).on( "ast-image__set-scope", AstraImageCommon._setScope );
56
+ $( document ).on( "click", ".ast-image__list-img-overlay", AstraImageCommon._preview );
57
+ $( document ).on( "click", ".ast-image__go-back-text", AstraImageCommon._goBack );
58
+ $( document ).on( "click", ".ast-image__save", AstraImageCommon._save );
59
+ $( document ).on( "change", ".ast-image__filter select", AstraImageCommon._filter );
60
+ $( document ).on( "click", ".ast-image__edit-api", AstraImageCommon._editAPI );
61
+ $( document ).on( "click", ".ast-image__browse-images", AstraImageCommon._browse );
62
+ },
63
+
64
+ _browse: function() {
65
+ $scope.find( '.ast-image__search' ).trigger( 'keyup' );
66
+ },
67
+
68
+ _editAPI: function( event ) {
69
+ event.stopPropagation();
70
+ wp.media.view.AstraAttachmentsBrowser.images = [];
71
+ $scope.find( '.ast-image__loader-wrap' ).show();
72
+ $scope.find( '.ast-image__skeleton' ).html( '' );
73
+ $scope.find( '.ast-image__skeleton' ).attr( 'style', '' );
74
+ $scope.find( '.ast-image__search' ).trigger( 'keyup' );
75
+ $scope.find( '.ast-image__loader-wrap' ).hide();
76
+ },
77
+
78
+ _filter: function() {
79
+ let category = $scope.find( '.ast-image__filter-category select' ).val();
80
+ let orientation = $scope.find( '.ast-image__filter-orientation select' ).val();
81
+ let order = $scope.find( '.ast-image__filter-order select' ).val();
82
+
83
+ AstraImageCommon.config.orientation = orientation;
84
+ AstraImageCommon.config.category = category;
85
+ AstraImageCommon.config.order = order;
86
+
87
+ $scope.find( '.ast-image__search' ).trigger( 'keyup' );
88
+ $scope.find( '.ast-image__loader-wrap' ).show();
89
+ },
90
+
91
+ _save: function() {
92
+
93
+ if ( ! AstraImageCommon.canSave ) {
94
+ return;
95
+ }
96
+
97
+ let thisBtn = $( this )
98
+
99
+ if ( thisBtn.data( 'import-status' ) ) {
100
+ return;
101
+ }
102
+
103
+ thisBtn.text( astraImages.downloading );
104
+ thisBtn.addClass( 'installing' );
105
+
106
+ AstraImageCommon.canSave = false;
107
+
108
+ // Work with JSON page here
109
+ $.ajax({
110
+ url: astraImages.ajaxurl,
111
+ type: 'POST',
112
+ dataType: 'json',
113
+ data: {
114
+ 'action' : 'astra-sites-create-image',
115
+ 'url' : AstraImageCommon.image.largeImageURL,
116
+ 'name' : AstraImageCommon.image.tags,
117
+ 'id' : AstraImageCommon.image.id,
118
+ '_ajax_nonce' : astraImages._ajax_nonce,
119
+ },
120
+ })
121
+ .fail(function( jqXHR ){
122
+ console.log( jqXHR );
123
+ })
124
+ .done(function ( data ) {
125
+ console.log(data.data);
126
+ if ( undefined == data.data ) {
127
+ return;
128
+ }
129
+ astraImages.saved_images = data.data['updated-saved-images'];
130
+ wp.media.view.AstraAttachmentsBrowser.object.photoUploadComplete( data.data );
131
+ thisBtn.text( 'Done' );
132
+ thisBtn.removeClass( 'installing' );
133
+ AstraImageCommon._empty();
134
+ });
135
+ },
136
+
137
+ _empty: function() {
138
+
139
+ AstraImageCommon.image = {};
140
+ AstraImageCommon.canSave = false;
141
+ AstraImageCommon.uploader = {};
142
+ AstraImageCommon.file = {};
143
+ AstraImageCommon.isPreview = false;
144
+ },
145
+
146
+ _goBack: function() {
147
+
148
+ AstraImageCommon._empty();
149
+
150
+ $( document ).trigger( 'ast-image__refresh' );
151
+
152
+ $scope.find( '.ast-image__skeleton' ).show();
153
+ $scope.removeClass( 'preview-mode' );
154
+ $scope.find( '.ast-attachments-search-wrap' ).children().show();
155
+ $scope.find( '.ast-image__go-back' ).remove();
156
+ $scope.find( '.ast-image__save-wrap' ).remove();
157
+ $scope.find( '.ast-image__preview-skeleton' ).hide();
158
+ $scope.find( '.ast-image__preview-skeleton' ).html( '' );
159
+
160
+ let wrapHeight = ( AstraImageCommon.offset - 210 );
161
+ $scope.find( '.ast-image__skeleton-inner-wrap' ).css( 'height', wrapHeight );
162
+ },
163
+
164
+ _preview: function() {
165
+
166
+ AstraImageCommon.isPreview = true;
167
+
168
+ let height = ( AstraImageCommon.offset - 190 );
169
+ $scope.find( '.ast-image__skeleton-inner-wrap' ).css( 'height', height );
170
+
171
+ setTimeout( function() {
172
+ $scope.find( '.ast-image__loader-wrap' ).hide();
173
+ }, 200 );
174
+
175
+ AstraImageCommon.image = $( this ).data( 'img-info' );
176
+
177
+ let preview = wp.template( 'ast-image-single' );
178
+ let single_html = preview( AstraImageCommon.image );
179
+
180
+ let save_btn = wp.template( 'ast-image-save' );
181
+ let single_btn = save_btn( AstraImageCommon.image );
182
+
183
+ let wrapHeight = $scope.find( '.ast-image__skeleton-inner-wrap' ).outerHeight();
184
+ wrapHeight = ( wrapHeight - 60 );
185
+
186
+ $scope.find( '.ast-image__skeleton' ).hide();
187
+ $scope.addClass( 'preview-mode' );
188
+ $scope.find( '.ast-attachments-search-wrap' ).children().hide();
189
+ $scope.find( '.ast-image__search-wrap' ).before( $( '#tmpl-ast-image-go-back' ).text() );
190
+ $scope.find( '.ast-image__search-wrap' ).after( single_btn );
191
+ $scope.find( '.ast-image__preview-skeleton' ).html( single_html );
192
+ $scope.find( '.ast-image__preview-skeleton' ).show();
193
+ $scope.find( '.single-site-preview' ).css( 'max-height', wrapHeight );
194
+
195
+ AstraImageCommon.canSave = true;
196
+ },
197
+
198
+ _setScope: function() {
199
+
200
+ AstraImageCommon.frame = wp.media.view.AstraAttachmentsBrowser.object.$el.closest( '.media-frame' );
201
+ $scope = AstraImageCommon.frame.find( '.ast-attachments-browser' );
202
+
203
+ if ( undefined == $scope ) {
204
+ return;
205
+ }
206
+
207
+ $( 'body' ).data( 'page', 1 );
208
+ let skeleton = $( '#tmpl-ast-image-skeleton' ).text();
209
+ $scope.append( skeleton );
210
+
211
+ let pixabay_filter = wp.template( 'ast-image-filters' );
212
+ $scope.find( '.ast-attachments-search-wrap' ).append( pixabay_filter() );
213
+
214
+ AstraImageCommon.offset = AstraImageCommon.frame.outerHeight();
215
+ let wrapHeight = ( AstraImageCommon.offset - 210 );
216
+ $scope.find( '.ast-image__skeleton-inner-wrap' ).css( 'height', wrapHeight );
217
+ $scope.find( '.ast-image__search' ).trigger( 'keyup' );
218
+ $scope.find( '.ast-image__loader-wrap' ).show();
219
+ $scope.find( '.ast-image__skeleton-inner-wrap' ).scroll( AstraImageCommon._loadMore );
220
+ },
221
+
222
+ _initImages: function() {
223
+
224
+ let loop = wp.template( 'ast-image-list' );
225
+ let list_html = loop( wp.media.view.AstraAttachmentsBrowser.images );
226
+
227
+ let masonryObj;
228
+ let container = document.querySelector( '.ast-image__skeleton' );
229
+ $scope.find( '.ast-image__loader-wrap' ).show();
230
+
231
+ if ( AstraImageCommon.infiniteLoad ) {
232
+ AstraImageCommon.images.push( wp.media.view.AstraAttachmentsBrowser.images );
233
+ $scope.find( '.ast-image__skeleton' ).append( list_html );
234
+ } else {
235
+ AstraImageCommon.images = wp.media.view.AstraAttachmentsBrowser.images;
236
+ $scope.find( '.ast-image__skeleton' ).html( list_html );
237
+ }
238
+ AstraImageCommon.loadingStatus = true;
239
+ if ( $scope.find( '.ast-image__list-wrap' ).length ) {
240
+ imagesLoaded( container, function() {
241
+ $scope.find( '.ast-image__list-wrap' ).each( function( index ) {
242
+ $( this ).removeClass( 'loading' );
243
+ $( this ).addClass( 'loaded' );
244
+ } );
245
+ $scope.find( '.ast-image__loader-wrap' ).hide();
246
+ masonryObj = new Masonry( container, {
247
+ itemSelector: '.ast-image__list-wrap'
248
+ });
249
+ });
250
+ } else {
251
+ $scope.find( '.ast-image__loader-wrap' ).hide();
252
+ }
253
+ },
254
+
255
+ _loadMore: function() {
256
+
257
+ if( AstraImageCommon.isPreview ) {
258
+ return;
259
+ }
260
+
261
+ let page = $( 'body' ).data( 'page' );
262
+ page = ( undefined == page ) ? 2 : ( page + 1 );
263
+
264
+ if ( undefined != $scope.find( '.ast-image__list-wrap:last' ).offset() ) {
265
+
266
+ if( ( $( window ).scrollTop() + AstraImageCommon.offset ) >= ( $scope.find( '.ast-image__list-wrap:last' ).offset().top ) ) {
267
+
268
+ if ( AstraImageCommon.loadingStatus ) {
269
+
270
+ $scope.find( '.ast-image__loader-wrap' ).show();
271
+
272
+ AstraImageCommon.loadingStatus = false;
273
+ AstraImageCommon.infiniteLoad = true;
274
+ AstraImageCommon.config.page = page;
275
+
276
+ $( 'body' ).data( 'page', page );
277
+
278
+ $scope.find( '.ast-image__search' ).trigger( 'infinite' );
279
+ }
280
+ }
281
+ }
282
+ },
283
+ };
284
+
285
+ /**
286
+ * Initialize AstraImageCommon
287
+ */
288
+ $(function(){
289
+ AstraImageCommon.init();
290
+ });
291
+
292
+ })(jQuery);
inc/assets/js/dist/index.js ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******/ (function(modules) { // webpackBootstrap
2
+ /******/ // The module cache
3
+ /******/ var installedModules = {};
4
+ /******/
5
+ /******/ // The require function
6
+ /******/ function __webpack_require__(moduleId) {
7
+ /******/
8
+ /******/ // Check if module is in cache
9
+ /******/ if(installedModules[moduleId]) {
10
+ /******/ return installedModules[moduleId].exports;
11
+ /******/ }
12
+ /******/ // Create a new module (and put it into the cache)
13
+ /******/ var module = installedModules[moduleId] = {
14
+ /******/ i: moduleId,
15
+ /******/ l: false,
16
+ /******/ exports: {}
17
+ /******/ };
18
+ /******/
19
+ /******/ // Execute the module function
20
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
+ /******/
22
+ /******/ // Flag the module as loaded
23
+ /******/ module.l = true;
24
+ /******/
25
+ /******/ // Return the exports of the module
26
+ /******/ return module.exports;
27
+ /******/ }
28
+ /******/
29
+ /******/
30
+ /******/ // expose the modules object (__webpack_modules__)
31
+ /******/ __webpack_require__.m = modules;
32
+ /******/
33
+ /******/ // expose the module cache
34
+ /******/ __webpack_require__.c = installedModules;
35
+ /******/
36
+ /******/ // define getter function for harmony exports
37
+ /******/ __webpack_require__.d = function(exports, name, getter) {
38
+ /******/ if(!__webpack_require__.o(exports, name)) {
39
+ /******/ Object.defineProperty(exports, name, {
40
+ /******/ configurable: false,
41
+ /******/ enumerable: true,
42
+ /******/ get: getter
43
+ /******/ });
44
+ /******/ }
45
+ /******/ };
46
+ /******/
47
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
48
+ /******/ __webpack_require__.n = function(module) {
49
+ /******/ var getter = module && module.__esModule ?
50
+ /******/ function getDefault() { return module['default']; } :
51
+ /******/ function getModuleExports() { return module; };
52
+ /******/ __webpack_require__.d(getter, 'a', getter);
53
+ /******/ return getter;
54
+ /******/ };
55
+ /******/
56
+ /******/ // Object.prototype.hasOwnProperty.call
57
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
+ /******/
59
+ /******/ // __webpack_public_path__
60
+ /******/ __webpack_require__.p = "";
61
+ /******/
62
+ /******/ // Load entry module and return exports
63
+ /******/ return __webpack_require__(__webpack_require__.s = 0);
64
+ /******/ })
65
+ /************************************************************************/
66
+ /******/ ([
67
+ /* 0 */
68
+ /*!************************************!*\
69
+ !*** ./inc/assets/js/src/index.js ***!
70
+ \************************************/
71
+ /*! dynamic exports provided */
72
+ /*! all exports used */
73
+ /***/ (function(module, exports, __webpack_require__) {
74
+
75
+ (function ($) {
76
+
77
+ AstraImages = {
78
+
79
+ init: function init() {
80
+
81
+ if (undefined != wp && wp.media) {
82
+
83
+ var View = wp.media.View,
84
+ mediaTrash = wp.media.view.settings.mediaTrash,
85
+ l10n = wp.media.view.l10n,
86
+ Frame = wp.media.view.Frame,
87
+ $ = jQuery,
88
+ newVar = {},
89
+ Select = wp.media.view.MediaFrame.Select;
90
+
91
+ wp.media.view.AstraAttachmentsBrowser = __webpack_require__(/*! ./frame.js */ 1);
92
+
93
+ Select.prototype.bindHandlers = function () {
94
+
95
+ this.on("router:create:browse", this.createRouter, this);
96
+ this.on("router:render:browse", this.browseRouter, this);
97
+ this.on("content:create:browse", this.browseContent, this);
98
+ this.on("content:create:astraimages", this.astraimages, this);
99
+ this.on("content:render:upload", this.uploadContent, this);
100
+ this.on("toolbar:create:select", this.createSelectToolbar, this);
101
+ };
102
+
103
+ Select.prototype.browseRouter = function (routerView) {
104
+
105
+ routerView.set({
106
+ upload: {
107
+ text: l10n.uploadFilesTitle,
108
+ priority: 20
109
+ },
110
+ browse: {
111
+ text: l10n.mediaLibraryTitle,
112
+ priority: 40
113
+ },
114
+ astraimages: {
115
+ text: astraImages.title,
116
+ priority: 70
117
+ }
118
+ });
119
+ };
120
+
121
+ Select.prototype.astraimages = function (contentRegion) {
122
+ var state = this.state();
123
+
124
+ // Browse our library of attachments.
125
+ var thisView = new wp.media.view.AstraAttachmentsBrowser({
126
+ controller: this,
127
+ model: state,
128
+ AttachmentView: state.get('AttachmentView')
129
+ });
130
+ contentRegion.view = thisView;
131
+ wp.media.view.AstraAttachmentsBrowser.object = thisView;
132
+ setTimeout(function () {
133
+ $(document).trigger('ast-image__set-scope');
134
+ }, 100);
135
+ };
136
+ }
137
+ }
138
+
139
+ };
140
+
141
+ /**
142
+ * Initialize AstraImages
143
+ */
144
+ $(function () {
145
+
146
+ AstraImages.init();
147
+
148
+ if (astraImages.is_bb_active && astraImages.is_bb_editor) {
149
+ if (undefined !== FLBuilder) {
150
+ if (null !== FLBuilder._singlePhotoSelector) {
151
+ FLBuilder._singlePhotoSelector.on('open', function (event) {
152
+ AstraImages.init();
153
+ });
154
+ }
155
+ }
156
+ }
157
+ });
158
+ })(jQuery);
159
+
160
+ /***/ }),
161
+ /* 1 */
162
+ /*!************************************!*\
163
+ !*** ./inc/assets/js/src/frame.js ***!
164
+ \************************************/
165
+ /*! dynamic exports provided */
166
+ /*! all exports used */
167
+ /***/ (function(module, exports, __webpack_require__) {
168
+
169
+ var View = wp.media.View,
170
+ Frame = wp.media.view.Frame,
171
+ $ = jQuery,
172
+ Select = wp.media.view.MediaFrame.Select,
173
+ AstraAttachmentsBrowser;
174
+
175
+ wp.media.view.AstraContent = __webpack_require__(/*! ./content.js */ 2);
176
+
177
+ AstraAttachmentsBrowser = Frame.extend({
178
+ tagName: 'div',
179
+ className: 'attachments-browser ast-attachments-browser',
180
+ images: [],
181
+ object: [],
182
+ initialize: function initialize() {
183
+ _.defaults(this.options, {
184
+ filters: false,
185
+ search: true,
186
+ date: true,
187
+ display: false,
188
+ sidebar: true,
189
+ AttachmentView: wp.media.view.Attachment.Library
190
+ });
191
+
192
+ // Add a heading before the attachments list.
193
+ this.createContent();
194
+ },
195
+
196
+ createContent: function createContent() {
197
+
198
+ this.attachmentsHeading = new wp.media.view.Heading({
199
+ text: astraImages.title,
200
+ level: 'h3',
201
+ className: 'ast-media-views-heading'
202
+ });
203
+ // this.views.add( this.attachmentsHeading );
204
+ this.views.add(new wp.media.view.AstraContent());
205
+ this.$el.find('.ast-image__search').wrapAll('<div class="ast-image__search-wrap">').parent().html();
206
+ this.$el.find('.ast-image__search-wrap').append('<span class="icon-search search-icon"></span>');
207
+ },
208
+
209
+ photoUploadComplete: function photoUploadComplete(savedImage) {
210
+ if (savedImage && savedImage.attachmentData) {
211
+ this.model.frame.content.mode("browse");
212
+ this.model.get("selection").add(savedImage.attachmentData);
213
+ this.model.frame.trigger("library:selection:add");
214
+ this.model.get("selection");
215
+ jQuery(".media-frame .media-button-select").click();
216
+ }
217
+ }
218
+ });
219
+
220
+ module.exports = AstraAttachmentsBrowser;
221
+
222
+ /***/ }),
223
+ /* 2 */
224
+ /*!**************************************!*\
225
+ !*** ./inc/assets/js/src/content.js ***!
226
+ \**************************************/
227
+ /*! dynamic exports provided */
228
+ /*! all exports used */
229
+ /***/ (function(module, exports, __webpack_require__) {
230
+
231
+ wp.media.view.AstraSearch = __webpack_require__(/*! ./search.js */ 3);
232
+
233
+ var AstraContent = wp.media.View.extend({
234
+
235
+ tagName: 'div',
236
+ className: 'ast-attachments-search-wrap',
237
+ initialize: function initialize() {
238
+ this.value = this.options.value;
239
+ },
240
+
241
+ render: function render() {
242
+
243
+ var search = new wp.media.view.AstraSearch({
244
+ controller: this.controller,
245
+ model: this.model
246
+ });
247
+ this.views.add(search);
248
+ return this;
249
+ }
250
+ });
251
+
252
+ module.exports = AstraContent;
253
+
254
+ /***/ }),
255
+ /* 3 */
256
+ /*!*************************************!*\
257
+ !*** ./inc/assets/js/src/search.js ***!
258
+ \*************************************/
259
+ /*! dynamic exports provided */
260
+ /*! all exports used */
261
+ /***/ (function(module, exports) {
262
+
263
+ var l10n = wp.media.view.l10n;
264
+ $ = jQuery;
265
+ // Search input view controller.
266
+ AstraSearch = wp.Backbone.View.extend({
267
+
268
+ tagName: 'input',
269
+ className: 'ast-image__search',
270
+ id: 'ast-image-search-input',
271
+ searching: false,
272
+ images: [],
273
+ attributes: {
274
+ placeholder: astraImages.search_placeholder,
275
+ type: 'search',
276
+ 'aria-describedby': 'live-search-desc'
277
+ },
278
+
279
+ events: {
280
+ 'search': 'search',
281
+ 'keyup': 'search',
282
+ 'blur': 'pushState',
283
+ 'infinite': 'infinite'
284
+ },
285
+
286
+ initialize: function initialize(options) {
287
+
288
+ this.parent = options.parent;
289
+ },
290
+
291
+ infinite: function infinite(event) {
292
+
293
+ // Since doSearch is debounced, it will only run when user input comes to a rest.
294
+ this.doSearch(event);
295
+ },
296
+
297
+ search: function search(event) {
298
+
299
+ // Clear on escape.
300
+ if (event.type === 'keyup' && event.which === 27) {
301
+ event.target.value = '';
302
+ }
303
+ if ('' == event.target.value) {
304
+ this.$el.removeClass('has-input');
305
+ } else {
306
+ this.$el.addClass('has-input');
307
+ }
308
+
309
+ $scope.find('.ast-image__skeleton').animate({ scrollTop: 0 }, 0);
310
+ $('body').data('page', 1);
311
+ AstraImageCommon.infiniteLoad = false;
312
+
313
+ var thisObject = this;
314
+ setTimeout(function () {
315
+ thisObject.doSearch(event);
316
+ }, 1000);
317
+ },
318
+
319
+ // Runs a search on the theme collection.
320
+ doSearch: function doSearch(event) {
321
+
322
+ if (this.searching) {
323
+ return;
324
+ }
325
+
326
+ var options = {};
327
+ var thisObject = this;
328
+ thisObject.searching = true;
329
+ AstraImageCommon.config.q = event.target.value;
330
+ var url = astraImages.pixabay_url + '?' + $.param(AstraImageCommon.config);
331
+
332
+ if (url) {
333
+ fetch(url).then(function (response) {
334
+ return response.json();
335
+ }).then(function (result) {
336
+ thisObject.searching = false;
337
+ this.images = result.hits;
338
+ wp.media.view.AstraAttachmentsBrowser.images = this.images;
339
+ $(document).trigger('ast-image__refresh');
340
+ });
341
+ }
342
+ },
343
+
344
+ pushState: function pushState(event) {
345
+ $(document).trigger('ast-image__refresh');
346
+ }
347
+ });
348
+
349
+ module.exports = AstraSearch;
350
+
351
+ /***/ })
352
+ /******/ ]);
inc/assets/js/elementor-admin-page.js ADDED
@@ -0,0 +1,1605 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * AJAX Request Queue
3
+ *
4
+ * - add()
5
+ * - remove()
6
+ * - run()
7
+ * - stop()
8
+ *
9
+ * @since 1.0.0
10
+ */
11
+ var AstraSitesAjaxQueue = (function() {
12
+
13
+ var requests = [];
14
+
15
+ return {
16
+
17
+ /**
18
+ * Add AJAX request
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+ add: function(opt) {
23
+ requests.push(opt);
24
+ },
25
+
26
+ /**
27
+ * Remove AJAX request
28
+ *
29
+ * @since 1.0.0
30
+ */
31
+ remove: function(opt) {
32
+ if( jQuery.inArray(opt, requests) > -1 )
33
+ requests.splice($.inArray(opt, requests), 1);
34
+ },
35
+
36
+ /**
37
+ * Run / Process AJAX request
38
+ *
39
+ * @since 1.0.0
40
+ */
41
+ run: function() {
42
+ var self = this,
43
+ oriSuc;
44
+
45
+ if( requests.length ) {
46
+ oriSuc = requests[0].complete;
47
+
48
+ requests[0].complete = function() {
49
+ if( typeof(oriSuc) === 'function' ) oriSuc();
50
+ requests.shift();
51
+ self.run.apply(self, []);
52
+ };
53
+
54
+ jQuery.ajax(requests[0]);
55
+
56
+ } else {
57
+
58
+ self.tid = setTimeout(function() {
59
+ self.run.apply(self, []);
60
+ }, 1000);
61
+ }
62
+ },
63
+
64
+ /**
65
+ * Stop AJAX request
66
+ *
67
+ * @since 1.0.0
68
+ */
69
+ stop: function() {
70
+
71
+ requests = [];
72
+ clearTimeout(this.tid);
73
+ }
74
+ };
75
+
76
+ }());
77
+
78
+ (function($){
79
+
80
+ $elscope = {};
81
+
82
+ $.fn.isInViewport = function() {
83
+
84
+ // If not have the element then return false!
85
+ if( ! $( this ).length ) {
86
+ return false;
87
+ }
88
+
89
+ var elementTop = $( this ).offset().top;
90
+ var elementBottom = elementTop + $( this ).outerHeight();
91
+
92
+ var viewportTop = $( window ).scrollTop();
93
+ var viewportBottom = viewportTop + $( window ).height();
94
+
95
+ return elementBottom > viewportTop && elementTop < viewportBottom;
96
+ };
97
+
98
+ AstraElementorSitesAdmin = {
99
+
100
+ visited_pages: [],
101
+ reset_remaining_posts: 0,
102
+ site_imported_data: null,
103
+ backup_taken: false,
104
+ templateData: {},
105
+ insertData: {},
106
+ log_file : '',
107
+ pages_list : '',
108
+ insertActionFlag : false,
109
+ page_id : 0,
110
+ site_id : 0,
111
+ block_id : 0,
112
+ requiredPlugins : [],
113
+ canImport : false,
114
+ canInsert : false,
115
+ type : 'pages',
116
+ action : '',
117
+ masonryObj : [],
118
+ index : 0,
119
+ blockCategory : '',
120
+ blockColor : '',
121
+
122
+ init: function() {
123
+ this._bind();
124
+ },
125
+
126
+ /**
127
+ * Binds events for the Astra Sites.
128
+ *
129
+ * @since 1.0.0
130
+ * @access private
131
+ * @method _bind
132
+ */
133
+ _bind: function() {
134
+
135
+ if ( elementorCommon ) {
136
+
137
+ let add_section_tmpl = $( "#tmpl-elementor-add-section" );
138
+
139
+ if ( add_section_tmpl.length > 0 ) {
140
+
141
+ let action_for_add_section = add_section_tmpl.text();
142
+ let white_label_class = '';
143
+ let stylesheet = '';
144
+ if ( astraElementorSites.isWhiteLabeled ) {
145
+ white_label_class = " ast-elementor-white-label"
146
+ stylesheet = '<style type="">.elementor-add-ast-site-button.ast-elementor-white-label .eicon-folder:before {content: \'' + astraElementorSites.plugin_name[0] + '\';}</style>'
147
+ }
148
+
149
+ action_for_add_section = action_for_add_section.replace( '<div class="elementor-add-section-drag-title', stylesheet + '<div class="elementor-add-section-area-button elementor-add-ast-site-button ' + white_label_class + '" title="' + astraElementorSites.plugin_name + '"> <i class="eicon-folder"></i> </div><div class="elementor-add-section-drag-title' );
150
+
151
+ add_section_tmpl.text( action_for_add_section );
152
+
153
+ elementor.on( "preview:loaded", function() {
154
+
155
+ let base_skeleton = wp.template( 'ast-template-base-skeleton' );
156
+ let header_template = $( '#tmpl-ast-template-modal__header' ).text();
157
+
158
+ if ( $( '#ast-sites-modal' ).length == 0 ) {
159
+
160
+ $( 'body' ).append( base_skeleton() );
161
+ $elscope = $( '#ast-sites-modal' );
162
+ $elscope.find( '.astra-sites-content-wrap' ).before( header_template );
163
+ }
164
+
165
+ $elscope.find( '.astra-blocks-category' ).select2();
166
+
167
+ $elscope.find( '.astra-blocks-category' ).on( 'select2:select', AstraElementorSitesAdmin._categoryChange );
168
+ $elscope.find( '.astra-blocks-filter' ).on( 'change', AstraElementorSitesAdmin._blockColorChange );
169
+
170
+ $( elementor.$previewContents[0].body ).on( "click", ".elementor-add-ast-site-button", AstraElementorSitesAdmin._open );
171
+
172
+ // Click events.
173
+ $( 'body' ).on( "click", ".ast-sites-modal__header__close", AstraElementorSitesAdmin._close );
174
+ $( 'body' ).on( "click", "#ast-sites-modal .elementor-template-library-menu-item", AstraElementorSitesAdmin._libraryClick );
175
+ $( 'body' ).on( "click", "#ast-sites-modal .theme-screenshot", AstraElementorSitesAdmin._preview );
176
+ $( 'body' ).on( "click", "#ast-sites-modal .back-to-layout", AstraElementorSitesAdmin._goBack );
177
+ $( 'body' ).on( "click", AstraElementorSitesAdmin._closeTooltip );
178
+
179
+ $( document ).on( "click", "#ast-sites-modal .ast-library-template-insert", AstraElementorSitesAdmin._insert );
180
+ $( document ).on( "click", ".ast-import-elementor-template", AstraElementorSitesAdmin._importTemplate );
181
+ $( 'body' ).on( "click", "#ast-sites-modal .astra-sites-tooltip-icon", AstraElementorSitesAdmin._toggleTooltip );
182
+ $( document ).on( "click", ".elementor-template-library-menu-item", AstraElementorSitesAdmin._toggle );
183
+ $( document ).on( 'click', '#ast-sites-modal .astra-sites__sync-wrap', AstraElementorSitesAdmin._sync );
184
+ $( document ).on( 'click', '#ast-sites-modal .ast-sites-modal__header__logo, #ast-sites-modal .back-to-layout-button', AstraElementorSitesAdmin._home );
185
+ $( document ).on( 'click', '#ast-sites-modal .notice-dismiss', AstraElementorSitesAdmin._dismiss );
186
+
187
+ // Other events.
188
+ $elscope.find( '.astra-sites-content-wrap' ).scroll( AstraElementorSitesAdmin._loadLargeImages );
189
+ $( document ).on( 'keyup input' , '#ast-sites-modal #wp-filter-search-input', AstraElementorSitesAdmin._search );
190
+
191
+ // Triggers.
192
+ $( document ).on( "astra-sites__elementor-open-after", AstraElementorSitesAdmin._initSites );
193
+ $( document ).on( "astra-sites__elementor-open-before", AstraElementorSitesAdmin._beforeOpen );
194
+ $( document ).on( "astra-sites__elementor-plugin-check", AstraElementorSitesAdmin._pluginCheck );
195
+ $( document ).on( 'astra-sites__elementor-close-before', AstraElementorSitesAdmin._beforeClose );
196
+
197
+ $( document ).on( 'astra-sites__elementor-do-step-1', AstraElementorSitesAdmin._step1 );
198
+ $( document ).on( 'astra-sites__elementor-do-step-2', AstraElementorSitesAdmin._step2 );
199
+
200
+ $( document ).on( 'astra-sites__elementor-goback-step-1', AstraElementorSitesAdmin._goStep1 );
201
+ $( document ).on( 'astra-sites__elementor-goback-step-2', AstraElementorSitesAdmin._goStep2 );
202
+
203
+ // Plugin install & activate.
204
+ $( document ).on( 'wp-plugin-installing' , AstraElementorSitesAdmin._pluginInstalling );
205
+ $( document ).on( 'wp-plugin-install-error' , AstraElementorSitesAdmin._installError );
206
+ $( document ).on( 'wp-plugin-install-success' , AstraElementorSitesAdmin._installSuccess );
207
+
208
+ });
209
+ }
210
+ }
211
+
212
+ },
213
+
214
+ _categoryChange: function( event ) {
215
+ AstraElementorSitesAdmin.blockCategory = $( this ).val();
216
+ $elscope.find( '#wp-filter-search-input' ).trigger( 'keyup' );
217
+ },
218
+
219
+ _blockColorChange: function( event ) {
220
+ AstraElementorSitesAdmin.blockColor = $( this ).val();
221
+ $elscope.find( '#wp-filter-search-input' ).trigger( 'keyup' );
222
+ },
223
+
224
+ _dismiss: function() {
225
+
226
+ $( this ).closest( '.ast-sites-floating-notice-wrap' ).removeClass( 'slide-in' );
227
+ $( this ).closest( '.ast-sites-floating-notice-wrap' ).addClass( 'slide-out' );
228
+
229
+ setTimeout( function() {
230
+ $( this ).closest( '.ast-sites-floating-notice-wrap' ).removeClass( 'slide-out' );
231
+ }, 200 );
232
+
233
+ if ( $( this ).closest( '.ast-sites-floating-notice-wrap' ).hasClass( 'refreshed-notice' ) ) {
234
+ $.ajax({
235
+ url : astraElementorSites.ajaxurl,
236
+ type : 'POST',
237
+ data : {
238
+ action : 'astra-sites-update-library-complete',
239
+ },
240
+ });
241
+ }
242
+ },
243
+
244
+ _done: function( data ) {
245
+
246
+ console.groupEnd( 'Process Done.' );
247
+
248
+ var str = ( AstraElementorSitesAdmin.type == 'pages' ) ? 'Template' : 'Block';
249
+ $elscope.find( '.ast-import-elementor-template' ).removeClass( 'installing' );
250
+ $elscope.find( '.ast-import-elementor-template' ).attr( 'data-demo-link', data.data.link );
251
+ setTimeout( function() {
252
+ $elscope.find( '.ast-import-elementor-template' ).text( 'View Saved ' + str );
253
+ $elscope.find( '.ast-import-elementor-template' ).addClass( 'action-done' );
254
+ }, 200 );
255
+ },
256
+
257
+ _beforeClose: function() {
258
+ if ( AstraElementorSitesAdmin.action == 'insert' ) {
259
+ $elscope.find( '.ast-library-template-insert' ).removeClass( 'installing' );
260
+ $elscope.find( '.ast-library-template-insert' ).text( 'Imported' );
261
+ $elscope.find( '.ast-library-template-insert' ).addClass( 'action-done' );
262
+
263
+ if ( $elscope.find( '.ast-sites-floating-notice-wrap' ).hasClass( 'slide-in' ) ) {
264
+
265
+ $elscope.find( '.ast-sites-floating-notice-wrap' ).removeClass( 'slide-in' );
266
+ $elscope.find( '.ast-sites-floating-notice-wrap' ).addClass( 'slide-out' );
267
+
268
+ setTimeout( function() {
269
+ $elscope.find( '.ast-sites-floating-notice-wrap' ).removeClass( 'slide-out' );
270
+ }, 200 );
271
+ }
272
+ }
273
+ },
274
+
275
+ _closeTooltip: function( event ) {
276
+
277
+ if(
278
+ event.target.className !== "ast-tooltip-wrap" &&
279
+ event.target.className !== "dashicons dashicons-editor-help"
280
+ ) {
281
+ var wrap = $elscope.find( '.ast-tooltip-wrap' );
282
+ if ( wrap.hasClass( 'ast-show-tooltip' ) ) {
283
+ $elscope.find( '.ast-tooltip-wrap' ).removeClass( 'ast-show-tooltip' );
284
+ }
285
+ }
286
+ },
287
+
288
+ _sync: function( event ) {
289
+
290
+ event.preventDefault();
291
+ var button = $( this ).find( '.astra-sites-sync-library-button' );
292
+
293
+ if( button.hasClass( 'updating-message') ) {
294
+ return;
295
+ }
296
+
297
+ button.addClass( 'updating-message');
298
+ $elscope.find( '#ast-sites-floating-notice-wrap-id .ast-sites-floating-notice' ).html( '<span class="message">Syncing template library in the background. The process can take anywhere between 2 to 3 minutes. We will notify you once done.<span><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss</span></button>' );
299
+ $elscope.find( '#ast-sites-floating-notice-wrap-id' ).addClass( 'slide-in' ).removeClass( 'refreshed-notice' );
300
+
301
+ $.ajax({
302
+ url : astraElementorSites.ajaxurl,
303
+ type : 'POST',
304
+ data : {
305
+ action : 'astra-sites-update-library',
306
+ },
307
+ })
308
+ .fail(function( jqXHR ){
309
+ console.log( jqXHR );
310
+ })
311
+ .done(function ( response ) {
312
+
313
+ if( response.success ) {
314
+ if( 'updated' === response.data ) {
315
+ $elscope.find( '#ast-sites-floating-notice-wrap-id').addClass('refreshed-notice').find('.ast-sites-floating-notice' ).html( '<span class="message">'+astraElementorSites.syncCompleteMessage+'</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss</span></button>' );
316
+ button.removeClass( 'updating-message');
317
+ console.log( 'Already sync all the sites.' );
318
+ } else {
319
+
320
+ // Import categories.
321
+ $.ajax({
322
+ url : astraElementorSites.ajaxurl,
323
+ type : 'POST',
324
+ data : {
325
+ action : 'astra-sites-import-categories',
326
+ },
327
+ })
328
+ .fail(function( jqXHR ){
329
+ console.log( jqXHR );
330
+ });
331
+
332
+ // Import Site Categories.
333
+ $.ajax({
334
+ url : astraElementorSites.ajaxurl,
335
+ type : 'POST',
336
+ data : {
337
+ action : 'astra-sites-import-site-categories',
338
+ },
339
+ })
340
+ .fail(function( jqXHR ){
341
+ console.log( jqXHR );
342
+ });
343
+
344
+ // Import Blocks.
345
+ $.ajax({
346
+ url : astraElementorSites.ajaxurl,
347
+ type : 'POST',
348
+ data : {
349
+ action : 'astra-sites-import-blocks',
350
+ },
351
+ })
352
+ .fail(function( jqXHR ){
353
+ console.log( jqXHR );
354
+ });
355
+
356
+ // Import Block Categories.
357
+ $.ajax({
358
+ url : astraElementorSites.ajaxurl,
359
+ type : 'POST',
360
+ data : {
361
+ action : 'astra-sites-import-block-categories',
362
+ },
363
+ })
364
+ .fail(function( jqXHR ){
365
+ console.log( jqXHR );
366
+ });
367
+
368
+ $.ajax({
369
+ url : astraElementorSites.ajaxurl,
370
+ type : 'POST',
371
+ data : {
372
+ action : 'astra-sites-get-sites-request-count',
373
+ },
374
+ })
375
+ .fail(function( jqXHR ){
376
+ console.log( jqXHR );
377
+ })
378
+ .done(function ( response ) {
379
+ if( response.success ) {
380
+ var total = response.data;
381
+
382
+ for( let i = 1; i <= total; i++ ) {
383
+ AstraSitesAjaxQueue.add({
384
+ url: astraElementorSites.ajaxurl,
385
+ type: 'POST',
386
+ data: {
387
+ action : 'astra-sites-import-sites',
388
+ page_no : i,
389
+ },
390
+ success: function( result ){
391
+
392
+ if( i === total && astraElementorSites.syncCompleteMessage ) {
393
+ button.removeClass( 'updating-message');
394
+ $elscope.find( '#ast-sites-floating-notice-wrap-id').addClass('refreshed-notice').find('.ast-sites-floating-notice' ).html( '<span class="message">'+astraElementorSites.syncCompleteMessage+'</span><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss</span></button>' );
395
+ }
396
+ }
397
+ });
398
+ }
399
+
400
+ // Run the AJAX queue.
401
+ AstraSitesAjaxQueue.run();
402
+ }
403
+ });
404
+ }
405
+ }
406
+ });
407
+ },
408
+
409
+ _toggleTooltip: function( e ) {
410
+
411
+ var wrap = $elscope.find( '.ast-tooltip-wrap' );
412
+
413
+
414
+ if ( wrap.hasClass( 'ast-show-tooltip' ) ) {
415
+ $elscope.find( '.ast-tooltip-wrap' ).removeClass( 'ast-show-tooltip' );
416
+ } else {
417
+ $elscope.find( '.ast-tooltip-wrap' ).addClass( 'ast-show-tooltip' );
418
+ }
419
+ },
420
+
421
+ _toggle: function( e ) {
422
+ $elscope.find( '.elementor-template-library-menu-item' ).removeClass( 'elementor-active' );
423
+
424
+ $elscope.find( '.dialog-lightbox-content' ).hide();
425
+
426
+ $elscope.find( '.theme-preview' ).hide();
427
+ $elscope.find( '.theme-preview' ).html( '' );
428
+ $elscope.find( '.theme-preview-block' ).hide();
429
+ $elscope.find( '.theme-preview-block' ).html( '' );
430
+ $elscope.find( '.astra-blocks-category-wrap' ).show();
431
+
432
+ $elscope.find( '.dialog-lightbox-content' ).hide();
433
+ $elscope.find( '.dialog-lightbox-content-block' ).hide();
434
+
435
+ $( this ).addClass( 'elementor-active' );
436
+ let data_type = $( this ).data( 'template-type' );
437
+
438
+ AstraElementorSitesAdmin.type = data_type;
439
+ AstraElementorSitesAdmin._switchTo( data_type );
440
+ },
441
+
442
+ _home: function() {
443
+ $elscope.find( '#wp-filter-search-input' ).val( '' );
444
+ // Hide Back button.
445
+ $elscope.find( '.back-to-layout' ).css( 'visibility', 'hidden' );
446
+ $elscope.find( '.back-to-layout' ).css( 'opacity', '0' );
447
+ $elscope.find( '.elementor-template-library-menu-item:first-child' ).trigger( 'click' );
448
+ },
449
+
450
+ _switchTo: function( type ) {
451
+ if ( 'pages' == type ) {
452
+ AstraElementorSitesAdmin._initSites();
453
+ $elscope.find( '.dialog-lightbox-content' ).show();
454
+ } else {
455
+ AstraElementorSitesAdmin._initBlocks();
456
+ $elscope.find( '.dialog-lightbox-content-block' ).show();
457
+ }
458
+ $elscope.find( '.astra-sites-content-wrap' ).trigger( 'scroll' );
459
+ },
460
+
461
+ _importWPForm: function( wpforms_url, callback ) {
462
+
463
+ if ( '' == wpforms_url ) {
464
+ if( callback && typeof callback == "function"){
465
+ callback( '' );
466
+ }
467
+ return;
468
+ }
469
+
470
+ $.ajax({
471
+ url : astraElementorSites.ajaxurl,
472
+ type : 'POST',
473
+ dataType: 'json',
474
+ data : {
475
+ action : 'astra-sites-import-wpforms',
476
+ wpforms_url : wpforms_url,
477
+ _ajax_nonce : astraElementorSites._ajax_nonce,
478
+ },
479
+ beforeSend: function() {
480
+ console.groupCollapsed( 'Importing WP Forms' );
481
+ },
482
+ })
483
+ .fail(function( jqXHR ){
484
+ console.log( jqXHR.status + ' ' + jqXHR.responseText, true );
485
+ console.groupEnd();
486
+ })
487
+ .done(function ( data ) {
488
+
489
+ // 1. Fail - Import WPForms Options.
490
+ if( false === data.success ) {
491
+ console.log( data.data );
492
+ console.groupEnd();
493
+ } else {
494
+ if( callback && typeof callback == "function"){
495
+ callback( data );
496
+ }
497
+ }
498
+ });
499
+ },
500
+
501
+ _createTemplate: function( data ) {
502
+
503
+ console.groupEnd();
504
+
505
+ // Work with JSON page here
506
+ $.ajax({
507
+ url: astraElementorSites.ajaxurl,
508
+ type: 'POST',
509
+ dataType: 'json',
510
+ data: {
511
+ 'action' : 'astra-sites-create-template',
512
+ 'data' : data,
513
+ 'title' : ( AstraElementorSitesAdmin.type == 'pages' ) ? astraElementorSites.default_page_builder_sites[ AstraElementorSitesAdmin.site_id ]['title'] : '',
514
+ 'type' : AstraElementorSitesAdmin.type,
515
+ '_ajax_nonce' : astraElementorSites._ajax_nonce,
516
+ },
517
+ beforeSend: function() {
518
+ console.groupCollapsed( 'Creating Template' );
519
+ }
520
+ })
521
+ .fail(function( jqXHR ){
522
+ console.log( jqXHR );
523
+ })
524
+ .done(function ( data ) {
525
+ AstraElementorSitesAdmin._done( data );
526
+ });
527
+ },
528
+
529
+ /**
530
+ * Install All Plugins.
531
+ */
532
+ _installAllPlugins: function( not_installed ) {
533
+
534
+ $.each( not_installed, function(index, single_plugin) {
535
+
536
+ console.log( 'Installing Plugin - ' + single_plugin.name );
537
+
538
+ // Add each plugin activate request in Ajax queue.
539
+ // @see wp-admin/js/updates.js
540
+ wp.updates.queue.push( {
541
+ action: 'install-plugin', // Required action.
542
+ data: {
543
+ slug: single_plugin.slug
544
+ }
545
+ } );
546
+ });
547
+
548
+ // Required to set queue.
549
+ wp.updates.queueChecker();
550
+ },
551
+
552
+ /**
553
+ * Activate All Plugins.
554
+ */
555
+ _activateAllPlugins: function( activate_plugins ) {
556
+
557
+ $.each( activate_plugins, function(index, single_plugin) {
558
+
559
+ console.log( 'Activating Plugin - ' + single_plugin.name );
560
+
561
+ AstraSitesAjaxQueue.add({
562
+ url: astraElementorSites.ajaxurl,
563
+ type: 'POST',
564
+ data: {
565
+ 'action' : 'astra-required-plugin-activate',
566
+ 'init' : single_plugin.init,
567
+ '_ajax_nonce' : astraElementorSites._ajax_nonce,
568
+ },
569
+ success: function( result ){
570
+
571
+ if( result.success ) {
572
+
573
+ var pluginsList = AstraElementorSitesAdmin.requiredPlugins.inactive;
574
+
575
+ // Reset not installed plugins list.
576
+ AstraElementorSitesAdmin.requiredPlugins.inactive = AstraElementorSitesAdmin._removePluginFromQueue( single_plugin.slug, pluginsList );
577
+
578
+ // Enable Demo Import Button
579
+ AstraElementorSitesAdmin._enableImport();
580
+ }
581
+ }
582
+ });
583
+ });
584
+ AstraSitesAjaxQueue.run();
585
+ },
586
+
587
+ /**
588
+ * Remove plugin from the queue.
589
+ */
590
+ _removePluginFromQueue: function( removeItem, pluginsList ) {
591
+ return jQuery.grep(pluginsList, function( value ) {
592
+ return value.slug != removeItem;
593
+ });
594
+ },
595
+
596
+ /**
597
+ * Get plugin from the queue.
598
+ */
599
+ _getPluginFromQueue: function( item, pluginsList ) {
600
+
601
+ var match = '';
602
+ for ( ind in pluginsList ) {
603
+ if( item == pluginsList[ind].slug ) {
604
+ match = pluginsList[ind];
605
+ }
606
+ }
607
+ return match;
608
+ },
609
+
610
+ _bulkPluginInstallActivate: function() {
611
+
612
+ if( 0 === AstraElementorSitesAdmin.requiredPlugins.length ) {
613
+ return;
614
+ }
615
+
616
+ console.groupCollapsed( 'Bulk Plugin Install Process Started' );
617
+
618
+ // If has class the skip-plugins then,
619
+ // Avoid installing 3rd party plugins.
620
+ var not_installed = AstraElementorSitesAdmin.requiredPlugins.notinstalled || '';
621
+ var activate_plugins = AstraElementorSitesAdmin.requiredPlugins.inactive || '';
622
+
623
+ console.log( AstraElementorSitesAdmin.requiredPlugins );
624
+
625
+ // First Install Bulk.
626
+ if( not_installed.length > 0 ) {
627
+ AstraElementorSitesAdmin._installAllPlugins( not_installed );
628
+ }
629
+
630
+ // Second Activate Bulk.
631
+ if( activate_plugins.length > 0 ) {
632
+ AstraElementorSitesAdmin._activateAllPlugins( activate_plugins );
633
+ }
634
+
635
+ if( activate_plugins.length <= 0 && not_installed.length <= 0 ) {
636
+ AstraElementorSitesAdmin._enableImport();
637
+ }
638
+ },
639
+
640
+ _importTemplate: function( e ) {
641
+
642
+ if ( ! AstraElementorSitesAdmin.canImport ) {
643
+ if ( $( this ).attr( 'data-demo-link' ) != undefined ) {
644
+ window.open( $( this ).attr( 'data-demo-link' ), '_blank' );
645
+ }
646
+ return;
647
+ }
648
+
649
+ AstraElementorSitesAdmin.canImport = false;
650
+
651
+ var str = ( AstraElementorSitesAdmin.type == 'pages' ) ? 'Template' : 'Block';
652
+
653
+ $( this ).addClass( 'installing' );
654
+ $( this ).text( 'Saving ' + str + '...' );
655
+
656
+ AstraElementorSitesAdmin.action = 'import';
657
+
658
+ AstraElementorSitesAdmin._bulkPluginInstallActivate();
659
+ },
660
+
661
+ _unescape: function( input_string ) {
662
+ var title = _.unescape( input_string );
663
+
664
+ // @todo check why below character not escape with function _.unescape();
665
+ title = title.replace('&#8211;', '-' );
666
+
667
+ return title;
668
+ },
669
+
670
+ _unescape_lower: function( input_string ) {
671
+ input_string = $( "<textarea/>") .html( input_string ).text()
672
+ var input_string = AstraElementorSitesAdmin._unescape( input_string );
673
+ return input_string.toLowerCase();
674
+ },
675
+
676
+ _search: function() {
677
+
678
+ let search_term = $( this ).val() || '';
679
+ search_term = search_term.toLowerCase();
680
+
681
+ if ( 'pages' == AstraElementorSitesAdmin.type ) {
682
+
683
+ var items = AstraElementorSitesAdmin._getSearchedPages( search_term );
684
+
685
+ if( search_term.length ) {
686
+ $( this ).addClass( 'has-input' );
687
+ AstraElementorSitesAdmin._addSites( items );
688
+ } else {
689
+ $( this ).removeClass( 'has-input' );
690
+ AstraElementorSitesAdmin._appendSites( astraElementorSites.default_page_builder_sites );
691
+ }
692
+ } else {
693
+
694
+ var items = AstraElementorSitesAdmin._getSearchedBlocks( search_term );
695
+
696
+ if( search_term.length ) {
697
+ $( this ).addClass( 'has-input' );
698
+ AstraElementorSitesAdmin._appendBlocks( items );
699
+ } else {
700
+ $( this ).removeClass( 'has-input' );
701
+ AstraElementorSitesAdmin._appendBlocks( astraElementorSites.astra_blocks );
702
+ }
703
+ }
704
+ },
705
+
706
+ _getSearchedPages: function( search_term ) {
707
+ var items = [];
708
+ search_term = search_term.toLowerCase();
709
+
710
+ for( site_id in astraElementorSites.default_page_builder_sites ) {
711
+
712
+ var current_site = astraElementorSites.default_page_builder_sites[site_id];
713
+
714
+ // Check in site title.
715
+ if( current_site['title'] ) {
716
+ var site_title = AstraElementorSitesAdmin._unescape_lower( current_site['title'] );
717
+
718
+ if( site_title.toLowerCase().includes( search_term ) ) {
719
+
720
+ for( page_id in current_site['pages'] ) {
721
+
722
+ items[page_id] = current_site['pages'][page_id];
723
+ items[page_id]['type'] = 'page';
724
+ items[page_id]['site_id'] = site_id;
725
+ items[page_id]['astra-sites-type'] = current_site['astra-sites-type'] || '';
726
+ items[page_id]['parent-site-name'] = current_site['title'] || '';
727
+ items[page_id]['pages-count'] = 0;
728
+ }
729
+ }
730
+ }
731
+
732
+ // Check in site tags.
733
+ if ( undefined != current_site['astra-sites-tag'] ) {
734
+
735
+ if( Object.keys( current_site['astra-sites-tag'] ).length ) {
736
+ for( site_tag_id in current_site['astra-sites-tag'] ) {
737
+ var tag_title = current_site['astra-sites-tag'][site_tag_id];
738
+ tag_title = AstraElementorSitesAdmin._unescape_lower( tag_title.replace('-', ' ') );
739
+
740
+ if( tag_title.toLowerCase().includes( search_term ) ) {
741
+
742
+ for( page_id in current_site['pages'] ) {
743
+
744
+ items[page_id] = current_site['pages'][page_id];
745
+ items[page_id]['type'] = 'page';
746
+ items[page_id]['site_id'] = site_id;
747
+ items[page_id]['astra-sites-type'] = current_site['astra-sites-type'] || '';
748
+ items[page_id]['parent-site-name'] = current_site['title'] || '';
749
+ items[page_id]['pages-count'] = 0;
750
+ }
751
+ }
752
+ }
753
+ }
754
+ }
755
+
756
+ // Check in page title.
757
+ if( Object.keys( current_site['pages'] ).length ) {
758
+ var pages = current_site['pages'];
759
+
760
+ for( page_id in pages ) {
761
+
762
+ // Check in site title.
763
+ if( pages[page_id]['title'] ) {
764
+
765
+ var page_title = AstraElementorSitesAdmin._unescape_lower( pages[page_id]['title'] );
766
+
767
+ if( page_title.toLowerCase().includes( search_term ) ) {
768
+ items[page_id] = pages[page_id];
769
+ items[page_id]['type'] = 'page';
770
+ items[page_id]['site_id'] = site_id;
771
+ items[page_id]['astra-sites-type'] = current_site['astra-sites-type'] || '';
772
+ items[page_id]['parent-site-name'] = current_site['title'] || '';
773
+ items[page_id]['pages-count'] = 0;
774
+ }
775
+ }
776
+
777
+ // Check in site tags.
778
+ if ( undefined != pages[page_id]['astra-sites-tag'] ) {
779
+
780
+ if( Object.keys( pages[page_id]['astra-sites-tag'] ).length ) {
781
+ for( page_tag_id in pages[page_id]['astra-sites-tag'] ) {
782
+ var page_tag_title = pages[page_id]['astra-sites-tag'][page_tag_id];
783
+ page_tag_title = AstraElementorSitesAdmin._unescape_lower( page_tag_title.replace('-', ' ') );
784
+ if( page_tag_title.toLowerCase().includes( search_term ) ) {
785
+ items[page_id] = pages[page_id];
786
+ items[page_id]['type'] = 'page';
787
+ items[page_id]['site_id'] = site_id;
788
+ items[page_id]['astra-sites-type'] = current_site['astra-sites-type'] || '';
789
+ items[page_id]['parent-site-name'] = current_site['title'] || '';
790
+ items[page_id]['pages-count'] = 0;
791
+ }
792
+ }
793
+ }
794
+ }
795
+
796
+ }
797
+ }
798
+ }
799
+
800
+ return items;
801
+ },
802
+
803
+ _getSearchedBlocks: function( search_term ) {
804
+
805
+ var items = [];
806
+
807
+ if( search_term.length ) {
808
+
809
+ for( block_id in astraElementorSites.astra_blocks ) {
810
+
811
+ var current_site = astraElementorSites.astra_blocks[block_id];
812
+
813
+ // Check in site title.
814
+ if( current_site['title'] ) {
815
+ var site_title = AstraElementorSitesAdmin._unescape_lower( current_site['title'] );
816
+
817
+ if( site_title.toLowerCase().includes( search_term ) ) {
818
+ items[block_id] = current_site;
819
+ items[block_id]['type'] = 'site';
820
+ items[block_id]['site_id'] = block_id;
821
+ }
822
+ }
823
+
824
+ // Check in site tags.
825
+ if( Object.keys( current_site['tag'] ).length ) {
826
+ for( site_tag_id in current_site['tag'] ) {
827
+ var tag_title = AstraElementorSitesAdmin._unescape_lower( current_site['tag'][site_tag_id] );
828
+
829
+ if( tag_title.toLowerCase().includes( search_term ) ) {
830
+ items[block_id] = current_site;
831
+ items[block_id]['type'] = 'site';
832
+ items[block_id]['site_id'] = block_id;
833
+ }
834
+ }
835
+ }
836
+ }
837
+ }
838
+
839
+ return items;
840
+ },
841
+
842
+ _addSites: function( data ) {
843
+
844
+ if ( data ) {
845
+ let single_template = wp.template( 'astra-sites-search' );
846
+ pages_list = single_template( data );
847
+ $elscope.find( '.dialog-lightbox-content' ).html( pages_list );
848
+ AstraElementorSitesAdmin._loadLargeImages();
849
+
850
+ } else {
851
+ $elscope.find( '.dialog-lightbox-content' ).html( wp.template('astra-sites-no-sites') );
852
+ }
853
+ },
854
+
855
+ _appendSites: function( data ) {
856
+
857
+ let single_template = wp.template( 'astra-sites-list' );
858
+ pages_list = single_template( data );
859
+ $elscope.find( '.dialog-lightbox-message-block' ).hide();
860
+ $elscope.find( '.dialog-lightbox-message' ).show();
861
+ $elscope.find( '.dialog-lightbox-content' ).html( pages_list );
862
+ AstraElementorSitesAdmin._loadLargeImages();
863
+ },
864
+
865
+ _appendBlocks: function( data ) {
866
+
867
+ let single_template = wp.template( 'astra-blocks-list' );
868
+ let blocks_list = single_template( data );
869
+ $elscope.find( '.dialog-lightbox-message' ).hide();
870
+ $elscope.find( '.dialog-lightbox-message-block' ).show();
871
+ $elscope.find( '.dialog-lightbox-content-block' ).html( blocks_list );
872
+ AstraElementorSitesAdmin._masonry();
873
+ },
874
+
875
+ _masonry: function() {
876
+
877
+ //create empty var masonryObj
878
+ var masonryObj;
879
+ var container = document.querySelector( '.dialog-lightbox-content-block' );
880
+ // initialize Masonry after all images have loaded
881
+ imagesLoaded( container, function() {
882
+ masonryObj = new Masonry( container, {
883
+ itemSelector: '.astra-sites-library-template'
884
+ });
885
+ });
886
+ },
887
+
888
+ _enableImport: function() {
889
+
890
+ console.log( 'Required Plugins Process Done.' );
891
+ console.groupEnd();
892
+
893
+ if ( 'pages' == AstraElementorSitesAdmin.type ) {
894
+
895
+ AstraElementorSitesAdmin._importWPForm( AstraElementorSitesAdmin.templateData['astra-site-wpforms-path'], function( form_response ) {
896
+
897
+ fetch( AstraElementorSitesAdmin.templateData['astra-page-api-url'] + '?&track=true&site_url=' + astraElementorSites.siteURL ).then(response => {
898
+ return response.json();
899
+ }).then( data => {
900
+ AstraElementorSitesAdmin.insertData = data;
901
+ if ( 'insert' == AstraElementorSitesAdmin.action ) {
902
+ AstraElementorSitesAdmin._insertDemo( data );
903
+ } else {
904
+ AstraElementorSitesAdmin._createTemplate( data );
905
+ }
906
+ }).catch( err => {
907
+ console.log( err );
908
+ console.groupEnd();
909
+ });
910
+ });
911
+
912
+ } else {
913
+
914
+ AstraElementorSitesAdmin._importWPForm( AstraElementorSitesAdmin.templateData['post-meta']['astra-site-wpforms-path'], function( form_response ) {
915
+ AstraElementorSitesAdmin.insertData = AstraElementorSitesAdmin.templateData;
916
+ if ( 'insert' == AstraElementorSitesAdmin.action ) {
917
+ AstraElementorSitesAdmin._insertDemo( AstraElementorSitesAdmin.templateData );
918
+ } else {
919
+ AstraElementorSitesAdmin._createTemplate( AstraElementorSitesAdmin.templateData );
920
+ }
921
+ });
922
+
923
+
924
+ }
925
+ },
926
+
927
+ _insert: function( e ) {
928
+
929
+ if ( ! AstraElementorSitesAdmin.canInsert ) {
930
+ return;
931
+ }
932
+
933
+ AstraElementorSitesAdmin.canInsert = false;
934
+ var str = ( AstraElementorSitesAdmin.type == 'pages' ) ? 'Template' : 'Block';
935
+
936
+ $( this ).addClass( 'installing' );
937
+ $( this ).text( 'Importing ' + str + '...' );
938
+
939
+ AstraElementorSitesAdmin.action = 'insert';
940
+
941
+ AstraElementorSitesAdmin._bulkPluginInstallActivate();
942
+ },
943
+
944
+ _insertDemo: function( data ) {
945
+
946
+ if ( undefined !== data && undefined !== data[ 'post-meta' ][ '_elementor_data' ] ) {
947
+
948
+ let templateModel = new Backbone.Model({
949
+ getTitle() {
950
+ return data['title']
951
+ },
952
+ });
953
+ let page_content = JSON.parse( data[ 'post-meta' ][ '_elementor_data' ]);
954
+ let page_settings = '';
955
+ let api_url = '';
956
+
957
+ if ( 'blocks' == AstraElementorSitesAdmin.type ) {
958
+ api_url = astraElementorSites.ApiURL + 'astra-blocks/' + data['id'] + '/?&track=true&site_url=' + astraElementorSites.siteURL;
959
+ } else {
960
+ api_url = AstraElementorSitesAdmin.templateData['astra-page-api-url'] + '?&track=true&site_url=' + astraElementorSites.siteURL;
961
+ }
962
+
963
+ $.ajax({
964
+ url : astraElementorSites.ajaxurl,
965
+ type : 'POST',
966
+ data : {
967
+ action : 'astra-page-elementor-batch-process',
968
+ id : elementor.config.document.id,
969
+ url : api_url,
970
+ _ajax_nonce : astraElementorSites._ajax_nonce,
971
+ },
972
+ beforeSend: function() {
973
+ console.groupCollapsed( 'Inserting Demo.' );
974
+ },
975
+ })
976
+ .fail(function( jqXHR ){
977
+ console.log( jqXHR );
978
+ console.groupEnd();
979
+ })
980
+ .done(function ( response ) {
981
+
982
+ page_content = response.data;
983
+
984
+ console.log( page_content );
985
+ console.groupEnd();
986
+
987
+ if ( undefined !== page_content && '' !== page_content ) {
988
+ elementor.channels.data.trigger('template:before:insert', templateModel);
989
+ elementor.getPreviewView().addChildModel( page_content, { at : AstraElementorSitesAdmin.index } || {} );
990
+ elementor.channels.data.trigger('template:after:insert', {});
991
+ if ( undefined != $e && 'undefined' != typeof $e.internal ) {
992
+ $e.internal( 'document/save/set-is-modified', { status: true } )
993
+ } else {
994
+ elementor.saver.setFlagEditorChange(true);
995
+ }
996
+ }
997
+ AstraElementorSitesAdmin.insertActionFlag = true;
998
+ AstraElementorSitesAdmin._close();
999
+ });
1000
+ }
1001
+ },
1002
+
1003
+ _goBack: function( e ) {
1004
+
1005
+ let step = $( this ).attr( 'data-step' );
1006
+
1007
+ $elscope.find( '.astra-sites-step-1-wrap' ).show();
1008
+ $elscope.find( '.astra-preview-actions-wrap' ).remove();
1009
+
1010
+ if ( 'pages' == AstraElementorSitesAdmin.type ) {
1011
+
1012
+ if ( 3 == step ) {
1013
+ $( this ).attr( 'data-step', 2 );
1014
+ $( document ).trigger( 'astra-sites__elementor-goback-step-2' );
1015
+ } else if ( 2 == step ) {
1016
+ $( this ).attr( 'data-step', 1 );
1017
+ $( document ).trigger( 'astra-sites__elementor-goback-step-1' );
1018
+ }
1019
+ } else {
1020
+ $( this ).attr( 'data-step', 1 );
1021
+ $( document ).trigger( 'astra-sites__elementor-goback-step-1' );
1022
+ }
1023
+
1024
+ $elscope.find( '.astra-sites-content-wrap' ).trigger( 'scroll' );
1025
+ },
1026
+
1027
+ _goStep1: function( e ) {
1028
+
1029
+
1030
+ // Reset site and page ids to null.
1031
+ AstraElementorSitesAdmin.site_id = '';
1032
+ AstraElementorSitesAdmin.page_id = '';
1033
+ AstraElementorSitesAdmin.block_id = '';
1034
+ AstraElementorSitesAdmin.requiredPlugins = [];
1035
+ AstraElementorSitesAdmin.templateData = {};
1036
+ AstraElementorSitesAdmin.canImport = false;
1037
+ AstraElementorSitesAdmin.canInsert = false;
1038
+
1039
+ // Hide Back button.
1040
+ $elscope.find( '.back-to-layout' ).css( 'visibility', 'hidden' );
1041
+ $elscope.find( '.back-to-layout' ).css( 'opacity', '0' );
1042
+
1043
+ // Hide Preview Page.
1044
+ $elscope.find( '.theme-preview' ).hide();
1045
+ $elscope.find( '.theme-preview' ).html( '' );
1046
+ $elscope.find( '.theme-preview-block' ).hide();
1047
+ $elscope.find( '.theme-preview-block' ).html( '' );
1048
+ $elscope.find( '.astra-blocks-category-wrap' ).show();
1049
+
1050
+ // Show listing page.
1051
+ if( AstraElementorSitesAdmin.type == 'pages' ) {
1052
+
1053
+ $elscope.find( '.dialog-lightbox-content' ).show();
1054
+ $elscope.find( '.dialog-lightbox-content-block' ).hide();
1055
+
1056
+ // Set listing HTML.
1057
+ AstraElementorSitesAdmin._appendSites( astraElementorSites.default_page_builder_sites );
1058
+ } else {
1059
+
1060
+ // Set listing HTML.
1061
+ AstraElementorSitesAdmin._appendBlocks( astraElementorSites.astra_blocks );
1062
+
1063
+ $elscope.find( '.dialog-lightbox-content-block' ).show();
1064
+ $elscope.find( '.dialog-lightbox-content' ).hide();
1065
+
1066
+ if ( '' !== $elscope.find( '#wp-filter-search-input' ).val() ) {
1067
+ $elscope.find( '#wp-filter-search-input' ).trigger( 'keyup' );
1068
+ }
1069
+ }
1070
+ },
1071
+
1072
+ _goStep2: function( e ) {
1073
+
1074
+ // Set page and site ids.
1075
+ AstraElementorSitesAdmin.site_id = $elscope.find( '#astra-blocks' ).data( 'site-id' );
1076
+ AstraElementorSitesAdmin.page_id = '';
1077
+
1078
+ if ( undefined === AstraElementorSitesAdmin.site_id ) {
1079
+ return;
1080
+ }
1081
+
1082
+ // Single Preview template.
1083
+ let single_template = wp.template( 'astra-sites-list-search' );
1084
+ let passing_data = astraElementorSites.default_page_builder_sites[ AstraElementorSitesAdmin.site_id ]['pages'];
1085
+ passing_data['site_id'] = AstraElementorSitesAdmin.site_id;
1086
+ pages_list = single_template( passing_data );
1087
+ $elscope.find( '.dialog-lightbox-content' ).html( pages_list );
1088
+
1089
+ // Hide Preview page.
1090
+ $elscope.find( '.theme-preview' ).hide();
1091
+ $elscope.find( '.theme-preview' ).html( '' );
1092
+ $elscope.find( '.astra-blocks-category-wrap' ).show();
1093
+ $elscope.find( '.theme-preview-block' ).hide();
1094
+ $elscope.find( '.theme-preview-block' ).html( '' );
1095
+
1096
+ // Show listing page.
1097
+ $elscope.find( '.dialog-lightbox-content' ).show();
1098
+ $elscope.find( '.dialog-lightbox-content-block' ).hide();
1099
+
1100
+ AstraElementorSitesAdmin._loadLargeImages();
1101
+
1102
+ if ( '' !== $elscope.find( '#wp-filter-search-input' ).val() ) {
1103
+ $elscope.find( '#wp-filter-search-input' ).trigger( 'keyup' );
1104
+ }
1105
+ },
1106
+
1107
+ _step1: function( e ) {
1108
+
1109
+ if ( 'pages' == AstraElementorSitesAdmin.type ) {
1110
+
1111
+ let passing_data = astraElementorSites.default_page_builder_sites[ AstraElementorSitesAdmin.site_id ]['pages'];
1112
+
1113
+ var count = 0;
1114
+ var one_page = [];
1115
+ var one_page_id = '';
1116
+
1117
+ for ( key in passing_data ) {
1118
+ if ( undefined == passing_data[ key ]['site-pages-type'] ) {
1119
+ continue;
1120
+ }
1121
+ if ( 'gutenberg' == passing_data[key]['site-pages-page-builder'] ) {
1122
+ continue;
1123
+ }
1124
+ count++;
1125
+ one_page = passing_data[ key ];
1126
+ one_page_id = key;
1127
+ }
1128
+
1129
+ if ( count == 1 ) {
1130
+
1131
+ // Logic for one page sites.
1132
+ AstraElementorSitesAdmin.page_id = one_page_id;
1133
+
1134
+ $elscope.find( '.back-to-layout' ).css( 'visibility', 'visible' );
1135
+ $elscope.find( '.back-to-layout' ).css( 'opacity', '1' );
1136
+
1137
+ $elscope.find( '.back-to-layout' ).attr( 'data-step', 2 );
1138
+ $( document ).trigger( 'astra-sites__elementor-do-step-2' );
1139
+
1140
+ return;
1141
+ }
1142
+
1143
+
1144
+ let single_template = wp.template( 'astra-sites-list-search' );
1145
+ passing_data['site_id'] = AstraElementorSitesAdmin.site_id;
1146
+ pages_list = single_template( passing_data );
1147
+ $elscope.find( '.dialog-lightbox-content-block' ).hide();
1148
+ $elscope.find( '.astra-sites-step-1-wrap' ).show();
1149
+ $elscope.find( '.astra-preview-actions-wrap' ).remove();
1150
+ $elscope.find( '.theme-preview' ).hide();
1151
+ $elscope.find( '.theme-preview' ).html( '' );
1152
+ $elscope.find( '.astra-blocks-category-wrap' ).show();
1153
+ $elscope.find( '.theme-preview-block' ).hide();
1154
+ $elscope.find( '.theme-preview-block' ).html( '' );
1155
+ $elscope.find( '.dialog-lightbox-content' ).show();
1156
+ $elscope.find( '.dialog-lightbox-content' ).html( pages_list );
1157
+
1158
+ AstraElementorSitesAdmin._loadLargeImages();
1159
+
1160
+ } else {
1161
+
1162
+ $elscope.find( '.dialog-lightbox-content' ).hide();
1163
+ $elscope.find( '.dialog-lightbox-content-block' ).hide();
1164
+ $elscope.find( '.dialog-lightbox-message' ).animate({ scrollTop: 0 }, 50 );
1165
+ $elscope.find( '.theme-preview-block' ).show();
1166
+ $elscope.find( '.astra-blocks-category-wrap' ).hide();
1167
+
1168
+ // Hide.
1169
+ $elscope.find( '.theme-preview' ).hide();
1170
+ $elscope.find( '.theme-preview' ).html( '' );
1171
+
1172
+ let import_template = wp.template( 'astra-sites-elementor-preview' );
1173
+ let import_template_header = wp.template( 'astra-sites-elementor-preview-actions' );
1174
+ let template_object = astraElementorSites.astra_blocks[ AstraElementorSitesAdmin.block_id ];
1175
+
1176
+ template_object['id'] = AstraElementorSitesAdmin.block_id;
1177
+
1178
+ preview_page_html = import_template( template_object );
1179
+ $elscope.find( '.theme-preview-block' ).html( preview_page_html );
1180
+
1181
+ $elscope.find( '.astra-sites-step-1-wrap' ).hide();
1182
+
1183
+ preview_action_html = import_template_header( template_object );
1184
+ $elscope.find( '.elementor-templates-modal__header__items-area' ).before( preview_action_html );
1185
+ AstraElementorSitesAdmin._masonry();
1186
+
1187
+ let actual_id = AstraElementorSitesAdmin.block_id.replace( 'id-', '' );
1188
+ $( document ).trigger( 'astra-sites__elementor-plugin-check', { 'id': actual_id } );
1189
+ }
1190
+ },
1191
+
1192
+ _step2: function( e ) {
1193
+
1194
+ $elscope.find( '.dialog-lightbox-content' ).hide();
1195
+ $elscope.find( '.dialog-lightbox-message' ).animate({ scrollTop: 0 }, 50 );
1196
+ $elscope.find( '.theme-preview' ).show();
1197
+
1198
+ if ( undefined === AstraElementorSitesAdmin.site_id ) {
1199
+ return;
1200
+ }
1201
+
1202
+ let import_template = wp.template( 'astra-sites-elementor-preview' );
1203
+ let import_template_header = wp.template( 'astra-sites-elementor-preview-actions' );
1204
+ let template_object = astraElementorSites.default_page_builder_sites[ AstraElementorSitesAdmin.site_id ]['pages'][ AstraElementorSitesAdmin.page_id ];
1205
+
1206
+ if ( undefined === template_object ) {
1207
+ return;
1208
+ }
1209
+
1210
+ template_object['id'] = AstraElementorSitesAdmin.site_id;
1211
+
1212
+ preview_page_html = import_template( template_object );
1213
+ $elscope.find( '.theme-preview' ).html( preview_page_html );
1214
+
1215
+ $elscope.find( '.astra-sites-step-1-wrap' ).hide();
1216
+
1217
+ preview_action_html = import_template_header( template_object );
1218
+ $elscope.find( '.elementor-templates-modal__header__items-area' ).before( preview_action_html );
1219
+
1220
+ let actual_id = AstraElementorSitesAdmin.page_id.replace( 'id-', '' );
1221
+ $( document ).trigger( 'astra-sites__elementor-plugin-check', { 'id': actual_id } );
1222
+ },
1223
+
1224
+ _preview : function( e ) {
1225
+
1226
+ let step = $( this ).attr( 'data-step' );
1227
+
1228
+ AstraElementorSitesAdmin.site_id = $( this ).closest( '.astra-theme' ).data( 'site-id' );
1229
+ AstraElementorSitesAdmin.page_id = $( this ).closest( '.astra-theme' ).data( 'template-id' );
1230
+ AstraElementorSitesAdmin.block_id = $( this ).closest( '.astra-theme' ).data( 'block-id' );
1231
+
1232
+ $elscope.find( '.back-to-layout' ).css( 'visibility', 'visible' );
1233
+ $elscope.find( '.back-to-layout' ).css( 'opacity', '1' );
1234
+
1235
+ if ( 1 == step ) {
1236
+
1237
+ $elscope.find( '.back-to-layout' ).attr( 'data-step', 2 );
1238
+ $( document ).trigger( 'astra-sites__elementor-do-step-1' );
1239
+
1240
+ } else {
1241
+
1242
+ $elscope.find( '.back-to-layout' ).attr( 'data-step', 3 );
1243
+ $( document ).trigger( 'astra-sites__elementor-do-step-2' );
1244
+
1245
+ }
1246
+ },
1247
+
1248
+ _pluginCheck : function( e, data ) {
1249
+
1250
+ var api_post = {
1251
+ slug: 'site-pages' + '/' + data['id']
1252
+ };
1253
+
1254
+ if ( 'blocks' == AstraElementorSitesAdmin.type ) {
1255
+ api_post = {
1256
+ slug: 'astra-blocks' + '/' + data['id']
1257
+ };
1258
+ }
1259
+
1260
+
1261
+ var params = {
1262
+ method: 'GET',
1263
+ cache: 'default',
1264
+ };
1265
+
1266
+ fetch( astraElementorSites.ApiURL + api_post.slug, params ).then( response => {
1267
+ if ( response.status === 200 ) {
1268
+ return response.json().then(items => ({
1269
+ items : items,
1270
+ items_count : response.headers.get( 'x-wp-total' ),
1271
+ item_pages : response.headers.get( 'x-wp-totalpages' ),
1272
+ }))
1273
+ } else {
1274
+ //$(document).trigger( 'astra-sites-api-request-error' );
1275
+ return response.json();
1276
+ }
1277
+ })
1278
+ .then(data => {
1279
+ if( 'object' === typeof data ) {
1280
+ if ( undefined !== data && undefined !== data['items'] ) {
1281
+ AstraElementorSitesAdmin.templateData = data['items'];
1282
+ if ( AstraElementorSitesAdmin.type == 'pages' ) {
1283
+
1284
+ if ( undefined !== AstraElementorSitesAdmin.templateData['site-pages-required-plugins'] ) {
1285
+ AstraElementorSitesAdmin._requiredPluginsMarkup( AstraElementorSitesAdmin.templateData['site-pages-required-plugins'] );
1286
+ }
1287
+ } else {
1288
+ if ( undefined !== AstraElementorSitesAdmin.templateData['post-meta']['astra-blocks-required-plugins'] ) {
1289
+ AstraElementorSitesAdmin._requiredPluginsMarkup( AstraElementorSitesAdmin.templateData['post-meta']['astra-blocks-required-plugins'] );
1290
+ }
1291
+ }
1292
+ }
1293
+ }
1294
+ });
1295
+ },
1296
+
1297
+ _requiredPluginsMarkup: function( requiredPlugins ) {
1298
+
1299
+ if( '' === requiredPlugins ) {
1300
+ return;
1301
+ }
1302
+
1303
+ if (
1304
+ AstraElementorSitesAdmin.type == 'pages' &&
1305
+ astraElementorSites.default_page_builder_sites[AstraElementorSitesAdmin.site_id]['astra-sites-type'] != undefined &&
1306
+ astraElementorSites.default_page_builder_sites[AstraElementorSitesAdmin.site_id]['astra-sites-type'] != 'free'
1307
+ ) {
1308
+
1309
+ if ( ! astraElementorSites.license_status ) {
1310
+
1311
+ output = '<p class="ast-validate">' + astraElementorSites.license_msg + '</p>';
1312
+
1313
+ $elscope.find('.required-plugins-list').html( output );
1314
+ $elscope.find('.ast-tooltip-wrap').css( 'opacity', 1 );
1315
+ $elscope.find('.astra-sites-tooltip').css( 'opacity', 1 );
1316
+
1317
+ /**
1318
+ * Enable Demo Import Button
1319
+ * @type number
1320
+ */
1321
+ AstraElementorSitesAdmin.requiredPlugins = [];
1322
+ AstraElementorSitesAdmin.canImport = true;
1323
+ AstraElementorSitesAdmin.canInsert = true;
1324
+ $elscope.find( '.astra-sites-import-template-action > div' ).removeClass( 'disabled' );
1325
+ return;
1326
+ }
1327
+
1328
+ }
1329
+
1330
+ // Required Required.
1331
+ $.ajax({
1332
+ url : astraElementorSites.ajaxurl,
1333
+ type : 'POST',
1334
+ data : {
1335
+ action : 'astra-required-plugins',
1336
+ _ajax_nonce : astraElementorSites._ajax_nonce,
1337
+ required_plugins : requiredPlugins
1338
+ },
1339
+ })
1340
+ .fail(function( jqXHR ){
1341
+ console.log( jqXHR );
1342
+ console.groupEnd();
1343
+ })
1344
+ .done(function ( response ) {
1345
+
1346
+ var output = '';
1347
+
1348
+ /**
1349
+ * Count remaining plugins.
1350
+ * @type number
1351
+ */
1352
+ var remaining_plugins = 0;
1353
+ var required_plugins_markup = '';
1354
+
1355
+ required_plugins = response.data['required_plugins'];
1356
+
1357
+ if( response.data['third_party_required_plugins'].length ) {
1358
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
1359
+ }
1360
+
1361
+ /**
1362
+ * Not Installed
1363
+ *
1364
+ * List of not installed required plugins.
1365
+ */
1366
+ if ( typeof required_plugins.notinstalled !== 'undefined' ) {
1367
+
1368
+ // Add not have installed plugins count.
1369
+ remaining_plugins += parseInt( required_plugins.notinstalled.length );
1370
+
1371
+ $( required_plugins.notinstalled ).each(function( index, plugin ) {
1372
+ if ( 'elementor' == plugin.slug ) {
1373
+ return;
1374
+ }
1375
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
1376
+ });
1377
+ }
1378
+
1379
+ /**
1380
+ * Inactive
1381
+ *
1382
+ * List of not inactive required plugins.
1383
+ */
1384
+ if ( typeof required_plugins.inactive !== 'undefined' ) {
1385
+
1386
+ // Add inactive plugins count.
1387
+ remaining_plugins += parseInt( required_plugins.inactive.length );
1388
+
1389
+ $( required_plugins.inactive ).each(function( index, plugin ) {
1390
+ if ( 'elementor' == plugin.slug ) {
1391
+ return;
1392
+ }
1393
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
1394
+ });
1395
+ }
1396
+
1397
+ /**
1398
+ * Active
1399
+ *
1400
+ * List of not active required plugins.
1401
+ */
1402
+ if ( typeof required_plugins.active !== 'undefined' ) {
1403
+
1404
+ $( required_plugins.active ).each(function( index, plugin ) {
1405
+ if ( 'elementor' == plugin.slug ) {
1406
+ return;
1407
+ }
1408
+ output += '<li class="plugin-card plugin-card-'+plugin.slug+'" data-slug="'+plugin.slug+'" data-init="'+plugin.init+'" data-name="'+plugin.name+'">'+plugin.name+'</li>';
1409
+ });
1410
+ }
1411
+
1412
+ if ( '' != output ) {
1413
+ output = '<li class="plugin-card-head"><strong>Install Required Plugins</strong></li>' + output;
1414
+ $elscope.find('.required-plugins-list').html( output );
1415
+ $elscope.find('.ast-tooltip-wrap').css( 'opacity', 1 );
1416
+ $elscope.find('.astra-sites-tooltip').css( 'opacity', 1 );
1417
+ }
1418
+
1419
+
1420
+ /**
1421
+ * Enable Demo Import Button
1422
+ * @type number
1423
+ */
1424
+ AstraElementorSitesAdmin.requiredPlugins = response.data['required_plugins'];
1425
+ AstraElementorSitesAdmin.canImport = true;
1426
+ AstraElementorSitesAdmin.canInsert = true;
1427
+ $elscope.find( '.astra-sites-import-template-action > div' ).removeClass( 'disabled' );
1428
+ });
1429
+ },
1430
+
1431
+ _libraryClick: function( e ) {
1432
+ $elscope.find( ".elementor-template-library-menu-item" ).each( function() {
1433
+ $(this).removeClass( 'elementor-active' );
1434
+ } );
1435
+ $( this ).addClass( 'elementor-active' );
1436
+ },
1437
+
1438
+ _loadLargeImage: function( el ) {
1439
+
1440
+ if( el.hasClass('loaded') ) {
1441
+ return;
1442
+ }
1443
+
1444
+ if( el.parents('.astra-theme').isInViewport() ) {
1445
+ var large_img_url = el.data('src') || '';
1446
+ var imgLarge = new Image();
1447
+ imgLarge.src = large_img_url;
1448
+ imgLarge.onload = function () {
1449
+ el.removeClass('loading');
1450
+ el.addClass('loaded');
1451
+ el.css('background-image', 'url(\''+imgLarge.src+'\'' );
1452
+ };
1453
+ }
1454
+ },
1455
+
1456
+ _loadLargeImages: function() {
1457
+ $elscope.find('.theme-screenshot').each(function( key, el ) {
1458
+ AstraElementorSitesAdmin._loadLargeImage( $(el) );
1459
+ });
1460
+ },
1461
+
1462
+ _close: function( e ) {
1463
+ console.groupEnd( 'Process Done.' );
1464
+ $( document ).trigger( 'astra-sites__elementor-close-before' );
1465
+ setTimeout( function() {
1466
+ $elscope.fadeOut();
1467
+ $( 'body' ).removeClass( 'astra-sites__elementor-open' );
1468
+ }, 300 );
1469
+ $( document ).trigger( 'astra-sites__elementor-close-after' );
1470
+ },
1471
+
1472
+ _open: function( e ) {
1473
+ $( document ).trigger( 'astra-sites__elementor-open-before' );
1474
+
1475
+ $( 'body' ).addClass( 'astra-sites__elementor-open' );
1476
+
1477
+ let add_section = $( this ).closest( '.elementor-add-section' );
1478
+
1479
+ if ( add_section.hasClass( 'elementor-add-section-inline' ) ) {
1480
+ AstraElementorSitesAdmin.index = add_section.prevAll().length;
1481
+ } else {
1482
+ AstraElementorSitesAdmin.index = add_section.prev().children().length;
1483
+ }
1484
+ AstraElementorSitesAdmin._home();
1485
+ $elscope.fadeIn();
1486
+ if ( $( '.refreshed-notice' ).length == 1 ) {
1487
+ setTimeout(
1488
+ function() {
1489
+ $( '.refreshed-notice' ).find( '.notice-dismiss' ).click();
1490
+ },
1491
+ 2500
1492
+ );
1493
+ }
1494
+ $( document ).trigger( 'astra-sites__elementor-open-after' );
1495
+ },
1496
+
1497
+ _beforeOpen: function( e ) {
1498
+
1499
+ let userPrefersDark = matchMedia( '(prefers-color-scheme: dark)' ).matches;
1500
+ let uiTheme = elementor.settings.editorPreferences.model.get( 'ui_theme' );
1501
+
1502
+ if ( 'dark' === uiTheme || ( 'auto' === uiTheme && userPrefersDark ) ) {
1503
+ $( 'body' ).addClass( 'ast-sites-dark-mode' );
1504
+ } else {
1505
+ $( 'body' ).removeClass( 'ast-sites-dark-mode' );
1506
+ }
1507
+
1508
+ // Hide preview page.
1509
+ $elscope.find( '.theme-preview' ).hide();
1510
+ $elscope.find( '.theme-preview' ).html( '' );
1511
+
1512
+ // Show site listing page.
1513
+ $elscope.find( '.dialog-lightbox-content' ).show();
1514
+
1515
+ // Hide Back button.
1516
+ $elscope.find( '.back-to-layout' ).css( 'visibility', 'hidden' );
1517
+ $elscope.find( '.back-to-layout' ).css( 'opacity', '0' );
1518
+ },
1519
+
1520
+ _initSites: function( e ) {
1521
+ AstraElementorSitesAdmin._appendSites( astraElementorSites.default_page_builder_sites );
1522
+ AstraElementorSitesAdmin._goBack();
1523
+ },
1524
+
1525
+ _initBlocks: function( e ) {
1526
+ AstraElementorSitesAdmin._appendBlocks( astraElementorSites.astra_blocks );
1527
+ AstraElementorSitesAdmin._goBack();
1528
+ },
1529
+
1530
+ /**
1531
+ * Install Success
1532
+ */
1533
+ _installSuccess: function( event, response ) {
1534
+
1535
+ event.preventDefault();
1536
+
1537
+ // Transform the 'Install' button into an 'Activate' button.
1538
+ var $init = $( '.plugin-card-' + response.slug ).data('init');
1539
+ var $name = $( '.plugin-card-' + response.slug ).data('name');
1540
+
1541
+ // Reset not installed plugins list.
1542
+ var pluginsList = AstraElementorSitesAdmin.requiredPlugins.notinstalled;
1543
+ var curr_plugin = AstraElementorSitesAdmin._getPluginFromQueue( response.slug, pluginsList );
1544
+
1545
+ AstraElementorSitesAdmin.requiredPlugins.notinstalled = AstraElementorSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1546
+
1547
+
1548
+ // WordPress adds "Activate" button after waiting for 1000ms. So we will run our activation after that.
1549
+ setTimeout( function() {
1550
+
1551
+ console.log( 'Activating Plugin - ' + curr_plugin.name );
1552
+
1553
+ $.ajax({
1554
+ url: astraElementorSites.ajaxurl,
1555
+ type: 'POST',
1556
+ data: {
1557
+ 'action' : 'astra-required-plugin-activate',
1558
+ 'init' : curr_plugin.init,
1559
+ '_ajax_nonce' : astraElementorSites._ajax_nonce,
1560
+ },
1561
+ })
1562
+ .done(function (result) {
1563
+
1564
+ if( result.success ) {
1565
+ var pluginsList = AstraElementorSitesAdmin.requiredPlugins.inactive;
1566
+
1567
+ console.log( 'Activated Plugin - ' + curr_plugin.name );
1568
+
1569
+ // Reset not installed plugins list.
1570
+ AstraElementorSitesAdmin.requiredPlugins.inactive = AstraElementorSitesAdmin._removePluginFromQueue( response.slug, pluginsList );
1571
+
1572
+ // Enable Demo Import Button
1573
+ AstraElementorSitesAdmin._enableImport();
1574
+
1575
+ }
1576
+ });
1577
+
1578
+ }, 1200 );
1579
+
1580
+ },
1581
+
1582
+ /**
1583
+ * Plugin Installation Error.
1584
+ */
1585
+ _installError: function( event, response ) {
1586
+ console.log( 'Error Installing Plugin - ' + args.slug );
1587
+ console.log( response.errorMessage );
1588
+ },
1589
+
1590
+ /**
1591
+ * Installing Plugin
1592
+ */
1593
+ _pluginInstalling: function(event, args) {
1594
+ console.log( 'Installing Plugin - ' + args.slug );
1595
+ },
1596
+ };
1597
+
1598
+ /**
1599
+ * Initialize AstraElementorSitesAdmin
1600
+ */
1601
+ $(function(){
1602
+ AstraElementorSitesAdmin.init();
1603
+ });
1604
+
1605
+ })(jQuery);
inc/assets/js/history.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()})(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window)
inc/assets/js/install-theme.js CHANGED
@@ -14,7 +14,7 @@
14
  * Binds events for the Astra Sites.
15
  *
16
  * @since 1.3.2
17
- *
18
  * @access private
19
  * @method _bind
20
  */
@@ -22,17 +22,17 @@
22
  {
23
  $( document ).on( 'click', '.astra-sites-theme-not-installed', AstraSitesInstallTheme._install_and_activate );
24
  $( document ).on( 'click', '.astra-sites-theme-installed-but-inactive', AstraSitesInstallTheme._activateTheme );
25
- $( document ).on('wp-theme-install-success' , AstraSitesInstallTheme._activateTheme);
26
  },
27
 
28
  /**
29
  * Close Getting Started Notice
30
- *
31
  * @param {object} event
32
  * @return void
33
  */
34
  _auto_close_notice: function() {
35
-
36
  if( $( '.astra-sites-getting-started-btn' ).length ) {
37
  $.ajax({
38
  url: AstraSitesInstallThemeVars.ajaxurl,
@@ -77,11 +77,7 @@
77
  })
78
  .done(function (result) {
79
  if( result.success ) {
80
- $('#astra-theme-activation-nag a').text( AstraSitesInstallThemeVars.activated );
81
-
82
- setTimeout(function() {
83
- location.reload();
84
- }, 1000);
85
  }
86
 
87
  });
@@ -94,7 +90,7 @@
94
  * Install and activate
95
  *
96
  * @since 1.3.2
97
- *
98
  * @param {object} event Current event.
99
  * @return void
100
  */
@@ -112,7 +108,7 @@
112
  if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
113
  wp.updates.requestFilesystemCredentials( event );
114
  }
115
-
116
  wp.updates.installTheme( {
117
  slug: theme_slug
118
  });
@@ -127,4 +123,4 @@
127
  AstraSitesInstallTheme.init();
128
  });
129
 
130
- })(jQuery);
14
  * Binds events for the Astra Sites.
15
  *
16
  * @since 1.3.2
17
+ *
18
  * @access private
19
  * @method _bind
20
  */
22
  {
23
  $( document ).on( 'click', '.astra-sites-theme-not-installed', AstraSitesInstallTheme._install_and_activate );
24
  $( document ).on( 'click', '.astra-sites-theme-installed-but-inactive', AstraSitesInstallTheme._activateTheme );
25
+ $( document ).on( 'wp-theme-install-success' , AstraSitesInstallTheme._activateTheme);
26
  },
27
 
28
  /**
29
  * Close Getting Started Notice
30
+ *
31
  * @param {object} event
32
  * @return void
33
  */
34
  _auto_close_notice: function() {
35
+
36
  if( $( '.astra-sites-getting-started-btn' ).length ) {
37
  $.ajax({
38
  url: AstraSitesInstallThemeVars.ajaxurl,
77
  })
78
  .done(function (result) {
79
  if( result.success ) {
80
+ $('.astra-sites-theme-action-link').parent().html( AstraSitesInstallThemeVars.activated + ' 🎉' );
 
 
 
 
81
  }
82
 
83
  });
90
  * Install and activate
91
  *
92
  * @since 1.3.2
93
+ *
94
  * @param {object} event Current event.
95
  * @return void
96
  */
108
  if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.ajaxLocked ) {
109
  wp.updates.requestFilesystemCredentials( event );
110
  }
111
+
112
  wp.updates.installTheme( {
113
  slug: theme_slug
114
  });
123
  AstraSitesInstallTheme.init();
124
  });
125
 
126
+ })(jQuery);
inc/assets/js/src/content.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wp.media.view.AstraSearch = require( './search.js' );
2
+
3
+ var AstraContent = wp.media.View.extend({
4
+
5
+ tagName: 'div',
6
+ className: 'ast-attachments-search-wrap',
7
+ initialize: function() {
8
+ this.value = this.options.value;
9
+ },
10
+
11
+ render: function() {
12
+
13
+ var search = new wp.media.view.AstraSearch({
14
+ controller: this.controller,
15
+ model: this.model,
16
+ });
17
+ this.views.add( search );
18
+ return this;
19
+ }
20
+ });
21
+
22
+ module.exports = AstraContent;
inc/assets/js/src/frame.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var View = wp.media.View,
2
+ Frame = wp.media.view.Frame,
3
+ $ = jQuery,
4
+ Select = wp.media.view.MediaFrame.Select,
5
+ AstraAttachmentsBrowser;
6
+
7
+ wp.media.view.AstraContent = require( './content.js' );
8
+
9
+ AstraAttachmentsBrowser = Frame.extend({
10
+ tagName: 'div',
11
+ className: 'attachments-browser ast-attachments-browser',
12
+ images : [],
13
+ object: [],
14
+ initialize: function() {
15
+ _.defaults( this.options, {
16
+ filters: false,
17
+ search: true,
18
+ date: true,
19
+ display: false,
20
+ sidebar: true,
21
+ AttachmentView: wp.media.view.Attachment.Library
22
+ });
23
+
24
+ // Add a heading before the attachments list.
25
+ this.createContent();
26
+ },
27
+
28
+ createContent: function() {
29
+
30
+ this.attachmentsHeading = new wp.media.view.Heading( {
31
+ text: astraImages.title,
32
+ level: 'h3',
33
+ className: 'ast-media-views-heading'
34
+ } );
35
+ // this.views.add( this.attachmentsHeading );
36
+ this.views.add( new wp.media.view.AstraContent );
37
+ this.$el.find( '.ast-image__search' ).wrapAll( '<div class="ast-image__search-wrap">' ).parent().html();
38
+ this.$el.find( '.ast-image__search-wrap' ).append( '<span class="icon-search search-icon"></span>' );
39
+ },
40
+
41
+ photoUploadComplete: function( savedImage ) {
42
+ if ( savedImage && savedImage.attachmentData) {
43
+ this.model.frame.content.mode("browse")
44
+ this.model.get("selection").add( savedImage.attachmentData )
45
+ this.model.frame.trigger("library:selection:add")
46
+ this.model.get("selection")
47
+ jQuery(".media-frame .media-button-select").click()
48
+ }
49
+ }
50
+ });
51
+
52
+ module.exports = AstraAttachmentsBrowser;
inc/assets/js/src/index.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+
3
+ AstraImages = {
4
+
5
+ init: function() {
6
+
7
+ if ( undefined != wp && wp.media ) {
8
+
9
+ var View = wp.media.View,
10
+ mediaTrash = wp.media.view.settings.mediaTrash,
11
+ l10n = wp.media.view.l10n,
12
+ Frame = wp.media.view.Frame,
13
+ $ = jQuery,
14
+ newVar = {},
15
+ Select = wp.media.view.MediaFrame.Select;
16
+
17
+ wp.media.view.AstraAttachmentsBrowser = require( './frame.js' );
18
+
19
+ Select.prototype.bindHandlers = function() {
20
+
21
+ this.on("router:create:browse", this.createRouter, this);
22
+ this.on("router:render:browse", this.browseRouter, this);
23
+ this.on("content:create:browse", this.browseContent, this);
24
+ this.on("content:create:astraimages", this.astraimages, this);
25
+ this.on("content:render:upload", this.uploadContent, this);
26
+ this.on("toolbar:create:select", this.createSelectToolbar, this);
27
+ }
28
+
29
+ Select.prototype.browseRouter = function( routerView ) {
30
+
31
+ routerView.set({
32
+ upload: {
33
+ text: l10n.uploadFilesTitle,
34
+ priority: 20
35
+ },
36
+ browse: {
37
+ text: l10n.mediaLibraryTitle,
38
+ priority: 40
39
+ },
40
+ astraimages: {
41
+ text: astraImages.title,
42
+ priority: 70
43
+ }
44
+ });
45
+ }
46
+
47
+ Select.prototype.astraimages = function( contentRegion ) {
48
+ var state = this.state();
49
+
50
+ // Browse our library of attachments.
51
+ let thisView = new wp.media.view.AstraAttachmentsBrowser({
52
+ controller: this,
53
+ model: state,
54
+ AttachmentView: state.get( 'AttachmentView' )
55
+ });
56
+ contentRegion.view = thisView
57
+ wp.media.view.AstraAttachmentsBrowser.object = thisView
58
+ setTimeout( function() {
59
+ $( document ).trigger( 'ast-image__set-scope' );
60
+ }, 100 );
61
+ }
62
+ }
63
+ },
64
+
65
+ };
66
+
67
+
68
+ /**
69
+ * Initialize AstraImages
70
+ */
71
+ $( function(){
72
+
73
+ AstraImages.init();
74
+
75
+ if ( astraImages.is_bb_active && astraImages.is_bb_editor ) {
76
+ if ( undefined !== FLBuilder ) {
77
+ if ( null !== FLBuilder._singlePhotoSelector ) {
78
+ FLBuilder._singlePhotoSelector.on( 'open', function( event ) {
79
+ AstraImages.init();
80
+ } );
81
+ }
82
+ }
83
+ }
84
+
85
+ });
86
+
87
+ })(jQuery);
88
+
inc/assets/js/src/search.js ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var l10n = wp.media.view.l10n
2
+ $ = jQuery
3
+ // Search input view controller.
4
+ AstraSearch = wp.Backbone.View.extend({
5
+
6
+ tagName: 'input',
7
+ className: 'ast-image__search',
8
+ id: 'ast-image-search-input',
9
+ searching: false,
10
+ images: [],
11
+ attributes: {
12
+ placeholder: astraImages.search_placeholder,
13
+ type: 'search',
14
+ 'aria-describedby': 'live-search-desc'
15
+ },
16
+
17
+ events: {
18
+ 'search' : 'search',
19
+ 'keyup': 'search',
20
+ 'blur': 'pushState',
21
+ 'infinite': 'infinite',
22
+ },
23
+
24
+ initialize: function( options ) {
25
+
26
+ this.parent = options.parent;
27
+ },
28
+
29
+ infinite: function( event ) {
30
+
31
+ // Since doSearch is debounced, it will only run when user input comes to a rest.
32
+ this.doSearch( event );
33
+ },
34
+
35
+ search: function( event ) {
36
+
37
+ // Clear on escape.
38
+ if ( event.type === 'keyup' && event.which === 27 ) {
39
+ event.target.value = '';
40
+ }
41
+ if( '' == event.target.value ) {
42
+ this.$el.removeClass('has-input');
43
+ } else {
44
+ this.$el.addClass('has-input');
45
+ }
46
+
47
+ $scope.find( '.ast-image__skeleton' ).animate({ scrollTop: 0 }, 0 );
48
+ $( 'body' ).data( 'page', 1 );
49
+ AstraImageCommon.infiniteLoad = false;
50
+
51
+ let thisObject = this;
52
+ setTimeout( function(){
53
+ thisObject.doSearch( event );
54
+ }, 1000 );
55
+ },
56
+
57
+ // Runs a search on the theme collection.
58
+ doSearch: function( event ) {
59
+
60
+ if ( this.searching ) {
61
+ return;
62
+ }
63
+
64
+ var options = {};
65
+ let thisObject = this;
66
+ thisObject.searching = true;
67
+ AstraImageCommon.config.q = event.target.value;
68
+ var url = astraImages.pixabay_url + '?' + $.param( AstraImageCommon.config );
69
+
70
+ if ( url ) {
71
+ fetch( url ).then(function (response) {
72
+ return response.json();
73
+ }).then(function (result) {
74
+ thisObject.searching = false;
75
+ this.images = result.hits;
76
+ wp.media.view.AstraAttachmentsBrowser.images = this.images;
77
+ $( document ).trigger( 'ast-image__refresh' );
78
+ });
79
+ }
80
+ },
81
+
82
+ pushState: function( event ) {
83
+ $( document ).trigger( 'ast-image__refresh' );
84
+ }
85
+ });
86
+
87
+ module.exports = AstraSearch;
inc/classes/class-astra-sites-elementor-images.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Astra_Sites_Elementor_Images class
4
+ *
5
+ * This class is used to manage Pixabay Images.
6
+ *
7
+ * @package Astra Sites
8
+ * @since 2.0.0
9
+ */
10
+
11
+ use Elementor\Utils;
12
+
13
+ // If plugin - 'Elementor' not exist then return.
14
+ if ( class_exists( 'Astra_Sites_Elementor_Images' ) ) {
15
+ return;
16
+ }
17
+
18
+ /**
19
+ * Astra_Sites_Elementor_Images
20
+ */
21
+ class Astra_Sites_Elementor_Images {
22
+
23
+ /**
24
+ * Instance of Astra_Sites
25
+ *
26
+ * @since 2.0.0
27
+ * @var (Object) Astra_Sites
28
+ */
29
+ private static $instance = null;
30
+
31
+ /**
32
+ * Instance of Astra_Sites_Elementor_Images.
33
+ *
34
+ * @since 2.0.0
35
+ *
36
+ * @return object Class object.
37
+ */
38
+ public static function get_instance() {
39
+ if ( ! isset( self::$instance ) ) {
40
+ self::$instance = new self();
41
+ }
42
+
43
+ return self::$instance;
44
+ }
45
+
46
+ /**
47
+ * Import Image.
48
+ *
49
+ * @since 2.0.0
50
+ * @param array $image Downloaded Image array.
51
+ */
52
+ public function get_attachment_data( $image ) {
53
+
54
+ if ( ! empty( $image ) ) {
55
+ return array(
56
+ 'content' => array(
57
+ array(
58
+ 'id' => \Elementor\Utils::generate_random_string(),
59
+ 'elType' => 'section',
60
+ 'settings' => array(),
61
+ 'isInner' => false,
62
+ 'elements' => array(
63
+ array(
64
+ 'id' => \Elementor\Utils::generate_random_string(),
65
+ 'elType' => 'column',
66
+ 'elements' => array(
67
+ array(
68
+ 'id' => \Elementor\Utils::generate_random_string(),
69
+ 'elType' => 'widget',
70
+ 'settings' => array(
71
+ 'image' => array(
72
+ 'url' => wp_get_attachment_url( $image ),
73
+ 'id' => $image,
74
+ ),
75
+ 'image_size' => 'full',
76
+ ),
77
+ 'widgetType' => 'image',
78
+ ),
79
+ ),
80
+ 'isInner' => false,
81
+ ),
82
+ ),
83
+ ),
84
+ ),
85
+ );
86
+ }
87
+ return array();
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Kicking this off by calling 'get_instance()' method
93
+ */
94
+ Astra_Sites_Elementor_Images::get_instance();
inc/classes/class-astra-sites-elementor-pages.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Elementor Importer
4
+ *
5
+ * @package Astra Sites
6
+ */
7
+
8
+ namespace Elementor\TemplateLibrary;
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
+ }
13
+
14
+ // If plugin - 'Elementor' not exist then return.
15
+ if ( ! class_exists( '\Elementor\Plugin' ) ) {
16
+ return;
17
+ }
18
+
19
+ use Elementor\Core\Base\Document;
20
+ use Elementor\DB;
21
+ use Elementor\Core\Settings\Page\Manager as PageSettingsManager;
22
+ use Elementor\Core\Settings\Manager as SettingsManager;
23
+ use Elementor\Core\Settings\Page\Model;
24
+ use Elementor\Editor;
25
+ use Elementor\Plugin;
26
+ use Elementor\Settings;
27
+ use Elementor\Utils;
28
+
29
+ /**
30
+ * Elementor template library local source.
31
+ *
32
+ * Elementor template library local source handler class is responsible for
33
+ * handling local Elementor templates saved by the user locally on his site.
34
+ *
35
+ * @since 2.0.0 Added compatibility for Elemetnor v2.5.0
36
+ */
37
+ class Astra_Sites_Elementor_Pages extends Source_Local {
38
+
39
+ /**
40
+ * Update post meta.
41
+ *
42
+ * @since 2.0.0
43
+ * @param integer $post_id Post ID.
44
+ * @param array $data Elementor Data.
45
+ * @return array $data Elementor Imported Data.
46
+ */
47
+ public function import( $post_id = 0, $data = array() ) {
48
+
49
+ if ( ! empty( $post_id ) && ! empty( $data ) ) {
50
+
51
+ $data = wp_json_encode( $data, true );
52
+
53
+ // Update WP form IDs.
54
+ $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
55
+ if ( $ids_mapping ) {
56
+ foreach ( $ids_mapping as $old_id => $new_id ) {
57
+ $data = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $data );
58
+ $data = str_replace( '"select_form":"' . $old_id, '"select_form":"' . $new_id, $data );
59
+ }
60
+ }
61
+
62
+ $data = json_decode( $data, true );
63
+
64
+ // Import the data.
65
+ $data = $this->process_export_import_content( $data, 'on_import' );
66
+
67
+ // Replace the site urls.
68
+ $demo_data = get_option( 'astra_sites_import_data', array() );
69
+ if ( isset( $demo_data['astra-site-url'] ) ) {
70
+ $site_url = get_site_url();
71
+ $site_url = str_replace( '/', '\/', $site_url );
72
+ $demo_site_url = 'https:' . $demo_data['astra-site-url'];
73
+ $demo_site_url = str_replace( '/', '\/', $demo_site_url );
74
+ $data = str_replace( $demo_site_url, $site_url, $data );
75
+ }
76
+
77
+ // Replace the site urls.
78
+ $demo_data = get_option( 'astra_sites_import_data', array() );
79
+ if ( isset( $demo_data['astra-site-url'] ) ) {
80
+ $data = wp_json_encode( $data, true );
81
+ if ( ! empty( $data ) ) {
82
+ $site_url = get_site_url();
83
+ $site_url = str_replace( '/', '\/', $site_url );
84
+ $demo_site_url = 'https:' . $demo_data['astra-site-url'];
85
+ $demo_site_url = str_replace( '/', '\/', $demo_site_url );
86
+ $data = str_replace( $demo_site_url, $site_url, $data );
87
+ $data = json_decode( $data, true );
88
+ }
89
+ }
90
+
91
+ // Update processed meta.
92
+ update_metadata( 'post', $post_id, '_elementor_data', $data );
93
+
94
+ // !important, Clear the cache after images import.
95
+ Plugin::$instance->posts_css_manager->clear_cache();
96
+
97
+ return $data;
98
+ }
99
+
100
+ return array();
101
+ }
102
+ }
inc/classes/class-astra-sites-importer-log.php CHANGED
@@ -6,7 +6,9 @@
6
  * @package Astra Sites
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
  if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
12
 
@@ -21,7 +23,7 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
21
  * @since 1.1.0
22
  * @var (Object) Class object
23
  */
24
- private static $_instance = null;
25
 
26
  /**
27
  * Log File
@@ -39,11 +41,11 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
39
  * @return object Class object.
40
  */
41
  public static function get_instance() {
42
- if ( ! isset( self::$_instance ) ) {
43
- self::$_instance = new self;
44
  }
45
 
46
- return self::$_instance;
47
  }
48
 
49
  /**
@@ -64,12 +66,17 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
64
  * @since 1.1.0
65
  * @return null
66
  */
67
- function has_file_read_write() {
 
 
 
68
 
69
  // Get user credentials for WP file-system API.
70
- $astra_sites_import = wp_nonce_url( admin_url( 'themes.php?page=astra-sites' ), 'astra-import' );
71
- $creds = request_filesystem_credentials( $astra_sites_import, '', false, false, null );
72
- if ( false === $creds ) {
 
 
73
  return;
74
  }
75
 
@@ -80,6 +87,22 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
80
  add_action( 'astra_sites_import_start', array( $this, 'start' ), 10, 2 );
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  /**
84
  * Add log file URL in UI response.
85
  *
@@ -116,50 +139,34 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
116
  * @param string $demo_api_uri Import site API URL.
117
  * @return void
118
  */
119
- function start( $data = array(), $demo_api_uri = '' ) {
120
-
121
- Astra_Sites_Importer_Log::add( 'Started Import Process' );
122
-
123
- Astra_Sites_Importer_Log::add( '# System Details: ' );
124
- Astra_Sites_Importer_Log::add( "Debug Mode \t\t: " . self::get_debug_mode() );
125
- Astra_Sites_Importer_Log::add( "Operating System \t: " . self::get_os() );
126
- Astra_Sites_Importer_Log::add( "Software \t\t: " . self::get_software() );
127
- Astra_Sites_Importer_Log::add( "MySQL version \t\t: " . self::get_mysql_version() );
128
- Astra_Sites_Importer_Log::add( "XML Reader \t\t: " . self::get_xmlreader_status() );
129
- Astra_Sites_Importer_Log::add( "PHP Version \t\t: " . self::get_php_version() );
130
- Astra_Sites_Importer_Log::add( "PHP Max Input Vars \t: " . self::get_php_max_input_vars() );
131
- Astra_Sites_Importer_Log::add( "PHP Max Post Size \t: " . self::get_php_max_post_size() );
132
- Astra_Sites_Importer_Log::add( "PHP Extension GD \t: " . self::get_php_extension_gd() );
133
- Astra_Sites_Importer_Log::add( "PHP Max Execution Time \t: " . self::get_max_execution_time() );
134
- Astra_Sites_Importer_Log::add( "Max Upload Size \t: " . size_format( wp_max_upload_size() ) );
135
- Astra_Sites_Importer_Log::add( "Memory Limit \t\t: " . self::get_memory_limit() );
136
- Astra_Sites_Importer_Log::add( "Timezone \t\t: " . self::get_timezone() );
137
- Astra_Sites_Importer_Log::add( PHP_EOL . '-----' . PHP_EOL );
138
- Astra_Sites_Importer_Log::add( 'Importing Started! - ' . self::current_time() );
139
-
140
- Astra_Sites_Importer_Log::add( '---' . PHP_EOL );
141
- Astra_Sites_Importer_Log::add( 'WHY IMPORT PROCESS CAN FAIL? READ THIS - ' );
142
- Astra_Sites_Importer_Log::add( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' . PHP_EOL );
143
- Astra_Sites_Importer_Log::add( '---' . PHP_EOL );
144
 
145
  }
146
 
147
- /**
148
- * Get an instance of WP_Filesystem_Direct.
149
- *
150
- * @since 1.1.0
151
- * @return object A WP_Filesystem_Direct instance.
152
- */
153
- static public function get_filesystem() {
154
- global $wp_filesystem;
155
-
156
- require_once ABSPATH . '/wp-admin/includes/file.php';
157
-
158
- WP_Filesystem();
159
-
160
- return $wp_filesystem;
161
- }
162
-
163
  /**
164
  * Get Log File
165
  *
@@ -194,7 +201,7 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
194
  wp_mkdir_p( $dir_info['path'] );
195
 
196
  // Add an index file for security.
197
- self::get_filesystem()->put_contents( $dir_info['path'] . 'index.html', '' );
198
  }
199
 
200
  return $dir_info;
@@ -235,13 +242,15 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
235
 
236
  $existing_data = '';
237
  if ( file_exists( $log_file ) ) {
238
- $existing_data = self::get_filesystem()->get_contents( $log_file );
239
  }
240
 
241
  // Style separator.
242
  $separator = PHP_EOL;
243
 
244
- self::get_filesystem()->put_contents( $log_file, $existing_data . $separator . $content, FS_CHMOD_FILE );
 
 
245
  }
246
 
247
  /**
@@ -366,7 +375,9 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
366
  * @return string Current PHP Max Input Vars
367
  */
368
  public static function get_php_max_input_vars() {
 
369
  return ini_get( 'max_input_vars' ); // phpcs:disable PHPCompatibility.IniDirectives.NewIniDirectives.max_input_varsFound
 
370
  }
371
 
372
  /**
@@ -403,6 +414,104 @@ if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
403
  return __( 'No', 'astra-sites' );
404
  }
405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  }
407
 
408
  /**
6
  * @package Astra Sites
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
 
13
  if ( ! class_exists( 'Astra_Sites_Importer_Log' ) ) :
14
 
23
  * @since 1.1.0
24
  * @var (Object) Class object
25
  */
26
+ private static $instance = null;
27
 
28
  /**
29
  * Log File
41
  * @return object Class object.
42
  */
43
  public static function get_instance() {
44
+ if ( ! isset( self::$instance ) ) {
45
+ self::$instance = new self();
46
  }
47
 
48
+ return self::$instance;
49
  }
50
 
51
  /**
66
  * @since 1.1.0
67
  * @return null
68
  */
69
+ public function has_file_read_write() {
70
+
71
+ $upload_dir = self::log_dir();
72
+ $upload_path = trailingslashit( $upload_dir['url'] );
73
 
74
  // Get user credentials for WP file-system API.
75
+ $astra_sites_import = wp_nonce_url( admin_url( 'themes.php?page=starter-templates' ), 'astra-import' );
76
+ $creds = request_filesystem_credentials( $astra_sites_import, '', false, $upload_dir['path'], null );
77
+ $file_created = Astra_Sites::get_instance()->get_filesystem()->put_contents( $upload_dir['path'] . 'index.html', '' );
78
+ if ( false === $creds || ( ! $file_created ) ) {
79
+ add_action( 'admin_notices', array( $this, 'file_permission_notice' ) );
80
  return;
81
  }
82
 
87
  add_action( 'astra_sites_import_start', array( $this, 'start' ), 10, 2 );
88
  }
89
 
90
+ /**
91
+ * File Permission Notice
92
+ *
93
+ * @since 2.0.0
94
+ * @return void
95
+ */
96
+ public function file_permission_notice() {
97
+ ?>
98
+ <div class="notice notice-error astra-sites-must-notices astra-sites-file-permission-issue">
99
+ <p><?php esc_html_e( 'Required File Permissions to import the templates are missing.', 'astra-sites' ); ?></p>
100
+ <p><?php esc_html_e( 'You can easily update permissions by adding the following code into the wp-config.php file.', 'astra-sites' ); ?></p>
101
+ <p><code>define( 'FS_METHOD', 'direct' );</code></p>
102
+ </div>
103
+ <?php
104
+ }
105
+
106
  /**
107
  * Add log file URL in UI response.
108
  *
139
  * @param string $demo_api_uri Import site API URL.
140
  * @return void
141
  */
142
+ public function start( $data = array(), $demo_api_uri = '' ) {
143
+
144
+ self::add( 'Started Import Process' );
145
+
146
+ self::add( '# System Details: ' );
147
+ self::add( "Debug Mode \t\t: " . self::get_debug_mode() );
148
+ self::add( "Operating System \t: " . self::get_os() );
149
+ self::add( "Software \t\t: " . self::get_software() );
150
+ self::add( "MySQL version \t\t: " . self::get_mysql_version() );
151
+ self::add( "XML Reader \t\t: " . self::get_xmlreader_status() );
152
+ self::add( "PHP Version \t\t: " . self::get_php_version() );
153
+ self::add( "PHP Max Input Vars \t: " . self::get_php_max_input_vars() );
154
+ self::add( "PHP Max Post Size \t: " . self::get_php_max_post_size() );
155
+ self::add( "PHP Extension GD \t: " . self::get_php_extension_gd() );
156
+ self::add( "PHP Max Execution Time \t: " . self::get_max_execution_time() );
157
+ self::add( "Max Upload Size \t: " . size_format( wp_max_upload_size() ) );
158
+ self::add( "Memory Limit \t\t: " . self::get_memory_limit() );
159
+ self::add( "Timezone \t\t: " . self::get_timezone() );
160
+ self::add( PHP_EOL . '-----' . PHP_EOL );
161
+ self::add( 'Importing Started! - ' . self::current_time() );
162
+
163
+ self::add( '---' . PHP_EOL );
164
+ self::add( 'WHY IMPORT PROCESS CAN FAIL? READ THIS - ' );
165
+ self::add( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' . PHP_EOL );
166
+ self::add( '---' . PHP_EOL );
167
 
168
  }
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  /**
171
  * Get Log File
172
  *
201
  wp_mkdir_p( $dir_info['path'] );
202
 
203
  // Add an index file for security.
204
+ Astra_Sites::get_instance()->get_filesystem()->put_contents( $dir_info['path'] . 'index.html', '' );
205
  }
206
 
207
  return $dir_info;
242
 
243
  $existing_data = '';
244
  if ( file_exists( $log_file ) ) {
245
+ $existing_data = Astra_Sites::get_instance()->get_filesystem()->get_contents( $log_file );
246
  }
247
 
248
  // Style separator.
249
  $separator = PHP_EOL;
250
 
251
+ astra_sites_error_log( $content );
252
+
253
+ Astra_Sites::get_instance()->get_filesystem()->put_contents( $log_file, $existing_data . $separator . $content, FS_CHMOD_FILE );
254
  }
255
 
256
  /**
375
  * @return string Current PHP Max Input Vars
376
  */
377
  public static function get_php_max_input_vars() {
378
+ // @codingStandardsIgnoreStart
379
  return ini_get( 'max_input_vars' ); // phpcs:disable PHPCompatibility.IniDirectives.NewIniDirectives.max_input_varsFound
380
+ // @codingStandardsIgnoreEnd
381
  }
382
 
383
  /**
414
  return __( 'No', 'astra-sites' );
415
  }
416
 
417
+ /**
418
+ * Display Data
419
+ *
420
+ * @since 2.0.0
421
+ * @return void
422
+ */
423
+ public function display_data() {
424
+
425
+ $crons = _get_cron_array();
426
+ $events = array();
427
+
428
+ if ( empty( $crons ) ) {
429
+ esc_html_e( 'You currently have no scheduled cron events.', 'astra-sites' );
430
+ }
431
+
432
+ foreach ( $crons as $time => $cron ) {
433
+ $keys = array_keys( $cron );
434
+ $key = $keys[0];
435
+ $events[ $key ] = $time;
436
+ }
437
+
438
+ $expired = get_transient( 'astra-sites-import-check' );
439
+ if ( $expired ) {
440
+ global $wpdb;
441
+ $transient = 'astra-sites-import-check';
442
+
443
+ $transient_timeout = $wpdb->get_col(
444
+ $wpdb->prepare(
445
+ "SELECT option_value
446
+ FROM $wpdb->options
447
+ WHERE option_name
448
+ LIKE %s",
449
+ '%_transient_timeout_' . $transient . '%'
450
+ )
451
+ );
452
+
453
+ $older_date = $transient_timeout[0];
454
+ $transient_status = 'Transient: Not Expired! Recheck in ' . human_time_diff( time(), $older_date );
455
+ } else {
456
+ $transient_status = 'Transient: Starting.. Process for each 5 minutes.';
457
+ }
458
+ $temp = get_option( 'astra-sites-batch-status-string', '' );
459
+ $temp .= isset( $events['wp_astra_site_importer_cron'] ) ? '<br/>Batch: Recheck batch in ' . human_time_diff( time(), $events['wp_astra_site_importer_cron'] ) : '<br/>Batch: Not Started! Until the Transient expire.';
460
+
461
+ $upload_dir = self::get_instance()->log_dir();
462
+ $list_files = list_files( $upload_dir['path'] );
463
+ $backup_files = array();
464
+ $log_files = array();
465
+ foreach ( $list_files as $key => $file ) {
466
+ if ( strpos( $file, '.json' ) ) {
467
+ $backup_files[] = $file;
468
+ }
469
+ if ( strpos( $file, '.txt' ) ) {
470
+ $log_files[] = $file;
471
+ }
472
+ }
473
+ ?>
474
+ <table>
475
+ <tr>
476
+ <td>
477
+ <h2>Log Files</h2>
478
+ <ul>
479
+ <?php
480
+ foreach ( $log_files as $key => $file ) {
481
+ $file_name = basename( $file );
482
+ $file = str_replace( $upload_dir['path'], $upload_dir['url'], $file );
483
+ ?>
484
+ <li>
485
+ <a target="_blank" href="<?php echo esc_attr( $file ); ?>"><?php echo esc_html( $file_name ); ?></a>
486
+ </li>
487
+ <?php } ?>
488
+ </ul>
489
+ </td>
490
+ <td>
491
+ <h2>Backup Files</h2>
492
+ <ul>
493
+ <?php
494
+ foreach ( $backup_files as $key => $file ) {
495
+ $file_name = basename( $file );
496
+ $file = str_replace( $upload_dir['path'], $upload_dir['url'], $file );
497
+ ?>
498
+ <li>
499
+ <a target="_blank" href="<?php echo esc_attr( $file ); ?>"><?php echo esc_html( $file_name ); ?></a>
500
+ </li>
501
+ <?php } ?>
502
+ </ul>
503
+ </td>
504
+ <td>
505
+ <div class="batch-log">
506
+ <p><?php echo wp_kses_post( $temp ); ?></p>
507
+ <p><?php echo wp_kses_post( $transient_status ); ?></p>
508
+ </div>
509
+ </td>
510
+ </tr>
511
+ </table>
512
+ <?php
513
+ }
514
+
515
  }
516
 
517
  /**
inc/classes/class-astra-sites-importer.php CHANGED
@@ -6,9 +6,11 @@
6
  * @package Astra Sites
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
- if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
12
 
13
  /**
14
  * Astra Sites Importer
@@ -21,7 +23,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
21
  * @since 1.0.0
22
  * @var (Object) Class object
23
  */
24
- public static $_instance = null;
25
 
26
  /**
27
  * Set Instance
@@ -31,11 +33,11 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
31
  * @return object Class object.
32
  */
33
  public static function get_instance() {
34
- if ( ! isset( self::$_instance ) ) {
35
- self::$_instance = new self;
36
  }
37
 
38
- return self::$_instance;
39
  }
40
 
41
  /**
@@ -47,13 +49,13 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
47
 
48
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer-log.php';
49
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-sites-helper.php';
50
- require_once ASTRA_SITES_DIR . 'inc/importers/class-widgets-importer.php';
51
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-customizer-import.php';
52
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-site-options-import.php';
53
 
54
  // Import AJAX.
55
- add_action( 'wp_ajax_astra-sites-import-set-site-data', array( $this, 'import_start' ) );
56
  add_action( 'wp_ajax_astra-sites-import-wpforms', array( $this, 'import_wpforms' ) );
 
57
  add_action( 'wp_ajax_astra-sites-import-customizer-settings', array( $this, 'import_customizer_settings' ) );
58
  add_action( 'wp_ajax_astra-sites-import-prepare-xml', array( $this, 'prepare_xml_data' ) );
59
  add_action( 'wp_ajax_astra-sites-import-options', array( $this, 'import_options' ) );
@@ -61,12 +63,12 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
61
  add_action( 'wp_ajax_astra-sites-import-end', array( $this, 'import_end' ) );
62
 
63
  // Hooks in AJAX.
64
- add_action( 'astra_sites_import_complete', array( $this, 'clear_cache' ) );
65
  add_action( 'init', array( $this, 'load_importer' ) );
66
 
67
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing.php';
68
 
69
- add_action( 'astra_sites_image_import_complete', array( $this, 'clear_cache' ) );
70
 
71
  // Reset Customizer Data.
72
  add_action( 'wp_ajax_astra-sites-reset-customizer-data', array( $this, 'reset_customizer_data' ) );
@@ -93,7 +95,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
93
  * @param int $timeout_value Time in seconds until a request times out. Default 5.
94
  * @param string $url The request URL.
95
  */
96
- function set_timeout_for_images( $timeout_value, $url ) {
97
 
98
  // URL not contain `https://websitedemos.net` then return $timeout_value.
99
  if ( strpos( $url, 'https://websitedemos.net' ) === false ) {
@@ -102,8 +104,9 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
102
 
103
  // Check is image URL of type jpg|png|gif|jpeg.
104
  if ( Astra_Sites_Image_Importer::get_instance()->is_image_url( $url ) ) {
105
- $timeout_value = 30;
106
  }
 
107
  return $timeout_value;
108
  }
109
 
@@ -114,55 +117,15 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
114
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-astra-wxr-importer.php';
115
  }
116
 
117
- /**
118
- * Start Site Import
119
- *
120
- * @since 1.1.0
121
- * @return void
122
- */
123
- function import_start() {
124
-
125
- // Verify Nonce.
126
- check_ajax_referer( 'astra-sites', '_ajax_nonce' );
127
-
128
- if ( ! current_user_can( 'customize' ) ) {
129
- wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
130
- }
131
-
132
- $demo_api_uri = isset( $_POST['api_url'] ) ? esc_url( $_POST['api_url'] ) : '';
133
-
134
- if ( ! empty( $demo_api_uri ) ) {
135
-
136
- $demo_data = self::get_single_demo( $demo_api_uri );
137
- update_option( 'astra_sites_import_data', $demo_data );
138
-
139
- if ( is_wp_error( $demo_data ) ) {
140
- wp_send_json_error( $demo_data->get_error_message() );
141
- } else {
142
- $log_file = Astra_Sites_Importer_Log::add_log_file_url();
143
- if ( isset( $log_file['url'] ) && ! empty( $log_file['url'] ) ) {
144
- $demo_data['log_file'] = $log_file['url'];
145
- }
146
- do_action( 'astra_sites_import_start', $demo_data, $demo_api_uri );
147
- }
148
-
149
- wp_send_json_success( $demo_data );
150
-
151
- } else {
152
- wp_send_json_error( __( 'Request site API URL is empty. Try again!', 'astra-sites' ) );
153
- }
154
-
155
- }
156
-
157
  /**
158
  * Change flow status
159
  *
160
- * @since 1.4.0
161
  *
162
  * @param array $args Flow query args.
163
  * @return array Flow query args.
164
  */
165
- function change_flow_status( $args ) {
166
  $args['post_status'] = 'publish';
167
  return $args;
168
  }
@@ -170,60 +133,16 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
170
  /**
171
  * Track Flow
172
  *
173
- * @since 1.4.0
174
  *
175
  * @param integer $flow_id Flow ID.
176
  * @return void
177
  */
178
- function track_flows( $flow_id ) {
179
- error_log( 'Flow ID ' . $flow_id );
180
  Astra_WXR_Importer::instance()->track_post( $flow_id );
181
  }
182
 
183
- /**
184
- * Import CartFlows
185
- *
186
- * @since 1.4.0
187
- *
188
- * @param string $url Cartflows JSON file URL.
189
- * @return void
190
- */
191
- function import_cartflows( $url = '' ) {
192
-
193
- // Make the flow publish.
194
- add_action( 'cartflows_flow_importer_args', array( $this, 'change_flow_status' ) );
195
- add_action( 'cartflows_flow_imported', array( $this, 'track_flows' ) );
196
- add_action( 'cartflows_step_imported', array( $this, 'track_flows' ) );
197
-
198
- $url = ( isset( $_REQUEST['cartflows_url'] ) ) ? urldecode( $_REQUEST['cartflows_url'] ) : urldecode( $url );
199
- if ( ! empty( $url ) && is_callable( 'CartFlows_Importer::get_instance' ) ) {
200
-
201
- // Download JSON file.
202
- $file_path = Astra_Sites_Helper::download_file( $url );
203
-
204
- if ( $file_path['success'] ) {
205
- if ( isset( $file_path['data']['file'] ) ) {
206
-
207
- $ext = strtolower( pathinfo( $file_path['data']['file'], PATHINFO_EXTENSION ) );
208
-
209
- if ( 'json' === $ext ) {
210
- $flows = json_decode( file_get_contents( $file_path['data']['file'] ), true );
211
-
212
- if ( ! empty( $flows ) ) {
213
- CartFlows_Importer::get_instance()->import_from_json_data( $flows );
214
- }
215
- }
216
- }
217
- }
218
- }
219
-
220
- if ( defined( 'WP_CLI' ) ) {
221
- WP_CLI::line( 'Imported from ' . $url );
222
- } else {
223
- wp_send_json_success( $url );
224
- }
225
- }
226
-
227
  /**
228
  * Import WP Forms
229
  *
@@ -233,7 +152,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
233
  * @param string $wpforms_url WP Forms JSON file URL.
234
  * @return void
235
  */
236
- function import_wpforms( $wpforms_url = '' ) {
237
 
238
  if ( ! defined( 'WP_CLI' ) ) {
239
  // Verify Nonce.
@@ -249,16 +168,16 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
249
 
250
  if ( ! empty( $wpforms_url ) && function_exists( 'wpforms_encode' ) ) {
251
 
252
- // Download XML file.
253
- $xml_path = Astra_Sites_Helper::download_file( $wpforms_url );
254
 
255
- if ( $xml_path['success'] ) {
256
- if ( isset( $xml_path['data']['file'] ) ) {
257
 
258
- $ext = strtolower( pathinfo( $xml_path['data']['file'], PATHINFO_EXTENSION ) );
259
 
260
  if ( 'json' === $ext ) {
261
- $forms = json_decode( file_get_contents( $xml_path['data']['file'] ), true );
262
 
263
  if ( ! empty( $forms ) ) {
264
 
@@ -316,6 +235,50 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
316
  }
317
  }
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  /**
320
  * Import Customizer Settings.
321
  *
@@ -325,7 +288,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
325
  * @param array $customizer_data Customizer Data.
326
  * @return void
327
  */
328
- function import_customizer_settings( $customizer_data = array() ) {
329
 
330
  if ( ! defined( 'WP_CLI' ) ) {
331
  // Verify Nonce.
@@ -340,9 +303,11 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
340
 
341
  if ( ! empty( $customizer_data ) ) {
342
 
343
- Astra_Sites_Importer_Log::add( 'Imported Customizer Settings ' . json_encode( $customizer_data ) );
344
 
345
  // Set meta for tracking the post.
 
 
346
  update_option( '_astra_sites_old_customizer_data', $customizer_data );
347
 
348
  Astra_Customizer_Import::instance()->import( $customizer_data );
@@ -368,7 +333,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
368
  * @since 1.1.0
369
  * @return void
370
  */
371
- function prepare_xml_data() {
372
 
373
  // Verify Nonce.
374
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
@@ -416,7 +381,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
416
  * @param array $options_data Site Options.
417
  * @return void
418
  */
419
- function import_options( $options_data = array() ) {
420
 
421
  if ( ! defined( 'WP_CLI' ) ) {
422
  // Verify Nonce.
@@ -432,7 +397,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
432
  if ( ! empty( $options_data ) ) {
433
  // Set meta for tracking the post.
434
  if ( is_array( $options_data ) ) {
435
- Astra_Sites_Importer_Log::add( 'Imported - Site Options ' . json_encode( $options_data ) );
436
  update_option( '_astra_sites_old_site_options', $options_data );
437
  }
438
 
@@ -462,7 +427,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
462
  * @param string $widgets_data Widgets Data.
463
  * @return void
464
  */
465
- function import_widgets( $widgets_data = '' ) {
466
 
467
  if ( ! defined( 'WP_CLI' ) ) {
468
  // Verify Nonce.
@@ -475,7 +440,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
475
 
476
  $widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripslashes( $_POST['widgets_data'] ) ) : (object) $widgets_data;
477
 
478
- Astra_Sites_Importer_Log::add( 'Imported - Widgets ' . json_encode( $widgets_data ) );
479
 
480
  if ( ! empty( $widgets_data ) ) {
481
 
@@ -485,6 +450,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
485
  // Set meta for tracking the post.
486
  if ( is_object( $widgets_data ) ) {
487
  $widgets_data = (array) $widgets_data;
 
488
  update_option( '_astra_sites_old_widgets_data', $widgets_data );
489
  }
490
 
@@ -509,7 +475,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
509
  * @since 1.0.14
510
  * @return void
511
  */
512
- function import_end() {
513
 
514
  if ( ! defined( 'WP_CLI' ) ) {
515
  // Verify Nonce.
@@ -520,7 +486,9 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
520
  }
521
  }
522
 
523
- do_action( 'astra_sites_import_complete' );
 
 
524
  }
525
 
526
  /**
@@ -618,7 +586,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
618
  *
619
  * @since 1.0.9
620
  */
621
- public function clear_cache() {
622
 
623
  // Clear 'Builder Builder' cache.
624
  if ( is_callable( 'FLBuilderModel::delete_asset_cache_for_all_posts' ) ) {
@@ -630,16 +598,31 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
630
  Astra_Minify::refresh_assets();
631
  }
632
 
 
 
633
  Astra_Sites_Importer_Log::add( 'Complete ' );
634
  }
635
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
  /**
637
  * Reset customizer data
638
  *
639
  * @since 1.3.0
640
  * @return void
641
  */
642
- function reset_customizer_data() {
643
 
644
  if ( ! defined( 'WP_CLI' ) ) {
645
  // Verify Nonce.
@@ -650,7 +633,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
650
  }
651
  }
652
 
653
- Astra_Sites_Importer_Log::add( 'Deleted customizer Settings ' . json_encode( get_option( 'astra-settings', array() ) ) );
654
 
655
  delete_option( 'astra-settings' );
656
 
@@ -667,7 +650,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
667
  * @since 1.3.0
668
  * @return void
669
  */
670
- function reset_site_options() {
671
 
672
  if ( ! defined( 'WP_CLI' ) ) {
673
  // Verify Nonce.
@@ -680,7 +663,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
680
 
681
  $options = get_option( '_astra_sites_old_site_options', array() );
682
 
683
- Astra_Sites_Importer_Log::add( 'Deleted - Site Options ' . json_encode( $options ) );
684
 
685
  if ( $options ) {
686
  foreach ( $options as $option_key => $option_value ) {
@@ -701,7 +684,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
701
  * @since 1.3.0
702
  * @return void
703
  */
704
- function reset_widgets_data() {
705
 
706
  if ( ! defined( 'WP_CLI' ) ) {
707
  // Verify Nonce.
@@ -716,7 +699,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
716
 
717
  if ( ! empty( $old_widgets ) ) {
718
 
719
- Astra_Sites_Importer_Log::add( 'DELETED - WIDGETS ' . json_encode( $old_widgets ) );
720
 
721
  $sidebars_widgets = get_option( 'sidebars_widgets', array() );
722
 
@@ -753,7 +736,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
753
  * @param integer $post_id Post ID.
754
  * @return void
755
  */
756
- function delete_imported_posts( $post_id = 0 ) {
757
 
758
  if ( ! defined( 'WP_CLI' ) ) {
759
  // Verify Nonce.
@@ -792,7 +775,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
792
  * @param integer $post_id Post ID.
793
  * @return void
794
  */
795
- function delete_imported_wp_forms( $post_id = 0 ) {
796
 
797
  if ( ! defined( 'WP_CLI' ) ) {
798
  // Verify Nonce.
@@ -828,7 +811,7 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
828
  * @param integer $term_id Term ID.
829
  * @return void
830
  */
831
- function delete_imported_terms( $term_id = 0 ) {
832
  if ( ! defined( 'WP_CLI' ) ) {
833
  // Verify Nonce.
834
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
@@ -863,7 +846,4 @@ if ( ! class_exists( 'Astra_Sites_Importer' ) ) :
863
  * Kicking this off by calling 'get_instance()' method
864
  */
865
  Astra_Sites_Importer::get_instance();
866
-
867
- endif;
868
-
869
-
6
  * @package Astra Sites
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit; // Exit if accessed directly.
11
+ }
12
 
13
+ if ( ! class_exists( 'Astra_Sites_Importer' ) ) {
14
 
15
  /**
16
  * Astra Sites Importer
23
  * @since 1.0.0
24
  * @var (Object) Class object
25
  */
26
+ public static $instance = null;
27
 
28
  /**
29
  * Set Instance
33
  * @return object Class object.
34
  */
35
  public static function get_instance() {
36
+ if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
  }
39
 
40
+ return self::$instance;
41
  }
42
 
43
  /**
49
 
50
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer-log.php';
51
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-sites-helper.php';
52
+ require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-widget-importer.php';
53
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-customizer-import.php';
54
  require_once ASTRA_SITES_DIR . 'inc/importers/class-astra-site-options-import.php';
55
 
56
  // Import AJAX.
 
57
  add_action( 'wp_ajax_astra-sites-import-wpforms', array( $this, 'import_wpforms' ) );
58
+ add_action( 'wp_ajax_astra-sites-import-cartflows', array( $this, 'import_cartflows' ) );
59
  add_action( 'wp_ajax_astra-sites-import-customizer-settings', array( $this, 'import_customizer_settings' ) );
60
  add_action( 'wp_ajax_astra-sites-import-prepare-xml', array( $this, 'prepare_xml_data' ) );
61
  add_action( 'wp_ajax_astra-sites-import-options', array( $this, 'import_options' ) );
63
  add_action( 'wp_ajax_astra-sites-import-end', array( $this, 'import_end' ) );
64
 
65
  // Hooks in AJAX.
66
+ add_action( 'astra_sites_import_complete', array( $this, 'after_batch_complete' ) );
67
  add_action( 'init', array( $this, 'load_importer' ) );
68
 
69
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing.php';
70
 
71
+ add_action( 'astra_sites_image_import_complete', array( $this, 'after_batch_complete' ) );
72
 
73
  // Reset Customizer Data.
74
  add_action( 'wp_ajax_astra-sites-reset-customizer-data', array( $this, 'reset_customizer_data' ) );
95
  * @param int $timeout_value Time in seconds until a request times out. Default 5.
96
  * @param string $url The request URL.
97
  */
98
+ public function set_timeout_for_images( $timeout_value, $url ) {
99
 
100
  // URL not contain `https://websitedemos.net` then return $timeout_value.
101
  if ( strpos( $url, 'https://websitedemos.net' ) === false ) {
104
 
105
  // Check is image URL of type jpg|png|gif|jpeg.
106
  if ( Astra_Sites_Image_Importer::get_instance()->is_image_url( $url ) ) {
107
+ $timeout_value = 300;
108
  }
109
+
110
  return $timeout_value;
111
  }
112
 
117
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-astra-wxr-importer.php';
118
  }
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  /**
121
  * Change flow status
122
  *
123
+ * @since 2.0.0
124
  *
125
  * @param array $args Flow query args.
126
  * @return array Flow query args.
127
  */
128
+ public function change_flow_status( $args ) {
129
  $args['post_status'] = 'publish';
130
  return $args;
131
  }
133
  /**
134
  * Track Flow
135
  *
136
+ * @since 2.0.0
137
  *
138
  * @param integer $flow_id Flow ID.
139
  * @return void
140
  */
141
+ public function track_flows( $flow_id ) {
142
+ astra_sites_error_log( 'Flow ID ' . $flow_id );
143
  Astra_WXR_Importer::instance()->track_post( $flow_id );
144
  }
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  /**
147
  * Import WP Forms
148
  *
152
  * @param string $wpforms_url WP Forms JSON file URL.
153
  * @return void
154
  */
155
+ public function import_wpforms( $wpforms_url = '' ) {
156
 
157
  if ( ! defined( 'WP_CLI' ) ) {
158
  // Verify Nonce.
168
 
169
  if ( ! empty( $wpforms_url ) && function_exists( 'wpforms_encode' ) ) {
170
 
171
+ // Download JSON file.
172
+ $file_path = Astra_Sites_Helper::download_file( $wpforms_url );
173
 
174
+ if ( $file_path['success'] ) {
175
+ if ( isset( $file_path['data']['file'] ) ) {
176
 
177
+ $ext = strtolower( pathinfo( $file_path['data']['file'], PATHINFO_EXTENSION ) );
178
 
179
  if ( 'json' === $ext ) {
180
+ $forms = json_decode( Astra_Sites::get_instance()->get_filesystem()->get_contents( $file_path['data']['file'] ), true );
181
 
182
  if ( ! empty( $forms ) ) {
183
 
235
  }
236
  }
237
 
238
+ /**
239
+ * Import CartFlows
240
+ *
241
+ * @since 2.0.0
242
+ *
243
+ * @param string $url Cartflows JSON file URL.
244
+ * @return void
245
+ */
246
+ public function import_cartflows( $url = '' ) {
247
+
248
+ // Make the flow publish.
249
+ add_action( 'cartflows_flow_importer_args', array( $this, 'change_flow_status' ) );
250
+ add_action( 'cartflows_flow_imported', array( $this, 'track_flows' ) );
251
+ add_action( 'cartflows_step_imported', array( $this, 'track_flows' ) );
252
+
253
+ $url = ( isset( $_REQUEST['cartflows_url'] ) ) ? urldecode( $_REQUEST['cartflows_url'] ) : urldecode( $url ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
254
+ if ( ! empty( $url ) && is_callable( 'CartFlows_Importer::get_instance' ) ) {
255
+
256
+ // Download JSON file.
257
+ $file_path = Astra_Sites_Helper::download_file( $url );
258
+
259
+ if ( $file_path['success'] ) {
260
+ if ( isset( $file_path['data']['file'] ) ) {
261
+
262
+ $ext = strtolower( pathinfo( $file_path['data']['file'], PATHINFO_EXTENSION ) );
263
+
264
+ if ( 'json' === $ext ) {
265
+ $flows = json_decode( Astra_Sites::get_instance()->get_filesystem()->get_contents( $file_path['data']['file'] ), true );
266
+
267
+ if ( ! empty( $flows ) ) {
268
+ CartFlows_Importer::get_instance()->import_from_json_data( $flows );
269
+ }
270
+ }
271
+ }
272
+ }
273
+ }
274
+
275
+ if ( defined( 'WP_CLI' ) ) {
276
+ WP_CLI::line( 'Imported from ' . $url );
277
+ } else {
278
+ wp_send_json_success( $url );
279
+ }
280
+ }
281
+
282
  /**
283
  * Import Customizer Settings.
284
  *
288
  * @param array $customizer_data Customizer Data.
289
  * @return void
290
  */
291
+ public function import_customizer_settings( $customizer_data = array() ) {
292
 
293
  if ( ! defined( 'WP_CLI' ) ) {
294
  // Verify Nonce.
303
 
304
  if ( ! empty( $customizer_data ) ) {
305
 
306
+ Astra_Sites_Importer_Log::add( 'Imported Customizer Settings ' . wp_json_encode( $customizer_data ) );
307
 
308
  // Set meta for tracking the post.
309
+ astra_sites_error_log( 'Customizer Data ' . wp_json_encode( $customizer_data ) );
310
+
311
  update_option( '_astra_sites_old_customizer_data', $customizer_data );
312
 
313
  Astra_Customizer_Import::instance()->import( $customizer_data );
333
  * @since 1.1.0
334
  * @return void
335
  */
336
+ public function prepare_xml_data() {
337
 
338
  // Verify Nonce.
339
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
381
  * @param array $options_data Site Options.
382
  * @return void
383
  */
384
+ public function import_options( $options_data = array() ) {
385
 
386
  if ( ! defined( 'WP_CLI' ) ) {
387
  // Verify Nonce.
397
  if ( ! empty( $options_data ) ) {
398
  // Set meta for tracking the post.
399
  if ( is_array( $options_data ) ) {
400
+ Astra_Sites_Importer_Log::add( 'Imported - Site Options ' . wp_json_encode( $options_data ) );
401
  update_option( '_astra_sites_old_site_options', $options_data );
402
  }
403
 
427
  * @param string $widgets_data Widgets Data.
428
  * @return void
429
  */
430
+ public function import_widgets( $widgets_data = '' ) {
431
 
432
  if ( ! defined( 'WP_CLI' ) ) {
433
  // Verify Nonce.
440
 
441
  $widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripslashes( $_POST['widgets_data'] ) ) : (object) $widgets_data;
442
 
443
+ Astra_Sites_Importer_Log::add( 'Imported - Widgets ' . wp_json_encode( $widgets_data ) );
444
 
445
  if ( ! empty( $widgets_data ) ) {
446
 
450
  // Set meta for tracking the post.
451
  if ( is_object( $widgets_data ) ) {
452
  $widgets_data = (array) $widgets_data;
453
+
454
  update_option( '_astra_sites_old_widgets_data', $widgets_data );
455
  }
456
 
475
  * @since 1.0.14
476
  * @return void
477
  */
478
+ public function import_end() {
479
 
480
  if ( ! defined( 'WP_CLI' ) ) {
481
  // Verify Nonce.
486
  }
487
  }
488
 
489
+ $demo_data = get_option( 'astra_sites_import_data', array() );
490
+
491
+ do_action( 'astra_sites_import_complete', $demo_data );
492
  }
493
 
494
  /**
586
  *
587
  * @since 1.0.9
588
  */
589
+ public function after_batch_complete() {
590
 
591
  // Clear 'Builder Builder' cache.
592
  if ( is_callable( 'FLBuilderModel::delete_asset_cache_for_all_posts' ) ) {
598
  Astra_Minify::refresh_assets();
599
  }
600
 
601
+ $this->update_latest_checksums();
602
+
603
  Astra_Sites_Importer_Log::add( 'Complete ' );
604
  }
605
 
606
+ /**
607
+ * Update Latest Checksums
608
+ *
609
+ * Store latest checksum after batch complete.
610
+ *
611
+ * @since 2.0.0
612
+ * @return void
613
+ */
614
+ public function update_latest_checksums() {
615
+ $latest_checksums = get_option( 'astra-sites-last-export-checksums-latest', '' );
616
+ update_option( 'astra-sites-last-export-checksums', $latest_checksums );
617
+ }
618
+
619
  /**
620
  * Reset customizer data
621
  *
622
  * @since 1.3.0
623
  * @return void
624
  */
625
+ public function reset_customizer_data() {
626
 
627
  if ( ! defined( 'WP_CLI' ) ) {
628
  // Verify Nonce.
633
  }
634
  }
635
 
636
+ Astra_Sites_Importer_Log::add( 'Deleted customizer Settings ' . wp_json_encode( get_option( 'astra-settings', array() ) ) );
637
 
638
  delete_option( 'astra-settings' );
639
 
650
  * @since 1.3.0
651
  * @return void
652
  */
653
+ public function reset_site_options() {
654
 
655
  if ( ! defined( 'WP_CLI' ) ) {
656
  // Verify Nonce.
663
 
664
  $options = get_option( '_astra_sites_old_site_options', array() );
665
 
666
+ Astra_Sites_Importer_Log::add( 'Deleted - Site Options ' . wp_json_encode( $options ) );
667
 
668
  if ( $options ) {
669
  foreach ( $options as $option_key => $option_value ) {
684
  * @since 1.3.0
685
  * @return void
686
  */
687
+ public function reset_widgets_data() {
688
 
689
  if ( ! defined( 'WP_CLI' ) ) {
690
  // Verify Nonce.
699
 
700
  if ( ! empty( $old_widgets ) ) {
701
 
702
+ Astra_Sites_Importer_Log::add( 'DELETED - WIDGETS ' . wp_json_encode( $old_widgets ) );
703
 
704
  $sidebars_widgets = get_option( 'sidebars_widgets', array() );
705
 
736
  * @param integer $post_id Post ID.
737
  * @return void
738
  */
739
+ public function delete_imported_posts( $post_id = 0 ) {
740
 
741
  if ( ! defined( 'WP_CLI' ) ) {
742
  // Verify Nonce.
775
  * @param integer $post_id Post ID.
776
  * @return void
777
  */
778
+ public function delete_imported_wp_forms( $post_id = 0 ) {
779
 
780
  if ( ! defined( 'WP_CLI' ) ) {
781
  // Verify Nonce.
811
  * @param integer $term_id Term ID.
812
  * @return void
813
  */
814
+ public function delete_imported_terms( $term_id = 0 ) {
815
  if ( ! defined( 'WP_CLI' ) ) {
816
  // Verify Nonce.
817
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
846
  * Kicking this off by calling 'get_instance()' method
847
  */
848
  Astra_Sites_Importer::get_instance();
849
+ }
 
 
 
inc/classes/class-astra-sites-page.php CHANGED
@@ -39,7 +39,7 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
39
  */
40
  public static function get_instance() {
41
  if ( ! isset( self::$instance ) ) {
42
- self::$instance = new self;
43
  }
44
  return self::$instance;
45
  }
@@ -56,8 +56,29 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
56
  }
57
 
58
  add_action( 'after_setup_theme', array( $this, 'init_admin_settings' ), 99 );
59
- add_action( 'admin_init', array( $this, 'save_page_builder' ) );
 
60
  add_action( 'admin_notices', array( $this, 'getting_started' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
@@ -67,24 +88,56 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
67
  *
68
  * @return void
69
  */
70
- function getting_started() {
71
- if ( 'plugins' !== get_current_screen()->base ) {
 
 
 
 
72
  return;
73
  }
74
 
75
- $processed = get_user_meta( get_current_user_id(), '_astra_sites_gettings_started', true );
76
- $product_name = Astra_Sites_White_Label::get_instance()->page_title( 'Astra' );
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- if ( $processed ) {
79
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
- ?>
83
- <div class="notice notice-info is-dismissible astra-sites-getting-started-notice">
84
- <?php /* translators: %1$s is the admin page URL, %2$s is product name. */ ?>
85
- <p><?php printf( __( 'Thank you for choosing %1$s! Check the library of <a class="astra-sites-getting-started-btn" href="%2$s">ready starter sites here »</a>', 'astra-sites' ), $product_name, admin_url( 'themes.php?page=astra-sites' ) ); ?></p>
86
- </div>
87
- <?php
88
  }
89
 
90
  /**
@@ -95,14 +148,13 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
95
  * @param string $page_builder_slug Page Builder Slug.
96
  * @return mixed
97
  */
98
- function save_page_builder( $page_builder_slug = '' ) {
99
 
100
  // Only admins can save settings.
101
  if ( ! defined( 'WP_CLI' ) && ! current_user_can( 'manage_options' ) ) {
102
  return;
103
  }
104
 
105
- // Make sure we have a valid nonce.
106
  if ( ! defined( 'WP_CLI' ) && ( ! isset( $_REQUEST['astra-sites-page-builder'] ) || ! wp_verify_nonce( $_REQUEST['astra-sites-page-builder'], 'astra-sites-welcome-screen' ) ) ) {
107
  return;
108
  }
@@ -126,10 +178,65 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
126
  }
127
 
128
  if ( ! defined( 'WP_CLI' ) ) {
129
- wp_redirect( admin_url( '/themes.php?page=astra-sites' ) );
 
130
  }
131
  }
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  /**
134
  * Get single setting value
135
  *
@@ -137,7 +244,7 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
137
  * @param mixed $defaults Setting value.
138
  * @return mixed Stored setting value.
139
  */
140
- function get_setting( $key = '', $defaults = '' ) {
141
 
142
  $settings = $this->get_settings();
143
 
@@ -157,7 +264,7 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
157
  *
158
  * @return array Stored settings.
159
  */
160
- function get_settings() {
161
 
162
  $defaults = array(
163
  'page_builder' => '',
@@ -168,13 +275,28 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
168
  return wp_parse_args( $stored_data, $defaults );
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  /**
172
  * Admin settings init
173
  */
174
  public function init_admin_settings() {
175
- add_action( 'admin_menu', array( $this, 'add_admin_menu' ), 100 );
176
  add_action( 'admin_notices', array( $this, 'notices' ) );
177
  add_action( 'astra_sites_menu_general_action', array( $this, 'general_page' ) );
 
178
  }
179
 
180
  /**
@@ -184,16 +306,23 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
184
  */
185
  public function notices() {
186
 
187
- if ( 'appearance_page_astra-sites' !== get_current_screen()->id ) {
 
 
 
 
 
 
 
188
  return;
189
  }
190
 
191
  if ( ! class_exists( 'XMLReader' ) ) {
192
  ?>
193
- <div class="notice astra-sites-xml-notice notice-error">
194
- <p><b><?php _e( 'Required XMLReader PHP extension is missing on your server!', 'astra-sites' ); ?></b></p>
195
  <?php /* translators: %s is the white label name. */ ?>
196
- <p><?php printf( __( '%s import requires XMLReader extension to be installed. Please contact your web hosting provider and ask them to install and activate the XMLReader PHP extension.', 'astra-sites' ), ASTRA_SITES_NAME ); ?></p>
197
  </div>
198
  <?php
199
  }
@@ -253,16 +382,17 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
253
  public function render( $action ) {
254
 
255
  // Settings update message.
256
- if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] || 'saved_ext' === $_REQUEST['message'] ) ) {
257
  ?>
258
- <span id="message" class="notice notice-success is-dismissive"><p> <?php esc_html_e( 'Settings saved successfully.', 'astra-sites' ); ?> </p></span>
259
  <?php
260
  }
261
 
262
- $default_page_builder = $this->get_setting( 'page_builder' );
263
 
264
- if ( empty( $default_page_builder ) || isset( $_GET['change-page-builder'] ) ) {
265
 
 
266
  $plugins = get_option( 'active_plugins', array() );
267
  $page_builders = array();
268
  if ( $plugins ) {
@@ -283,51 +413,141 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
283
  $page_builders = implode( ',', $page_builders );
284
  ?>
285
  <div class="astra-sites-welcome" data-plugins="<?php echo esc_attr( $page_builders ); ?>">
286
- <div class="inner">
287
- <form id="astra-sites-welcome-form" enctype="multipart/form-data" method="post">
288
- <h1><?php _e( 'Select Page Builder', 'astra-sites' ); ?></h1>
289
- <p><?php _e( 'Astra offers starter sites that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list below.', 'astra-sites' ); ?></p>
290
- <div class="fields">
291
- <ul class="page-builders">
292
- <?php foreach ( (array) $this->get_page_builders() as $key => $page_builder ) { ?>
293
- <li>
294
- <label>
295
- <input type="radio" name="page_builder" value="<?php echo esc_attr( $page_builder['slug'] ); ?>">
296
- <img src="<?php echo esc_url( $page_builder['image_url'] ); ?>" />
297
- <div class="title"><?php echo esc_html( $page_builder['name'] ); ?></div>
298
- </label>
299
- </li>
 
 
 
 
 
300
  <?php } ?>
301
- </ul>
302
- <div class="astra-sites-page-builder-notice" style="display: none;">
303
- <p class="description"><?php _e( 'Please select your favorite page builder to continue..', 'astra-sites' ); ?></p>
304
- </div>
305
- <?php submit_button( __( 'Next', 'astra-sites' ), 'primary button-hero disabled' ); ?>
306
  </div>
307
-
308
- <input type="hidden" name="message" value="saved" />
309
- <?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
310
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  </div>
312
  </div>
313
  <?php } else { ?>
314
- <?php
315
- $page_title = apply_filters( 'astra_sites_page_title', __( 'Astra Starter Sites - Your Library of 100+ Ready Templates!', 'astra-sites' ) );
316
- ?>
317
  <div class="nav-tab-wrapper">
318
- <h1 class='astra-sites-title'> <?php echo esc_html( $page_title ); ?> </h1>
319
- <form id="astra-sites-welcome-form-inline" enctype="multipart/form-data" method="post">
320
- <div class="fields">
321
- <select name="page_builder" required="required">
322
- <option value="gutenberg" <?php selected( $default_page_builder, 'gutenberg' ); ?>><?php _e( 'Block Editor (Gutenberg)', 'astra-sites' ); ?></option>
323
- <option value="elementor" <?php selected( $default_page_builder, 'elementor' ); ?>><?php _e( 'Elementor', 'astra-sites' ); ?></option>
324
- <option value="beaver-builder" <?php selected( $default_page_builder, 'beaver-builder' ); ?>><?php _e( 'Beaver Builder', 'astra-sites' ); ?></option>
325
- <option value="brizy" <?php selected( $default_page_builder, 'brizy' ); ?>><?php _e( 'Brizy', 'astra-sites' ); ?></option>
326
- </select>
 
 
 
 
 
 
 
 
 
327
  </div>
328
- <input type="hidden" name="message" value="saved" />
329
- <?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
330
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  <?php
332
  $view_actions = $this->get_view_actions();
333
 
@@ -348,36 +568,152 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
348
  <a class='nav-tab <?php echo esc_attr( $active ); ?>' href='<?php echo esc_url( $url ); ?>'> <?php echo esc_html( $data['label'] ); ?> </a>
349
  <?php } ?>
350
  </div><!-- .nav-tab-wrapper -->
 
 
 
351
  <?php
352
  }
353
  }
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  /**
356
  * Page Builder List
357
  *
358
  * @since 1.4.0
359
  * @return array
360
  */
361
- function get_page_builders() {
362
  return array(
363
- 'gutenberg' => array(
364
- 'slug' => 'gutenberg',
365
- 'name' => __( 'Gutenberg', 'astra-sites' ),
366
- 'image_url' => ASTRA_SITES_URI . 'inc/assets/images/gutenberg.jpg',
367
- ),
368
  'elementor' => array(
369
  'slug' => 'elementor',
370
- 'name' => __( 'Elementor', 'astra-sites' ),
371
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/elementor.jpg',
372
  ),
373
  'beaver-builder' => array(
374
  'slug' => 'beaver-builder',
375
- 'name' => __( 'Beaver Builder', 'astra-sites' ),
376
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/beaver-builder.jpg',
377
  ),
 
 
 
 
 
378
  'brizy' => array(
379
  'slug' => 'brizy',
380
- 'name' => __( 'Brizy', 'astra-sites' ),
381
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/brizy.jpg',
382
  ),
383
  );
@@ -392,12 +728,13 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
392
  */
393
  public function get_page_url( $menu_slug ) {
394
 
395
- $parent_page = 'themes.php';
 
396
 
397
  if ( strpos( $parent_page, '?' ) !== false ) {
398
- $query_var = '&page=astra-sites';
399
  } else {
400
- $query_var = '?page=astra-sites';
401
  }
402
 
403
  $parent_page_url = admin_url( $parent_page . $query_var );
@@ -413,9 +750,9 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
413
  * @since 1.0.6
414
  */
415
  public function add_admin_menu() {
416
- $page_title = apply_filters( 'astra_sites_menu_page_title', __( 'Astra Starter Sites', 'astra-sites' ) );
417
 
418
- $page = add_theme_page( $page_title, $page_title, 'manage_options', 'astra-sites', array( $this, 'menu_callback' ) );
419
  }
420
 
421
  /**
@@ -425,11 +762,10 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
425
  */
426
  public function menu_callback() {
427
 
428
- $current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : 'general';
429
 
430
  $active_tab = str_replace( '_', '-', $current_slug );
431
  $current_slug = str_replace( '-', '_', $current_slug );
432
-
433
  ?>
434
  <div class="astra-sites-menu-page-wrapper">
435
  <?php $this->init_nav_menu( $active_tab ); ?>
@@ -445,11 +781,156 @@ if ( ! class_exists( 'Astra_Sites_Page' ) ) {
445
  */
446
  public function general_page() {
447
  $default_page_builder = $this->get_setting( 'page_builder' );
448
- if ( empty( $default_page_builder ) || isset( $_GET['change-page-builder'] ) ) {
449
  return;
450
  }
 
 
 
 
 
 
 
451
  require_once ASTRA_SITES_DIR . 'inc/includes/admin-page.php';
452
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
454
 
455
  Astra_Sites_Page::get_instance();
39
  */
40
  public static function get_instance() {
41
  if ( ! isset( self::$instance ) ) {
42
+ self::$instance = new self();
43
  }
44
  return self::$instance;
45
  }
56
  }
57
 
58
  add_action( 'after_setup_theme', array( $this, 'init_admin_settings' ), 99 );
59
+ add_action( 'wp_ajax_astra-sites-change-page-builder', array( $this, 'save_page_builder_on_ajax' ) );
60
+ add_action( 'admin_init', array( $this, 'save_page_builder_on_submit' ) );
61
  add_action( 'admin_notices', array( $this, 'getting_started' ) );
62
+ add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );
63
+ }
64
+
65
+ /**
66
+ * Admin Body Classes
67
+ *
68
+ * @since 2.0.0
69
+ * @param string $classes Space separated class string.
70
+ */
71
+ public function admin_body_class( $classes = '' ) {
72
+
73
+ $is_page_builder_screen = isset( $_GET['change-page-builder'] ) ? true : false; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
74
+ $current_page_builder = self::get_instance()->get_setting( 'page_builder' );
75
+
76
+ if ( $is_page_builder_screen || empty( $current_page_builder ) ) {
77
+ return $classes . ' astra-sites-change-page-builder ';
78
+ }
79
+
80
+ return $classes;
81
+
82
  }
83
 
84
  /**
88
  *
89
  * @return void
90
  */
91
+ public function getting_started() {
92
+
93
+ $current_screen = get_current_screen();
94
+
95
+ // Bail if not on Astra Sites screen.
96
+ if ( ! is_object( $current_screen ) && null === $current_screen ) {
97
  return;
98
  }
99
 
100
+ if ( 'appearance_page_starter-templates' === $current_screen->base ) {
101
+ $manual_sync = get_option( 'astra-sites-manual-sync-complete', 'no' );
102
+ if ( 'yes' === $manual_sync ) {
103
+ $status = get_option( 'astra-sites-batch-is-complete', 'no' );
104
+ if ( 'yes' === $status ) {
105
+ ?>
106
+ <div class="astra-sites-sync-library-message success astra-sites-notice notice notice-success is-dismissible">
107
+ <p><?php Astra_Sites::get_instance()->get_sync_complete_message( true ); ?></p>
108
+ </div>
109
+ <?php
110
+ }
111
+ }
112
+ }
113
 
114
+ if ( 'plugins' === $current_screen->base ) {
115
+ $processed = get_option( '_astra_sites_gettings_started', 'no' );
116
+ $product_name = Astra_Sites_White_Label::get_instance()->get_white_label_name( 'Astra' );
117
+
118
+ if ( 'yes' === $processed ) {
119
+ return;
120
+ }
121
+
122
+ $arguments = array(
123
+ 'page' => 'starter-templates',
124
+ );
125
+
126
+ $page_builder = self::get_instance()->get_setting( 'page_builder' );
127
+
128
+ if ( empty( $page_builder ) ) {
129
+ $arguments['change-page-builder'] = 'yes';
130
+ }
131
+ $url = add_query_arg( $arguments, admin_url( 'themes.php' ) );
132
+
133
+ ?>
134
+ <div class="notice notice-info is-dismissible astra-sites-notice astra-sites-getting-started-notice">
135
+ <?php /* translators: %1$s is the admin page URL, %2$s is product name. */ ?>
136
+ <p><?php printf( __( 'Thank you for choosing %1$s! Check the library of <a class="astra-sites-getting-started-btn" href="%2$s">ready starter templates here »</a>', 'astra-sites' ), esc_html( $product_name ), esc_url( $url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
137
+ </div>
138
+ <?php
139
  }
140
 
 
 
 
 
 
 
141
  }
142
 
143
  /**
148
  * @param string $page_builder_slug Page Builder Slug.
149
  * @return mixed
150
  */
151
+ public function save_page_builder_on_submit( $page_builder_slug = '' ) {
152
 
153
  // Only admins can save settings.
154
  if ( ! defined( 'WP_CLI' ) && ! current_user_can( 'manage_options' ) ) {
155
  return;
156
  }
157
 
 
158
  if ( ! defined( 'WP_CLI' ) && ( ! isset( $_REQUEST['astra-sites-page-builder'] ) || ! wp_verify_nonce( $_REQUEST['astra-sites-page-builder'], 'astra-sites-welcome-screen' ) ) ) {
159
  return;
160
  }
178
  }
179
 
180
  if ( ! defined( 'WP_CLI' ) ) {
181
+ wp_safe_redirect( admin_url( '/themes.php?page=starter-templates' ) );
182
+ exit();
183
  }
184
  }
185
 
186
+ /**
187
+ * Save Page Builder
188
+ *
189
+ * @return void
190
+ */
191
+ public function save_page_builder_on_ajax() {
192
+
193
+ // Only admins can save settings.
194
+ if ( ! current_user_can( 'manage_options' ) ) {
195
+ wp_send_json_error();
196
+ }
197
+
198
+ // Stored Settings.
199
+ $stored_data = $this->get_settings();
200
+
201
+ // New settings.
202
+ $new_data = array(
203
+ 'page_builder' => ( isset( $_REQUEST['page_builder'] ) ) ? sanitize_key( $_REQUEST['page_builder'] ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended
204
+ );
205
+
206
+ // Merge settings.
207
+ $data = wp_parse_args( $new_data, $stored_data );
208
+
209
+ // Update settings.
210
+ update_option( 'astra_sites_settings', $data );
211
+
212
+ $sites = $this->get_sites_by_page_builder( $new_data['page_builder'] );
213
+
214
+ wp_send_json_success( $sites );
215
+ }
216
+
217
+ /**
218
+ * Get Page Builder Sites
219
+ *
220
+ * @since 2.0.0
221
+ *
222
+ * @param string $default_page_builder default page builder slug.
223
+ * @return array page builder sites.
224
+ */
225
+ public function get_sites_by_page_builder( $default_page_builder = '' ) {
226
+ $sites_and_pages = Astra_Sites::get_instance()->get_all_sites();
227
+ $current_page_builder_sites = array();
228
+ if ( ! empty( $sites_and_pages ) ) {
229
+ $page_builder_keys = wp_list_pluck( $sites_and_pages, 'astra-site-page-builder' );
230
+ foreach ( $page_builder_keys as $site_id => $page_builder ) {
231
+ if ( $default_page_builder === $page_builder ) {
232
+ $current_page_builder_sites[ $site_id ] = $sites_and_pages[ $site_id ];
233
+ }
234
+ }
235
+ }
236
+
237
+ return $current_page_builder_sites;
238
+ }
239
+
240
  /**
241
  * Get single setting value
242
  *
244
  * @param mixed $defaults Setting value.
245
  * @return mixed Stored setting value.
246
  */
247
+ public function get_setting( $key = '', $defaults = '' ) {
248
 
249
  $settings = $this->get_settings();
250
 
264
  *
265
  * @return array Stored settings.
266
  */
267
+ public function get_settings() {
268
 
269
  $defaults = array(
270
  'page_builder' => '',
275
  return wp_parse_args( $stored_data, $defaults );
276
  }
277
 
278
+ /**
279
+ * Update Settings
280
+ *
281
+ * @param array $args Arguments.
282
+ */
283
+ public function update_settings( $args = array() ) {
284
+
285
+ $stored_data = get_option( 'astra_sites_settings', array() );
286
+
287
+ $new_data = wp_parse_args( $args, $stored_data );
288
+
289
+ update_option( 'astra_sites_settings', $new_data );
290
+ }
291
+
292
  /**
293
  * Admin settings init
294
  */
295
  public function init_admin_settings() {
296
+ add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
297
  add_action( 'admin_notices', array( $this, 'notices' ) );
298
  add_action( 'astra_sites_menu_general_action', array( $this, 'general_page' ) );
299
+ add_action( 'astra_pages_menu_general_action', array( $this, 'general_page_for_astra_pages' ) );
300
  }
301
 
302
  /**
306
  */
307
  public function notices() {
308
 
309
+ $current_screen = get_current_screen();
310
+
311
+ // Bail if not on Astra Sites screen.
312
+ if ( ! is_object( $current_screen ) && null === $current_screen ) {
313
+ return;
314
+ }
315
+
316
+ if ( 'appearance_page_starter-templates' !== $current_screen->id ) {
317
  return;
318
  }
319
 
320
  if ( ! class_exists( 'XMLReader' ) ) {
321
  ?>
322
+ <div class="notice astra-sites-xml-notice astra-sites-notice notice-error">
323
+ <p><b><?php esc_html_e( 'Required XMLReader PHP extension is missing on your server!', 'astra-sites' ); ?></b></p>
324
  <?php /* translators: %s is the white label name. */ ?>
325
+ <p><?php printf( esc_html__( '%s import requires XMLReader extension to be installed. Please contact your web hosting provider and ask them to install and activate the XMLReader PHP extension.', 'astra-sites' ), esc_html( ASTRA_SITES_NAME ) ); ?></p>
326
  </div>
327
  <?php
328
  }
382
  public function render( $action ) {
383
 
384
  // Settings update message.
385
+ if ( isset( $_REQUEST['message'] ) && ( 'saved' === $_REQUEST['message'] || 'saved_ext' === $_REQUEST['message'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
386
  ?>
387
+ <span id="message" class="notice astra-sites-notice notice-success is-dismissive"><p> <?php esc_html_e( 'Settings saved successfully.', 'astra-sites' ); ?> </p></span>
388
  <?php
389
  }
390
 
391
+ $current_slug = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : 'starter-templates'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
392
 
393
+ $default_page_builder = $this->get_setting( 'page_builder' );
394
 
395
+ if ( empty( $default_page_builder ) || isset( $_GET['change-page-builder'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
396
  $plugins = get_option( 'active_plugins', array() );
397
  $page_builders = array();
398
  if ( $plugins ) {
413
  $page_builders = implode( ',', $page_builders );
414
  ?>
415
  <div class="astra-sites-welcome" data-plugins="<?php echo esc_attr( $page_builders ); ?>">
416
+ <div class="inner-wrap">
417
+ <div class="inner">
418
+ <div class="header">
419
+ <?php
420
+ $white_label = false;
421
+ $white_label_class = '';
422
+ if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
423
+ $white_label_title = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
424
+ if ( $white_label_title ) {
425
+ $white_label = true;
426
+ $white_label_class = 'white-label-enabled';
427
+ }
428
+ }
429
+ ?>
430
+ <span class="logo <?php echo esc_attr( $white_label_class ); ?>">
431
+ <?php if ( ! $white_label ) { ?>
432
+ <img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/logo.svg' ); ?>">
433
+ <?php } else { ?>
434
+ <?php echo esc_html( Astra_Sites_White_Label::get_instance()->get_white_label_name() ); ?>
435
  <?php } ?>
436
+ <h3 class="title"><?php esc_html_e( 'Getting Started', 'astra-sites' ); ?></h3>
437
+ </span>
438
+ <a href="<?php echo esc_url( admin_url() ); ?>" class="close"><span class="dashicons dashicons-no-alt"></span></a>
 
 
439
  </div>
440
+ <form id="astra-sites-welcome-form" enctype="multipart/form-data" method="post">
441
+ <h1><?php esc_html_e( 'Select Page Builder', 'astra-sites' ); ?></h1>
442
+ <p><?php esc_html_e( 'We offer starter templates that can be imported in one click. These sites are available in the following page builders. Please choose your preferred page builder from the list below.', 'astra-sites' ); ?></p>
443
+ <div class="fields">
444
+ <ul class="page-builders">
445
+ <?php
446
+ $default_page_builder = $this->get_setting( 'page_builder' );
447
+ $page_builders = $this->get_page_builders();
448
+ foreach ( $page_builders as $key => $page_builder ) {
449
+ ?>
450
+ <li data-page-builder="<?php echo esc_html( $page_builder['slug'] ); ?>">
451
+ <label>
452
+ <input type="radio" name="page_builder" value="<?php echo esc_html( $page_builder['name'] ); ?>">
453
+ <img src="<?php echo esc_url( $this->get_page_builder_image( $page_builder['slug'] ) ); ?>" />
454
+ <div class="title"><?php echo esc_html( $page_builder['name'] ); ?></div>
455
+ </label>
456
+ </li>
457
+ <?php
458
+ }
459
+ ?>
460
+ </ul>
461
+ </div>
462
+ <input type="hidden" name="message" value="saved" />
463
+ <?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
464
+ </form>
465
+ </div>
466
  </div>
467
  </div>
468
  <?php } else { ?>
469
+
 
 
470
  <div class="nav-tab-wrapper">
471
+ <?php
472
+ $white_label = false;
473
+ $white_label_class = '';
474
+ if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
475
+ $white_label_title = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
476
+ if ( $white_label_title ) {
477
+ $white_label = true;
478
+ $white_label_class = 'white-label-enabled';
479
+ }
480
+ }
481
+ ?>
482
+ <div class="logo <?php echo esc_attr( $white_label_class ); ?>">
483
+ <div class="astra-sites-logo-wrap">
484
+ <?php if ( ! $white_label ) { ?>
485
+ <img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/logo.svg' ); ?>">
486
+ <?php } else { ?>
487
+ <?php echo esc_html( Astra_Sites_White_Label::get_instance()->get_white_label_name() ); ?>
488
+ <?php } ?>
489
  </div>
490
+ </div>
491
+
492
+ <div class="back-to-layout" title="Back to Layout"><i class="icon-chevron-left"></i></div>
493
+ <div id="astra-sites-filters" class="hide-on-mobile">
494
+ <?php $this->site_filters(); ?>
495
+ </div>
496
+ <div class="form">
497
+ <div class="filters-wrap favorite-filters-wrap header-actions">
498
+ <div class="filters-slug">
499
+ <ul class="filter-links">
500
+ <li>
501
+ <a title="<?php esc_html_e( 'My Favorite', 'astra-sites' ); ?>" href="#" class="astra-sites-show-favorite-button">
502
+ <i class="icon-heart"></i>
503
+ </a>
504
+ </li>
505
+ <li>
506
+ <a title="<?php esc_html_e( 'Sync Library', 'astra-sites' ); ?>" href="#" class="astra-sites-sync-library-button">
507
+ <i class="icon-refresh"></i>
508
+ </a>
509
+ </li>
510
+ </ul>
511
+ </div>
512
+ </div>
513
+ <span class="page-builder-icon">
514
+ <div class="selected-page-builder">
515
+ <?php
516
+ $page_builder = $this->get_default_page_builder();
517
+ if ( $page_builder ) {
518
+ ?>
519
+ <img src="<?php echo esc_url( $this->get_page_builder_image( $page_builder['slug'] ) ); ?>" />
520
+ <span class="page-builder-title"><?php echo esc_html( $page_builder['name'] ); ?></span>
521
+ <span class="dashicons dashicons-arrow-down"></span>
522
+ <?php } ?>
523
+ </div>
524
+ <ul class="page-builders">
525
+ <?php
526
+ $default_page_builder = $this->get_setting( 'page_builder' );
527
+ $page_builders = Astra_Sites::get_instance()->get_page_builders();
528
+ foreach ( $page_builders as $key => $page_builder ) {
529
+ $class = '';
530
+ if ( $default_page_builder === $page_builder['slug'] ) {
531
+ $class = 'active';
532
+ }
533
+ ?>
534
+ <li data-page-builder="<?php echo esc_html( $page_builder['slug'] ); ?>" class="<?php echo esc_html( $class ); ?>">
535
+ <img src="<?php echo esc_url( $this->get_page_builder_image( $page_builder['slug'] ) ); ?>" />
536
+ <div class="title"><?php echo esc_html( $page_builder['name'] ); ?></div>
537
+ </li>
538
+ <?php
539
+ }
540
+ ?>
541
+ </ul>
542
+ <form id="astra-sites-welcome-form-inline" enctype="multipart/form-data" method="post" style="display: none;">
543
+ <div class="fields">
544
+ <input type="hidden" name="page_builder" class="page-builder-input" required="required" />
545
+ </div>
546
+ <input type="hidden" name="message" value="saved" />
547
+ <?php wp_nonce_field( 'astra-sites-welcome-screen', 'astra-sites-page-builder' ); ?>
548
+ </form>
549
+ </span>
550
+ </div>
551
  <?php
552
  $view_actions = $this->get_view_actions();
553
 
568
  <a class='nav-tab <?php echo esc_attr( $active ); ?>' href='<?php echo esc_url( $url ); ?>'> <?php echo esc_html( $data['label'] ); ?> </a>
569
  <?php } ?>
570
  </div><!-- .nav-tab-wrapper -->
571
+ <div id="astra-sites-filters" class="hide-on-desktop">
572
+ <?php $this->site_filters(); ?>
573
+ </div>
574
  <?php
575
  }
576
  }
577
 
578
+ /**
579
+ * Site Filters
580
+ *
581
+ * @since 2.0.0
582
+ *
583
+ * @return void
584
+ */
585
+ public function site_filters() {
586
+ ?>
587
+ <div class="wp-filter hide-if-no-js">
588
+ <div class="section-left">
589
+ <div class="search-form">
590
+ <?php
591
+ $categories = get_option( 'astra-sites-categories', array() );
592
+ if ( ! empty( $categories ) ) {
593
+ ?>
594
+ <div id="astra-sites__category-filter" class="dropdown-check-list" tabindex="100">
595
+ <span class="astra-sites__category-filter-anchor" data-slug=""><?php esc_html_e( 'All', 'astra-sites' ); ?></span>
596
+ <ul class="astra-sites__category-filter-items">
597
+ <li class="ast-sites__filter-wrap category-active" data-slug=""><?php esc_html_e( 'All', 'astra-sites' ); ?> </li>
598
+ <?php
599
+ foreach ( $categories as $key => $value ) {
600
+ if ( 'free' !== $value['slug'] ) {
601
+ ?>
602
+ <li class="ast-sites__filter-wrap" data-slug="<?php echo esc_attr( $value['slug'] ); ?>"><?php echo esc_html( $value['name'] ); ?> </li>
603
+ <?php
604
+ }
605
+ }
606
+ ?>
607
+ <li class="ast-sites__filter-wrap-checkbox first-wrap">
608
+ <label>
609
+ <input id="radio-all" type="radio" name="ast-sites-radio" class="checkbox active" value="" checked /><?php esc_html_e( 'All', 'astra-sites' ); ?>
610
+ </label>
611
+ </li>
612
+ <li class="ast-sites__filter-wrap-checkbox">
613
+ <label>
614
+ <input id="radio-free" type="radio" name="ast-sites-radio" class="checkbox" value="free" /><?php esc_html_e( 'Free', 'astra-sites' ); ?>
615
+ </label>
616
+ </li>
617
+ <li class="ast-sites__filter-wrap-checkbox">
618
+ <label>
619
+ <input id="radio-agency" type="radio" name="ast-sites-radio" class="checkbox" value="agency" /><?php esc_html_e( 'Agency', 'astra-sites' ); ?>
620
+ </label>
621
+ </li>
622
+ </ul>
623
+ </div>
624
+ <?php
625
+ }
626
+ ?>
627
+ <input autocomplete="off" placeholder="<?php esc_html_e( 'Search...', 'astra-sites' ); ?>" type="search" aria-describedby="live-search-desc" id="wp-filter-search-input" class="wp-filter-search">
628
+ <span class="icon-search search-icon"></span>
629
+ <div class="astra-sites-autocomplete-result"></div>
630
+ </div>
631
+ </div>
632
+ </div>
633
+ <?php
634
+ }
635
+
636
+ /**
637
+ * Get Default Page Builder
638
+ *
639
+ * @since 2.0.0
640
+ *
641
+ * @return mixed page builders or empty string.
642
+ */
643
+ public function get_default_page_builder() {
644
+ $default_page_builder = $this->get_setting( 'page_builder' );
645
+
646
+ $page_builders = Astra_Sites::get_instance()->get_page_builders();
647
+
648
+ foreach ( $page_builders as $key => $page_builder ) {
649
+ if ( $page_builder['slug'] === $default_page_builder ) {
650
+ return $page_builder;
651
+ }
652
+ }
653
+
654
+ return '';
655
+ }
656
+
657
+ /**
658
+ * Get Page Builders
659
+ *
660
+ * @since 2.0.0
661
+ *
662
+ * @param string $slug Page Builder Slug.
663
+ * @return array page builders.
664
+ */
665
+ public function get_page_builder_image( $slug ) {
666
+
667
+ $image = '';
668
+
669
+ switch ( $slug ) {
670
+
671
+ case 'elementor':
672
+ $image = ASTRA_SITES_URI . 'inc/assets/images/elementor.jpg';
673
+ break;
674
+
675
+ case 'beaver-builder':
676
+ $image = ASTRA_SITES_URI . 'inc/assets/images/beaver-builder.jpg';
677
+ break;
678
+
679
+ case 'gutenberg':
680
+ $image = ASTRA_SITES_URI . 'inc/assets/images/gutenberg.jpg';
681
+ break;
682
+
683
+ case 'brizy':
684
+ $image = ASTRA_SITES_URI . 'inc/assets/images/brizy.jpg';
685
+ break;
686
+ }
687
+
688
+ return $image;
689
+ }
690
+
691
  /**
692
  * Page Builder List
693
  *
694
  * @since 1.4.0
695
  * @return array
696
  */
697
+ public function get_page_builders() {
698
  return array(
 
 
 
 
 
699
  'elementor' => array(
700
  'slug' => 'elementor',
701
+ 'name' => esc_html__( 'Elementor', 'astra-sites' ),
702
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/elementor.jpg',
703
  ),
704
  'beaver-builder' => array(
705
  'slug' => 'beaver-builder',
706
+ 'name' => esc_html__( 'Beaver Builder', 'astra-sites' ),
707
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/beaver-builder.jpg',
708
  ),
709
+ 'gutenberg' => array(
710
+ 'slug' => 'gutenberg',
711
+ 'name' => esc_html__( 'Gutenberg', 'astra-sites' ),
712
+ 'image_url' => ASTRA_SITES_URI . 'inc/assets/images/gutenberg.jpg',
713
+ ),
714
  'brizy' => array(
715
  'slug' => 'brizy',
716
+ 'name' => esc_html__( 'Brizy', 'astra-sites' ),
717
  'image_url' => ASTRA_SITES_URI . 'inc/assets/images/brizy.jpg',
718
  ),
719
  );
728
  */
729
  public function get_page_url( $menu_slug ) {
730
 
731
+ $current_slug = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : 'starter-templates'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
732
+ $parent_page = 'themes.php';
733
 
734
  if ( strpos( $parent_page, '?' ) !== false ) {
735
+ $query_var = '&page=' . $current_slug;
736
  } else {
737
+ $query_var = '?page=' . $current_slug;
738
  }
739
 
740
  $parent_page_url = admin_url( $parent_page . $query_var );
750
  * @since 1.0.6
751
  */
752
  public function add_admin_menu() {
753
+ $page_title = apply_filters( 'astra_sites_menu_page_title', esc_html__( 'Starter Templates', 'astra-sites' ) );
754
 
755
+ $page = add_theme_page( $page_title, $page_title, 'manage_options', 'starter-templates', array( $this, 'menu_callback' ) );
756
  }
757
 
758
  /**
762
  */
763
  public function menu_callback() {
764
 
765
+ $current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
766
 
767
  $active_tab = str_replace( '_', '-', $current_slug );
768
  $current_slug = str_replace( '-', '_', $current_slug );
 
769
  ?>
770
  <div class="astra-sites-menu-page-wrapper">
771
  <?php $this->init_nav_menu( $active_tab ); ?>
781
  */
782
  public function general_page() {
783
  $default_page_builder = $this->get_setting( 'page_builder' );
784
+ if ( empty( $default_page_builder ) || isset( $_GET['change-page-builder'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
785
  return;
786
  }
787
+
788
+ $global_cpt_meta = array(
789
+ 'category_slug' => 'astra-site-category',
790
+ 'cpt_slug' => 'astra-sites',
791
+ 'page_builder' => 'astra-site-page-builder',
792
+ );
793
+
794
  require_once ASTRA_SITES_DIR . 'inc/includes/admin-page.php';
795
  }
796
+
797
+ /**
798
+ * Converts a period of time in seconds into a human-readable format representing the interval.
799
+ *
800
+ * @since 2.0.0
801
+ *
802
+ * Example:
803
+ *
804
+ * echo self::interval( 90 );
805
+ * // 1 minute 30 seconds
806
+ *
807
+ * @param int $since A period of time in seconds.
808
+ * @return string An interval represented as a string.
809
+ */
810
+ public function interval( $since ) {
811
+ // Array of time period chunks.
812
+ $chunks = array(
813
+ /* translators: 1: The number of years in an interval of time. */
814
+ array( 60 * 60 * 24 * 365, _n_noop( '%s year', '%s years', 'astra-sites' ) ),
815
+ /* translators: 1: The number of months in an interval of time. */
816
+ array( 60 * 60 * 24 * 30, _n_noop( '%s month', '%s months', 'astra-sites' ) ),
817
+ /* translators: 1: The number of weeks in an interval of time. */
818
+ array( 60 * 60 * 24 * 7, _n_noop( '%s week', '%s weeks', 'astra-sites' ) ),
819
+ /* translators: 1: The number of days in an interval of time. */
820
+ array( 60 * 60 * 24, _n_noop( '%s day', '%s days', 'astra-sites' ) ),
821
+ /* translators: 1: The number of hours in an interval of time. */
822
+ array( 60 * 60, _n_noop( '%s hour', '%s hours', 'astra-sites' ) ),
823
+ /* translators: 1: The number of minutes in an interval of time. */
824
+ array( 60, _n_noop( '%s minute', '%s minutes', 'astra-sites' ) ),
825
+ /* translators: 1: The number of seconds in an interval of time. */
826
+ array( 1, _n_noop( '%s second', '%s seconds', 'astra-sites' ) ),
827
+ );
828
+
829
+ if ( $since <= 0 ) {
830
+ return esc_html__( 'now', 'astra-sites' );
831
+ }
832
+
833
+ /**
834
+ * We only want to output two chunks of time here, eg:
835
+ * x years, xx months
836
+ * x days, xx hours
837
+ * so there's only two bits of calculation below:
838
+ */
839
+ $j = count( $chunks );
840
+
841
+ // Step one: the first chunk.
842
+ for ( $i = 0; $i < $j; $i++ ) {
843
+ $seconds = $chunks[ $i ][0];
844
+ $name = $chunks[ $i ][1];
845
+
846
+ // Finding the biggest chunk (if the chunk fits, break).
847
+ $count = floor( $since / $seconds );
848
+ if ( $count ) {
849
+ break;
850
+ }
851
+ }
852
+
853
+ // Set output var.
854
+ $output = sprintf( translate_nooped_plural( $name, $count, 'astra-sites' ), $count );
855
+
856
+ // Step two: the second chunk.
857
+ if ( $i + 1 < $j ) {
858
+ $seconds2 = $chunks[ $i + 1 ][0];
859
+ $name2 = $chunks[ $i + 1 ][1];
860
+ $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 );
861
+ if ( $count2 ) {
862
+ // Add to output var.
863
+ $output .= ' ' . sprintf( translate_nooped_plural( $name2, $count2, 'astra-sites' ), $count2 );
864
+ }
865
+ }
866
+
867
+ return $output;
868
+ }
869
+
870
+ /**
871
+ * Check Cron Status
872
+ *
873
+ * Gets the current cron status by performing a test spawn. Cached for one hour when all is well.
874
+ *
875
+ * @since 2.0.0
876
+ *
877
+ * @param bool $cache Whether to use the cached result from previous calls.
878
+ * @return true|WP_Error Boolean true if the cron spawner is working as expected, or a WP_Error object if not.
879
+ */
880
+ public static function test_cron( $cache = true ) {
881
+ global $wp_version;
882
+
883
+ if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
884
+ return new WP_Error( 'wp_portfolio_cron_error', esc_html__( 'ERROR! Cron schedules are disabled by setting constant DISABLE_WP_CRON to true.<br/>To start the import process please enable the cron by setting the constant to false. E.g. define( \'DISABLE_WP_CRON\', false );', 'astra-sites' ) );
885
+ }
886
+
887
+ if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
888
+ return new WP_Error( 'wp_portfolio_cron_error', esc_html__( 'ERROR! Cron schedules are disabled by setting constant ALTERNATE_WP_CRON to true.<br/>To start the import process please enable the cron by setting the constant to false. E.g. define( \'ALTERNATE_WP_CRON\', false );', 'astra-sites' ) );
889
+ }
890
+
891
+ $cached_status = get_transient( 'astra-portfolio-cron-test-ok' );
892
+
893
+ if ( $cache && $cached_status ) {
894
+ return true;
895
+ }
896
+
897
+ $sslverify = version_compare( $wp_version, 4.0, '<' );
898
+ $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
899
+
900
+ $cron_request = apply_filters(
901
+ 'cron_request',
902
+ array(
903
+ 'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ),
904
+ 'key' => $doing_wp_cron,
905
+ 'args' => array(
906
+ 'timeout' => 3,
907
+ 'blocking' => true,
908
+ 'sslverify' => apply_filters( 'https_local_ssl_verify', $sslverify ),
909
+ ),
910
+ )
911
+ );
912
+
913
+ $cron_request['args']['blocking'] = true;
914
+
915
+ $result = wp_remote_post( $cron_request['url'], $cron_request['args'] );
916
+
917
+ if ( is_wp_error( $result ) ) {
918
+ return $result;
919
+ } elseif ( wp_remote_retrieve_response_code( $result ) >= 300 ) {
920
+ return new WP_Error(
921
+ 'unexpected_http_response_code',
922
+ sprintf(
923
+ /* translators: 1: The HTTP response code. */
924
+ __( 'Unexpected HTTP response code: %s', 'astra-sites' ),
925
+ intval( wp_remote_retrieve_response_code( $result ) )
926
+ )
927
+ );
928
+ } else {
929
+ set_transient( 'astra-portfolio-cron-test-ok', 1, 3600 );
930
+ return true;
931
+ }
932
+
933
+ }
934
  }
935
 
936
  Astra_Sites_Page::get_instance();
inc/classes/class-astra-sites-white-label.php CHANGED
@@ -55,7 +55,7 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
55
  */
56
  public static function get_instance() {
57
  if ( ! isset( self::$instance ) ) {
58
- self::$instance = new self;
59
  }
60
  return self::$instance;
61
  }
@@ -68,9 +68,9 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
68
  public function __construct() {
69
  add_filter( 'all_plugins', array( $this, 'plugins_page' ) );
70
  add_filter( 'astra_addon_branding_options', __CLASS__ . '::settings' );
71
- add_action( 'astra_pro_white_label_add_form', __CLASS__ . '::add_white_lavel_form' );
72
- add_filter( 'astra_sites_menu_page_title', array( $this, 'page_title' ) );
73
- add_filter( 'astra_sites_page_title', array( $this, 'page_title' ) );
74
 
75
  // Display the link with the plugin meta.
76
  if ( is_admin() ) {
@@ -86,7 +86,7 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
86
  * @param array $plugins Plugins Array.
87
  * @return array
88
  */
89
- function plugins_page( $plugins ) {
90
 
91
  if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
92
  return $plugins;
@@ -124,6 +124,30 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
124
  return $plugins;
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  /**
128
  * Remove a "view details" link from the plugin list table
129
  *
@@ -181,7 +205,7 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
181
  * @param array $settings White label setting.
182
  * @return void
183
  */
184
- public static function add_white_lavel_form( $settings = array() ) {
185
 
186
  /* translators: %1$s product name */
187
  $plugin_name = sprintf( __( '%1$s Branding', 'astra-sites' ), ASTRA_SITES_NAME );
@@ -197,16 +221,31 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
197
  * @param string $title Page Title.
198
  * @return string Filtered Page Title.
199
  */
200
- function page_title( $title = '' ) {
201
-
202
  if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
203
  $astra_sites_name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
204
  if ( ! empty( $astra_sites_name ) ) {
205
- $title = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
206
  }
207
  }
208
 
209
- return $title;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
 
212
  /**
@@ -216,7 +255,7 @@ if ( ! class_exists( 'Astra_Sites_White_Label' ) ) :
216
  *
217
  * @return string
218
  */
219
- function is_white_labeled() {
220
  if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
221
  return false;
222
  }
55
  */
56
  public static function get_instance() {
57
  if ( ! isset( self::$instance ) ) {
58
+ self::$instance = new self();
59
  }
60
  return self::$instance;
61
  }
68
  public function __construct() {
69
  add_filter( 'all_plugins', array( $this, 'plugins_page' ) );
70
  add_filter( 'astra_addon_branding_options', __CLASS__ . '::settings' );
71
+ add_action( 'astra_pro_white_label_add_form', __CLASS__ . '::add_white_label_form' );
72
+ add_filter( 'astra_sites_menu_page_title', array( $this, 'get_white_label_name' ) );
73
+ add_filter( 'astra_sites_page_title', array( $this, 'get_white_label_name' ) );
74
 
75
  // Display the link with the plugin meta.
76
  if ( is_admin() ) {
86
  * @param array $plugins Plugins Array.
87
  * @return array
88
  */
89
+ public function plugins_page( $plugins ) {
90
 
91
  if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
92
  return $plugins;
124
  return $plugins;
125
  }
126
 
127
+ /**
128
+ * Get value of single key from option array.
129
+ *
130
+ * @since 2.0.0.
131
+ * @param string $type Option type.
132
+ * @param string $key Option key.
133
+ * @param string $default Default value if key not found.
134
+ * @return mixed Return stored option value.
135
+ */
136
+ public static function get_option( $type = '', $key = '', $default = null ) {
137
+
138
+ if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_white_label' ) ) {
139
+ return $default;
140
+ }
141
+
142
+ $value = Astra_Ext_White_Label_Markup::get_white_label( $type, $key );
143
+ if ( ! empty( $value ) ) {
144
+ return $value;
145
+ }
146
+
147
+ return $default;
148
+
149
+ }
150
+
151
  /**
152
  * Remove a "view details" link from the plugin list table
153
  *
205
  * @param array $settings White label setting.
206
  * @return void
207
  */
208
+ public static function add_white_label_form( $settings = array() ) {
209
 
210
  /* translators: %1$s product name */
211
  $plugin_name = sprintf( __( '%1$s Branding', 'astra-sites' ), ASTRA_SITES_NAME );
221
  * @param string $title Page Title.
222
  * @return string Filtered Page Title.
223
  */
224
+ public function get_white_label_name( $title = '' ) {
 
225
  if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
226
  $astra_sites_name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
227
  if ( ! empty( $astra_sites_name ) ) {
228
+ return Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' );
229
  }
230
  }
231
 
232
+ return ASTRA_SITES_NAME;
233
+ }
234
+
235
+ /**
236
+ * White Label Link
237
+ *
238
+ * @since 2.0.0
239
+ *
240
+ * @param string $link Default link.
241
+ * @return string Filtered Page Title.
242
+ */
243
+ public function get_white_label_link( $link = '' ) {
244
+ if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
245
+ return Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-agency', 'licence' );
246
+ }
247
+
248
+ return $link;
249
  }
250
 
251
  /**
255
  *
256
  * @return string
257
  */
258
+ public function is_white_labeled() {
259
  if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
260
  return false;
261
  }
inc/classes/class-astra-sites-wp-cli.php CHANGED
@@ -159,7 +159,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
159
  if ( 'free' !== $demo_data['site-type'] && 'upgrade' === $demo_data['license-status'] && ! $license_status ) {
160
 
161
  if ( ! defined( 'ASTRA_PRO_SITES_NAME' ) ) {
162
- WP_CLI::line( __( 'This is Agency site. Please activate the "Astra Premium Sites" license!', 'astra-sites' ) );
163
  WP_CLI::line( __( 'Use `wp plugin deactivate astra-sites` and then `wp plugin activate astra-pro-sites`', 'astra-sites' ) );
164
  }
165
 
@@ -173,14 +173,19 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
173
  if ( isset( $demo_data['required-plugins'] ) ) {
174
  $plugins = (array) $demo_data['required-plugins'];
175
  if ( ! empty( $plugins ) ) {
176
- $plugin_status = Astra_Sites::get_instance()->required_plugin( $plugins );
177
 
178
  // Install Plugins.
179
  if ( ! empty( $plugin_status['required_plugins']['notinstalled'] ) ) {
180
  WP_CLI::line( __( 'Installing Plugins..', 'astra-sites' ) );
181
  foreach ( $plugin_status['required_plugins']['notinstalled'] as $key => $plugin ) {
182
  if ( isset( $plugin['slug'] ) ) {
183
- WP_CLI::runcommand( 'plugin install ' . $plugin['slug'] . ' --activate' );
 
 
 
 
 
184
  }
185
  }
186
  }
@@ -266,7 +271,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
266
  * @since 1.4.3
267
  * @return void
268
  */
269
- function import_end() {
270
  Astra_Sites_Importer::get_instance()->import_end();
271
  }
272
 
@@ -285,20 +290,20 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
285
  // Valid site ID?
286
  $url = isset( $args[0] ) ? esc_url_raw( $args[0] ) : '';
287
  if ( empty( $url ) ) {
288
- WP_CLI::error( __( 'Invalid XML URL.', 'astra-sites' ) );
289
  }
290
 
291
  // Download XML file.
292
  /* translators: %s is the XML file URL. */
293
- WP_CLI::line( sprintf( __( 'Downloading %s', 'astra-sites' ), $url ) );
294
  $xml_path = Astra_Sites_Helper::download_file( $url );
295
 
296
  if ( $xml_path['success'] && isset( $xml_path['data']['file'] ) ) {
297
- WP_CLI::line( __( 'Importing WXR..', 'astra-sites' ) );
298
  Astra_WXR_Importer::instance()->sse_import( $xml_path['data']['file'] );
299
  } else {
300
  /* translators: %s is error message. */
301
- WP_CLI::line( printf( __( 'WXR file Download Failed. Error %s', 'astra-sites' ), $xml_path['data'] ) );
302
  }
303
  }
304
 
@@ -436,7 +441,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
436
  $page_builder_slugs = array_keys( $page_builders );
437
  $page_builder_slug = isset( $args[1] ) ? $args[1] : '';
438
  if ( in_array( $page_builder_slug, $page_builder_slugs, true ) ) {
439
- Astra_Sites_Page::get_instance()->save_page_builder( $page_builder_slug );
440
  /* translators: %s is the page builder name. */
441
  WP_CLI::line( sprintf( __( '"%s" is set as default page builder.', 'astra-sites' ), $page_builders[ $page_builder_slug ]['name'] ) );
442
 
@@ -496,7 +501,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
496
  $args = $response['args'];
497
  $page_builders = $response['terms'];
498
  if ( empty( $page_builders['data'] ) ) {
499
- WP_CLI::error( __( 'This site page builder is not exist. Try different site page builder.', 'astra-sites' ) );
500
  }
501
 
502
  // Add type.
@@ -505,7 +510,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
505
  $args = $response['args'];
506
  $types = $response['terms'];
507
  if ( empty( $types['data'] ) ) {
508
- WP_CLI::error( __( 'This site type is not exist. Try different site type.', 'astra-sites' ) );
509
  }
510
 
511
  // Add categories.
@@ -514,7 +519,7 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
514
  $args = $response['args'];
515
  $categories = $response['terms'];
516
  if ( empty( $categories['data'] ) ) {
517
- WP_CLI::error( __( 'This site category is not exist. Try different site category.', 'astra-sites' ) );
518
  }
519
 
520
  // Site list.
@@ -684,6 +689,22 @@ if ( class_exists( 'WP_CLI_Command' ) && ! class_exists( 'Astra_Sites_WP_CLI' )
684
  'data' => $all_posts,
685
  );
686
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  }
688
 
689
  /**
159
  if ( 'free' !== $demo_data['site-type'] && 'upgrade' === $demo_data['license-status'] && ! $license_status ) {
160
 
161
  if ( ! defined( 'ASTRA_PRO_SITES_NAME' ) ) {
162
+ WP_CLI::line( __( 'This is Agency site. Please activate the "Starter Templates" license!', 'astra-sites' ) );
163
  WP_CLI::line( __( 'Use `wp plugin deactivate astra-sites` and then `wp plugin activate astra-pro-sites`', 'astra-sites' ) );
164
  }
165
 
173
  if ( isset( $demo_data['required-plugins'] ) ) {
174
  $plugins = (array) $demo_data['required-plugins'];
175
  if ( ! empty( $plugins ) ) {
176
+ $plugin_status = Astra_Sites::get_instance()->required_plugin( $plugins, $demo_data['astra-site-options-data'], $demo_data['astra-enabled-extensions'] );
177
 
178
  // Install Plugins.
179
  if ( ! empty( $plugin_status['required_plugins']['notinstalled'] ) ) {
180
  WP_CLI::line( __( 'Installing Plugins..', 'astra-sites' ) );
181
  foreach ( $plugin_status['required_plugins']['notinstalled'] as $key => $plugin ) {
182
  if ( isset( $plugin['slug'] ) ) {
183
+
184
+ // Install plugin.
185
+ WP_CLI::runcommand( 'plugin install ' . $plugin['slug'] );
186
+
187
+ // Activate plugin.
188
+ Astra_Sites::get_instance()->required_plugin_activate( $plugin['init'], $demo_data['astra-site-options-data'], $demo_data['astra-enabled-extensions'] );
189
  }
190
  }
191
  }
271
  * @since 1.4.3
272
  * @return void
273
  */
274
+ public function import_end() {
275
  Astra_Sites_Importer::get_instance()->import_end();
276
  }
277
 
290
  // Valid site ID?
291
  $url = isset( $args[0] ) ? esc_url_raw( $args[0] ) : '';
292
  if ( empty( $url ) ) {
293
+ WP_CLI::error( esc_html__( 'Invalid XML URL.', 'astra-sites' ) );
294
  }
295
 
296
  // Download XML file.
297
  /* translators: %s is the XML file URL. */
298
+ WP_CLI::line( sprintf( esc_html__( 'Downloading %s', 'astra-sites' ), $url ) );
299
  $xml_path = Astra_Sites_Helper::download_file( $url );
300
 
301
  if ( $xml_path['success'] && isset( $xml_path['data']['file'] ) ) {
302
+ WP_CLI::line( esc_html__( 'Importing WXR..', 'astra-sites' ) );
303
  Astra_WXR_Importer::instance()->sse_import( $xml_path['data']['file'] );
304
  } else {
305
  /* translators: %s is error message. */
306
+ WP_CLI::line( printf( esc_html__( 'WXR file Download Failed. Error %s', 'astra-sites' ), esc_html( $xml_path['data'] ) ) );
307
  }
308
  }
309
 
441
  $page_builder_slugs = array_keys( $page_builders );
442
  $page_builder_slug = isset( $args[1] ) ? $args[1] : '';
443
  if ( in_array( $page_builder_slug, $page_builder_slugs, true ) ) {
444
+ Astra_Sites_Page::get_instance()->save_page_builder_on_submit( $page_builder_slug );
445
  /* translators: %s is the page builder name. */
446
  WP_CLI::line( sprintf( __( '"%s" is set as default page builder.', 'astra-sites' ), $page_builders[ $page_builder_slug ]['name'] ) );
447
 
501
  $args = $response['args'];
502
  $page_builders = $response['terms'];
503
  if ( empty( $page_builders['data'] ) ) {
504
+ WP_CLI::error( __( 'This page builder plugin is not installed. Please try a different page builder.', 'astra-sites' ) );
505
  }
506
 
507
  // Add type.
510
  $args = $response['args'];
511
  $types = $response['terms'];
512
  if ( empty( $types['data'] ) ) {
513
+ WP_CLI::error( __( 'This site type does not exist. Please try a different site type.', 'astra-sites' ) );
514
  }
515
 
516
  // Add categories.
519
  $args = $response['args'];
520
  $categories = $response['terms'];
521
  if ( empty( $categories['data'] ) ) {
522
+ WP_CLI::error( __( 'This site category does not exist. Please try a different site category.', 'astra-sites' ) );
523
  }
524
 
525
  // Site list.
689
  'data' => $all_posts,
690
  );
691
  }
692
+
693
+ /**
694
+ * Sync Library.
695
+ *
696
+ * Sync the library and create the .json files.
697
+ *
698
+ * Use: `wp astra-sites sync`
699
+ *
700
+ * @since 2.0.0
701
+ * @param array $args Arguments.
702
+ * @param array $assoc_args Associated Arguments.
703
+ * @return void.
704
+ */
705
+ public function sync( $args = array(), $assoc_args = array() ) {
706
+ Astra_Sites_Batch_Processing::get_instance()->process_batch();
707
+ }
708
  }
709
 
710
  /**
inc/classes/class-astra-sites.php CHANGED
@@ -6,7 +6,11 @@
6
  * @package Astra Sites
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
 
 
10
 
11
  if ( ! class_exists( 'Astra_Sites' ) ) :
12
 
@@ -21,7 +25,31 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
21
  * @since 1.0.0
22
  * @var (String) URL
23
  */
24
- public static $api_url;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  /**
27
  * Instance of Astra_Sites
@@ -29,7 +57,23 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
29
  * @since 1.0.0
30
  * @var (Object) Astra_Sites
31
  */
32
- private static $_instance = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  /**
35
  * Instance of Astra_Sites.
@@ -39,11 +83,11 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
39
  * @return object Class object.
40
  */
41
  public static function get_instance() {
42
- if ( ! isset( self::$_instance ) ) {
43
- self::$_instance = new self;
44
  }
45
 
46
- return self::$_instance;
47
  }
48
 
49
  /**
@@ -53,22 +97,678 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
53
  */
54
  private function __construct() {
55
 
56
- self::set_api_url();
57
 
58
  $this->includes();
59
 
60
- add_action( 'admin_notices', array( $this, 'add_notice' ), 1 );
61
  add_action( 'admin_notices', array( $this, 'admin_notices' ) );
62
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
63
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- // AJAX.
66
- add_action( 'wp_ajax_astra-required-plugins', array( $this, 'required_plugin' ) );
67
- add_action( 'wp_ajax_astra-required-plugin-activate', array( $this, 'required_plugin_activate' ) );
68
- add_action( 'wp_ajax_astra-sites-backup-settings', array( $this, 'backup_settings' ) );
69
- add_action( 'wp_ajax_astra-sites-set-reset-data', array( $this, 'get_reset_data' ) );
70
- add_action( 'wp_ajax_astra-sites-activate-theme', array( $this, 'activate_theme' ) );
71
- add_action( 'wp_ajax_astra-sites-getting-started-notice', array( $this, 'getting_started_notice' ) );
72
  }
73
 
74
  /**
@@ -77,7 +777,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
77
  * @since 1.3.5
78
  * @return void
79
  */
80
- function getting_started_notice() {
81
  // Verify Nonce.
82
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
83
 
@@ -85,7 +785,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
85
  wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
86
  }
87
 
88
- update_user_meta( get_current_user_id(), '_astra_sites_gettings_started', true );
89
  wp_send_json_success();
90
  }
91
 
@@ -95,7 +795,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
95
  * @since 1.3.2
96
  * @return void
97
  */
98
- function activate_theme() {
99
 
100
  // Verify Nonce.
101
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
@@ -117,7 +817,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
117
  /**
118
  * Set reset data
119
  */
120
- function get_reset_data() {
121
 
122
  if ( ! defined( 'WP_CLI' ) ) {
123
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
@@ -150,13 +850,13 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
150
  /**
151
  * Backup our existing settings.
152
  */
153
- function backup_settings() {
154
 
155
  if ( ! defined( 'WP_CLI' ) ) {
156
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
157
 
158
  if ( ! current_user_can( 'manage_options' ) ) {
159
- wp_send_json_error( __( 'User not have permission!', 'astra-sites' ) );
160
  }
161
  }
162
 
@@ -165,10 +865,10 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
165
  $upload_dir = Astra_Sites_Importer_Log::get_instance()->log_dir();
166
  $upload_path = trailingslashit( $upload_dir['path'] );
167
  $log_file = $upload_path . $file_name;
168
- $file_system = Astra_Sites_Importer_Log::get_instance()->get_filesystem();
169
 
170
  // If file system fails? Then take a backup in site option.
171
- if ( false === $file_system->put_contents( $log_file, json_encode( $old_settings ), FS_CHMOD_FILE ) ) {
172
  update_option( 'astra_sites_' . $file_name, $old_settings );
173
  }
174
 
@@ -182,7 +882,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
182
  /**
183
  * Add Admin Notice.
184
  */
185
- function add_notice() {
186
 
187
  $theme_status = 'astra-sites-theme-' . $this->get_theme_status();
188
 
@@ -190,9 +890,10 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
190
  array(
191
  'id' => 'astra-theme-activation-nag',
192
  'type' => 'error',
 
193
  'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
194
  /* translators: 1: theme.php file*/
195
- 'message' => sprintf( __( '<p>Astra Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="#" class="%3$s" data-theme-slug="astra">Install & Activate Now</a></p>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ) ), $theme_status ),
196
  'dismissible' => true,
197
  'dismissible-time' => WEEK_IN_SECONDS,
198
  )
@@ -206,7 +907,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
206
  *
207
  * @return string Theme status
208
  */
209
- function get_theme_status() {
210
 
211
  $theme = wp_get_theme();
212
 
@@ -230,7 +931,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
230
  *
231
  * @since 1.0.1
232
  */
233
- function load_textdomain() {
234
  load_plugin_textdomain( 'astra-sites' );
235
  }
236
 
@@ -240,12 +941,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
240
  * @since 1.0.5
241
  * @return void
242
  */
243
- function admin_notices() {
244
-
245
- if ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) {
246
- return;
247
- }
248
-
249
  add_action( 'plugin_action_links_' . ASTRA_SITES_BASE, array( $this, 'action_links' ) );
250
  }
251
 
@@ -255,21 +951,135 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
255
  * @param mixed $links Plugin Action links.
256
  * @return array
257
  */
258
- function action_links( $links ) {
 
 
 
 
 
 
 
 
 
 
 
259
  $action_links = array(
260
- 'settings' => '<a href="' . admin_url( 'themes.php?page=astra-sites' ) . '" aria-label="' . esc_attr__( 'See Library', 'astra-sites' ) . '">' . esc_html__( 'See Library', 'astra-sites' ) . '</a>',
261
  );
262
 
263
  return array_merge( $action_links, $links );
264
  }
265
 
 
 
 
 
 
 
 
 
 
266
  /**
267
  * Setter for $api_url
268
  *
269
  * @since 1.0.0
270
  */
271
- public static function set_api_url() {
272
- self::$api_url = apply_filters( 'astra_sites_api_url', 'https://websitedemos.net/wp-json/wp/v2/' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  }
274
 
275
  /**
@@ -278,7 +1088,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
278
  * @since 1.0.0
279
  */
280
  public function get_api_url() {
281
- return self::$api_url;
282
  }
283
 
284
  /**
@@ -294,23 +1104,27 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
294
  */
295
  public function admin_enqueue( $hook = '' ) {
296
 
 
 
 
297
  wp_enqueue_script( 'astra-sites-install-theme', ASTRA_SITES_URI . 'inc/assets/js/install-theme.js', array( 'jquery', 'updates' ), ASTRA_SITES_VER, true );
298
  wp_enqueue_style( 'astra-sites-install-theme', ASTRA_SITES_URI . 'inc/assets/css/install-theme.css', null, ASTRA_SITES_VER, 'all' );
 
299
 
300
  $data = apply_filters(
301
  'astra_sites_install_theme_localize_vars',
302
  array(
303
  'installed' => __( 'Installed! Activating..', 'astra-sites' ),
304
- 'activating' => __( 'Activating..', 'astra-sites' ),
305
- 'activated' => __( 'Activated! Reloading..', 'astra-sites' ),
306
- 'installing' => __( 'Installing..', 'astra-sites' ),
307
  'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
308
  '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
309
  )
310
  );
311
  wp_localize_script( 'astra-sites-install-theme', 'AstraSitesInstallThemeVars', $data );
312
 
313
- if ( 'appearance_page_astra-sites' !== $hook ) {
314
  return;
315
  }
316
 
@@ -323,33 +1137,206 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
323
  // Fetch.
324
  wp_register_script( 'astra-sites-fetch', ASTRA_SITES_URI . 'inc/assets/js/fetch.umd.js', array( 'jquery' ), ASTRA_SITES_VER, true );
325
 
 
 
 
326
  // API.
327
  wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery', 'astra-sites-fetch' ), ASTRA_SITES_VER, true );
328
 
329
  // Admin Page.
330
  wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
331
- wp_enqueue_script( 'astra-sites-admin-page', ASTRA_SITES_URI . 'inc/assets/js/admin-page.js', array( 'jquery', 'wp-util', 'updates', 'wp-url' ), ASTRA_SITES_VER, true );
332
- wp_enqueue_script( 'astra-sites-render-grid', ASTRA_SITES_URI . 'inc/assets/js/render-grid.js', array( 'wp-util', 'astra-sites-api', 'imagesloaded', 'jquery' ), ASTRA_SITES_VER, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
 
334
  $data = apply_filters(
335
  'astra_sites_localize_vars',
336
  array(
337
- 'ApiURL' => self::$api_url,
338
- 'filters' => array(
339
- 'page_builder' => array(
340
- 'title' => __( 'Page Builder', 'astra-sites' ),
341
- 'slug' => 'astra-site-page-builder',
342
- 'trigger' => 'astra-api-category-loaded',
343
- ),
344
- 'categories' => array(
345
- 'title' => __( 'Categories', 'astra-sites' ),
346
- 'slug' => 'astra-site-category',
347
- 'trigger' => 'astra-api-category-loaded',
348
- ),
 
 
 
 
349
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  )
351
  );
352
- wp_localize_script( 'astra-sites-api', 'astraSitesApi', $data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
  // Use this for premium demos.
355
  $request_params = apply_filters(
@@ -357,100 +1344,112 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
357
  array(
358
  'purchase_key' => '',
359
  'site_url' => '',
360
- 'par-page' => 30,
361
  )
362
  );
363
 
364
- $data = apply_filters(
365
- 'astra_sites_render_localize_vars',
366
- array(
367
- 'sites' => $request_params,
368
- 'page-builders' => array(),
369
- 'categories' => array(),
370
- 'settings' => array(),
371
- 'default_page_builder' => Astra_Sites_Page::get_instance()->get_setting( 'page_builder' ),
372
- )
373
- );
374
 
375
- wp_localize_script( 'astra-sites-render-grid', 'astraRenderGrid', $data );
 
 
 
376
 
377
  $data = apply_filters(
378
- 'astra_sites_localize_vars',
379
  array(
380
- 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false,
381
- 'isPro' => defined( 'ASTRA_PRO_SITES_NAME' ) ? true : false,
382
- 'isWhiteLabeled' => Astra_Sites_White_Label::get_instance()->is_white_labeled(),
383
- 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
384
- 'siteURL' => site_url(),
385
- 'docUrl' => 'https://wpastra.com/',
386
- 'getProText' => __( 'Get Agency Bundle', 'astra-sites' ),
387
- 'getProURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
388
- 'getUpgradeText' => __( 'Upgrade', 'astra-sites' ),
389
- 'getUpgradeURL' => esc_url( 'https://wpastra.com/agency/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
390
- '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
391
- 'requiredPlugins' => array(),
392
- 'XMLReaderDisabled' => ! class_exists( 'XMLReader' ) ? true : false,
393
- 'strings' => array(
394
- /* translators: %s are HTML tags. */
395
- 'warningXMLReader' => sprintf( __( '%1$sRequired XMLReader PHP extension is missing on your server!%2$sAstra Sites import requires XMLReader extension to be installed. Please contact your web hosting provider and ask them to install and activate the XMLReader PHP extension.', 'astra-sites' ), '<div class="notice astra-sites-xml-notice notice-error"><p><b>', '</b></p><p>', '</p></div>' ),
396
- 'warningBeforeCloseWindow' => __( 'Warning! Astra Site Import process is not complete. Don\'t close the window until import process complete. Do you still want to leave the window?', 'astra-sites' ),
397
- 'importFailedBtnSmall' => __( 'Error!', 'astra-sites' ),
398
- 'importFailedBtnLarge' => __( 'Error! Read Possibilities.', 'astra-sites' ),
399
- 'importFailedURL' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=import-failed' ),
400
- 'viewSite' => __( 'Done! View Site', 'astra-sites' ),
401
- 'btnActivating' => __( 'Activating', 'astra-sites' ) . '&hellip;',
402
- 'btnActive' => __( 'Active', 'astra-sites' ),
403
- 'importFailBtn' => __( 'Import failed.', 'astra-sites' ),
404
- 'importFailBtnLarge' => __( 'Import failed.', 'astra-sites' ),
405
- 'importDemo' => __( 'Import This Site', 'astra-sites' ),
406
- 'importingDemo' => __( 'Importing..', 'astra-sites' ),
407
- 'DescExpand' => __( 'Read more', 'astra-sites' ) . '&hellip;',
408
- 'DescCollapse' => __( 'Hide', 'astra-sites' ),
409
- 'responseError' => __( 'There was a problem receiving a response from server.', 'astra-sites' ),
410
- 'searchNoFound' => __( 'No Demos found, Try a different search.', 'astra-sites' ),
411
- ),
412
- 'log' => array(
413
- 'installingPlugin' => __( 'Installing plugin ', 'astra-sites' ),
414
- 'installed' => __( 'Plugin installed!', 'astra-sites' ),
415
- 'activating' => __( 'Activating plugin ', 'astra-sites' ),
416
- 'activated' => __( 'Plugin activated ', 'astra-sites' ),
417
- 'bulkActivation' => __( 'Bulk plugin activation...', 'astra-sites' ),
418
- 'activate' => __( 'Plugin activate - ', 'astra-sites' ),
419
- 'activationError' => __( 'Error! While activating plugin - ', 'astra-sites' ),
420
- 'bulkInstall' => __( 'Bulk plugin installation...', 'astra-sites' ),
421
- 'api' => __( 'Site API ', 'astra-sites' ),
422
- 'importing' => __( 'Importing..', 'astra-sites' ),
423
- 'processingRequest' => __( 'Processing requests...', 'astra-sites' ),
424
- 'importCustomizer' => __( 'Importing "Customizer Settings"...', 'astra-sites' ),
425
- 'importCustomizerSuccess' => __( 'Imported customizer settings!', 'astra-sites' ),
426
- 'importWPForms' => __( 'Importing "Contact Forms"...', 'astra-sites' ),
427
- 'importWPFormsSuccess' => __( 'Imported Contact Forms!', 'astra-sites' ),
428
- 'importXMLPrepare' => __( 'Preparing "XML" Data...', 'astra-sites' ),
429
- 'importXMLPrepareSuccess' => __( 'Set XML data!', 'astra-sites' ),
430
- 'importXML' => __( 'Importing "XML"...', 'astra-sites' ),
431
- 'importXMLSuccess' => __( 'Imported XML!', 'astra-sites' ),
432
- 'importOptions' => __( 'Importing "Options"...', 'astra-sites' ),
433
- 'importOptionsSuccess' => __( 'Imported Options!', 'astra-sites' ),
434
- 'importWidgets' => __( 'Importing "Widgets"...', 'astra-sites' ),
435
- 'importWidgetsSuccess' => __( 'Imported Widgets!', 'astra-sites' ),
436
- 'serverConfiguration' => esc_url( 'https://wpastra.com/docs/?p=1314&utm_source=demo-import-panel&utm_campaign=import-error&utm_medium=wp-dashboard' ),
437
- 'success' => __( 'View site: ', 'astra-sites' ),
438
- 'gettingData' => __( 'Getting Site Information..', 'astra-sites' ),
439
- 'importingCustomizer' => __( 'Importing Customizer Settings..', 'astra-sites' ),
440
- 'importingWPForms' => __( 'Importing Contact Forms..', 'astra-sites' ),
441
- 'importXMLPreparing' => __( 'Setting up import data..', 'astra-sites' ),
442
- 'importingXML' => __( 'Importing Content..', 'astra-sites' ),
443
- 'importingOptions' => __( 'Importing Site Options..', 'astra-sites' ),
444
- 'importingWidgets' => __( 'Importing Widgets..', 'astra-sites' ),
445
- 'importComplete' => __( 'Import Complete..', 'astra-sites' ),
446
- 'preview' => __( 'Previewing ', 'astra-sites' ),
447
- 'importLogText' => __( 'See Error Log &rarr;', 'astra-sites' ),
448
  ),
449
  )
450
  );
451
 
452
- wp_localize_script( 'astra-sites-admin-page', 'astraSitesAdmin', $data );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
 
 
454
  }
455
 
456
  /**
@@ -460,9 +1459,12 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
460
  */
461
  private function includes() {
462
 
 
463
  require_once ASTRA_SITES_DIR . 'inc/lib/astra-notices/class-astra-notices.php';
464
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-white-label.php';
465
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-page.php';
 
 
466
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/class-astra-sites-compatibility.php';
467
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer.php';
468
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-wp-cli.php';
@@ -487,20 +1489,13 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
487
  wp_send_json_error(
488
  array(
489
  'success' => false,
490
- 'message' => __( 'User have not plugin install permissions.', 'astra-sites' ),
491
  )
492
  );
493
  }
494
  }
495
 
496
- $plugin_init = ( isset( $_POST['init'] ) ) ? esc_attr( $_POST['init'] ) : $init;
497
- $astra_site_options = ( isset( $_POST['options'] ) ) ? json_decode( stripslashes( $_POST['options'] ) ) : $options;
498
- $enabled_extensions = ( isset( $_POST['enabledExtensions'] ) ) ? json_decode( stripslashes( $_POST['enabledExtensions'] ) ) : $enabled_extensions;
499
-
500
- $data = array(
501
- 'astra_site_options' => $astra_site_options,
502
- 'enabled_extensions' => $enabled_extensions,
503
- );
504
 
505
  $activate = activate_plugin( $plugin_init, '', false, true );
506
 
@@ -517,7 +1512,10 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
517
  }
518
  }
519
 
520
- do_action( 'astra_sites_after_plugin_activation', $plugin_init, $data );
 
 
 
521
 
522
  if ( defined( 'WP_CLI' ) ) {
523
  WP_CLI::line( 'Plugin Activated!' );
@@ -537,9 +1535,11 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
537
  * @since 2.0.0
538
  *
539
  * @param array $required_plugins Required Plugins.
 
 
540
  * @return mixed
541
  */
542
- public function required_plugin( $required_plugins = array() ) {
543
 
544
  // Verify Nonce.
545
  if ( ! defined( 'WP_CLI' ) ) {
@@ -576,7 +1576,13 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
576
  ),
577
  );
578
 
579
- if ( count( $required_plugins ) > 0 ) {
 
 
 
 
 
 
580
  foreach ( $required_plugins as $key => $plugin ) {
581
 
582
  /**
@@ -587,15 +1593,24 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
587
  $plugin_pro = $this->pro_plugin_exist( $plugin['init'] );
588
  if ( $plugin_pro ) {
589
 
 
 
 
 
590
  // Pro - Active.
591
  if ( is_plugin_active( $plugin_pro['init'] ) ) {
592
  $response['active'][] = $plugin_pro;
593
 
 
 
594
  // Pro - Inactive.
595
  } else {
596
  $response['inactive'][] = $plugin_pro;
597
  }
598
  } else {
 
 
 
599
 
600
  // Lite - Installed but Inactive.
601
  if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) && is_plugin_inactive( $plugin['init'] ) ) {
@@ -605,16 +1620,18 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
605
  // Lite - Not Installed.
606
  } elseif ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) ) {
607
 
608
- $response['notinstalled'][] = $plugin;
609
-
610
  // Added premium plugins which need to install first.
611
  if ( array_key_exists( $plugin['slug'], $third_party_plugins ) ) {
612
  $third_party_required_plugins[] = $third_party_plugins[ $plugin['slug'] ];
 
 
613
  }
614
 
615
  // Lite - Active.
616
  } else {
617
  $response['active'][] = $plugin;
 
 
618
  }
619
  }
620
  }
@@ -623,6 +1640,7 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
623
  $data = array(
624
  'required_plugins' => $response,
625
  'third_party_required_plugins' => $third_party_required_plugins,
 
626
  );
627
 
628
  if ( defined( 'WP_CLI' ) ) {
@@ -634,6 +1652,25 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
634
 
635
  }
636
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  /**
638
  * Has Pro Version Support?
639
  * And
@@ -687,8 +1724,125 @@ if ( ! class_exists( 'Astra_Sites' ) ) :
687
  return false;
688
  }
689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
 
 
691
 
 
 
692
  }
693
 
694
  /**
6
  * @package Astra Sites
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ use Elementor\Core\Schemes;
14
 
15
  if ( ! class_exists( 'Astra_Sites' ) ) :
16
 
25
  * @since 1.0.0
26
  * @var (String) URL
27
  */
28
+ public $api_url;
29
+
30
+ /**
31
+ * Search API URL which is used to get the response from.
32
+ *
33
+ * @since 2.0.0
34
+ * @var (String) URL
35
+ */
36
+ public $search_url;
37
+
38
+ /**
39
+ * API URL which is used to get the response from Pixabay.
40
+ *
41
+ * @since 2.0.0
42
+ * @var (String) URL
43
+ */
44
+ public $pixabay_url;
45
+
46
+ /**
47
+ * API Key which is used to get the response from Pixabay.
48
+ *
49
+ * @since 2.0.0
50
+ * @var (String) URL
51
+ */
52
+ public $pixabay_api_key;
53
 
54
  /**
55
  * Instance of Astra_Sites
57
  * @since 1.0.0
58
  * @var (Object) Astra_Sites
59
  */
60
+ private static $instance = null;
61
+
62
+ /**
63
+ * Localization variable
64
+ *
65
+ * @since 2.0.0
66
+ * @var (Array) $local_vars
67
+ */
68
+ public static $local_vars = array();
69
+
70
+ /**
71
+ * Localization variable
72
+ *
73
+ * @since 2.0.0
74
+ * @var (Array) $wp_upload_url
75
+ */
76
+ public $wp_upload_url = '';
77
 
78
  /**
79
  * Instance of Astra_Sites.
83
  * @return object Class object.
84
  */
85
  public static function get_instance() {
86
+ if ( ! isset( self::$instance ) ) {
87
+ self::$instance = new self();
88
  }
89
 
90
+ return self::$instance;
91
  }
92
 
93
  /**
97
  */
98
  private function __construct() {
99
 
100
+ $this->set_api_url();
101
 
102
  $this->includes();
103
 
 
104
  add_action( 'admin_notices', array( $this, 'admin_notices' ) );
105
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
106
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ), 99 );
107
+ add_action( 'wp_enqueue_scripts', array( $this, 'image_search_scripts' ) );
108
+ add_action( 'elementor/editor/footer', array( $this, 'insert_templates' ) );
109
+ add_action( 'admin_footer', array( $this, 'insert_image_templates' ) );
110
+ add_action( 'wp_footer', array( $this, 'insert_image_templates_bb_and_brizy' ) );
111
+ add_action( 'elementor/editor/footer', array( $this, 'register_widget_scripts' ), 99 );
112
+ add_action( 'elementor/editor/wp_head', array( $this, 'add_predefined_variables' ) );
113
+ add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'popup_styles' ) );
114
+ add_action( 'elementor/preview/enqueue_styles', array( $this, 'popup_styles' ) );
115
+
116
+ // AJAX.
117
+ add_action( 'wp_ajax_astra-required-plugins', array( $this, 'required_plugin' ) );
118
+ add_action( 'wp_ajax_astra-required-plugin-activate', array( $this, 'required_plugin_activate' ) );
119
+ add_action( 'wp_ajax_astra-sites-backup-settings', array( $this, 'backup_settings' ) );
120
+ add_action( 'wp_ajax_astra-sites-set-reset-data', array( $this, 'get_reset_data' ) );
121
+ add_action( 'wp_ajax_astra-sites-activate-theme', array( $this, 'activate_theme' ) );
122
+ add_action( 'wp_ajax_astra-sites-create-page', array( $this, 'create_page' ) );
123
+ add_action( 'wp_ajax_astra-sites-import-media', array( $this, 'import_media' ) );
124
+ add_action( 'wp_ajax_astra-sites-create-template', array( $this, 'create_template' ) );
125
+ add_action( 'wp_ajax_astra-sites-create-image', array( $this, 'create_image' ) );
126
+ add_action( 'wp_ajax_astra-sites-getting-started-notice', array( $this, 'getting_started_notice' ) );
127
+ add_action( 'wp_ajax_astra-sites-favorite', array( $this, 'add_to_favorite' ) );
128
+ add_action( 'wp_ajax_astra-sites-api-request', array( $this, 'api_request' ) );
129
+ add_action( 'wp_ajax_astra-page-elementor-batch-process', array( $this, 'elementor_batch_process' ) );
130
+
131
+ add_action( 'delete_attachment', array( $this, 'delete_astra_images' ) );
132
+ add_filter( 'heartbeat_received', array( $this, 'search_push' ), 10, 2 );
133
+ }
134
+
135
+ /**
136
+ * Push Data to Search API.
137
+ *
138
+ * @since 2.0.0
139
+ * @param Object $response Response data object.
140
+ * @param Object $data Data object.
141
+ *
142
+ * @return array Search response.
143
+ */
144
+ public function search_push( $response, $data ) {
145
+
146
+ // If we didn't receive our data, don't send any back.
147
+ if ( empty( $data['ast-sites-search-terms'] ) ) {
148
+ return $response;
149
+ }
150
+
151
+ $args = array(
152
+ 'timeout' => 3,
153
+ 'blocking' => true,
154
+ 'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
155
+ 'body' => array(
156
+ 'search' => $data['ast-sites-search-terms'],
157
+ 'url' => esc_url( site_url() ),
158
+ ),
159
+ );
160
+
161
+ $result = wp_remote_post( $this->search_url, $args );
162
+ $response['ast-sites-search-terms'] = wp_remote_retrieve_body( $result );
163
+
164
+ return $response;
165
+ }
166
+
167
+ /**
168
+ * Before Astra Image delete, remove from options.
169
+ *
170
+ * @since 2.0.0
171
+ * @param int $id ID to deleting image.
172
+ * @return void
173
+ */
174
+ public function delete_astra_images( $id ) {
175
+
176
+ if ( ! $id ) {
177
+ return;
178
+ }
179
+
180
+ // @codingStandardsIgnoreStart
181
+ $saved_images = get_option( 'astra-sites-saved-images', array() );
182
+ $astra_image_flag = get_post_meta( $id, 'astra-images', true );
183
+ $astra_image_flag = (int) $astra_image_flag;
184
+ if (
185
+ '' !== $astra_image_flag &&
186
+ is_array( $saved_images ) &&
187
+ ! empty( $saved_images ) &&
188
+ in_array( $astra_image_flag, $saved_images )
189
+ ) {
190
+ $saved_images = array_diff( $saved_images, [ $astra_image_flag ] );
191
+ update_option( 'astra-sites-saved-images', $saved_images );
192
+ }
193
+ // @codingStandardsIgnoreEnd
194
+ }
195
+
196
+ /**
197
+ * Enqueue Image Search scripts into Beaver Builder Editor.
198
+ *
199
+ * @since 2.0.0
200
+ * @return void
201
+ */
202
+ public function image_search_scripts() {
203
+
204
+ if ( class_exists( 'FLBuilderModel' ) ) {
205
+ if ( FLBuilderModel::is_builder_active() ) {
206
+ // Image Search assets.
207
+ $this->image_search_assets();
208
+ }
209
+ }
210
+
211
+ if ( class_exists( 'Brizy_Editor_Post' ) ) {
212
+ if ( isset( $_GET['brizy-edit'] ) || isset( $_GET['brizy-edit-iframe'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
213
+ // Image Search assets.
214
+ $this->image_search_assets();
215
+ }
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Elementor Batch Process via AJAX
221
+ *
222
+ * @since 2.0.0
223
+ */
224
+ public function elementor_batch_process() {
225
+
226
+ // Verify Nonce.
227
+ check_ajax_referer( 'astra-sites', '_ajax_nonce' );
228
+
229
+ if ( ! current_user_can( 'customize' ) ) {
230
+ wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
231
+ }
232
+
233
+ if ( ! isset( $_POST['url'] ) ) {
234
+ wp_send_json_error( __( 'Invalid API URL', 'astra-sites' ) );
235
+ }
236
+
237
+ $response = wp_remote_get( $_POST['url'] );
238
+
239
+ if ( is_wp_error( $response ) ) {
240
+ wp_send_json_error( wp_remote_retrieve_body( $response ) );
241
+ }
242
+
243
+ $body = wp_remote_retrieve_body( $response );
244
+ $data = json_decode( $body, true );
245
+ if ( ! isset( $data['post-meta']['_elementor_data'] ) ) {
246
+ wp_send_json_error( __( 'Invalid Post Meta', 'astra-sites' ) );
247
+ }
248
+
249
+ $meta = json_decode( $data['post-meta']['_elementor_data'], true );
250
+ $post_id = $_POST['id'];
251
+
252
+ if ( empty( $post_id ) || empty( $meta ) ) {
253
+ wp_send_json_error( __( 'Invalid Post ID or Elementor Meta', 'astra-sites' ) );
254
+ }
255
+
256
+ if ( isset( $data['astra-page-options-data'] ) && isset( $data['astra-page-options-data']['elementor_load_fa4_shim'] ) ) {
257
+ update_option( 'elementor_load_fa4_shim', $data['astra-page-options-data']['elementor_load_fa4_shim'] );
258
+ }
259
+
260
+ $import = new \Elementor\TemplateLibrary\Astra_Sites_Elementor_Pages();
261
+ $import_data = $import->import( $post_id, $meta );
262
+
263
+ wp_send_json_success( $import_data );
264
+ }
265
+
266
+ /**
267
+ * API Request
268
+ *
269
+ * @since 2.0.0
270
+ */
271
+ public function api_request() {
272
+ $url = isset( $_POST['url'] ) ? $_POST['url'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
273
+
274
+ if ( empty( $url ) ) {
275
+ wp_send_json_error( __( 'Provided API URL is empty! Please try again!', 'astra-sites' ) );
276
+ }
277
+
278
+ $api_args = array(
279
+ 'timeout' => 30,
280
+ );
281
+ $request = wp_remote_get( trailingslashit( self::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/' . $url, $api_args );
282
+ if ( ! is_wp_error( $request ) && 200 === (int) wp_remote_retrieve_response_code( $request ) ) {
283
+
284
+ $demo_data = json_decode( wp_remote_retrieve_body( $request ), true );
285
+ update_option( 'astra_sites_import_data', $demo_data );
286
+
287
+ wp_send_json_success( $demo_data );
288
+ } elseif ( is_wp_error( $request ) ) {
289
+ wp_send_json_error( 'API Request is failed due to ' . $request->get_error_message() );
290
+ } elseif ( 200 !== (int) wp_remote_retrieve_response_code( $request ) ) {
291
+ $demo_data = json_decode( wp_remote_retrieve_body( $request ), true );
292
+ if ( is_array( $demo_data ) && isset( $demo_data['code'] ) ) {
293
+ wp_send_json_error( $demo_data['message'] );
294
+ } else {
295
+ wp_send_json_error( wp_remote_retrieve_body( $request ) );
296
+ }
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Add Predefined Variables
302
+ *
303
+ * @since 2.0.0
304
+ */
305
+ public function add_predefined_variables() {
306
+
307
+ global $current_screen;
308
+ ?>
309
+ <script type="text/javascript">
310
+ addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
311
+ var ajaxurl = '<?php echo esc_url( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
312
+ pagenow = '<?php echo esc_html( $current_screen->id ); ?>',
313
+ typenow = '<?php echo esc_html( $current_screen->post_type ); ?>';
314
+ </script>
315
+ <?php
316
+ }
317
+
318
+ /**
319
+ * Insert Template
320
+ *
321
+ * @return void
322
+ */
323
+ public function insert_image_templates() {
324
+ ob_start();
325
+ require_once ASTRA_SITES_DIR . 'inc/includes/image-templates.php';
326
+ ob_end_flush();
327
+ }
328
+
329
+ /**
330
+ * Insert Template
331
+ *
332
+ * @return void
333
+ */
334
+ public function insert_image_templates_bb_and_brizy() {
335
+
336
+ if ( class_exists( 'FLBuilderModel' ) ) {
337
+ if ( FLBuilderModel::is_builder_active() ) {
338
+ ob_start();
339
+ require_once ASTRA_SITES_DIR . 'inc/includes/image-templates.php';
340
+ ob_end_flush();
341
+ }
342
+ }
343
+
344
+ if ( class_exists( 'Brizy_Editor_Post' ) ) {
345
+ if ( isset( $_GET['brizy-edit'] ) || isset( $_GET['brizy-edit-iframe'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
346
+ ob_start();
347
+ require_once ASTRA_SITES_DIR . 'inc/includes/image-templates.php';
348
+ ob_end_flush();
349
+ }
350
+ }
351
+ }
352
+
353
+ /**
354
+ * Insert Template
355
+ *
356
+ * @return void
357
+ */
358
+ public function insert_templates() {
359
+ ob_start();
360
+ require_once ASTRA_SITES_DIR . 'inc/includes/templates.php';
361
+ require_once ASTRA_SITES_DIR . 'inc/includes/image-templates.php';
362
+ ob_end_flush();
363
+ }
364
+
365
+ /**
366
+ * Add/Remove Favorite.
367
+ *
368
+ * @since 2.0.0
369
+ */
370
+ public function add_to_favorite() {
371
+
372
+ if ( ! current_user_can( 'manage_options' ) ) {
373
+ wp_send_json_error( 'You can\'t access this action.' );
374
+ }
375
+
376
+ $new_favorites = array();
377
+ $site_id = isset( $_POST['site_id'] ) ? sanitize_key( $_POST['site_id'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
378
+
379
+ if ( empty( $site_id ) ) {
380
+ wp_send_json_error();
381
+ }
382
+
383
+ $favorite_settings = get_option( 'astra-sites-favorites', array() );
384
+
385
+ if ( false !== $favorite_settings && is_array( $favorite_settings ) ) {
386
+ $new_favorites = $favorite_settings;
387
+ }
388
+
389
+ if ( 'false' === $_POST['is_favorite'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
390
+ if ( in_array( $site_id, $new_favorites, true ) ) {
391
+ $key = array_search( $site_id, $new_favorites, true );
392
+ unset( $new_favorites[ $key ] );
393
+ }
394
+ } else {
395
+ if ( ! in_array( $site_id, $new_favorites, true ) ) {
396
+ array_push( $new_favorites, $site_id );
397
+ }
398
+ }
399
+
400
+ update_option( 'astra-sites-favorites', $new_favorites );
401
+
402
+ wp_send_json_success(
403
+ array(
404
+ 'all_favorites' => $new_favorites,
405
+ )
406
+ );
407
+ }
408
+
409
+ /**
410
+ * Import Template.
411
+ *
412
+ * @since 2.0.0
413
+ */
414
+ public function create_template() {
415
+
416
+ // Verify Nonce.
417
+ check_ajax_referer( 'astra-sites', '_ajax_nonce' );
418
+
419
+ if ( ! current_user_can( 'customize' ) ) {
420
+ wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
421
+ }
422
+
423
+ $content = isset( $_POST['data']['content']['rendered'] ) ? $_POST['data']['content']['rendered'] : '';
424
+
425
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : array();
426
+
427
+ if ( empty( $data ) ) {
428
+ wp_send_json_error( 'Empty page data.' );
429
+ }
430
+
431
+ $page_id = isset( $_POST['data']['id'] ) ? $_POST['data']['id'] : '';
432
+
433
+ $title = '';
434
+ if ( isset( $_POST['data']['title']['rendered'] ) ) {
435
+ if ( '' !== $_POST['title'] ) {
436
+ $title = $_POST['title'] . ' - ' . $_POST['data']['title']['rendered'];
437
+ } else {
438
+ $title = $_POST['data']['title']['rendered'];
439
+ }
440
+ }
441
+
442
+ $excerpt = isset( $_POST['data']['excerpt']['rendered'] ) ? $_POST['data']['excerpt']['rendered'] : '';
443
+
444
+ $post_args = array(
445
+ 'post_type' => 'elementor_library',
446
+ 'post_status' => 'publish',
447
+ 'post_title' => $title,
448
+ 'post_content' => $content,
449
+ 'post_excerpt' => $excerpt,
450
+ );
451
+
452
+ $new_page_id = wp_insert_post( $post_args );
453
+ $post_meta = isset( $_POST['data']['post-meta'] ) ? $_POST['data']['post-meta'] : array();
454
+
455
+ if ( ! empty( $post_meta ) ) {
456
+ $this->import_template_meta( $new_page_id, $post_meta );
457
+ }
458
+
459
+ if ( 'pages' === $_POST['type'] ) {
460
+ update_post_meta( $new_page_id, '_elementor_template_type', 'page' );
461
+ wp_set_object_terms( $new_page_id, 'page', 'elementor_library_type' );
462
+ } else {
463
+ update_post_meta( $new_page_id, '_elementor_template_type', 'section' );
464
+ wp_set_object_terms( $new_page_id, 'section', 'elementor_library_type' );
465
+ }
466
+
467
+ update_post_meta( $new_page_id, '_wp_page_template', 'elementor_header_footer' );
468
+
469
+ do_action( 'astra_sites_process_single', $new_page_id );
470
+
471
+ wp_send_json_success(
472
+ array(
473
+ 'remove-page-id' => $page_id,
474
+ 'id' => $new_page_id,
475
+ 'link' => get_permalink( $new_page_id ),
476
+ )
477
+ );
478
+ }
479
+
480
+ /**
481
+ * Import Birzy Media.
482
+ *
483
+ * @since 2.0.0
484
+ */
485
+ public function import_media() {
486
+
487
+ // Verify Nonce.
488
+ check_ajax_referer( 'astra-sites', '_ajax_nonce' );
489
+
490
+ $image_data = isset( $_POST['media'] ) ? $_POST['media'] : array();
491
+
492
+ if ( empty( $image_data ) ) {
493
+ wp_send_json_error();
494
+ }
495
+
496
+ $image = array(
497
+ 'url' => $image_data['url'],
498
+ 'id' => $image_data['id'],
499
+ );
500
+ $downloaded_image = Astra_Sites_Image_Importer::get_instance()->import( $image );
501
+
502
+ // Set meta data.
503
+ if ( isset( $image_data['meta'] ) && ! empty( $image_data['meta'] ) ) {
504
+ foreach ( $image_data['meta'] as $meta_key => $meta_value ) {
505
+ update_post_meta( $downloaded_image['id'], $meta_key, $meta_value );
506
+ }
507
+ }
508
+
509
+ wp_send_json_success();
510
+ }
511
+
512
+ /**
513
+ * Import Page.
514
+ *
515
+ * @since 2.0.0
516
+ */
517
+ public function create_page() {
518
+
519
+ // Verify Nonce.
520
+ check_ajax_referer( 'astra-sites', '_ajax_nonce' );
521
+
522
+ if ( ! current_user_can( 'customize' ) ) {
523
+ wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
524
+ }
525
+
526
+ $default_page_builder = Astra_Sites_Page::get_instance()->get_setting( 'page_builder' );
527
+
528
+ $content = isset( $_POST['data']['original_content'] ) ? $_POST['data']['original_content'] : ( isset( $_POST['data']['content']['rendered'] ) ? $_POST['data']['content']['rendered'] : '' );
529
+
530
+ if ( 'elementor' === $default_page_builder ) {
531
+ if ( isset( $_POST['data']['astra-page-options-data'] ) && isset( $_POST['data']['astra-page-options-data']['elementor_load_fa4_shim'] ) ) {
532
+ update_option( 'elementor_load_fa4_shim', $_POST['data']['astra-page-options-data']['elementor_load_fa4_shim'] );
533
+ }
534
+ }
535
+
536
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : array();
537
+
538
+ if ( empty( $data ) ) {
539
+ wp_send_json_error( 'Empty page data.' );
540
+ }
541
+
542
+ $page_id = isset( $_POST['data']['id'] ) ? $_POST['data']['id'] : '';
543
+ $title = isset( $_POST['data']['title']['rendered'] ) ? $_POST['data']['title']['rendered'] : '';
544
+ $excerpt = isset( $_POST['data']['excerpt']['rendered'] ) ? $_POST['data']['excerpt']['rendered'] : '';
545
+
546
+ $post_args = array(
547
+ 'post_type' => 'page',
548
+ 'post_status' => 'draft',
549
+ 'post_title' => $title,
550
+ 'post_content' => $content,
551
+ 'post_excerpt' => $excerpt,
552
+ );
553
+
554
+ $new_page_id = wp_insert_post( $post_args );
555
+ $post_meta = isset( $_POST['data']['post-meta'] ) ? $_POST['data']['post-meta'] : array();
556
+
557
+ if ( ! empty( $post_meta ) ) {
558
+ $this->import_post_meta( $new_page_id, $post_meta );
559
+ }
560
+
561
+ if ( isset( $_POST['data']['astra-page-options-data'] ) && ! empty( $_POST['data']['astra-page-options-data'] ) ) {
562
+
563
+ foreach ( $_POST['data']['astra-page-options-data'] as $option => $value ) {
564
+ update_option( $option, $value );
565
+ }
566
+ }
567
+
568
+ if ( 'elementor' === $default_page_builder ) {
569
+ update_post_meta( $new_page_id, '_wp_page_template', 'elementor_header_footer' );
570
+ }
571
+
572
+ do_action( 'astra_sites_process_single', $new_page_id );
573
+
574
+ wp_send_json_success(
575
+ array(
576
+ 'remove-page-id' => $page_id,
577
+ 'id' => $new_page_id,
578
+ 'link' => get_permalink( $new_page_id ),
579
+ )
580
+ );
581
+ }
582
+
583
+ /**
584
+ * Import Image.
585
+ *
586
+ * @since 2.0.0
587
+ */
588
+ public function create_image() {
589
+
590
+ // Verify Nonce.
591
+ check_ajax_referer( 'astra-sites', '_ajax_nonce' );
592
+
593
+ if ( ! current_user_can( 'customize' ) ) {
594
+ wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
595
+ }
596
+
597
+ $url = $_POST['url'];
598
+ $name = $_POST['name'];
599
+ $photo_id = $_POST['id'];
600
+
601
+ $saved_images = get_option( 'astra-sites-saved-images', array() );
602
+
603
+ $this->wp_upload_url = $this->get_wp_upload_url();
604
+
605
+ $image = '';
606
+ $result = array();
607
+
608
+ if ( '' !== $url ) {
609
+
610
+ $name = preg_replace( '/\.[^.]+$/', '', $name ) . '-' . $photo_id . '.jpg';
611
+ $image = $this->create_image_from_url( $url, $name );
612
+
613
+ if ( $image ) {
614
+
615
+ $result['attachmentData'] = wp_prepare_attachment_for_js( $image );
616
+ if ( did_action( 'elementor/loaded' ) ) {
617
+ $result['data'] = Astra_Sites_Elementor_Images::get_instance()->get_attachment_data( $image );
618
+ }
619
+ }
620
+ }
621
+
622
+ if ( empty( $saved_images ) || false === $saved_images ) {
623
+ $saved_images = array();
624
+ }
625
+
626
+ $saved_images[] = $photo_id;
627
+ update_option( 'astra-sites-saved-images', $saved_images );
628
+
629
+ $result['updated-saved-images'] = get_option( 'astra-sites-saved-images', array() );
630
+
631
+ wp_send_json_success( $result );
632
+ }
633
+
634
+ /**
635
+ * Set the upload directory
636
+ */
637
+ public function get_wp_upload_url() {
638
+ $wp_upload_dir = wp_upload_dir();
639
+ return isset( $wp_upload_dir['url'] ) ? $wp_upload_dir['url'] : false;
640
+ }
641
+
642
+ /**
643
+ * Create the image and return the new media upload id.
644
+ *
645
+ * @param String $url URL to pixabay image.
646
+ * @param String $name Name to pixabay image.
647
+ * @see http://codex.wordpress.org/Function_Reference/wp_insert_attachment#Example
648
+ */
649
+ public function create_image_from_url( $url, $name ) {
650
+
651
+ if ( empty( $url ) || empty( $this->wp_upload_url ) ) {
652
+ return false;
653
+ }
654
+
655
+ $filename = basename( $url );
656
+
657
+ $upload_file = wp_upload_bits( $name, null, self::get_instance()->get_filesystem()->get_contents( $url ) );
658
+
659
+ if ( ! $upload_file['error'] ) {
660
+
661
+ $wp_filetype = wp_check_filetype( $name, null );
662
+ $attachment = array(
663
+ 'post_mime_type' => $wp_filetype['type'],
664
+ 'post_parent' => 0,
665
+ 'post_title' => preg_replace( '/\.[^.]+$/', '', $name ),
666
+ 'post_content' => ASTRA_SITES_NAME . ' Image - ' . $name,
667
+ 'post_status' => 'inherit',
668
+ );
669
+ $attachment_id = wp_insert_attachment( $attachment, $upload_file['file'], 0 );
670
+
671
+ if ( ! is_wp_error( $attachment_id ) ) {
672
+
673
+ require_once ABSPATH . 'wp-admin/includes/image.php';
674
+ require_once ABSPATH . 'wp-admin/includes/media.php';
675
+
676
+ $attachment_data = wp_generate_attachment_metadata( $attachment_id, $upload_file['file'] );
677
+ wp_update_attachment_metadata( $attachment_id, $attachment_data );
678
+
679
+ update_post_meta( $attachment_id, 'astra-images', $_POST['id'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
680
+ update_post_meta( $attachment_id, '_wp_attachment_image_alt', sanitize_text_field( ! empty( $_POST['name'] ) ? $_POST['name'] : '' ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
681
+
682
+ return $attachment_id;
683
+ }
684
+ }
685
+
686
+ return false;
687
+
688
+ }
689
+
690
+ /**
691
+ * Import Post Meta
692
+ *
693
+ * @since 2.0.0
694
+ *
695
+ * @param integer $post_id Post ID.
696
+ * @param array $metadata Post meta.
697
+ * @return void
698
+ */
699
+ public function import_post_meta( $post_id, $metadata ) {
700
+
701
+ $metadata = (array) $metadata;
702
+
703
+ foreach ( $metadata as $meta_key => $meta_value ) {
704
+
705
+ if ( $meta_value ) {
706
+
707
+ if ( '_elementor_data' === $meta_key ) {
708
+
709
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
710
+
711
+ if ( is_array( $raw_data ) ) {
712
+ $raw_data = wp_slash( wp_json_encode( $raw_data ) );
713
+ } else {
714
+ $raw_data = wp_slash( $raw_data );
715
+ }
716
+ } else {
717
+
718
+ if ( is_serialized( $meta_value, true ) ) {
719
+ $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
720
+ } elseif ( is_array( $meta_value ) ) {
721
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
722
+ } else {
723
+ $raw_data = $meta_value;
724
+ }
725
+ }
726
+
727
+ update_post_meta( $post_id, $meta_key, $raw_data );
728
+ }
729
+ }
730
+ }
731
+
732
+ /**
733
+ * Import Post Meta
734
+ *
735
+ * @since 2.0.0
736
+ *
737
+ * @param integer $post_id Post ID.
738
+ * @param array $metadata Post meta.
739
+ * @return void
740
+ */
741
+ public function import_template_meta( $post_id, $metadata ) {
742
+
743
+ $metadata = (array) $metadata;
744
+
745
+ foreach ( $metadata as $meta_key => $meta_value ) {
746
+
747
+ if ( $meta_value ) {
748
+
749
+ if ( '_elementor_data' === $meta_key ) {
750
+
751
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
752
+
753
+ if ( is_array( $raw_data ) ) {
754
+ $raw_data = wp_slash( wp_json_encode( $raw_data ) );
755
+ } else {
756
+ $raw_data = wp_slash( $raw_data );
757
+ }
758
+ } else {
759
+
760
+ if ( is_serialized( $meta_value, true ) ) {
761
+ $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
762
+ } elseif ( is_array( $meta_value ) ) {
763
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
764
+ } else {
765
+ $raw_data = $meta_value;
766
+ }
767
+ }
768
 
769
+ update_post_meta( $post_id, $meta_key, $raw_data );
770
+ }
771
+ }
 
 
 
 
772
  }
773
 
774
  /**
777
  * @since 1.3.5
778
  * @return void
779
  */
780
+ public function getting_started_notice() {
781
  // Verify Nonce.
782
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
783
 
785
  wp_send_json_error( __( 'You are not allowed to perform this action', 'astra-sites' ) );
786
  }
787
 
788
+ update_option( '_astra_sites_gettings_started', 'yes' );
789
  wp_send_json_success();
790
  }
791
 
795
  * @since 1.3.2
796
  * @return void
797
  */
798
+ public function activate_theme() {
799
 
800
  // Verify Nonce.
801
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
817
  /**
818
  * Set reset data
819
  */
820
+ public function get_reset_data() {
821
 
822
  if ( ! defined( 'WP_CLI' ) ) {
823
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
850
  /**
851
  * Backup our existing settings.
852
  */
853
+ public function backup_settings() {
854
 
855
  if ( ! defined( 'WP_CLI' ) ) {
856
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
857
 
858
  if ( ! current_user_can( 'manage_options' ) ) {
859
+ wp_send_json_error( __( 'User does not have permission!', 'astra-sites' ) );
860
  }
861
  }
862
 
865
  $upload_dir = Astra_Sites_Importer_Log::get_instance()->log_dir();
866
  $upload_path = trailingslashit( $upload_dir['path'] );
867
  $log_file = $upload_path . $file_name;
868
+ $file_system = self::get_instance()->get_filesystem();
869
 
870
  // If file system fails? Then take a backup in site option.
871
+ if ( false === $file_system->put_contents( $log_file, wp_json_encode( $old_settings ), FS_CHMOD_FILE ) ) {
872
  update_option( 'astra_sites_' . $file_name, $old_settings );
873
  }
874
 
882
  /**
883
  * Add Admin Notice.
884
  */
885
+ public function add_notice() {
886
 
887
  $theme_status = 'astra-sites-theme-' . $this->get_theme_status();
888
 
890
  array(
891
  'id' => 'astra-theme-activation-nag',
892
  'type' => 'error',
893
+ 'class' => 'astra-sites-notice',
894
  'show_if' => ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) ? true : false,
895
  /* translators: 1: theme.php file*/
896
+ 'message' => sprintf( __( '<p>%4$s Theme needs to be active for you to use currently installed "%1$s" plugin. <a href="#" class="%3$s" data-theme-slug="astra">Install & Activate Now</a></p>', 'astra-sites' ), ASTRA_SITES_NAME, esc_url( admin_url( 'themes.php?theme=astra' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ), $theme_status ),
897
  'dismissible' => true,
898
  'dismissible-time' => WEEK_IN_SECONDS,
899
  )
907
  *
908
  * @return string Theme status
909
  */
910
+ public function get_theme_status() {
911
 
912
  $theme = wp_get_theme();
913
 
931
  *
932
  * @since 1.0.1
933
  */
934
+ public function load_textdomain() {
935
  load_plugin_textdomain( 'astra-sites' );
936
  }
937
 
941
  * @since 1.0.5
942
  * @return void
943
  */
944
+ public function admin_notices() {
 
 
 
 
 
945
  add_action( 'plugin_action_links_' . ASTRA_SITES_BASE, array( $this, 'action_links' ) );
946
  }
947
 
951
  * @param mixed $links Plugin Action links.
952
  * @return array
953
  */
954
+ public function action_links( $links ) {
955
+
956
+ $arguments = array(
957
+ 'page' => 'starter-templates',
958
+ );
959
+
960
+ $current_page_builder = Astra_Sites_Page::get_instance()->get_setting( 'page_builder' );
961
+ if ( empty( $current_page_builder ) ) {
962
+ $arguments['change-page-builder'] = 'yes';
963
+ }
964
+ $url = add_query_arg( $arguments, admin_url( 'themes.php' ) );
965
+
966
  $action_links = array(
967
+ 'settings' => '<a href="' . esc_url( $url ) . '" aria-label="' . esc_attr__( 'See Library', 'astra-sites' ) . '">' . esc_html__( 'See Library', 'astra-sites' ) . '</a>',
968
  );
969
 
970
  return array_merge( $action_links, $links );
971
  }
972
 
973
+ /**
974
+ * Get the API URL.
975
+ *
976
+ * @since 1.0.0
977
+ */
978
+ public static function get_api_domain() {
979
+ return apply_filters( 'astra_sites_api_domain', 'https://websitedemos.net/' );
980
+ }
981
+
982
  /**
983
  * Setter for $api_url
984
  *
985
  * @since 1.0.0
986
  */
987
+ public function set_api_url() {
988
+ $this->api_url = apply_filters( 'astra_sites_api_url', trailingslashit( self::get_api_domain() ) . '/wp-json/wp/v2/' );
989
+
990
+ $this->search_url = apply_filters( 'astra_sites_search_api_url', trailingslashit( self::get_api_domain() ) . '/wp-json/analytics/v2/search/' );
991
+
992
+ $this->pixabay_url = 'https://pixabay.com/api/';
993
+ $this->pixabay_api_key = '2727911-c4d7c1031949c7e0411d7e81e';
994
+ }
995
+
996
+ /**
997
+ * Enqueue Image Search scripts.
998
+ *
999
+ * @since 2.0.0
1000
+ * @return void
1001
+ */
1002
+ public function image_search_assets() {
1003
+
1004
+ wp_enqueue_script( 'masonry' );
1005
+ wp_enqueue_script( 'imagesloaded' );
1006
+
1007
+ wp_enqueue_script(
1008
+ 'astra-sites-images-common',
1009
+ ASTRA_SITES_URI . 'inc/assets/js/dist/common.js',
1010
+ array( 'jquery', 'wp-util' ), // Dependencies, defined above.
1011
+ ASTRA_SITES_VER,
1012
+ true
1013
+ );
1014
+
1015
+ $data = apply_filters(
1016
+ 'astra_sites_images_common',
1017
+ array(
1018
+ 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
1019
+ 'asyncurl' => esc_url( admin_url( 'async-upload.php' ) ),
1020
+ 'pixabay_url' => $this->pixabay_url,
1021
+ 'pixabay_api_key' => $this->pixabay_api_key,
1022
+ 'is_bb_active' => ( class_exists( 'FLBuilderModel' ) ),
1023
+ 'is_brizy_active' => ( class_exists( 'Brizy_Editor_Post' ) ),
1024
+ 'is_elementor_active' => ( did_action( 'elementor/loaded' ) ),
1025
+ 'is_bb_editor' => ( class_exists( 'FLBuilderModel' ) ) ? ( FLBuilderModel::is_builder_active() ) : false,
1026
+ 'is_brizy_editor' => ( class_exists( 'Brizy_Editor_Post' ) ) ? ( isset( $_GET['brizy-edit'] ) || isset( $_GET['brizy-edit-iframe'] ) ) : false, // phpcs:ignore WordPress.Security.NonceVerification.Recommended
1027
+ 'saved_images' => get_option( 'astra-sites-saved-images', array() ),
1028
+ 'pixabay_category' => array(
1029
+ 'all' => __( 'All', 'astra-sites' ),
1030
+ 'animals' => __( 'Animals', 'astra-sites' ),
1031
+ 'buildings' => __( 'Architecture/Buildings', 'astra-sites' ),
1032
+ 'backgrounds' => __( 'Backgrounds/Textures', 'astra-sites' ),
1033
+ 'fashion' => __( 'Beauty/Fashion', 'astra-sites' ),
1034
+ 'business' => __( 'Business/Finance', 'astra-sites' ),
1035
+ 'computer' => __( 'Computer/Communication', 'astra-sites' ),
1036
+ 'education' => __( 'Education', 'astra-sites' ),
1037
+ 'feelings' => __( 'Emotions', 'astra-sites' ),
1038
+ 'food' => __( 'Food/Drink', 'astra-sites' ),
1039
+ 'health' => __( 'Health/Medical', 'astra-sites' ),
1040
+ 'industry' => __( 'Industry/Craft', 'astra-sites' ),
1041
+ 'music' => __( 'Music', 'astra-sites' ),
1042
+ 'nature' => __( 'Nature/Landscapes', 'astra-sites' ),
1043
+ 'people' => __( 'People', 'astra-sites' ),
1044
+ 'places' => __( 'Places/Monuments', 'astra-sites' ),
1045
+ 'religion' => __( 'Religion', 'astra-sites' ),
1046
+ 'science' => __( 'Science/Technology', 'astra-sites' ),
1047
+ 'sports' => __( 'Sports', 'astra-sites' ),
1048
+ 'transportation' => __( 'Transportation/Traffic', 'astra-sites' ),
1049
+ 'travel' => __( 'Travel/Vacation', 'astra-sites' ),
1050
+ ),
1051
+ 'pixabay_order' => array(
1052
+ 'popular' => __( 'Popular', 'astra-sites' ),
1053
+ 'latest' => __( 'Latest', 'astra-sites' ),
1054
+ 'upcoming' => __( 'Upcoming', 'astra-sites' ),
1055
+ 'ec' => __( 'Editor\'s Choice', 'astra-sites' ),
1056
+ ),
1057
+ 'pixabay_orientation' => array(
1058
+ 'any' => __( 'Any Orientation', 'astra-sites' ),
1059
+ 'vertical' => __( 'Vertical', 'astra-sites' ),
1060
+ 'horizontal' => __( 'Horizontal', 'astra-sites' ),
1061
+ ),
1062
+ 'title' => __( 'Free Images from Pixabay', 'astra-sites' ),
1063
+ 'search_placeholder' => __( 'Pixabay Search - Ex: flowers', 'astra-sites' ),
1064
+ 'downloading' => __( 'Downloading...', 'astra-sites' ),
1065
+ 'validating' => __( 'Validating...', 'astra-sites' ),
1066
+ 'empty_api_key' => __( 'Please enter an API key.', 'astra-sites' ),
1067
+ 'error_api_key' => __( 'An error occured with code ', 'astra-sites' ),
1068
+ '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
1069
+ )
1070
+ );
1071
+ wp_localize_script( 'astra-sites-images-common', 'astraImages', $data );
1072
+
1073
+ wp_enqueue_script(
1074
+ 'astra-sites-images-script',
1075
+ ASTRA_SITES_URI . 'inc/assets/js/dist/index.js',
1076
+ array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor', 'wp-api-fetch', 'astra-sites-images-common' ), // Dependencies, defined above.
1077
+ ASTRA_SITES_VER,
1078
+ true
1079
+ );
1080
+
1081
+ wp_enqueue_style( 'astra-sites-images', ASTRA_SITES_URI . 'inc/assets/css/images.css', ASTRA_SITES_VER, true );
1082
+ wp_style_add_data( 'astra-sites-images', 'rtl', 'replace' );
1083
  }
1084
 
1085
  /**
1088
  * @since 1.0.0
1089
  */
1090
  public function get_api_url() {
1091
+ return $this->api_url;
1092
  }
1093
 
1094
  /**
1104
  */
1105
  public function admin_enqueue( $hook = '' ) {
1106
 
1107
+ // Image Search assets.
1108
+ $this->image_search_assets();
1109
+
1110
  wp_enqueue_script( 'astra-sites-install-theme', ASTRA_SITES_URI . 'inc/assets/js/install-theme.js', array( 'jquery', 'updates' ), ASTRA_SITES_VER, true );
1111
  wp_enqueue_style( 'astra-sites-install-theme', ASTRA_SITES_URI . 'inc/assets/css/install-theme.css', null, ASTRA_SITES_VER, 'all' );
1112
+ wp_style_add_data( 'astra-sites-install-theme', 'rtl', 'replace' );
1113
 
1114
  $data = apply_filters(
1115
  'astra_sites_install_theme_localize_vars',
1116
  array(
1117
  'installed' => __( 'Installed! Activating..', 'astra-sites' ),
1118
+ 'activating' => __( 'Activating...', 'astra-sites' ),
1119
+ 'activated' => __( 'Activated!', 'astra-sites' ),
1120
+ 'installing' => __( 'Installing...', 'astra-sites' ),
1121
  'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
1122
  '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
1123
  )
1124
  );
1125
  wp_localize_script( 'astra-sites-install-theme', 'AstraSitesInstallThemeVars', $data );
1126
 
1127
+ if ( 'appearance_page_starter-templates' !== $hook ) {
1128
  return;
1129
  }
1130
 
1137
  // Fetch.
1138
  wp_register_script( 'astra-sites-fetch', ASTRA_SITES_URI . 'inc/assets/js/fetch.umd.js', array( 'jquery' ), ASTRA_SITES_VER, true );
1139
 
1140
+ // History.
1141
+ wp_register_script( 'astra-sites-history', ASTRA_SITES_URI . 'inc/assets/js/history.js', array( 'jquery' ), ASTRA_SITES_VER, true );
1142
+
1143
  // API.
1144
  wp_register_script( 'astra-sites-api', ASTRA_SITES_URI . 'inc/assets/js/astra-sites-api.js', array( 'jquery', 'astra-sites-fetch' ), ASTRA_SITES_VER, true );
1145
 
1146
  // Admin Page.
1147
  wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
1148
+ wp_style_add_data( 'astra-sites-admin', 'rtl', 'replace' );
1149
+ wp_enqueue_script( 'astra-sites-admin-page', ASTRA_SITES_URI . 'inc/assets/js/admin-page.js', array( 'jquery', 'wp-util', 'updates', 'jquery-ui-autocomplete', 'astra-sites-api', 'astra-sites-history', 'wp-url' ), ASTRA_SITES_VER, true );
1150
+
1151
+ $data = $this->get_local_vars();
1152
+
1153
+ wp_localize_script( 'astra-sites-admin-page', 'astraSitesVars', $data );
1154
+ }
1155
+
1156
+ /**
1157
+ * Returns Localization Variables.
1158
+ *
1159
+ * @since 2.0.0
1160
+ */
1161
+ public function get_local_vars() {
1162
+
1163
+ $stored_data = array(
1164
+ 'astra-site-category' => array(),
1165
+ 'astra-site-page-builder' => array(),
1166
+ 'astra-sites' => array(),
1167
+ 'site-pages-category' => array(),
1168
+ 'site-pages-page-builder' => array(),
1169
+ 'site-pages-parent-category' => array(),
1170
+ 'site-pages' => array(),
1171
+ 'favorites' => get_option( 'astra-sites-favorites' ),
1172
+ );
1173
+
1174
+ $favorite_data = get_option( 'astra-sites-favorites' );
1175
+
1176
+ // Use this for premium demos.
1177
+ $request_params = apply_filters(
1178
+ 'astra_sites_api_params',
1179
+ array(
1180
+ 'purchase_key' => '',
1181
+ 'site_url' => '',
1182
+ 'per-page' => 15,
1183
+ )
1184
+ );
1185
+
1186
+ $license_status = false;
1187
+ if ( is_callable( 'BSF_License_Manager::bsf_is_active_license' ) ) {
1188
+ $license_status = BSF_License_Manager::bsf_is_active_license( 'astra-pro-sites' );
1189
+ }
1190
+
1191
+ $default_page_builder = Astra_Sites_Page::get_instance()->get_setting( 'page_builder' );
1192
 
1193
  $data = apply_filters(
1194
  'astra_sites_localize_vars',
1195
  array(
1196
+ 'isPro' => defined( 'ASTRA_PRO_SITES_NAME' ) ? true : false,
1197
+ 'isWhiteLabeled' => Astra_Sites_White_Label::get_instance()->is_white_labeled(),
1198
+ 'whiteLabelName' => Astra_Sites_White_Label::get_instance()->get_white_label_name(),
1199
+ 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
1200
+ 'siteURL' => site_url(),
1201
+ 'getProText' => __( 'Get Agency Bundle', 'astra-sites' ),
1202
+ 'getProURL' => esc_url( 'https://wpastra.com/pricing/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
1203
+ 'getUpgradeText' => __( 'Upgrade', 'astra-sites' ),
1204
+ 'getUpgradeURL' => esc_url( 'https://wpastra.com/pricing/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
1205
+ '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
1206
+ 'requiredPlugins' => array(),
1207
+ 'strings' => array(
1208
+ /* translators: %s are white label strings. */
1209
+ 'warningBeforeCloseWindow' => sprintf( __( 'Warning! %1$s Import process is not complete. Don\'t close the window until import process complete. Do you still want to leave the window?', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ),
1210
+ 'viewSite' => __( 'Done! View Site', 'astra-sites' ),
1211
+ 'syncCompleteMessage' => self::get_instance()->get_sync_complete_message(),
1212
  ),
1213
+ 'log' => array(
1214
+ 'bulkInstall' => __( 'Installing Required Plugins..', 'astra-sites' ),
1215
+ /* translators: %s are white label strings. */
1216
+ 'themeInstall' => sprintf( __( 'Installing %1$s Theme..', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ),
1217
+ ),
1218
+ 'default_page_builder' => $default_page_builder,
1219
+ 'default_page_builder_sites' => Astra_Sites_Page::get_instance()->get_sites_by_page_builder( $default_page_builder ),
1220
+ 'sites' => $request_params,
1221
+ 'categories' => array(),
1222
+ 'page-builders' => array(),
1223
+ 'api_sites_and_pages_tags' => get_option( 'astra-sites-tags', array() ),
1224
+ 'license_status' => $license_status,
1225
+ 'license_page_builder' => get_option( 'astra-sites-license-page-builder', '' ),
1226
+
1227
+ 'ApiURL' => $this->api_url,
1228
+ 'stored_data' => $stored_data,
1229
+ 'favorite_data' => $favorite_data,
1230
+ 'category_slug' => 'astra-site-category',
1231
+ 'page_builder' => 'astra-site-page-builder',
1232
+ 'cpt_slug' => 'astra-sites',
1233
+ 'parent_category' => '',
1234
+ 'compatibilities' => $this->get_compatibilities(),
1235
+ 'compatibilities_data' => $this->get_compatibilities_data(),
1236
+
1237
  )
1238
  );
1239
+
1240
+ return $data;
1241
+ }
1242
+
1243
+ /**
1244
+ * Import Compatibility Errors
1245
+ *
1246
+ * @since 2.0.0
1247
+ * @return mixed
1248
+ */
1249
+ public function get_compatibilities_data() {
1250
+ return array(
1251
+ 'xmlreader' => array(
1252
+ 'title' => esc_html__( 'XMLReader Support Missing', 'astra-sites' ),
1253
+ 'tooltip' => '<p>' . esc_html__( 'You\'re close to importing the template. To complete the process, enable XMLReader support on your website.', 'astra-sites' ) . '</p><p>' . esc_html__( 'You can get in touch with your server administrator to enable XMLReader support.', 'astra-sites' ) . '</p>',
1254
+ ),
1255
+ 'curl' => array(
1256
+ 'title' => esc_html__( 'cURL Support Missing', 'astra-sites' ),
1257
+ 'tooltip' => '<p>' . esc_html__( 'To run a smooth import, kindly enable cURL support on your website.', 'astra-sites' ) . '</p><p>' . esc_html__( 'You can get in touch with your server administrator to enable cURL support.', 'astra-sites' ) . '</p>',
1258
+ ),
1259
+ 'wp-debug' => array(
1260
+ 'title' => esc_html__( 'Disable Debug Mode', 'astra-sites' ),
1261
+ 'tooltip' => '<p>' . esc_html__( 'WordPress debug mode is currently enabled on your website. With this, any errors from third-party plugins might affect the import process.', 'astra-sites' ) . '</p><p>' . esc_html__( 'Kindly disable it to continue importing the Starter Template. To do so, you can add the following code into the wp-config.php file.', 'astra-sites' ) . '</p><p><code>define(\'WP_DEBUG\', false);</code></p>',
1262
+ ),
1263
+ 'update-available' => array(
1264
+ 'title' => esc_html__( 'Update Plugin', 'astra-sites' ),
1265
+ 'tooltip' => '<p>' . esc_html__( 'Updates are available for plugins used in this starter template.', 'astra-sites' ) . '</p><p>' . esc_html__( 'Kindly update them for a successful import. Skipping this step might break the template design/feature.', 'astra-sites' ) . '</p>',
1266
+ ),
1267
+ 'third-party-required' => array(
1268
+ 'title' => esc_html__( 'Required Plugins Missing', 'astra-sites' ),
1269
+ 'tooltip' => '<p>' . esc_html__( 'This starter template requires premium plugins. As these are third party premium plugins, you\'ll need to purchase, install and activate them first.', 'astra-sites' ) . '</p>',
1270
+ ),
1271
+ 'dynamic-page' => array(
1272
+ 'title' => esc_html__( 'Dynamic Page', 'astra-sites' ),
1273
+ 'tooltip' => '<p>' . esc_html__( 'The page template you are about to import contains a dynamic widget/module. Please note this dynamic data will not be available with the imported page.', 'astra-sites' ) . '</p><p>' . esc_html__( 'You will need to add it manually on the page.', 'astra-sites' ) . '</p><p>' . esc_html__( 'This dynamic content will be available when you import the entire site.', 'astra-sites' ) . '</p>',
1274
+ ),
1275
+ );
1276
+ }
1277
+
1278
+ /**
1279
+ * Get all compatibilities
1280
+ *
1281
+ * @since 2.0.0
1282
+ *
1283
+ * @return array
1284
+ */
1285
+ public function get_compatibilities() {
1286
+
1287
+ $data = $this->get_compatibilities_data();
1288
+
1289
+ $compatibilities = array(
1290
+ 'errors' => array(),
1291
+ 'warnings' => array(),
1292
+ );
1293
+
1294
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1295
+ $compatibilities['warnings']['wp-debug'] = $data['wp-debug'];
1296
+ }
1297
+
1298
+ if ( ! class_exists( 'XMLReader' ) ) {
1299
+ $compatibilities['errors']['xmlreader'] = $data['xmlreader'];
1300
+ }
1301
+
1302
+ if ( ! function_exists( 'curl_version' ) ) {
1303
+ $compatibilities['errors']['curl'] = $data['curl'];
1304
+ }
1305
+
1306
+ return $compatibilities;
1307
+ }
1308
+
1309
+ /**
1310
+ * Register module required js on elementor's action.
1311
+ *
1312
+ * @since 2.0.0
1313
+ */
1314
+ public function register_widget_scripts() {
1315
+
1316
+ $page_builders = self::get_instance()->get_page_builders();
1317
+ $has_elementor = false;
1318
+
1319
+ foreach ( $page_builders as $page_builder ) {
1320
+
1321
+ if ( 'elementor' === $page_builder['slug'] ) {
1322
+ $has_elementor = true;
1323
+ }
1324
+ }
1325
+
1326
+ if ( ! $has_elementor ) {
1327
+ return;
1328
+ }
1329
+
1330
+ wp_enqueue_script( 'masonry' );
1331
+ wp_enqueue_script( 'imagesloaded' );
1332
+
1333
+ // Image Search assets.
1334
+ $this->image_search_assets();
1335
+
1336
+ wp_enqueue_script( 'astra-sites-elementor-admin-page', ASTRA_SITES_URI . 'inc/assets/js/elementor-admin-page.js', array( 'jquery', 'wp-util', 'updates', 'masonry', 'imagesloaded' ), ASTRA_SITES_VER, true );
1337
+
1338
+ wp_enqueue_style( 'astra-sites-admin', ASTRA_SITES_URI . 'inc/assets/css/admin.css', ASTRA_SITES_VER, true );
1339
+ wp_style_add_data( 'astra-sites-admin', 'rtl', 'replace' );
1340
 
1341
  // Use this for premium demos.
1342
  $request_params = apply_filters(
1344
  array(
1345
  'purchase_key' => '',
1346
  'site_url' => '',
1347
+ 'per-page' => 15,
1348
  )
1349
  );
1350
 
1351
+ $license_status = false;
1352
+ if ( is_callable( 'BSF_License_Manager::bsf_is_active_license' ) ) {
1353
+ $license_status = BSF_License_Manager::bsf_is_active_license( 'astra-pro-sites' );
1354
+ }
1355
+
1356
+ /* translators: %s are link. */
1357
+ $license_msg = sprintf( __( 'This is a premium website demo available only with the Agency Bundles you can purchase it from <a href="%s" target="_blank">here</a>.', 'astra-sites' ), 'https://wpastra.com/pricing/' );
 
 
 
1358
 
1359
+ if ( defined( 'ASTRA_PRO_SITES_NAME' ) ) {
1360
+ /* translators: %s are link. */
1361
+ $license_msg = sprintf( __( 'This is a premium template available with \'Agency\' packages. <a href="%s" target="_blank">Validate Your License</a> Key to import this template.', 'astra-sites' ), esc_url( admin_url( 'plugins.php?bsf-inline-license-form=astra-pro-sites' ) ) );
1362
+ }
1363
 
1364
  $data = apply_filters(
1365
+ 'astra_sites_render_localize_vars',
1366
  array(
1367
+ 'plugin_name' => Astra_Sites_White_Label::get_instance()->get_white_label_name(),
1368
+ 'sites' => $request_params,
1369
+ 'settings' => array(),
1370
+ 'page-builders' => array(),
1371
+ 'categories' => array(),
1372
+ 'default_page_builder' => 'elementor',
1373
+ 'astra_blocks' => $this->get_all_blocks(),
1374
+ 'license_status' => $license_status,
1375
+ 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
1376
+ 'api_sites_and_pages_tags' => get_option( 'astra-sites-tags', array() ),
1377
+ 'default_page_builder_sites' => Astra_Sites_Page::get_instance()->get_sites_by_page_builder( 'elementor' ),
1378
+ 'ApiURL' => $this->api_url,
1379
+ '_ajax_nonce' => wp_create_nonce( 'astra-sites' ),
1380
+ 'isPro' => defined( 'ASTRA_PRO_SITES_NAME' ) ? true : false,
1381
+ 'license_msg' => $license_msg,
1382
+ 'isWhiteLabeled' => Astra_Sites_White_Label::get_instance()->is_white_labeled(),
1383
+ 'getProText' => __( 'Get Agency Bundle', 'astra-sites' ),
1384
+ 'getProURL' => esc_url( 'https://wpastra.com/pricing/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=wp-dashboard' ),
1385
+ 'astra_block_categories' => get_option( 'astra-blocks-categories', array() ),
1386
+ 'siteURL' => site_url(),
1387
+ 'syncCompleteMessage' => self::get_instance()->get_sync_complete_message(),
1388
+ /* translators: %s are link. */
1389
+ 'page_settings' => array(
1390
+ 'message' => __( 'You can locate <strong>Starter Templates Settings</strong> under the <strong>Page Settings</strong> of the Style Tab.', 'astra-sites' ),
1391
+ 'url' => '#',
1392
+ 'url_text' => __( 'Read More ', 'astra-sites' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1393
  ),
1394
  )
1395
  );
1396
 
1397
+ wp_localize_script( 'astra-sites-elementor-admin-page', 'astraElementorSites', $data );
1398
+ }
1399
+
1400
+ /**
1401
+ * Register module required js on elementor's action.
1402
+ *
1403
+ * @since 2.0.0
1404
+ */
1405
+ public function popup_styles() {
1406
+
1407
+ wp_enqueue_style( 'astra-sites-elementor-admin-page', ASTRA_SITES_URI . 'inc/assets/css/elementor-admin.css', ASTRA_SITES_VER, true );
1408
+ wp_enqueue_style( 'astra-sites-elementor-admin-page-dark', ASTRA_SITES_URI . 'inc/assets/css/elementor-admin-dark.css', ASTRA_SITES_VER, true );
1409
+ wp_style_add_data( 'astra-sites-elementor-admin-page', 'rtl', 'replace' );
1410
+
1411
+ }
1412
+
1413
+ /**
1414
+ * Get all sites
1415
+ *
1416
+ * @since 2.0.0
1417
+ * @return array All sites.
1418
+ */
1419
+ public function get_all_sites() {
1420
+ $sites_and_pages = array();
1421
+ $total_requests = (int) get_option( 'astra-sites-requests', 0 );
1422
+
1423
+ for ( $page = 1; $page <= $total_requests; $page++ ) {
1424
+ $current_page_data = get_option( 'astra-sites-and-pages-page-' . $page, array() );
1425
+ if ( ! empty( $current_page_data ) ) {
1426
+ foreach ( $current_page_data as $page_id => $page_data ) {
1427
+ $sites_and_pages[ $page_id ] = $page_data;
1428
+ }
1429
+ }
1430
+ }
1431
+
1432
+ return $sites_and_pages;
1433
+ }
1434
+
1435
+ /**
1436
+ * Get all blocks
1437
+ *
1438
+ * @since 2.0.0
1439
+ * @return array All Elementor Blocks.
1440
+ */
1441
+ public function get_all_blocks() {
1442
+ $blocks = array();
1443
+ for ( $page = 1; $page <= 2; $page++ ) {
1444
+ $current_page_data = get_option( 'astra-blocks-' . $page, array() );
1445
+ if ( ! empty( $current_page_data ) ) {
1446
+ foreach ( $current_page_data as $page_id => $page_data ) {
1447
+ $blocks[ $page_id ] = $page_data;
1448
+ }
1449
+ }
1450
+ }
1451
 
1452
+ return $blocks;
1453
  }
1454
 
1455
  /**
1459
  */
1460
  private function includes() {
1461
 
1462
+ require_once ASTRA_SITES_DIR . 'inc/classes/functions.php';
1463
  require_once ASTRA_SITES_DIR . 'inc/lib/astra-notices/class-astra-notices.php';
1464
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-white-label.php';
1465
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-page.php';
1466
+ require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-elementor-pages.php';
1467
+ require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-elementor-images.php';
1468
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/class-astra-sites-compatibility.php';
1469
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-importer.php';
1470
  require_once ASTRA_SITES_DIR . 'inc/classes/class-astra-sites-wp-cli.php';
1489
  wp_send_json_error(
1490
  array(
1491
  'success' => false,
1492
+ 'message' => __( 'Error: You don\'t have the required permissions to install plugins.', 'astra-sites' ),
1493
  )
1494
  );
1495
  }
1496
  }
1497
 
1498
+ $plugin_init = ( isset( $_POST['init'] ) ) ? esc_attr( $_POST['init'] ) : $init;
 
 
 
 
 
 
 
1499
 
1500
  $activate = activate_plugin( $plugin_init, '', false, true );
1501
 
1512
  }
1513
  }
1514
 
1515
+ $options = ( isset( $_POST['options'] ) ) ? json_decode( stripslashes( $_POST['options'] ) ) : $options;
1516
+ $enabled_extensions = ( isset( $_POST['enabledExtensions'] ) ) ? json_decode( stripslashes( $_POST['enabledExtensions'] ) ) : $enabled_extensions;
1517
+
1518
+ $this->after_plugin_activate( $plugin_init, $options, $enabled_extensions );
1519
 
1520
  if ( defined( 'WP_CLI' ) ) {
1521
  WP_CLI::line( 'Plugin Activated!' );
1535
  * @since 2.0.0
1536
  *
1537
  * @param array $required_plugins Required Plugins.
1538
+ * @param array $options Site Options.
1539
+ * @param array $enabled_extensions Enabled Extensions.
1540
  * @return mixed
1541
  */
1542
+ public function required_plugin( $required_plugins = array(), $options = array(), $enabled_extensions = array() ) {
1543
 
1544
  // Verify Nonce.
1545
  if ( ! defined( 'WP_CLI' ) ) {
1576
  ),
1577
  );
1578
 
1579
+ $options = ( isset( $_POST['options'] ) ) ? json_decode( stripslashes( $_POST['options'] ) ) : $options;
1580
+ $enabled_extensions = ( isset( $_POST['enabledExtensions'] ) ) ? json_decode( stripslashes( $_POST['enabledExtensions'] ) ) : $enabled_extensions;
1581
+
1582
+ $plugin_updates = get_plugin_updates();
1583
+ $update_avilable_plugins = array();
1584
+
1585
+ if ( ! empty( $required_plugins ) ) {
1586
  foreach ( $required_plugins as $key => $plugin ) {
1587
 
1588
  /**
1593
  $plugin_pro = $this->pro_plugin_exist( $plugin['init'] );
1594
  if ( $plugin_pro ) {
1595
 
1596
+ if ( array_key_exists( $plugin_pro['init'], $plugin_updates ) ) {
1597
+ $update_avilable_plugins[] = $plugin_pro;
1598
+ }
1599
+
1600
  // Pro - Active.
1601
  if ( is_plugin_active( $plugin_pro['init'] ) ) {
1602
  $response['active'][] = $plugin_pro;
1603
 
1604
+ $this->after_plugin_activate( $plugin['init'], $options, $enabled_extensions );
1605
+
1606
  // Pro - Inactive.
1607
  } else {
1608
  $response['inactive'][] = $plugin_pro;
1609
  }
1610
  } else {
1611
+ if ( array_key_exists( $plugin['init'], $plugin_updates ) ) {
1612
+ $update_avilable_plugins[] = $plugin;
1613
+ }
1614
 
1615
  // Lite - Installed but Inactive.
1616
  if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) && is_plugin_inactive( $plugin['init'] ) ) {
1620
  // Lite - Not Installed.
1621
  } elseif ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin['init'] ) ) {
1622
 
 
 
1623
  // Added premium plugins which need to install first.
1624
  if ( array_key_exists( $plugin['slug'], $third_party_plugins ) ) {
1625
  $third_party_required_plugins[] = $third_party_plugins[ $plugin['slug'] ];
1626
+ } else {
1627
+ $response['notinstalled'][] = $plugin;
1628
  }
1629
 
1630
  // Lite - Active.
1631
  } else {
1632
  $response['active'][] = $plugin;
1633
+
1634
+ $this->after_plugin_activate( $plugin['init'], $options, $enabled_extensions );
1635
  }
1636
  }
1637
  }
1640
  $data = array(
1641
  'required_plugins' => $response,
1642
  'third_party_required_plugins' => $third_party_required_plugins,
1643
+ 'update_avilable_plugins' => $update_avilable_plugins,
1644
  );
1645
 
1646
  if ( defined( 'WP_CLI' ) ) {
1652
 
1653
  }
1654
 
1655
+ /**
1656
+ * After Plugin Activate
1657
+ *
1658
+ * @since 2.0.0
1659
+ *
1660
+ * @param string $plugin_init Plugin Init File.
1661
+ * @param array $options Site Options.
1662
+ * @param array $enabled_extensions Enabled Extensions.
1663
+ * @return void
1664
+ */
1665
+ public function after_plugin_activate( $plugin_init = '', $options = array(), $enabled_extensions = array() ) {
1666
+ $data = array(
1667
+ 'astra_site_options' => $options,
1668
+ 'enabled_extensions' => $enabled_extensions,
1669
+ );
1670
+
1671
+ do_action( 'astra_sites_after_plugin_activation', $plugin_init, $data );
1672
+ }
1673
+
1674
  /**
1675
  * Has Pro Version Support?
1676
  * And
1724
  return false;
1725
  }
1726
 
1727
+ /**
1728
+ * Get Default Page Builders
1729
+ *
1730
+ * @since 2.0.0
1731
+ * @return array
1732
+ */
1733
+ public function get_default_page_builders() {
1734
+ return array(
1735
+ array(
1736
+ 'id' => 33,
1737
+ 'slug' => 'elementor',
1738
+ 'name' => 'Elementor',
1739
+ ),
1740
+ array(
1741
+ 'id' => 34,
1742
+ 'slug' => 'beaver-builder',
1743
+ 'name' => 'Beaver Builder',
1744
+ ),
1745
+ array(
1746
+ 'id' => 42,
1747
+ 'slug' => 'gutenberg',
1748
+ 'name' => 'Gutenberg',
1749
+ ),
1750
+ array(
1751
+ 'id' => 41,
1752
+ 'slug' => 'brizy',
1753
+ 'name' => 'Brizy',
1754
+ ),
1755
+ );
1756
+ }
1757
+
1758
+ /**
1759
+ * Get Page Builders
1760
+ *
1761
+ * @since 2.0.0
1762
+ * @return array
1763
+ */
1764
+ public function get_page_builders() {
1765
+ return $this->get_default_page_builders();
1766
+ }
1767
+
1768
+ /**
1769
+ * Get Page Builder Filed
1770
+ *
1771
+ * @since 2.0.0
1772
+ * @param string $page_builder Page Bulider.
1773
+ * @param string $field Field name.
1774
+ * @return mixed
1775
+ */
1776
+ public function get_page_builder_field( $page_builder = '', $field = '' ) {
1777
+ if ( empty( $page_builder ) ) {
1778
+ return '';
1779
+ }
1780
+
1781
+ $page_builders = self::get_instance()->get_page_builders();
1782
+ if ( empty( $page_builders ) ) {
1783
+ return '';
1784
+ }
1785
+
1786
+ foreach ( $page_builders as $key => $current_page_builder ) {
1787
+ if ( $page_builder === $current_page_builder['slug'] ) {
1788
+ if ( isset( $current_page_builder[ $field ] ) ) {
1789
+ return $current_page_builder[ $field ];
1790
+ }
1791
+ }
1792
+ }
1793
+
1794
+ return '';
1795
+ }
1796
+
1797
+ /**
1798
+ * Get License Key
1799
+ *
1800
+ * @since 2.0.0
1801
+ * @return array
1802
+ */
1803
+ public function get_license_key() {
1804
+ if ( class_exists( 'BSF_License_Manager' ) ) {
1805
+ if ( BSF_License_Manager::bsf_is_active_license( 'astra-pro-sites' ) ) {
1806
+ return BSF_License_Manager::instance()->bsf_get_product_info( 'astra-pro-sites', 'purchase_key' );
1807
+ }
1808
+ }
1809
+
1810
+ return '';
1811
+ }
1812
+
1813
+ /**
1814
+ * Get Sync Complete Message
1815
+ *
1816
+ * @since 2.0.0
1817
+ * @param boolean $echo Echo the message.
1818
+ * @return mixed
1819
+ */
1820
+ public function get_sync_complete_message( $echo = false ) {
1821
+
1822
+ $message = __( 'Template library refreshed!', 'astra-sites' );
1823
+
1824
+ if ( $echo ) {
1825
+ echo esc_html( $message );
1826
+ } else {
1827
+ return esc_html( $message );
1828
+ }
1829
+ }
1830
+
1831
+ /**
1832
+ * Get an instance of WP_Filesystem_Direct.
1833
+ *
1834
+ * @since 2.0.0
1835
+ * @return object A WP_Filesystem_Direct instance.
1836
+ */
1837
+ public static function get_filesystem() {
1838
+ global $wp_filesystem;
1839
+
1840
+ require_once ABSPATH . '/wp-admin/includes/file.php';
1841
 
1842
+ WP_Filesystem();
1843
 
1844
+ return $wp_filesystem;
1845
+ }
1846
  }
1847
 
1848
  /**
inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php CHANGED
@@ -34,7 +34,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
34
  */
35
  public static function get_instance() {
36
  if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self;
38
  }
39
  return self::$instance;
40
  }
@@ -70,11 +70,13 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
70
  * @param array $data Data.
71
  * @return void
72
  */
73
- function astra_pro( $plugin_init = '', $data = array() ) {
74
 
75
- if ( 'astra-addon/astra-addon.php' === $plugin_init ) {
76
 
77
- $data = json_decode( json_encode( $data ), true );
 
 
78
 
79
  if ( isset( $data['enabled_extensions'] ) ) {
80
  $extensions = $data['enabled_extensions'];
@@ -285,7 +287,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Astra_Pro' ) ) :
285
  * @since 1.2.3
286
  * @return void
287
  */
288
- function clear_cache() {
289
  if ( is_callable( 'Astra_Minify::refresh_assets' ) ) {
290
  Astra_Minify::refresh_assets();
291
  }
34
  */
35
  public static function get_instance() {
36
  if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
  }
39
  return self::$instance;
40
  }
70
  * @param array $data Data.
71
  * @return void
72
  */
73
+ public function astra_pro( $plugin_init = '', $data = array() ) {
74
 
75
+ if ( 'astra-addon/astra-addon.php' === $plugin_init && ! empty( $data ) ) {
76
 
77
+ if ( is_array( $data ) ) {
78
+ $data = json_decode( wp_json_encode( $data ), true );
79
+ }
80
 
81
  if ( isset( $data['enabled_extensions'] ) ) {
82
  $extensions = $data['enabled_extensions'];
287
  * @since 1.2.3
288
  * @return void
289
  */
290
+ public function clear_cache() {
291
  if ( is_callable( 'Astra_Minify::refresh_assets' ) ) {
292
  Astra_Minify::refresh_assets();
293
  }
inc/classes/compatibility/class-astra-sites-compatibility.php CHANGED
@@ -32,7 +32,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility' ) ) :
32
  */
33
  public static function instance() {
34
  if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self;
36
  }
37
  return self::$instance;
38
  }
@@ -47,9 +47,6 @@ if ( ! class_exists( 'Astra_Sites_Compatibility' ) ) :
47
  // Plugin - Astra Pro.
48
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php';
49
 
50
- // Plugin - Site Origin Widgets.
51
- require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/so-widgets-bundle/class-astra-sites-compatibility-so-widgets.php';
52
-
53
  // Plugin - WooCommerce.
54
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/woocommerce/class-astra-sites-compatibility-woocommerce.php';
55
 
32
  */
33
  public static function instance() {
34
  if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
  }
37
  return self::$instance;
38
  }
47
  // Plugin - Astra Pro.
48
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/astra-pro/class-astra-sites-compatibility-astra-pro.php';
49
 
 
 
 
50
  // Plugin - WooCommerce.
51
  require_once ASTRA_SITES_DIR . 'inc/classes/compatibility/woocommerce/class-astra-sites-compatibility-woocommerce.php';
52
 
inc/classes/compatibility/elementor/class-astra-sites-compatibility-elementor.php CHANGED
@@ -2,18 +2,20 @@
2
  /**
3
  * Astra Sites Compatibility for 'Elementor'
4
  *
5
- * @see https://wordpress.org/plugins/elementor/
6
- *
7
  * @package Astra Sites
8
- * @since 1.4.3
9
  */
10
 
 
 
 
 
11
  if ( ! class_exists( 'Astra_Sites_Compatibility_Elementor' ) ) :
12
 
13
  /**
14
- * Astra_Sites_Compatibility_Elementor
15
  *
16
- * @since 1.4.3
17
  */
18
  class Astra_Sites_Compatibility_Elementor {
19
 
@@ -22,19 +24,19 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Elementor' ) ) :
22
  *
23
  * @access private
24
  * @var object Class object.
25
- * @since 1.4.3
26
  */
27
  private static $instance;
28
 
29
  /**
30
  * Initiator
31
  *
32
- * @since 1.4.3
33
  * @return object initialized object of class.
34
  */
35
  public static function get_instance() {
36
  if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self;
38
  }
39
  return self::$instance;
40
  }
@@ -42,7 +44,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_Elementor' ) ) :
42
  /**
43
  * Constructor
44
  *
45
- * @since 1.4.3
46
  */
47
  public function __construct() {
48
 
2
  /**
3
  * Astra Sites Compatibility for 'Elementor'
4
  *
 
 
5
  * @package Astra Sites
6
+ * @since 2.0.0
7
  */
8
 
9
+ namespace AstraSites\Elementor;
10
+
11
+ defined( 'ABSPATH' ) || exit;
12
+
13
  if ( ! class_exists( 'Astra_Sites_Compatibility_Elementor' ) ) :
14
 
15
  /**
16
+ * Elementor Compatibility
17
  *
18
+ * @since 2.0.0
19
  */
20
  class Astra_Sites_Compatibility_Elementor {
21
 
24
  *
25
  * @access private
26
  * @var object Class object.
27
+ * @since 2.0.0
28
  */
29
  private static $instance;
30
 
31
  /**
32
  * Initiator
33
  *
34
+ * @since 2.0.0
35
  * @return object initialized object of class.
36
  */
37
  public static function get_instance() {
38
  if ( ! isset( self::$instance ) ) {
39
+ self::$instance = new self();
40
  }
41
  return self::$instance;
42
  }
44
  /**
45
  * Constructor
46
  *
47
+ * @since 2.0.0
48
  */
49
  public function __construct() {
50
 
inc/classes/compatibility/sfwd-lms/class-astra-sites-compatibility-sfwd-lms.php CHANGED
@@ -34,7 +34,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_SFWD_LMS' ) ) :
34
  */
35
  public static function get_instance() {
36
  if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self;
38
  }
39
  return self::$instance;
40
  }
@@ -55,7 +55,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_SFWD_LMS' ) ) :
55
  *
56
  * @param array $post_types Post types.
57
  */
58
- function set_post_types( $post_types = array() ) {
59
  return array_merge( $post_types, array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'sfwd-certificates', 'sfwd-assignment' ) );
60
  }
61
  }
34
  */
35
  public static function get_instance() {
36
  if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
  }
39
  return self::$instance;
40
  }
55
  *
56
  * @param array $post_types Post types.
57
  */
58
+ public function set_post_types( $post_types = array() ) {
59
  return array_merge( $post_types, array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-topic', 'sfwd-quiz', 'sfwd-certificates', 'sfwd-assignment' ) );
60
  }
61
  }
inc/classes/compatibility/so-widgets-bundle/class-astra-sites-compatibility-so-widgets.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- * Astra Sites Compatibility for 'SiteOrigin Widgets Bundle'
4
- *
5
- * @see https://wordpress.org/plugins/so-widgets-bundle/
6
- *
7
- * @package Astra Sites
8
- * @since 1.0.0
9
- */
10
-
11
- if ( ! class_exists( 'Astra_Sites_Compatibility_SO_Widgets' ) ) :
12
-
13
- /**
14
- * Astra_Sites_Compatibility_SO_Widgets
15
- *
16
- * @since 1.0.0
17
- */
18
- class Astra_Sites_Compatibility_SO_Widgets {
19
-
20
- /**
21
- * Instance
22
- *
23
- * @access private
24
- * @var object Class object.
25
- * @since 1.0.0
26
- */
27
- private static $instance;
28
-
29
- /**
30
- * Initiator
31
- *
32
- * @since 1.0.0
33
- * @return object initialized object of class.
34
- */
35
- public static function instance() {
36
- if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self;
38
- }
39
- return self::$instance;
40
- }
41
-
42
- /**
43
- * Constructor
44
- *
45
- * @since 1.0.0
46
- */
47
- public function __construct() {
48
- add_action( 'astra_sites_after_plugin_activation', array( $this, 'site_origin' ), 10, 2 );
49
- }
50
-
51
- /**
52
- * Update Site Origin Active Widgets
53
- *
54
- * @since 1.0.0
55
- *
56
- * @param string $plugin_init Plugin init file.
57
- * @param array $data Data.
58
- * @return void
59
- */
60
- function site_origin( $plugin_init = '', $data = array() ) {
61
-
62
- if ( 'so-widgets-bundle/so-widgets-bundle.php' === $plugin_init ) {
63
-
64
- $data = json_decode( json_encode( $data ), true );
65
-
66
- if ( isset( $data['astra_site_options'] ) ) {
67
-
68
- $widgets = ( isset( $data['astra_site_options']['siteorigin_widgets_active'] ) ) ? $data['astra_site_options']['siteorigin_widgets_active'] : '';
69
-
70
- if ( ! empty( $widgets ) ) {
71
- update_option( 'siteorigin_widgets_active', $widgets );
72
- wp_cache_delete( 'active_widgets', 'siteorigin_widgets' );
73
- }
74
- }
75
- }
76
-
77
- }
78
-
79
- }
80
-
81
- /**
82
- * Kicking this off by calling 'instance()' method
83
- */
84
- Astra_Sites_Compatibility_SO_Widgets::instance();
85
-
86
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/classes/compatibility/woocommerce/class-astra-sites-compatibility-woocommerce.php CHANGED
@@ -34,7 +34,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_WooCommerce' ) ) :
34
  */
35
  public static function instance() {
36
  if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self;
38
  }
39
  return self::$instance;
40
  }
@@ -57,7 +57,7 @@ if ( ! class_exists( 'Astra_Sites_Compatibility_WooCommerce' ) ) :
57
  * @param array $demo_api_uri Demo site URL.
58
  * @return void
59
  */
60
- function add_attributes( $demo_data = array(), $demo_api_uri = '' ) {
61
  $attributes = ( isset( $demo_data['astra-site-options-data']['woocommerce_product_attributes'] ) ) ? $demo_data['astra-site-options-data']['woocommerce_product_attributes'] : array();
62
 
63
  if ( ! empty( $attributes ) && function_exists( 'wc_create_attribute' ) ) {
34
  */
35
  public static function instance() {
36
  if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
  }
39
  return self::$instance;
40
  }
57
  * @param array $demo_api_uri Demo site URL.
58
  * @return void
59
  */
60
+ public function add_attributes( $demo_data = array(), $demo_api_uri = '' ) {
61
  $attributes = ( isset( $demo_data['astra-site-options-data']['woocommerce_product_attributes'] ) ) ? $demo_data['astra-site-options-data']['woocommerce_product_attributes'] : array();
62
 
63
  if ( ! empty( $attributes ) && function_exists( 'wc_create_attribute' ) ) {
inc/classes/functions.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions
4
+ *
5
+ * @since 2.0.0
6
+ * @package Astra Sites
7
+ */
8
+
9
+ if ( ! function_exists( 'astra_sites_error_log' ) ) :
10
+
11
+ /**
12
+ * Error Log
13
+ *
14
+ * A wrapper function for the error_log() function.
15
+ *
16
+ * @since 2.0.0
17
+ *
18
+ * @param mixed $message Error message.
19
+ * @return void
20
+ */
21
+ function astra_sites_error_log( $message = '' ) {
22
+ if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
23
+ if ( is_array( $message ) ) {
24
+ $message = wp_json_encode( $message );
25
+ }
26
+
27
+ error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
28
+ }
29
+ }
30
+
31
+ endif;
inc/config/paths.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Paths
3
+ *
4
+ * Project related paths.
5
+ */
6
+
7
+ const path = require( "path" )
8
+ const fs = require( "fs" )
9
+
10
+ // Make sure any symlinks in the project folder are resolved:
11
+ const pluginDir = fs.realpathSync( process.cwd() )
12
+ const resolvePlugin = relativePath => path.resolve( pluginDir, relativePath )
13
+
14
+ // Config after eject: we're in ./config/
15
+ module.exports = {
16
+ dotenv: resolvePlugin( ".env" ),
17
+ pluginSrc: resolvePlugin( "inc/assets/js/src" ), // Plugin src folder path.
18
+ pluginBlocksJs: resolvePlugin( "inc/assets/js/src/index.js" ),
19
+ yarnLockFile: resolvePlugin( "yarn.lock" ),
20
+ pluginDist: resolvePlugin( "." ), // We are in ./dist folder already so the path '.' resolves to ./dist/.
21
+ }
inc/config/webpack.config.dev.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Webpack Configuration
3
+ *
4
+ * Working of a Webpack can be very simple or complex. This is an intenally simple
5
+ * build configuration.
6
+ *
7
+ * Webpack basics — If you are new the Webpack here's all you need to know:
8
+ * 1. Webpack is a module bundler. It bundles different JS modules together.
9
+ * 2. It needs and entry point and an ouput to process file(s) and bundle them.
10
+ * 3. By default it only understands common JavaScript but you can make it
11
+ * understand other formats by way of adding a Webpack loader.
12
+ * 4. In the file below you will find an entry point, an ouput, and a babel-loader
13
+ * that tests all .js files excluding the ones in node_modules to process the
14
+ * ESNext and make it compatible with older browsers i.e. it converts the
15
+ * ESNext (new standards of JavaScript) into old JavaScript through a loader
16
+ * by Babel.
17
+ *
18
+ * TODO: Instructions.
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+
23
+ const paths = require( "./paths" )
24
+ const autoprefixer = require( "autoprefixer" )
25
+ const ExtractTextPlugin = require( "extract-text-webpack-plugin" )
26
+
27
+ const fs = require( "fs" )
28
+ const sass = require('node-sass');
29
+
30
+ // Configuration for the ExtractTextPlugin — DRY rule.
31
+ const extractConfig = {
32
+ use: [
33
+ // "postcss" loader applies autoprefixer to our CSS.
34
+ { loader: "raw-loader" },
35
+ {
36
+ loader: "postcss-loader",
37
+ options: {
38
+ ident: "postcss",
39
+ plugins: [
40
+ autoprefixer( {
41
+ browsers: [
42
+ ">1%",
43
+ "last 4 versions",
44
+ "Firefox ESR",
45
+ "not ie < 9", // React doesn't support IE8 anyway
46
+ ],
47
+ flexbox: "no-2009",
48
+ } ),
49
+ ],
50
+ },
51
+ }
52
+ ],
53
+ }
54
+
55
+ // Export configuration.
56
+ module.exports = {
57
+ entry: {
58
+ "./inc/assets/js/dist/index": paths.pluginBlocksJs, // 'name' : 'path/file.ext'.
59
+ },
60
+ output: {
61
+ // Add * filename * comments to generated require()s in the output.
62
+ pathinfo: true,
63
+ // The dist folder.
64
+ path: paths.pluginDist,
65
+ filename: "[name].js", // [name] = './assets/js/dist/blocks.build' as defined above.
66
+ },
67
+ // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
68
+ devtool: "cheap-eval-source-map",
69
+ module: {
70
+ rules: [
71
+ {
72
+ test: /\.(js|jsx|mjs)$/,
73
+ exclude: /(node_modules|bower_components)/,
74
+ use: {
75
+ loader: "babel-loader",
76
+ options: {
77
+
78
+ // This is a feature of `babel-loader` for webpack (not Babel itself).
79
+ // It enables caching results in ./node_modules/.cache/babel-loader/
80
+ // directory for faster rebuilds.
81
+ cacheDirectory: true,
82
+ },
83
+ },
84
+ }
85
+ ],
86
+ },
87
+ stats: "minimal"
88
+ }
inc/config/webpack.config.prod.js ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Webpack Configuration
3
+ *
4
+ * Working of a Webpack can be very simple or complex. This is an intenally simple
5
+ * build configuration.
6
+ *
7
+ * Webpack basics — If you are new the Webpack here's all you need to know:
8
+ * 1. Webpack is a module bundler. It bundles different JS modules together.
9
+ * 2. It needs and entry point and an ouput to process file(s) and bundle them.
10
+ * 3. By default it only understands common JavaScript but you can make it
11
+ * understand other formats by way of adding a Webpack loader.
12
+ * 4. In the file below you will find an entry point, an ouput, and a babel-loader
13
+ * that tests all .js files excluding the ones in node_modules to process the
14
+ * ESNext and make it compatible with older browsers i.e. it converts the
15
+ * ESNext (new standards of JavaScript) into old JavaScript through a loader
16
+ * by Babel.
17
+ *
18
+ * TODO: Instructions.
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+
23
+ const paths = require( "./paths" )
24
+ const webpack = require( "webpack" )
25
+ const autoprefixer = require( "autoprefixer" )
26
+ const ExtractTextPlugin = require( "extract-text-webpack-plugin" )
27
+
28
+ // Source maps are resource heavy and can cause out of memory issue for large source files.
29
+ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP === "true"
30
+
31
+ const fs = require( "fs" )
32
+ const sass = require('node-sass');
33
+
34
+ // Configuration for the ExtractTextPlugin — DRY rule.
35
+ const extractConfig = {
36
+ use: [
37
+ // "postcss" loader applies autoprefixer to our CSS.
38
+ { loader: "raw-loader" },
39
+ {
40
+ loader: "postcss-loader",
41
+ options: {
42
+ ident: "postcss",
43
+ plugins: [
44
+ autoprefixer( {
45
+ browsers: [
46
+ ">1%",
47
+ "last 4 versions",
48
+ "Firefox ESR",
49
+ "not ie < 9", // React doesn't support IE8 anyway
50
+ ],
51
+ flexbox: "no-2009",
52
+ } ),
53
+ ],
54
+ },
55
+ }
56
+ ],
57
+ }
58
+
59
+ // Export configuration.
60
+ module.exports = {
61
+ entry: {
62
+ "./inc/assets/js/dist/index": paths.pluginBlocksJs, // 'name' : 'path/file.ext'.
63
+ },
64
+ output: {
65
+ // Add /* filename */ comments to generated require()s in the output.
66
+ pathinfo: true,
67
+ // The dist folder.
68
+ path: paths.pluginDist,
69
+ filename: "[name].js", // [name] = './assets/js/dist/blocks.build' as defined above.
70
+ },
71
+ // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
72
+ devtool: shouldUseSourceMap ? "source-map" : false,
73
+ module: {
74
+ rules: [
75
+ {
76
+ test: /\.(js|jsx|mjs)$/,
77
+ exclude: /(node_modules|bower_components)/,
78
+ use: {
79
+ loader: "babel-loader",
80
+ options: {
81
+
82
+ // This is a feature of `babel-loader` for webpack (not Babel itself).
83
+ // It enables caching results in ./node_modules/.cache/babel-loader/
84
+ // directory for faster rebuilds.
85
+ cacheDirectory: true,
86
+ },
87
+ },
88
+ }
89
+ ],
90
+ },
91
+ stats: "minimal"
92
+ }
inc/importers/batch-processing/class-astra-sites-batch-processing-beaver-builder.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
- self::$instance = new self;
37
  }
38
  return self::$instance;
39
  }
@@ -55,6 +55,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
55
  public function import() {
56
 
57
  Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for Beaver Builder ----' );
 
58
  if ( ! is_callable( 'FLBuilderModel::get_post_types' ) ) {
59
  return;
60
  }
@@ -85,7 +86,8 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
85
  */
86
  public function import_single_post( $post_id = 0 ) {
87
 
88
- Astra_Sites_Importer_Log::add( 'Post ID: ' . $post_id );
 
89
  if ( ! empty( $post_id ) ) {
90
 
91
  // Get page builder data.
@@ -145,6 +147,21 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
145
  $settings->data = FLBuilderPhoto::get_attachment_data( $settings->photo );
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  // 3) Set `list item` module images.
149
  if ( isset( $settings->add_list_item ) ) {
150
  foreach ( $settings->add_list_item as $key => $value ) {
@@ -154,23 +171,32 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Beaver_Builder' ) ) :
154
 
155
  // 4) Set `list item` module images.
156
  if ( isset( $settings->text ) ) {
157
- $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
158
- if ( $ids_mapping ) {
159
-
160
- // Keep old data in temp.
161
- $updated_data = $settings->text;
162
 
163
- // Update WP form IDs.
164
- foreach ( $ids_mapping as $old_id => $new_id ) {
165
- $updated_data = str_replace( '[wpforms id="' . $old_id, '[wpforms id="' . $new_id, $updated_data );
166
- }
167
 
168
- // Update modified data.
169
- $settings->text = $updated_data;
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
171
  }
172
 
173
- return $settings;
174
  }
175
 
176
  /**
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
  return self::$instance;
39
  }
55
  public function import() {
56
 
57
  Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for Beaver Builder ----' );
58
+
59
  if ( ! is_callable( 'FLBuilderModel::get_post_types' ) ) {
60
  return;
61
  }
86
  */
87
  public function import_single_post( $post_id = 0 ) {
88
 
89
+ Astra_Sites_Importer_Log::add( '---- Processing WordPress Page - for Beaver Builder ---- "' . $post_id . '"' );
90
+
91
  if ( ! empty( $post_id ) ) {
92
 
93
  // Get page builder data.
147
  $settings->data = FLBuilderPhoto::get_attachment_data( $settings->photo );
148
  }
149
 
150
+ if ( 'uabb-wp-forms-styler' === $settings->type ) {
151
+ astra_sites_error_log( '--------WP Form Styler ID replacement start-------' );
152
+ $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
153
+ if ( $ids_mapping ) {
154
+ // Update WP form IDs.
155
+ foreach ( $ids_mapping as $old_id => $new_id ) {
156
+ if ( isset( $settings->wp_form_id ) && $old_id === $settings->wp_form_id ) {
157
+ astra_sites_error_log( '--------WP Form Styler ID ' . $old_id . ' replaced to ' . $new_id . '-------' );
158
+ $settings->wp_form_id = $new_id;
159
+ }
160
+ }
161
+ }
162
+ astra_sites_error_log( '--------WP Form Styler ID replacement done-------' );
163
+ }
164
+
165
  // 3) Set `list item` module images.
166
  if ( isset( $settings->add_list_item ) ) {
167
  foreach ( $settings->add_list_item as $key => $value ) {
171
 
172
  // 4) Set `list item` module images.
173
  if ( isset( $settings->text ) ) {
174
+ $settings->text = self::get_wpforms_mapping( $settings->text );
175
+ } elseif ( isset( $settings->html ) ) {
176
+ $settings->html = self::get_wpforms_mapping( $settings->html );
177
+ }
 
178
 
179
+ return $settings;
180
+ }
 
 
181
 
182
+ /**
183
+ * Replace WP Forms shortcode.
184
+ *
185
+ * @since 2.0.0
186
+ * @param string $content Content.
187
+ * @return string Content.
188
+ */
189
+ private static function get_wpforms_mapping( $content = '' ) {
190
+ $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
191
+ astra_sites_error_log( wp_json_encode( $ids_mapping ) );
192
+ if ( $ids_mapping ) {
193
+ // Update WP form IDs.
194
+ foreach ( $ids_mapping as $old_id => $new_id ) {
195
+ $content = str_replace( '[wpforms id="' . $old_id, '[wpforms id="' . $new_id, $content );
196
  }
197
  }
198
 
199
+ return $content;
200
  }
201
 
202
  /**
inc/importers/batch-processing/class-astra-sites-batch-processing-brizy.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Brizy' ) ) :
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
- self::$instance = new self;
37
  }
38
  return self::$instance;
39
  }
@@ -54,6 +54,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Brizy' ) ) :
54
  public function import() {
55
 
56
  Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for "Brizy" ----' );
 
57
  if ( ! is_callable( 'Brizy_Editor_Storage_Common::instance' ) ) {
58
  return;
59
  }
@@ -84,33 +85,39 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Brizy' ) ) :
84
  */
85
  public function import_single_post( $post_id = 0 ) {
86
 
87
- $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
88
 
89
- // Empty mapping? Then return.
90
- if ( empty( $ids_mapping ) ) {
91
- return;
92
- }
93
 
94
  $json_value = null;
95
 
96
  $post = Brizy_Editor_Post::get( (int) $post_id );
97
  $data = $post->storage()->get( Brizy_Editor_Post::BRIZY_POST, false );
98
 
 
99
  // Decode current data.
100
  $json_value = base64_decode( $data['editor_data'] );
 
101
 
102
- // Update WPForm IDs.
103
- foreach ( $ids_mapping as $old_id => $new_id ) {
104
- $json_value = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $json_value );
 
 
 
 
 
 
 
105
  }
106
 
 
107
  // Encode modified data.
108
  $data['editor_data'] = base64_encode( $json_value );
 
109
 
110
  $post->set_editor_data( $json_value );
111
-
112
  $post->storage()->set( Brizy_Editor_Post::BRIZY_POST, $data );
113
-
114
  $post->compile_page();
115
  $post->save();
116
  }
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
  return self::$instance;
39
  }
54
  public function import() {
55
 
56
  Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for "Brizy" ----' );
57
+
58
  if ( ! is_callable( 'Brizy_Editor_Storage_Common::instance' ) ) {
59
  return;
60
  }
85
  */
86
  public function import_single_post( $post_id = 0 ) {
87
 
88
+ astra_sites_error_log( '---- Processing WordPress Page - for "Brizy" ---- "' . $post_id . '"' );
89
 
90
+ $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
 
 
 
91
 
92
  $json_value = null;
93
 
94
  $post = Brizy_Editor_Post::get( (int) $post_id );
95
  $data = $post->storage()->get( Brizy_Editor_Post::BRIZY_POST, false );
96
 
97
+ // @codingStandardsIgnoreStart
98
  // Decode current data.
99
  $json_value = base64_decode( $data['editor_data'] );
100
+ // @codingStandardsIgnoreEnd
101
 
102
+ // Empty mapping? Then return.
103
+ if ( ! empty( $ids_mapping ) ) {
104
+
105
+ // Update WPForm IDs.
106
+ astra_sites_error_log( '---- Processing WP Forms Mapping ----' );
107
+ astra_sites_error_log( $ids_mapping );
108
+
109
+ foreach ( $ids_mapping as $old_id => $new_id ) {
110
+ $json_value = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $json_value );
111
+ }
112
  }
113
 
114
+ // @codingStandardsIgnoreStart
115
  // Encode modified data.
116
  $data['editor_data'] = base64_encode( $json_value );
117
+ // @codingStandardsIgnoreEnd
118
 
119
  $post->set_editor_data( $json_value );
 
120
  $post->storage()->set( Brizy_Editor_Post::BRIZY_POST, $data );
 
121
  $post->compile_page();
122
  $post->save();
123
  }
inc/importers/batch-processing/class-astra-sites-batch-processing-elementor.php CHANGED
@@ -44,7 +44,9 @@ class Astra_Sites_Batch_Processing_Elementor extends Source_Local {
44
  */
45
  public function import() {
46
 
 
47
  $post_types = \Astra_Sites_Batch_Processing::get_post_types_supporting( 'elementor' );
 
48
  if ( empty( $post_types ) && ! is_array( $post_types ) ) {
49
  return;
50
  }
@@ -70,44 +72,54 @@ class Astra_Sites_Batch_Processing_Elementor extends Source_Local {
70
  */
71
  public function import_single_post( $post_id = 0 ) {
72
 
73
- if ( ! empty( $post_id ) ) {
74
-
75
- $hotlink_imported = get_post_meta( $post_id, '_astra_sites_hotlink_imported', true );
76
 
77
- if ( empty( $hotlink_imported ) ) {
78
 
79
- $data = get_post_meta( $post_id, '_elementor_data', true );
80
 
81
- if ( ! empty( $data ) ) {
82
 
83
- // Update WP form IDs.
84
- $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
85
- if ( $ids_mapping ) {
86
- foreach ( $ids_mapping as $old_id => $new_id ) {
87
- $data = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $data );
88
- }
89
  }
 
90
 
91
- if ( ! is_array( $data ) ) {
92
- $data = json_decode( $data, true );
93
- }
 
 
 
 
94
 
95
- $document = Plugin::$instance->documents->get( $post_id );
96
- if ( $document ) {
97
- $data = $document->get_elements_raw_data( $data, true );
 
 
 
 
 
 
 
 
 
 
 
98
  }
 
99
 
100
- // Import the data.
101
- $data = $this->process_export_import_content( $data, 'on_import' );
102
-
103
- // Update processed meta.
104
- update_metadata( 'post', $post_id, '_elementor_data', $data );
105
- update_metadata( 'post', $post_id, '_astra_sites_hotlink_imported', true );
106
-
107
- // !important, Clear the cache after images import.
108
- Plugin::$instance->files_manager->clear_cache();
109
 
110
- }
 
111
  }
112
  }
113
  }
44
  */
45
  public function import() {
46
 
47
+ \Astra_Sites_Importer_Log::add( '---- Processing WordPress Posts / Pages - for Elementor ----' );
48
  $post_types = \Astra_Sites_Batch_Processing::get_post_types_supporting( 'elementor' );
49
+
50
  if ( empty( $post_types ) && ! is_array( $post_types ) ) {
51
  return;
52
  }
72
  */
73
  public function import_single_post( $post_id = 0 ) {
74
 
75
+ \Astra_Sites_Importer_Log::add( '---- Processing WordPress Page - for Elementor ---- "' . $post_id . '"' );
 
 
76
 
77
+ if ( ! empty( $post_id ) ) {
78
 
79
+ $data = get_post_meta( $post_id, '_elementor_data', true );
80
 
81
+ if ( ! empty( $data ) ) {
82
 
83
+ // Update WP form IDs.
84
+ $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
85
+ if ( $ids_mapping ) {
86
+ foreach ( $ids_mapping as $old_id => $new_id ) {
87
+ $data = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $data );
88
+ $data = str_replace( '"select_form":"' . $old_id, '"select_form":"' . $new_id, $data );
89
  }
90
+ }
91
 
92
+ if ( ! is_array( $data ) ) {
93
+ $data = json_decode( $data, true );
94
+ }
95
+ $document = Plugin::$instance->documents->get( $post_id );
96
+ if ( $document ) {
97
+ $data = $document->get_elements_raw_data( $data, true );
98
+ }
99
 
100
+ // Import the data.
101
+ $data = $this->process_export_import_content( $data, 'on_import' );
102
+
103
+ // Replace the site urls.
104
+ $demo_data = get_option( 'astra_sites_import_data', array() );
105
+ if ( isset( $demo_data['astra-site-url'] ) ) {
106
+ $data = wp_json_encode( $data, true );
107
+ if ( ! empty( $data ) ) {
108
+ $site_url = get_site_url();
109
+ $site_url = str_replace( '/', '\/', $site_url );
110
+ $demo_site_url = 'https:' . $demo_data['astra-site-url'];
111
+ $demo_site_url = str_replace( '/', '\/', $demo_site_url );
112
+ $data = str_replace( $demo_site_url, $site_url, $data );
113
+ $data = json_decode( $data, true );
114
  }
115
+ }
116
 
117
+ // Update processed meta.
118
+ update_metadata( 'post', $post_id, '_elementor_data', $data );
119
+ update_metadata( 'post', $post_id, '_astra_sites_hotlink_imported', true );
 
 
 
 
 
 
120
 
121
+ // !important, Clear the cache after images import.
122
+ Plugin::$instance->files_manager->clear_cache();
123
  }
124
  }
125
  }
inc/importers/batch-processing/class-astra-sites-batch-processing-gutenberg.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
- self::$instance = new self;
37
  }
38
  return self::$instance;
39
  }
@@ -54,7 +54,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
54
  * 'pre_user_description'.
55
  * @return array Array of allowed HTML tags and their allowed attributes.
56
  */
57
- function allowed_tags_and_attributes( $allowedposttags, $context ) {
58
 
59
  // Keep only for 'post' contenxt.
60
  if ( 'post' === $context ) {
@@ -107,11 +107,23 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
107
  */
108
  public function import_single_post( $post_id = 0 ) {
109
 
 
 
 
 
 
 
 
 
 
 
 
110
  $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
111
 
112
  // Post content.
113
  $content = get_post_field( 'post_content', $post_id );
114
 
 
115
  if ( ! empty( $ids_mapping ) ) {
116
  // Replace ID's.
117
  foreach ( $ids_mapping as $old_id => $new_id ) {
@@ -130,7 +142,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
130
 
131
  $catogory_mapping = ( isset( $tax_mapping['post']['category'] ) ) ? $tax_mapping['post']['category'] : array();
132
 
133
- if ( is_array( $catogory_mapping ) ) {
134
 
135
  foreach ( $catogory_mapping as $key => $value ) {
136
 
@@ -146,7 +158,8 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
146
  // expects as 'u0026amp;'. So, Converted '&amp;' with 'u0026amp;'.
147
  //
148
  // @todo This affect for normal page content too. Detect only Gutenberg pages and process only on it.
149
- $content = str_replace( '&amp;', "\u0026amp;", $content );
 
150
 
151
  // Update content.
152
  wp_update_post(
@@ -157,6 +170,55 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Gutenberg' ) ) :
157
  );
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
 
162
  /**
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
  return self::$instance;
39
  }
54
  * 'pre_user_description'.
55
  * @return array Array of allowed HTML tags and their allowed attributes.
56
  */
57
+ public function allowed_tags_and_attributes( $allowedposttags, $context ) {
58
 
59
  // Keep only for 'post' contenxt.
60
  if ( 'post' === $context ) {
107
  */
108
  public function import_single_post( $post_id = 0 ) {
109
 
110
+ $is_elementor_page = get_post_meta( $post_id, '_elementor_version', true );
111
+ $is_beaver_builder_page = get_post_meta( $post_id, '_fl_builder_enabled', true );
112
+ $is_brizy_page = get_post_meta( $post_id, 'brizy_post_uid', true );
113
+
114
+ // If page contain Elementor, Brizy or Beaver Builder meta then skip this page.
115
+ if ( $is_elementor_page || $is_beaver_builder_page || $is_brizy_page ) {
116
+ return;
117
+ }
118
+
119
+ Astra_Sites_Importer_Log::add( '---- Processing WordPress Page - for Gutenberg ---- "' . $post_id . '"' );
120
+
121
  $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() );
122
 
123
  // Post content.
124
  $content = get_post_field( 'post_content', $post_id );
125
 
126
+ // Empty mapping? Then return.
127
  if ( ! empty( $ids_mapping ) ) {
128
  // Replace ID's.
129
  foreach ( $ids_mapping as $old_id => $new_id ) {
142
 
143
  $catogory_mapping = ( isset( $tax_mapping['post']['category'] ) ) ? $tax_mapping['post']['category'] : array();
144
 
145
+ if ( is_array( $catogory_mapping ) && ! empty( $catogory_mapping ) ) {
146
 
147
  foreach ( $catogory_mapping as $key => $value ) {
148
 
158
  // expects as 'u0026amp;'. So, Converted '&amp;' with 'u0026amp;'.
159
  //
160
  // @todo This affect for normal page content too. Detect only Gutenberg pages and process only on it.
161
+ // $content = str_replace( '&amp;', "\u0026amp;", $content );
162
+ $content = $this->get_content( $content );
163
 
164
  // Update content.
165
  wp_update_post(
170
  );
171
  }
172
 
173
+ /**
174
+ * Download and Replace hotlink images
175
+ *
176
+ * @since 2.0.0
177
+ *
178
+ * @param string $content Mixed post content.
179
+ * @return array Hotlink image array.
180
+ */
181
+ public function get_content( $content = '' ) {
182
+
183
+ $all_links = wp_extract_urls( $content );
184
+ $image_links = array();
185
+ $image_map = array();
186
+
187
+ // Not have any link.
188
+ if ( empty( $all_links ) ) {
189
+ return $content;
190
+ }
191
+
192
+ foreach ( $all_links as $key => $link ) {
193
+
194
+ if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) {
195
+ $image_links[] = $link;
196
+ }
197
+ }
198
+ // Not have any image link.
199
+ if ( empty( $image_links ) ) {
200
+ return $content;
201
+ }
202
+
203
+ foreach ( $image_links as $key => $image_url ) {
204
+ // Download remote image.
205
+ $image = array(
206
+ 'url' => $image_url,
207
+ 'id' => wp_rand( 000, 999 ),
208
+ );
209
+ $downloaded_image = Astra_Sites_Image_Importer::get_instance()->import( $image );
210
+ // Old and New image mapping links.
211
+ $image_map[ $image_url ] = $downloaded_image['url'];
212
+ }
213
+
214
+ // Replace old image links with new image links.
215
+ foreach ( $image_map as $old_url => $new_url ) {
216
+ $content = str_replace( $old_url, $new_url, $content );
217
+ }
218
+
219
+ return $content;
220
+ }
221
+
222
  }
223
 
224
  /**
inc/importers/batch-processing/class-astra-sites-batch-processing-importer.php ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Batch Processing
4
+ *
5
+ * @package Astra Sites
6
+ * @since 2.0.0
7
+ */
8
+
9
+ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Importer' ) ) :
10
+
11
+ /**
12
+ * Astra_Sites_Batch_Processing_Importer
13
+ *
14
+ * @since 1.0.14
15
+ */
16
+ class Astra_Sites_Batch_Processing_Importer {
17
+
18
+ /**
19
+ * Instance
20
+ *
21
+ * @since 1.0.14
22
+ * @access private
23
+ * @var object Class object.
24
+ */
25
+ private static $instance;
26
+
27
+ /**
28
+ * Initiator
29
+ *
30
+ * @since 1.0.14
31
+ * @return object initialized object of class.
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
+ }
37
+ return self::$instance;
38
+ }
39
+
40
+ /**
41
+ * Constructor
42
+ *
43
+ * @since 1.0.14
44
+ */
45
+ public function __construct() {
46
+ }
47
+
48
+ /**
49
+ * Import Categories
50
+ *
51
+ * @since 2.0.0
52
+ * @return void
53
+ */
54
+ public function import_categories() {
55
+ astra_sites_error_log( 'Requesting Tags' );
56
+ update_option( 'astra-sites-batch-status-string', 'Requesting Tags' );
57
+
58
+ $api_args = array(
59
+ 'timeout' => 30,
60
+ );
61
+ $tags_request = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/astra-sites-tag/?_fields=id,name,slug', $api_args );
62
+ if ( ! is_wp_error( $tags_request ) && 200 === (int) wp_remote_retrieve_response_code( $tags_request ) ) {
63
+ $tags = json_decode( wp_remote_retrieve_body( $tags_request ), true );
64
+
65
+ if ( isset( $tags['code'] ) ) {
66
+ $message = isset( $tags['message'] ) ? $tags['message'] : '';
67
+ if ( ! empty( $message ) ) {
68
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
69
+ } else {
70
+ astra_sites_error_log( 'HTTP Request Error!' );
71
+ }
72
+ } else {
73
+ update_option( 'astra-sites-tags', $tags );
74
+
75
+ if ( defined( 'WP_CLI' ) ) {
76
+ $this->generate_file( 'astra-sites-tags', $tags );
77
+ }
78
+ }
79
+ }
80
+
81
+ astra_sites_error_log( 'Tags Imported Successfully!' );
82
+ update_option( 'astra-sites-batch-status-string', 'Tags Imported Successfully!' );
83
+ }
84
+
85
+ /**
86
+ * Generate JSON file.
87
+ *
88
+ * @since 2.0.0
89
+ *
90
+ * @param string $filename File name.
91
+ * @param array $data JSON file data.
92
+ * @return void.
93
+ */
94
+ public function generate_file( $filename = '', $data = array() ) {
95
+ if ( defined( 'WP_CLI' ) ) {
96
+ Astra_Sites::get_instance()->get_filesystem()->put_contents( ASTRA_SITES_DIR . 'inc/json/' . $filename . '.json', wp_json_encode( $data ) );
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Import Categories
102
+ *
103
+ * @since 2.0.0
104
+ * @return void
105
+ */
106
+ public function import_site_categories() {
107
+ astra_sites_error_log( 'Requesting Site Categories' );
108
+ update_option( 'astra-sites-batch-status-string', 'Requesting Site Categories' );
109
+
110
+ $api_args = array(
111
+ 'timeout' => 30,
112
+ );
113
+ $categories_request = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/astra-site-category/?_fields=id,name,slug&per_page=100', $api_args );
114
+ if ( ! is_wp_error( $categories_request ) && 200 === (int) wp_remote_retrieve_response_code( $categories_request ) ) {
115
+ $categories = json_decode( wp_remote_retrieve_body( $categories_request ), true );
116
+
117
+ if ( isset( $categories['code'] ) ) {
118
+ $message = isset( $categories['message'] ) ? $categories['message'] : '';
119
+ if ( ! empty( $message ) ) {
120
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
121
+ } else {
122
+ astra_sites_error_log( 'HTTP Request Error!' );
123
+ }
124
+ } else {
125
+ update_option( 'astra-sites-categories', $categories );
126
+
127
+ if ( defined( 'WP_CLI' ) ) {
128
+ $this->generate_file( 'astra-sites-categories', $categories );
129
+ }
130
+ }
131
+ }
132
+
133
+ astra_sites_error_log( 'Site Categories Imported Successfully!' );
134
+ update_option( 'astra-sites-batch-status-string', 'Site Categories Imported Successfully!' );
135
+ }
136
+
137
+ /**
138
+ * Import Block Categories
139
+ *
140
+ * @since 2.0.0
141
+ * @return void
142
+ */
143
+ public function import_block_categories() {
144
+ astra_sites_error_log( 'Requesting Block Categories' );
145
+ update_option( 'astra-sites-batch-status-string', 'Requesting Block Categories' );
146
+
147
+ $api_args = array(
148
+ 'timeout' => 30,
149
+ );
150
+ $tags_request = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/blocks-category/?_fields=id,name,slug&per_page=100', $api_args );
151
+ if ( ! is_wp_error( $tags_request ) && 200 === (int) wp_remote_retrieve_response_code( $tags_request ) ) {
152
+ $tags = json_decode( wp_remote_retrieve_body( $tags_request ), true );
153
+
154
+ if ( isset( $tags['code'] ) ) {
155
+ $message = isset( $tags['message'] ) ? $tags['message'] : '';
156
+ if ( ! empty( $message ) ) {
157
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
158
+ } else {
159
+ astra_sites_error_log( 'HTTP Request Error!' );
160
+ }
161
+ } else {
162
+ $categories = array();
163
+ foreach ( $tags as $key => $value ) {
164
+ $categories[ $value['id'] ] = $value;
165
+ }
166
+
167
+ update_option( 'astra-blocks-categories', $categories );
168
+
169
+ if ( defined( 'WP_CLI' ) ) {
170
+ $this->generate_file( 'astra-blocks-categories', $categories );
171
+ }
172
+ }
173
+ }
174
+
175
+ astra_sites_error_log( 'Block Categories Imported Successfully!' );
176
+ update_option( 'astra-sites-batch-status-string', 'Categories Imported Successfully!' );
177
+ }
178
+
179
+
180
+ /**
181
+ * Import Page Builders
182
+ *
183
+ * @since 2.0.0
184
+ * @return void
185
+ */
186
+ public function set_license_page_builder() {
187
+
188
+ astra_sites_error_log( 'Requesting License Page Builders' );
189
+
190
+ $url = add_query_arg(
191
+ array(
192
+ '_fields' => 'id,name,slug',
193
+ 'site_url' => get_site_url(),
194
+ 'purchase_key' => Astra_Sites::get_instance()->get_license_key(),
195
+ 'only_allow_page_builders' => 'true',
196
+ ),
197
+ trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/astra-site-page-builder/'
198
+ );
199
+
200
+ $api_args = array(
201
+ 'timeout' => 30,
202
+ );
203
+
204
+ $page_builder_request = wp_remote_get( $url, $api_args );
205
+ if ( ! is_wp_error( $page_builder_request ) && 200 === (int) wp_remote_retrieve_response_code( $page_builder_request ) ) {
206
+ $page_builders = json_decode( wp_remote_retrieve_body( $page_builder_request ), true );
207
+ if ( isset( $page_builders['code'] ) ) {
208
+ $message = isset( $page_builders['message'] ) ? $page_builders['message'] : '';
209
+ if ( ! empty( $message ) ) {
210
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
211
+ } else {
212
+ astra_sites_error_log( 'HTTP Request Error!' );
213
+ }
214
+ } else {
215
+ // @codingStandardsIgnoreStart
216
+ // Set mini agency page builder.
217
+ $page_builder_slugs = wp_list_pluck( $page_builders, 'slug' );
218
+ if ( in_array( 'elementor', $page_builder_slugs ) && ! in_array( 'beaver-builder', $page_builder_slugs ) ) {
219
+ update_option( 'astra-sites-license-page-builder', 'elementor' );
220
+ astra_sites_error_log( 'Set "Elementor" as License Page Builder' );
221
+ } elseif ( in_array( 'beaver-builder', $page_builder_slugs ) && ! in_array( 'elementor', $page_builder_slugs ) ) {
222
+ update_option( 'astra-sites-license-page-builder', 'beaver-builder' );
223
+ astra_sites_error_log( 'Set "Beaver Builder" as License Page Builder' );
224
+ } else {
225
+ update_option( 'astra-sites-license-page-builder', '' );
226
+ astra_sites_error_log( 'Not Set Any License Page Builder' );
227
+ }
228
+ // @codingStandardsIgnoreEnd
229
+ }
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Import Page Builders
235
+ *
236
+ * @since 2.0.0
237
+ * @return void
238
+ */
239
+ public function import_page_builders() {
240
+ astra_sites_error_log( 'Requesting Page Builders' );
241
+ update_option( 'astra-sites-batch-status-string', 'Requesting Page Builders' );
242
+
243
+ $purchase_key = Astra_Sites::get_instance()->get_license_key();
244
+ $site_url = get_site_url();
245
+
246
+ $api_args = array(
247
+ 'timeout' => 30,
248
+ );
249
+
250
+ $page_builder_request = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/wp/v2/astra-site-page-builder/?_fields=id,name,slug&site_url=' . $site_url . '&purchase_key=' . $purchase_key, $api_args );
251
+ if ( ! is_wp_error( $page_builder_request ) && 200 === (int) wp_remote_retrieve_response_code( $page_builder_request ) ) {
252
+ $page_builders = json_decode( wp_remote_retrieve_body( $page_builder_request ), true );
253
+
254
+ if ( isset( $page_builders['code'] ) ) {
255
+ $message = isset( $page_builders['message'] ) ? $page_builders['message'] : '';
256
+ if ( ! empty( $message ) ) {
257
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
258
+ } else {
259
+ astra_sites_error_log( 'HTTP Request Error!' );
260
+ }
261
+ } else {
262
+ update_option( 'astra-sites-page-builders', $page_builders );
263
+
264
+ if ( defined( 'WP_CLI' ) ) {
265
+ $this->generate_file( 'astra-sites-page-builders', $page_builders );
266
+ }
267
+ }
268
+ }
269
+
270
+ astra_sites_error_log( 'Page Builders Imported Successfully!' );
271
+ update_option( 'astra-sites-batch-status-string', 'Page Builders Imported Successfully!' );
272
+ }
273
+
274
+ /**
275
+ * Import Blocks
276
+ *
277
+ * @since 2.0.0
278
+ * @param integer $page Page number.
279
+ * @return void
280
+ */
281
+ public function import_blocks( $page = 1 ) {
282
+
283
+ astra_sites_error_log( 'BLOCK: -------- ACTUAL IMPORT --------' );
284
+ $api_args = array(
285
+ 'timeout' => 30,
286
+ );
287
+ $all_blocks = array();
288
+ astra_sites_error_log( 'BLOCK: Requesting ' . $page );
289
+ update_option( 'astra-blocks-batch-status-string', 'Requesting for blocks page - ' . $page );
290
+ $response = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/astra-blocks/v1/blocks?per_page=100&page=' . $page, $api_args );
291
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
292
+ $astra_blocks = json_decode( wp_remote_retrieve_body( $response ), true );
293
+
294
+ if ( isset( $astra_blocks['code'] ) ) {
295
+ $message = isset( $astra_blocks['message'] ) ? $astra_blocks['message'] : '';
296
+ if ( ! empty( $message ) ) {
297
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
298
+ } else {
299
+ astra_sites_error_log( 'HTTP Request Error!' );
300
+ }
301
+ } else {
302
+ astra_sites_error_log( 'BLOCK: Storing data for page ' . $page . ' in option astra-blocks-' . $page );
303
+ update_option( 'astra-blocks-batch-status-string', 'Storing data for page ' . $page . ' in option astra-blocks-' . $page );
304
+
305
+ update_option( 'astra-blocks-' . $page, $astra_blocks );
306
+
307
+ if ( defined( 'WP_CLI' ) ) {
308
+ $this->generate_file( 'astra-blocks-' . $page, $astra_blocks );
309
+ }
310
+ }
311
+ } else {
312
+ astra_sites_error_log( 'BLOCK: API Error: ' . $response->get_error_message() );
313
+ }
314
+
315
+ astra_sites_error_log( 'BLOCK: Complete storing data for blocks ' . $page );
316
+ update_option( 'astra-blocks-batch-status-string', 'Complete storing data for page ' . $page );
317
+ }
318
+
319
+ /**
320
+ * Import
321
+ *
322
+ * @since 1.0.14
323
+ * @since 2.0.0 Added page no.
324
+ *
325
+ * @param integer $page Page number.
326
+ * @return array
327
+ */
328
+ public function import_sites( $page = 1 ) {
329
+ $api_args = array(
330
+ 'timeout' => 30,
331
+ );
332
+ $sites_and_pages = array();
333
+ astra_sites_error_log( 'Requesting ' . $page );
334
+ update_option( 'astra-sites-batch-status-string', 'Requesting ' . $page );
335
+ $response = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/astra-sites/v1/sites-and-pages?per_page=15&page=' . $page, $api_args );
336
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
337
+ $sites_and_pages = json_decode( wp_remote_retrieve_body( $response ), true );
338
+
339
+ if ( isset( $sites_and_pages['code'] ) ) {
340
+ $message = isset( $sites_and_pages['message'] ) ? $sites_and_pages['message'] : '';
341
+ if ( ! empty( $message ) ) {
342
+ astra_sites_error_log( 'HTTP Request Error: ' . $message );
343
+ } else {
344
+ astra_sites_error_log( 'HTTP Request Error!' );
345
+ }
346
+ } else {
347
+ astra_sites_error_log( 'Storing data for page ' . $page . ' in option astra-sites-and-pages-page-' . $page );
348
+ update_option( 'astra-sites-batch-status-string', 'Storing data for page ' . $page . ' in option astra-sites-and-pages-page-' . $page );
349
+
350
+ update_option( 'astra-sites-and-pages-page-' . $page, $sites_and_pages );
351
+
352
+ if ( defined( 'WP_CLI' ) ) {
353
+ $this->generate_file( 'astra-sites-and-pages-page-' . $page, $sites_and_pages );
354
+ }
355
+ }
356
+ } else {
357
+ astra_sites_error_log( 'API Error: ' . $response->get_error_message() );
358
+ }
359
+
360
+ astra_sites_error_log( 'Complete storing data for page ' . $page );
361
+ update_option( 'astra-sites-batch-status-string', 'Complete storing data for page ' . $page );
362
+
363
+ return $sites_and_pages;
364
+ }
365
+ }
366
+
367
+ /**
368
+ * Kicking this off by calling 'get_instance()' method
369
+ */
370
+ Astra_Sites_Batch_Processing_Importer::get_instance();
371
+
372
+ endif;
inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php CHANGED
@@ -33,7 +33,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Misc' ) ) :
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
- self::$instance = new self;
37
  }
38
  return self::$instance;
39
  }
33
  public static function get_instance() {
34
 
35
  if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
  return self::$instance;
39
  }
inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php CHANGED
@@ -32,7 +32,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) :
32
  */
33
  public static function get_instance() {
34
  if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self;
36
  }
37
  return self::$instance;
38
  }
32
  */
33
  public static function get_instance() {
34
  if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
  }
37
  return self::$instance;
38
  }
inc/importers/batch-processing/class-astra-sites-batch-processing.php CHANGED
@@ -33,6 +33,33 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
33
  */
34
  public static $process_all;
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  /**
37
  * Initiator
38
  *
@@ -41,7 +68,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
41
  */
42
  public static function get_instance() {
43
  if ( ! isset( self::$instance ) ) {
44
- self::$instance = new self;
45
  }
46
  return self::$instance;
47
  }
@@ -65,6 +92,8 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
65
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-async-request.php';
66
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process.php';
67
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process-astra.php';
 
 
68
 
69
  // Prepare Widgets.
70
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php';
@@ -78,11 +107,609 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
78
  // Prepare Misc.
79
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php';
80
 
81
- self::$process_all = new WP_Background_Process_Astra();
 
 
 
 
 
82
 
83
  // Start image importing after site import complete.
84
  add_filter( 'astra_sites_image_importer_skip_image', array( $this, 'skip_image' ), 10, 2 );
85
  add_action( 'astra_sites_import_complete', array( $this, 'start_process' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  }
87
 
88
  /**
@@ -94,9 +721,15 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
94
  * @param array $attachment Batch process image input.
95
  * @return boolean
96
  */
97
- function skip_image( $can_process, $attachment ) {
98
 
99
  if ( isset( $attachment['url'] ) && ! empty( $attachment['url'] ) ) {
 
 
 
 
 
 
100
  if (
101
  strpos( $attachment['url'], 'brainstormforce.com' ) !== false ||
102
  strpos( $attachment['url'], 'wpastra.com' ) !== false ||
@@ -120,7 +753,7 @@ if ( ! class_exists( 'Astra_Sites_Batch_Processing' ) ) :
120
  public function start_process() {
121
 
122
  Astra_Sites_Importer_Log::add( 'Batch Process Started!' );
123
- Astra_Sites_Importer_Log::add( Astra_Sites_White_Label::get_instance()->page_title( ASTRA_SITES_NAME ) . ' - Importing Images for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
124
 
125
  // Add "widget" in import [queue].
126
  if ( class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) {
33
  */
34
  public static $process_all;
35
 
36
+ /**
37
+ * Last Export Checksums
38
+ *
39
+ * @since 2.0.0
40
+ * @var object Class object.
41
+ * @access public
42
+ */
43
+ public $last_export_checksums;
44
+
45
+ /**
46
+ * Sites Importer
47
+ *
48
+ * @since 2.0.0
49
+ * @var object Class object.
50
+ * @access public
51
+ */
52
+ public static $process_site_importer;
53
+
54
+ /**
55
+ * Process Single Page
56
+ *
57
+ * @since 2.0.0
58
+ * @var object Class object.
59
+ * @access public
60
+ */
61
+ public static $process_single;
62
+
63
  /**
64
  * Initiator
65
  *
68
  */
69
  public static function get_instance() {
70
  if ( ! isset( self::$instance ) ) {
71
+ self::$instance = new self();
72
  }
73
  return self::$instance;
74
  }
92
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-async-request.php';
93
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process.php';
94
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process-astra.php';
95
+ require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process-astra-single.php';
96
+ require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/helpers/class-wp-background-process-astra-site-importer.php';
97
 
98
  // Prepare Widgets.
99
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing-widgets.php';
107
  // Prepare Misc.
108
  require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing-misc.php';
109
 
110
+ // Process Importer.
111
+ require_once ASTRA_SITES_DIR . 'inc/importers/batch-processing/class-astra-sites-batch-processing-importer.php';
112
+
113
+ self::$process_all = new WP_Background_Process_Astra();
114
+ self::$process_single = new WP_Background_Process_Astra_Single();
115
+ self::$process_site_importer = new WP_Background_Process_Astra_Site_Importer();
116
 
117
  // Start image importing after site import complete.
118
  add_filter( 'astra_sites_image_importer_skip_image', array( $this, 'skip_image' ), 10, 2 );
119
  add_action( 'astra_sites_import_complete', array( $this, 'start_process' ) );
120
+ add_action( 'astra_sites_process_single', array( $this, 'start_process_single' ) );
121
+ add_action( 'admin_head', array( $this, 'start_importer' ) );
122
+ add_action( 'wp_ajax_astra-sites-update-library', array( $this, 'update_library' ) );
123
+ add_action( 'wp_ajax_astra-sites-update-library-complete', array( $this, 'update_library_complete' ) );
124
+ add_action( 'wp_ajax_astra-sites-import-categories', array( $this, 'import_categories' ) );
125
+ add_action( 'wp_ajax_astra-sites-import-site-categories', array( $this, 'import_site_categories' ) );
126
+ add_action( 'wp_ajax_astra-sites-import-block-categories', array( $this, 'import_block_categories' ) );
127
+ add_action( 'wp_ajax_astra-sites-import-page-builders', array( $this, 'import_page_builders' ) );
128
+ add_action( 'wp_ajax_astra-sites-import-blocks', array( $this, 'import_blocks' ) );
129
+ add_action( 'wp_ajax_astra-sites-get-sites-request-count', array( $this, 'sites_requests_count' ) );
130
+ add_action( 'wp_ajax_astra-sites-import-sites', array( $this, 'import_sites' ) );
131
+ }
132
+
133
+ /**
134
+ * Import Categories
135
+ *
136
+ * @since 2.0.0
137
+ * @return void
138
+ */
139
+ public function import_categories() {
140
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_categories();
141
+ wp_send_json_success();
142
+ }
143
+
144
+ /**
145
+ * Import Site Categories
146
+ *
147
+ * @since 2.0.0
148
+ * @return void
149
+ */
150
+ public function import_site_categories() {
151
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_site_categories();
152
+ wp_send_json_success();
153
+ }
154
+
155
+ /**
156
+ * Import Block Categories
157
+ *
158
+ * @since 2.0.0
159
+ * @return void
160
+ */
161
+ public function import_block_categories() {
162
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_block_categories();
163
+ wp_send_json_success();
164
+ }
165
+
166
+ /**
167
+ * Import Page Builders
168
+ *
169
+ * @since 2.0.0
170
+ * @return void
171
+ */
172
+ public function import_page_builders() {
173
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_page_builders();
174
+ wp_send_json_success();
175
+ }
176
+
177
+ /**
178
+ * Import Blocks
179
+ *
180
+ * @since 2.0.0
181
+ * @return void
182
+ */
183
+ public function import_blocks() {
184
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_blocks();
185
+ wp_send_json_success();
186
+ }
187
+
188
+ /**
189
+ * Import Sites
190
+ *
191
+ * @since 2.0.0
192
+ * @return void
193
+ */
194
+ public function import_sites() {
195
+ $page_no = isset( $_POST['page_no'] ) ? absint( $_POST['page_no'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
196
+ if ( $page_no ) {
197
+ $sites_and_pages = Astra_Sites_Batch_Processing_Importer::get_instance()->import_sites( $page_no );
198
+
199
+ $page_builder_keys = wp_list_pluck( $sites_and_pages, 'astra-site-page-builder' );
200
+ $default_page_builder = Astra_Sites_Page::get_instance()->get_setting( 'page_builder' );
201
+
202
+ $current_page_builder_sites = array();
203
+ foreach ( $page_builder_keys as $site_id => $page_builder ) {
204
+ if ( $default_page_builder === $page_builder ) {
205
+ $current_page_builder_sites[ $site_id ] = $sites_and_pages[ $site_id ];
206
+ }
207
+ }
208
+
209
+ wp_send_json_success( $current_page_builder_sites );
210
+ }
211
+
212
+ wp_send_json_error();
213
+ }
214
+
215
+ /**
216
+ * Sites Requests Count
217
+ *
218
+ * @since 2.0.0
219
+ * @return void
220
+ */
221
+ public function sites_requests_count() {
222
+
223
+ // Get count.
224
+ $total_requests = $this->get_total_requests();
225
+ if ( $total_requests ) {
226
+ wp_send_json_success( $total_requests );
227
+ }
228
+
229
+ wp_send_json_error();
230
+ }
231
+
232
+ /**
233
+ * Update Library Complete
234
+ *
235
+ * @since 2.0.0
236
+ * @return void
237
+ */
238
+ public function update_library_complete() {
239
+ Astra_Sites_Importer::get_instance()->update_latest_checksums();
240
+
241
+ update_option( 'astra-sites-batch-is-complete', 'no' );
242
+ update_option( 'astra-sites-manual-sync-complete', 'yes' );
243
+ wp_send_json_success();
244
+ }
245
+
246
+ /**
247
+ * Get Last Exported Checksum Status
248
+ *
249
+ * @since 2.0.0
250
+ * @return string Checksums Status.
251
+ */
252
+ public function get_last_export_checksums() {
253
+
254
+ $old_last_export_checksums = get_option( 'astra-sites-last-export-checksums', '' );
255
+
256
+ $new_last_export_checksums = $this->set_last_export_checksums();
257
+
258
+ $checksums_status = 'no';
259
+
260
+ if ( empty( $old_last_export_checksums ) ) {
261
+ $checksums_status = 'yes';
262
+ }
263
+
264
+ if ( $new_last_export_checksums !== $old_last_export_checksums ) {
265
+ $checksums_status = 'yes';
266
+ }
267
+
268
+ return apply_filters( 'astra_sites_checksums_status', $checksums_status );
269
+ }
270
+
271
+ /**
272
+ * Set Last Exported Checksum
273
+ *
274
+ * @since 2.0.0
275
+ * @return string Checksums Status.
276
+ */
277
+ public function set_last_export_checksums() {
278
+
279
+ if ( ! empty( $this->last_export_checksums ) ) {
280
+ return $this->last_export_checksums;
281
+ }
282
+
283
+ $api_args = array(
284
+ 'timeout' => 60,
285
+ );
286
+
287
+ $response = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . 'wp-json/astra-sites/v1/get-last-export-checksums', $api_args );
288
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
289
+ $result = json_decode( wp_remote_retrieve_body( $response ), true );
290
+
291
+ // Set last export checksums.
292
+ if ( ! empty( $result['last_export_checksums'] ) ) {
293
+ update_option( 'astra-sites-last-export-checksums-latest', $result['last_export_checksums'] );
294
+
295
+ $this->last_export_checksums = $result['last_export_checksums'];
296
+ }
297
+ }
298
+
299
+ return $this->last_export_checksums;
300
+ }
301
+
302
+ /**
303
+ * Update Library
304
+ *
305
+ * @since 2.0.0
306
+ * @return void
307
+ */
308
+ public function update_library() {
309
+
310
+ if ( 'no' === $this->get_last_export_checksums() ) {
311
+ wp_send_json_success( 'updated' );
312
+ }
313
+
314
+ $status = Astra_Sites_Page::get_instance()->test_cron();
315
+ if ( is_wp_error( $status ) ) {
316
+ $import_with = 'ajax';
317
+ } else {
318
+ $import_with = 'batch';
319
+ // Process import.
320
+ $this->process_batch();
321
+ }
322
+
323
+ wp_send_json_success( $import_with );
324
+ }
325
+
326
+ /**
327
+ * Start Importer
328
+ *
329
+ * @since 2.0.0
330
+ * @return void
331
+ */
332
+ public function start_importer() {
333
+
334
+ $is_fresh_site = get_option( 'astra-sites-fresh-site', '' );
335
+
336
+ // Process initially for the fresh user.
337
+ if ( isset( $_GET['reset'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
338
+
339
+ // Process import.
340
+ $this->process_batch();
341
+
342
+ } elseif ( empty( $is_fresh_site ) ) {
343
+
344
+ // First time user save the data of sites, pages, categories etc from the JSON file.
345
+ $dir = ASTRA_SITES_DIR . 'inc/json';
346
+ $list_files = list_files( $dir );
347
+ if ( ! empty( $list_files ) ) {
348
+ $list_files = array_map( 'basename', $list_files );
349
+ foreach ( $list_files as $key => $file_name ) {
350
+ $data = Astra_Sites::get_instance()->get_filesystem()->get_contents( $dir . '/' . $file_name );
351
+ if ( ! empty( $data ) ) {
352
+ $option_name = str_replace( '.json', '', $file_name );
353
+ update_option( $option_name, json_decode( $data, true ) );
354
+ }
355
+ }
356
+ }
357
+
358
+ // Also, Trigger the batch to get latest data.
359
+ // If batch failed then user have at least the data from the JSON file.
360
+ $this->process_batch();
361
+
362
+ update_option( 'astra-sites-fresh-site', 'yes' );
363
+
364
+ // If not fresh user then trigger batch import on the transient and option
365
+ // Only on the Astra Sites page.
366
+ } else {
367
+
368
+ $current_screen = get_current_screen();
369
+
370
+ // Bail if not on Astra Sites screen.
371
+ if ( ! is_object( $current_screen ) && null === $current_screen ) {
372
+ return;
373
+ }
374
+
375
+ if ( 'appearance_page_starter-templates' === $current_screen->id ) {
376
+
377
+ // Process import.
378
+ $this->process_import();
379
+ }
380
+ }
381
+ }
382
+
383
+ /**
384
+ * Process Batch
385
+ *
386
+ * @since 2.0.0
387
+ * @return mixed
388
+ */
389
+ public function process_batch() {
390
+
391
+ if ( 'no' === $this->get_last_export_checksums() ) {
392
+ $this->log( 'Library is up to date!' );
393
+ if ( defined( 'WP_CLI' ) ) {
394
+ WP_CLI::line( 'Library is up to date!' );
395
+ }
396
+ return;
397
+ }
398
+
399
+ $status = Astra_Sites_Page::get_instance()->test_cron();
400
+ if ( is_wp_error( $status ) ) {
401
+ astra_sites_error_log( 'Error! Batch Not Start due to disabled cron events!' );
402
+ update_option( 'astra-sites-batch-status-string', 'Error! Batch Not Start due to disabled cron events!' );
403
+
404
+ if ( defined( 'WP_CLI' ) ) {
405
+ WP_CLI::line( 'Error! Batch Not Start due to disabled cron events!' );
406
+ } else {
407
+ // For non- WP CLI request return to prevent the request.
408
+ return;
409
+ }
410
+ }
411
+
412
+ $this->log( 'Sync Library Started!' );
413
+
414
+ // Added the categories.
415
+ $this->log( 'Added Tags in queue.' );
416
+
417
+ if ( defined( 'WP_CLI' ) ) {
418
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_categories();
419
+ } else {
420
+ self::$process_site_importer->push_to_queue(
421
+ array(
422
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
423
+ 'method' => 'import_categories',
424
+ )
425
+ );
426
+ }
427
+
428
+ // Added the categories.
429
+ $this->log( 'Added Site Categories in queue.' );
430
+
431
+ if ( defined( 'WP_CLI' ) ) {
432
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_site_categories();
433
+ } else {
434
+ self::$process_site_importer->push_to_queue(
435
+ array(
436
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
437
+ 'method' => 'import_site_categories',
438
+ )
439
+ );
440
+ }
441
+
442
+ // Added the page_builders.
443
+ $this->log( 'Added page builders in queue.' );
444
+
445
+ if ( defined( 'WP_CLI' ) ) {
446
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_page_builders();
447
+ } else {
448
+ self::$process_site_importer->push_to_queue(
449
+ array(
450
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
451
+ 'method' => 'import_page_builders',
452
+ )
453
+ );
454
+ }
455
+
456
+ // Get count.
457
+ $total_requests = $this->get_total_blocks_requests();
458
+ if ( $total_requests ) {
459
+ $this->log( 'BLOCK: Total Blocks Requests ' . $total_requests );
460
+
461
+ for ( $page = 1; $page <= $total_requests; $page++ ) {
462
+
463
+ $this->log( 'BLOCK: Added page ' . $page . ' in queue.' );
464
+
465
+ if ( defined( 'WP_CLI' ) ) {
466
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_blocks( $page );
467
+ } else {
468
+ self::$process_site_importer->push_to_queue(
469
+ array(
470
+ 'page' => $page,
471
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
472
+ 'method' => 'import_blocks',
473
+ )
474
+ );
475
+ }
476
+ }
477
+ }
478
+
479
+ // Added the categories.
480
+ $this->log( 'Added Block Categories in queue.' );
481
+
482
+ if ( defined( 'WP_CLI' ) ) {
483
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_block_categories();
484
+ } else {
485
+ self::$process_site_importer->push_to_queue(
486
+ array(
487
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
488
+ 'method' => 'import_block_categories',
489
+ )
490
+ );
491
+ }
492
+
493
+ // Get count.
494
+ $total_requests = $this->get_total_requests();
495
+ if ( $total_requests ) {
496
+ $this->log( 'Total Requests ' . $total_requests );
497
+
498
+ for ( $page = 1; $page <= $total_requests; $page++ ) {
499
+
500
+ $this->log( 'Added page ' . $page . ' in queue.' );
501
+
502
+ if ( defined( 'WP_CLI' ) ) {
503
+ Astra_Sites_Batch_Processing_Importer::get_instance()->import_sites( $page );
504
+ } else {
505
+ self::$process_site_importer->push_to_queue(
506
+ array(
507
+ 'page' => $page,
508
+ 'instance' => Astra_Sites_Batch_Processing_Importer::get_instance(),
509
+ 'method' => 'import_sites',
510
+ )
511
+ );
512
+ }
513
+ }
514
+ }
515
+
516
+ if ( defined( 'WP_CLI' ) ) {
517
+ $this->log( 'Sync Process Complete.' );
518
+ } else {
519
+ // Dispatch Queue.
520
+ $this->log( 'Dispatch the Queue!' );
521
+
522
+ self::$process_site_importer->save()->dispatch();
523
+ }
524
+
525
+ }
526
+
527
+ /**
528
+ * Log
529
+ *
530
+ * @since 2.0.0
531
+ *
532
+ * @param string $message Log message.
533
+ * @return void.
534
+ */
535
+ public function log( $message = '' ) {
536
+ if ( defined( 'WP_CLI' ) ) {
537
+ WP_CLI::line( $message );
538
+ } else {
539
+ astra_sites_error_log( $message );
540
+ update_option( 'astra-sites-batch-status-string', $message );
541
+ }
542
+ }
543
+
544
+ /**
545
+ * Process Import
546
+ *
547
+ * @since 2.0.0
548
+ *
549
+ * @return mixed Null if process is already started.
550
+ */
551
+ public function process_import() {
552
+
553
+ // Batch is already started? Then return.
554
+ $status = get_option( 'astra-sites-batch-status' );
555
+ $expired = get_transient( 'astra-sites-import-check' );
556
+ if ( 'in-process' === $status ) {
557
+ return;
558
+ }
559
+
560
+ // Check batch expiry.
561
+ $expired = get_transient( 'astra-sites-import-check' );
562
+ if ( false !== $expired ) {
563
+ return;
564
+ }
565
+
566
+ // For 1 week.
567
+ set_transient( 'astra-sites-import-check', 'true', apply_filters( 'astra_sites_sync_check_time', WEEK_IN_SECONDS ) );
568
+
569
+ update_option( 'astra-sites-batch-status', 'in-process' );
570
+
571
+ // Process batch.
572
+ $this->process_batch();
573
+ }
574
+
575
+ /**
576
+ * Get Total Requests
577
+ *
578
+ * @return integer
579
+ */
580
+ public function get_total_requests() {
581
+
582
+ astra_sites_error_log( 'Getting Total Pages' );
583
+ update_option( 'astra-sites-batch-status-string', 'Getting Total Pages' );
584
+
585
+ $api_args = array(
586
+ 'timeout' => 60,
587
+ );
588
+
589
+ $response = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/astra-sites/v1/get-total-pages/?per_page=15', $api_args );
590
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
591
+ $total_requests = json_decode( wp_remote_retrieve_body( $response ), true );
592
+
593
+ if ( isset( $total_requests['pages'] ) ) {
594
+
595
+ $this->log( 'Updated requests ' . $total_requests['pages'] );
596
+ update_option( 'astra-sites-requests', $total_requests['pages'] );
597
+ Astra_Sites_Batch_Processing_Importer::get_instance()->generate_file( 'astra-sites-requests', $total_requests['pages'] );
598
+
599
+ return $total_requests['pages'];
600
+ }
601
+ }
602
+
603
+ astra_sites_error_log( 'Request Failed! Still Calling..' );
604
+ update_option( 'astra-sites-batch-status-string', 'Request Failed! Still Calling..' );
605
+
606
+ $this->get_total_requests();
607
+ }
608
+
609
+ /**
610
+ * Get Blocks Total Requests
611
+ *
612
+ * @return integer
613
+ */
614
+ public function get_total_blocks_requests() {
615
+
616
+ astra_sites_error_log( 'BLOCK: Getting Total Blocks' );
617
+ update_option( 'astra-sites-batch-status-string', 'Getting Total Blocks' );
618
+
619
+ $api_args = array(
620
+ 'timeout' => 60,
621
+ );
622
+
623
+ $response = wp_remote_get( trailingslashit( Astra_Sites::get_instance()->get_api_domain() ) . '/wp-json/astra-blocks/v1/get-total-blocks', $api_args );
624
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
625
+ $total_requests = json_decode( wp_remote_retrieve_body( $response ), true );
626
+
627
+ astra_sites_error_log( 'BLOCK: Updated requests ' . $total_requests );
628
+ update_option( 'astra-blocks-batch-status-string', 'Updated requests ' . $total_requests );
629
+
630
+ update_option( 'astra-blocks-requests', $total_requests );
631
+
632
+ return $total_requests;
633
+ }
634
+
635
+ astra_sites_error_log( 'BLOCK: Request Failed! Still Calling..' );
636
+ update_option( 'astra-blocks-batch-status-string', 'Request Failed! Still Calling..' );
637
+
638
+ $this->get_total_blocks_requests();
639
+ }
640
+
641
+ /**
642
+ * Start Single Page Import
643
+ *
644
+ * @param int $page_id Page ID .
645
+ * @since 2.0.0
646
+ * @return void
647
+ */
648
+ public function start_process_single( $page_id ) {
649
+
650
+ astra_sites_error_log( '=================== ' . Astra_Sites_White_Label::get_instance()->get_white_label_name( ASTRA_SITES_NAME ) . ' - Single Page - Importing Images for Blog name \'' . get_the_title( $page_id ) . '\' (' . $page_id . ') ===================' );
651
+
652
+ $default_page_builder = Astra_Sites_Page::get_instance()->get_setting( 'page_builder' );
653
+
654
+ if ( 'gutenberg' === $default_page_builder ) {
655
+ // Add "gutenberg" in import [queue].
656
+ self::$process_single->push_to_queue(
657
+ array(
658
+ 'page_id' => $page_id,
659
+ 'instance' => Astra_Sites_Batch_Processing_Gutenberg::get_instance(),
660
+ )
661
+ );
662
+ }
663
+
664
+ // Add "brizy" in import [queue].
665
+ if ( 'brizy' === $default_page_builder && is_plugin_active( 'brizy/brizy.php' ) ) {
666
+ // Add "gutenberg" in import [queue].
667
+ self::$process_single->push_to_queue(
668
+ array(
669
+ 'page_id' => $page_id,
670
+ 'instance' => Astra_Sites_Batch_Processing_Brizy::get_instance(),
671
+ )
672
+ );
673
+ }
674
+
675
+ // Add "bb-plugin" in import [queue].
676
+ if (
677
+ 'beaver-builder' === $default_page_builder &&
678
+ ( is_plugin_active( 'beaver-builder-lite-version/fl-builder.php' ) || is_plugin_active( 'bb-plugin/fl-builder.php' ) )
679
+ ) {
680
+ // Add "gutenberg" in import [queue].
681
+ self::$process_single->push_to_queue(
682
+ array(
683
+ 'page_id' => $page_id,
684
+ 'instance' => Astra_Sites_Batch_Processing_Beaver_Builder::get_instance(),
685
+ )
686
+ );
687
+ }
688
+
689
+ // Add "elementor" in import [queue].
690
+ if ( 'elementor' === $default_page_builder ) {
691
+ // @todo Remove required `allow_url_fopen` support.
692
+ if ( ini_get( 'allow_url_fopen' ) ) {
693
+ if ( is_plugin_active( 'elementor/elementor.php' ) ) {
694
+
695
+ // !important, Clear the cache after images import.
696
+ \Elementor\Plugin::$instance->posts_css_manager->clear_cache();
697
+
698
+ $import = new \Elementor\TemplateLibrary\Astra_Sites_Batch_Processing_Elementor();
699
+ self::$process_single->push_to_queue(
700
+ array(
701
+ 'page_id' => $page_id,
702
+ 'instance' => $import,
703
+ )
704
+ );
705
+ }
706
+ } else {
707
+ astra_sites_error_log( 'Couldn\'t not import image due to allow_url_fopen() is disabled!' );
708
+ }
709
+ }
710
+
711
+ // Dispatch Queue.
712
+ self::$process_single->save()->dispatch();
713
  }
714
 
715
  /**
721
  * @param array $attachment Batch process image input.
722
  * @return boolean
723
  */
724
+ public function skip_image( $can_process, $attachment ) {
725
 
726
  if ( isset( $attachment['url'] ) && ! empty( $attachment['url'] ) ) {
727
+
728
+ // If image URL contain current site URL? then return true to skip that image from import.
729
+ if ( strpos( $attachment['url'], site_url() ) !== false ) {
730
+ return true;
731
+ }
732
+
733
  if (
734
  strpos( $attachment['url'], 'brainstormforce.com' ) !== false ||
735
  strpos( $attachment['url'], 'wpastra.com' ) !== false ||
753
  public function start_process() {
754
 
755
  Astra_Sites_Importer_Log::add( 'Batch Process Started!' );
756
+ Astra_Sites_Importer_Log::add( Astra_Sites_White_Label::get_instance()->get_white_label_name( ASTRA_SITES_NAME ) . ' - Importing Images for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
757
 
758
  // Add "widget" in import [queue].
759
  if ( class_exists( 'Astra_Sites_Batch_Processing_Widgets' ) ) {
inc/importers/batch-processing/helpers/class-astra-sites-image-importer.php CHANGED
@@ -49,7 +49,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
49
  */
50
  public static function get_instance() {
51
  if ( ! isset( self::$instance ) ) {
52
- self::$instance = new self;
53
  }
54
  return self::$instance;
55
  }
@@ -93,7 +93,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
93
  * @param string $attachment_url Attachment URL.
94
  * @return string Hash string.
95
  */
96
- private function get_hash_image( $attachment_url ) {
97
  return sha1( $attachment_url );
98
  }
99
 
@@ -108,17 +108,17 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
108
 
109
  if ( apply_filters( 'astra_sites_image_importer_skip_image', false, $attachment ) ) {
110
  Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image - {from filter} - ' . $attachment['url'] . ' - Filter name `astra_sites_image_importer_skip_image`.' );
111
- return $attachment;
112
  }
113
 
114
- global $wpdb;
115
-
116
  // Already imported? Then return!
117
  if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) {
118
  Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image {already imported from batch process} - ' . $attachment['url'] . ' - already imported.' );
119
- return $this->already_imported_ids[ $attachment['id'] ];
120
  }
121
 
 
 
122
  // 1. Is already imported in Batch Import Process?
123
  $post_id = $wpdb->get_var(
124
  $wpdb->prepare(
@@ -154,9 +154,9 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
154
  'id' => $post_id,
155
  'url' => wp_get_attachment_url( $post_id ),
156
  );
157
- $this->already_imported_ids[ $attachment['id'] ] = $new_attachment;
158
 
159
- return $new_attachment;
160
  }
161
 
162
  return false;
@@ -171,9 +171,10 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
171
  */
172
  public function import( $attachment ) {
173
 
 
174
  $saved_image = $this->get_saved_image( $attachment );
175
  if ( $saved_image ) {
176
- return $saved_image;
177
  }
178
 
179
  $file_content = wp_remote_retrieve_body(
@@ -188,6 +189,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
188
 
189
  // Empty file content?
190
  if ( empty( $file_content ) ) {
 
191
  Astra_Sites_Importer_Log::add( 'BATCH - FAIL Image {Error: Failed wp_remote_retrieve_body} - ' . $attachment['url'] );
192
  return $attachment;
193
  }
@@ -195,11 +197,13 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
195
  // Extract the file name and extension from the URL.
196
  $filename = basename( $attachment['url'] );
197
 
 
198
  $upload = wp_upload_bits(
199
  $filename,
200
  null,
201
  $file_content
202
  );
 
203
 
204
  $post = array(
205
  'post_title' => $filename,
@@ -221,6 +225,8 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
221
  );
222
  update_post_meta( $post_id, '_astra_sites_image_hash', $this->get_hash_image( $attachment['url'] ) );
223
 
 
 
224
  $new_attachment = array(
225
  'id' => $post_id,
226
  'url' => $upload['url'],
@@ -228,7 +234,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
228
 
229
  Astra_Sites_Importer_Log::add( 'BATCH - SUCCESS Image {Imported} - ' . $new_attachment['url'] );
230
 
231
- $this->already_imported_ids[ $attachment['id'] ] = $new_attachment;
232
 
233
  return $new_attachment;
234
  }
@@ -241,7 +247,7 @@ if ( ! class_exists( 'Astra_Sites_Image_Importer' ) ) :
241
  * @param string $url URL.
242
  * @return boolean
243
  */
244
- function is_image_url( $url = '' ) {
245
  if ( empty( $url ) ) {
246
  return false;
247
  }
49
  */
50
  public static function get_instance() {
51
  if ( ! isset( self::$instance ) ) {
52
+ self::$instance = new self();
53
  }
54
  return self::$instance;
55
  }
93
  * @param string $attachment_url Attachment URL.
94
  * @return string Hash string.
95
  */
96
+ public function get_hash_image( $attachment_url ) {
97
  return sha1( $attachment_url );
98
  }
99
 
108
 
109
  if ( apply_filters( 'astra_sites_image_importer_skip_image', false, $attachment ) ) {
110
  Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image - {from filter} - ' . $attachment['url'] . ' - Filter name `astra_sites_image_importer_skip_image`.' );
111
+ return true;
112
  }
113
 
 
 
114
  // Already imported? Then return!
115
  if ( isset( $this->already_imported_ids[ $attachment['id'] ] ) ) {
116
  Astra_Sites_Importer_Log::add( 'BATCH - SKIP Image {already imported from batch process} - ' . $attachment['url'] . ' - already imported.' );
117
+ return true;
118
  }
119
 
120
+ global $wpdb;
121
+
122
  // 1. Is already imported in Batch Import Process?
123
  $post_id = $wpdb->get_var(
124
  $wpdb->prepare(
154
  'id' => $post_id,
155
  'url' => wp_get_attachment_url( $post_id ),
156
  );
157
+ $this->already_imported_ids[ $attachment['id'] ] = $post_id;
158
 
159
+ return true;
160
  }
161
 
162
  return false;
171
  */
172
  public function import( $attachment ) {
173
 
174
+ Astra_Sites_Importer_Log::add( 'Source - ' . $attachment['url'] );
175
  $saved_image = $this->get_saved_image( $attachment );
176
  if ( $saved_image ) {
177
+ return $attachment;
178
  }
179
 
180
  $file_content = wp_remote_retrieve_body(
189
 
190
  // Empty file content?
191
  if ( empty( $file_content ) ) {
192
+
193
  Astra_Sites_Importer_Log::add( 'BATCH - FAIL Image {Error: Failed wp_remote_retrieve_body} - ' . $attachment['url'] );
194
  return $attachment;
195
  }
197
  // Extract the file name and extension from the URL.
198
  $filename = basename( $attachment['url'] );
199
 
200
+ // @codingStandardsIgnoreStart
201
  $upload = wp_upload_bits(
202
  $filename,
203
  null,
204
  $file_content
205
  );
206
+ // @codingStandardsIgnoreEnd
207
 
208
  $post = array(
209
  'post_title' => $filename,
225
  );
226
  update_post_meta( $post_id, '_astra_sites_image_hash', $this->get_hash_image( $attachment['url'] ) );
227
 
228
+ Astra_WXR_Importer::instance()->track_post( $post_id );
229
+
230
  $new_attachment = array(
231
  'id' => $post_id,
232
  'url' => $upload['url'],
234
 
235
  Astra_Sites_Importer_Log::add( 'BATCH - SUCCESS Image {Imported} - ' . $new_attachment['url'] );
236
 
237
+ $this->already_imported_ids[ $attachment['id'] ] = $post_id;
238
 
239
  return $new_attachment;
240
  }
247
  * @param string $url URL.
248
  * @return boolean
249
  */
250
+ public function is_image_url( $url = '' ) {
251
  if ( empty( $url ) ) {
252
  return false;
253
  }
inc/importers/batch-processing/helpers/class-wp-background-process-astra-single.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Single Page Background Process
4
+ *
5
+ * @package Astra Sites
6
+ * @since 2.0.0
7
+ */
8
+
9
+ if ( class_exists( 'WP_Background_Process' ) ) :
10
+
11
+ /**
12
+ * Image Background Process
13
+ *
14
+ * @since 2.0.0
15
+ */
16
+ class WP_Background_Process_Astra_Single extends WP_Background_Process {
17
+
18
+ /**
19
+ * Image Process
20
+ *
21
+ * @var string
22
+ */
23
+ protected $action = 'astra_sites_single_page';
24
+
25
+ /**
26
+ * Task
27
+ *
28
+ * Override this method to perform any actions required on each
29
+ * queue item. Return the modified item for further processing
30
+ * in the next pass through. Or, return false to remove the
31
+ * item from the queue.
32
+ *
33
+ * @since 2.0.0
34
+ *
35
+ * @param object $object Queue item object.
36
+ * @return mixed
37
+ */
38
+ protected function task( $object ) {
39
+
40
+ $page_id = $object['page_id'];
41
+
42
+ $process = $object['instance'];
43
+
44
+ if ( method_exists( $process, 'import_single_post' ) ) {
45
+ $process->import_single_post( $page_id );
46
+ }
47
+
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Complete
53
+ *
54
+ * Override if applicable, but ensure that the below actions are
55
+ * performed, or, call parent::complete().
56
+ *
57
+ * @since 2.0.0
58
+ */
59
+ protected function complete() {
60
+
61
+ astra_sites_error_log( 'Complete' );
62
+
63
+ parent::complete();
64
+
65
+ do_action( 'astra_sites_image_import_complete' );
66
+
67
+ }
68
+
69
+ }
70
+
71
+ endif;
inc/importers/batch-processing/helpers/class-wp-background-process-astra-site-importer.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Single Page Background Process
4
+ *
5
+ * @package Astra Sites
6
+ * @since 2.0.0
7
+ */
8
+
9
+ if ( class_exists( 'WP_Background_Process' ) ) :
10
+
11
+ /**
12
+ * Image Background Process
13
+ *
14
+ * @since 2.0.0
15
+ */
16
+ class WP_Background_Process_Astra_Site_Importer extends WP_Background_Process {
17
+
18
+ /**
19
+ * Image Process
20
+ *
21
+ * @var string
22
+ */
23
+ protected $action = 'astra_site_importer';
24
+
25
+ /**
26
+ * Task
27
+ *
28
+ * Override this method to perform any actions required on each
29
+ * queue item. Return the modified item for further processing
30
+ * in the next pass through. Or, return false to remove the
31
+ * item from the queue.
32
+ *
33
+ * @since 2.0.0
34
+ *
35
+ * @param object $object Queue item object.
36
+ * @return mixed
37
+ */
38
+ protected function task( $object ) {
39
+
40
+ $process = $object['instance'];
41
+ $method = $object['method'];
42
+
43
+ if ( 'import_page_builders' === $method ) {
44
+ astra_sites_error_log( '-------- Importing Page Builders --------' );
45
+ update_option( 'astra-sites-batch-status-string', 'Importing Page Builders' );
46
+ $process->import_page_builders();
47
+ } elseif ( 'import_categories' === $method ) {
48
+ astra_sites_error_log( '-------- Importing Tags --------' );
49
+ update_option( 'astra-sites-batch-status-string', 'Importing Tags' );
50
+ $process->import_categories();
51
+ } elseif ( 'import_sites' === $method ) {
52
+ astra_sites_error_log( '-------- Importing Sites --------' );
53
+ $page = $object['page'];
54
+ astra_sites_error_log( 'Inside Batch ' . $page );
55
+ update_option( 'astra-sites-batch-status-string', 'Inside Batch ' . $page );
56
+ $process->import_sites( $page );
57
+ } elseif ( 'import_blocks' === $method ) {
58
+ astra_sites_error_log( '-------- Importing Blocks --------' );
59
+ $page = $object['page'];
60
+ astra_sites_error_log( 'Inside Batch ' . $page );
61
+ update_option( 'astra-sites-batch-status-string', 'Inside Batch ' . $page );
62
+ $process->import_blocks( $page );
63
+ } elseif ( 'import_block_categories' === $method ) {
64
+ astra_sites_error_log( '-------- Importing Blocks Categories --------' );
65
+ update_option( 'astra-sites-batch-status-string', 'Importing Blocks Categories' );
66
+ $process->import_block_categories();
67
+ } elseif ( 'import_site_categories' === $method ) {
68
+ astra_sites_error_log( '-------- Importing Site Categories --------' );
69
+ update_option( 'astra-sites-batch-status-string', 'Importing Site Categories' );
70
+ $process->import_site_categories();
71
+ }
72
+
73
+ return false;
74
+ }
75
+
76
+ /**
77
+ * Complete
78
+ *
79
+ * Override if applicable, but ensure that the below actions are
80
+ * performed, or, call parent::complete().
81
+ *
82
+ * @since 2.0.0
83
+ */
84
+ protected function complete() {
85
+ parent::complete();
86
+
87
+ astra_sites_error_log( esc_html__( 'All processes are complete', 'astra-sites' ) );
88
+ update_option( 'astra-sites-batch-status-string', 'All processes are complete' );
89
+ delete_option( 'astra-sites-batch-status' );
90
+ update_option( 'astra-sites-batch-is-complete', 'yes' );
91
+
92
+ do_action( 'astra_sites_site_import_batch_complete' );
93
+ }
94
+
95
+ }
96
+
97
+ endif;
inc/importers/batch-processing/helpers/class-wp-background-process.php CHANGED
@@ -62,7 +62,7 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
62
  $this->cron_interval_identifier = $this->identifier . '_cron_interval';
63
 
64
  add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) );
65
- add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) );
66
  }
67
 
68
  /**
@@ -146,7 +146,7 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
146
  * @return string
147
  */
148
  protected function generate_key( $length = 64 ) {
149
- $unique = md5( microtime() . rand() );
150
  $prepend = $this->identifier . '_batch_';
151
 
152
  return substr( $prepend . $unique, 0, $length );
@@ -199,11 +199,14 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
199
 
200
  $count = $wpdb->get_var(
201
  $wpdb->prepare(
 
202
  "
203
  SELECT COUNT(*)
204
  FROM {$table}
205
  WHERE {$column} LIKE %s
206
- ", $key
 
 
207
  )
208
  );
209
 
@@ -278,13 +281,16 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
278
 
279
  $query = $wpdb->get_row(
280
  $wpdb->prepare(
 
281
  "
282
  SELECT *
283
  FROM {$table}
284
  WHERE {$column} LIKE %s
285
  ORDER BY {$key_column} ASC
286
  LIMIT 1
287
- ", $key
 
 
288
  )
289
  );
290
 
@@ -430,6 +436,7 @@ if ( ! class_exists( 'WP_Background_Process' ) ) {
430
  // Adds every 5 minutes to the existing schedules.
431
  $schedules[ $this->identifier . '_cron_interval' ] = array(
432
  'interval' => MINUTE_IN_SECONDS * $interval,
 
433
  'display' => sprintf( __( 'Every %d Minutes', 'astra-sites' ), $interval ),
434
  );
435
 
62
  $this->cron_interval_identifier = $this->identifier . '_cron_interval';
63
 
64
  add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) );
65
+ add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) ); // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected
66
  }
67
 
68
  /**
146
  * @return string
147
  */
148
  protected function generate_key( $length = 64 ) {
149
+ $unique = md5( microtime() . wp_rand() );
150
  $prepend = $this->identifier . '_batch_';
151
 
152
  return substr( $prepend . $unique, 0, $length );
199
 
200
  $count = $wpdb->get_var(
201
  $wpdb->prepare(
202
+ // phpcs:disable
203
  "
204
  SELECT COUNT(*)
205
  FROM {$table}
206
  WHERE {$column} LIKE %s
207
+ ",
208
+ $key
209
+ // phpcs:enable
210
  )
211
  );
212
 
281
 
282
  $query = $wpdb->get_row(
283
  $wpdb->prepare(
284
+ // phpcs:disable
285
  "
286
  SELECT *
287
  FROM {$table}
288
  WHERE {$column} LIKE %s
289
  ORDER BY {$key_column} ASC
290
  LIMIT 1
291
+ ",
292
+ $key
293
+ // phpcs:enable
294
  )
295
  );
296
 
436
  // Adds every 5 minutes to the existing schedules.
437
  $schedules[ $this->identifier . '_cron_interval' ] = array(
438
  'interval' => MINUTE_IN_SECONDS * $interval,
439
+ /* translators: %d are the minutes. */
440
  'display' => sprintf( __( 'Every %d Minutes', 'astra-sites' ), $interval ),
441
  );
442
 
inc/importers/class-astra-customizer-import.php CHANGED
@@ -6,7 +6,9 @@
6
  * @package Astra Addon
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
  /**
12
  * Customizer Data importer class.
@@ -21,7 +23,7 @@ class Astra_Customizer_Import {
21
  * @since 1.0.0
22
  * @var Astra_Customizer_Import
23
  */
24
- private static $_instance = null;
25
 
26
  /**
27
  * Instantiate Astra_Customizer_Import
@@ -31,11 +33,11 @@ class Astra_Customizer_Import {
31
  */
32
  public static function instance() {
33
 
34
- if ( ! isset( self::$_instance ) ) {
35
- self::$_instance = new self;
36
  }
37
 
38
- return self::$_instance;
39
  }
40
 
41
  /**
@@ -49,7 +51,7 @@ class Astra_Customizer_Import {
49
 
50
  // Update Astra Theme customizer settings.
51
  if ( isset( $options['astra-settings'] ) ) {
52
- self::_import_settings( $options['astra-settings'] );
53
  }
54
 
55
  // Add Custom CSS.
@@ -69,12 +71,12 @@ class Astra_Customizer_Import {
69
  * @param array $options Astra Customizer setting array.
70
  * @return void
71
  */
72
- static public function _import_settings( $options = array() ) {
73
  foreach ( $options as $key => $val ) {
74
 
75
- if ( Astra_Sites_Helper::_is_image_url( $val ) ) {
76
 
77
- $data = Astra_Sites_Helper::_sideload_image( $val );
78
 
79
  if ( ! is_wp_error( $data ) ) {
80
  $options[ $key ] = $data->url;
6
  * @package Astra Addon
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit; // Exit if accessed directly.
11
+ }
12
 
13
  /**
14
  * Customizer Data importer class.
23
  * @since 1.0.0
24
  * @var Astra_Customizer_Import
25
  */
26
+ private static $instance = null;
27
 
28
  /**
29
  * Instantiate Astra_Customizer_Import
33
  */
34
  public static function instance() {
35
 
36
+ if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
  }
39
 
40
+ return self::$instance;
41
  }
42
 
43
  /**
51
 
52
  // Update Astra Theme customizer settings.
53
  if ( isset( $options['astra-settings'] ) ) {
54
+ self::import_settings( $options['astra-settings'] );
55
  }
56
 
57
  // Add Custom CSS.
71
  * @param array $options Astra Customizer setting array.
72
  * @return void
73
  */
74
+ public static function import_settings( $options = array() ) {
75
  foreach ( $options as $key => $val ) {
76
 
77
+ if ( Astra_Sites_Helper::is_image_url( $val ) ) {
78
 
79
+ $data = Astra_Sites_Helper::sideload_image( $val );
80
 
81
  if ( ! is_wp_error( $data ) ) {
82
  $options[ $key ] = $data->url;
inc/importers/class-astra-site-options-import.php CHANGED
@@ -6,7 +6,9 @@
6
  * @package Astra Addon
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
  /**
12
  * Customizer Site options importer class.
@@ -21,7 +23,7 @@ class Astra_Site_Options_Import {
21
  * @since 1.0.0
22
  * @var (Object) Astra_Site_Options_Importer
23
  */
24
- private static $_instance = null;
25
 
26
  /**
27
  * Instanciate Astra_Site_Options_Importer
@@ -30,11 +32,11 @@ class Astra_Site_Options_Import {
30
  * @return (Object) Astra_Site_Options_Importer
31
  */
32
  public static function instance() {
33
- if ( ! isset( self::$_instance ) ) {
34
- self::$_instance = new self();
35
  }
36
 
37
- return self::$_instance;
38
  }
39
 
40
  /**
@@ -52,9 +54,6 @@ class Astra_Site_Options_Import {
52
  'page_on_front',
53
  'page_for_posts',
54
 
55
- // Plugin: SiteOrigin Widgets Bundle.
56
- 'siteorigin_widgets_active',
57
-
58
  // Plugin: Elementor.
59
  'elementor_container_width',
60
  'elementor_cpt_support',
@@ -255,7 +254,7 @@ class Astra_Site_Options_Import {
255
 
256
  if ( ! empty( $cat['slug'] ) && ! empty( $cat['thumbnail_src'] ) ) {
257
 
258
- $image = (object) Astra_Sites_Helper::_sideload_image( $cat['thumbnail_src'] );
259
 
260
  if ( ! is_wp_error( $image ) ) {
261
 
@@ -283,6 +282,7 @@ class Astra_Site_Options_Import {
283
  private function insert_logo( $image_url = '' ) {
284
  $attachment_id = $this->download_image( $image_url );
285
  if ( $attachment_id ) {
 
286
  set_theme_mod( 'custom_logo', $attachment_id );
287
  }
288
  }
@@ -296,7 +296,7 @@ class Astra_Site_Options_Import {
296
  * @return mixed false|Attachment ID
297
  */
298
  private function download_image( $image_url = '' ) {
299
- $data = (object) Astra_Sites_Helper::_sideload_image( $image_url );
300
 
301
  if ( ! is_wp_error( $data ) ) {
302
  if ( isset( $data->attachment_id ) && ! empty( $data->attachment_id ) ) {
6
  * @package Astra Addon
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
 
13
  /**
14
  * Customizer Site options importer class.
23
  * @since 1.0.0
24
  * @var (Object) Astra_Site_Options_Importer
25
  */
26
+ private static $instance = null;
27
 
28
  /**
29
  * Instanciate Astra_Site_Options_Importer
32
  * @return (Object) Astra_Site_Options_Importer
33
  */
34
  public static function instance() {
35
+ if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
 
39
+ return self::$instance;
40
  }
41
 
42
  /**
54
  'page_on_front',
55
  'page_for_posts',
56
 
 
 
 
57
  // Plugin: Elementor.
58
  'elementor_container_width',
59
  'elementor_cpt_support',
254
 
255
  if ( ! empty( $cat['slug'] ) && ! empty( $cat['thumbnail_src'] ) ) {
256
 
257
+ $image = (object) Astra_Sites_Helper::sideload_image( $cat['thumbnail_src'] );
258
 
259
  if ( ! is_wp_error( $image ) ) {
260
 
282
  private function insert_logo( $image_url = '' ) {
283
  $attachment_id = $this->download_image( $image_url );
284
  if ( $attachment_id ) {
285
+ Astra_WXR_Importer::instance()->track_post( $attachment_id );
286
  set_theme_mod( 'custom_logo', $attachment_id );
287
  }
288
  }
296
  * @return mixed false|Attachment ID
297
  */
298
  private function download_image( $image_url = '' ) {
299
+ $data = (object) Astra_Sites_Helper::sideload_image( $image_url );
300
 
301
  if ( ! is_wp_error( $data ) ) {
302
  if ( isset( $data->attachment_id ) && ! empty( $data->attachment_id ) ) {
inc/importers/class-astra-sites-helper.php CHANGED
@@ -32,7 +32,7 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
32
  */
33
  public static function get_instance() {
34
  if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self;
36
  }
37
  return self::$instance;
38
  }
@@ -56,7 +56,7 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
56
  * @param object $attachment Attachment object.
57
  * @param array $meta Attachment meta data.
58
  */
59
- function add_svg_image_support( $response, $attachment, $meta ) {
60
  if ( ! function_exists( 'simplexml_load_file' ) ) {
61
  return $response;
62
  }
@@ -124,7 +124,7 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
124
  * @param object $all_sidebars Widget data.
125
  * @return object Set custom menu id by slug.
126
  */
127
- function custom_menu_widget( $all_sidebars ) {
128
 
129
  // Get current menu ID & Slugs.
130
  $menu_locations = array();
@@ -165,7 +165,7 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
165
  public static function download_file( $file = '', $timeout_seconds = 300 ) {
166
 
167
  // Gives us access to the download_url() and wp_handle_sideload() functions.
168
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
169
 
170
  // Download file to temp dir.
171
  $temp_file = download_url( $file, $timeout_seconds );
@@ -236,13 +236,13 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
236
  * @param string $file The image file path.
237
  * @return array An array of image data.
238
  */
239
- static public function _sideload_image( $file ) {
240
  $data = new stdClass();
241
 
242
  if ( ! function_exists( 'media_handle_sideload' ) ) {
243
- require_once( ABSPATH . 'wp-admin/includes/media.php' );
244
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
245
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
246
  }
247
 
248
  if ( ! empty( $file ) ) {
@@ -289,7 +289,7 @@ if ( ! class_exists( 'Astra_Sites_Helper' ) ) :
289
  * @param string $string The string to check.
290
  * @return bool Whether the string is an image url or not.
291
  */
292
- static public function _is_image_url( $string = '' ) {
293
  if ( is_string( $string ) ) {
294
 
295
  if ( preg_match( '/\.(jpg|jpeg|svg|png|gif)/i', $string ) ) {
32
  */
33
  public static function get_instance() {
34
  if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
  }
37
  return self::$instance;
38
  }
56
  * @param object $attachment Attachment object.
57
  * @param array $meta Attachment meta data.
58
  */
59
+ public function add_svg_image_support( $response, $attachment, $meta ) {
60
  if ( ! function_exists( 'simplexml_load_file' ) ) {
61
  return $response;
62
  }
124
  * @param object $all_sidebars Widget data.
125
  * @return object Set custom menu id by slug.
126
  */
127
+ public function custom_menu_widget( $all_sidebars ) {
128
 
129
  // Get current menu ID & Slugs.
130
  $menu_locations = array();
165
  public static function download_file( $file = '', $timeout_seconds = 300 ) {
166
 
167
  // Gives us access to the download_url() and wp_handle_sideload() functions.
168
+ require_once ABSPATH . 'wp-admin/includes/file.php';
169
 
170
  // Download file to temp dir.
171
  $temp_file = download_url( $file, $timeout_seconds );
236
  * @param string $file The image file path.
237
  * @return array An array of image data.
238
  */
239
+ public static function sideload_image( $file ) {
240
  $data = new stdClass();
241
 
242
  if ( ! function_exists( 'media_handle_sideload' ) ) {
243
+ require_once ABSPATH . 'wp-admin/includes/media.php';
244
+ require_once ABSPATH . 'wp-admin/includes/file.php';
245
+ require_once ABSPATH . 'wp-admin/includes/image.php';
246
  }
247
 
248
  if ( ! empty( $file ) ) {
289
  * @param string $string The string to check.
290
  * @return bool Whether the string is an image url or not.
291
  */
292
+ public static function is_image_url( $string = '' ) {
293
  if ( is_string( $string ) ) {
294
 
295
  if ( preg_match( '/\.(jpg|jpeg|svg|png|gif)/i', $string ) ) {
inc/importers/{class-widgets-importer.php → class-astra-widget-importer.php} RENAMED
@@ -2,16 +2,16 @@
2
  /**
3
  * Widget Data exporter class.
4
  *
5
- * @package Astra Addon
6
- * @see - https://wordpress.org/plugins/widget-importer-exporter/
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
  /**
12
  * Widget Data exporter class.
13
- *
14
- * @see - https://wordpress.org/plugins/widget-importer-exporter/
15
  */
16
  class Astra_Widget_Importer {
17
 
@@ -20,15 +20,20 @@ class Astra_Widget_Importer {
20
  *
21
  * @var Astra_Widget_Importer
22
  */
23
- private static $_instance = null;
24
 
 
 
 
 
 
25
  public static function instance() {
26
 
27
- if ( ! isset( self::$_instance ) ) {
28
- self::$_instance = new self;
29
  }
30
 
31
- return self::$_instance;
32
  }
33
 
34
  /**
@@ -41,7 +46,7 @@ class Astra_Widget_Importer {
41
  * @global array $wp_registered_widget_updates
42
  * @return array Widget information
43
  */
44
- function wie_available_widgets() {
45
 
46
  global $wp_registered_widget_controls;
47
 
@@ -51,7 +56,7 @@ class Astra_Widget_Importer {
51
 
52
  foreach ( $widget_controls as $widget ) {
53
 
54
- if ( ! empty( $widget['id_base'] ) && ! isset( $available_widgets[ $widget['id_base'] ] ) ) { // no dupes
55
 
56
  $available_widgets[ $widget['id_base'] ]['id_base'] = $widget['id_base'];
57
  $available_widgets[ $widget['id_base'] ]['name'] = $widget['name'];
@@ -68,16 +73,16 @@ class Astra_Widget_Importer {
68
  * @since 0.4
69
  * @global array $wp_registered_sidebars
70
  *
71
- * @param object $data JSON widget data from .wie file
72
  *
73
  * @return array Results array
74
  */
75
- function import_widgets_data( $data ) {
76
 
77
  global $wp_registered_sidebars;
78
 
79
  // Have valid data?
80
- // If no data or could not decode
81
  if ( empty( $data ) || ! is_object( $data ) ) {
82
  wp_die(
83
  esc_html__( 'Import data could not be read. Please try a different file.', 'astra-sites' ),
@@ -88,33 +93,33 @@ class Astra_Widget_Importer {
88
  );
89
  }
90
 
91
- // Hook before import
92
  do_action( 'wie_before_import' );
93
  $data = apply_filters( 'wie_import_data', $data );
94
 
95
- // Get all available widgets site supports
96
  $available_widgets = $this->wie_available_widgets();
97
 
98
- // Get all existing widget instances
99
  $widget_instances = array();
100
  foreach ( $available_widgets as $widget_data ) {
101
  $widget_instances[ $widget_data['id_base'] ] = get_option( 'widget_' . $widget_data['id_base'] );
102
  }
103
 
104
- // Begin results
105
  $results = array();
106
 
107
- // Loop import data's sidebars
108
  foreach ( $data as $sidebar_id => $widgets ) {
109
 
110
- // Skip inactive widgets
111
- // (should not be in export file)
112
- if ( 'wp_inactive_widgets' == $sidebar_id ) {
113
  continue;
114
  }
115
 
116
- // Check if sidebar is available on this site
117
- // Otherwise add widgets to inactive, and say so
118
  if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
119
  $sidebar_available = true;
120
  $use_sidebar_id = $sidebar_id;
@@ -122,23 +127,23 @@ class Astra_Widget_Importer {
122
  $sidebar_message = '';
123
  } else {
124
  $sidebar_available = false;
125
- $use_sidebar_id = 'wp_inactive_widgets'; // add to inactive if sidebar does not exist in theme
126
  $sidebar_message_type = 'error';
127
  $sidebar_message = esc_html__( 'Widget area does not exist in theme (using Inactive)', 'astra-sites' );
128
  }
129
 
130
- // Result for sidebar
131
- $results[ $sidebar_id ]['name'] = ! empty( $wp_registered_sidebars[ $sidebar_id ]['name'] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : $sidebar_id; // sidebar name if theme supports it; otherwise ID
132
  $results[ $sidebar_id ]['message_type'] = $sidebar_message_type;
133
  $results[ $sidebar_id ]['message'] = $sidebar_message;
134
  $results[ $sidebar_id ]['widgets'] = array();
135
 
136
- // Loop widgets
137
  foreach ( $widgets as $widget_instance_id => $widget ) {
138
 
139
  $fail = false;
140
 
141
- // Get id_base (remove -# from end) and instance ID number
142
  $id_base = preg_replace( '/-[0-9]+$/', '', $widget_instance_id );
143
  $instance_id_number = str_replace( $id_base . '-', '', $widget_instance_id );
144
 
@@ -146,43 +151,43 @@ class Astra_Widget_Importer {
146
  if ( ! $fail && ! isset( $available_widgets[ $id_base ] ) ) {
147
  $fail = true;
148
  $widget_message_type = 'error';
149
- $widget_message = esc_html__( 'Site does not support widget', 'astra-sites' ); // explain why widget not imported
150
  }
151
 
152
- // Filter to modify settings object before conversion to array and import
153
- // Leave this filter here for backwards compatibility with manipulating objects (before conversion to array below)
154
- // Ideally the newer wie_widget_settings_array below will be used instead of this
155
- $widget = apply_filters( 'wie_widget_settings', $widget ); // object
156
 
157
  // Convert multidimensional objects to multidimensional arrays
158
  // Some plugins like Jetpack Widget Visibility store settings as multidimensional arrays
159
  // Without this, they are imported as objects and cause fatal error on Widgets page
160
  // If this creates problems for plugins that do actually intend settings in objects then may need to consider other approach: https://wordpress.org/support/topic/problem-with-array-of-arrays
161
- // It is probably much more likely that arrays are used than objects, however
162
  $widget = json_decode( wp_json_encode( $widget ), true );
163
 
164
  // Filter to modify settings array
165
- // This is preferred over the older wie_widget_settings filter above
166
- // Do before identical check because changes may make it identical to end result (such as URL replacements)
167
  $widget = apply_filters( 'wie_widget_settings_array', $widget );
168
 
169
  // Does widget with identical settings already exist in same sidebar?
170
  if ( ! $fail && isset( $widget_instances[ $id_base ] ) ) {
171
 
172
- // Get existing widgets in this sidebar
173
  $sidebars_widgets = get_option( 'sidebars_widgets' );
174
- $sidebar_widgets = isset( $sidebars_widgets[ $use_sidebar_id ] ) ? $sidebars_widgets[ $use_sidebar_id ] : array(); // check Inactive if that's where will go
175
 
176
- // Loop widgets with ID base
177
  $single_widget_instances = ! empty( $widget_instances[ $id_base ] ) ? $widget_instances[ $id_base ] : array();
178
  foreach ( $single_widget_instances as $check_id => $check_widget ) {
179
 
180
  // Is widget in same sidebar and has identical settings?
181
- if ( in_array( "$id_base-$check_id", $sidebar_widgets ) && (array) $widget == $check_widget ) {
182
 
183
  $fail = true;
184
  $widget_message_type = 'warning';
185
- $widget_message = esc_html__( 'Widget already exists', 'astra-sites' ); // explain why widget not imported
186
 
187
  break;
188
 
@@ -190,52 +195,52 @@ class Astra_Widget_Importer {
190
  }
191
  }
192
 
193
- // No failure
194
  if ( ! $fail ) {
195
 
196
- // Add widget instance
197
- $single_widget_instances = get_option( 'widget_' . $id_base ); // all instances for that widget ID base, get fresh every time
198
  $single_widget_instances = ! empty( $single_widget_instances ) ? $single_widget_instances : array(
199
  '_multiwidget' => 1,
200
- ); // start fresh if have to
201
- $single_widget_instances[] = $widget; // add it
202
 
203
- // Get the key it was given
204
  end( $single_widget_instances );
205
  $new_instance_id_number = key( $single_widget_instances );
206
 
207
- // If key is 0, make it 1
208
- // When 0, an issue can occur where adding a widget causes data from other widget to load, and the widget doesn't stick (reload wipes it)
209
  if ( '0' === strval( $new_instance_id_number ) ) {
210
  $new_instance_id_number = 1;
211
  $single_widget_instances[ $new_instance_id_number ] = $single_widget_instances[0];
212
  unset( $single_widget_instances[0] );
213
  }
214
 
215
- // Move _multiwidget to end of array for uniformity
216
  if ( isset( $single_widget_instances['_multiwidget'] ) ) {
217
  $multiwidget = $single_widget_instances['_multiwidget'];
218
  unset( $single_widget_instances['_multiwidget'] );
219
  $single_widget_instances['_multiwidget'] = $multiwidget;
220
  }
221
 
222
- // Update option with new widget
223
  $result = update_option( 'widget_' . $id_base, $single_widget_instances );
224
 
225
- // Assign widget instance to sidebar
226
- $sidebars_widgets = get_option( 'sidebars_widgets' ); // which sidebars have which widgets, get fresh every time
227
 
228
- // Avoid rarely fatal error when the option is an empty string
229
- // https://github.com/churchthemes/widget-importer-exporter/pull/11
230
  if ( ! $sidebars_widgets ) {
231
  $sidebars_widgets = array();
232
  }
233
 
234
- $new_instance_id = $id_base . '-' . $new_instance_id_number; // use ID number from new widget instance
235
- $sidebars_widgets[ $use_sidebar_id ][] = $new_instance_id; // add new instance to sidebar
236
- update_option( 'sidebars_widgets', $sidebars_widgets ); // save the amended data
237
 
238
- // After widget import action
239
  $after_widget_import = array(
240
  'sidebar' => $use_sidebar_id,
241
  'sidebar_old' => $sidebar_id,
@@ -248,7 +253,7 @@ class Astra_Widget_Importer {
248
  );
249
  do_action( 'wie_after_widget_import', $after_widget_import );
250
 
251
- // Success message
252
  if ( $sidebar_available ) {
253
  $widget_message_type = 'success';
254
  $widget_message = esc_html__( 'Imported', 'astra-sites' );
@@ -256,21 +261,21 @@ class Astra_Widget_Importer {
256
  $widget_message_type = 'warning';
257
  $widget_message = esc_html__( 'Imported to Inactive', 'astra-sites' );
258
  }
259
- }// End if().
260
 
261
- // Result for widget instance
262
- $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['name'] = isset( $available_widgets[ $id_base ]['name'] ) ? $available_widgets[ $id_base ]['name'] : $id_base; // widget name or ID if name not available (not supported by site)
263
- $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['title'] = ! empty( $widget['title'] ) ? $widget['title'] : esc_html__( 'No Title', 'astra-sites' ); // show "No Title" if widget instance is untitled
264
  $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message_type'] = $widget_message_type;
265
  $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message'] = $widget_message;
266
 
267
- }// End foreach().
268
- }// End foreach().
269
 
270
- // Hook after import
271
  do_action( 'wie_after_import' );
272
 
273
- // Return results
274
  return apply_filters( 'wie_import_results', $results );
275
 
276
  }
2
  /**
3
  * Widget Data exporter class.
4
  *
5
+ * @since 2.0.0
6
+ * @package Astra Sites
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit; // Exit if accessed directly.
11
+ }
12
 
13
  /**
14
  * Widget Data exporter class.
 
 
15
  */
16
  class Astra_Widget_Importer {
17
 
20
  *
21
  * @var Astra_Widget_Importer
22
  */
23
+ private static $instance = null;
24
 
25
+ /**
26
+ * Instance
27
+ *
28
+ * @return object
29
+ */
30
  public static function instance() {
31
 
32
+ if ( ! isset( self::$instance ) ) {
33
+ self::$instance = new self();
34
  }
35
 
36
+ return self::$instance;
37
  }
38
 
39
  /**
46
  * @global array $wp_registered_widget_updates
47
  * @return array Widget information
48
  */
49
+ public function wie_available_widgets() {
50
 
51
  global $wp_registered_widget_controls;
52
 
56
 
57
  foreach ( $widget_controls as $widget ) {
58
 
59
+ if ( ! empty( $widget['id_base'] ) && ! isset( $available_widgets[ $widget['id_base'] ] ) ) { // no dupes.
60
 
61
  $available_widgets[ $widget['id_base'] ]['id_base'] = $widget['id_base'];
62
  $available_widgets[ $widget['id_base'] ]['name'] = $widget['name'];
73
  * @since 0.4
74
  * @global array $wp_registered_sidebars
75
  *
76
+ * @param object $data JSON widget data from .wie file.
77
  *
78
  * @return array Results array
79
  */
80
+ public function import_widgets_data( $data ) {
81
 
82
  global $wp_registered_sidebars;
83
 
84
  // Have valid data?
85
+ // If no data or could not decode.
86
  if ( empty( $data ) || ! is_object( $data ) ) {
87
  wp_die(
88
  esc_html__( 'Import data could not be read. Please try a different file.', 'astra-sites' ),
93
  );
94
  }
95
 
96
+ // Hook before import.
97
  do_action( 'wie_before_import' );
98
  $data = apply_filters( 'wie_import_data', $data );
99
 
100
+ // Get all available widgets site supports.
101
  $available_widgets = $this->wie_available_widgets();
102
 
103
+ // Get all existing widget instances.
104
  $widget_instances = array();
105
  foreach ( $available_widgets as $widget_data ) {
106
  $widget_instances[ $widget_data['id_base'] ] = get_option( 'widget_' . $widget_data['id_base'] );
107
  }
108
 
109
+ // Begin results.
110
  $results = array();
111
 
112
+ // Loop import data's sidebars.
113
  foreach ( $data as $sidebar_id => $widgets ) {
114
 
115
+ // Skip inactive widgets.
116
+ // (should not be in export file).
117
+ if ( 'wp_inactive_widgets' === $sidebar_id ) {
118
  continue;
119
  }
120
 
121
+ // Check if sidebar is available on this site.
122
+ // Otherwise add widgets to inactive, and say so.
123
  if ( isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
124
  $sidebar_available = true;
125
  $use_sidebar_id = $sidebar_id;
127
  $sidebar_message = '';
128
  } else {
129
  $sidebar_available = false;
130
+ $use_sidebar_id = 'wp_inactive_widgets'; // add to inactive if sidebar does not exist in theme.
131
  $sidebar_message_type = 'error';
132
  $sidebar_message = esc_html__( 'Widget area does not exist in theme (using Inactive)', 'astra-sites' );
133
  }
134
 
135
+ // Result for sidebar.
136
+ $results[ $sidebar_id ]['name'] = ! empty( $wp_registered_sidebars[ $sidebar_id ]['name'] ) ? $wp_registered_sidebars[ $sidebar_id ]['name'] : $sidebar_id; // sidebar name if theme supports it; otherwise ID.
137
  $results[ $sidebar_id ]['message_type'] = $sidebar_message_type;
138
  $results[ $sidebar_id ]['message'] = $sidebar_message;
139
  $results[ $sidebar_id ]['widgets'] = array();
140
 
141
+ // Loop widgets.
142
  foreach ( $widgets as $widget_instance_id => $widget ) {
143
 
144
  $fail = false;
145
 
146
+ // Get id_base (remove -# from end) and instance ID number.
147
  $id_base = preg_replace( '/-[0-9]+$/', '', $widget_instance_id );
148
  $instance_id_number = str_replace( $id_base . '-', '', $widget_instance_id );
149
 
151
  if ( ! $fail && ! isset( $available_widgets[ $id_base ] ) ) {
152
  $fail = true;
153
  $widget_message_type = 'error';
154
+ $widget_message = esc_html__( 'Site does not support widget', 'astra-sites' ); // explain why widget not imported.
155
  }
156
 
157
+ // Filter to modify settings object before conversion to array and import.
158
+ // Leave this filter here for backwards compatibility with manipulating objects (before conversion to array below).
159
+ // Ideally the newer wie_widget_settings_array below will be used instead of this.
160
+ $widget = apply_filters( 'wie_widget_settings', $widget ); // object.
161
 
162
  // Convert multidimensional objects to multidimensional arrays
163
  // Some plugins like Jetpack Widget Visibility store settings as multidimensional arrays
164
  // Without this, they are imported as objects and cause fatal error on Widgets page
165
  // If this creates problems for plugins that do actually intend settings in objects then may need to consider other approach: https://wordpress.org/support/topic/problem-with-array-of-arrays
166
+ // It is probably much more likely that arrays are used than objects, however.
167
  $widget = json_decode( wp_json_encode( $widget ), true );
168
 
169
  // Filter to modify settings array
170
+ // This is preferred over the older wie_widget_settings filter above.
171
+ // Do before identical check because changes may make it identical to end result (such as URL replacements).
172
  $widget = apply_filters( 'wie_widget_settings_array', $widget );
173
 
174
  // Does widget with identical settings already exist in same sidebar?
175
  if ( ! $fail && isset( $widget_instances[ $id_base ] ) ) {
176
 
177
+ // Get existing widgets in this sidebar.
178
  $sidebars_widgets = get_option( 'sidebars_widgets' );
179
+ $sidebar_widgets = isset( $sidebars_widgets[ $use_sidebar_id ] ) ? $sidebars_widgets[ $use_sidebar_id ] : array(); // check Inactive if that's where will go.
180
 
181
+ // Loop widgets with ID base.
182
  $single_widget_instances = ! empty( $widget_instances[ $id_base ] ) ? $widget_instances[ $id_base ] : array();
183
  foreach ( $single_widget_instances as $check_id => $check_widget ) {
184
 
185
  // Is widget in same sidebar and has identical settings?
186
+ if ( in_array( "$id_base-$check_id", $sidebar_widgets, true ) && (array) $widget === $check_widget ) {
187
 
188
  $fail = true;
189
  $widget_message_type = 'warning';
190
+ $widget_message = esc_html__( 'Widget already exists', 'astra-sites' ); // explain why widget not imported.
191
 
192
  break;
193
 
195
  }
196
  }
197
 
198
+ // No failure.
199
  if ( ! $fail ) {
200
 
201
+ // Add widget instance.
202
+ $single_widget_instances = get_option( 'widget_' . $id_base ); // all instances for that widget ID base, get fresh every time.
203
  $single_widget_instances = ! empty( $single_widget_instances ) ? $single_widget_instances : array(
204
  '_multiwidget' => 1,
205
+ ); // start fresh if have to.
206
+ $single_widget_instances[] = $widget; // add it.
207
 
208
+ // Get the key it was given.
209
  end( $single_widget_instances );
210
  $new_instance_id_number = key( $single_widget_instances );
211
 
212
+ // If key is 0, make it 1.
213
+ // When 0, an issue can occur where adding a widget causes data from other widget to load, and the widget doesn't stick (reload wipes it).
214
  if ( '0' === strval( $new_instance_id_number ) ) {
215
  $new_instance_id_number = 1;
216
  $single_widget_instances[ $new_instance_id_number ] = $single_widget_instances[0];
217
  unset( $single_widget_instances[0] );
218
  }
219
 
220
+ // Move _multiwidget to end of array for uniformity.
221
  if ( isset( $single_widget_instances['_multiwidget'] ) ) {
222
  $multiwidget = $single_widget_instances['_multiwidget'];
223
  unset( $single_widget_instances['_multiwidget'] );
224
  $single_widget_instances['_multiwidget'] = $multiwidget;
225
  }
226
 
227
+ // Update option with new widget.
228
  $result = update_option( 'widget_' . $id_base, $single_widget_instances );
229
 
230
+ // Assign widget instance to sidebar.
231
+ $sidebars_widgets = get_option( 'sidebars_widgets' ); // which sidebars have which widgets, get fresh every time.
232
 
233
+ // Avoid rarely fatal error when the option is an empty string.
234
+ // https://github.com/churchthemes/widget-importer-exporter/pull/11.
235
  if ( ! $sidebars_widgets ) {
236
  $sidebars_widgets = array();
237
  }
238
 
239
+ $new_instance_id = $id_base . '-' . $new_instance_id_number; // use ID number from new widget instance.
240
+ $sidebars_widgets[ $use_sidebar_id ][] = $new_instance_id; // add new instance to sidebar.
241
+ update_option( 'sidebars_widgets', $sidebars_widgets ); // save the amended data.
242
 
243
+ // After widget import action.
244
  $after_widget_import = array(
245
  'sidebar' => $use_sidebar_id,
246
  'sidebar_old' => $sidebar_id,
253
  );
254
  do_action( 'wie_after_widget_import', $after_widget_import );
255
 
256
+ // Success message.
257
  if ( $sidebar_available ) {
258
  $widget_message_type = 'success';
259
  $widget_message = esc_html__( 'Imported', 'astra-sites' );
261
  $widget_message_type = 'warning';
262
  $widget_message = esc_html__( 'Imported to Inactive', 'astra-sites' );
263
  }
264
+ }
265
 
266
+ // Result for widget instance.
267
+ $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['name'] = isset( $available_widgets[ $id_base ]['name'] ) ? $available_widgets[ $id_base ]['name'] : $id_base; // widget name or ID if name not available (not supported by site).
268
+ $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['title'] = ! empty( $widget['title'] ) ? $widget['title'] : esc_html__( 'No Title', 'astra-sites' ); // show "No Title" if widget instance is untitled.
269
  $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message_type'] = $widget_message_type;
270
  $results[ $sidebar_id ]['widgets'][ $widget_instance_id ]['message'] = $widget_message;
271
 
272
+ }
273
+ }
274
 
275
+ // Hook after import.
276
  do_action( 'wie_after_import' );
277
 
278
+ // Return results.
279
  return apply_filters( 'wie_import_results', $results );
280
 
281
  }
inc/importers/wxr-importer/class-astra-wxr-importer.php CHANGED
@@ -6,7 +6,9 @@
6
  * @package Astra Addon
7
  */
8
 
9
- defined( 'ABSPATH' ) or exit;
 
 
10
 
11
  /**
12
  * Class Astra WXR Importer
@@ -21,7 +23,7 @@ class Astra_WXR_Importer {
21
  * @since 1.0.0
22
  * @var Astra_WXR_Importer
23
  */
24
- private static $_instance = null;
25
 
26
  /**
27
  * Instantiate Astra_WXR_Importer
@@ -30,11 +32,11 @@ class Astra_WXR_Importer {
30
  * @return (Object) Astra_WXR_Importer.
31
  */
32
  public static function instance() {
33
- if ( ! isset( self::$_instance ) ) {
34
- self::$_instance = new self();
35
  }
36
 
37
- return self::$_instance;
38
  }
39
 
40
  /**
@@ -45,7 +47,7 @@ class Astra_WXR_Importer {
45
  private function __construct() {
46
 
47
  require_once ABSPATH . '/wp-admin/includes/class-wp-importer.php';
48
- require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-logger.php';
49
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php';
50
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-importer.php';
51
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-import-info.php';
@@ -54,7 +56,6 @@ class Astra_WXR_Importer {
54
  add_action( 'wp_ajax_astra-wxr-import', array( $this, 'sse_import' ) );
55
  add_filter( 'wxr_importer.pre_process.user', '__return_null' );
56
  add_filter( 'wxr_importer.pre_process.post', array( $this, 'gutenberg_content_fix' ), 10, 4 );
57
-
58
  if ( version_compare( get_bloginfo( 'version' ), '5.1.0', '>=' ) ) {
59
  add_filter( 'wp_check_filetype_and_ext', array( $this, 'real_mime_types_5_1_0' ), 10, 5 );
60
  } else {
@@ -66,12 +67,31 @@ class Astra_WXR_Importer {
66
  /**
67
  * Track Imported Post
68
  *
69
- * @param int $post_id Post ID.
 
70
  * @return void
71
  */
72
- function track_post( $post_id ) {
73
  Astra_Sites_Importer_Log::add( 'Inserted - Post ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id ) );
 
74
  update_post_meta( $post_id, '_astra_sites_imported_post', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
76
 
77
  /**
@@ -80,10 +100,10 @@ class Astra_WXR_Importer {
80
  * @param int $term_id Term ID.
81
  * @return void
82
  */
83
- function track_term( $term_id ) {
84
  $term = get_term( $term_id );
85
  if ( $term ) {
86
- Astra_Sites_Importer_Log::add( 'Inserted - Term ' . $term_id . ' - ' . json_encode( $term ) );
87
  }
88
  update_term_meta( $term_id, '_astra_sites_imported_term', true );
89
  }
@@ -104,7 +124,7 @@ class Astra_WXR_Importer {
104
  * @param array $comments Comments on the post.
105
  * @param array $terms Terms on the post.
106
  */
107
- function gutenberg_content_fix( $data, $meta, $comments, $terms ) {
108
  if ( isset( $data['post_content'] ) ) {
109
  $data['post_content'] = wp_slash( $data['post_content'] );
110
  }
@@ -126,7 +146,7 @@ class Astra_WXR_Importer {
126
  * @param array $mimes Key is the file extension with value as the mime type.
127
  * @param string $real_mime Real MIME type of the uploaded file.
128
  */
129
- function real_mime_types_5_1_0( $defaults, $file, $filename, $mimes, $real_mime ) {
130
  return $this->real_mimes( $defaults, $filename );
131
  }
132
 
@@ -144,7 +164,7 @@ class Astra_WXR_Importer {
144
  * $file being in a tmp directory).
145
  * @param array $mimes Key is the file extension with value as the mime type.
146
  */
147
- function real_mime_types( $defaults, $file, $filename, $mimes ) {
148
  return $this->real_mimes( $defaults, $filename );
149
  }
150
 
@@ -158,16 +178,16 @@ class Astra_WXR_Importer {
158
  * @param string $filename The name of the file (may differ from $file due to
159
  * $file being in a tmp directory).
160
  */
161
- function real_mimes( $defaults, $filename ) {
162
 
163
  // Set EXT and real MIME type only for the file name `wxr.xml`.
164
- if ( 'wxr.xml' === $filename ) {
165
  $defaults['ext'] = 'xml';
166
  $defaults['type'] = 'text/xml';
167
  }
168
 
169
- // Set EXT and real MIME type only for the file name `wpforms.json`.
170
- if ( 'wpforms.json' === $filename ) {
171
  $defaults['ext'] = 'json';
172
  $defaults['type'] = 'text/plain';
173
  }
@@ -175,6 +195,22 @@ class Astra_WXR_Importer {
175
  return $defaults;
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  /**
179
  * Constructor.
180
  *
@@ -183,16 +219,16 @@ class Astra_WXR_Importer {
183
  *
184
  * @param string $xml_url XML file URL.
185
  */
186
- function sse_import( $xml_url = '' ) {
187
 
188
  if ( ! defined( 'WP_CLI' ) ) {
189
 
190
  // Verify Nonce.
191
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
192
 
 
193
  // Start the event stream.
194
  header( 'Content-Type: text/event-stream, charset=UTF-8' );
195
-
196
  // Turn off PHP output compression.
197
  $previous = error_reporting( error_reporting() ^ E_WARNING );
198
  ini_set( 'output_buffering', 'off' );
@@ -205,9 +241,10 @@ class Astra_WXR_Importer {
205
  header( 'X-Accel-Buffering: no' );
206
  header( 'Content-Encoding: none' );
207
  }
 
208
 
209
- // 2KB padding for IE
210
- echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
211
  }
212
 
213
  $xml_url = isset( $_REQUEST['xml_url'] ) ? urldecode( $_REQUEST['xml_url'] ) : urldecode( $xml_url );
@@ -224,6 +261,9 @@ class Astra_WXR_Importer {
224
  flush();
225
  }
226
 
 
 
 
227
  // Are we allowed to create users?
228
  add_filter( 'wxr_importer.pre_process.user', '__return_null' );
229
 
@@ -241,7 +281,7 @@ class Astra_WXR_Importer {
241
  add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
242
 
243
  // Keep track of our progress.
244
- add_action( 'wxr_importer.processed.post', array( $this, 'track_post' ) );
245
  add_action( 'wxr_importer.processed.term', array( $this, 'track_term' ) );
246
 
247
  // Flush once more.
@@ -329,7 +369,7 @@ class Astra_WXR_Importer {
329
  * @param string $url Downloaded XML file absolute URL.
330
  * @return array XML file data.
331
  */
332
- function get_data( $url ) {
333
  $importer = $this->get_importer();
334
  $data = $importer->get_preliminary_information( $url );
335
  if ( is_wp_error( $data ) ) {
@@ -451,7 +491,7 @@ class Astra_WXR_Importer {
451
  echo 'data: ' . wp_json_encode( $data ) . "\n\n";
452
 
453
  // Extra padding.
454
- echo ':' . str_repeat( ' ', 2048 ) . "\n\n";
455
  }
456
 
457
  flush();
6
  * @package Astra Addon
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit; // Exit if accessed directly.
11
+ }
12
 
13
  /**
14
  * Class Astra WXR Importer
23
  * @since 1.0.0
24
  * @var Astra_WXR_Importer
25
  */
26
+ private static $instance = null;
27
 
28
  /**
29
  * Instantiate Astra_WXR_Importer
32
  * @return (Object) Astra_WXR_Importer.
33
  */
34
  public static function instance() {
35
+ if ( ! isset( self::$instance ) ) {
36
+ self::$instance = new self();
37
  }
38
 
39
+ return self::$instance;
40
  }
41
 
42
  /**
47
  private function __construct() {
48
 
49
  require_once ABSPATH . '/wp-admin/includes/class-wp-importer.php';
50
+ require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wp-importer-logger.php';
51
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php';
52
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-importer.php';
53
  require_once ASTRA_SITES_DIR . 'inc/importers/wxr-importer/class-wxr-import-info.php';
56
  add_action( 'wp_ajax_astra-wxr-import', array( $this, 'sse_import' ) );
57
  add_filter( 'wxr_importer.pre_process.user', '__return_null' );
58
  add_filter( 'wxr_importer.pre_process.post', array( $this, 'gutenberg_content_fix' ), 10, 4 );
 
59
  if ( version_compare( get_bloginfo( 'version' ), '5.1.0', '>=' ) ) {
60
  add_filter( 'wp_check_filetype_and_ext', array( $this, 'real_mime_types_5_1_0' ), 10, 5 );
61
  } else {
67
  /**
68
  * Track Imported Post
69
  *
70
+ * @param int $post_id Post ID.
71
+ * @param array $data Raw data imported for the post.
72
  * @return void
73
  */
74
+ public function track_post( $post_id = 0, $data = array() ) {
75
  Astra_Sites_Importer_Log::add( 'Inserted - Post ' . $post_id . ' - ' . get_post_type( $post_id ) . ' - ' . get_the_title( $post_id ) );
76
+
77
  update_post_meta( $post_id, '_astra_sites_imported_post', true );
78
+
79
+ // Set the full width template for the pages.
80
+ if ( isset( $data['post_type'] ) && 'page' === $data['post_type'] ) {
81
+ $is_elementor_page = get_post_meta( $post_id, '_elementor_version', true );
82
+ $theme_status = Astra_Sites::get_instance()->get_theme_status();
83
+ if ( 'installed-and-active' !== $theme_status && $is_elementor_page ) {
84
+ update_post_meta( $post_id, '_wp_page_template', 'elementor_header_footer' );
85
+ }
86
+ } elseif ( isset( $data['post_type'] ) && 'attachment' === $data['post_type'] ) {
87
+ $remote_url = isset( $data['guid'] ) ? $data['guid'] : '';
88
+ $attachment_hash_url = Astra_Sites_Image_Importer::get_instance()->get_hash_image( $remote_url );
89
+ if ( ! empty( $attachment_hash_url ) ) {
90
+ update_post_meta( $post_id, '_astra_sites_image_hash', $attachment_hash_url );
91
+ update_post_meta( $post_id, '_elementor_source_image_hash', $attachment_hash_url );
92
+ }
93
+ }
94
+
95
  }
96
 
97
  /**
100
  * @param int $term_id Term ID.
101
  * @return void
102
  */
103
+ public function track_term( $term_id ) {
104
  $term = get_term( $term_id );
105
  if ( $term ) {
106
+ Astra_Sites_Importer_Log::add( 'Inserted - Term ' . $term_id . ' - ' . wp_json_encode( $term ) );
107
  }
108
  update_term_meta( $term_id, '_astra_sites_imported_term', true );
109
  }
124
  * @param array $comments Comments on the post.
125
  * @param array $terms Terms on the post.
126
  */
127
+ public function gutenberg_content_fix( $data, $meta, $comments, $terms ) {
128
  if ( isset( $data['post_content'] ) ) {
129
  $data['post_content'] = wp_slash( $data['post_content'] );
130
  }
146
  * @param array $mimes Key is the file extension with value as the mime type.
147
  * @param string $real_mime Real MIME type of the uploaded file.
148
  */
149
+ public function real_mime_types_5_1_0( $defaults, $file, $filename, $mimes, $real_mime ) {
150
  return $this->real_mimes( $defaults, $filename );
151
  }
152
 
164
  * $file being in a tmp directory).
165
  * @param array $mimes Key is the file extension with value as the mime type.
166
  */
167
+ public function real_mime_types( $defaults, $file, $filename, $mimes ) {
168
  return $this->real_mimes( $defaults, $filename );
169
  }
170
 
178
  * @param string $filename The name of the file (may differ from $file due to
179
  * $file being in a tmp directory).
180
  */
181
+ public function real_mimes( $defaults, $filename ) {
182
 
183
  // Set EXT and real MIME type only for the file name `wxr.xml`.
184
+ if ( strpos( $filename, 'wxr' ) !== false ) {
185
  $defaults['ext'] = 'xml';
186
  $defaults['type'] = 'text/xml';
187
  }
188
 
189
+ // Set EXT and real MIME type only for the file name `wpforms.json` or `wpforms-{page-id}.json`.
190
+ if ( strpos( $filename, 'wpforms' ) !== false ) {
191
  $defaults['ext'] = 'json';
192
  $defaults['type'] = 'text/plain';
193
  }
195
  return $defaults;
196
  }
197
 
198
+ /**
199
+ * Set GUID as per the attachment URL which avoid duplicate images issue due to the different GUID.
200
+ *
201
+ * @param array $data Post data. (Return empty to skip).
202
+ * @param array $meta Meta data.
203
+ * @param array $comments Comments on the post.
204
+ * @param array $terms Terms on the post.
205
+ */
206
+ public function fix_image_duplicate_issue( $data, $meta, $comments, $terms ) {
207
+
208
+ $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid'];
209
+ $data['guid'] = $remote_url;
210
+
211
+ return $data;
212
+ }
213
+
214
  /**
215
  * Constructor.
216
  *
219
  *
220
  * @param string $xml_url XML file URL.
221
  */
222
+ public function sse_import( $xml_url = '' ) {
223
 
224
  if ( ! defined( 'WP_CLI' ) ) {
225
 
226
  // Verify Nonce.
227
  check_ajax_referer( 'astra-sites', '_ajax_nonce' );
228
 
229
+ // @codingStandardsIgnoreStart
230
  // Start the event stream.
231
  header( 'Content-Type: text/event-stream, charset=UTF-8' );
 
232
  // Turn off PHP output compression.
233
  $previous = error_reporting( error_reporting() ^ E_WARNING );
234
  ini_set( 'output_buffering', 'off' );
241
  header( 'X-Accel-Buffering: no' );
242
  header( 'Content-Encoding: none' );
243
  }
244
+ // @codingStandardsIgnoreEnd
245
 
246
+ // 2KB padding for IE.
247
+ echo esc_html( ':' . str_repeat( ' ', 2048 ) . "\n\n" );
248
  }
249
 
250
  $xml_url = isset( $_REQUEST['xml_url'] ) ? urldecode( $_REQUEST['xml_url'] ) : urldecode( $xml_url );
261
  flush();
262
  }
263
 
264
+ // Change GUID image URL.
265
+ add_filter( 'wxr_importer.pre_process.post', array( $this, 'fix_image_duplicate_issue' ), 10, 4 );
266
+
267
  // Are we allowed to create users?
268
  add_filter( 'wxr_importer.pre_process.user', '__return_null' );
269
 
281
  add_action( 'wxr_importer.process_failed.user', array( $this, 'imported_user' ) );
282
 
283
  // Keep track of our progress.
284
+ add_action( 'wxr_importer.processed.post', array( $this, 'track_post' ), 10, 2 );
285
  add_action( 'wxr_importer.processed.term', array( $this, 'track_term' ) );
286
 
287
  // Flush once more.
369
  * @param string $url Downloaded XML file absolute URL.
370
  * @return array XML file data.
371
  */
372
+ public function get_data( $url ) {
373
  $importer = $this->get_importer();
374
  $data = $importer->get_preliminary_information( $url );
375
  if ( is_wp_error( $data ) ) {
491
  echo 'data: ' . wp_json_encode( $data ) . "\n\n";
492
 
493
  // Extra padding.
494
+ echo esc_html( ':' . str_repeat( ' ', 2048 ) . "\n\n" );
495
  }
496
 
497
  flush();
inc/importers/wxr-importer/class-wp-importer-logger-serversentevents.php CHANGED
@@ -1,16 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
2
 
3
  if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) && class_exists( 'WP_Importer_Logger' ) ) {
4
 
 
 
 
 
 
5
  class WP_Importer_Logger_ServerSentEvents extends WP_Importer_Logger {
6
 
7
  /**
8
  * Logs with an arbitrary level.
9
  *
10
- * @param mixed $level
11
- * @param string $message
12
- * @param array $context
13
- * @return null
14
  */
15
  public function log( $level, $message, array $context = array() ) {
16
 
@@ -24,8 +36,8 @@ if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) && class_exists( 'W
24
  case 'warning':
25
  case 'notice':
26
  case 'info':
27
- if( defined( 'WP_CLI' ) ) {
28
- if( isset( $data['message'] ) && ! empty( $data['message'] ) ) {
29
  WP_CLI::line( $data['message'] );
30
  } else {
31
  WP_CLI::line( wp_json_encode( $data ) );
@@ -39,8 +51,8 @@ if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) && class_exists( 'W
39
 
40
  case 'debug':
41
  if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
42
- if( defined( 'WP_CLI' ) ) {
43
- if( isset( $data['message'] ) && ! empty( $data['message'] ) ) {
44
  WP_CLI::line( $data['message'] );
45
  } else {
46
  WP_CLI::line( wp_json_encode( $data ) );
1
  <?php
2
+ /**
3
+ * Import Log ServerSendEvents
4
+ *
5
+ * @since 2.0.0
6
+ *
7
+ * @package Astra Sites
8
+ */
9
 
10
  if ( ! class_exists( 'WP_Importer_Logger_ServerSentEvents' ) && class_exists( 'WP_Importer_Logger' ) ) {
11
 
12
+ /**
13
+ * Import Log ServerSendEvents
14
+ *
15
+ * @since 2.0.0
16
+ */
17
  class WP_Importer_Logger_ServerSentEvents extends WP_Importer_Logger {
18
 
19
  /**
20
  * Logs with an arbitrary level.
21
  *
22
+ * @param mixed $level Log level.
23
+ * @param string $message Log message.
24
+ * @param array $context Log context.
25
+ * @return void
26
  */
27
  public function log( $level, $message, array $context = array() ) {
28
 
36
  case 'warning':
37
  case 'notice':
38
  case 'info':
39
+ if ( defined( 'WP_CLI' ) ) {
40
+ if ( isset( $data['message'] ) && ! empty( $data['message'] ) ) {
41
  WP_CLI::line( $data['message'] );
42
  } else {
43
  WP_CLI::line( wp_json_encode( $data ) );
51
 
52
  case 'debug':
53
  if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {
54
+ if ( defined( 'WP_CLI' ) ) {
55
+ if ( isset( $data['message'] ) && ! empty( $data['message'] ) ) {
56
  WP_CLI::line( $data['message'] );
57
  } else {
58
  WP_CLI::line( wp_json_encode( $data ) );
inc/importers/wxr-importer/{class-logger.php → class-wp-importer-logger.php} RENAMED
@@ -1,6 +1,9 @@
1
  <?php
2
-
3
  /**
 
 
 
 
4
  * Describes a logger instance
5
  *
6
  * Based on PSR-3: http://www.php-fig.org/psr/psr-3/
@@ -17,13 +20,19 @@
17
  * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
18
  * for the full interface specification.
19
  */
20
- if( ! class_exists( 'WP_Importer_Logger' ) ) :
 
 
 
 
 
21
  class WP_Importer_Logger {
 
22
  /**
23
  * System is unusable.
24
  *
25
- * @param string $message
26
- * @param array $context
27
  * @return null
28
  */
29
  public function emergency( $message, array $context = array() ) {
@@ -36,8 +45,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
36
  * Example: Entire website down, database unavailable, etc. This should
37
  * trigger the SMS alerts and wake you up.
38
  *
39
- * @param string $message
40
- * @param array $context
41
  * @return null
42
  */
43
  public function alert( $message, array $context = array() ) {
@@ -49,8 +58,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
49
  *
50
  * Example: Application component unavailable, unexpected exception.
51
  *
52
- * @param string $message
53
- * @param array $context
54
  * @return null
55
  */
56
  public function critical( $message, array $context = array() ) {
@@ -61,8 +70,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
61
  * Runtime errors that do not require immediate action but should typically
62
  * be logged and monitored.
63
  *
64
- * @param string $message
65
- * @param array $context
66
  * @return null
67
  */
68
  public function error( $message, array $context = array() ) {
@@ -75,8 +84,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
75
  * Example: Use of deprecated APIs, poor use of an API, undesirable things
76
  * that are not necessarily wrong.
77
  *
78
- * @param string $message
79
- * @param array $context
80
  * @return null
81
  */
82
  public function warning( $message, array $context = array() ) {
@@ -86,8 +95,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
86
  /**
87
  * Normal but significant events.
88
  *
89
- * @param string $message
90
- * @param array $context
91
  * @return null
92
  */
93
  public function notice( $message, array $context = array() ) {
@@ -99,8 +108,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
99
  *
100
  * Example: User logs in, SQL logs.
101
  *
102
- * @param string $message
103
- * @param array $context
104
  * @return null
105
  */
106
  public function info( $message, array $context = array() ) {
@@ -110,8 +119,8 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
110
  /**
111
  * Detailed debug information.
112
  *
113
- * @param string $message
114
- * @param array $context
115
  * @return null
116
  */
117
  public function debug( $message, array $context = array() ) {
@@ -121,10 +130,10 @@ if( ! class_exists( 'WP_Importer_Logger' ) ) :
121
  /**
122
  * Logs with an arbitrary level.
123
  *
124
- * @param mixed $level
125
- * @param string $message
126
- * @param array $context
127
- * @return null
128
  */
129
  public function log( $level, $message, array $context = array() ) {
130
 
1
  <?php
 
2
  /**
3
+ * WordPress Importer
4
+ *
5
+ * @package WordPress Importer
6
+ *
7
  * Describes a logger instance
8
  *
9
  * Based on PSR-3: http://www.php-fig.org/psr/psr-3/
20
  * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
21
  * for the full interface specification.
22
  */
23
+
24
+ if ( ! class_exists( 'WP_Importer_Logger' ) ) :
25
+
26
+ /**
27
+ * WP Importer Log
28
+ */
29
  class WP_Importer_Logger {
30
+
31
  /**
32
  * System is unusable.
33
  *
34
+ * @param string $message Error message.
35
+ * @param array $context Error context.
36
  * @return null
37
  */
38
  public function emergency( $message, array $context = array() ) {
45
  * Example: Entire website down, database unavailable, etc. This should
46
  * trigger the SMS alerts and wake you up.
47
  *
48
+ * @param string $message Error message.
49
+ * @param array $context Error context.
50
  * @return null
51
  */
52
  public function alert( $message, array $context = array() ) {
58
  *
59
  * Example: Application component unavailable, unexpected exception.
60
  *
61
+ * @param string $message Error message.
62
+ * @param array $context Error context.
63
  * @return null
64
  */
65
  public function critical( $message, array $context = array() ) {
70
  * Runtime errors that do not require immediate action but should typically
71
  * be logged and monitored.
72
  *
73
+ * @param string $message Error message.
74
+ * @param array $context Error context.
75
  * @return null
76
  */
77
  public function error( $message, array $context = array() ) {
84
  * Example: Use of deprecated APIs, poor use of an API, undesirable things
85
  * that are not necessarily wrong.
86
  *
87
+ * @param string $message Error message.
88
+ * @param array $context Error context.
89
  * @return null
90
  */
91
  public function warning( $message, array $context = array() ) {
95
  /**
96
  * Normal but significant events.
97
  *
98
+ * @param string $message Error message.
99
+ * @param array $context Error context.
100
  * @return null
101
  */
102
  public function notice( $message, array $context = array() ) {
108
  *
109
  * Example: User logs in, SQL logs.
110
  *
111
+ * @param string $message Error message.
112
+ * @param array $context Error context.
113
  * @return null
114
  */
115
  public function info( $message, array $context = array() ) {
119
  /**
120
  * Detailed debug information.
121
  *
122
+ * @param string $message Error message.
123
+ * @param array $context Error context.
124
  * @return null
125
  */
126
  public function debug( $message, array $context = array() ) {
130
  /**
131
  * Logs with an arbitrary level.
132
  *
133
+ * @param mixed $level Error level.
134
+ * @param string $message Error message.
135
+ * @param array $context Error context.
136
+ * @return void
137
  */
138
  public function log( $level, $message, array $context = array() ) {
139
 
inc/importers/wxr-importer/class-wxr-import-info.php CHANGED
@@ -1,21 +1,90 @@
1
  <?php
 
 
 
 
 
 
 
2
 
3
  if ( ! class_exists( 'WXR_Import_Info' ) ) {
4
 
 
 
 
 
 
5
  class WXR_Import_Info {
 
 
 
 
 
 
6
  public $home;
 
 
 
 
 
 
7
  public $siteurl;
8
 
 
 
 
 
 
9
  public $title;
10
 
11
- public $users = array();
12
- public $post_count = 0;
13
- public $media_count = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  public $comment_count = 0;
15
- public $term_count = 0;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  public $generator = '';
 
 
 
 
 
 
18
  public $version;
19
  }
20
 
21
- }
1
  <?php
2
+ /**
3
+ * WXR Import Info
4
+ *
5
+ * @since 2.0.0
6
+ *
7
+ * @package Astra Sites
8
+ */
9
 
10
  if ( ! class_exists( 'WXR_Import_Info' ) ) {
11
 
12
+ /**
13
+ * Import Info
14
+ *
15
+ * @since 2.0.0
16
+ */
17
  class WXR_Import_Info {
18
+
19
+ /**
20
+ * Home
21
+ *
22
+ * @var Home
23
+ */
24
  public $home;
25
+
26
+ /**
27
+ * Siteurl
28
+ *
29
+ * @var Site URL
30
+ */
31
  public $siteurl;
32
 
33
+ /**
34
+ * Title
35
+ *
36
+ * @var Title
37
+ */
38
  public $title;
39
 
40
+ /**
41
+ * Users
42
+ *
43
+ * @var Users
44
+ */
45
+ public $users = array();
46
+
47
+ /**
48
+ * Post_count
49
+ *
50
+ * @var Post Count
51
+ */
52
+ public $post_count = 0;
53
+
54
+ /**
55
+ * Media Count
56
+ *
57
+ * @var Media Count
58
+ */
59
+ public $media_count = 0;
60
+
61
+ /**
62
+ * Comment Count
63
+ *
64
+ * @var Comment Count
65
+ */
66
  public $comment_count = 0;
 
67
 
68
+ /**
69
+ * Term Count
70
+ *
71
+ * @var Term Count
72
+ */
73
+ public $term_count = 0;
74
+
75
+ /**
76
+ * Generator
77
+ *
78
+ * @var Generator
79
+ */
80
  public $generator = '';
81
+
82
+ /**
83
+ * Version
84
+ *
85
+ * @var Version
86
+ */
87
  public $version;
88
  }
89
 
90
+ }
inc/importers/wxr-importer/class-wxr-importer.php CHANGED
@@ -1,6 +1,15 @@
1
  <?php
 
 
 
 
 
2
 
3
- if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
 
 
 
 
4
  class WXR_Importer extends WP_Importer {
5
  /**
6
  * Maximum supported WXR version
@@ -36,27 +45,110 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
36
  */
37
  protected $version = '1.0';
38
 
39
- // information to import from WXR file
 
 
 
 
 
40
  protected $categories = array();
 
 
 
 
 
 
41
  protected $tags = array();
 
 
 
 
 
 
42
  protected $base_url = '';
43
 
44
- // TODO: REMOVE THESE
 
 
 
 
 
45
  protected $processed_terms = array();
 
 
 
 
 
 
46
  protected $processed_posts = array();
 
 
 
 
 
 
47
  protected $processed_menu_items = array();
 
 
 
 
 
 
48
  protected $menu_item_orphans = array();
 
 
 
 
 
 
49
  protected $missing_menu_items = array();
50
 
51
- // NEW STYLE
 
 
 
 
 
 
52
  protected $mapping = array();
 
 
 
 
 
 
53
  protected $requires_remapping = array();
 
 
 
 
 
 
54
  protected $exists = array();
 
 
 
 
 
 
55
  protected $user_slug_override = array();
56
 
 
 
 
 
 
 
57
  protected $url_remap = array();
 
 
 
 
 
 
58
  protected $featured_images = array();
59
 
 
60
  /**
61
  * Logger instance.
62
  *
@@ -67,18 +159,18 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
67
  /**
68
  * Constructor
69
  *
70
- * @param array $options {
71
- * @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.)
72
- * @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.)
73
- * @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.)
74
- * @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.)
75
- * @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.)
76
- * @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `<img class="wp-image-*">` only. Default is false.)
77
- * @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.)
78
  * }
79
  */
80
  public function __construct( $options = array() ) {
81
- // Initialize some important variables
82
  $empty_types = array(
83
  'post' => array(),
84
  'comment' => array(),
@@ -86,23 +178,31 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
86
  'user' => array(),
87
  );
88
 
89
- $this->mapping = $empty_types;
90
  $this->mapping['user_slug'] = array();
91
- $this->mapping['term_id'] = array();
92
- $this->requires_remapping = $empty_types;
93
- $this->exists = $empty_types;
94
-
95
- $this->options = wp_parse_args( $options, array(
96
- 'prefill_existing_posts' => true,
97
- 'prefill_existing_comments' => true,
98
- 'prefill_existing_terms' => true,
99
- 'update_attachment_guids' => false,
100
- 'fetch_attachments' => false,
101
- 'aggressive_url_search' => false,
102
- 'default_author' => null,
103
- ) );
 
 
 
104
  }
105
 
 
 
 
 
 
106
  public function set_logger( $logger ) {
107
  $this->logger = $logger;
108
  }
@@ -114,19 +214,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
114
  * @return XMLReader|WP_Error Reader instance on success, error otherwise.
115
  */
116
  protected function get_reader( $file ) {
117
- // Avoid loading external entities for security
118
  $old_value = null;
119
- if ( function_exists( 'libxml_disable_entity_loader' ) ) {
120
- // $old_value = libxml_disable_entity_loader( true );
121
- }
122
 
123
  $reader = new XMLReader();
124
  $status = $reader->open( $file );
125
 
126
- if ( ! is_null( $old_value ) ) {
127
- // libxml_disable_entity_loader( $old_value );
128
- }
129
-
130
  if ( ! $status ) {
131
  return new WP_Error( 'wxr_importer.cannot_parse', __( 'Could not open the file for parsing', 'wordpress-importer' ) );
132
  }
@@ -137,40 +230,43 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
137
  /**
138
  * The main controller for the actual import stage.
139
  *
140
- * @param string $file Path to the WXR file for importing
141
  */
142
  public function get_preliminary_information( $file ) {
143
- // Let's run the actual importer now, woot
144
  $reader = $this->get_reader( $file );
145
  if ( is_wp_error( $reader ) ) {
146
  return $reader;
147
  }
148
 
149
- // Set the version to compatibility mode first
150
  $this->version = '1.0';
151
 
152
  // Start parsing!
153
  $data = new WXR_Import_Info();
154
  while ( $reader->read() ) {
155
- // Only deal with element opens
156
- if ( $reader->nodeType !== XMLReader::ELEMENT ) {
157
  continue;
158
  }
159
 
160
  switch ( $reader->name ) {
161
  case 'wp:wxr_version':
162
- // Upgrade to the correct version
163
  $this->version = $reader->readString();
164
 
165
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
166
- $this->logger->warning( sprintf(
167
- __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
168
- $this->version,
169
- self::MAX_WXR_VERSION
170
- ) );
 
 
 
171
  }
172
 
173
- // Handled everything in this node, move on to the next
174
  $reader->next();
175
  break;
176
 
@@ -201,36 +297,36 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
201
  if ( is_wp_error( $parsed ) ) {
202
  $this->log_error( $parsed );
203
 
204
- // Skip the rest of this post
205
  $reader->next();
206
  break;
207
  }
208
 
209
  $data->users[] = $parsed;
210
 
211
- // Handled everything in this node, move on to the next
212
  $reader->next();
213
  break;
214
 
215
  case 'item':
216
- $node = $reader->expand();
217
  $parsed = $this->parse_post_node( $node );
218
  if ( is_wp_error( $parsed ) ) {
219
  $this->log_error( $parsed );
220
 
221
- // Skip the rest of this post
222
  $reader->next();
223
  break;
224
  }
225
 
226
- if ( $parsed['data']['post_type'] === 'attachment' ) {
227
  $data->media_count++;
228
  } else {
229
  $data->post_count++;
230
  }
231
  $data->comment_count += count( $parsed['comments'] );
232
 
233
- // Handled everything in this node, move on to the next
234
  $reader->next();
235
  break;
236
 
@@ -239,11 +335,11 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
239
  case 'wp:term':
240
  $data->term_count++;
241
 
242
- // Handled everything in this node, move on to the next
243
  $reader->next();
244
  break;
245
- }// End switch().
246
- }// End while().
247
 
248
  $data->version = $this->version;
249
 
@@ -253,40 +349,43 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
253
  /**
254
  * The main controller for the actual import stage.
255
  *
256
- * @param string $file Path to the WXR file for importing
257
  */
258
  public function parse_authors( $file ) {
259
- // Let's run the actual importer now, woot
260
  $reader = $this->get_reader( $file );
261
  if ( is_wp_error( $reader ) ) {
262
  return $reader;
263
  }
264
 
265
- // Set the version to compatibility mode first
266
  $this->version = '1.0';
267
 
268
  // Start parsing!
269
  $authors = array();
270
  while ( $reader->read() ) {
271
- // Only deal with element opens
272
- if ( $reader->nodeType !== XMLReader::ELEMENT ) {
273
  continue;
274
  }
275
 
276
  switch ( $reader->name ) {
277
  case 'wp:wxr_version':
278
- // Upgrade to the correct version
279
  $this->version = $reader->readString();
280
 
281
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
282
- $this->logger->warning( sprintf(
283
- __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
284
- $this->version,
285
- self::MAX_WXR_VERSION
286
- ) );
 
 
 
287
  }
288
 
289
- // Handled everything in this node, move on to the next
290
  $reader->next();
291
  break;
292
 
@@ -297,18 +396,18 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
297
  if ( is_wp_error( $parsed ) ) {
298
  $this->log_error( $parsed );
299
 
300
- // Skip the rest of this post
301
  $reader->next();
302
  break;
303
  }
304
 
305
  $authors[] = $parsed;
306
 
307
- // Handled everything in this node, move on to the next
308
  $reader->next();
309
  break;
310
  }
311
- }// End while().
312
 
313
  return $authors;
314
  }
@@ -316,7 +415,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
316
  /**
317
  * The main controller for the actual import stage.
318
  *
319
- * @param string $file Path to the WXR file for importing
320
  */
321
  public function import( $file ) {
322
  add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
@@ -327,63 +426,66 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
327
  return $result;
328
  }
329
 
330
- // Let's run the actual importer now, woot
331
  $reader = $this->get_reader( $file );
332
  if ( is_wp_error( $reader ) ) {
333
  return $reader;
334
  }
335
 
336
- // Set the version to compatibility mode first
337
  $this->version = '1.0';
338
 
339
- // Reset other variables
340
  $this->base_url = '';
341
 
342
  // Start parsing!
343
  while ( $reader->read() ) {
344
- // Only deal with element opens
345
- if ( $reader->nodeType !== XMLReader::ELEMENT ) {
346
  continue;
347
  }
348
 
349
  switch ( $reader->name ) {
350
  case 'wp:wxr_version':
351
- // Upgrade to the correct version
352
  $this->version = $reader->readString();
353
 
354
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
355
- $this->logger->warning( sprintf(
356
- __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
357
- $this->version,
358
- self::MAX_WXR_VERSION
359
- ) );
 
 
 
360
  }
361
 
362
- // Handled everything in this node, move on to the next
363
  $reader->next();
364
  break;
365
 
366
  case 'wp:base_site_url':
367
  $this->base_url = $reader->readString();
368
 
369
- // Handled everything in this node, move on to the next
370
  $reader->next();
371
  break;
372
 
373
  case 'item':
374
- $node = $reader->expand();
375
  $parsed = $this->parse_post_node( $node );
376
  if ( is_wp_error( $parsed ) ) {
377
  $this->log_error( $parsed );
378
 
379
- // Skip the rest of this post
380
  $reader->next();
381
  break;
382
  }
383
 
384
  $this->process_post( $parsed['data'], $parsed['meta'], $parsed['comments'], $parsed['terms'] );
385
 
386
- // Handled everything in this node, move on to the next
387
  $reader->next();
388
  break;
389
 
@@ -394,7 +496,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
394
  if ( is_wp_error( $parsed ) ) {
395
  $this->log_error( $parsed );
396
 
397
- // Skip the rest of this post
398
  $reader->next();
399
  break;
400
  }
@@ -404,7 +506,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
404
  $this->log_error( $status );
405
  }
406
 
407
- // Handled everything in this node, move on to the next
408
  $reader->next();
409
  break;
410
 
@@ -415,14 +517,14 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
415
  if ( is_wp_error( $parsed ) ) {
416
  $this->log_error( $parsed );
417
 
418
- // Skip the rest of this post
419
  $reader->next();
420
  break;
421
  }
422
 
423
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
424
 
425
- // Handled everything in this node, move on to the next
426
  $reader->next();
427
  break;
428
 
@@ -433,14 +535,14 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
433
  if ( is_wp_error( $parsed ) ) {
434
  $this->log_error( $parsed );
435
 
436
- // Skip the rest of this post
437
  $reader->next();
438
  break;
439
  }
440
 
441
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
442
 
443
- // Handled everything in this node, move on to the next
444
  $reader->next();
445
  break;
446
 
@@ -451,22 +553,22 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
451
  if ( is_wp_error( $parsed ) ) {
452
  $this->log_error( $parsed );
453
 
454
- // Skip the rest of this post
455
  $reader->next();
456
  break;
457
  }
458
 
459
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
460
 
461
- // Handled everything in this node, move on to the next
462
  $reader->next();
463
  break;
464
 
465
  default:
466
- // Skip this node, probably handled by something already
467
  break;
468
- }// End switch().
469
- }// End while().
470
 
471
  // Now that we've done the main processing, do any required
472
  // post-processing and remapping.
@@ -475,7 +577,9 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
475
  if ( $this->options['aggressive_url_search'] ) {
476
  $this->replace_attachment_urls_in_content();
477
  }
 
478
  // $this->remap_featured_images();
 
479
  $this->import_end();
480
  }
481
 
@@ -487,29 +591,29 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
487
  protected function log_error( WP_Error $error ) {
488
  $this->logger->warning( $error->get_error_message() );
489
 
490
- // Log the data as debug info too
491
  $data = $error->get_error_data();
492
  if ( ! empty( $data ) ) {
493
- $this->logger->debug( var_export( $data, true ) );
494
  }
495
  }
496
 
497
  /**
498
  * Parses the WXR file and prepares us for the task of processing parsed data
499
  *
500
- * @param string $file Path to the WXR file for importing
501
  */
502
  protected function import_start( $file ) {
503
  if ( ! is_file( $file ) ) {
504
  return new WP_Error( 'wxr_importer.file_missing', __( 'The file does not exist, please try again.', 'wordpress-importer' ) );
505
  }
506
 
507
- // Suspend bunches of stuff in WP core
508
  wp_defer_term_counting( true );
509
  wp_defer_comment_counting( true );
510
  wp_suspend_cache_invalidation( true );
511
 
512
- // Prefill exists calls if told to
513
  if ( $this->options['prefill_existing_posts'] ) {
514
  $this->prefill_existing_posts();
515
  }
@@ -533,7 +637,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
533
  * Performs post-import cleanup of files and the cache
534
  */
535
  protected function import_end() {
536
- // Re-enable stuff in core
537
  wp_suspend_cache_invalidation( false );
538
  wp_cache_flush();
539
  foreach ( get_taxonomies() as $tax ) {
@@ -556,13 +660,13 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
556
  /**
557
  * Set the user mapping.
558
  *
559
- * @param array $mapping List of map arrays (containing `old_slug`, `old_id`, `new_id`)
560
  */
561
  public function set_user_mapping( $mapping ) {
562
  foreach ( $mapping as $map ) {
563
  if ( empty( $map['old_slug'] ) || empty( $map['old_id'] ) || empty( $map['new_id'] ) ) {
564
  $this->logger->warning( __( 'Invalid author mapping', 'wordpress-importer' ) );
565
- $this->logger->debug( var_export( $map, true ) );
566
  continue;
567
  }
568
 
@@ -595,71 +699,71 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
595
  * @return array|WP_Error Post data array on success, error otherwise.
596
  */
597
  protected function parse_post_node( $node ) {
598
- $data = array();
599
- $meta = array();
600
  $comments = array();
601
- $terms = array();
602
 
603
- foreach ( $node->childNodes as $child ) {
604
- // We only care about child elements
605
- if ( $child->nodeType !== XML_ELEMENT_NODE ) {
606
  continue;
607
  }
608
 
609
- switch ( $child->tagName ) {
610
  case 'wp:post_type':
611
- $data['post_type'] = $child->textContent;
612
  break;
613
 
614
  case 'title':
615
- $data['post_title'] = $child->textContent;
616
  break;
617
 
618
  case 'guid':
619
- $data['guid'] = $child->textContent;
620
  break;
621
 
622
  case 'dc:creator':
623
- $data['post_author'] = $child->textContent;
624
  break;
625
 
626
  case 'content:encoded':
627
- $data['post_content'] = $child->textContent;
628
  break;
629
 
630
  case 'excerpt:encoded':
631
- $data['post_excerpt'] = $child->textContent;
632
  break;
633
 
634
  case 'wp:post_id':
635
- $data['post_id'] = $child->textContent;
636
  break;
637
 
638
  case 'wp:post_date':
639
- $data['post_date'] = $child->textContent;
640
  break;
641
 
642
  case 'wp:post_date_gmt':
643
- $data['post_date_gmt'] = $child->textContent;
644
  break;
645
 
646
  case 'wp:comment_status':
647
- $data['comment_status'] = $child->textContent;
648
  break;
649
 
650
  case 'wp:ping_status':
651
- $data['ping_status'] = $child->textContent;
652
  break;
653
 
654
  case 'wp:post_name':
655
- $data['post_name'] = $child->textContent;
656
  break;
657
 
658
  case 'wp:status':
659
- $data['post_status'] = $child->textContent;
660
 
661
- if ( $data['post_status'] === 'auto-draft' ) {
662
- // Bail now
663
  return new WP_Error(
664
  'wxr_importer.post.cannot_import_draft',
665
  __( 'Cannot import auto-draft posts' ),
@@ -669,23 +773,23 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
669
  break;
670
 
671
  case 'wp:post_parent':
672
- $data['post_parent'] = $child->textContent;
673
  break;
674
 
675
  case 'wp:menu_order':
676
- $data['menu_order'] = $child->textContent;
677
  break;
678
 
679
  case 'wp:post_password':
680
- $data['post_password'] = $child->textContent;
681
  break;
682
 
683
  case 'wp:is_sticky':
684
- $data['is_sticky'] = $child->textContent;
685
  break;
686
 
687
  case 'wp:attachment_url':
688
- $data['attachment_url'] = $child->textContent;
689
  break;
690
 
691
  case 'wp:postmeta':
@@ -708,8 +812,8 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
708
  $terms[] = $term_item;
709
  }
710
  break;
711
- }// End switch().
712
- }// End foreach().
713
 
714
  return compact( 'data', 'meta', 'comments', 'terms' );
715
  }
@@ -721,6 +825,11 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
721
  * Doesn't create a new post if: the post type doesn't exist, the given post ID
722
  * is already noted as imported or a post with the same title and date already exists.
723
  * Note that new/updated terms, comments and meta are imported for the last of the above.
 
 
 
 
 
724
  */
725
  protected function process_post( $data, $meta, $comments, $terms ) {
726
  /**
@@ -731,12 +840,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
731
  * @param array $comments Comments on the post.
732
  * @param array $terms Terms on the post.
733
  */
734
- $data = apply_filters( 'wxr_importer.pre_process.post', $data, $meta, $comments, $terms );
735
  if ( empty( $data ) ) {
736
  return false;
737
  }
738
 
739
- $original_id = isset( $data['post_id'] ) ? (int) $data['post_id'] : 0;
740
  $parent_id = isset( $data['post_parent'] ) ? (int) $data['post_parent'] : 0;
741
  $author_id = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0;
742
 
@@ -749,43 +858,49 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
749
 
750
  // Is this type even valid?
751
  if ( ! $post_type_object ) {
752
- $this->logger->warning( sprintf(
753
- __( 'Failed to import "%1$s": Invalid post type %2$s', 'wordpress-importer' ),
754
- $data['post_title'],
755
- $data['post_type']
756
- ) );
 
 
 
757
  return false;
758
  }
759
 
760
  $post_exists = $this->post_exists( $data );
761
  if ( $post_exists ) {
762
- $this->logger->info( sprintf(
763
- __( '%1$s "%2$s" already exists.', 'wordpress-importer' ),
764
- $post_type_object->labels->singular_name,
765
- $data['post_title']
766
- ) );
 
 
 
767
 
768
  /**
769
  * Post processing already imported.
770
  *
771
  * @param array $data Raw data imported for the post.
772
  */
773
- do_action( 'wxr_importer.process_already_imported.post', $data );
774
 
775
- // Even though this post already exists, new comments might need importing
776
  $this->process_comments( $comments, $original_id, $data, $post_exists );
777
 
778
  return false;
779
  }
780
 
781
- // Map the parent post, or mark it as one we need to fix
782
  $requires_remapping = false;
783
  if ( $parent_id ) {
784
  if ( isset( $this->mapping['post'][ $parent_id ] ) ) {
785
  $data['post_parent'] = $this->mapping['post'][ $parent_id ];
786
  } else {
787
- $meta[] = array(
788
- 'key' => '_wxr_import_parent',
789
  'value' => $parent_id,
790
  );
791
  $requires_remapping = true;
@@ -794,7 +909,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
794
  }
795
  }
796
 
797
- // Map the author, or mark it as one we need to fix
798
  $author = sanitize_user( $data['post_author'], true );
799
  if ( empty( $author ) ) {
800
  // Missing or invalid author, use default if available.
@@ -802,8 +917,8 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
802
  } elseif ( isset( $this->mapping['user_slug'][ $author ] ) ) {
803
  $data['post_author'] = $this->mapping['user_slug'][ $author ];
804
  } else {
805
- $meta[] = array(
806
- 'key' => '_wxr_import_user_slug',
807
  'value' => $author,
808
  );
809
  $requires_remapping = true;
@@ -813,18 +928,18 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
813
 
814
  // Does the post look like it contains attachment images?
815
  if ( preg_match( self::REGEX_HAS_ATTACHMENT_REFS, $data['post_content'] ) ) {
816
- $meta[] = array(
817
- 'key' => '_wxr_import_has_attachment_refs',
818
  'value' => true,
819
  );
820
  $requires_remapping = true;
821
  }
822
 
823
- // Whitelist to just the keys we allow
824
  $postdata = array(
825
  'import_id' => $data['post_id'],
826
  );
827
- $allowed = array(
828
  'post_author' => true,
829
  'post_date' => true,
830
  'post_date_gmt' => true,
@@ -853,32 +968,38 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
853
 
854
  if ( 'attachment' === $postdata['post_type'] ) {
855
  if ( ! $this->options['fetch_attachments'] ) {
856
- $this->logger->notice( sprintf(
857
- __( 'Skipping attachment "%s", fetching attachments disabled' ),
858
- $data['post_title']
859
- ) );
 
 
 
860
  /**
861
  * Post processing skipped.
862
  *
863
  * @param array $data Raw data imported for the post.
864
  * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
865
  */
866
- do_action( 'wxr_importer.process_skipped.post', $data, $meta );
867
  return false;
868
  }
869
  $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid'];
870
- $post_id = $this->process_attachment( $postdata, $meta, $remote_url );
871
  } else {
872
  $post_id = wp_insert_post( $postdata, true );
873
  do_action( 'wp_import_insert_post', $post_id, $original_id, $postdata, $data );
874
  }
875
 
876
  if ( is_wp_error( $post_id ) ) {
877
- $this->logger->error( sprintf(
878
- __( 'Failed to import "%1$s" (%2$s)', 'wordpress-importer' ),
879
- $data['post_title'],
880
- $post_type_object->labels->singular_name
881
- ) );
 
 
 
882
  $this->logger->debug( $post_id->get_error_message() );
883
 
884
  /**
@@ -890,47 +1011,53 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
890
  * @param array $comments Raw comment data, already processed by {@see process_comments}.
891
  * @param array $terms Raw term data, already processed.
892
  */
893
- do_action( 'wxr_importer.process_failed.post', $post_id, $data, $meta, $comments, $terms );
894
  return false;
895
  }
896
 
897
- // Ensure stickiness is handled correctly too
898
- if ( $data['is_sticky'] === '1' ) {
899
  stick_post( $post_id );
900
  }
901
 
902
- // map pre-import ID to local ID
903
  $this->mapping['post'][ $original_id ] = (int) $post_id;
904
  if ( $requires_remapping ) {
905
  $this->requires_remapping['post'][ $post_id ] = true;
906
  }
907
  $this->mark_post_exists( $data, $post_id );
908
 
909
- $this->logger->info( sprintf(
910
- __( 'Imported "%1$s" (%2$s)', 'wordpress-importer' ),
911
- $data['post_title'],
912
- $post_type_object->labels->singular_name
913
- ) );
914
- $this->logger->debug( sprintf(
915
- __( 'Post %1$d remapped to %2$d', 'wordpress-importer' ),
916
- $original_id,
917
- $post_id
918
- ) );
919
-
920
- // Handle the terms too
 
 
 
 
 
 
921
  $terms = apply_filters( 'wp_import_post_terms', $terms, $post_id, $data );
922
 
923
  if ( ! empty( $terms ) ) {
924
  $term_ids = array();
925
  foreach ( $terms as $term ) {
926
  $taxonomy = $term['taxonomy'];
927
- $key = sha1( $taxonomy . ':' . $term['slug'] );
928
 
929
  if ( isset( $this->mapping['term'][ $key ] ) ) {
930
  $term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ];
931
  } else {
932
- $meta[] = array(
933
- 'key' => '_wxr_import_term',
934
  'value' => $term,
935
  );
936
  $requires_remapping = true;
@@ -959,7 +1086,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
959
  * @param array $comments Raw comment data, already processed by {@see process_comments}.
960
  * @param array $terms Raw term data, already processed.
961
  */
962
- do_action( 'wxr_importer.processed.post', $post_id, $data, $meta, $comments, $terms );
963
  }
964
 
965
  /**
@@ -970,13 +1097,15 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
970
  * represents doesn't exist then the menu item will not be imported (waits until the
971
  * end of the import to retry again before discarding).
972
  *
973
- * @param array $item Menu item details from WXR file
 
 
974
  */
975
  protected function process_menu_item_meta( $post_id, $data, $meta ) {
976
 
977
- $item_type = get_post_meta( $post_id, '_menu_item_type', true );
978
  $original_object_id = get_post_meta( $post_id, '_menu_item_object_id', true );
979
- $object_id = null;
980
 
981
  $this->logger->debug( sprintf( 'Processing menu item %s', $item_type ) );
982
 
@@ -1006,7 +1135,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1006
  break;
1007
 
1008
  default:
1009
- // associated object is missing or not imported yet, we'll retry later
1010
  $this->missing_menu_items[] = $item;
1011
  $this->logger->debug( 'Unknown menu item type' );
1012
  break;
@@ -1028,16 +1157,17 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1028
  /**
1029
  * If fetching attachments is enabled then attempt to create a new attachment
1030
  *
1031
- * @param array $post Attachment post details from WXR
1032
- * @param string $url URL to fetch attachment from
1033
- * @return int|WP_Error Post ID on success, WP_Error otherwise
 
1034
  */
1035
  protected function process_attachment( $post, $meta, $remote_url ) {
1036
  // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
1037
- // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload()
1038
  $post['upload_date'] = $post['post_date'];
1039
  foreach ( $meta as $meta_item ) {
1040
- if ( $meta_item['key'] !== '_wp_attached_file' ) {
1041
  continue;
1042
  }
1043
 
@@ -1047,7 +1177,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1047
  break;
1048
  }
1049
 
1050
- // if the URL is absolute, but does not contain address, then upload it assuming base_site_url
1051
  if ( preg_match( '|^/[\w\W]+$|', $remote_url ) ) {
1052
  $remote_url = rtrim( $this->base_url, '/' ) . $remote_url;
1053
  }
@@ -1065,12 +1195,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1065
  $post['post_mime_type'] = $info['type'];
1066
 
1067
  // WP really likes using the GUID for display. Allow updating it.
1068
- // See https://core.trac.wordpress.org/ticket/33386
1069
  if ( $this->options['update_attachment_guids'] ) {
1070
  $post['guid'] = $upload['url'];
1071
  }
1072
 
1073
- // as per wp-admin/includes/upload.php
1074
  $post_id = wp_insert_attachment( $post, $upload['file'] );
1075
  if ( is_wp_error( $post_id ) ) {
1076
  return $post_id;
@@ -1079,29 +1209,15 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1079
  $attachment_metadata = wp_generate_attachment_metadata( $post_id, $upload['file'] );
1080
  wp_update_attachment_metadata( $post_id, $attachment_metadata );
1081
 
1082
- // Map this image URL later if we need to
1083
  $this->url_remap[ $remote_url ] = $upload['url'];
1084
 
1085
- // If we have a HTTPS URL, ensure the HTTP URL gets replaced too
1086
  if ( substr( $remote_url, 0, 8 ) === 'https://' ) {
1087
- $insecure_url = 'http' . substr( $remote_url, 5 );
1088
  $this->url_remap[ $insecure_url ] = $upload['url'];
1089
  }
1090
 
1091
- if ( $this->options['aggressive_url_search'] ) {
1092
- // remap resized image URLs, works by stripping the extension and remapping the URL stub.
1093
- /*
1094
- if ( preg_match( '!^image/!', $info['type'] ) ) {
1095
- $parts = pathinfo( $remote_url );
1096
- $name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
1097
-
1098
- $parts_new = pathinfo( $upload['url'] );
1099
- $name_new = basename( $parts_new['basename'], ".{$parts_new['extension']}" );
1100
-
1101
- $this->url_remap[$parts['dirname'] . '/' . $name] = $parts_new['dirname'] . '/' . $name_new;
1102
- }*/
1103
- }
1104
-
1105
  return $post_id;
1106
  }
1107
 
@@ -1112,19 +1228,19 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1112
  * @return array|null Meta data array on success, or null on error.
1113
  */
1114
  protected function parse_meta_node( $node ) {
1115
- foreach ( $node->childNodes as $child ) {
1116
- // We only care about child elements
1117
- if ( $child->nodeType !== XML_ELEMENT_NODE ) {
1118
  continue;
1119
  }
1120
 
1121
- switch ( $child->tagName ) {
1122
  case 'wp:meta_key':
1123
- $key = $child->textContent;
1124
  break;
1125
 
1126
  case 'wp:meta_value':
1127
- $value = $child->textContent;
1128
  break;
1129
  }
1130
  }
@@ -1139,9 +1255,9 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1139
  /**
1140
  * Process and import post meta items.
1141
  *
1142
- * @param array $meta List of meta data arrays
1143
- * @param int $post_id Post to associate with
1144
- * @param array $post Post data
1145
  * @return int|WP_Error Number of meta items imported on success, error otherwise.
1146
  */
1147
  protected function process_post_meta( $meta, $post_id, $post ) {
@@ -1156,12 +1272,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1156
  * @param array $meta_item Meta data. (Return empty to skip.)
1157
  * @param int $post_id Post the meta is attached to.
1158
  */
1159
- $meta_item = apply_filters( 'wxr_importer.pre_process.post_meta', $meta_item, $post_id );
1160
  if ( empty( $meta_item ) ) {
1161
  return false;
1162
  }
1163
 
1164
- $key = apply_filters( 'import_post_meta_key', $meta_item['key'], $post_id, $post );
1165
  $value = false;
1166
 
1167
  if ( '_edit_last' === $key ) {
@@ -1175,7 +1291,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1175
  }
1176
 
1177
  if ( $key ) {
1178
- // export gets meta straight from the DB so could have a serialized string
1179
  if ( ! $value ) {
1180
  $value = maybe_unserialize( $meta_item['value'] );
1181
  }
@@ -1183,12 +1299,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1183
  add_post_meta( $post_id, $key, $value );
1184
  do_action( 'import_post_meta', $post_id, $key, $value );
1185
 
1186
- // if the post has a featured image, take note of this in case of remap
1187
  if ( '_thumbnail_id' === $key ) {
1188
  $this->featured_images[ $post_id ] = (int) $value;
1189
  }
1190
  }
1191
- }// End foreach().
1192
 
1193
  return true;
1194
  }
@@ -1204,58 +1320,58 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1204
  'commentmeta' => array(),
1205
  );
1206
 
1207
- foreach ( $node->childNodes as $child ) {
1208
- // We only care about child elements
1209
- if ( $child->nodeType !== XML_ELEMENT_NODE ) {
1210
  continue;
1211
  }
1212
 
1213
- switch ( $child->tagName ) {
1214
  case 'wp:comment_id':
1215
- $data['comment_id'] = $child->textContent;
1216
  break;
1217
  case 'wp:comment_author':
1218
- $data['comment_author'] = $child->textContent;
1219
  break;
1220
 
1221
  case 'wp:comment_author_email':
1222
- $data['comment_author_email'] = $child->textContent;
1223
  break;
1224
 
1225
  case 'wp:comment_author_IP':
1226
- $data['comment_author_IP'] = $child->textContent;
1227
  break;
1228
 
1229
  case 'wp:comment_author_url':
1230
- $data['comment_author_url'] = $child->textContent;
1231
  break;
1232
 
1233
  case 'wp:comment_user_id':
1234
- $data['comment_user_id'] = $child->textContent;
1235
  break;
1236
 
1237
  case 'wp:comment_date':
1238
- $data['comment_date'] = $child->textContent;
1239
  break;
1240
 
1241
  case 'wp:comment_date_gmt':
1242
- $data['comment_date_gmt'] = $child->textContent;
1243
  break;
1244
 
1245
  case 'wp:comment_content':
1246
- $data['comment_content'] = $child->textContent;
1247
  break;
1248
 
1249
  case 'wp:comment_approved':
1250
- $data['comment_approved'] = $child->textContent;
1251
  break;
1252
 
1253
  case 'wp:comment_type':
1254
- $data['comment_type'] = $child->textContent;
1255
  break;
1256
 
1257
  case 'wp:comment_parent':
1258
- $data['comment_parent'] = $child->textContent;
1259
  break;
1260
 
1261
  case 'wp:commentmeta':
@@ -1264,8 +1380,8 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1264
  $data['commentmeta'][] = $meta_item;
1265
  }
1266
  break;
1267
- }// End switch().
1268
- }// End foreach().
1269
 
1270
  return $data;
1271
  }
@@ -1273,9 +1389,10 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1273
  /**
1274
  * Process and import comment data.
1275
  *
1276
- * @param array $comments List of comment data arrays.
1277
- * @param int $post_id Post to associate with.
1278
- * @param array $post Post data.
 
1279
  * @return int|WP_Error Number of comments imported on success, error otherwise.
1280
  */
1281
  protected function process_comments( $comments, $post_id, $post, $post_exists = false ) {
@@ -1287,7 +1404,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1287
 
1288
  $num_comments = 0;
1289
 
1290
- // Sort by ID to avoid excessive remapping later
1291
  usort( $comments, array( $this, 'sort_comments_by_id' ) );
1292
 
1293
  foreach ( $comments as $key => $comment ) {
@@ -1297,17 +1414,17 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1297
  * @param array $comment Comment data. (Return empty to skip.)
1298
  * @param int $post_id Post the comment is attached to.
1299
  */
1300
- $comment = apply_filters( 'wxr_importer.pre_process.comment', $comment, $post_id );
1301
  if ( empty( $comment ) ) {
1302
  return false;
1303
  }
1304
 
1305
- $original_id = isset( $comment['comment_id'] ) ? (int) $comment['comment_id'] : 0;
1306
- $parent_id = isset( $comment['comment_parent'] ) ? (int) $comment['comment_parent'] : 0;
1307
  $author_id = isset( $comment['comment_user_id'] ) ? (int) $comment['comment_user_id'] : 0;
1308
 
1309
  // if this is a new post we can skip the comment_exists() check
1310
- // TODO: Check comment_exists for performance
1311
  if ( $post_exists ) {
1312
  $existing = $this->comment_exists( $comment );
1313
  if ( $existing ) {
@@ -1317,58 +1434,58 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1317
  *
1318
  * @param array $comment Raw data imported for the comment.
1319
  */
1320
- do_action( 'wxr_importer.process_already_imported.comment', $comment );
1321
 
1322
  $this->mapping['comment'][ $original_id ] = $existing;
1323
  continue;
1324
  }
1325
  }
1326
 
1327
- // Remove meta from the main array
1328
  $meta = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array();
1329
  unset( $comment['commentmeta'] );
1330
 
1331
- // Map the parent comment, or mark it as one we need to fix
1332
  $requires_remapping = false;
1333
  if ( $parent_id ) {
1334
  if ( isset( $this->mapping['comment'][ $parent_id ] ) ) {
1335
  $comment['comment_parent'] = $this->mapping['comment'][ $parent_id ];
1336
  } else {
1337
- // Prepare for remapping later
1338
- $meta[] = array(
1339
- 'key' => '_wxr_import_parent',
1340
  'value' => $parent_id,
1341
  );
1342
  $requires_remapping = true;
1343
 
1344
- // Wipe the parent for now
1345
  $comment['comment_parent'] = 0;
1346
  }
1347
  }
1348
 
1349
- // Map the author, or mark it as one we need to fix
1350
  if ( $author_id ) {
1351
  if ( isset( $this->mapping['user'][ $author_id ] ) ) {
1352
  $comment['user_id'] = $this->mapping['user'][ $author_id ];
1353
  } else {
1354
- // Prepare for remapping later
1355
- $meta[] = array(
1356
- 'key' => '_wxr_import_user',
1357
  'value' => $author_id,
1358
  );
1359
  $requires_remapping = true;
1360
 
1361
- // Wipe the user for now
1362
  $comment['user_id'] = 0;
1363
  }
1364
  }
1365
 
1366
- // Run standard core filters
1367
  $comment['comment_post_ID'] = $post_id;
1368
- $comment = wp_filter_comment( $comment );
1369
 
1370
- // wp_insert_comment expects slashed data
1371
- $comment_id = wp_insert_comment( wp_slash( $comment ) );
1372
  $this->mapping['comment'][ $original_id ] = $comment_id;
1373
  if ( $requires_remapping ) {
1374
  $this->requires_remapping['comment'][ $comment_id ] = true;
@@ -1385,7 +1502,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1385
  */
1386
  do_action( 'wp_import_insert_comment', $comment_id, $comment, $post_id, $post );
1387
 
1388
- // Process the meta items
1389
  foreach ( $meta as $meta_item ) {
1390
  $value = maybe_unserialize( $meta_item['value'] );
1391
  add_comment_meta( $comment_id, wp_slash( $meta_item['key'] ), wp_slash( $value ) );
@@ -1399,17 +1516,23 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1399
  * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
1400
  * @param array $post_id Parent post ID.
1401
  */
1402
- do_action( 'wxr_importer.processed.comment', $comment_id, $comment, $meta, $post_id );
1403
 
1404
  $num_comments++;
1405
- }// End foreach().
1406
 
1407
  return $num_comments;
1408
  }
1409
 
 
 
 
 
 
 
1410
  protected function parse_category_node( $node ) {
1411
  $data = array(
1412
- // Default taxonomy to "category", since this is a `<category>` tag
1413
  'taxonomy' => 'category',
1414
  );
1415
  $meta = array();
@@ -1421,14 +1544,14 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1421
  $data['slug'] = $node->getAttribute( 'nicename' );
1422
  }
1423
 
1424
- $data['name'] = $node->textContent;
1425
 
1426
  if ( empty( $data['slug'] ) ) {
1427
  return null;
1428
  }
1429
 
1430
- // Just for extra compatibility
1431
- if ( $data['taxonomy'] === 'tag' ) {
1432
  $data['taxonomy'] = 'post_tag';
1433
  }
1434
 
@@ -1438,8 +1561,8 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1438
  /**
1439
  * Callback for `usort` to sort comments by ID
1440
  *
1441
- * @param array $a Comment data for the first comment
1442
- * @param array $b Comment data for the second comment
1443
  * @return int
1444
  */
1445
  public static function sort_comments_by_id( $a, $b ) {
@@ -1454,38 +1577,44 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1454
  return $a['comment_id'] - $b['comment_id'];
1455
  }
1456
 
 
 
 
 
 
 
1457
  protected function parse_author_node( $node ) {
1458
  $data = array();
1459
  $meta = array();
1460
- foreach ( $node->childNodes as $child ) {
1461
- // We only care about child elements
1462
- if ( $child->nodeType !== XML_ELEMENT_NODE ) {
1463
  continue;
1464
  }
1465
 
1466
- switch ( $child->tagName ) {
1467
  case 'wp:author_login':
1468
- $data['user_login'] = $child->textContent;
1469
  break;
1470
 
1471
  case 'wp:author_id':
1472
- $data['ID'] = $child->textContent;
1473
  break;
1474
 
1475
  case 'wp:author_email':
1476
- $data['user_email'] = $child->textContent;
1477
  break;
1478
 
1479
  case 'wp:author_display_name':
1480
- $data['display_name'] = $child->textContent;
1481
  break;
1482
 
1483
  case 'wp:author_first_name':
1484
- $data['first_name'] = $child->textContent;
1485
  break;
1486
 
1487
  case 'wp:author_last_name':
1488
- $data['last_name'] = $child->textContent;
1489
  break;
1490
  }
1491
  }
@@ -1493,6 +1622,13 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1493
  return compact( 'data', 'meta' );
1494
  }
1495
 
 
 
 
 
 
 
 
1496
  protected function process_author( $data, $meta ) {
1497
  /**
1498
  * Pre-process user data.
@@ -1500,19 +1636,19 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1500
  * @param array $data User data. (Return empty to skip.)
1501
  * @param array $meta Meta data.
1502
  */
1503
- $data = apply_filters( 'wxr_importer.pre_process.user', $data, $meta );
1504
  if ( empty( $data ) ) {
1505
  return false;
1506
  }
1507
 
1508
  // Have we already handled this user?
1509
- $original_id = isset( $data['ID'] ) ? $data['ID'] : 0;
1510
  $original_slug = $data['user_login'];
1511
 
1512
  if ( isset( $this->mapping['user'][ $original_id ] ) ) {
1513
  $existing = $this->mapping['user'][ $original_id ];
1514
 
1515
- // Note the slug mapping if we need to too
1516
  if ( ! isset( $this->mapping['user_slug'][ $original_slug ] ) ) {
1517
  $this->mapping['user_slug'][ $original_slug ] = $existing;
1518
  }
@@ -1523,21 +1659,21 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1523
  if ( isset( $this->mapping['user_slug'][ $original_slug ] ) ) {
1524
  $existing = $this->mapping['user_slug'][ $original_slug ];
1525
 
1526
- // Ensure we note the mapping too
1527
  $this->mapping['user'][ $original_id ] = $existing;
1528
 
1529
  return false;
1530
  }
1531
 
1532
- // Allow overriding the user's slug
1533
  $login = $original_slug;
1534
  if ( isset( $this->user_slug_override[ $login ] ) ) {
1535
  $login = $this->user_slug_override[ $login ];
1536
  }
1537
 
1538
  $userdata = array(
1539
- 'user_login' => sanitize_user( $login, true ),
1540
- 'user_pass' => wp_generate_password(),
1541
  );
1542
 
1543
  $allowed = array(
@@ -1556,10 +1692,13 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1556
 
1557
  $user_id = wp_insert_user( wp_slash( $userdata ) );
1558
  if ( is_wp_error( $user_id ) ) {
1559
- $this->logger->error( sprintf(
1560
- __( 'Failed to import user "%s"', 'wordpress-importer' ),
1561
- $userdata['user_login']
1562
- ) );
 
 
 
1563
  $this->logger->debug( $user_id->get_error_message() );
1564
 
1565
  /**
@@ -1568,7 +1707,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1568
  * @param WP_Error $user_id Error object.
1569
  * @param array $userdata Raw data imported for the user.
1570
  */
1571
- do_action( 'wxr_importer.process_failed.user', $user_id, $userdata );
1572
  return false;
1573
  }
1574
 
@@ -1577,26 +1716,39 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1577
  }
1578
  $this->mapping['user_slug'][ $original_slug ] = $user_id;
1579
 
1580
- $this->logger->info( sprintf(
1581
- __( 'Imported user "%s"', 'wordpress-importer' ),
1582
- $userdata['user_login']
1583
- ) );
1584
- $this->logger->debug( sprintf(
1585
- __( 'User %1$d remapped to %2$d', 'wordpress-importer' ),
1586
- $original_id,
1587
- $user_id
1588
- ) );
1589
-
1590
- // TODO: Implement meta handling once WXR includes it
 
 
 
 
 
 
1591
  /**
1592
  * User processing completed.
1593
  *
1594
  * @param int $user_id New user ID.
1595
  * @param array $userdata Raw data imported for the user.
1596
  */
1597
- do_action( 'wxr_importer.processed.user', $user_id, $userdata );
1598
  }
1599
 
 
 
 
 
 
 
 
1600
  protected function parse_term_node( $node, $type = 'term' ) {
1601
  $data = array();
1602
  $meta = array();
@@ -1634,15 +1786,15 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1634
  break;
1635
  }
1636
 
1637
- foreach ( $node->childNodes as $child ) {
1638
- // We only care about child elements
1639
- if ( $child->nodeType !== XML_ELEMENT_NODE ) {
1640
  continue;
1641
  }
1642
 
1643
- $key = array_search( $child->tagName, $tag_name );
1644
  if ( $key ) {
1645
- $data[ $key ] = $child->textContent;
1646
  }
1647
  }
1648
 
@@ -1650,14 +1802,21 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1650
  return null;
1651
  }
1652
 
1653
- // Compatibility with WXR 1.0
1654
- if ( $data['taxonomy'] === 'tag' ) {
1655
  $data['taxonomy'] = 'post_tag';
1656
  }
1657
 
1658
  return compact( 'data', 'meta' );
1659
  }
1660
 
 
 
 
 
 
 
 
1661
  protected function process_term( $data, $meta ) {
1662
  /**
1663
  * Pre-process term data.
@@ -1665,16 +1824,16 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1665
  * @param array $data Term data. (Return empty to skip.)
1666
  * @param array $meta Meta data.
1667
  */
1668
- $data = apply_filters( 'wxr_importer.pre_process.term', $data, $meta );
1669
  if ( empty( $data ) ) {
1670
  return false;
1671
  }
1672
 
1673
- $original_id = isset( $data['id'] ) ? (int) $data['id'] : 0;
1674
- $parent_id = isset( $data['parent'] ) ? (int) $data['parent'] : 0;
1675
 
1676
  $mapping_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
1677
- $existing = $this->term_exists( $data );
1678
  if ( $existing ) {
1679
 
1680
  /**
@@ -1682,26 +1841,27 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1682
  *
1683
  * @param array $data Raw data imported for the term.
1684
  */
1685
- do_action( 'wxr_importer.process_already_imported.term', $data );
1686
 
1687
- $this->mapping['term'][ $mapping_key ] = $existing;
1688
  $this->mapping['term_id'][ $original_id ] = $existing;
1689
  return false;
1690
  }
1691
 
1692
- // WP really likes to repeat itself in export files
1693
  if ( isset( $this->mapping['term'][ $mapping_key ] ) ) {
1694
  return false;
1695
  }
1696
 
1697
  $termdata = array();
1698
- $allowed = array(
1699
- 'slug' => true,
1700
  'description' => true,
1701
  );
1702
 
1703
  // Map the parent comment, or mark it as one we need to fix
1704
- // TODO: add parent mapping and remapping
 
1705
  /*
1706
  $requires_remapping = false;
1707
  if ( $parent_id ) {
@@ -1716,6 +1876,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1716
  $data['parent'] = 0;
1717
  }
1718
  }*/
 
1719
 
1720
  foreach ( $data as $key => $value ) {
1721
  if ( ! isset( $allowed[ $key ] ) ) {
@@ -1727,11 +1888,14 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1727
 
1728
  $result = wp_insert_term( $data['name'], $data['taxonomy'], $termdata );
1729
  if ( is_wp_error( $result ) ) {
1730
- $this->logger->warning( sprintf(
1731
- __( 'Failed to import %1$s %2$s', 'wordpress-importer' ),
1732
- $data['taxonomy'],
1733
- $data['name']
1734
- ) );
 
 
 
1735
  $this->logger->debug( $result->get_error_message() );
1736
  do_action( 'wp_import_insert_term_failed', $result, $data );
1737
 
@@ -1742,25 +1906,31 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1742
  * @param array $data Raw data imported for the term.
1743
  * @param array $meta Meta data supplied for the term.
1744
  */
1745
- do_action( 'wxr_importer.process_failed.term', $result, $data, $meta );
1746
  return false;
1747
  }
1748
 
1749
  $term_id = $result['term_id'];
1750
 
1751
- $this->mapping['term'][ $mapping_key ] = $term_id;
1752
  $this->mapping['term_id'][ $original_id ] = $term_id;
1753
 
1754
- $this->logger->info( sprintf(
1755
- __( 'Imported "%1$s" (%2$s)', 'wordpress-importer' ),
1756
- $data['name'],
1757
- $data['taxonomy']
1758
- ) );
1759
- $this->logger->debug( sprintf(
1760
- __( 'Term %1$d remapped to %2$d', 'wordpress-importer' ),
1761
- $original_id,
1762
- $term_id
1763
- ) );
 
 
 
 
 
 
1764
 
1765
  do_action( 'wp_import_insert_term', $term_id, $data );
1766
 
@@ -1770,33 +1940,36 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1770
  * @param int $term_id New term ID.
1771
  * @param array $data Raw data imported for the term.
1772
  */
1773
- do_action( 'wxr_importer.processed.term', $term_id, $data );
1774
  }
1775
 
1776
  /**
1777
  * Attempt to download a remote file attachment
1778
  *
1779
- * @param string $url URL of item to fetch
1780
- * @param array $post Attachment details
1781
- * @return array|WP_Error Local file location details on success, WP_Error otherwise
1782
  */
1783
  protected function fetch_remote_file( $url, $post ) {
1784
- // extract the file name and extension from the url
1785
  $file_name = basename( $url );
1786
 
1787
- // get placeholder file in the upload dir with a unique, sanitized filename
1788
- $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );
1789
  if ( $upload['error'] ) {
1790
  return new WP_Error( 'upload_dir_error', $upload['error'] );
1791
  }
1792
 
1793
- // fetch the remote url and write it to the placeholder file
1794
- $response = wp_remote_get( $url, array(
1795
- 'stream' => true,
1796
- 'filename' => $upload['file'],
1797
- ) );
 
 
 
1798
 
1799
- // request failed
1800
  if ( is_wp_error( $response ) ) {
1801
  unlink( $upload['file'] );
1802
  return $response;
@@ -1804,12 +1977,13 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1804
 
1805
  $code = (int) wp_remote_retrieve_response_code( $response );
1806
 
1807
- // make sure the fetch was successful
1808
- if ( $code !== 200 ) {
1809
  unlink( $upload['file'] );
1810
  return new WP_Error(
1811
  'import_file_error',
1812
  sprintf(
 
1813
  __( 'Remote server returned %1$d %2$s for %3$s', 'wordpress-importer' ),
1814
  $code,
1815
  get_status_header_desc( $code ),
@@ -1819,7 +1993,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1819
  }
1820
 
1821
  $filesize = filesize( $upload['file'] );
1822
- $headers = wp_remote_retrieve_headers( $response );
1823
 
1824
  if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
1825
  unlink( $upload['file'] );
@@ -1834,6 +2008,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1834
  $max_size = (int) $this->max_attachment_size();
1835
  if ( ! empty( $max_size ) && $filesize > $max_size ) {
1836
  unlink( $upload['file'] );
 
1837
  $message = sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), size_format( $max_size ) );
1838
  return new WP_Error( 'import_file_error', $message );
1839
  }
@@ -1841,8 +2016,11 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1841
  return $upload;
1842
  }
1843
 
 
 
 
1844
  protected function post_process() {
1845
- // Time to tackle any left-over bits
1846
  if ( ! empty( $this->requires_remapping['post'] ) ) {
1847
  $this->post_process_posts( $this->requires_remapping['post'] );
1848
  }
@@ -1851,14 +2029,23 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1851
  }
1852
  }
1853
 
 
 
 
 
 
 
1854
  protected function post_process_posts( $todo ) {
1855
  foreach ( $todo as $post_id => $_ ) {
1856
- $this->logger->debug( sprintf(
1857
- // Note: title intentionally not used to skip extra processing
1858
- // for when debug logging is off
1859
- __( 'Running post-processing for post %d', 'wordpress-importer' ),
1860
- $post_id
1861
- ) );
 
 
 
1862
 
1863
  $data = array();
1864
 
@@ -1868,16 +2055,22 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1868
  if ( isset( $this->mapping['post'][ $parent_id ] ) ) {
1869
  $data['post_parent'] = $this->mapping['post'][ $parent_id ];
1870
  } else {
1871
- $this->logger->warning( sprintf(
1872
- __( 'Could not find the post parent for "%1$s" (post #%2$d)', 'wordpress-importer' ),
1873
- get_the_title( $post_id ),
1874
- $post_id
1875
- ) );
1876
- $this->logger->debug( sprintf(
1877
- __( 'Post %1$d was imported with parent %2$d, but could not be found', 'wordpress-importer' ),
1878
- $post_id,
1879
- $parent_id
1880
- ) );
 
 
 
 
 
 
1881
  }
1882
  }
1883
 
@@ -1887,25 +2080,31 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1887
  if ( isset( $this->mapping['user_slug'][ $author_slug ] ) ) {
1888
  $data['post_author'] = $this->mapping['user_slug'][ $author_slug ];
1889
  } else {
1890
- $this->logger->warning( sprintf(
1891
- __( 'Could not find the author for "%1$s" (post #%2$d)', 'wordpress-importer' ),
1892
- get_the_title( $post_id ),
1893
- $post_id
1894
- ) );
1895
- $this->logger->debug( sprintf(
1896
- __( 'Post %1$d was imported with author "%2$s", but could not be found', 'wordpress-importer' ),
1897
- $post_id,
1898
- $author_slug
1899
- ) );
 
 
 
 
 
 
1900
  }
1901
  }
1902
 
1903
  $has_attachments = get_post_meta( $post_id, '_wxr_import_has_attachment_refs', true );
1904
  if ( ! empty( $has_attachments ) ) {
1905
- $post = get_post( $post_id );
1906
  $content = $post->post_content;
1907
 
1908
- // Replace all the URLs we've got
1909
  $new_content = str_replace( array_keys( $this->url_remap ), $this->url_remap, $content );
1910
  if ( $new_content !== $content ) {
1911
  $data['post_content'] = $new_content;
@@ -1918,33 +2117,45 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1918
 
1919
  // Do we have updates to make?
1920
  if ( empty( $data ) ) {
1921
- $this->logger->debug( sprintf(
1922
- __( 'Post %d was marked for post-processing, but none was required.', 'wordpress-importer' ),
1923
- $post_id
1924
- ) );
 
 
 
1925
  continue;
1926
  }
1927
 
1928
- // Run the update
1929
  $data['ID'] = $post_id;
1930
- $result = wp_update_post( $data, true );
1931
  if ( is_wp_error( $result ) ) {
1932
- $this->logger->warning( sprintf(
1933
- __( 'Could not update "%1$s" (post #%2$d) with mapped data', 'wordpress-importer' ),
1934
- get_the_title( $post_id ),
1935
- $post_id
1936
- ) );
 
 
 
1937
  $this->logger->debug( $result->get_error_message() );
1938
  continue;
1939
  }
1940
 
1941
- // Clear out our temporary meta keys
1942
  delete_post_meta( $post_id, '_wxr_import_parent' );
1943
  delete_post_meta( $post_id, '_wxr_import_user_slug' );
1944
  delete_post_meta( $post_id, '_wxr_import_has_attachment_refs' );
1945
- }// End foreach().
1946
  }
1947
 
 
 
 
 
 
 
1948
  protected function post_process_menu_item( $post_id ) {
1949
  $menu_object_id = get_post_meta( $post_id, '_wxr_import_menu_item', true );
1950
  if ( empty( $menu_object_id ) ) {
@@ -1974,23 +2185,35 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
1974
  if ( ! empty( $menu_object ) ) {
1975
  update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $menu_object ) );
1976
  } else {
1977
- $this->logger->warning( sprintf(
1978
- __( 'Could not find the menu object for "%1$s" (post #%2$d)', 'wordpress-importer' ),
1979
- get_the_title( $post_id ),
1980
- $post_id
1981
- ) );
1982
- $this->logger->debug( sprintf(
1983
- __( 'Post %1$d was imported with object "%2$d" of type "%3$s", but could not be found', 'wordpress-importer' ),
1984
- $post_id,
1985
- $menu_object_id,
1986
- $menu_item_type
1987
- ) );
 
 
 
 
 
 
1988
  }
1989
 
1990
  delete_post_meta( $post_id, '_wxr_import_menu_item' );
1991
  }
1992
 
1993
 
 
 
 
 
 
 
1994
  protected function post_process_comments( $todo ) {
1995
  foreach ( $todo as $comment_id => $_ ) {
1996
  $data = array();
@@ -2001,15 +2224,21 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2001
  if ( isset( $this->mapping['comment'][ $parent_id ] ) ) {
2002
  $data['comment_parent'] = $this->mapping['comment'][ $parent_id ];
2003
  } else {
2004
- $this->logger->warning( sprintf(
2005
- __( 'Could not find the comment parent for comment #%d', 'wordpress-importer' ),
2006
- $comment_id
2007
- ) );
2008
- $this->logger->debug( sprintf(
2009
- __( 'Comment %1$d was imported with parent %2$d, but could not be found', 'wordpress-importer' ),
2010
- $comment_id,
2011
- $parent_id
2012
- ) );
 
 
 
 
 
 
2013
  }
2014
  }
2015
 
@@ -2019,15 +2248,21 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2019
  if ( isset( $this->mapping['user'][ $author_id ] ) ) {
2020
  $data['user_id'] = $this->mapping['user'][ $author_id ];
2021
  } else {
2022
- $this->logger->warning( sprintf(
2023
- __( 'Could not find the author for comment #%d', 'wordpress-importer' ),
2024
- $comment_id
2025
- ) );
2026
- $this->logger->debug( sprintf(
2027
- __( 'Comment %1$d was imported with author %2$d, but could not be found', 'wordpress-importer' ),
2028
- $comment_id,
2029
- $author_id
2030
- ) );
 
 
 
 
 
 
2031
  }
2032
  }
2033
 
@@ -2036,21 +2271,24 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2036
  continue;
2037
  }
2038
 
2039
- // Run the update
2040
- $data['comment_ID'] = $comment_ID;
2041
- $result = wp_update_comment( wp_slash( $data ) );
2042
  if ( empty( $result ) ) {
2043
- $this->logger->warning( sprintf(
2044
- __( 'Could not update comment #%d with mapped data', 'wordpress-importer' ),
2045
- $comment_id
2046
- ) );
 
 
 
2047
  continue;
2048
  }
2049
 
2050
- // Clear out our temporary meta keys
2051
  delete_comment_meta( $comment_id, '_wxr_import_parent' );
2052
  delete_comment_meta( $comment_id, '_wxr_import_user' );
2053
- }// End foreach().
2054
  }
2055
 
2056
  /**
@@ -2058,30 +2296,30 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2058
  */
2059
  protected function replace_attachment_urls_in_content() {
2060
  global $wpdb;
2061
- // make sure we do the longest urls first, in case one is a substring of another
2062
  uksort( $this->url_remap, array( $this, 'cmpr_strlen' ) );
2063
 
2064
  foreach ( $this->url_remap as $from_url => $to_url ) {
2065
- // remap urls in post_content
2066
  $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url );
2067
- $wpdb->query( $query );
2068
 
2069
- // remap enclosure urls
2070
- $query = $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url );
2071
- $result = $wpdb->query( $query );
2072
  }
2073
  }
2074
 
2075
  /**
2076
  * Update _thumbnail_id meta to new, imported attachment IDs
2077
  */
2078
- function remap_featured_images() {
2079
- // cycle through posts that have a featured image
2080
  foreach ( $this->featured_images as $post_id => $value ) {
2081
  if ( isset( $this->processed_posts[ $value ] ) ) {
2082
  $new_id = $this->processed_posts[ $value ];
2083
 
2084
- // only update if there's a difference
2085
  if ( $new_id !== $value ) {
2086
  update_post_meta( $post_id, '_thumbnail_id', $new_id );
2087
  }
@@ -2092,13 +2330,13 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2092
  /**
2093
  * Decide if the given meta key maps to information we will want to import
2094
  *
2095
- * @param string $key The meta key to check
2096
- * @return string|bool The key if we do want to import, false if not
2097
  */
2098
  public function is_valid_meta_key( $key ) {
2099
  // skip attachment metadata since we'll regenerate it from scratch
2100
- // skip _edit_lock as not relevant for import
2101
- if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) {
2102
  return false;
2103
  }
2104
 
@@ -2118,15 +2356,22 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2118
  /**
2119
  * Added to http_request_timeout filter to force timeout at 60 seconds during import
2120
  *
2121
- * @access protected
 
2122
  * @return int 60
2123
  */
2124
- function bump_request_timeout( $val ) {
2125
  return 60;
2126
  }
2127
 
2128
- // return the difference in length between two strings
2129
- function cmpr_strlen( $a, $b ) {
 
 
 
 
 
 
2130
  return strlen( $b ) - strlen( $a );
2131
  }
2132
 
@@ -2158,20 +2403,20 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2158
  * @return int|bool Existing post ID if it exists, false otherwise.
2159
  */
2160
  protected function post_exists( $data ) {
2161
- // Constant-time lookup if we prefilled
2162
  $exists_key = $data['guid'];
2163
 
2164
  if ( $this->options['prefill_existing_posts'] ) {
2165
  return isset( $this->exists['post'][ $exists_key ] ) ? $this->exists['post'][ $exists_key ] : false;
2166
  }
2167
 
2168
- // No prefilling, but might have already handled it
2169
  if ( isset( $this->exists['post'][ $exists_key ] ) ) {
2170
  return $this->exists['post'][ $exists_key ];
2171
  }
2172
 
2173
- // Still nothing, try post_exists, and cache it
2174
- $exists = post_exists( $data['post_title'], $data['post_content'], $data['post_date'] );
2175
  $this->exists['post'][ $exists_key ] = $exists;
2176
 
2177
  return $exists;
@@ -2184,7 +2429,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2184
  * @param int $post_id Post ID.
2185
  */
2186
  protected function mark_post_exists( $data, $post_id ) {
2187
- $exists_key = $data['guid'];
2188
  $this->exists['post'][ $exists_key ] = $post_id;
2189
  }
2190
 
@@ -2198,7 +2443,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2198
  $posts = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_date FROM {$wpdb->comments}" );
2199
 
2200
  foreach ( $posts as $item ) {
2201
- $exists_key = sha1( $item->comment_author . ':' . $item->comment_date );
2202
  $this->exists['comment'][ $exists_key ] = $item->comment_ID;
2203
  }
2204
  }
@@ -2212,18 +2457,18 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2212
  protected function comment_exists( $data ) {
2213
  $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] );
2214
 
2215
- // Constant-time lookup if we prefilled
2216
  if ( $this->options['prefill_existing_comments'] ) {
2217
  return isset( $this->exists['comment'][ $exists_key ] ) ? $this->exists['comment'][ $exists_key ] : false;
2218
  }
2219
 
2220
- // No prefilling, but might have already handled it
2221
  if ( isset( $this->exists['comment'][ $exists_key ] ) ) {
2222
  return $this->exists['comment'][ $exists_key ];
2223
  }
2224
 
2225
- // Still nothing, try comment_exists, and cache it
2226
- $exists = comment_exists( $data['comment_author'], $data['comment_date'] );
2227
  $this->exists['comment'][ $exists_key ] = $exists;
2228
 
2229
  return $exists;
@@ -2236,7 +2481,7 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2236
  * @param int $comment_id Comment ID.
2237
  */
2238
  protected function mark_comment_exists( $data, $comment_id ) {
2239
- $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] );
2240
  $this->exists['comment'][ $exists_key ] = $comment_id;
2241
  }
2242
 
@@ -2247,12 +2492,12 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2247
  */
2248
  protected function prefill_existing_terms() {
2249
  global $wpdb;
2250
- $query = "SELECT t.term_id, tt.taxonomy, t.slug FROM {$wpdb->terms} AS t";
2251
  $query .= " JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id";
2252
- $terms = $wpdb->get_results( $query );
2253
 
2254
  foreach ( $terms as $item ) {
2255
- $exists_key = sha1( $item->taxonomy . ':' . $item->slug );
2256
  $this->exists['term'][ $exists_key ] = $item->term_id;
2257
  }
2258
  }
@@ -2266,17 +2511,17 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2266
  protected function term_exists( $data ) {
2267
  $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
2268
 
2269
- // Constant-time lookup if we prefilled
2270
  if ( $this->options['prefill_existing_terms'] ) {
2271
  return isset( $this->exists['term'][ $exists_key ] ) ? $this->exists['term'][ $exists_key ] : false;
2272
  }
2273
 
2274
- // No prefilling, but might have already handled it
2275
  if ( isset( $this->exists['term'][ $exists_key ] ) ) {
2276
  return $this->exists['term'][ $exists_key ];
2277
  }
2278
 
2279
- // Still nothing, try comment_exists, and cache it
2280
  $exists = term_exists( $data['slug'], $data['taxonomy'] );
2281
  if ( is_array( $exists ) ) {
2282
  $exists = $exists['term_id'];
@@ -2294,8 +2539,8 @@ if( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
2294
  * @param int $term_id Term ID.
2295
  */
2296
  protected function mark_term_exists( $data, $term_id ) {
2297
- $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
2298
  $this->exists['term'][ $exists_key ] = $term_id;
2299
  }
2300
  }
2301
- endif;
1
  <?php
2
+ /**
3
+ * WXR Importer
4
+ *
5
+ * @package WXR Importer
6
+ */
7
 
8
+ if ( ! class_exists( 'WXR_Importer' ) && class_exists( 'WP_Importer' ) ) :
9
+
10
+ /**
11
+ * WXR Importer
12
+ */
13
  class WXR_Importer extends WP_Importer {
14
  /**
15
  * Maximum supported WXR version
45
  */
46
  protected $version = '1.0';
47
 
48
+ // information to import from WXR file.
49
+ /**
50
+ * Categories
51
+ *
52
+ * @var array
53
+ */
54
  protected $categories = array();
55
+
56
+ /**
57
+ * Tags
58
+ *
59
+ * @var array
60
+ */
61
  protected $tags = array();
62
+
63
+ /**
64
+ * Base Url
65
+ *
66
+ * @var string
67
+ */
68
  protected $base_url = '';
69
 
70
+ // TODO: REMOVE THESE.
71
+ /**
72
+ * Processed Terms
73
+ *
74
+ * @var array
75
+ */
76
  protected $processed_terms = array();
77
+
78
+ /**
79
+ * Processed Posts
80
+ *
81
+ * @var array
82
+ */
83
  protected $processed_posts = array();
84
+
85
+ /**
86
+ * Processed Menu Items
87
+ *
88
+ * @var array
89
+ */
90
  protected $processed_menu_items = array();
91
+
92
+ /**
93
+ * Menu Item Orphans
94
+ *
95
+ * @var array
96
+ */
97
  protected $menu_item_orphans = array();
98
+
99
+ /**
100
+ * Missing Menu Items
101
+ *
102
+ * @var array
103
+ */
104
  protected $missing_menu_items = array();
105
 
106
+
107
+ // NEW STYLE.
108
+ /**
109
+ * Mapping
110
+ *
111
+ * @var array
112
+ */
113
  protected $mapping = array();
114
+
115
+ /**
116
+ * Requires Remapping
117
+ *
118
+ * @var array
119
+ */
120
  protected $requires_remapping = array();
121
+
122
+ /**
123
+ * Exists
124
+ *
125
+ * @var array
126
+ */
127
  protected $exists = array();
128
+
129
+ /**
130
+ * User Slug Override
131
+ *
132
+ * @var array
133
+ */
134
  protected $user_slug_override = array();
135
 
136
+
137
+ /**
138
+ * Url Remap
139
+ *
140
+ * @var array
141
+ */
142
  protected $url_remap = array();
143
+
144
+ /**
145
+ * Featured Images
146
+ *
147
+ * @var array
148
+ */
149
  protected $featured_images = array();
150
 
151
+
152
  /**
153
  * Logger instance.
154
  *
159
  /**
160
  * Constructor
161
  *
162
+ * @param array $options {.
163
+ * @var bool $prefill_existing_posts Should we prefill `post_exists` calls? (True prefills and uses more memory, false checks once per imported post and takes longer. Default is true.).
164
+ * @var bool $prefill_existing_comments Should we prefill `comment_exists` calls? (True prefills and uses more memory, false checks once per imported comment and takes longer. Default is true.).
165
+ * @var bool $prefill_existing_terms Should we prefill `term_exists` calls? (True prefills and uses more memory, false checks once per imported term and takes longer. Default is true.).
166
+ * @var bool $update_attachment_guids Should attachment GUIDs be updated to the new URL? (True updates the GUID, which keeps compatibility with v1, false doesn't update, and allows deduplication and reimporting. Default is false.).
167
+ * @var bool $fetch_attachments Fetch attachments from the remote server. (True fetches and creates attachment posts, false skips attachments. Default is false.).
168
+ * @var bool $aggressive_url_search Should we search/replace for URLs aggressively? (True searches all posts' content for old URLs and replaces, false checks for `<img class="wp-image-*">` only. Default is false.).
169
+ * @var int $default_author User ID to use if author is missing or invalid. (Default is null, which leaves posts unassigned.).
170
  * }
171
  */
172
  public function __construct( $options = array() ) {
173
+ // Initialize some important variables.
174
  $empty_types = array(
175
  'post' => array(),
176
  'comment' => array(),
178
  'user' => array(),
179
  );
180
 
181
+ $this->mapping = $empty_types;
182
  $this->mapping['user_slug'] = array();
183
+ $this->mapping['term_id'] = array();
184
+ $this->requires_remapping = $empty_types;
185
+ $this->exists = $empty_types;
186
+
187
+ $this->options = wp_parse_args(
188
+ $options,
189
+ array(
190
+ 'prefill_existing_posts' => true,
191
+ 'prefill_existing_comments' => true,
192
+ 'prefill_existing_terms' => true,
193
+ 'update_attachment_guids' => false,
194
+ 'fetch_attachments' => false,
195
+ 'aggressive_url_search' => false,
196
+ 'default_author' => null,
197
+ )
198
+ );
199
  }
200
 
201
+ /**
202
+ * Set Logger
203
+ *
204
+ * @param object $logger Logger object.
205
+ */
206
  public function set_logger( $logger ) {
207
  $this->logger = $logger;
208
  }
214
  * @return XMLReader|WP_Error Reader instance on success, error otherwise.
215
  */
216
  protected function get_reader( $file ) {
217
+ // Avoid loading external entities for security.
218
  $old_value = null;
 
 
 
219
 
220
  $reader = new XMLReader();
221
  $status = $reader->open( $file );
222
 
 
 
 
 
223
  if ( ! $status ) {
224
  return new WP_Error( 'wxr_importer.cannot_parse', __( 'Could not open the file for parsing', 'wordpress-importer' ) );
225
  }
230
  /**
231
  * The main controller for the actual import stage.
232
  *
233
+ * @param string $file Path to the WXR file for importing.
234
  */
235
  public function get_preliminary_information( $file ) {
236
+ // Let's run the actual importer now, woot.
237
  $reader = $this->get_reader( $file );
238
  if ( is_wp_error( $reader ) ) {
239
  return $reader;
240
  }
241
 
242
+ // Set the version to compatibility mode first.
243
  $this->version = '1.0';
244
 
245
  // Start parsing!
246
  $data = new WXR_Import_Info();
247
  while ( $reader->read() ) {
248
+ // Only deal with element opens.
249
+ if ( XMLReader::ELEMENT !== $reader->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
250
  continue;
251
  }
252
 
253
  switch ( $reader->name ) {
254
  case 'wp:wxr_version':
255
+ // Upgrade to the correct version.
256
  $this->version = $reader->readString();
257
 
258
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
259
+ $this->logger->warning(
260
+ sprintf(
261
+ /* translators: %1$s is WXR version, %2$s is max supported WXR version. */
262
+ __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
263
+ $this->version,
264
+ self::MAX_WXR_VERSION
265
+ )
266
+ );
267
  }
268
 
269
+ // Handled everything in this node, move on to the next.
270
  $reader->next();
271
  break;
272
 
297
  if ( is_wp_error( $parsed ) ) {
298
  $this->log_error( $parsed );
299
 
300
+ // Skip the rest of this post.
301
  $reader->next();
302
  break;
303
  }
304
 
305
  $data->users[] = $parsed;
306
 
307
+ // Handled everything in this node, move on to the next.
308
  $reader->next();
309
  break;
310
 
311
  case 'item':
312
+ $node = $reader->expand();
313
  $parsed = $this->parse_post_node( $node );
314
  if ( is_wp_error( $parsed ) ) {
315
  $this->log_error( $parsed );
316
 
317
+ // Skip the rest of this post.
318
  $reader->next();
319
  break;
320
  }
321
 
322
+ if ( 'attachment' === $parsed['data']['post_type'] ) {
323
  $data->media_count++;
324
  } else {
325
  $data->post_count++;
326
  }
327
  $data->comment_count += count( $parsed['comments'] );
328
 
329
+ // Handled everything in this node, move on to the next.
330
  $reader->next();
331
  break;
332
 
335
  case 'wp:term':
336
  $data->term_count++;
337
 
338
+ // Handled everything in this node, move on to the next.
339
  $reader->next();
340
  break;
341
+ }
342
+ }
343
 
344
  $data->version = $this->version;
345
 
349
  /**
350
  * The main controller for the actual import stage.
351
  *
352
+ * @param string $file Path to the WXR file for importing.
353
  */
354
  public function parse_authors( $file ) {
355
+ // Let's run the actual importer now, woot.
356
  $reader = $this->get_reader( $file );
357
  if ( is_wp_error( $reader ) ) {
358
  return $reader;
359
  }
360
 
361
+ // Set the version to compatibility mode first.
362
  $this->version = '1.0';
363
 
364
  // Start parsing!
365
  $authors = array();
366
  while ( $reader->read() ) {
367
+ // Only deal with element opens.
368
+ if ( XMLReader::ELEMENT !== $reader->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
369
  continue;
370
  }
371
 
372
  switch ( $reader->name ) {
373
  case 'wp:wxr_version':
374
+ // Upgrade to the correct version.
375
  $this->version = $reader->readString();
376
 
377
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
378
+ $this->logger->warning(
379
+ sprintf(
380
+ /* translators: %1$s is WXR version, %2$s is max supported WXR version. */
381
+ __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
382
+ $this->version,
383
+ self::MAX_WXR_VERSION
384
+ )
385
+ );
386
  }
387
 
388
+ // Handled everything in this node, move on to the next.
389
  $reader->next();
390
  break;
391
 
396
  if ( is_wp_error( $parsed ) ) {
397
  $this->log_error( $parsed );
398
 
399
+ // Skip the rest of this post.
400
  $reader->next();
401
  break;
402
  }
403
 
404
  $authors[] = $parsed;
405
 
406
+ // Handled everything in this node, move on to the next.
407
  $reader->next();
408
  break;
409
  }
410
+ }
411
 
412
  return $authors;
413
  }
415
  /**
416
  * The main controller for the actual import stage.
417
  *
418
+ * @param string $file Path to the WXR file for importing.
419
  */
420
  public function import( $file ) {
421
  add_filter( 'import_post_meta_key', array( $this, 'is_valid_meta_key' ) );
426
  return $result;
427
  }
428
 
429
+ // Let's run the actual importer now, woot.
430
  $reader = $this->get_reader( $file );
431
  if ( is_wp_error( $reader ) ) {
432
  return $reader;
433
  }
434
 
435
+ // Set the version to compatibility mode first.
436
  $this->version = '1.0';
437
 
438
+ // Reset other variables.
439
  $this->base_url = '';
440
 
441
  // Start parsing!
442
  while ( $reader->read() ) {
443
+ // Only deal with element opens.
444
+ if ( XMLReader::ELEMENT !== $reader->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
445
  continue;
446
  }
447
 
448
  switch ( $reader->name ) {
449
  case 'wp:wxr_version':
450
+ // Upgrade to the correct version.
451
  $this->version = $reader->readString();
452
 
453
  if ( version_compare( $this->version, self::MAX_WXR_VERSION, '>' ) ) {
454
+ $this->logger->warning(
455
+ sprintf(
456
+ /* translators: %1$s is WXR version, %2$s is max supported WXR version. */
457
+ __( 'This WXR file (version %1$s) is newer than the importer (version %2$s) and may not be supported. Please consider updating.', 'wordpress-importer' ),
458
+ $this->version,
459
+ self::MAX_WXR_VERSION
460
+ )
461
+ );
462
  }
463
 
464
+ // Handled everything in this node, move on to the next.
465
  $reader->next();
466
  break;
467
 
468
  case 'wp:base_site_url':
469
  $this->base_url = $reader->readString();
470
 
471
+ // Handled everything in this node, move on to the next.
472
  $reader->next();
473
  break;
474
 
475
  case 'item':
476
+ $node = $reader->expand();
477
  $parsed = $this->parse_post_node( $node );
478
  if ( is_wp_error( $parsed ) ) {
479
  $this->log_error( $parsed );
480
 
481
+ // Skip the rest of this post.
482
  $reader->next();
483
  break;
484
  }
485
 
486
  $this->process_post( $parsed['data'], $parsed['meta'], $parsed['comments'], $parsed['terms'] );
487
 
488
+ // Handled everything in this node, move on to the next.
489
  $reader->next();
490
  break;
491
 
496
  if ( is_wp_error( $parsed ) ) {
497
  $this->log_error( $parsed );
498
 
499
+ // Skip the rest of this post.
500
  $reader->next();
501
  break;
502
  }
506
  $this->log_error( $status );
507
  }
508
 
509
+ // Handled everything in this node, move on to the next.
510
  $reader->next();
511
  break;
512
 
517
  if ( is_wp_error( $parsed ) ) {
518
  $this->log_error( $parsed );
519
 
520
+ // Skip the rest of this post.
521
  $reader->next();
522
  break;
523
  }
524
 
525
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
526
 
527
+ // Handled everything in this node, move on to the next.
528
  $reader->next();
529
  break;
530
 
535
  if ( is_wp_error( $parsed ) ) {
536
  $this->log_error( $parsed );
537
 
538
+ // Skip the rest of this post.
539
  $reader->next();
540
  break;
541
  }
542
 
543
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
544
 
545
+ // Handled everything in this node, move on to the next.
546
  $reader->next();
547
  break;
548
 
553
  if ( is_wp_error( $parsed ) ) {
554
  $this->log_error( $parsed );
555
 
556
+ // Skip the rest of this post.
557
  $reader->next();
558
  break;
559
  }
560
 
561
  $status = $this->process_term( $parsed['data'], $parsed['meta'] );
562
 
563
+ // Handled everything in this node, move on to the next.
564
  $reader->next();
565
  break;
566
 
567
  default:
568
+ // Skip this node, probably handled by something already.
569
  break;
570
+ }
571
+ }
572
 
573
  // Now that we've done the main processing, do any required
574
  // post-processing and remapping.
577
  if ( $this->options['aggressive_url_search'] ) {
578
  $this->replace_attachment_urls_in_content();
579
  }
580
+ // phpcs:disable
581
  // $this->remap_featured_images();
582
+ // phpcs:enable
583
  $this->import_end();
584
  }
585
 
591
  protected function log_error( WP_Error $error ) {
592
  $this->logger->warning( $error->get_error_message() );
593
 
594
+ // Log the data as debug info too.
595
  $data = $error->get_error_data();
596
  if ( ! empty( $data ) ) {
597
+ $this->logger->debug( var_export( $data, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
598
  }
599
  }
600
 
601
  /**
602
  * Parses the WXR file and prepares us for the task of processing parsed data
603
  *
604
+ * @param string $file Path to the WXR file for importing.
605
  */
606
  protected function import_start( $file ) {
607
  if ( ! is_file( $file ) ) {
608
  return new WP_Error( 'wxr_importer.file_missing', __( 'The file does not exist, please try again.', 'wordpress-importer' ) );
609
  }
610
 
611
+ // Suspend bunches of stuff in WP core.
612
  wp_defer_term_counting( true );
613
  wp_defer_comment_counting( true );
614
  wp_suspend_cache_invalidation( true );
615
 
616
+ // Prefill exists calls if told to.
617
  if ( $this->options['prefill_existing_posts'] ) {
618
  $this->prefill_existing_posts();
619
  }
637
  * Performs post-import cleanup of files and the cache
638
  */
639
  protected function import_end() {
640
+ // Re-enable stuff in core.
641
  wp_suspend_cache_invalidation( false );
642
  wp_cache_flush();
643
  foreach ( get_taxonomies() as $tax ) {
660
  /**
661
  * Set the user mapping.
662
  *
663
+ * @param array $mapping List of map arrays (containing `old_slug`, `old_id`, `new_id`).
664
  */
665
  public function set_user_mapping( $mapping ) {
666
  foreach ( $mapping as $map ) {
667
  if ( empty( $map['old_slug'] ) || empty( $map['old_id'] ) || empty( $map['new_id'] ) ) {
668
  $this->logger->warning( __( 'Invalid author mapping', 'wordpress-importer' ) );
669
+ $this->logger->debug( var_export( $map, true ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
670
  continue;
671
  }
672
 
699
  * @return array|WP_Error Post data array on success, error otherwise.
700
  */
701
  protected function parse_post_node( $node ) {
702
+ $data = array();
703
+ $meta = array();
704
  $comments = array();
705
+ $terms = array();
706
 
707
+ foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
708
+ // We only care about child elements.
709
+ if ( XML_ELEMENT_NODE !== $child->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
710
  continue;
711
  }
712
 
713
+ switch ( $child->tagName ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
714
  case 'wp:post_type':
715
+ $data['post_type'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
716
  break;
717
 
718
  case 'title':
719
+ $data['post_title'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
720
  break;
721
 
722
  case 'guid':
723
+ $data['guid'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
724
  break;
725
 
726
  case 'dc:creator':
727
+ $data['post_author'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
728
  break;
729
 
730
  case 'content:encoded':
731
+ $data['post_content'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
732
  break;
733
 
734
  case 'excerpt:encoded':
735
+ $data['post_excerpt'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
736
  break;
737
 
738
  case 'wp:post_id':
739
+ $data['post_id'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
740
  break;
741
 
742
  case 'wp:post_date':
743
+ $data['post_date'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
744
  break;
745
 
746
  case 'wp:post_date_gmt':
747
+ $data['post_date_gmt'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
748
  break;
749
 
750
  case 'wp:comment_status':
751
+ $data['comment_status'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
752
  break;
753
 
754
  case 'wp:ping_status':
755
+ $data['ping_status'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
756
  break;
757
 
758
  case 'wp:post_name':
759
+ $data['post_name'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
760
  break;
761
 
762
  case 'wp:status':
763
+ $data['post_status'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
764
 
765
+ if ( 'auto-draft' === $data['post_status'] ) {
766
+ // Bail now.
767
  return new WP_Error(
768
  'wxr_importer.post.cannot_import_draft',
769
  __( 'Cannot import auto-draft posts' ),
773
  break;
774
 
775
  case 'wp:post_parent':
776
+ $data['post_parent'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
777
  break;
778
 
779
  case 'wp:menu_order':
780
+ $data['menu_order'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
781
  break;
782
 
783
  case 'wp:post_password':
784
+ $data['post_password'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
785
  break;
786
 
787
  case 'wp:is_sticky':
788
+ $data['is_sticky'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
789
  break;
790
 
791
  case 'wp:attachment_url':
792
+ $data['attachment_url'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
793
  break;
794
 
795
  case 'wp:postmeta':
812
  $terms[] = $term_item;
813
  }
814
  break;
815
+ }
816
+ }
817
 
818
  return compact( 'data', 'meta', 'comments', 'terms' );
819
  }
825
  * Doesn't create a new post if: the post type doesn't exist, the given post ID
826
  * is already noted as imported or a post with the same title and date already exists.
827
  * Note that new/updated terms, comments and meta are imported for the last of the above.
828
+ *
829
+ * @param array $data Post data. (Return empty to skip.).
830
+ * @param array $meta Meta data.
831
+ * @param array $comments Comments on the post.
832
+ * @param array $terms Terms on the post.
833
  */
834
  protected function process_post( $data, $meta, $comments, $terms ) {
835
  /**
840
  * @param array $comments Comments on the post.
841
  * @param array $terms Terms on the post.
842
  */
843
+ $data = apply_filters( 'wxr_importer.pre_process.post', $data, $meta, $comments, $terms ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
844
  if ( empty( $data ) ) {
845
  return false;
846
  }
847
 
848
+ $original_id = isset( $data['post_id'] ) ? (int) $data['post_id'] : 0;
849
  $parent_id = isset( $data['post_parent'] ) ? (int) $data['post_parent'] : 0;
850
  $author_id = isset( $data['post_author'] ) ? (int) $data['post_author'] : 0;
851
 
858
 
859
  // Is this type even valid?
860
  if ( ! $post_type_object ) {
861
+ $this->logger->warning(
862
+ sprintf(
863
+ /* translators: %1$s is the import message, %2$s is post type. */
864
+ __( 'Failed to import "%1$s": Invalid post type %2$s', 'wordpress-importer' ),
865
+ $data['post_title'],
866
+ $data['post_type']
867
+ )
868
+ );
869
  return false;
870
  }
871
 
872
  $post_exists = $this->post_exists( $data );
873
  if ( $post_exists ) {
874
+ $this->logger->info(
875
+ sprintf(
876
+ /* translators: %1$s single post type, %2$s is post title. */
877
+ __( '%1$s "%2$s" already exists.', 'wordpress-importer' ),
878
+ $post_type_object->labels->singular_name,
879
+ $data['post_title']
880
+ )
881
+ );
882
 
883
  /**
884
  * Post processing already imported.
885
  *
886
  * @param array $data Raw data imported for the post.
887
  */
888
+ do_action( 'wxr_importer.process_already_imported.post', $data ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
889
 
890
+ // Even though this post already exists, new comments might need importing.
891
  $this->process_comments( $comments, $original_id, $data, $post_exists );
892
 
893
  return false;
894
  }
895
 
896
+ // Map the parent post, or mark it as one we need to fix.
897
  $requires_remapping = false;
898
  if ( $parent_id ) {
899
  if ( isset( $this->mapping['post'][ $parent_id ] ) ) {
900
  $data['post_parent'] = $this->mapping['post'][ $parent_id ];
901
  } else {
902
+ $meta[] = array(
903
+ 'key' => '_wxr_import_parent',
904
  'value' => $parent_id,
905
  );
906
  $requires_remapping = true;
909
  }
910
  }
911
 
912
+ // Map the author, or mark it as one we need to fix.
913
  $author = sanitize_user( $data['post_author'], true );
914
  if ( empty( $author ) ) {
915
  // Missing or invalid author, use default if available.
917
  } elseif ( isset( $this->mapping['user_slug'][ $author ] ) ) {
918
  $data['post_author'] = $this->mapping['user_slug'][ $author ];
919
  } else {
920
+ $meta[] = array(
921
+ 'key' => '_wxr_import_user_slug',
922
  'value' => $author,
923
  );
924
  $requires_remapping = true;
928
 
929
  // Does the post look like it contains attachment images?
930
  if ( preg_match( self::REGEX_HAS_ATTACHMENT_REFS, $data['post_content'] ) ) {
931
+ $meta[] = array(
932
+ 'key' => '_wxr_import_has_attachment_refs',
933
  'value' => true,
934
  );
935
  $requires_remapping = true;
936
  }
937
 
938
+ // Whitelist to just the keys we allow.
939
  $postdata = array(
940
  'import_id' => $data['post_id'],
941
  );
942
+ $allowed = array(
943
  'post_author' => true,
944
  'post_date' => true,
945
  'post_date_gmt' => true,
968
 
969
  if ( 'attachment' === $postdata['post_type'] ) {
970
  if ( ! $this->options['fetch_attachments'] ) {
971
+ $this->logger->notice(
972
+ sprintf(
973
+ /* translators: %s is post title */
974
+ __( 'Skipping attachment "%s", fetching attachments disabled' ),
975
+ $data['post_title']
976
+ )
977
+ );
978
  /**
979
  * Post processing skipped.
980
  *
981
  * @param array $data Raw data imported for the post.
982
  * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
983
  */
984
+ do_action( 'wxr_importer.process_skipped.post', $data, $meta ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
985
  return false;
986
  }
987
  $remote_url = ! empty( $data['attachment_url'] ) ? $data['attachment_url'] : $data['guid'];
988
+ $post_id = $this->process_attachment( $postdata, $meta, $remote_url );
989
  } else {
990
  $post_id = wp_insert_post( $postdata, true );
991
  do_action( 'wp_import_insert_post', $post_id, $original_id, $postdata, $data );
992
  }
993
 
994
  if ( is_wp_error( $post_id ) ) {
995
+ $this->logger->error(
996
+ sprintf(
997
+ /* translators: %1$s is the post title, %2$s is post type. */
998
+ __( 'Failed to import "%1$s" (%2$s)', 'wordpress-importer' ),
999
+ $data['post_title'],
1000
+ $post_type_object->labels->singular_name
1001
+ )
1002
+ );
1003
  $this->logger->debug( $post_id->get_error_message() );
1004
 
1005
  /**
1011
  * @param array $comments Raw comment data, already processed by {@see process_comments}.
1012
  * @param array $terms Raw term data, already processed.
1013
  */
1014
+ do_action( 'wxr_importer.process_failed.post', $post_id, $data, $meta, $comments, $terms ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1015
  return false;
1016
  }
1017
 
1018
+ // Ensure stickiness is handled correctly too.
1019
+ if ( '1' === $data['is_sticky'] ) {
1020
  stick_post( $post_id );
1021
  }
1022
 
1023
+ // map pre-import ID to local ID.
1024
  $this->mapping['post'][ $original_id ] = (int) $post_id;
1025
  if ( $requires_remapping ) {
1026
  $this->requires_remapping['post'][ $post_id ] = true;
1027
  }
1028
  $this->mark_post_exists( $data, $post_id );
1029
 
1030
+ $this->logger->info(
1031
+ sprintf(
1032
+ /* translators: %1$s is the post title, %2$s is post type. */
1033
+ __( 'Imported "%1$s" (%2$s)', 'wordpress-importer' ),
1034
+ $data['post_title'],
1035
+ $post_type_object->labels->singular_name
1036
+ )
1037
+ );
1038
+ $this->logger->debug(
1039
+ sprintf(
1040
+ /* translators: %1$s is the original post id, %2$s is old post id. */
1041
+ __( 'Post %1$d remapped to %2$d', 'wordpress-importer' ),
1042
+ $original_id,
1043
+ $post_id
1044
+ )
1045
+ );
1046
+
1047
+ // Handle the terms too.
1048
  $terms = apply_filters( 'wp_import_post_terms', $terms, $post_id, $data );
1049
 
1050
  if ( ! empty( $terms ) ) {
1051
  $term_ids = array();
1052
  foreach ( $terms as $term ) {
1053
  $taxonomy = $term['taxonomy'];
1054
+ $key = sha1( $taxonomy . ':' . $term['slug'] );
1055
 
1056
  if ( isset( $this->mapping['term'][ $key ] ) ) {
1057
  $term_ids[ $taxonomy ][] = (int) $this->mapping['term'][ $key ];
1058
  } else {
1059
+ $meta[] = array(
1060
+ 'key' => '_wxr_import_term',
1061
  'value' => $term,
1062
  );
1063
  $requires_remapping = true;
1086
  * @param array $comments Raw comment data, already processed by {@see process_comments}.
1087
  * @param array $terms Raw term data, already processed.
1088
  */
1089
+ do_action( 'wxr_importer.processed.post', $post_id, $data, $meta, $comments, $terms ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1090
  }
1091
 
1092
  /**
1097
  * represents doesn't exist then the menu item will not be imported (waits until the
1098
  * end of the import to retry again before discarding).
1099
  *
1100
+ * @param int $post_id New post ID.
1101
+ * @param array $data Raw data imported for the post.
1102
+ * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
1103
  */
1104
  protected function process_menu_item_meta( $post_id, $data, $meta ) {
1105
 
1106
+ $item_type = get_post_meta( $post_id, '_menu_item_type', true );
1107
  $original_object_id = get_post_meta( $post_id, '_menu_item_object_id', true );
1108
+ $object_id = null;
1109
 
1110
  $this->logger->debug( sprintf( 'Processing menu item %s', $item_type ) );
1111
 
1135
  break;
1136
 
1137
  default:
1138
+ // associated object is missing or not imported yet, we'll retry later.
1139
  $this->missing_menu_items[] = $item;
1140
  $this->logger->debug( 'Unknown menu item type' );
1141
  break;
1157
  /**
1158
  * If fetching attachments is enabled then attempt to create a new attachment
1159
  *
1160
+ * @param array $post Attachment post details from WXR.
1161
+ * @param string $meta Raw meta data, already processed by {@see process_post_meta}.
1162
+ * @param string $remote_url URL to fetch attachment from.
1163
+ * @return int|WP_Error Post ID on success, WP_Error otherwise.
1164
  */
1165
  protected function process_attachment( $post, $meta, $remote_url ) {
1166
  // try to use _wp_attached file for upload folder placement to ensure the same location as the export site
1167
+ // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload().
1168
  $post['upload_date'] = $post['post_date'];
1169
  foreach ( $meta as $meta_item ) {
1170
+ if ( '_wp_attached_file' !== $meta_item['key'] ) {
1171
  continue;
1172
  }
1173
 
1177
  break;
1178
  }
1179
 
1180
+ // if the URL is absolute, but does not contain address, then upload it assuming base_site_url.
1181
  if ( preg_match( '|^/[\w\W]+$|', $remote_url ) ) {
1182
  $remote_url = rtrim( $this->base_url, '/' ) . $remote_url;
1183
  }
1195
  $post['post_mime_type'] = $info['type'];
1196
 
1197
  // WP really likes using the GUID for display. Allow updating it.
1198
+ // See https://core.trac.wordpress.org/ticket/33386.
1199
  if ( $this->options['update_attachment_guids'] ) {
1200
  $post['guid'] = $upload['url'];
1201
  }
1202
 
1203
+ // as per wp-admin/includes/upload.php.
1204
  $post_id = wp_insert_attachment( $post, $upload['file'] );
1205
  if ( is_wp_error( $post_id ) ) {
1206
  return $post_id;
1209
  $attachment_metadata = wp_generate_attachment_metadata( $post_id, $upload['file'] );
1210
  wp_update_attachment_metadata( $post_id, $attachment_metadata );
1211
 
1212
+ // Map this image URL later if we need to.
1213
  $this->url_remap[ $remote_url ] = $upload['url'];
1214
 
1215
+ // If we have a HTTPS URL, ensure the HTTP URL gets replaced too.
1216
  if ( substr( $remote_url, 0, 8 ) === 'https://' ) {
1217
+ $insecure_url = 'http' . substr( $remote_url, 5 );
1218
  $this->url_remap[ $insecure_url ] = $upload['url'];
1219
  }
1220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1221
  return $post_id;
1222
  }
1223
 
1228
  * @return array|null Meta data array on success, or null on error.
1229
  */
1230
  protected function parse_meta_node( $node ) {
1231
+ foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1232
+ // We only care about child elements.
1233
+ if ( XML_ELEMENT_NODE !== $child->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1234
  continue;
1235
  }
1236
 
1237
+ switch ( $child->tagName ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1238
  case 'wp:meta_key':
1239
+ $key = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1240
  break;
1241
 
1242
  case 'wp:meta_value':
1243
+ $value = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1244
  break;
1245
  }
1246
  }
1255
  /**
1256
  * Process and import post meta items.
1257
  *
1258
+ * @param array $meta List of meta data arrays.
1259
+ * @param int $post_id Post to associate with.
1260
+ * @param array $post Post data.
1261
  * @return int|WP_Error Number of meta items imported on success, error otherwise.
1262
  */
1263
  protected function process_post_meta( $meta, $post_id, $post ) {
1272
  * @param array $meta_item Meta data. (Return empty to skip.)
1273
  * @param int $post_id Post the meta is attached to.
1274
  */
1275
+ $meta_item = apply_filters( 'wxr_importer.pre_process.post_meta', $meta_item, $post_id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1276
  if ( empty( $meta_item ) ) {
1277
  return false;
1278
  }
1279
 
1280
+ $key = apply_filters( 'import_post_meta_key', $meta_item['key'], $post_id, $post );
1281
  $value = false;
1282
 
1283
  if ( '_edit_last' === $key ) {
1291
  }
1292
 
1293
  if ( $key ) {
1294
+ // export gets meta straight from the DB so could have a serialized string.
1295
  if ( ! $value ) {
1296
  $value = maybe_unserialize( $meta_item['value'] );
1297
  }
1299
  add_post_meta( $post_id, $key, $value );
1300
  do_action( 'import_post_meta', $post_id, $key, $value );
1301
 
1302
+ // if the post has a featured image, take note of this in case of remap.
1303
  if ( '_thumbnail_id' === $key ) {
1304
  $this->featured_images[ $post_id ] = (int) $value;
1305
  }
1306
  }
1307
+ }
1308
 
1309
  return true;
1310
  }
1320
  'commentmeta' => array(),
1321
  );
1322
 
1323
+ foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1324
+ // We only care about child elements.
1325
+ if ( XML_ELEMENT_NODE !== $child->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1326
  continue;
1327
  }
1328
 
1329
+ switch ( $child->tagName ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1330
  case 'wp:comment_id':
1331
+ $data['comment_id'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1332
  break;
1333
  case 'wp:comment_author':
1334
+ $data['comment_author'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1335
  break;
1336
 
1337
  case 'wp:comment_author_email':
1338
+ $data['comment_author_email'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1339
  break;
1340
 
1341
  case 'wp:comment_author_IP':
1342
+ $data['comment_author_IP'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1343
  break;
1344
 
1345
  case 'wp:comment_author_url':
1346
+ $data['comment_author_url'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1347
  break;
1348
 
1349
  case 'wp:comment_user_id':
1350
+ $data['comment_user_id'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1351
  break;
1352
 
1353
  case 'wp:comment_date':
1354
+ $data['comment_date'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1355
  break;
1356
 
1357
  case 'wp:comment_date_gmt':
1358
+ $data['comment_date_gmt'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1359
  break;
1360
 
1361
  case 'wp:comment_content':
1362
+ $data['comment_content'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1363
  break;
1364
 
1365
  case 'wp:comment_approved':
1366
+ $data['comment_approved'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1367
  break;
1368
 
1369
  case 'wp:comment_type':
1370
+ $data['comment_type'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1371
  break;
1372
 
1373
  case 'wp:comment_parent':
1374
+ $data['comment_parent'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1375
  break;
1376
 
1377
  case 'wp:commentmeta':
1380
  $data['commentmeta'][] = $meta_item;
1381
  }
1382
  break;
1383
+ }
1384
+ }
1385
 
1386
  return $data;
1387
  }
1389
  /**
1390
  * Process and import comment data.
1391
  *
1392
+ * @param array $comments List of comment data arrays.
1393
+ * @param int $post_id Post to associate with.
1394
+ * @param array $post Post data.
1395
+ * @param boolean $post_exists Post exist status.
1396
  * @return int|WP_Error Number of comments imported on success, error otherwise.
1397
  */
1398
  protected function process_comments( $comments, $post_id, $post, $post_exists = false ) {
1404
 
1405
  $num_comments = 0;
1406
 
1407
+ // Sort by ID to avoid excessive remapping later.
1408
  usort( $comments, array( $this, 'sort_comments_by_id' ) );
1409
 
1410
  foreach ( $comments as $key => $comment ) {
1414
  * @param array $comment Comment data. (Return empty to skip.)
1415
  * @param int $post_id Post the comment is attached to.
1416
  */
1417
+ $comment = apply_filters( 'wxr_importer.pre_process.comment', $comment, $post_id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1418
  if ( empty( $comment ) ) {
1419
  return false;
1420
  }
1421
 
1422
+ $original_id = isset( $comment['comment_id'] ) ? (int) $comment['comment_id'] : 0;
1423
+ $parent_id = isset( $comment['comment_parent'] ) ? (int) $comment['comment_parent'] : 0;
1424
  $author_id = isset( $comment['comment_user_id'] ) ? (int) $comment['comment_user_id'] : 0;
1425
 
1426
  // if this is a new post we can skip the comment_exists() check
1427
+ // TODO: Check comment_exists for performance.
1428
  if ( $post_exists ) {
1429
  $existing = $this->comment_exists( $comment );
1430
  if ( $existing ) {
1434
  *
1435
  * @param array $comment Raw data imported for the comment.
1436
  */
1437
+ do_action( 'wxr_importer.process_already_imported.comment', $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1438
 
1439
  $this->mapping['comment'][ $original_id ] = $existing;
1440
  continue;
1441
  }
1442
  }
1443
 
1444
+ // Remove meta from the main array.
1445
  $meta = isset( $comment['commentmeta'] ) ? $comment['commentmeta'] : array();
1446
  unset( $comment['commentmeta'] );
1447
 
1448
+ // Map the parent comment, or mark it as one we need to fix.
1449
  $requires_remapping = false;
1450
  if ( $parent_id ) {
1451
  if ( isset( $this->mapping['comment'][ $parent_id ] ) ) {
1452
  $comment['comment_parent'] = $this->mapping['comment'][ $parent_id ];
1453
  } else {
1454
+ // Prepare for remapping later.
1455
+ $meta[] = array(
1456
+ 'key' => '_wxr_import_parent',
1457
  'value' => $parent_id,
1458
  );
1459
  $requires_remapping = true;
1460
 
1461
+ // Wipe the parent for now.
1462
  $comment['comment_parent'] = 0;
1463
  }
1464
  }
1465
 
1466
+ // Map the author, or mark it as one we need to fix.
1467
  if ( $author_id ) {
1468
  if ( isset( $this->mapping['user'][ $author_id ] ) ) {
1469
  $comment['user_id'] = $this->mapping['user'][ $author_id ];
1470
  } else {
1471
+ // Prepare for remapping later.
1472
+ $meta[] = array(
1473
+ 'key' => '_wxr_import_user',
1474
  'value' => $author_id,
1475
  );
1476
  $requires_remapping = true;
1477
 
1478
+ // Wipe the user for now.
1479
  $comment['user_id'] = 0;
1480
  }
1481
  }
1482
 
1483
+ // Run standard core filters.
1484
  $comment['comment_post_ID'] = $post_id;
1485
+ $comment = wp_filter_comment( $comment );
1486
 
1487
+ // wp_insert_comment expects slashed data.
1488
+ $comment_id = wp_insert_comment( wp_slash( $comment ) );
1489
  $this->mapping['comment'][ $original_id ] = $comment_id;
1490
  if ( $requires_remapping ) {
1491
  $this->requires_remapping['comment'][ $comment_id ] = true;
1502
  */
1503
  do_action( 'wp_import_insert_comment', $comment_id, $comment, $post_id, $post );
1504
 
1505
+ // Process the meta items.
1506
  foreach ( $meta as $meta_item ) {
1507
  $value = maybe_unserialize( $meta_item['value'] );
1508
  add_comment_meta( $comment_id, wp_slash( $meta_item['key'] ), wp_slash( $value ) );
1516
  * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
1517
  * @param array $post_id Parent post ID.
1518
  */
1519
+ do_action( 'wxr_importer.processed.comment', $comment_id, $comment, $meta, $post_id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1520
 
1521
  $num_comments++;
1522
+ }
1523
 
1524
  return $num_comments;
1525
  }
1526
 
1527
+ /**
1528
+ * Parse Category Node
1529
+ *
1530
+ * @param object $node Category Node.
1531
+ * @return array
1532
+ */
1533
  protected function parse_category_node( $node ) {
1534
  $data = array(
1535
+ // Default taxonomy to "category", since this is a `<category>` tag.
1536
  'taxonomy' => 'category',
1537
  );
1538
  $meta = array();
1544
  $data['slug'] = $node->getAttribute( 'nicename' );
1545
  }
1546
 
1547
+ $data['name'] = $node->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1548
 
1549
  if ( empty( $data['slug'] ) ) {
1550
  return null;
1551
  }
1552
 
1553
+ // Just for extra compatibility.
1554
+ if ( 'tag' === $data['taxonomy'] ) {
1555
  $data['taxonomy'] = 'post_tag';
1556
  }
1557
 
1561
  /**
1562
  * Callback for `usort` to sort comments by ID
1563
  *
1564
+ * @param array $a Comment data for the first comment.
1565
+ * @param array $b Comment data for the second comment.
1566
  * @return int
1567
  */
1568
  public static function sort_comments_by_id( $a, $b ) {
1577
  return $a['comment_id'] - $b['comment_id'];
1578
  }
1579
 
1580
+ /**
1581
+ * Parse Author Node
1582
+ *
1583
+ * @param object $node Author Node.
1584
+ * @return array
1585
+ */
1586
  protected function parse_author_node( $node ) {
1587
  $data = array();
1588
  $meta = array();
1589
+ foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1590
+ // We only care about child elements.
1591
+ if ( XML_ELEMENT_NODE !== $child->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1592
  continue;
1593
  }
1594
 
1595
+ switch ( $child->tagName ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1596
  case 'wp:author_login':
1597
+ $data['user_login'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1598
  break;
1599
 
1600
  case 'wp:author_id':
1601
+ $data['ID'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1602
  break;
1603
 
1604
  case 'wp:author_email':
1605
+ $data['user_email'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1606
  break;
1607
 
1608
  case 'wp:author_display_name':
1609
+ $data['display_name'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1610
  break;
1611
 
1612
  case 'wp:author_first_name':
1613
+ $data['first_name'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1614
  break;
1615
 
1616
  case 'wp:author_last_name':
1617
+ $data['last_name'] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1618
  break;
1619
  }
1620
  }
1622
  return compact( 'data', 'meta' );
1623
  }
1624
 
1625
+ /**
1626
+ * Process Author
1627
+ *
1628
+ * @param array $data User data. (Return empty to skip.).
1629
+ * @param array $meta Meta data.
1630
+ * @return boolean
1631
+ */
1632
  protected function process_author( $data, $meta ) {
1633
  /**
1634
  * Pre-process user data.
1636
  * @param array $data User data. (Return empty to skip.)
1637
  * @param array $meta Meta data.
1638
  */
1639
+ $data = apply_filters( 'wxr_importer.pre_process.user', $data, $meta ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1640
  if ( empty( $data ) ) {
1641
  return false;
1642
  }
1643
 
1644
  // Have we already handled this user?
1645
+ $original_id = isset( $data['ID'] ) ? $data['ID'] : 0;
1646
  $original_slug = $data['user_login'];
1647
 
1648
  if ( isset( $this->mapping['user'][ $original_id ] ) ) {
1649
  $existing = $this->mapping['user'][ $original_id ];
1650
 
1651
+ // Note the slug mapping if we need to too.
1652
  if ( ! isset( $this->mapping['user_slug'][ $original_slug ] ) ) {
1653
  $this->mapping['user_slug'][ $original_slug ] = $existing;
1654
  }
1659
  if ( isset( $this->mapping['user_slug'][ $original_slug ] ) ) {
1660
  $existing = $this->mapping['user_slug'][ $original_slug ];
1661
 
1662
+ // Ensure we note the mapping too.
1663
  $this->mapping['user'][ $original_id ] = $existing;
1664
 
1665
  return false;
1666
  }
1667
 
1668
+ // Allow overriding the user's slug.
1669
  $login = $original_slug;
1670
  if ( isset( $this->user_slug_override[ $login ] ) ) {
1671
  $login = $this->user_slug_override[ $login ];
1672
  }
1673
 
1674
  $userdata = array(
1675
+ 'user_login' => sanitize_user( $login, true ),
1676
+ 'user_pass' => wp_generate_password(),
1677
  );
1678
 
1679
  $allowed = array(
1692
 
1693
  $user_id = wp_insert_user( wp_slash( $userdata ) );
1694
  if ( is_wp_error( $user_id ) ) {
1695
+ $this->logger->error(
1696
+ sprintf(
1697
+ /* translators: %s user login name */
1698
+ __( 'Failed to import user "%s"', 'wordpress-importer' ),
1699
+ $userdata['user_login']
1700
+ )
1701
+ );
1702
  $this->logger->debug( $user_id->get_error_message() );
1703
 
1704
  /**
1707
  * @param WP_Error $user_id Error object.
1708
  * @param array $userdata Raw data imported for the user.
1709
  */
1710
+ do_action( 'wxr_importer.process_failed.user', $user_id, $userdata ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1711
  return false;
1712
  }
1713
 
1716
  }
1717
  $this->mapping['user_slug'][ $original_slug ] = $user_id;
1718
 
1719
+ $this->logger->info(
1720
+ sprintf(
1721
+ /* translators: %s user login name */
1722
+ __( 'Imported user "%s"', 'wordpress-importer' ),
1723
+ $userdata['user_login']
1724
+ )
1725
+ );
1726
+ $this->logger->debug(
1727
+ sprintf(
1728
+ /* translators: %1$s original user Id, %2$s old user Id. */
1729
+ __( 'User %1$d remapped to %2$d', 'wordpress-importer' ),
1730
+ $original_id,
1731
+ $user_id
1732
+ )
1733
+ );
1734
+
1735
+ // TODO: Implement meta handling once WXR includes it.
1736
  /**
1737
  * User processing completed.
1738
  *
1739
  * @param int $user_id New user ID.
1740
  * @param array $userdata Raw data imported for the user.
1741
  */
1742
+ do_action( 'wxr_importer.processed.user', $user_id, $userdata ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1743
  }
1744
 
1745
+ /**
1746
+ * Process Term
1747
+ *
1748
+ * @param object $node Term node.
1749
+ * @param string $type Term type.
1750
+ * @return array
1751
+ */
1752
  protected function parse_term_node( $node, $type = 'term' ) {
1753
  $data = array();
1754
  $meta = array();
1786
  break;
1787
  }
1788
 
1789
+ foreach ( $node->childNodes as $child ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1790
+ // We only care about child elements.
1791
+ if ( XML_ELEMENT_NODE !== $child->nodeType ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1792
  continue;
1793
  }
1794
 
1795
+ $key = array_search( $child->tagName, $tag_name ); // phpcs:ignore
1796
  if ( $key ) {
1797
+ $data[ $key ] = $child->textContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
1798
  }
1799
  }
1800
 
1802
  return null;
1803
  }
1804
 
1805
+ // Compatibility with WXR 1.0.
1806
+ if ( 'tag' === $data['taxonomy'] ) {
1807
  $data['taxonomy'] = 'post_tag';
1808
  }
1809
 
1810
  return compact( 'data', 'meta' );
1811
  }
1812
 
1813
+ /**
1814
+ * Process Term
1815
+ *
1816
+ * @param array $data Term data. (Return empty to skip.).
1817
+ * @param array $meta Meta data.
1818
+ * @return boolean
1819
+ */
1820
  protected function process_term( $data, $meta ) {
1821
  /**
1822
  * Pre-process term data.
1824
  * @param array $data Term data. (Return empty to skip.)
1825
  * @param array $meta Meta data.
1826
  */
1827
+ $data = apply_filters( 'wxr_importer.pre_process.term', $data, $meta ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1828
  if ( empty( $data ) ) {
1829
  return false;
1830
  }
1831
 
1832
+ $original_id = isset( $data['id'] ) ? (int) $data['id'] : 0;
1833
+ $parent_id = isset( $data['parent'] ) ? (int) $data['parent'] : 0;
1834
 
1835
  $mapping_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
1836
+ $existing = $this->term_exists( $data );
1837
  if ( $existing ) {
1838
 
1839
  /**
1841
  *
1842
  * @param array $data Raw data imported for the term.
1843
  */
1844
+ do_action( 'wxr_importer.process_already_imported.term', $data ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1845
 
1846
+ $this->mapping['term'][ $mapping_key ] = $existing;
1847
  $this->mapping['term_id'][ $original_id ] = $existing;
1848
  return false;
1849
  }
1850
 
1851
+ // WP really likes to repeat itself in export files.
1852
  if ( isset( $this->mapping['term'][ $mapping_key ] ) ) {
1853
  return false;
1854
  }
1855
 
1856
  $termdata = array();
1857
+ $allowed = array(
1858
+ 'slug' => true,
1859
  'description' => true,
1860
  );
1861
 
1862
  // Map the parent comment, or mark it as one we need to fix
1863
+ // TODO: add parent mapping and remapping.
1864
+ // phpcs:disable
1865
  /*
1866
  $requires_remapping = false;
1867
  if ( $parent_id ) {
1876
  $data['parent'] = 0;
1877
  }
1878
  }*/
1879
+ // phpcs:enable
1880
 
1881
  foreach ( $data as $key => $value ) {
1882
  if ( ! isset( $allowed[ $key ] ) ) {
1888
 
1889
  $result = wp_insert_term( $data['name'], $data['taxonomy'], $termdata );
1890
  if ( is_wp_error( $result ) ) {
1891
+ $this->logger->warning(
1892
+ sprintf(
1893
+ /* translators: %1$s is the taxonomy, %2$s is taxonomy name. */
1894
+ __( 'Failed to import %1$s %2$s', 'wordpress-importer' ),
1895
+ $data['taxonomy'],
1896
+ $data['name']
1897
+ )
1898
+ );
1899
  $this->logger->debug( $result->get_error_message() );
1900
  do_action( 'wp_import_insert_term_failed', $result, $data );
1901
 
1906
  * @param array $data Raw data imported for the term.
1907
  * @param array $meta Meta data supplied for the term.
1908
  */
1909
+ do_action( 'wxr_importer.process_failed.term', $result, $data, $meta ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1910
  return false;
1911
  }
1912
 
1913
  $term_id = $result['term_id'];
1914
 
1915
+ $this->mapping['term'][ $mapping_key ] = $term_id;
1916
  $this->mapping['term_id'][ $original_id ] = $term_id;
1917
 
1918
+ $this->logger->info(
1919
+ sprintf(
1920
+ /* translators: %1$s is the taxonomy name, %2$s is taxonomy. */
1921
+ __( 'Imported "%1$s" (%2$s)', 'wordpress-importer' ),
1922
+ $data['name'],
1923
+ $data['taxonomy']
1924
+ )
1925
+ );
1926
+ $this->logger->debug(
1927
+ sprintf(
1928
+ /* translators: %1$s is term original id, %2$s is term id. */
1929
+ __( 'Term %1$d remapped to %2$d', 'wordpress-importer' ),
1930
+ $original_id,
1931
+ $term_id
1932
+ )
1933
+ );
1934
 
1935
  do_action( 'wp_import_insert_term', $term_id, $data );
1936
 
1940
  * @param int $term_id New term ID.
1941
  * @param array $data Raw data imported for the term.
1942
  */
1943
+ do_action( 'wxr_importer.processed.term', $term_id, $data ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1944
  }
1945
 
1946
  /**
1947
  * Attempt to download a remote file attachment
1948
  *
1949
+ * @param string $url URL of item to fetch.
1950
+ * @param array $post Attachment details.
1951
+ * @return array|WP_Error Local file location details on success, WP_Error otherwise.
1952
  */
1953
  protected function fetch_remote_file( $url, $post ) {
1954
+ // extract the file name and extension from the url.
1955
  $file_name = basename( $url );
1956
 
1957
+ // get placeholder file in the upload dir with a unique, sanitized filename.
1958
+ $upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] ); // phpcs:ignore WordPress.WP.DeprecatedParameters.Wp_upload_bitsParam2Found
1959
  if ( $upload['error'] ) {
1960
  return new WP_Error( 'upload_dir_error', $upload['error'] );
1961
  }
1962
 
1963
+ // fetch the remote url and write it to the placeholder file.
1964
+ $response = wp_remote_get(
1965
+ $url,
1966
+ array(
1967
+ 'stream' => true,
1968
+ 'filename' => $upload['file'],
1969
+ )
1970
+ );
1971
 
1972
+ // request failed.
1973
  if ( is_wp_error( $response ) ) {
1974
  unlink( $upload['file'] );
1975
  return $response;
1977
 
1978
  $code = (int) wp_remote_retrieve_response_code( $response );
1979
 
1980
+ // make sure the fetch was successful.
1981
+ if ( 200 !== $code ) {
1982
  unlink( $upload['file'] );
1983
  return new WP_Error(
1984
  'import_file_error',
1985
  sprintf(
1986
+ /* translators: %1$s is error code, %2$s is error code header, %3$s is url. */
1987
  __( 'Remote server returned %1$d %2$s for %3$s', 'wordpress-importer' ),
1988
  $code,
1989
  get_status_header_desc( $code ),
1993
  }
1994
 
1995
  $filesize = filesize( $upload['file'] );
1996
+ $headers = wp_remote_retrieve_headers( $response );
1997
 
1998
  if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
1999
  unlink( $upload['file'] );
2008
  $max_size = (int) $this->max_attachment_size();
2009
  if ( ! empty( $max_size ) && $filesize > $max_size ) {
2010
  unlink( $upload['file'] );
2011
+ /* translators: %s max file size. */
2012
  $message = sprintf( __( 'Remote file is too large, limit is %s', 'wordpress-importer' ), size_format( $max_size ) );
2013
  return new WP_Error( 'import_file_error', $message );
2014
  }
2016
  return $upload;
2017
  }
2018
 
2019
+ /**
2020
+ * Post process
2021
+ */
2022
  protected function post_process() {
2023
+ // Time to tackle any left-over bits.
2024
  if ( ! empty( $this->requires_remapping['post'] ) ) {
2025
  $this->post_process_posts( $this->requires_remapping['post'] );
2026
  }
2029
  }
2030
  }
2031
 
2032
+ /**
2033
+ * Post Process Posts
2034
+ *
2035
+ * @param array $todo Todo items.
2036
+ * @return void
2037
+ */
2038
  protected function post_process_posts( $todo ) {
2039
  foreach ( $todo as $post_id => $_ ) {
2040
+ $this->logger->debug(
2041
+ sprintf(
2042
+ // Note: title intentionally not used to skip extra processing.
2043
+ // for when debug logging is off.
2044
+ /* translators: %d is post id. */
2045
+ __( 'Running post-processing for post %d', 'wordpress-importer' ),
2046
+ $post_id
2047
+ )
2048
+ );
2049
 
2050
  $data = array();
2051
 
2055
  if ( isset( $this->mapping['post'][ $parent_id ] ) ) {
2056
  $data['post_parent'] = $this->mapping['post'][ $parent_id ];
2057
  } else {
2058
+ $this->logger->warning(
2059
+ sprintf(
2060
+ /* translators: %1$s is post title, %2$s is post id. */
2061
+ __( 'Could not find the post parent for "%1$s" (post #%2$d)', 'wordpress-importer' ),
2062
+ get_the_title( $post_id ),
2063
+ $post_id
2064
+ )
2065
+ );
2066
+ $this->logger->debug(
2067
+ sprintf(
2068
+ /* translators: %1$d is post id, %2$d is parent post id. */
2069
+ __( 'Post %1$d was imported with parent %2$d, but could not be found', 'wordpress-importer' ),
2070
+ $post_id,
2071
+ $parent_id
2072
+ )
2073
+ );
2074
  }
2075
  }
2076
 
2080
  if ( isset( $this->mapping['user_slug'][ $author_slug ] ) ) {
2081
  $data['post_author'] = $this->mapping['user_slug'][ $author_slug ];
2082
  } else {
2083
+ $this->logger->warning(
2084
+ sprintf(
2085
+ /* translators: %1$s is the post title, %2$s is post id. */
2086
+ __( 'Could not find the author for "%1$s" (post #%2$d)', 'wordpress-importer' ),
2087
+ get_the_title( $post_id ),
2088
+ $post_id
2089
+ )
2090
+ );
2091
+ $this->logger->debug(
2092
+ sprintf(
2093
+ /* translators: %1$d is post id, %2$s is author slug. */
2094
+ __( 'Post %1$d was imported with author "%2$s", but could not be found', 'wordpress-importer' ),
2095
+ $post_id,
2096
+ $author_slug
2097
+ )
2098
+ );
2099
  }
2100
  }
2101
 
2102
  $has_attachments = get_post_meta( $post_id, '_wxr_import_has_attachment_refs', true );
2103
  if ( ! empty( $has_attachments ) ) {
2104
+ $post = get_post( $post_id );
2105
  $content = $post->post_content;
2106
 
2107
+ // Replace all the URLs we've got.
2108
  $new_content = str_replace( array_keys( $this->url_remap ), $this->url_remap, $content );
2109
  if ( $new_content !== $content ) {
2110
  $data['post_content'] = $new_content;
2117
 
2118
  // Do we have updates to make?
2119
  if ( empty( $data ) ) {
2120
+ $this->logger->debug(
2121
+ sprintf(
2122
+ /* translators: %d is post id. */
2123
+ __( 'Post %d was marked for post-processing, but none was required.', 'wordpress-importer' ),
2124
+ $post_id
2125
+ )
2126
+ );
2127
  continue;
2128
  }
2129
 
2130
+ // Run the update.
2131
  $data['ID'] = $post_id;
2132
+ $result = wp_update_post( $data, true );
2133
  if ( is_wp_error( $result ) ) {
2134
+ $this->logger->warning(
2135
+ sprintf(
2136
+ /* translators: %1$s is the post title, %2$s is post id. */
2137
+ __( 'Could not update "%1$s" (post #%2$d) with mapped data', 'wordpress-importer' ),
2138
+ get_the_title( $post_id ),
2139
+ $post_id
2140
+ )
2141
+ );
2142
  $this->logger->debug( $result->get_error_message() );
2143
  continue;
2144
  }
2145
 
2146
+ // Clear out our temporary meta keys.
2147
  delete_post_meta( $post_id, '_wxr_import_parent' );
2148
  delete_post_meta( $post_id, '_wxr_import_user_slug' );
2149
  delete_post_meta( $post_id, '_wxr_import_has_attachment_refs' );
2150
+ }
2151
  }
2152
 
2153
+ /**
2154
+ * Post process menu item
2155
+ *
2156
+ * @param int $post_id Post id.
2157
+ * @return mixed
2158
+ */
2159
  protected function post_process_menu_item( $post_id ) {
2160
  $menu_object_id = get_post_meta( $post_id, '_wxr_import_menu_item', true );
2161
  if ( empty( $menu_object_id ) ) {
2185
  if ( ! empty( $menu_object ) ) {
2186
  update_post_meta( $post_id, '_menu_item_object_id', wp_slash( $menu_object ) );
2187
  } else {
2188
+ $this->logger->warning(
2189
+ sprintf(
2190
+ /* translators: %1$s is the post title, %2$s is post id. */
2191
+ __( 'Could not find the menu object for "%1$s" (post #%2$d)', 'wordpress-importer' ),
2192
+ get_the_title( $post_id ),
2193
+ $post_id
2194
+ )
2195
+ );
2196
+ $this->logger->debug(
2197
+ sprintf(
2198
+ /* translators: %1$s is post id, %2$s is post object id, %3$s is menu type. */
2199
+ __( 'Post %1$d was imported with object "%2$d" of type "%3$s", but could not be found', 'wordpress-importer' ),
2200
+ $post_id,
2201
+ $menu_object_id,
2202
+ $menu_item_type
2203
+ )
2204
+ );
2205
  }
2206
 
2207
  delete_post_meta( $post_id, '_wxr_import_menu_item' );
2208
  }
2209
 
2210
 
2211
+ /**
2212
+ * Post process comments
2213
+ *
2214
+ * @param array $todo Todo items.
2215
+ * @return void
2216
+ */
2217
  protected function post_process_comments( $todo ) {
2218
  foreach ( $todo as $comment_id => $_ ) {
2219
  $data = array();
2224
  if ( isset( $this->mapping['comment'][ $parent_id ] ) ) {
2225
  $data['comment_parent'] = $this->mapping['comment'][ $parent_id ];
2226
  } else {
2227
+ $this->logger->warning(
2228
+ sprintf(
2229
+ /* translators: %d is comment id. */
2230
+ __( 'Could not find the comment parent for comment #%d', 'wordpress-importer' ),
2231
+ $comment_id
2232
+ )
2233
+ );
2234
+ $this->logger->debug(
2235
+ sprintf(
2236
+ /* translators: %1$s is comment id, %2$s is parent comment id. */
2237
+ __( 'Comment %1$d was imported with parent %2$d, but could not be found', 'wordpress-importer' ),
2238
+ $comment_id,
2239
+ $parent_id
2240
+ )
2241
+ );
2242
  }
2243
  }
2244
 
2248
  if ( isset( $this->mapping['user'][ $author_id ] ) ) {
2249
  $data['user_id'] = $this->mapping['user'][ $author_id ];
2250
  } else {
2251
+ $this->logger->warning(
2252
+ sprintf(
2253
+ /* translators: %d is comment id. */
2254
+ __( 'Could not find the author for comment #%d', 'wordpress-importer' ),
2255
+ $comment_id
2256
+ )
2257
+ );
2258
+ $this->logger->debug(
2259
+ sprintf(
2260
+ /* translators: %1$d is comment id, %2$d is author id. */
2261
+ __( 'Comment %1$d was imported with author %2$d, but could not be found', 'wordpress-importer' ),
2262
+ $comment_id,
2263
+ $author_id
2264
+ )
2265
+ );
2266
  }
2267
  }
2268
 
2271
  continue;
2272
  }
2273
 
2274
+ // Run the update.
2275
+ $data['comment_ID'] = $comment_ID; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
2276
+ $result = wp_update_comment( wp_slash( $data ) );
2277
  if ( empty( $result ) ) {
2278
+ $this->logger->warning(
2279
+ sprintf(
2280
+ /* translators: %d is comment id. */
2281
+ __( 'Could not update comment #%d with mapped data', 'wordpress-importer' ),
2282
+ $comment_id
2283
+ )
2284
+ );
2285
  continue;
2286
  }
2287
 
2288
+ // Clear out our temporary meta keys.
2289
  delete_comment_meta( $comment_id, '_wxr_import_parent' );
2290
  delete_comment_meta( $comment_id, '_wxr_import_user' );
2291
+ }
2292
  }
2293
 
2294
  /**
2296
  */
2297
  protected function replace_attachment_urls_in_content() {
2298
  global $wpdb;
2299
+ // make sure we do the longest urls first, in case one is a substring of another.
2300
  uksort( $this->url_remap, array( $this, 'cmpr_strlen' ) );
2301
 
2302
  foreach ( $this->url_remap as $from_url => $to_url ) {
2303
+ // remap urls in post_content.
2304
  $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url );
2305
+ $wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
2306
 
2307
+ // remap enclosure urls.
2308
+ $query = $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, %s, %s) WHERE meta_key='enclosure'", $from_url, $to_url );
2309
+ $result = $wpdb->query( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
2310
  }
2311
  }
2312
 
2313
  /**
2314
  * Update _thumbnail_id meta to new, imported attachment IDs
2315
  */
2316
+ public function remap_featured_images() {
2317
+ // cycle through posts that have a featured image.
2318
  foreach ( $this->featured_images as $post_id => $value ) {
2319
  if ( isset( $this->processed_posts[ $value ] ) ) {
2320
  $new_id = $this->processed_posts[ $value ];
2321
 
2322
+ // only update if there's a difference.
2323
  if ( $new_id !== $value ) {
2324
  update_post_meta( $post_id, '_thumbnail_id', $new_id );
2325
  }
2330
  /**
2331
  * Decide if the given meta key maps to information we will want to import
2332
  *
2333
+ * @param string $key The meta key to check.
2334
+ * @return string|bool The key if we do want to import, false if not.
2335
  */
2336
  public function is_valid_meta_key( $key ) {
2337
  // skip attachment metadata since we'll regenerate it from scratch
2338
+ // skip _edit_lock as not relevant for import.
2339
+ if ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
2340
  return false;
2341
  }
2342
 
2356
  /**
2357
  * Added to http_request_timeout filter to force timeout at 60 seconds during import
2358
  *
2359
+ * @param string $val Timeout value.
2360
+ * @access public
2361
  * @return int 60
2362
  */
2363
+ public function bump_request_timeout( $val ) {
2364
  return 60;
2365
  }
2366
 
2367
+ /**
2368
+ * Return the difference in length between two strings.
2369
+ *
2370
+ * @param string $a String one.
2371
+ * @param string $b String two.
2372
+ * @return string
2373
+ */
2374
+ public function cmpr_strlen( $a, $b ) {
2375
  return strlen( $b ) - strlen( $a );
2376
  }
2377
 
2403
  * @return int|bool Existing post ID if it exists, false otherwise.
2404
  */
2405
  protected function post_exists( $data ) {
2406
+ // Constant-time lookup if we prefilled.
2407
  $exists_key = $data['guid'];
2408
 
2409
  if ( $this->options['prefill_existing_posts'] ) {
2410
  return isset( $this->exists['post'][ $exists_key ] ) ? $this->exists['post'][ $exists_key ] : false;
2411
  }
2412
 
2413
+ // No prefilling, but might have already handled it.
2414
  if ( isset( $this->exists['post'][ $exists_key ] ) ) {
2415
  return $this->exists['post'][ $exists_key ];
2416
  }
2417
 
2418
+ // Still nothing, try post_exists, and cache it.
2419
+ $exists = post_exists( $data['post_title'], $data['post_content'], $data['post_date'] );
2420
  $this->exists['post'][ $exists_key ] = $exists;
2421
 
2422
  return $exists;
2429
  * @param int $post_id Post ID.
2430
  */
2431
  protected function mark_post_exists( $data, $post_id ) {
2432
+ $exists_key = $data['guid'];
2433
  $this->exists['post'][ $exists_key ] = $post_id;
2434
  }
2435
 
2443
  $posts = $wpdb->get_results( "SELECT comment_ID, comment_author, comment_date FROM {$wpdb->comments}" );
2444
 
2445
  foreach ( $posts as $item ) {
2446
+ $exists_key = sha1( $item->comment_author . ':' . $item->comment_date );
2447
  $this->exists['comment'][ $exists_key ] = $item->comment_ID;
2448
  }
2449
  }
2457
  protected function comment_exists( $data ) {
2458
  $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] );
2459
 
2460
+ // Constant-time lookup if we prefilled.
2461
  if ( $this->options['prefill_existing_comments'] ) {
2462
  return isset( $this->exists['comment'][ $exists_key ] ) ? $this->exists['comment'][ $exists_key ] : false;
2463
  }
2464
 
2465
+ // No prefilling, but might have already handled it.
2466
  if ( isset( $this->exists['comment'][ $exists_key ] ) ) {
2467
  return $this->exists['comment'][ $exists_key ];
2468
  }
2469
 
2470
+ // Still nothing, try comment_exists, and cache it.
2471
+ $exists = comment_exists( $data['comment_author'], $data['comment_date'] );
2472
  $this->exists['comment'][ $exists_key ] = $exists;
2473
 
2474
  return $exists;
2481
  * @param int $comment_id Comment ID.
2482
  */
2483
  protected function mark_comment_exists( $data, $comment_id ) {
2484
+ $exists_key = sha1( $data['comment_author'] . ':' . $data['comment_date'] );
2485
  $this->exists['comment'][ $exists_key ] = $comment_id;
2486
  }
2487
 
2492
  */
2493
  protected function prefill_existing_terms() {
2494
  global $wpdb;
2495
+ $query = "SELECT t.term_id, tt.taxonomy, t.slug FROM {$wpdb->terms} AS t";
2496
  $query .= " JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id";
2497
+ $terms = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
2498
 
2499
  foreach ( $terms as $item ) {
2500
+ $exists_key = sha1( $item->taxonomy . ':' . $item->slug );
2501
  $this->exists['term'][ $exists_key ] = $item->term_id;
2502
  }
2503
  }
2511
  protected function term_exists( $data ) {
2512
  $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
2513
 
2514
+ // Constant-time lookup if we prefilled.
2515
  if ( $this->options['prefill_existing_terms'] ) {
2516
  return isset( $this->exists['term'][ $exists_key ] ) ? $this->exists['term'][ $exists_key ] : false;
2517
  }
2518
 
2519
+ // No prefilling, but might have already handled it.
2520
  if ( isset( $this->exists['term'][ $exists_key ] ) ) {
2521
  return $this->exists['term'][ $exists_key ];
2522
  }
2523
 
2524
+ // Still nothing, try comment_exists, and cache it.
2525
  $exists = term_exists( $data['slug'], $data['taxonomy'] );
2526
  if ( is_array( $exists ) ) {
2527
  $exists = $exists['term_id'];
2539
  * @param int $term_id Term ID.
2540
  */
2541
  protected function mark_term_exists( $data, $term_id ) {
2542
+ $exists_key = sha1( $data['taxonomy'] . ':' . $data['slug'] );
2543
  $this->exists['term'][ $exists_key ] = $term_id;
2544
  }
2545
  }
2546
+ endif;
inc/includes/admin-page.php CHANGED
@@ -11,56 +11,375 @@
11
  * @since 1.0.0
12
  */
13
 
14
- defined( 'ABSPATH' ) or exit;
15
- ?>
 
16
 
17
- <div class="wrap" id="astra-sites-admin">
18
 
19
- <div id="astra-sites-filters">
20
 
21
- <?php if ( apply_filters( 'astra_sites_show_filters', true ) ) { ?>
22
- <div class="wp-filter hide-if-no-js">
23
- <div class="section-left">
24
 
25
- <!-- All Filters -->
26
- <div class="filter-count">
27
- <span class="count"></span>
28
- </div>
29
- <div class="filters-wrap" style="display: none;">
30
- <div id="astra-site-page-builder"></div>
31
- </div>
32
- <div class="filters-wrap">
33
- <div id="astra-site-category"></div>
34
- </div>
35
 
36
- </div>
37
 
38
- <div class="section-right">
39
 
40
- <div class="search-form">
41
- <label class="screen-reader-text" for="wp-filter-search-input"><?php _e( 'Search Sites', 'astra-sites' ); ?> </label>
42
- <input placeholder="<?php _e( 'Search Sites...', 'astra-sites' ); ?>" type="search" aria-describedby="live-search-desc" id="wp-filter-search-input" class="wp-filter-search">
43
- </div>
44
 
 
 
 
 
 
 
 
 
 
45
  </div>
46
  </div>
47
- <?php } ?>
 
 
 
 
 
 
 
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  </div>
50
 
51
- <?php do_action( 'astra_sites_before_site_grid' ); ?>
52
 
53
- <div class="theme-browser rendered">
54
- <div id="astra-sites" class="themes wp-clearfix"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  </div>
 
56
 
57
- <div class="spinner-wrap">
58
- <span class="spinner"></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  </div>
 
 
 
60
 
61
- <?php do_action( 'astra_sites_after_site_grid' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
- </div>
64
 
65
  <?php
66
  /**
@@ -68,17 +387,60 @@ defined( 'ABSPATH' ) or exit;
68
  */
69
  ?>
70
  <script type="text/template" id="tmpl-astra-sites-pro-site-description">
71
- <p><?php _e( 'Liked this demo?', 'astra-sites' ); ?></p>
72
  <p>
73
  <?php
74
  /* translators: %s is pricing page link */
75
- printf( __( 'It is a premium website demo which is available only with the Agency Bundles <a href="%s" target="_blank">Buy Now!</a>', 'astra-sites' ), 'https://wpastra.com/pricing/' );
76
  ?>
77
  </p>
78
  <p>
79
  <?php
80
  /* translators: %s is article link */
81
- printf( __( 'Already own an Agency Bundle? Read an article to know how you can <a href="%s" target="_blank">import a premium website demo</a>.', 'astra-sites' ), 'https://wpastra.com/docs/import-astra-agency-website-demos/' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  ?>
83
  </p>
84
  </script>
@@ -89,203 +451,142 @@ defined( 'ABSPATH' ) or exit;
89
  */
90
  ?>
91
  <script type="text/template" id="tmpl-astra-sites-pro-inactive-site-description">
92
- <p><?php _e( 'You are just 2 minutes away from importing this demo!', 'astra-sites' ); ?></p>
93
- <p><?php _e( 'It is a premium website demo and you need to activate the license to access it.', 'astra-sites' ); ?></p>
94
  <p>
95
  <?php
96
  /* translators: %s is article link */
97
- printf( __( 'Learn how you can <a href="%s" target="_blank">activate the license</a> of the Astra Premium Sites plugin.', 'astra-sites' ), 'https://wpastra.com/docs/activate-license-for-astra-premium-sites-plugin/' );
98
  ?>
99
  </p>
100
  </script>
101
 
102
  <?php
103
  /**
104
- * TMPL - Third Party Required Plugins
105
  */
106
  ?>
107
- <script type="text/template" id="tmpl-astra-sites-third-party-required-plugins">
108
- <div class="astra-sites-third-party-required-plugins-wrap">
109
- <h3 class="theme-name"><?php esc_html_e( 'Required Plugins Missing', 'astra-sites' ); ?></h3>
110
- <p><?php esc_html_e( 'This starter site requires premium plugins. As these are third party premium plugins, you\'ll need to purchase, install and activate them first.', 'astra-sites' ); ?></p>
111
- <ul class="astra-sites-third-party-required-plugins">
112
- <# for ( key in data ) { #>
113
- <li class="plugin-card plugin-card-{{data[ key ].slug}}'" data-slug="{{data[ key ].slug }}" data-init="{{data[ key ].init}}" data-name="{{data[ key ].name}}"><a href="{{data[ key ].link}}" target="_blank">{{data[ key ].name}}</a></li>
114
- <# } #>
115
- </ul>
 
 
 
 
 
 
 
 
 
 
116
  </div>
117
  </script>
118
 
119
  <?php
120
  /**
121
- * TMPL - Single Demo Preview
122
  */
123
  ?>
124
- <script type="text/template" id="tmpl-astra-site-select-page-builder">
125
- <div class="select-page-builder">
126
- <div class="note-wrap">
127
- <h3>
128
- <span class="up-arrow dashicons dashicons-editor-break"></span>
129
- <div class="note"><?php _e( 'Select Your Favorite Page Builder', 'astra-sites' ); ?></div>
130
- </h3>
 
 
 
 
 
 
 
 
 
 
131
  </div>
132
- <img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/sites-screenshot.jpg' ); ?>" alt="<?php _e( 'Sites List..', 'astra-sites' ); ?>" title="<?php _e( 'Sites List..', 'astra-sites' ); ?>" />
133
  </div>
134
  </script>
135
 
136
  <?php
137
  /**
138
- * TMPL - Single Demo Preview
139
  */
140
  ?>
141
- <script type="text/template" id="tmpl-astra-site-preview">
142
- <div class="astra-sites-preview theme-install-overlay wp-full-overlay expanded">
143
- <div class="wp-full-overlay-sidebar">
144
- <div class="wp-full-overlay-header"
145
- data-demo-id="{{{data.id}}}"
146
- data-demo-type="{{{data.astra_demo_type}}}"
147
- data-demo-url="{{{data.astra_demo_url}}}"
148
- data-demo-api="{{{data.demo_api}}}"
149
- data-demo-name="{{{data.demo_name}}}"
150
- data-demo-slug="{{{data.slug}}}"
151
- data-screenshot="{{{data.screenshot}}}"
152
- data-content="{{{data.content}}}"
153
- data-required-plugins="{{data.required_plugins}}">
154
- <input type="hidden" class="astra-site-options" value="{{data.astra_site_options}}" >
155
- <input type="hidden" class="astra-enabled-extensions" value="{{data.astra_enabled_extensions}}" >
156
- <button class="close-full-overlay"><span class="screen-reader-text"><?php esc_html_e( 'Close', 'astra-sites' ); ?></span></button>
157
- <button class="previous-theme"><span class="screen-reader-text"><?php esc_html_e( 'Previous', 'astra-sites' ); ?></span></button>
158
- <button class="next-theme"><span class="screen-reader-text"><?php esc_html_e( 'Next', 'astra-sites' ); ?></span></button>
159
- <!-- <a class="button hide-if-no-customize astra-site-import" href="#" data-import="disabled"><?php esc_html_e( 'Import Site', 'astra-sites' ); ?></a> -->
160
- <a class="button hide-if-no-customize button-primary astra-demo-import" href="#" data-import="disabled"><?php esc_html_e( 'Import Site', 'astra-sites' ); ?></a>
161
-
162
- </div>
163
- <div class="wp-full-overlay-sidebar-content">
164
- <div class="install-theme-info">
165
-
166
- <span class="site-type {{{data.astra_demo_type}}}">{{{data.astra_demo_type}}}</span>
167
- <h3 class="theme-name">{{{data.demo_name}}}</h3>
168
-
169
- <# if ( data.screenshot.length ) { #>
170
- <div class="theme-screenshot-wrap">
171
- <img class="theme-screenshot" src="{{{data.screenshot}}}" alt="">
172
- </div>
173
- <# } #>
174
-
175
- <div class="theme-details">
176
- {{{data.content}}}
177
- </div>
178
- <a href="#" class="theme-details-read-more"><?php _e( 'Read more', 'astra-sites' ); ?> &hellip;</a>
179
-
180
- <div class="astra-sites-advanced-options-wrap">
181
-
182
- <div class="astra-sites-advanced-options">
183
-
184
- <ul class="astra-site-contents">
185
- <li class="astra-sites-import-plugins">
186
- <input type="checkbox" name="plugins" checked="checked" class="disabled checkbox" readonly>
187
- <strong><?php _e( 'Install Required Plugins', 'astra-sites' ); ?></strong>
188
- <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-plugins-settings"><span class="dashicons dashicons-editor-help"></span></span>
189
- <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-plugins-settings" style="display: none;">
190
- <ul class="required-plugins-list"><span class="spinner is-active"></span></ul>
191
- </div>
192
- </li>
193
- <li class="astra-sites-import-customizer">
194
- <label>
195
- <input type="checkbox" name="customizer" checked="checked" class="checkbox">
196
- <strong>Import Customizer Settings</strong>
197
- <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-customizer-settings"><span class="dashicons dashicons-editor-help"></span></span>
198
- <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-customizer-settings" style="display: none;">
199
- <p><?php _e( 'Customizer is what gives a design to the website; and selecting this option replaces your current design with a new one.', 'astra-sites' ); ?></p>
200
- <p><?php _e( 'Backup of current customizer settings will be stored in "wp-content/astra-sites" directory, just in case if you want to restore it later.', 'astra-sites' ); ?></p>
201
- </div>
202
- </label>
203
- </li>
204
- <li class="astra-sites-import-xml">
205
- <label>
206
- <input type="checkbox" name="xml" checked="checked" class="checkbox">
207
- <strong>Import Content</strong>
208
- </label>
209
- <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-site-content"><span class="dashicons dashicons-editor-help"></span></span>
210
- <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-site-content" style="display: none;"><p><?php _e( 'Selecting this option will import dummy pages, posts, images and menus. If you do not want to import dummy content, please uncheck this option.', 'astra-sites' ); ?></p></div>
211
- </li>
212
- <li class="astra-sites-import-widgets">
213
- <label>
214
- <input type="checkbox" name="widgets" checked="checked" class="checkbox">
215
- <strong>Import Widgets</strong>
216
- </label>
217
- </li>
218
- </ul>
219
- </div>
220
-
221
- <ul>
222
- <li class="astra-sites-reset-data">
223
- <label>
224
- <input type="checkbox" name="reset" class="checkbox">
225
- <strong>Delete Previously Imported Site</strong>
226
- <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-reset-data" style="display: none;"><p><?php _e( 'WARNING: Selecting this option will delete data from your current website. Choose this option only if this is intended.', 'astra-sites' ); ?></p></div>
227
- </label>
228
- </li>
229
- </ul>
230
-
231
- <!-- <p><a href="#" class="astra-sites-advanced-options-button"><?php _e( 'Advanced Options', 'astra-sites' ); ?></a></p> -->
232
-
233
- </div>
234
-
235
- <!-- <div class="astra-sites-advanced-options">
236
- <h4><?php _e( 'Required Plugins', 'astra-sites' ); ?> </h4>
237
- <div class="required-plugins"></div>
238
- </div> -->
239
  </div>
240
  </div>
241
-
242
- <div class="wp-full-overlay-footer">
243
- <div class="footer-import-button-wrap">
244
- <a class="button button-hero hide-if-no-customize button-primary astra-demo-import" href="#" data-import="disabled">
245
- <?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
246
- <span class="percent"></span>
247
- </a>
248
- <div class="astra-site-import-process-wrap" style="display: none;">
249
- <progress class="astra-site-import-process" max="100" value="0"></progress>
250
- </div>
251
- <!-- <a class="button button-hero hide-if-no-customize astra-site-import" href="#">
252
- <?php esc_html_e( 'Import Site', 'astra-sites' ); ?>
253
- </a> -->
254
  </div>
255
- <button type="button" class="collapse-sidebar button" aria-expanded="true"
256
- aria-label="Collapse Sidebar">
257
- <span class="collapse-sidebar-arrow"></span>
258
- <span class="collapse-sidebar-label"><?php esc_html_e( 'Collapse', 'astra-sites' ); ?></span>
259
- </button>
260
-
261
- <div class="devices-wrapper">
262
- <div class="devices">
263
- <button type="button" class="preview-desktop active" aria-pressed="true" data-device="desktop">
264
- <span class="screen-reader-text"><?php _e( 'Enter desktop preview mode', 'astra-sites' ); ?></span>
265
- </button>
266
- <button type="button" class="preview-tablet" aria-pressed="false" data-device="tablet">
267
- <span class="screen-reader-text"><?php _e( 'Enter tablet preview mode', 'astra-sites' ); ?></span>
268
- </button>
269
- <button type="button" class="preview-mobile" aria-pressed="false" data-device="mobile">
270
- <span class="screen-reader-text"><?php _e( 'Enter mobile preview mode', 'astra-sites' ); ?></span>
271
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  </div>
273
  </div>
274
-
275
  </div>
276
- </div>
277
- <div class="wp-full-overlay-main">
278
- <iframe src="{{{data.astra_demo_url}}}" title="<?php esc_attr_e( 'Preview', 'astra-sites' ); ?>"></iframe>
279
- <div class="astra-sites-result-preview" style="display: none;">
280
- <div class="inner">
281
- <h2><?php _e( 'We\'re importing your website.', 'astra-sites' ); ?></h2>
282
- <p><?php _e( 'The process can take anywhere between 2 to 10 minutes depending on the size of the website and speed of connection.', 'astra-sites' ); ?></p>
283
- <p><?php _e( 'Please do not close this browser window until the site is imported completely.', 'astra-sites' ); ?></p>
284
- <div class="current-importing-status-wrap">
285
- <div class="current-importing-status">
286
- <div class="current-importing-status-title"></div>
287
- <div class="current-importing-status-description"></div>
288
- </div>
 
 
 
 
 
 
289
  </div>
290
  </div>
291
  </div>
@@ -293,145 +594,203 @@ defined( 'ABSPATH' ) or exit;
293
  </div>
294
  </script>
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  <?php
297
  /**
298
- * TMPL - No more demos
299
  */
300
  ?>
301
- <script type="text/template" id="tmpl-astra-site-api-request-failed">
302
- <div class="no-themes">
303
- <?php
304
-
305
- /* translators: %1$s & %2$s are a Demo API URL */
306
- printf( __( '<p> It seems the demo data server, <i><a href="%1$s">%2$s</a></i> is unreachable from your site.</p>', 'astra-sites' ), esc_url( Astra_Sites::$api_url ), esc_url( Astra_Sites::$api_url ) );
307
-
308
- _e( '<p class="left-margin"> 1. Sometimes, simple page reload fixes any temporary issues. No kidding!</p>', 'astra-sites' );
309
-
310
- _e( '<p class="left-margin"> 2. If that does not work, you will need to talk to your server administrator and check if demo server is being blocked by the firewall!</p>', 'astra-sites' );
311
-
312
- /* translators: %1$s is a support link */
313
- printf( __( '<p>If that does not help, please open up a <a href="%1$s" target="_blank">Support Ticket</a> and we will be glad take a closer look for you.</p>', 'astra-sites' ), esc_url( 'https://wpastra.com/support/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=api-request-failed' ) );
314
- ?>
315
- </div>
316
  </script>
317
 
318
  <?php
319
  /**
320
- * TMPL - Site Down
321
  */
322
  ?>
323
- <script type="text/template" id="tmpl-astra-site-down">
324
- <div class="postbox astra-site-down">
325
- <h2><?php _e( 'Under Maintenance..', 'astra-sites' ); ?></h2>
326
- <p><?php _e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly. ', 'astra-sites' ); ?></p>
327
- <p><?php _e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website.', 'astra-sites' ); ?></p>
 
 
 
 
 
 
 
 
 
 
328
  </div>
329
  </script>
330
 
331
  <?php
332
  /**
333
- * TMPL - Filters
334
  */
335
  ?>
336
- <script type="text/template" id="tmpl-astra-site-filters">
337
 
338
- <# if ( data ) { #>
 
339
 
340
- <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
 
 
 
 
 
 
 
 
341
 
342
- <# if ( data.args.show_all ) { #>
343
- <li>
344
- <a href="#" data-group="all"> All </a>
345
- </li>
346
- <# } #>
347
 
348
- <# for ( key in data.items ) { #>
349
- <# if ( data.items[ key ].count ) { #>
350
- <li>
351
- <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}">
352
- {{ data.items[ key ].name }}
353
- </a>
354
- </li>
355
- <# } #>
356
- <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
- </ul>
359
- <# } #>
360
- </script>
 
 
 
 
 
 
361
 
362
- <?php
363
- /**
364
- * TMPL - List
365
- */
366
- ?>
367
- <script type="text/template" id="tmpl-astra-sites-list">
368
-
369
- <# if ( data.items.length ) { #>
370
- <# for ( key in data.items ) { #>
371
-
372
- <div class="theme astra-theme site-single {{ data.items[ key ].status }}" tabindex="0" aria-describedby="astra-theme-action astra-theme-name"
373
- data-demo-id="{{{ data.items[ key ].id }}}"
374
- data-demo-type="{{{ data.items[ key ]['astra-site-type'] }}}"
375
- data-demo-url="{{{ data.items[ key ]['astra-site-url'] }}}"
376
- data-demo-api="{{{ data.items[ key ]['_links']['self'][0]['href'] }}}"
377
- data-demo-name="{{{ data.items[ key ].title.rendered }}}"
378
- data-demo-slug="{{{ data.items[ key ].slug }}}"
379
- data-screenshot="{{{ data.items[ key ]['featured-image-url'] }}}"
380
- data-content="{{{ data.items[ key ].content.rendered }}}"
381
- data-required-plugins="{{ JSON.stringify( data.items[ key ]['required-plugins'] ) }}"
382
- data-groups=["{{ data.items[ key ].tags }}"]>
383
- <input type="hidden" class="astra-site-options" value="{{ JSON.stringify(data.items[ key ]['astra-site-options-data'] ) }}" />
384
- <input type="hidden" class="astra-enabled-extensions" value="{{ JSON.stringify(data.items[ key ]['astra-enabled-extensions'] ) }}" />
 
 
 
 
 
 
 
 
 
 
 
385
 
386
- <div class="inner">
387
- <span class="site-preview" data-href="{{ data.items[ key ]['astra-site-url'] }}?TB_iframe=true&width=600&height=550" data-title="{{ data.items[ key ].title.rendered }}">
388
- <div class="theme-screenshot" style="background-image: url('{{ data.items[ key ]['featured-image-url'] }}');"></div>
389
- </span>
390
- <# if ( data.items[ key ]['astra-site-type'] ) { #>
391
- <# var type = ( data.items[ key ]['astra-site-type'] !== 'premium' ) ? ( data.items[ key ]['astra-site-type'] ) : 'agency'; #>
392
- <span class="site-type {{data.items[ key ]['astra-site-type']}}">{{ type }}</span>
393
- <# } #>
394
- <# if ( data.items[ key ].status ) { #>
395
- <span class="status {{data.items[ key ].status}}">{{data.items[ key ].status}}</span>
396
- <# } #>
397
- <div class="theme-id-container">
398
- <h3 class="theme-name" id="astra-theme-name"> {{{ data.items[ key ].title.rendered }}} </h3>
399
- <div class="theme-actions">
400
- <button class="button-primary button preview install-theme-preview"><?php esc_html_e( 'Preview', 'astra-sites' ); ?></button>
401
  </div>
402
  </div>
403
  </div>
404
  </div>
405
- <# } #>
406
- <# } else { #>
407
- <p class="no-themes" style="display:block;">
408
- <?php _e( 'No Demos found, Try a different search.', 'astra-sites' ); ?>
409
- <span class="description">
410
- <?php
411
- /* translators: %1$s External Link */
412
- printf( __( 'Don\'t see a site that you would like to import?<br><a target="_blank" href="%1$s">Please suggest us!</a>', 'astra-sites' ), esc_url( 'https://wpastra.com/sites-suggestions/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=suggestions' ) );
413
- ?>
414
- </span>
415
- </p>
416
- <# } #>
417
- </script>
418
 
419
- <?php
420
- /**
421
- * TMPL - List
422
- */
423
- ?>
424
- <script type="text/template" id="tmpl-astra-sites-suggestions">
425
- <div class="theme astra-theme site-single astra-sites-suggestions">
426
- <div class="inner">
427
- <p>
428
- <?php
429
- /* translators: %1$s External Link */
430
- printf( __( 'Don\'t see a site that you would like to import?<br><a target="_blank" href="%1$s">Please suggest us!</a>', 'astra-sites' ), esc_url( 'https://wpastra.com/sites-suggestions/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=suggestions' ) );
431
- ?>
432
- </p>
433
  </div>
434
  </div>
435
  </script>
 
436
  <?php
437
  wp_print_admin_notice_templates();
11
  * @since 1.0.0
12
  */
13
 
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
+ }
17
 
 
18
 
19
+ ?>
20
 
21
+ <div class="wrap" id="astra-sites-admin" data-slug="<?php echo esc_html( $global_cpt_meta['cpt_slug'] ); ?>">
 
 
22
 
23
+ <?php
24
+ if ( ! empty( $_GET['debug'] ) && 'yes' === $_GET['debug'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
25
+ ?>
26
+ <div class="astra-sites-log">
27
+ <?php Astra_Sites_Importer_Log::get_instance()->display_data(); ?>
28
+ </div>
 
 
 
 
29
 
30
+ <?php } else { ?>
31
 
32
+ <?php do_action( 'astra_sites_before_site_grid' ); ?>
33
 
34
+ <div class="theme-browser rendered">
35
+ <div id="astra-sites" class="themes wp-clearfix"></div>
36
+ <div id="site-pages" class="themes wp-clearfix"></div>
37
+ <div class="astra-sites-result-preview" style="display: none;"></div>
38
 
39
+ <div class="astra-sites-popup" style="display: none;">
40
+ <div class="overlay"></div>
41
+ <div class="inner">
42
+ <div class="heading">
43
+ <h3><?php esc_html_e( 'Heading', 'astra-sites' ); ?></h3>
44
+ <span class="dashicons close dashicons-no-alt"></span>
45
+ </div>
46
+ <div class="astra-sites-import-content"></div>
47
+ <div class="ast-actioms-wrap"></div>
48
  </div>
49
  </div>
50
+ </div>
51
+
52
+ <?php do_action( 'astra_sites_after_site_grid' ); ?>
53
+
54
+ <?php } ?>
55
+ </div>
56
+
57
+ <script type="text/template" id="tmpl-astra-sites-compatibility-messages">
58
 
59
+ <div class="skip-and-import">
60
+ <div class="heading">
61
+ <h3><?php esc_html_e( 'We\'re Almost There!', 'astra-sites' ); ?></h3>
62
+ <span class="dashicons close dashicons-no-alt"></span>
63
+ </div>
64
+ <div class="astra-sites-import-content">
65
+
66
+ <p><?php esc_html_e( 'You\'re close to importing the template. To complete the process, please clear the following conditions.', 'astra-sites' ); ?></p>
67
+
68
+ <ul class="astra-site-contents">
69
+
70
+ <# for ( code in data ) { #>
71
+ <# if( Object.keys( data[ code ] ).length ) { #>
72
+
73
+ <# for ( id in data[ code ] ) { #>
74
+ <li>
75
+ {{{ data[ code ][id].title }}}
76
+
77
+ <# if ( data[ code ][id].tooltip ) { #>
78
+ <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-skip-and-import-notice-{{id}}">
79
+ <span class="dashicons dashicons-editor-help"></span>
80
+ </span>
81
+ <div class="astra-sites-tooltip-message" id="astra-sites-skip-and-import-notice-{{id}}" style="display: none;">
82
+ {{{data[ code ][id].tooltip}}}
83
+ </div>
84
+ <# } #>
85
+ </li>
86
+ <# } #>
87
+
88
+ <# } #>
89
+ <# } #>
90
+
91
+ </ul>
92
+
93
+ </div>
94
+ <div class="ast-actioms-wrap">
95
+ <# if( Object.keys( data['errors'] ).length ) { #>
96
+ <a href="#" class="button button-hero button-primary astra-demo-import disabled site-install-site-button"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
97
+ <# } else { #>
98
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
99
+ <# } #>
100
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
101
+ </div>
102
  </div>
103
 
104
+ </script>
105
 
106
+ <script type="text/template" id="tmpl-astra-sites-no-sites">
107
+ <div class="astra-sites-no-sites">
108
+ <div class="inner">
109
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
110
+ <div class="content">
111
+ <div class="empty-item">
112
+ <img class="empty-collection-part" src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/empty-collection.svg' ); ?>" alt="empty-collection">
113
+ </div>
114
+ <div class="description">
115
+ <p>
116
+ <?php
117
+ $s_url = Astra_Sites_White_Label::get_option( 'astra-agency', 'licence' );
118
+ /* translators: %1$s External Link */
119
+ printf( __( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( $s_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
120
+ ?>
121
+ </p>
122
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
123
+ </div>
124
+ </div>
125
+ </div>
126
  </div>
127
+ </script>
128
 
129
+ <script type="text/template" id="tmpl-astra-sites-no-favorites">
130
+ <div class="astra-sites-no-favorites">
131
+ <div class="inner">
132
+ <h3><?php esc_html_e( 'Favorite Template List Is Empty.', 'astra-sites' ); ?></h3>
133
+ <div class="content">
134
+ <div class="empty-item">
135
+ <img class="empty-collection-part" src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/empty-collection.svg' ); ?>" alt="empty-collection">
136
+ </div>
137
+ <div class="description">
138
+ <p>
139
+ <?php
140
+ /* translators: %1$s External Link */
141
+ esc_html_e( 'You\'ll notice a heart-shaped symbol on every template card. Simply tap this icon to mark the template as Favorite.', 'astra-sites' );
142
+ ?>
143
+ </p>
144
+ <img src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/arrow-blue.svg' ); ?>" class="arrow-img">
145
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ </script>
151
+ <?php
152
+ /**
153
+ * TMPL - Show Page Builder Sites
154
+ */
155
+ ?>
156
+ <script type="text/template" id="tmpl-astra-sites-page-builder-sites">
157
+ <# for ( site_id in data ) { #>
158
+ <#
159
+ var current_site_id = site_id;
160
+ var type = data[site_id]['type'] || 'site';
161
+ var wrapper_class = data[site_id]['class'] || '';
162
+ var page_site_id = data[site_id]['site_id'] || '';
163
+ var favorite_status = false;
164
+ var favorite_class = '';
165
+ var favorite_title = '<?php esc_html_e( 'Make as Favorite', 'astra-sites' ); ?>';
166
+ var featured_image_url = data[site_id]['featured-image-url'];
167
+ var thumbnail_image_url = data[site_id]['thumbnail-image-url'] || featured_image_url;
168
+
169
+ var site_type = data[site_id]['astra-sites-type'] || '';
170
+ var page_id = '';
171
+ if ( 'site' === type ) {
172
+ if( Object.values( astraSitesVars.favorite_data ).indexOf( String(site_id) ) >= 0 ) {
173
+ favorite_class = 'is-favorite';
174
+ favorite_status = true;
175
+ favorite_title = '<?php esc_html_e( 'Make as Unfavorite', 'astra-sites' ); ?>';
176
+ }
177
+ } else {
178
+ thumbnail_image_url = featured_image_url;
179
+ current_site_id = page_site_id;
180
+ page_id = site_id;
181
+ }
182
+
183
+ var title = data[site_id]['title'] || '';
184
+ var pages_count = parseInt( data[site_id]['pages-count'] ) || 0;
185
+ var pages_count_class = '';
186
+ var pages_count_string = ( pages_count !== 1 ) ? pages_count + ' Templates' : pages_count + ' Template';
187
+ if( 'site' === type ) {
188
+ if( pages_count ) {
189
+ pages_count_class = 'has-pages';
190
+ } else {
191
+ pages_count_class = 'no-pages';
192
+ }
193
+ }
194
+ var site_title = data[site_id]['site-title'] || '';
195
+
196
+ #>
197
+ <div class="theme astra-theme site-single {{favorite_class}} {{pages_count_class}} astra-sites-previewing-{{type}} {{wrapper_class}}" data-site-id="{{current_site_id}}" data-page-id="{{page_id}}">
198
+ <div class="inner">
199
+ <span class="site-preview" data-title="{{{title}}}">
200
+ <div class="theme-screenshot one loading" data-src="{{thumbnail_image_url}}" data-featured-src="{{featured_image_url}}"></div>
201
+ </span>
202
+ <div class="theme-id-container">
203
+ <div class="theme-name">
204
+ <span class="title">
205
+ <# if ( 'site' === type ) { #>
206
+ <div class='site-title'>{{{title}}}</div>
207
+ <# if ( pages_count ) { #>
208
+ <div class='pages-count'>{{{pages_count_string}}}</div>
209
+ <# } #>
210
+ <# } else { #>
211
+ <div class='site-title'>{{{site_title}}}</div>
212
+ <div class='page-title'>{{{title}}}</div>
213
+ <# } #>
214
+ </span>
215
+ </div>
216
+ <# if ( '' === type || 'site' === type ) { #>
217
+ <div class="favorite-action-wrap" data-favorite="{{favorite_class}}" title="{{favorite_title}}">
218
+ <i class="icon-heart"></i>
219
+ </div>
220
+ <# } #>
221
+ </div>
222
+ <# if ( site_type && 'free' !== site_type ) { #>
223
+ <?php /* translators: %s are white label strings. */ ?>
224
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
225
+ <# } #>
226
+ </div>
227
  </div>
228
+ <# } #>
229
+
230
+ </script>
231
 
232
+ <?php
233
+ /**
234
+ * TMPL - Show Page Builder Sites
235
+ */
236
+ ?>
237
+ <script type="text/template" id="tmpl-astra-sites-page-builder-sites-search">
238
+ <# var pages_list = []; #>
239
+ <# var sites_list = []; #>
240
+ <# var pages_list_arr = []; #>
241
+ <# var sites_list_arr = []; #>
242
+ <# for ( site_id in data ) {
243
+ var type = data[site_id]['type'] || 'site';
244
+ if ( 'site' === type ) {
245
+ sites_list_arr.push( data[site_id] );
246
+ sites_list[site_id] = data[site_id];
247
+ } else {
248
+ pages_list_arr.push( data[site_id] );
249
+ pages_list[site_id] = data[site_id]
250
+ }
251
+ } #>
252
+ <# if ( sites_list_arr.length > 0 ) { #>
253
+ <h3 class="ast-sites__search-title"><?php esc_html_e( 'Site Templates', 'astra-sites' ); ?></h3>
254
+ <div class="ast-sites__search-wrap">
255
+ <# for ( site_id in sites_list ) { #>
256
+ <#
257
+ var current_site_id = site_id;
258
+ var type = sites_list[site_id]['type'] || 'site';
259
+ var page_site_id = sites_list[site_id]['site_id'] || '';
260
+ var favorite_status = false;
261
+ var favorite_class = '';
262
+ var favorite_title = '<?php esc_html_e( 'Make as Favorite', 'astra-sites' ); ?>';
263
+ var featured_image_url = sites_list[site_id]['featured-image-url'];
264
+ var thumbnail_image_url = sites_list[site_id]['thumbnail-image-url'] || featured_image_url;
265
+
266
+ var site_type = sites_list[site_id]['astra-sites-type'] || '';
267
+ var page_id = '';
268
+ if( Object.values( astraSitesVars.favorite_data ).indexOf( String(site_id) ) >= 0 ) {
269
+ favorite_class = 'is-favorite';
270
+ favorite_status = true;
271
+ favorite_title = '<?php esc_html_e( 'Make as Unfavorite', 'astra-sites' ); ?>';
272
+ }
273
+
274
+ var title = sites_list[site_id]['title'] || '';
275
+ var pages_count = parseInt( sites_list[site_id]['pages-count'] ) || 0;
276
+ var pages_count_string = ( pages_count !== 1 ) ? pages_count + ' Templates' : pages_count + ' Template';
277
+ var pages_count_class = '';
278
+ if( pages_count ) {
279
+ pages_count_class = 'has-pages';
280
+ } else {
281
+ pages_count_class = 'no-pages';
282
+ }
283
+ var site_title = sites_list[site_id]['site-title'] || '';
284
+
285
+ #>
286
+ <div class="theme astra-theme site-single {{favorite_class}} {{pages_count_class}} astra-sites-previewing-{{type}}" data-site-id="{{current_site_id}}" data-page-id="{{page_id}}">
287
+ <div class="inner">
288
+ <span class="site-preview" data-title="{{{title}}}">
289
+ <div class="theme-screenshot one loading" data-src="{{thumbnail_image_url}}" data-featured-src="{{featured_image_url}}"></div>
290
+ </span>
291
+ <div class="theme-id-container">
292
+ <div class="theme-name">
293
+ <span class="title">
294
+ <# if ( 'site' === type ) { #>
295
+ <div class='site-title'>{{{title}}}</div>
296
+ <# if ( pages_count ) { #>
297
+ <div class='pages-count'>{{{pages_count_string}}}</div>
298
+ <# } #>
299
+ <# } else { #>
300
+ <div class='site-title'>{{{site_title}}}</div>
301
+ <div class='page-title'>{{{title}}}</div>
302
+ <# } #>
303
+ </span>
304
+ </div>
305
+ <# if ( '' === type || 'site' === type ) { #>
306
+ <div class="favorite-action-wrap" data-favorite="{{favorite_class}}" title="{{favorite_title}}">
307
+ <i class="icon-heart"></i>
308
+ </div>
309
+ <# } #>
310
+ </div>
311
+ <# if ( site_type && 'free' !== site_type ) { #>
312
+ <?php /* translators: %s are white label strings. */ ?>
313
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
314
+ <# } #>
315
+ </div>
316
+ </div>
317
+ <# } #>
318
+ </div>
319
+ <# } #>
320
+ <# if ( pages_list_arr.length > 0 ) { #>
321
+
322
+ <h3 class="ast-sites__search-title"><?php esc_html_e( 'Page Templates', 'astra-sites' ); ?></h3>
323
+ <div class="ast-sites__search-wrap">
324
+ <# for ( site_id in pages_list ) { #>
325
+ <#
326
+ var current_site_id = site_id;
327
+ var type = pages_list[site_id]['type'] || 'site';
328
+ var page_site_id = pages_list[site_id]['site_id'] || '';
329
+ var favorite_status = false;
330
+ var favorite_class = '';
331
+ var favorite_title = '<?php esc_html_e( 'Make as Favorite', 'astra-sites' ); ?>';
332
+ var featured_image_url = pages_list[site_id]['featured-image-url'];
333
+ var thumbnail_image_url = pages_list[site_id]['thumbnail-image-url'] || featured_image_url;
334
+
335
+ var site_type = pages_list[site_id]['astra-sites-type'] || '';
336
+ var page_id = '';
337
+ thumbnail_image_url = featured_image_url;
338
+ current_site_id = page_site_id;
339
+ page_id = site_id;
340
+
341
+ var title = pages_list[site_id]['title'] || '';
342
+ var pages_count = pages_list[site_id]['pages-count'] || 0;
343
+ var pages_count_class = '';
344
+ if( 'site' === type ) {
345
+ if( pages_count ) {
346
+ pages_count_class = 'has-pages';
347
+ } else {
348
+ pages_count_class = 'no-pages';
349
+ }
350
+ }
351
+ var site_title = pages_list[site_id]['site-title'] || '';
352
+
353
+ #>
354
+ <div class="theme astra-theme site-single {{favorite_class}} {{pages_count_class}} astra-sites-previewing-{{type}}" data-site-id="{{current_site_id}}" data-page-id="{{page_id}}">
355
+ <div class="inner">
356
+ <span class="site-preview" data-title="{{{title}}}">
357
+ <div class="theme-screenshot one loading" data-src="{{thumbnail_image_url}}" data-featured-src="{{featured_image_url}}"></div>
358
+ </span>
359
+ <div class="theme-id-container">
360
+ <div class="theme-name">
361
+ <span class="title">
362
+ <div class='site-title'>{{{site_title}}}</div>
363
+ <div class='page-title'>{{{title}}}</div>
364
+ </span>
365
+ </div>
366
+ <# if ( '' === type || 'site' === type ) { #>
367
+ <div class="favorite-action-wrap" data-favorite="{{favorite_class}}" title="{{favorite_title}}">
368
+ <i class="icon-heart"></i>
369
+ </div>
370
+ <# } #>
371
+ </div>
372
+ <# if ( site_type && 'free' !== site_type ) { #>
373
+ <?php /* translators: %s are white label strings. */ ?>
374
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
375
+ <# } #>
376
+ </div>
377
+ </div>
378
+ <# } #>
379
+ </div>
380
+ <# } #>
381
 
382
+ </script>
383
 
384
  <?php
385
  /**
387
  */
388
  ?>
389
  <script type="text/template" id="tmpl-astra-sites-pro-site-description">
 
390
  <p>
391
  <?php
392
  /* translators: %s is pricing page link */
393
+ printf( __( 'This is a premium template available with \'Agency\' package. you can purchase it from <a href="%s" target="_blank">here</a>.', 'astra-sites' ), 'https://wpastra.com/pricing/' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
394
  ?>
395
  </p>
396
  <p>
397
  <?php
398
  /* translators: %s is article link */
399
+ printf( __( 'If you already own an Agency pack. Read an article to know how you can <a href="%s" target="_blank">import a premium website demo</a>.', 'astra-sites' ), esc_url( 'https://wpastra.com/docs/starter-templates-complete-site/' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
400
+ ?>
401
+ </p>
402
+ </script>
403
+
404
+ <?php
405
+ /**
406
+ * TMPL - Activate License
407
+ */
408
+ ?>
409
+ <script type="text/template" id="tmpl-astra-sites-skip-templates">
410
+ <p><?php esc_html_e( 'The page templates which contain the dynamic widgets/modules are not available for single template import. With the "Import Site" option, you can get those pages.', 'astra-sites' ); ?></p>
411
+ <p><?php esc_html_e( 'You can have the complete site preview from bottom left button.', 'astra-sites' ); ?></p>
412
+ </script>
413
+
414
+ <?php
415
+ /**
416
+ * TMPL - Activate License
417
+ */
418
+ ?>
419
+ <script type="text/template" id="tmpl-astra-sites-activate-license">
420
+ <?php
421
+ do_action( 'astra_sites_activate_license_popup' );
422
+ ?>
423
+ </script>
424
+
425
+ <?php
426
+ /**
427
+ * TMPL - Invalid Mini Agency License
428
+ */
429
+ ?>
430
+ <script type="text/template" id="tmpl-astra-sites-invalid-mini-agency-license">
431
+ <p>
432
+ <?php
433
+ $page_builder = get_option( 'astra-sites-license-page-builder', '' );
434
+ if ( 'elementor' === $page_builder ) {
435
+ $current_page_builder = 'Elementor';
436
+ $upgrade_page_builder = 'Beaver Builder';
437
+ } else {
438
+ $current_page_builder = 'Beaver Builder';
439
+ $upgrade_page_builder = 'Elementor';
440
+ }
441
+
442
+ /* translators: %s is pricing page link */
443
+ printf( __( '<p>Seems like you have purchased the %4$s \'Mini Agency\' package with a choice of \'%1$s\' page builder addon.</p><p>While this template is built with \'%2$s\' page builder addon.</p><p>Read article <a href="%3$s" target="_blank">here</a> to see how you can proceed.</p>', 'astra-sites' ), esc_html( $current_page_builder ), esc_html( $upgrade_page_builder ), esc_url( Astra_Sites_White_Label::get_instance()->get_white_label_link( 'https://wpastra.com/docs/not-valid-license/' ) ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
444
  ?>
445
  </p>
446
  </script>
451
  */
452
  ?>
453
  <script type="text/template" id="tmpl-astra-sites-pro-inactive-site-description">
454
+ <p><?php esc_html_e( 'You are just 2 minutes away from importing this demo!', 'astra-sites' ); ?></p>
455
+ <p><?php esc_html_e( 'This is a premium website demo template. Please activate your license to access it.', 'astra-sites' ); ?></p>
456
  <p>
457
  <?php
458
  /* translators: %s is article link */
459
+ printf( __( 'Learn how you can <a href="%1$s" target="_blank">activate the license</a> of the %2$s plugin.', 'astra-sites' ), esc_url( 'https://wpastra.com/docs/activate-license-for-astra-premium-sites-plugin/' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
460
  ?>
461
  </p>
462
  </script>
463
 
464
  <?php
465
  /**
466
+ * TMPL - Update Available Plugins
467
  */
468
  ?>
469
+ <script type="text/template" id="tmpl-astra-sites-update-available-required-plugins">
470
+ <div class="skip-and-import">
471
+ <div class="heading">
472
+ <h3><?php esc_html_e( 'Update Plugin', 'astra-sites' ); ?></h3>
473
+ <span class="dashicons close dashicons-no-alt"></span>
474
+ </div>
475
+ <div class="astra-sites-import-content">
476
+ <p><?php esc_html_e( 'Updates are available for plugins used in this starter template.', 'astra-sites' ); ?></p>
477
+ <p><?php esc_html_e( 'Kindly update them for a successful import. Skipping this step might break the template design/feature.', 'astra-sites' ); ?></p>
478
+ <ul class="astra-sites-third-party-required-plugins">
479
+ <# for ( key in data ) { #>
480
+ <li class="plugin-card plugin-card-{{data[ key ].slug}}'" data-slug="{{data[ key ].slug }}" data-init="{{data[ key ].init}}" data-name="{{data[ key ].name}}">{{data[ key ].name}}</li>
481
+ <# } #>
482
+ </ul>
483
+ </div>
484
+ <div class="ast-actioms-wrap">
485
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
486
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
487
+ </div>
488
  </div>
489
  </script>
490
 
491
  <?php
492
  /**
493
+ * TMPL - Third Party Required Plugins
494
  */
495
  ?>
496
+ <script type="text/template" id="tmpl-astra-sites-third-party-required-plugins">
497
+ <div class="skip-and-import">
498
+ <div class="heading">
499
+ <h3><?php esc_html_e( 'Required Plugins Missing', 'astra-sites' ); ?></h3>
500
+ <span class="dashicons close dashicons-no-alt"></span>
501
+ </div>
502
+ <div class="astra-sites-import-content">
503
+ <p><?php esc_html_e( 'This starter template requires premium plugins. As these are third party premium plugins, you\'ll need to purchase, install and activate them first.', 'astra-sites' ); ?></p>
504
+ <ul class="astra-sites-third-party-required-plugins">
505
+ <# for ( key in data ) { #>
506
+ <li class="plugin-card plugin-card-{{data[ key ].slug}}'" data-slug="{{data[ key ].slug }}" data-init="{{data[ key ].init}}" data-name="{{data[ key ].name}}"><a href="{{data[ key ].link}}" target="_blank">{{data[ key ].name}}</a></li>
507
+ <# } #>
508
+ </ul>
509
+ </div>
510
+ <div class="ast-actioms-wrap">
511
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
512
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
513
  </div>
 
514
  </div>
515
  </script>
516
 
517
  <?php
518
  /**
519
+ * TMPL - Single Site Preview
520
  */
521
  ?>
522
+ <script type="text/template" id="tmpl-astra-sites-single-site-preview">
523
+ <div class="single-site-wrap">
524
+ <div class="single-site">
525
+ <div class="single-site-preview-wrap">
526
+ <div class="single-site-pages-header">
527
+ <h3 class="astra-site-title">{{{data['title']}}}</h3>
528
+ <span class="count" style="display: none"></span>
529
+ </div>
530
+ <div class="single-site-preview">
531
+ <img class="theme-screenshot" data-src="" src="{{data['featured-image-url']}}" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  </div>
533
  </div>
534
+ <div class="single-site-pages-wrap">
535
+ <div class="astra-pages-title-wrap">
536
+ <span class="astra-pages-title"><?php esc_html_e( 'Page Templates', 'astra-sites' ); ?></span>
 
 
 
 
 
 
 
 
 
 
537
  </div>
538
+ <div class="single-site-pages">
539
+ <div id="single-pages">
540
+ <# for ( page_id in data.pages ) {
541
+ var dynamic_page = data.pages[page_id]['dynamic-page'] || 'no'; #>
542
+ <div class="theme astra-theme site-single" data-page-id="{{page_id}}" data-dynamic-page="{{dynamic_page}}" >
543
+ <div class="inner">
544
+ <#
545
+ var featured_image_class = '';
546
+ var featured_image = data.pages[page_id]['featured-image-url'] || '';
547
+ if( '' === featured_image ) {
548
+ featured_image = '<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/placeholder.png' ); ?>';
549
+ featured_image_class = ' no-featured-image ';
550
+ }
551
+
552
+ var thumbnail_image = data.pages[page_id]['thumbnail-image-url'] || '';
553
+ if( '' === thumbnail_image ) {
554
+ thumbnail_image = featured_image;
555
+ }
556
+ #>
557
+ <span class="site-preview" data-title="{{ data.pages[page_id]['title'] }}">
558
+ <div class="theme-screenshot one loading {{ featured_image_class }}" data-src="{{ thumbnail_image }}" data-featured-src="{{ featured_image }}"></div>
559
+ </span>
560
+ <div class="theme-id-container">
561
+ <h3 class="theme-name">
562
+ {{{ data.pages[page_id]['title'] }}}
563
+ </h3>
564
+ </div>
565
+ </div>
566
+ </div>
567
+ <# } #>
568
  </div>
569
  </div>
 
570
  </div>
571
+ <div class="single-site-footer">
572
+ <div class="site-action-buttons-wrap">
573
+ <?php $white_label_class = ( Astra_Sites_White_Label::get_instance()->get_white_label_name() !== ASTRA_SITES_NAME ) ? 'ast-white-label-flag' : ''; ?>
574
+ <a href="{{data['astra-site-url']}}" class="button button-hero site-preview-button <?php echo esc_html( $white_label_class ); ?>" target="_blank">Preview "{{{data['title']}}}" Site <i class="dashicons dashicons-external"></i></a>
575
+ <div class="site-action-buttons-right">
576
+ <# if( 'free' !== data['astra-sites-type'] && '' !== astraSitesVars.license_page_builder && data['astra-site-page-builder'] !== astraSitesVars.license_page_builder && ( 'brizy' !== data['astra-site-page-builder'] && 'gutenberg' !== data['astra-site-page-builder'] ) ) { #>
577
+ <a class="button button-hero button-primary disabled astra-sites-invalid-mini-agency-license-button"><?php esc_html_e( 'Not Valid License', 'astra-sites' ); ?></a>
578
+ <span class="dashicons dashicons-editor-help astra-sites-invalid-mini-agency-license-button"></span>
579
+ <# } else if( 'free' !== data['astra-sites-type'] && ! astraSitesVars.license_status ) { #>
580
+ <# if( ! astraSitesVars.isPro ) { #>
581
+ <a class="button button-hero button-primary " href="{{astraSitesVars.getProURL}}" target="_blank">{{astraSitesVars.getProText}}<i class="dashicons dashicons-external"></i></a>
582
+ <span class="dashicons dashicons-editor-help astra-sites-get-agency-bundle-button"></span>
583
+ <# } else { #>
584
+ <span class="button button-hero button-primary astra-sites-activate-license-button">{{astraSitesVars.getProText}}</span>
585
+ <# } #>
586
+ <# } else { #>
587
+ <div class="button button-hero button-primary site-import-site-button"><?php esc_html_e( 'Import Complete Site', 'astra-sites' ); ?></div>
588
+ <div style="margin-left: 5px;" class="button button-hero button-primary site-import-layout-button disabled"><?php esc_html_e( 'Import Template', 'astra-sites' ); ?></div>
589
+ <# } #>
590
  </div>
591
  </div>
592
  </div>
594
  </div>
595
  </script>
596
 
597
+ <script type="text/template" id="tmpl-astra-sites-site-import-success">
598
+ <div class="heading">
599
+ <h3><?php esc_html_e( 'Imported Successfully!', 'astra-sites' ); ?></h3>
600
+ <span class="dashicons close dashicons-no-alt"></span>
601
+ </div>
602
+ <div class="astra-sites-import-content">
603
+ <p><b><?php esc_html_e( 'Hurray! The Website Imported Successfully! 🎉', 'astra-sites' ); ?></b></p>
604
+ <p><?php esc_html_e( 'Go ahead, customize the text, images and design to make it yours!', 'astra-sites' ); ?></p>
605
+ <p><?php esc_html_e( 'Have fun!', 'astra-sites' ); ?></p>
606
+ </div>
607
+ <div class="ast-actioms-wrap">
608
+ <a class="button button-primary button-hero" href="<?php echo esc_url( site_url() ); ?>" target="_blank"><?php esc_html_e( 'View Site', 'astra-sites' ); ?> <i class="dashicons dashicons-external"></i></a>
609
+ </div>
610
+ </script>
611
+
612
+ <script type="text/template" id="tmpl-astra-sites-page-import-success">
613
+ <div class="heading">
614
+ <h3><?php esc_html_e( 'Imported Successfully!', 'astra-sites' ); ?></h3>
615
+ <span class="dashicons close dashicons-no-alt"></span>
616
+ </div>
617
+ <div class="astra-sites-import-content">
618
+ <p><b><?php esc_html_e( 'Hurray! The Template Imported Successfully! 🎉', 'astra-sites' ); ?></b></p>
619
+ <p><?php esc_html_e( 'Go ahead, customize the text, images and design to make it yours!', 'astra-sites' ); ?></p>
620
+ <p><?php esc_html_e( 'Have fun!', 'astra-sites' ); ?></p>
621
+ </div>
622
+ <div class="ast-actioms-wrap">
623
+ <a class="button button-primary button-hero" href="{{data['link']}}" target="_blank"><?php esc_html_e( 'View Template', 'astra-sites' ); ?> <i class="dashicons dashicons-external"></i></a>
624
+ </div>
625
+ </script>
626
+
627
  <?php
628
  /**
629
+ * TMPL - Import Process Interrupted
630
  */
631
  ?>
632
+ <script type="text/template" id="tmpl-astra-sites-request-failed">
633
+ <p><?php esc_html_e( 'The import process interrupted!', 'astra-sites' ); ?></p>
634
+ <p><?php esc_html_e( 'Your website is facing a temporary issue connecting to the template server.', 'astra-sites' ); ?></p>
635
+ <p><?php esc_html_e( 'Please try again after some time.', 'astra-sites' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
636
  </script>
637
 
638
  <?php
639
  /**
640
+ * TMPL - Dynamic Page
641
  */
642
  ?>
643
+ <script type="text/template" id="tmpl-astra-sites-dynamic-page">
644
+ <div class="skip-and-import">
645
+ <div class="heading">
646
+ <h3><?php esc_html_e( 'Heads Up!', 'astra-sites' ); ?></h3>
647
+ <span class="dashicons close dashicons-no-alt"></span>
648
+ </div>
649
+ <div class="astra-sites-import-content">
650
+ <p><?php esc_html_e( 'The page template you are about to import contains a dynamic widget/module. Please note this dynamic data will not be available with the imported page.', 'astra-sites' ); ?></p>
651
+ <p><?php esc_html_e( 'You will need to add it manually on the page.', 'astra-sites' ); ?></p>
652
+ <p><?php esc_html_e( 'This dynamic content will be available when you import the entire site.', 'astra-sites' ); ?></p>
653
+ </div>
654
+ <div class="ast-actioms-wrap">
655
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
656
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
657
+ </div>
658
  </div>
659
  </script>
660
 
661
  <?php
662
  /**
663
+ * TMPL - First Screen
664
  */
665
  ?>
666
+ <script type="text/template" id="tmpl-astra-sites-result-preview">
667
 
668
+ <div class="overlay"></div>
669
+ <div class="inner">
670
 
671
+ <div class="default">
672
+ <div class="heading">
673
+ <# if( 'astra-sites' === data ) { #>
674
+ <h3><?php esc_html_e( 'Your Selected Website is Being Imported!', 'astra-sites' ); ?></h3>
675
+ <# } else { #>
676
+ <h3><?php esc_html_e( 'Your Selected Template is Being Imported!', 'astra-sites' ); ?></h3>
677
+ <# } #>
678
+ <span class="dashicons close dashicons-no-alt"></span>
679
+ </div>
680
 
681
+ <div class="astra-sites-import-content">
682
+ <div class="install-theme-info">
683
+ <div class="astra-sites-advanced-options-wrap">
684
+ <div class="astra-sites-advanced-options">
685
+ <ul class="astra-site-contents">
686
 
687
+ <# if( 'astra-sites' === data ) { #>
688
+ <li class="astra-sites-reset-data">
689
+ <label>
690
+ <input type="checkbox" name="reset" class="checkbox">
691
+ <strong><?php esc_html_e( 'Delete Previously Imported Site', 'astra-sites' ); ?></strong>
692
+ <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-reset-data" style="display: none;"><p><?php esc_html_e( 'WARNING: Selecting this option will delete all data from the previous import. Choose this option only if this is intended.', 'astra-sites' ); ?></p></div>
693
+ </label>
694
+ </li>
695
+
696
+ <?php $theme_status = Astra_Sites::get_instance()->get_theme_status(); ?>
697
+ <?php $theme_dependancy_class = ''; ?>
698
+ <?php if ( 'installed-and-active' !== $theme_status ) { ?>
699
+ <?php $theme_dependancy_class = 'astra-theme-module'; ?>
700
+ <li class="astra-sites-theme-activation">
701
+ <label>
702
+ <input type="checkbox" name="reset" class="checkbox" checked="checked" data-status="<?php echo esc_attr( $theme_status ); ?>">
703
+ <strong><?php esc_html_e( 'Install & Activate Astra Theme', 'astra-sites' ); ?></strong>
704
+ <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-theme-activation" style="display: none;"><p><?php esc_html_e( 'To import the site in the original format, you would need the Astra theme activated. You can import it with any other theme, but the site might lose some of the design settings and look a bit different.', 'astra-sites' ); ?></p></div>
705
+ </label>
706
+ </li>
707
+ <?php } ?>
708
+
709
+ <li class="astra-sites-import-customizer <?php echo esc_attr( $theme_dependancy_class ); ?>">
710
+ <label>
711
+ <input type="checkbox" name="customizer" checked="checked" class="checkbox">
712
+ <strong><?php esc_html_e( 'Import Customizer Settings', 'astra-sites' ); ?></strong>
713
+ <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-customizer-settings"><span class="dashicons dashicons-editor-help"></span></span>
714
+ <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-customizer-settings" style="display: none;">
715
+ <?php /* translators: %s are white label strings. */ ?>
716
+ <p><?php printf( esc_html__( '%1$s customizer serves global settings that give uniform design to the website. Choosing this option will override your current customizer settings.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
717
+ </div>
718
+ </label>
719
+ </li>
720
+
721
+ <# } #>
722
+
723
+ <# if( 'astra-sites' === data ) { #>
724
+ <li class="astra-sites-import-widgets">
725
+ <label>
726
+ <input type="checkbox" name="widgets" checked="checked" class="checkbox">
727
+ <strong><?php esc_html_e( 'Import Widgets', 'astra-sites' ); ?></strong>
728
+ </label>
729
+ </li>
730
+ <# } #>
731
 
732
+ <li class="astra-sites-import-plugins">
733
+ <input type="checkbox" name="plugins" checked="checked" class="disabled checkbox" readonly>
734
+ <strong><?php esc_html_e( 'Install Required Plugins', 'astra-sites' ); ?></strong>
735
+ <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-plugins-settings"><span class="dashicons dashicons-editor-help"></span></span>
736
+ <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-plugins-settings" style="display: none;">
737
+ <p><?php esc_html_e( 'Plugins needed to import this template are missing. Required plugins will be installed and activated automatically.', 'astra-sites' ); ?></p>
738
+ <ul class="required-plugins-list"><span class="spinner is-active"></span></ul>
739
+ </div>
740
+ </li>
741
 
742
+ <# if( 'astra-sites' === data ) { #>
743
+ <li class="astra-sites-import-xml">
744
+ <label>
745
+ <input type="checkbox" name="xml" checked="checked" class="checkbox">
746
+ <strong><?php esc_html_e( 'Import Content', 'astra-sites' ); ?></strong>
747
+ </label>
748
+ <span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-site-content"><span class="dashicons dashicons-editor-help"></span></span>
749
+ <div class="astra-sites-tooltip-message" id="astra-sites-tooltip-site-content" style="display: none;"><p><?php esc_html_e( 'Selecting this option will import dummy pages, posts, images, and menus. If you do not want to import dummy content, please uncheck this option.', 'astra-sites' ); ?></p></div>
750
+ </li>
751
+ <# } #>
752
+ </ul>
753
+ </div>
754
+ </div>
755
+ </div>
756
+ <div class="ast-importing-wrap">
757
+ <#
758
+ if( 'astra-sites' === data ) {
759
+ var string = 'sites';
760
+ } else {
761
+ var string = 'template';
762
+ }
763
+ #>
764
+ <p>
765
+ <?php
766
+ /* translators: %s is the dynamic string. */
767
+ printf( esc_html__( 'Import process can take anywhere between 2 to 10 minutes depending on the size of the %s and speed of the connection.', 'astra-sites' ), '{{string}}' );
768
+ ?>
769
+ </p>
770
+ <p>
771
+ <?php
772
+ /* translators: %s is the dynamic string. */
773
+ printf( esc_html__( 'Please do NOT close this browser window until the %s is imported completely.', 'astra-sites' ), '{{string}}' );
774
+ ?>
775
+ </p>
776
 
777
+ <div class="current-importing-status-wrap">
778
+ <div class="current-importing-status">
779
+ <div class="current-importing-status-title"></div>
780
+ <div class="current-importing-status-description"></div>
 
 
 
 
 
 
 
 
 
 
 
781
  </div>
782
  </div>
783
  </div>
784
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
785
 
786
+ <div class="ast-actioms-wrap">
787
+ <a href="#" class="button button-hero button-primary astra-demo-import disabled site-install-site-button"><?php esc_html_e( 'Import', 'astra-sites' ); ?></a>
788
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import" style="display: none;"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
789
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
790
+ </div>
 
 
 
 
 
 
 
 
 
791
  </div>
792
  </div>
793
  </script>
794
+
795
  <?php
796
  wp_print_admin_notice_templates();
inc/includes/image-templates.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shortcode Markup
4
+ *
5
+ * TMPL - Single Demo Preview
6
+ * TMPL - No more demos
7
+ * TMPL - Filters
8
+ * TMPL - List
9
+ *
10
+ * @package Astra Sites
11
+ * @since 2.0.0
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
+ }
17
+
18
+ ?>
19
+
20
+ <script type="text/template" id="tmpl-ast-image-skeleton">
21
+ <div class="ast-image__skeleton-wrap">
22
+ <div class="ast-image__skeleton-inner-wrap">
23
+ <div class="ast-image__skeleton">
24
+ </div>
25
+ <div class="ast-image__preview-skeleton">
26
+ </div>
27
+ </div>
28
+ </div>
29
+ <div class="ast-image__loader-wrap">
30
+ <div class="ast-image__loader-1"></div>
31
+ <div class="ast-image__loader-2"></div>
32
+ <div class="ast-image__loader-3"></div>
33
+ </div>
34
+ </script>
35
+
36
+ <script type="text/template" id="tmpl-ast-image-list">
37
+
38
+ <# var count = 0; #>
39
+ <# for ( key in data ) { count++; #>
40
+ <# var imported_class = _.includes( astraImages.saved_images, data[key]['id'].toString() ) ? 'imported' : ''; #>
41
+ <div class="ast-image__list-wrap loading" data-id="{{data[key]['id']}}" data-url="{{data[key]['pageURL']}}">
42
+ <div class="ast-image__list-inner-wrap {{imported_class}}">
43
+ <div class="ast-image__list-img-wrap">
44
+ <img src="{{data[key]['webformatURL']}}" alt="{{data[key]['tags']}}" />
45
+ <div class="ast-image__list-img-overlay" data-img-info="{{JSON.stringify( data[key] )}}">
46
+ <span>{{data[key]['tags']}}</span>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <# } #>
52
+ <# if ( 0 === count ) { #>
53
+ <div class="astra-sites-no-sites">
54
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
55
+ </div>
56
+ <# } #>
57
+ </script>
58
+
59
+ <script type="text/template" id="tmpl-ast-image-filters">
60
+ <div class="ast-image__filter-wrap">
61
+ <ul class="ast-image__filter">
62
+ <li class="ast-image__filter-category">
63
+ <select>
64
+ <# for ( key in astraImages.pixabay_category ) { #>
65
+ <option value="{{key}}">{{astraImages.pixabay_category[key]}}</option>
66
+ <# } #>
67
+ </select>
68
+ </li>
69
+ <li class="ast-image__filter-orientation">
70
+ <select>
71
+ <# for ( key in astraImages.pixabay_orientation ) { #>
72
+ <option value="{{key}}">{{astraImages.pixabay_orientation[key]}}</option>
73
+ <# } #>
74
+ </select>
75
+ </li>
76
+ <li class="ast-image__filter-order">
77
+ <select>
78
+ <# for ( key in astraImages.pixabay_order ) { #>
79
+ <option value="{{key}}">{{astraImages.pixabay_order[key]}}</option>
80
+ <# } #>
81
+ </select>
82
+ </li>
83
+ </ul>
84
+ </div>
85
+ </script>
86
+
87
+ <script type="text/template" id="tmpl-ast-image-no-result">
88
+ <div class="astra-sites-no-sites">
89
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
90
+ <p class="description">
91
+ <?php
92
+ /* translators: %1$s External Link */
93
+ printf( esc_html__( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( 'https://wpastra.com/sites-suggestions/?utm_source=demo-import-panel&utm_campaign=astra-sites&utm_medium=suggestions' ) );
94
+ ?>
95
+ </p>
96
+ </div>
97
+ </script>
98
+
99
+ <script type="text/template" id="tmpl-ast-image-single">
100
+ <# var is_imported = _.includes( astraImages.saved_images, data.id.toString() ); #>
101
+ <# var disable_class = ( is_imported ) ? 'disabled': ''; #>
102
+ <# var image_type = data.largeImageURL.substring( data.largeImageURL.lastIndexOf( "." ) + 1 ); #>
103
+ <div class="single-site-wrap">
104
+ <div class="single-site">
105
+ <div class="single-site-preview-wrap">
106
+ <div class="single-site-preview">
107
+ <img class="theme-screenshot" src="{{data.largeImageURL}}">
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </script>
113
+
114
+ <script type="text/template" id="tmpl-ast-image-go-back">
115
+ <span class="ast-image__go-back">
116
+ <i class="icon-chevron-left"></i>
117
+ <span class="ast-image__go-back-text"><?php esc_html_e( 'Back to Images', 'astra-sites' ); ?></span>
118
+ </span>
119
+ </script>
120
+
121
+ <script type="text/template" id="tmpl-ast-image-save">
122
+ <# var is_imported = _.includes( astraImages.saved_images, data.id.toString() ); #>
123
+ <# var disable_class = ( is_imported ) ? 'disabled': ''; #>
124
+ <div class="ast-image__save-wrap">
125
+ <button type="button" class="ast-image__save button media-button button-primary button-large media-button-select {{disable_class}}" data-import-status={{is_imported}}>
126
+ <# if ( is_imported ) { #>
127
+ <?php esc_html_e( 'Already Saved', 'astra-sites' ); ?>
128
+ <# } else { #>
129
+ <?php esc_html_e( 'Save & Insert', 'astra-sites' ); ?>
130
+ <# } #>
131
+ </button>
132
+ </div>
133
+ </script>
134
+
135
+ <?php
inc/includes/templates.php ADDED
@@ -0,0 +1,538 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Shortcode Markup
4
+ *
5
+ * TMPL - Single Demo Preview
6
+ * TMPL - No more demos
7
+ * TMPL - Filters
8
+ * TMPL - List
9
+ *
10
+ * @package Astra Sites
11
+ * @since 1.0.0
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
+ }
17
+
18
+ ?>
19
+
20
+ <script type="text/template" id="tmpl-ast-template-base-skeleton">
21
+ <div class="dialog-widget dialog-lightbox-widget dialog-type-buttons dialog-type-lightbox" id="ast-sites-modal">
22
+ <div class="dialog-widget-content dialog-lightbox-widget-content">
23
+ <div class="astra-sites-content-wrap">
24
+ <div id="ast-sites-floating-notice-wrap-id" class="ast-sites-floating-notice-wrap"><div class="ast-sites-floating-notice"></div></div>
25
+ <?php
26
+ $manual_sync = get_option( 'astra-sites-manual-sync-complete', 'no' );
27
+ if ( 'yes' === $manual_sync ) {
28
+ $batch_status = get_option( 'astra-sites-batch-is-complete', 'no' );
29
+ if ( 'yes' === $batch_status ) {
30
+ ?>
31
+ <div class="ast-sites-floating-notice-wrap refreshed-notice slide-in">
32
+ <div class="ast-sites-floating-notice">
33
+ <div class="astra-sites-sync-library-message success astra-sites-notice notice notice-success is-dismissible">
34
+ <?php Astra_Sites::get_instance()->get_sync_complete_message( true ); ?> <button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss', 'astra-sites' ); ?></span></button>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ <?php
39
+ }
40
+ }
41
+ ?>
42
+ <div class="dialog-message dialog-lightbox-message" data-type="pages">
43
+ <div class="dialog-content dialog-lightbox-content theme-browser"></div>
44
+ <div class="theme-preview"></div>
45
+ </div>
46
+ <div class="dialog-message dialog-lightbox-message-block" data-type="blocks">
47
+ <div class="astra-blocks-category-wrap">
48
+ <div class="astra-blocks-category-inner-wrap">
49
+ <select id="elementor-template-library-filter" class="astra-blocks-category elementor-template-library-filter-select elementor-select2">
50
+ <option value=""><?php esc_html_e( 'All', 'astra-sites' ); ?></option>
51
+ <# for ( key in astraElementorSites.astra_block_categories ) { #>
52
+ <option value="{{astraElementorSites.astra_block_categories[key].id}}">{{astraElementorSites.astra_block_categories[key].name}}</option>
53
+ <# } #>
54
+ </select>
55
+ </div>
56
+ <div class="astra-blocks-filter-inner-wrap">
57
+ <select id="elementor-template-library-filter" class="astra-blocks-filter elementor-template-library-filter-select elementor-select2">
58
+ <option value=""><?php esc_html_e( 'Filter by Color', 'astra-sites' ); ?></option>
59
+ <option value="light"><?php esc_html_e( 'Light', 'astra-sites' ); ?></option>
60
+ <option value="dark"><?php esc_html_e( 'Dark', 'astra-sites' ); ?></option>
61
+ </select>
62
+ </div>
63
+ </div>
64
+ <div class="dialog-content dialog-lightbox-content-block theme-browser"></div>
65
+ <div class="theme-preview-block"></div>
66
+ </div>
67
+ </div>
68
+ <div class="dialog-buttons-wrapper dialog-lightbox-buttons-wrapper"></div>
69
+ </div>
70
+ <div class="dialog-background-lightbox"></div>
71
+ </div>
72
+ </script>
73
+
74
+ <script type="text/template" id="tmpl-ast-template-modal__header-back">
75
+ <div class="dialog-lightbox-back"><span class="dialog-lightbox-back-text"><?php esc_html_e( 'Back to Pages', 'astra-sites' ); ?></span></div>
76
+ </script>
77
+
78
+ <script type="text/template" id="tmpl-ast-template-modal__header">
79
+ <div class="dialog-header dialog-lightbox-header">
80
+ <div class="ast-sites-modal__header">
81
+ <div class="ast-sites-modal__header__logo-area position-left-last">
82
+ <?php
83
+ if ( ! Astra_Sites_White_Label::get_instance()->is_white_labeled() ) {
84
+ ?>
85
+ <div class="ast-sites-modal__header__logo">
86
+ <span class="ast-sites-modal__header__logo__icon-wrapper"></span>
87
+ </div>
88
+ <?php
89
+ } else {
90
+ ?>
91
+ <div class="ast-sites-modal__header__logo">
92
+ <span class="ast-sites-modal__header__logo__text-wrapper"><?php echo Astra_Sites_White_Label::get_instance()->get_white_label_name(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
93
+ </div>
94
+ <?php
95
+ }
96
+ ?>
97
+ <div class="back-to-layout" title="<?php esc_html_e( 'Back to Layout', 'astra-sites' ); ?>" data-step="1"><i class="icon-chevron-left"></i></div>
98
+ </div>
99
+ <div class="ast-sites-modal__header__menu-area astra-sites-step-1-wrap">
100
+ <div class="elementor-template-library-header-menu">
101
+ <div class="search-form">
102
+ <input autocomplete="off" placeholder="<?php esc_html_e( 'Search...', 'astra-sites' ); ?>" type="search" aria-describedby="live-search-desc" id="wp-filter-search-input" class="wp-filter-search">
103
+ <span class="icon-search search-icon"></span>
104
+ <div class="astra-sites-autocomplete-result"></div>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ <div class="elementor-templates-modal__header__menu-area astra-sites-step-1-wrap ast-sites-modal__options">
109
+ <div class="elementor-template-library-header-menu">
110
+ <div class="elementor-template-library-menu-item elementor-active" data-template-source="remote" data-template-type="pages"><span class="icon-file"></span><?php esc_html_e( 'Pages', 'astra-sites' ); ?></div>
111
+ <div class="elementor-template-library-menu-item" data-template-source="remote" data-template-type="blocks"><span class="icon-layers"></span><?php esc_html_e( 'Blocks', 'astra-sites' ); ?></div>
112
+ <div class="astra-sites__sync-wrap">
113
+ <div class="astra-sites-sync-library-button">
114
+ <span class="icon-refresh" aria-hidden="true" title="<?php esc_html_e( 'Sync Library', 'astra-sites' ); ?>"></span>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div class="elementor-templates-modal__header__items-area">
120
+ <div class="ast-sites-modal__header__close ast-sites-modal__header__close--normal ast-sites-modal__header__item">
121
+ <i class="dashicons close dashicons-no-alt" aria-hidden="true" title="<?php esc_html_e( 'Close', 'astra-sites' ); ?>"></i>
122
+ <span class="elementor-screen-only"><?php esc_html_e( 'Close', 'astra-sites' ); ?></span>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </script>
128
+
129
+ <script type="text/template" id="tmpl-astra-sites-list">
130
+
131
+ <#
132
+ var count = 0;
133
+ for ( key in data ) {
134
+ var page_data = data[ key ][ 'pages' ];
135
+ var site_type = data[ key ][ 'astra-sites-type' ] || '';
136
+ if ( 0 == Object.keys( page_data ).length ) {
137
+ continue;
138
+ }
139
+ if ( undefined == site_type ) {
140
+ continue;
141
+ }
142
+ var type_class = ' site-type-' + data[ key ]['astra-sites-type'];
143
+ var site_title = data[ key ]['title'].slice( 0, 25 );
144
+ if ( data[ key ]['title'].length > 25 ) {
145
+ site_title += '...';
146
+ }
147
+ count++;
148
+ #>
149
+ <div class="theme astra-theme site-single publish page-builder-elementor {{type_class}}" data-site-id={{key}} data-template-id="">
150
+ <div class="inner">
151
+ <span class="site-preview" data-href="" data-title={{site_title}}>
152
+ <div class="theme-screenshot one loading" data-step="1" data-src={{data[ key ]['thumbnail-image-url']}} data-featured-src={{data[ key ]['featured-image-url']}}>
153
+ <div class="elementor-template-library-template-preview">
154
+ <i class="eicon-zoom-in" aria-hidden="true"></i>
155
+ </div>
156
+ </div>
157
+ </span>
158
+ <div class="theme-id-container">
159
+ <h3 class="theme-name">{{{site_title}}}</h3>
160
+ </div>
161
+ <# if ( site_type && 'free' !== site_type ) { #>
162
+ <?php /* translators: %s are white label strings. */ ?>
163
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
164
+ <# } #>
165
+ </div>
166
+ </div>
167
+ <#
168
+ }
169
+ #>
170
+ </script>
171
+
172
+ <script type="text/template" id="tmpl-astra-blocks-list">
173
+
174
+ <#
175
+ var count = 0;
176
+ for ( key in data ) {
177
+ var site_title = ( undefined == data[ key ]['category'] || 0 == data[ key ]['category'].length ) ? data[ key ]['title'] : astraElementorSites.astra_block_categories[data[ key ]['category']].name;
178
+ if ( '' !== AstraElementorSitesAdmin.blockCategory ) {
179
+ if ( AstraElementorSitesAdmin.blockCategory != data[ key ]['category'] ) {
180
+ continue;
181
+ }
182
+ }
183
+
184
+ if ( '' !== AstraElementorSitesAdmin.blockColor ) {
185
+ if ( undefined !== data[ key ]['filter'] && AstraElementorSitesAdmin.blockColor != data[ key ]['filter'] ) {
186
+ continue;
187
+ }
188
+ }
189
+ count++;
190
+ #>
191
+ <div class="astra-sites-library-template astra-theme" data-block-id={{key}}>
192
+ <div class="astra-sites-library-template-inner theme-screenshot" data-step="1">
193
+ <div class="elementor-template-library-template-body">
194
+ <img src="{{data[ key ]['featured-image-url']}}">
195
+ <div class="elementor-template-library-template-preview">
196
+ <i class="eicon-zoom-in" aria-hidden="true"></i>
197
+ </div>
198
+ </div>
199
+ <div class="elementor-template-library-template-footer">
200
+ <div class="elementor-template-library-template-name theme-id-container">{{{site_title}}}</div>
201
+ <a class="elementor-template-library-template-action elementor-template-library-template-insert" style="display:none;">
202
+ <i class="eicon-file-download" aria-hidden="true"></i>
203
+ <span class="elementor-button-title">Insert</span>
204
+ </a>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ <#
209
+ }
210
+ if ( count == 0 ) {
211
+ #>
212
+ <div class="astra-sites-no-sites">
213
+ <div class="inner">
214
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
215
+ <div class="content">
216
+ <div class="description">
217
+ <p>
218
+ <?php
219
+ $s_url = Astra_Sites_White_Label::get_option( 'astra-agency', 'licence' );
220
+ /* translators: %1$s External Link */
221
+ printf( __( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( $s_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
222
+ ?>
223
+ </p>
224
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ <#
230
+ }
231
+ #>
232
+ </script>
233
+
234
+ <script type="text/template" id="tmpl-astra-sites-list-search">
235
+
236
+ <#
237
+ var count = 0;
238
+
239
+ for ( ind in data ) {
240
+ var site_type = data[ ind ]['site-pages-type'];
241
+ var type_class = ' site-type-' + site_type;
242
+ var site_id = ( undefined == data.site_id ) ? data[ind].site_id : data.site_id;
243
+ if ( undefined == site_type ) {
244
+ continue;
245
+ }
246
+ if ( 'gutenberg' == data[ind]['site-pages-page-builder'] ) {
247
+ continue;
248
+ }
249
+ var site_title = data[ ind ]['title'].slice( 0, 25 );
250
+ if ( data[ ind ]['title'].length > 25 ) {
251
+ site_title += '...';
252
+ }
253
+ count++;
254
+ #>
255
+ <div class="theme astra-theme site-single publish page-builder-elementor {{type_class}}" data-template-id={{ind}} data-site-id={{site_id}}>
256
+ <div class="inner">
257
+ <span class="site-preview" data-href="" data-title={{site_title}}>
258
+ <div class="theme-screenshot one loading" data-step="2" data-src={{data[ ind ]['thumbnail-image-url']}} data-featured-src={{data[ ind ]['featured-image-url']}}>
259
+ <div class="elementor-template-library-template-preview">
260
+ <i class="eicon-zoom-in" aria-hidden="true"></i>
261
+ </div>
262
+ </div>
263
+ </span>
264
+ <div class="theme-id-container">
265
+ <h3 class="theme-name">{{{site_title}}}</h3>
266
+ </div>
267
+ <# if ( site_type && 'free' !== site_type ) { #>
268
+ <?php /* translators: %s are white label strings. */ ?>
269
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
270
+ <# } #>
271
+ </div>
272
+ </div>
273
+ <#
274
+ }
275
+
276
+ if ( count == 0 ) {
277
+ #>
278
+ <div class="astra-sites-no-sites">
279
+ <div class="inner">
280
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
281
+ <div class="content">
282
+ <div class="description">
283
+ <p>
284
+ <?php
285
+ $s_url = Astra_Sites_White_Label::get_option( 'astra-agency', 'licence' );
286
+ /* translators: %1$s External Link */
287
+ printf( __( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( $s_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
288
+ ?>
289
+ </p>
290
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
291
+ </div>
292
+ </div>
293
+ </div>
294
+ </div>
295
+ <#
296
+ }
297
+ #>
298
+ </script>
299
+
300
+ <script type="text/template" id="tmpl-astra-sites-search">
301
+
302
+ <#
303
+ var count = 0;
304
+
305
+ for ( ind in data ) {
306
+ if ( 'gutenberg' == data[ind]['site-pages-page-builder'] ) {
307
+ continue;
308
+ }
309
+
310
+ var site_id = ( undefined == data.site_id ) ? data[ind].site_id : data.site_id;
311
+ var site_type = data[ ind ]['site-pages-type'];
312
+
313
+ if ( 'site' == data[ind]['type'] ) {
314
+ site_type = data[ ind ]['astra-sites-type'];
315
+ }
316
+
317
+ if ( undefined == site_type ) {
318
+ continue;
319
+ }
320
+
321
+ var parent_name = '';
322
+ if ( undefined != data[ind]['parent-site-name'] ) {
323
+ var parent_name = $( "<textarea/>") .html( data[ind]['parent-site-name'] ).text();
324
+ }
325
+
326
+ var complete_title = parent_name + ' - ' + data[ ind ]['title'];
327
+ var site_title = complete_title.slice( 0, 25 );
328
+ if ( complete_title.length > 25 ) {
329
+ site_title += '...';
330
+ }
331
+
332
+ var tmp = site_title.split(' - ');
333
+ var title1 = site_title;
334
+ var title2 = '';
335
+ if ( undefined !== tmp && undefined !== tmp[1] ) {
336
+ title1 = tmp[0];
337
+ title2 = ' - ' + tmp[1];
338
+ } else {
339
+ title1 = tmp[0];
340
+ title2 = '';
341
+ }
342
+
343
+ var type_class = ' site-type-' + site_type;
344
+ count++;
345
+ #>
346
+ <div class="theme astra-theme site-single publish page-builder-elementor {{type_class}}" data-template-id={{ind}} data-site-id={{site_id}}>
347
+ <div class="inner">
348
+ <span class="site-preview" data-href="" data-title={{title2}}>
349
+ <div class="theme-screenshot one loading" data-type={{data[ind]['type']}} data-step={{data[ind]['step']}} data-show="search" data-src={{data[ ind ]['thumbnail-image-url']}} data-featured-src={{data[ ind ]['featured-image-url']}}></div>
350
+ </span>
351
+ <div class="theme-id-container">
352
+ <h3 class="theme-name"><strong>{{title1}}</strong>{{title2}}</h3>
353
+ </div>
354
+ <# if ( site_type && 'free' !== site_type ) { #>
355
+ <?php /* translators: %1$s External Link */ ?>
356
+ <div class="agency-ribbons" title="<?php printf( esc_attr__( 'This premium template is accessible with %1$s "Agency" Package.', 'astra-sites' ), Astra_Sites_White_Label::get_instance()->get_white_label_name() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php esc_html_e( 'Agency', 'astra-sites' ); ?></div>
357
+ <# } #>
358
+ </div>
359
+ </div>
360
+ <#
361
+ }
362
+
363
+ if ( count == 0 ) {
364
+ #>
365
+ <div class="astra-sites-no-sites">
366
+ <div class="inner">
367
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
368
+ <div class="content">
369
+ <div class="description">
370
+ <p>
371
+ <?php
372
+ $s_url = Astra_Sites_White_Label::get_option( 'astra-agency', 'licence' );
373
+ /* translators: %1$s External Link */
374
+ printf( __( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( $s_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
375
+ ?>
376
+ </p>
377
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
378
+ </div>
379
+ </div>
380
+ </div>
381
+ </div>
382
+ <#
383
+ }
384
+ #>
385
+ </script>
386
+
387
+ <script type="text/template" id="tmpl-astra-sites-insert-button">
388
+ <div id="elementor-template-library-header-preview-insert-wrapper" class="elementor-templates-modal__header__item" data-template-id={{data.template_id}} data-site-id={{data.site_id}}>
389
+ <a class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button">
390
+ <i class="eicon-file-download" aria-hidden="true"></i>
391
+ <span class="elementor-button-title"><?php esc_html_e( 'Insert', 'astra-sites' ); ?></span>
392
+ </a>
393
+
394
+ </div>
395
+ </script>
396
+
397
+ <?php
398
+ /**
399
+ * TMPL - Update Available Plugins
400
+ */
401
+ ?>
402
+ <script type="text/template" id="tmpl-astra-sites-update-available-required-plugins">
403
+ <div class="skip-and-import">
404
+ <div class="heading">
405
+ <h3><?php esc_html_e( 'Update Plugin', 'astra-sites' ); ?></h3>
406
+ <span class="dashicons close dashicons-no-alt"></span>
407
+ </div>
408
+ <div class="astra-sites-import-content">
409
+ <p><?php esc_html_e( 'Updates are available for plugins used in this starter template.', 'astra-sites' ); ?></p>
410
+ <p><?php esc_html_e( 'Kindly update them for a successful import. Skipping this step might break the template design/feature.', 'astra-sites' ); ?></p>
411
+ <ul class="astra-sites-third-party-required-plugins">
412
+ <# for ( key in data ) { #>
413
+ <li class="plugin-card plugin-card-{{data[ key ].slug}}'" data-slug="{{data[ key ].slug }}" data-init="{{data[ key ].init}}" data-name="{{data[ key ].name}}">{{data[ key ].name}}</li>
414
+ <# } #>
415
+ </ul>
416
+ </div>
417
+ <div class="ast-actioms-wrap">
418
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
419
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
420
+ </div>
421
+ </div>
422
+ </script>
423
+
424
+ <?php
425
+ /**
426
+ * TMPL - Third Party Required Plugins
427
+ */
428
+ ?>
429
+ <script type="text/template" id="tmpl-astra-sites-third-party-required-plugins">
430
+ <div class="skip-and-import">
431
+ <div class="heading">
432
+ <h3><?php esc_html_e( 'Required Plugins Missing', 'astra-sites' ); ?></h3>
433
+ <span class="dashicons close dashicons-no-alt"></span>
434
+ </div>
435
+ <div class="astra-sites-import-content">
436
+ <p><?php esc_html_e( 'This starter site requires premium plugins. As these are third party premium plugins, you\'ll need to purchase, install and activate them first.', 'astra-sites' ); ?></p>
437
+ <ul class="astra-sites-third-party-required-plugins">
438
+ <# for ( key in data ) { #>
439
+ <li class="plugin-card plugin-card-{{data[ key ].slug}}'" data-slug="{{data[ key ].slug }}" data-init="{{data[ key ].init}}" data-name="{{data[ key ].name}}"><a href="{{data[ key ].link}}" target="_blank">{{data[ key ].name}}</a></li>
440
+ <# } #>
441
+ </ul>
442
+ </div>
443
+ <div class="ast-actioms-wrap">
444
+ <a href="#" class="button button-hero button-primary astra-sites-skip-and-import-step"><?php esc_html_e( 'Skip & Import', 'astra-sites' ); ?></a>
445
+ <div class="button button-hero site-import-cancel"><?php esc_html_e( 'Cancel', 'astra-sites' ); ?></div>
446
+ </div>
447
+ </div>
448
+ </script>
449
+
450
+ <script type="text/template" id="tmpl-astra-sites-no-sites">
451
+ <div class="astra-sites-no-sites">
452
+ <div class="inner">
453
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'astra-sites' ); ?></h3>
454
+ <div class="content">
455
+ <div class="empty-item">
456
+ <img class="empty-collection-part" src="<?php echo esc_url( ASTRA_SITES_URI . 'inc/assets/images/empty-collection.svg' ); ?>" alt="empty-collection">
457
+ </div>
458
+ <div class="description">
459
+ <p>
460
+ <?php
461
+ $s_url = Astra_Sites_White_Label::get_option( 'astra-agency', 'licence' );
462
+ /* translators: %1$s External Link */
463
+ printf( __( 'Don\'t see a template you would like to import?<br><a target="_blank" href="%1$s">Make a Template Suggestion!</a>', 'astra-sites' ), esc_url( $s_url ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
464
+ ?>
465
+ </p>
466
+ <div class="back-to-layout-button"><span class="button astra-sites-back"><?php esc_html_e( 'Back to Templates', 'astra-sites' ); ?></span></div>
467
+ </div>
468
+ </div>
469
+ </div>
470
+ </div>
471
+ <#
472
+ </script>
473
+
474
+ <script type="text/template" id="tmpl-astra-sites-elementor-preview">
475
+ <#
476
+ let wrap_height = $elscope.find( '.astra-sites-content-wrap' ).height();
477
+ wrap_height = ( wrap_height - 55 );
478
+ wrap_height = wrap_height + 'px';
479
+ #>
480
+ <div id="astra-blocks" class="themes wp-clearfix" data-site-id="{{data.id}}" style="display: block;">
481
+ <div class="single-site-wrap">
482
+ <div class="single-site">
483
+ <div class="single-site-preview-wrap">
484
+ <div class="single-site-preview" style="max-height: {{wrap_height}};">
485
+ <img class="theme-screenshot" data-src="" src="{{data['featured-image-url']}}">
486
+ </div>
487
+ </div>
488
+ </div>
489
+ </div>
490
+ </div>
491
+ </script>
492
+
493
+ <script type="text/template" id="tmpl-astra-sites-elementor-preview-actions">
494
+ <#
495
+ var demo_link = '';
496
+ var action_str = '';
497
+ if ( 'blocks' == AstraElementorSitesAdmin.type ) {
498
+ demo_link = astraElementorSites.astra_blocks[AstraElementorSitesAdmin.block_id]['url'];
499
+ action_str = 'Block';
500
+ } else {
501
+ demo_link = data['astra-page-url'];
502
+ action_str = 'Template';
503
+ }
504
+ #>
505
+ <div class="astra-preview-actions-wrap">
506
+ <div class="astra-preview-actions-inner-wrap">
507
+ <div class="astra-preview-actions">
508
+ <div class="site-action-buttons-wrap">
509
+ <div class="astra-sites-import-template-action site-action-buttons-right">
510
+ <div class="astra-sites-tooltip"><span class="astra-sites-tooltip-icon" data-tip-id="astra-sites-tooltip-plugins-settings"><span class="dashicons dashicons-editor-help"></span></span></div>
511
+ <#
512
+ var is_free = true;
513
+ if ( 'pages' == AstraElementorSitesAdmin.type ) {
514
+ if( 'free' !== data['site-pages-type'] && ! astraElementorSites.license_status ) {
515
+ is_free = false;
516
+ }
517
+ }
518
+ if( ! is_free ) { #>
519
+ <a class="button button-hero button-primary" href="{{astraElementorSites.getProURL}}" target="_blank">{{astraElementorSites.getProText}}<i class="dashicons dashicons-external"></i></a>
520
+ <# } else { #>
521
+ <div type="button" class="button button-hero button-primary ast-library-template-insert disabled"><?php esc_html_e( 'Import ', 'astra-sites' ); ?>{{action_str}}</div>
522
+ <div type="button" class="button button-hero button-primary ast-import-elementor-template disabled"><?php esc_html_e( 'Save ', 'astra-sites' ); ?>{{action_str}}</div>
523
+ <# } #>
524
+ </div>
525
+ </div>
526
+ </div>
527
+ <div class="ast-tooltip-wrap">
528
+ <div>
529
+ <div class="ast-tooltip-inner-wrap" id="astra-sites-tooltip-plugins-settings">
530
+ <ul class="required-plugins-list"><span class="spinner is-active"></span></ul>
531
+ </div>
532
+ </div>
533
+ </div>
534
+ </div>
535
+ </div>
536
+ </script>
537
+
538
+ <?php
inc/includes/white-label.php CHANGED
@@ -26,12 +26,12 @@ if ( ! is_callable( 'Astra_Ext_White_Label_Markup::branding_key_to_constant' ) )
26
  <div class="inside">
27
  <div class="form-wrap">
28
  <div class="form-field">
29
- <label><?php _e( 'Plugin Name:', 'astra-sites' ); ?>
30
  <input type="text" name="ast_white_label[astra-sites][name]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'astra-sites', 'name' ) ), true, true ); ?> value="<?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' ) ); ?>">
31
  </label>
32
  </div>
33
  <div class="form-field">
34
- <label><?php _e( 'Plugin Description:', 'astra-sites' ); ?>
35
  <textarea name="ast_white_label[astra-sites][description]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'astra-sites', 'description' ) ), true, true ); ?> rows="2"><?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'description' ) ); ?></textarea>
36
  </label>
37
  </div>
26
  <div class="inside">
27
  <div class="form-wrap">
28
  <div class="form-field">
29
+ <label><?php esc_html_e( 'Plugin Name:', 'astra-sites' ); ?>
30
  <input type="text" name="ast_white_label[astra-sites][name]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'astra-sites', 'name' ) ), true, true ); ?> value="<?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'name' ) ); ?>">
31
  </label>
32
  </div>
33
  <div class="form-field">
34
+ <label><?php esc_html_e( 'Plugin Description:', 'astra-sites' ); ?>
35
  <textarea name="ast_white_label[astra-sites][description]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'astra-sites', 'description' ) ), true, true ); ?> rows="2"><?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-sites', 'description' ) ); ?></textarea>
36
  </label>
37
  </div>
inc/json/astra-blocks-1.json ADDED
@@ -0,0 +1 @@
 
1
+ {"id-43103":{"title":"Hero 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-8b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-8b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-43099":{"title":"Hero 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-8w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-8w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-43090":{"title":"Hero 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-6b-600x621.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-6b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-43056":{"title":"Testimonial 10B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-10b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-10b-600x679.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-10b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-43022":{"title":"Team 10B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-10b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-10b-600x729.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-10b\/","tag":{"927":"team"},"category":829,"filter":""},"id-43018":{"title":"Team 10W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-10w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-10w-600x729.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-10w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-43013":{"title":"Services 12B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-12b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-12b-600x577.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-12b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-43009":{"title":"Services 12W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-12w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-12w-600x577.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-12w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-43000":{"title":"Services 11B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-11b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-11b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-11b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42974":{"title":"Services 11W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-11w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-11w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-11w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-42960":{"title":"Call To Action 11B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-11b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-11b-600x439.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-11b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-42950":{"title":"About 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-9b-600x668.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-9b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-42885":{"title":"Heading 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-8b-600x348.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-8b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-42884":{"title":"Heading 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-8w-600x348.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-8w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-42869":{"title":"Heading 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-7b-600x387.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-7b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-42862":{"title":"Heading 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-7w-600x387.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-7w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-42848":{"title":"Features 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-8b-600x701.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-8b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-42839":{"title":"Features 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-8w-600x701.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-8w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-42723":{"title":"About 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-8b-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-8b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-42709":{"title":"About 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-8w-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-8w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-42394":{"title":"FAQ 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-8b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-8b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-42393":{"title":"FAQ 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-8w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-8w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-42392":{"title":"FAQ 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-7b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-7b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-42319":{"title":"FAQ 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-7w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-7w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-42310":{"title":"Statistics 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-9b-600x548.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-9b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42307":{"title":"Statistics 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-9w-600x533.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-9w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42304":{"title":"Statistics 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-8b-600x181.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-8b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42298":{"title":"Statistics 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-8w-600x181.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-8w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42295":{"title":"Statistics 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-7b-600x419.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-7b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42292":{"title":"Statistics 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-7w-600x419.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-7w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42280":{"title":"Statistics 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-6b-600x158.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-6b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42259":{"title":"Statistics 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-5d.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-5d-600x463.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-5b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42229":{"title":"Services 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-8b-600x691.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-8b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42251":{"title":"Statistics 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-5w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-5w-600x463.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-5w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42243":{"title":"Statistics 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-6w-600x158.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-6w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42228":{"title":"Services 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-7b-600x736.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-7b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42231":{"title":"Services 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-9b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-9b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42232":{"title":"Services 10B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-10b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-10b-600x563.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-10b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42236":{"title":"Statistics 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-4b-600x274.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-4b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42227":{"title":"Services 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-6b-600x654.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-6b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-42219":{"title":"Statistics 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-4w-600x274.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-4w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42214":{"title":"Statistics 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-3b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-3b-600x349.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-3b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42193":{"title":"Statistics 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-3w-600x349.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-3w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-41939":{"title":"Features 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-7b-600x566.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-7b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-41938":{"title":"Features 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-6b-600x590.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-6b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-41937":{"title":"Features 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-5b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-5b-600x459.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-5b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-42169":{"title":"Statistics 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-2b-600x430.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-2b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42166":{"title":"Statistics 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-2w-600x430.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-2w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-42163":{"title":"Statistics 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-1b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-1b-600x226.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-1b\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"dark"},"id-42160":{"title":"Statistics 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-1w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/statistics-1w-600x226.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/statistics-1w\/","tag":{"924":"statistics","921":"stats"},"category":1096,"filter":"light"},"id-41763":{"title":"Hero 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-7b-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-7b-1-600x732.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-7b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-41764":{"title":"Hero 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-9b-600x570.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-9b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-41621":{"title":"Hero 10B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-10b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-10b-600x695.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-10b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-41080":{"title":"Hero 10W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-10w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-10w-600x695.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-10w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-41061":{"title":"Services 10W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-10w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-10w-600x563.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-10w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-41054":{"title":"Services 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-9w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-9w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-41045":{"title":"Services 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-8w-600x691.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-8w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-41034":{"title":"Team 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-8b-600x502.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-8b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-41033":{"title":"Team 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-9b-600x668.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-9b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-41028":{"title":"Testimonial 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-9b-600x433.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-9b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-41026":{"title":"Testimonial 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-8b-600x657.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-8b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-41023":{"title":"Testimonial 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-7b-600x629.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-7b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-40740":{"title":"Testimonial 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-9w-600x433.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-9w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-40739":{"title":"Testimonial 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-8w-600x657.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-8w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-40348":{"title":"Testimonial 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-7w-600x629.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-7w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-40097":{"title":"Team 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-9w-600x668.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-9w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-40030":{"title":"Team 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-8w-600x502.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-8w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-39936":{"title":"Features 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-7w-600x566.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-7w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-39839":{"title":"FAQ 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-6b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-6b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-39838":{"title":"FAQ 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-5b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-5b-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-5b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-39826":{"title":"Clients 8B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-8b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-8b-600x253.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-8b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-39816":{"title":"Clients 8W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-8w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-8w-600x253.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-8w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-39812":{"title":"Clients 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-7b-600x445.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-7b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-39787":{"title":"Clients 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-7w-600x445.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-7w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-39771":{"title":"Call To Action 9B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-9b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-9b-600x415.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-9b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-39763":{"title":"Call To Action 10B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-10b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-10b-600x495.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-10b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-39761":{"title":"Call To Action 10W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-10w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-10w-600x496.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-10w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-39755":{"title":"Call To Action 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-9w-600x415.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-9w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-38937":{"title":"Services 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-7w-600x736.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-7w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-38930":{"title":"Services 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-6w-600x654.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-6w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-38926":{"title":"FAQ 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-6w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-6w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-38917":{"title":"FAQ 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-5w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-5w-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-5w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-38906":{"title":"Hero 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-9w-600x570.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-9w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-38880":{"title":"Hero 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-7w-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-7w-1-600x732.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-7w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-38876":{"title":"Features 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-6w-600x590.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-6w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-38863":{"title":"Features 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-5w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-5w-600x458.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-5w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-38843":{"title":"Team 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-7b-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-7b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-38833":{"title":"Team 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-7w-600x800.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-7w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-38825":{"title":"Team 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-6b-600x703.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-6b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-38732":{"title":"Team 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-6w-600x703.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-6w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-38536":{"title":"Testimonial 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-5b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-5b-600x553.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-5b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-38471":{"title":"Testimonial 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-5w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-5w-600x553.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-5w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-38316":{"title":"Team 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-5b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-5b-600x561.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-5b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-38244":{"title":"Team 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-5w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-5w-600x561.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-5w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-38225":{"title":"About 7B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-7b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-7b-600x705.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-7b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-38180":{"title":"About 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-6b-600x694.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-6b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-38155":{"title":"About 7W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-7w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-7w-600x705.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-7w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-38147":{"title":"About 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-6w-600x694.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-6w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-38118":{"title":"Hero 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-6w-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-6w-1-600x621.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-6w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-37911":{"title":"Testimonial 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-4B.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-4B-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-4b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"}}
inc/json/astra-blocks-2.json ADDED
@@ -0,0 +1 @@
 
1
+ {"id-37910":{"title":"Testimonial 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-4W.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-4W-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-4w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-37905":{"title":"Testimonial 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-3B.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-3B-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-3b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-37904":{"title":"Testimonial 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-3w-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-3w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-37899":{"title":"Testimonial 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-2w-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-2w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-37898":{"title":"Testimonial 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-2B.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-2B-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-2b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-37889":{"title":"Testimonial 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-1W.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-1W-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-1w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-37890":{"title":"Testimonial 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-1B.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Testimonial-1B-600x450.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-1b\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"dark"},"id-37762":{"title":"Services 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-4b-600x555.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-4b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-37763":{"title":"Services 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-4w-600x555.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-4w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-37755":{"title":"Services 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-3w-600x642.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-3w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-37754":{"title":"Services 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-3b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-3b-2020-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-3b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-37747":{"title":"Services 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-2b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-2b-2020-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-2b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-37748":{"title":"Services 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-2w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-2w-2020-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-2w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-37726":{"title":"Services 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-1w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-1w-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-1w\/","tag":{"953":"services"},"category":952,"filter":"light"},"id-37739":{"title":"Services 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-1b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/services-1b-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/services-1b\/","tag":{"953":"services"},"category":952,"filter":"dark"},"id-37721":{"title":"Features 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-4b-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-4b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-37717":{"title":"Features 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-4w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-4w-2020-600x500.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-4w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-37704":{"title":"Features 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-3w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-3w-2020-600x630.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-3w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-37705":{"title":"Features 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-3b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-3b-2020-600x630.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-3b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-37697":{"title":"Features 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-2b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-2b-2020-600x630.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-2b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-37695":{"title":"Features 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-2w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/features-2w-2020-600x630.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-2w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-37688":{"title":"Features 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/feature-1b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/feature-1b-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-1b\/","tag":{"920":"features"},"category":919,"filter":"dark"},"id-37686":{"title":"Features 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/feature-1w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/feature-1w-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/features-1w\/","tag":{"920":"features"},"category":919,"filter":"light"},"id-37679":{"title":"Heading 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-6b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-6b-2020-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-6b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37678":{"title":"Heading 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-6w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-6w-2020-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-6w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37669":{"title":"Heading 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-5w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-5w-2020-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-5w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37670":{"title":"Heading 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-5b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-5b-2020-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-5b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37662":{"title":"Heading 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-4b-2020-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-4b-2020-1-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-4b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37661":{"title":"Heading 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-4w-600x344.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-4w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37656":{"title":"Heading 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-3b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-3b-2020-600x326.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-3b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37655":{"title":"Heading 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-3w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-3w-2020-600x326.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-3w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37646":{"title":"Heading 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-2w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-2w-2020-600x272.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-2w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37647":{"title":"Heading 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-2b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-2b-2020-600x272.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-2b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37642":{"title":"Heading 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-1b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-1b-2020-600x361.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-1b\/","tag":{"1093":"heading"},"category":1094,"filter":"dark"},"id-37640":{"title":"Heading 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-1w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/heading-1w-2020-600x361.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/heading-1w\/","tag":{"1093":"heading"},"category":1094,"filter":"light"},"id-37557":{"title":"Clients 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-6w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-6w-2020-600x378.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-6w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37558":{"title":"Clients 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-6b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-6b-2020-600x378.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-6b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37549":{"title":"Clients 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-5b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-5b-2020-600x225.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-5b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37550":{"title":"Clients 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-5w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-5w-2020-600x225.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-5w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37542":{"title":"Clients 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-4w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-4w-2020-600x225.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-4w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37544":{"title":"Clients 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-4b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-4b-2020-600x225.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-4b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37537":{"title":"Clients 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-3b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-3b-600x632.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-3b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37535":{"title":"Clients 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-3w-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-3w-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-3w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37530":{"title":"Clients 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-2b-600x329.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-2b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37529":{"title":"Clients 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-2w-600x329.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-2w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37524":{"title":"Clients 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-1b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-1b-600x329.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-1b\/","tag":{"1090":"clients"},"category":1091,"filter":"dark"},"id-37518":{"title":"Clients 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-1w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/clients-1w-600x329.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/clients-1w\/","tag":{"1090":"clients"},"category":1091,"filter":"light"},"id-37203":{"title":"Team 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-4b-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-4b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-37200":{"title":"Team 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-4w-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-4w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-37197":{"title":"Team 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-3b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-3b-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-3b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-37194":{"title":"Team 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-3w-600x491.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-3w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-37190":{"title":"Team 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-2b-600x578.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-2b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-37187":{"title":"Team 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Team-2W.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/Team-2W-600x578.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-2w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-37184":{"title":"Team 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-1b-2020.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-1b-2020-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-1b\/","tag":{"927":"team"},"category":829,"filter":"dark"},"id-37153":{"title":"Team 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-1w-2020-new.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/team-1w-2020-new-600x600.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/team-1w\/","tag":{"927":"team"},"category":829,"filter":"light"},"id-37150":{"title":"Call To Action 6B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-6b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-6b-600x445.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-6b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-37147":{"title":"Call To Action 6W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-6w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-6w-600x445.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-6w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-37136":{"title":"Call To Action 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-4b-600x227.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-4b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-37132":{"title":"Call To Action 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-4w-600x227.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-4w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-37129":{"title":"Call To Action 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-3d.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-3d-600x434.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-3b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-37126":{"title":"Call To Action 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-3w-600x434.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-3w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-37122":{"title":"Call To Action 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-2b-600x434.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-2b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-37120":{"title":"Call To Action 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-2w-600x434.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-2w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-37117":{"title":"Call To Action 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-1b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-1b-600x294.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-1b\/","tag":{"819":"call-to-action"},"category":832,"filter":"dark"},"id-37114":{"title":"Call To Action 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-1w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-1w-600x294.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-1w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-37111":{"title":"FAQ 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-4b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-4b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-37108":{"title":"FAQ 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-4w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-4w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-37105":{"title":"FAQ 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-3b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-3b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-3d\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-37102":{"title":"FAQ 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-3w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-3w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-37099":{"title":"FAQ 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-2b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-2b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-37096":{"title":"FAQ 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-2w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-2w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-37093":{"title":"FAQ 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-1b-2.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-1b-2-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-1b\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"dark"},"id-37061":{"title":"FAQ 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-1w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/faq-1w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/faq-1w\/","tag":{"822":"faq","821":"frequently-asked-questions"},"category":1001,"filter":"light"},"id-37057":{"title":"About 5B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-5b-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-5b-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-5b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-37051":{"title":"About 5W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-5w-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-5w-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-5w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-37043":{"title":"About 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-4b-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-4b-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-4b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-37040":{"title":"About 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-4w-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-4w-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-4w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-37025":{"title":"About 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-3B-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-3B-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-3b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-37022":{"title":"About 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-3W-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-3W-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-3w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-37019":{"title":"About 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-2B-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-2B-1-600x576.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-2b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-37015":{"title":"About 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-2W-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-2W-1-600x576.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-2w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-36983":{"title":"About 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-1B-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-1B-1-600x576.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-1b\/","tag":{"818":"about"},"category":825,"filter":"dark"},"id-36980":{"title":"About 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-1W-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/About-1W-1-600x576.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-1w\/","tag":{"818":"about"},"category":825,"filter":"light"},"id-36964":{"title":"Hero 4B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-4b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-4b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-4b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-36961":{"title":"Hero 4W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-4w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-4w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-4w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-36958":{"title":"Hero 3B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-3b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-3b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-3b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-36953":{"title":"Hero 2B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-2b.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-2b-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-2b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-36942":{"title":"Hero 3W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-3w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-3w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-3w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-36939":{"title":"Hero 2W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-2w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-2w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-2w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-36936":{"title":"Hero 1B","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-1b-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/hero-1b-1-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-1b\/","tag":{"817":"hero"},"category":831,"filter":"dark"},"id-35365":{"title":"Testimonial 10W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-10w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/testimonial-10w-600x679.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/testimonial-10w\/","tag":{"1095":"reviews","844":"testimonial"},"category":830,"filter":"light"},"id-29230":{"title":"Hero 1W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/08\/hero-1w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/08\/hero-1w-600x501.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/hero-1w\/","tag":{"817":"hero"},"category":831,"filter":"light"},"id-28634":{"title":"Call To Action 11W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-11w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/call-to-action-11w-600x439.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/call-to-action-11w\/","tag":{"819":"call-to-action"},"category":832,"filter":"light"},"id-28474":{"title":"About 9W","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-9w.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/about-9w-600x668.jpg","url":"https:\/\/websitedemos.net\/astra-blocks\/about-9w\/","tag":{"818":"about"},"category":825,"filter":"light"}}
inc/json/astra-blocks-3.json ADDED
@@ -0,0 +1 @@
 
1
+ []
inc/json/astra-blocks-categories.json ADDED
@@ -0,0 +1 @@
 
1
+ {"825":{"id":825,"name":"About","slug":"about"},"832":{"id":832,"name":"Call To Action","slug":"call-to-action"},"1091":{"id":1091,"name":"Clients","slug":"clients"},"1001":{"id":1001,"name":"FAQ","slug":"faq"},"919":{"id":919,"name":"Features","slug":"features"},"1094":{"id":1094,"name":"Heading","slug":"heading"},"831":{"id":831,"name":"Hero","slug":"hero"},"952":{"id":952,"name":"Services","slug":"services"},"1096":{"id":1096,"name":"Statistics","slug":"statistics"},"829":{"id":829,"name":"Team","slug":"team"},"830":{"id":830,"name":"Testimonial","slug":"testimonial"}}
inc/json/astra-sites-and-pages-page-1.json ADDED
@@ -0,0 +1 @@
 
1
+ {"id-19808":{"title":"Outdoor Adventure","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-400x950.png","astra-site-url":"\/\/websitedemos.net\/outdoor-adventure-02","astra-site-parent-id":186,"astra-sites-tag":{"544":"adventure","545":"camping","543":"extreme-sports","541":"mountains","542":"park","546":"sports"},"astra-sites-type":"free","astra-site-page-builder":"elementor","astra-site-category":{"27":"business","39":"free"},"pages":{"id-23830":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-02\/wp-json\/wp\/v2\/pages\/4","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-02\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23827":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-about-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-about-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-02\/wp-json\/wp\/v2\/pages\/5","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-02\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23832":{"title":"Services","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-services-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-services-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-02\/wp-json\/wp\/v2\/pages\/6","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-02\/services\/","astra-sites-tag":{"425":"services"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23831":{"title":"Projects","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-projects-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-projects-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-02\/wp-json\/wp\/v2\/pages\/7","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-02\/projects\/","astra-sites-tag":{"424":"project"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23829":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-contact-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23829-outdoor-adventure-contact-resize.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-02\/wp-json\/wp\/v2\/pages\/8","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-02\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-19884":{"title":"Outdoor Adventure","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-400x950.png","astra-site-url":"\/\/websitedemos.net\/outdoor-adventure-01","astra-site-parent-id":184,"astra-sites-tag":{"544":"adventure","545":"camping","543":"extreme-sports","541":"mountains","542":"park","546":"sports"},"astra-sites-type":"free","astra-site-page-builder":"beaver-builder","astra-site-category":{"27":"business","39":"free"},"pages":{"id-23776":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-01\/wp-json\/wp\/v2\/pages\/271","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-01\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23769":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-about-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-about-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-01\/wp-json\/wp\/v2\/pages\/5","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-01\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23781":{"title":"Services","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-services-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-services-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-01\/wp-json\/wp\/v2\/pages\/6","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-01\/services\/","astra-sites-tag":{"425":"services"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23780":{"title":"Projects","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-projects-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-projects-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-01\/wp-json\/wp\/v2\/pages\/7","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-01\/projects\/","astra-sites-tag":{"424":"project"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23772":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-contact-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23772-outdoor-adventure-contact-resize.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-01\/wp-json\/wp\/v2\/pages\/8","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-01\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-19990":{"title":"Outdoor Adventure","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-400x950.png","astra-site-url":"\/\/websitedemos.net\/outdoor-adventure-07","astra-site-parent-id":182,"astra-sites-tag":{"544":"adventure","545":"camping","543":"extreme-sports","541":"mountains","542":"park","546":"sports"},"astra-sites-type":"free","astra-site-page-builder":"gutenberg","astra-site-category":{"27":"business","39":"free"},"pages":{"id-23721":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot.png","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/outdoor-adventure-home-screenshot-600x800.png","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-07\/wp-json\/wp\/v2\/pages\/271","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-07\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23718":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23718-outdoor-adventure-about-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23718-outdoor-adventure-about-resize-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-07\/wp-json\/wp\/v2\/pages\/272","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-07\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23723":{"title":"Services","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23723-outdoor-adventure-services-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23723-outdoor-adventure-services-resize-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-07\/wp-json\/wp\/v2\/pages\/273","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-07\/services\/","astra-sites-tag":{"425":"services"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23722":{"title":"Projects","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23722-outdoor-adventure-projects-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23722-outdoor-adventure-projects-resize-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-07\/wp-json\/wp\/v2\/pages\/7","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-07\/projects\/","astra-sites-tag":{"424":"project"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-23720":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23720-outdoor-adventure-contact-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-23720-outdoor-adventure-contact-resize.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/outdoor-adventure-07\/wp-json\/wp\/v2\/pages\/8","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/outdoor-adventure-07\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-34012":{"title":"Pet Care","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-400x1865.jpg","astra-site-url":"\/\/websitedemos.net\/pet-care-04","astra-site-parent-id":992,"astra-sites-tag":{"1021":"local-business","374":"pet-care","372":"pet-minding","371":"pet-sitting","373":"pet-training"},"astra-sites-type":"agency-mini","astra-site-page-builder":"elementor","astra-site-category":{"27":"business"},"pages":{"id-35747":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-04\/wp-json\/wp\/v2\/pages\/5","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-04\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35745":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-04\/wp-json\/wp\/v2\/pages\/29","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-04\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35749":{"title":"Services","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-services.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-services-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-04\/wp-json\/wp\/v2\/pages\/31","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-04\/services\/","astra-sites-tag":{"425":"services"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35748":{"title":"Reviews","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-reviews.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-reviews-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-04\/wp-json\/wp\/v2\/pages\/33","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-04\/reviews\/","astra-sites-tag":{"432":"review"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35746":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-04\/wp-json\/wp\/v2\/pages\/35","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-04\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}}}},"id-34244":{"title":"Pet Care","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-400x1865.jpg","astra-site-url":"\/\/websitedemos.net\/pet-care-03","astra-site-parent-id":1010,"astra-sites-tag":{"376":"dog-training","375":"dog-walking","374":"pet-care","372":"pet-minding","371":"pet-sitting","373":"pet-training"},"astra-sites-type":"agency-mini","astra-site-page-builder":"beaver-builder","astra-site-category":{"27":"business"},"pages":{"id-35752":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-03\/wp-json\/wp\/v2\/pages\/415","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-03\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35750":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-03\/wp-json\/wp\/v2\/pages\/29","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-03\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35754":{"title":"Services","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-services.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-services-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-03\/wp-json\/wp\/v2\/pages\/31","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-03\/services\/","astra-sites-tag":{"425":"services"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35753":{"title":"Reviews","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-reviews.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-reviews-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-03\/wp-json\/wp\/v2\/pages\/33","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-03\/reviews\/","astra-sites-tag":{"432":"review"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-35751":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/pet-care-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/pet-care-03\/wp-json\/wp\/v2\/pages\/35","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/pet-care-03\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}}}},"id-31992":{"title":"Organic Store","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-400x1168.jpg","astra-site-url":"\/\/websitedemos.net\/organic-shop-02","astra-site-parent-id":910,"astra-sites-tag":{"496":"ecommerce","369":"natural","368":"organic","967":"product-store","733":"shop","966":"woo-commerce"},"astra-sites-type":"free","astra-site-page-builder":"elementor","astra-site-category":{"38":"ecommerce","39":"free"},"pages":{"id-33788":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-02\/wp-json\/wp\/v2\/pages\/95","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/organic-shop-02\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}},"id-31993":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/organic-shop-02-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/organic-shop-02-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-02\/wp-json\/wp\/v2\/pages\/96","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/organic-shop-02\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}},"id-31994":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-22304-organic-store-contact-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-22304-organic-store-contact-resize-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-02\/wp-json\/wp\/v2\/pages\/15","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/organic-shop-02\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}}}},"id-22401":{"title":"Organic Store","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-400x1168.jpg","astra-site-url":"\/\/websitedemos.net\/organic-shop-01","astra-site-parent-id":79,"astra-sites-tag":{"880":"cartflows","369":"natural","368":"organic","886":"organic-shop","370":"organic-store","733":"shop"},"astra-sites-type":"free","astra-site-page-builder":"beaver-builder","astra-site-category":{"38":"ecommerce","39":"free"},"pages":{"id-34078":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-products-store-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-01\/wp-json\/wp\/v2\/pages\/95","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/organic-shop-01\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}},"id-22303":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-shop-01-about-1.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/organic-shop-01-about-1-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-01\/wp-json\/wp\/v2\/pages\/96","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/organic-shop-01\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}},"id-22304":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-22304-organic-store-contact-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/id-22304-organic-store-contact-resize-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/organic-shop-01\/wp-json\/wp\/v2\/pages\/15","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/organic-shop-01\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"64":"ecommerce","61":"free"}}}},"id-21592":{"title":"Custom Printing Pro","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-400x1464.jpg","astra-site-url":"\/\/websitedemos.net\/custom-printing-04","astra-site-parent-id":67,"astra-sites-tag":{"400":"custom-printing","496":"ecommerce","881":"mug-printing","967":"product-store","733":"shop","405":"t-shirt-printing","966":"woo-commerce","1024":"woocommerce"},"astra-sites-type":"agency-mini","astra-site-page-builder":"elementor","astra-site-category":{"27":"business","38":"ecommerce"},"pages":{"id-36096":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-04\/wp-json\/wp\/v2\/pages\/95","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/custom-printing-04\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}},"id-22180":{"title":"About HDX","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-about-hdx.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-about-hdx-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-04\/wp-json\/wp\/v2\/pages\/96","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/custom-printing-04\/about-hdx\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}},"id-22183":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-04\/wp-json\/wp\/v2\/pages\/15","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/custom-printing-04\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}}}},"id-21821":{"title":"Custom Printing","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-400x1464.jpg","astra-site-url":"\/\/websitedemos.net\/custom-printing-03","astra-site-parent-id":318,"astra-sites-tag":{"880":"cartflows","400":"custom-printing","404":"gift-shop","401":"gift-store","403":"online-gifting","402":"printing","733":"shop","405":"t-shirt-printing","966":"woo-commerce"},"astra-sites-type":"agency-mini","astra-site-page-builder":"beaver-builder","astra-site-category":{"27":"business","38":"ecommerce"},"pages":{"id-34081":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-03\/wp-json\/wp\/v2\/pages\/95","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/custom-printing-03\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}},"id-26341":{"title":"About HDX","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-about-hdx.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-about-hdx-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-03\/wp-json\/wp\/v2\/pages\/96","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/custom-printing-03\/about-hdx\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}},"id-26344":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2020\/01\/custom-printing-04-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/custom-printing-03\/wp-json\/wp\/v2\/pages\/15","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/custom-printing-03\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","64":"ecommerce"}}}},"id-22009":{"title":"LearnDash Academy","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22009-learndash-academy-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22009-learndash-academy-resize-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22009-learndash-academy-resize.jpg","astra-site-url":"\/\/websitedemos.net\/learndash-academy-02","astra-site-parent-id":851,"astra-sites-tag":{"462":"courses","469":"ecourse","468":"elearning","467":"learndash","460":"learning","466":"online-courses","975":"online-learning"},"astra-sites-type":"free","astra-site-page-builder":"elementor","astra-site-category":{"27":"business","39":"free"},"pages":{"id-42985":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-02-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-02-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-02\/wp-json\/wp\/v2\/pages\/17","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-02\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-42984":{"title":"All Courses","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-02-all-courses.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-02-all-courses-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-02\/wp-json\/wp\/v2\/pages\/201","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-02\/all-courses\/","astra-sites-tag":{"462":"courses"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31168":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-02\/wp-json\/wp\/v2\/pages\/158","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-02\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31169":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-02\/wp-json\/wp\/v2\/pages\/401","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-02\/contact\/","astra-sites-tag":{"415":"contact","454":"contact-us","377":"get-in-touch"},"site-pages-type":"free","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-22110":{"title":"Learndash Academy","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22110-learndash-academy-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22110-learndash-academy-resize-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22110-learndash-academy-resize.jpg","astra-site-url":"\/\/websitedemos.net\/learndash-academy-01","astra-site-parent-id":885,"astra-sites-tag":{"462":"courses","468":"elearning","467":"learndash","460":"learning","466":"online-courses","975":"online-learning"},"astra-sites-type":"free","astra-site-page-builder":"beaver-builder","astra-site-category":{"27":"business","39":"free"},"pages":{"id-34127":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-01-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-01-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-01\/wp-json\/wp\/v2\/pages\/17","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-01\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-34126":{"title":"All Courses","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-01-all-courses.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-01-all-courses-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-01\/wp-json\/wp\/v2\/pages\/201","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-01\/all-courses\/","astra-sites-tag":{"462":"courses"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31832":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-01\/wp-json\/wp\/v2\/pages\/158","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-01\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31833":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-01\/wp-json\/wp\/v2\/pages\/401","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-01\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-22081":{"title":"LearnDash Academy","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22081-learndash-academy-resize.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22081-learndash-academy-resize-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/06\/id-22081-learndash-academy-resize.jpg","astra-site-url":"\/\/websitedemos.net\/learndash-academy-07","astra-site-parent-id":884,"astra-sites-tag":{"462":"courses","468":"elearning","467":"learndash","460":"learning","466":"online-courses","975":"online-learning"},"astra-sites-type":"free","astra-site-page-builder":"gutenberg","astra-site-category":{"27":"business","39":"free"},"pages":{"id-34133":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-07-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-07-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-07\/wp-json\/wp\/v2\/pages\/17","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-07\/","astra-sites-tag":{"423":"home"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-34132":{"title":"All Courses","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-07-all-courses.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/10\/learndash-academy-07-all-courses-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-07\/wp-json\/wp\/v2\/pages\/201","dynamic-page":"yes","astra-page-url":"\/\/websitedemos.net\/learndash-academy-07\/all-courses\/","astra-sites-tag":{"462":"courses"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31828":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-07\/wp-json\/wp\/v2\/pages\/158","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-07\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}},"id-31829":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/09\/learndash-academy-02-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/learndash-academy-07\/wp-json\/wp\/v2\/pages\/401","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/learndash-academy-07\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"free","site-pages-page-builder":"gutenberg","site-pages-category":[],"site-pages-parent-category":{"60":"business","61":"free"}}}},"id-18882":{"title":"Deeplight Restaurant","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-400x2091.jpg","astra-site-url":"\/\/websitedemos.net\/restaurant-04","astra-site-parent-id":113,"astra-sites-tag":{"562":"bistro","972":"club","560":"cuisine","561":"eatery","336":"food","350":"hotel","559":"outlet","335":"restaurant","970":"restro","971":"restro-bar"},"astra-sites-type":"agency-mini","astra-site-page-builder":"elementor","astra-site-category":{"27":"business"},"pages":{"id-23049":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/34","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23050":{"title":"Menu","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/35","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/menu\/","astra-sites-tag":{"565":"menu"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23045":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/36","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23048":{"title":"Gallery","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-gallery.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-gallery-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/37","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/gallery\/","astra-sites-tag":{"461":"gallery"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23051":{"title":"Testimonials","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-testimonials.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-testimonials-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/38","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/testimonials\/","astra-sites-tag":{"433":"testimonials"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23047":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-04\/wp-json\/wp\/v2\/pages\/39","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-04\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"elementor","site-pages-category":[],"site-pages-parent-category":{"60":"business"}}}},"id-19058":{"title":"Restaurant","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-400x2091.jpg","astra-site-url":"\/\/websitedemos.net\/restaurant-03","astra-site-parent-id":114,"astra-sites-tag":{"562":"bistro","972":"club","560":"cuisine","561":"eatery","336":"food","350":"hotel","559":"outlet","335":"restaurant","970":"restro","971":"restro-bar"},"astra-sites-type":"agency-mini","astra-site-page-builder":"beaver-builder","astra-site-category":{"27":"business"},"pages":{"id-23063":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/34","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23064":{"title":"Menu","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/35","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/menu\/","astra-sites-tag":{"565":"menu"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23059":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/36","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23062":{"title":"Gallery","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-gallery.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-gallery-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/37","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/gallery\/","astra-sites-tag":{"461":"gallery"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23065":{"title":"Testimonials","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-testimonials.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-testimonials-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/38","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/testimonials\/","astra-sites-tag":{"433":"testimonials"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23061":{"title":"Contact","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-contact.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-contact-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-03\/wp-json\/wp\/v2\/pages\/39","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-03\/contact\/","astra-sites-tag":{"415":"contact"},"site-pages-type":"agency-mini","site-pages-page-builder":"beaver-builder","site-pages-category":[],"site-pages-parent-category":{"60":"business"}}}},"id-21081":{"title":"Restaurant","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","fullpage-thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-400x2091.jpg","astra-site-url":"\/\/websitedemos.net\/restaurant-06","astra-site-parent-id":158,"astra-sites-tag":{"562":"bistro","972":"club","560":"cuisine","561":"eatery","336":"food","350":"hotel","559":"outlet","335":"restaurant","970":"restro","971":"restro-bar"},"astra-sites-type":"agency-mini","astra-site-page-builder":"brizy","astra-site-category":{"27":"business"},"pages":{"id-23510":{"title":"Home","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-home-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-06\/wp-json\/wp\/v2\/pages\/143","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-06\/","astra-sites-tag":{"423":"home"},"site-pages-type":"agency-mini","site-pages-page-builder":"brizy","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23511":{"title":"Menu","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-menu-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-06\/wp-json\/wp\/v2\/pages\/190","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-06\/menu\/","astra-sites-tag":{"565":"menu"},"site-pages-type":"agency-mini","site-pages-page-builder":"brizy","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23507":{"title":"About","featured-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about.jpg","thumbnail-image-url":"https:\/\/websitedemos.net\/wp-content\/uploads\/2019\/07\/restaurant-about-600x800.jpg","astra-page-api-url":"https:\/\/websitedemos.net\/restaurant-06\/wp-json\/wp\/v2\/pages\/201","dynamic-page":"no","astra-page-url":"\/\/websitedemos.net\/restaurant-06\/about\/","astra-sites-tag":{"352":"about"},"site-pages-type":"agency-mini","site-pages-page-builder":"brizy","site-pages-category":[],"site-pages-parent-category":{"60":"business"}},"id-23509":{"title":"Gallery","featured-i