Responsive Add Ons - Version 2.5.0

Version Description

  • 15th April 2021 =
  • Feature - Added filters on ready sites grid page to filter the ready sites based on page builder and categories
  • Feature - Search box on the ready sites grid page to search for the ready sites
Download this release

Release Info

Developer keyur5
Plugin Icon 128x128 Responsive Add Ons
Version 2.5.0
Comparing to
See all releases

Code changes from version 2.4.3 to 2.5.0

admin/css/install-responsive-theme.css CHANGED
@@ -18,4 +18,26 @@
18
  #responsive-theme-activation a {
19
  box-shadow: none;
20
  outline: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
18
  #responsive-theme-activation a {
19
  box-shadow: none;
20
  outline: none;
21
+ }
22
+ #responsive-theme-activation {
23
+ border: none;
24
+ padding: 20px;
25
+ }
26
+ #responsive-theme-activation .responsive-addons-message-inner {
27
+ display: flex;
28
+ -webkit-box-align: center;
29
+ align-items: center;
30
+ }
31
+ #responsive-theme-activation .responsive-addons-message-icon {
32
+ font-size: 20px;
33
+ }
34
+ #responsive-theme-activation .responsive-addons-message-content {
35
+ padding: 0 20px;
36
+ }
37
+ #responsive-theme-activation .responsive-addons-message-content .responsive-addons-message-actions {
38
+ margin-top: 10px;
39
+ }
40
+ #responsive-theme-activation .responsive-addons-message-content p{
41
+ padding: 0px;
42
+ margin: 0px;
43
  }
admin/css/responsive-ready-sites-admin.css CHANGED
@@ -233,7 +233,7 @@ responsive-ready-site-import-free.button.installing:before {
233
  border-radius: 5px;
234
  }
235
  #responsive-ready-sites-admin-page .responsive-sites-header {
236
- margin: 20px 20px 40px 20px;
237
  font-size: 26px;
238
  }
239
  .theme-browser .theme.active {
@@ -259,7 +259,7 @@ responsive-ready-site-import-free.button.installing:before {
259
  }
260
 
261
  .responsive-sites-suggestions .inner {
262
- padding: 27% 10% 50% 10%;
263
  text-align: center;
264
  position: absolute;
265
  left: 0;
@@ -283,7 +283,7 @@ responsive-ready-site-import-free.button.installing:before {
283
  text-align: center;
284
  }
285
  .responsive-sites-header .ready-site-list-title {
286
- font-size: 35px;
287
  font-weight: 500;
288
  line-height: 1.2;
289
  padding: 9px 0 4px 0;
@@ -293,10 +293,6 @@ responsive-ready-site-import-free.button.installing:before {
293
  line-height: 1.7;
294
  text-align: center;
295
  }
296
- #responsive-ready-sites-admin-page {
297
- padding: 20px 35px 20px 35px;
298
- background: #ffffff;
299
- }
300
  .responsive-ready-sites-advanced-options-wrap .result_preview {
301
  margin-top: 15%;
302
  }
@@ -305,12 +301,13 @@ responsive-ready-site-import-free.button.installing:before {
305
  }
306
  .demo-type.pro{
307
  position: absolute;
308
- right: 0;
309
- top: 0;
310
  background: #ff793f;
311
  z-index: 1;
312
  color: #ffffff;
313
- padding: 0.5em 1em;
 
314
  text-transform: uppercase;
315
  box-shadow: -2px 2px 5px rgba(0,0,0,0.1);
316
  }
@@ -424,27 +421,8 @@ responsive-ready-site-import-free.button.installing:before {
424
  .spinner-wrap .spinner.is-active{
425
  float:none;
426
  }
427
- #responsive-theme-activation {
428
- border: none;
429
- padding: 20px;
430
- }
431
- #responsive-theme-activation .responsive-addons-message-inner {
432
- display: flex;
433
- -webkit-box-align: center;
434
- align-items: center;
435
- }
436
- #responsive-theme-activation .responsive-addons-message-icon {
437
- font-size: 20px;
438
- }
439
- #responsive-theme-activation .responsive-addons-message-content {
440
- padding: 0 20px;
441
- }
442
- #responsive-theme-activation .responsive-addons-message-content .responsive-addons-message-actions {
443
- margin-top: 10px;
444
- }
445
- #responsive-theme-activation .responsive-addons-message-content p{
446
- padding: 0px;
447
- margin: 0px;
448
  }
449
  .single-site {
450
  display: flex;
@@ -731,3 +709,455 @@ responsive-ready-site-import-free.button.installing:before {
731
  }
732
  }
733
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  border-radius: 5px;
234
  }
235
  #responsive-ready-sites-admin-page .responsive-sites-header {
236
+ margin: 20px 20px 20px 20px;
237
  font-size: 26px;
238
  }
239
  .theme-browser .theme.active {
259
  }
260
 
261
  .responsive-sites-suggestions .inner {
262
+ padding: 20% 10% 20% 10%;
263
  text-align: center;
264
  position: absolute;
265
  left: 0;
283
  text-align: center;
284
  }
285
  .responsive-sites-header .ready-site-list-title {
286
+ font-size: 30px;
287
  font-weight: 500;
288
  line-height: 1.2;
289
  padding: 9px 0 4px 0;
293
  line-height: 1.7;
294
  text-align: center;
295
  }
 
 
 
 
296
  .responsive-ready-sites-advanced-options-wrap .result_preview {
297
  margin-top: 15%;
298
  }
301
  }
302
  .demo-type.pro{
303
  position: absolute;
304
+ right: -10px;
305
+ top: -10px;
306
  background: #ff793f;
307
  z-index: 1;
308
  color: #ffffff;
309
+ padding: 0.2em 0.8em;
310
+ border-radius: 2px;
311
  text-transform: uppercase;
312
  box-shadow: -2px 2px 5px rgba(0,0,0,0.1);
313
  }
421
  .spinner-wrap .spinner.is-active{
422
  float:none;
423
  }
424
+ .hide-me {
425
+ display: none !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  }
427
  .single-site {
428
  display: flex;
709
  }
710
  }
711
 
712
+
713
+ #responsive-sites__category-filter {
714
+ display: inline-block;
715
+ border: 1px solid #DDDDDD;
716
+ border-right: 0;
717
+ border-radius: 6px 0 0 6px;
718
+ }
719
+ #responsive-sites__category-filter .responsive-sites__category-filter-anchor {
720
+ height: 44px;
721
+ position: relative;
722
+ cursor: pointer;
723
+ display: flex;
724
+ padding: 0 12px 0 12px;
725
+ border: 0;
726
+ width: 97px;
727
+ justify-content: space-between;
728
+ align-items: center;
729
+ font-weight: 500;
730
+ border-radius: 6px 0 0 6px;
731
+ background-color: #ffffff;
732
+ }
733
+ #responsive-sites__category-filter .responsive-sites__category-filter-anchor:after {
734
+ position: absolute;
735
+ content: "";
736
+ border-left: 2px solid #555;
737
+ border-top: 2px solid #555;
738
+ padding: 3px;
739
+ right: 14px;
740
+ top: 38%;
741
+ -moz-transform: rotate(-135deg);
742
+ -ms-transform: rotate(-135deg);
743
+ -o-transform: rotate(-135deg);
744
+ -webkit-transform: rotate(-135deg);
745
+ transform: rotate(-135deg);
746
+ }
747
+ #responsive-sites__category-filter .responsive-sites__filter-wrap-checkbox.first-wrap {
748
+ padding-top: 15px;
749
+ margin-top: 15px;
750
+ border-top: 1px solid #eee;
751
+ }
752
+ #responsive-sites__category-filter ul.responsive-sites__category-filter-items {
753
+ display: none;
754
+ margin: 0;
755
+ position: absolute;
756
+ width: 98px;
757
+ top: 40px;
758
+ box-sizing: content-box;
759
+ border: 1px solid #e4e4e4;
760
+ margin-top: 10px;
761
+ min-width: 70px;
762
+ background-color: #fff;
763
+ border-radius: 6px;
764
+ box-shadow: 0 3px 6px rgba(0,0,0,.1);
765
+ padding: 15px;
766
+ -webkit-transform-origin: 50% 0;
767
+ transform-origin: 50% 0;
768
+ -webkit-transition: all .2s ease;
769
+ transition: all .2s ease;
770
+ }
771
+ #responsive-sites__category-filter li.responsive-sites__filter-wrap.category-active:before {
772
+ content: "✓";
773
+ color: #1E8CBE;
774
+ position: absolute;
775
+ left: -15px;
776
+ font-size: 15px;
777
+ }
778
+
779
+ .responsive-sites__category-filter-items label {
780
+ vertical-align: top;
781
+ }
782
+ #responsive-sites__category-filter ul.responsive-sites__category-filter-items li {
783
+ list-style: none;
784
+ margin-bottom: 8px;
785
+ margin-left: 14px;
786
+ cursor: pointer;
787
+ position: relative;
788
+ font-weight: 500;
789
+ }
790
+ #responsive-sites__category-filter ul.responsive-sites__category-filter-items li.responsive-sites__filter-wrap-checkbox {
791
+ margin-left: 0;
792
+ }
793
+ #responsive-sites-filters .wp-filter {
794
+ display: flex;
795
+ justify-content: space-between;
796
+ align-items: center;
797
+ }
798
+
799
+ #responsive-sites-filters .search-form {
800
+ position: relative;
801
+ font-weight: normal;
802
+ border: none;
803
+ margin: 0;
804
+ border-radius: 6px;
805
+ display: flex;
806
+ align-items: center;
807
+ height: 46px;
808
+ float: none;
809
+ }
810
+ #responsive-sites-filters {
811
+ flex: 1;
812
+ }
813
+
814
+ #responsive-sites-filters .wp-filter {
815
+ margin-top: 0;
816
+ justify-content: center;
817
+ box-shadow: none;
818
+ border: none;
819
+ margin-bottom: 0;
820
+ background: transparent;
821
+ padding: 0;
822
+ }
823
+ #responsive-sites-menu-page .nav-tab-wrapper {
824
+ display: flex;
825
+ justify-content: space-between;
826
+ border: none;
827
+ background: #fff;
828
+ padding: 0;
829
+ align-items: center;
830
+ box-shadow: 25px 0 30px rgba(28, 39, 60, 0.09);
831
+ border-bottom: 1px solid #dddddd;
832
+ position: fixed;
833
+ top: 32px;
834
+ right: 0;
835
+ left: 0;
836
+ margin-left: 160px;
837
+ z-index: 88;
838
+ }
839
+ .page-builders {
840
+ margin: 35px 0;
841
+ }
842
+
843
+ .page-builders li {
844
+ cursor: pointer;
845
+ display: inline-block;
846
+ padding: 1.2em;
847
+ }
848
+
849
+ .page-builders [type=radio] {
850
+ position: absolute;
851
+ opacity: 0;
852
+ width: 0;
853
+ height: 0;
854
+ }
855
+
856
+ .page-builders [type=radio] + img.active,
857
+ .page-builders [type=radio] + img:hover {
858
+ transform: translateY(-1px);
859
+ box-shadow: 0 2px 6px rgba(0, 115, 170, 0.18);
860
+ border-color: #0073aa;
861
+ }
862
+
863
+ .page-builders [type=radio] + img {
864
+ cursor: pointer;
865
+ border: 1px solid #dcdcdc;
866
+ border-radius: 4px;
867
+ transition: all linear 0.2s;
868
+ height: 100px;
869
+ padding: 6px;
870
+ }
871
+ .page-builder-icon .page-builders {
872
+ position: absolute;
873
+ top: 100%;
874
+ background: #fff;
875
+ z-index: 10;
876
+ margin: 0;
877
+ border: 1px solid #ddd;
878
+ opacity: 0;
879
+ visibility: hidden;
880
+ box-shadow: 0px 9px 21px 0px rgba(0, 0, 0, 0.2);
881
+ border-bottom-left-radius: 3px;
882
+ border-bottom-right-radius: 3px;
883
+ left: -1px;
884
+ right: 0px;
885
+ }
886
+ .page-builder-icon.active .page-builders {
887
+ opacity: 1;
888
+ visibility: visible;
889
+ }
890
+ .page-builder-icon .page-builders img {
891
+ height: 17px;
892
+ width: 17px;
893
+ border-radius: 50%;
894
+ margin-right: 10px;
895
+ }
896
+
897
+ .page-builder-icon .page-builders li {
898
+ display: flex;
899
+ padding: 10px 15px;
900
+ margin: 0;
901
+ }
902
+
903
+ .page-builder-icon {
904
+ display: inline-block;
905
+ font-size: 12px;
906
+ width: 164px;
907
+ position: relative;
908
+ cursor: pointer;
909
+ }
910
+
911
+ .page-builder-icon img {
912
+ height: auto;
913
+ width: 22px;
914
+ border-radius: 50%;
915
+ margin-right: 8px;
916
+ }
917
+
918
+ .selected-page-builder {
919
+ display: flex;
920
+ justify-content: center;
921
+ align-items: center;
922
+ }
923
+
924
+ .selected-page-builder .dashicons {
925
+ margin-left: 2px;
926
+ }
927
+
928
+ .page-builder-icon .page-builders .active,
929
+ .page-builder-icon .page-builders li:hover {
930
+ background-color: #f7f7f7;
931
+ }
932
+
933
+ .responsive-sites-autocomplete-result {
934
+ position: absolute;
935
+ top: 46px !important;
936
+ left: 0;
937
+ right: 0;
938
+ bottom: 0;
939
+ }
940
+
941
+ .responsive-sites-autocomplete-result .ui-autocomplete {
942
+ text-align: left;
943
+ left: 0 !important;
944
+ right: 0 !important;
945
+ width: calc( 100% - 2px ) !important;
946
+ z-index: 999999;
947
+ top: 0 !important;
948
+ }
949
+
950
+ #responsive-sites-filters .ui-autocomplete li,
951
+ #responsive-sites-filters .ui-autocomplete li:focus,
952
+ #responsive-sites-filters .ui-autocomplete li:hover {
953
+ outline: none;
954
+ }
955
+ #responsive-sites-filters .ui-autocomplete li {
956
+ padding: 3px 20px;
957
+ text-transform: capitalize;
958
+ }
959
+ #responsive-sites-filters .ui-autocomplete li:hover {
960
+ background-color: #eeeeee;
961
+ }
962
+
963
+ #responsive-sites-filters .ui-widget.ui-widget-content {
964
+ border-top-left-radius: 0;
965
+ border-top-right-radius: 0;
966
+ border-bottom-left-radius: 6px;
967
+ border-bottom-right-radius: 6px;
968
+ border: 1px solid rgba(32,33,36,0.18);
969
+ border-top: none;
970
+ overflow: hidden;
971
+ box-shadow: 0 3px 4px 0 rgba(32,33,36,0.18);
972
+ background: transparent;
973
+ padding-top: 10px;
974
+ padding-bottom: 10px;
975
+ background: #fff;
976
+ }
977
+
978
+ #responsive-sites-filters .ui-autocomplete li,
979
+ #responsive-sites-filters .ui-autocomplete li:focus,
980
+ #responsive-sites-filters .ui-autocomplete li:hover {
981
+ outline: none;
982
+ }
983
+ #responsive-sites-filters .ui-autocomplete li {
984
+ padding: 3px 20px;
985
+ text-transform: capitalize;
986
+ }
987
+ #responsive-sites-filters .ui-autocomplete li:hover {
988
+ background-color: #eeeeee;
989
+ }
990
+ .responsive-sites-autocomplete-result {
991
+ position: absolute;
992
+ top: 46px !important;
993
+ left: 0;
994
+ right: 0;
995
+ bottom: 0;
996
+ }
997
+
998
+ .responsive-sites-autocomplete-result .ui-autocomplete {
999
+ text-align: left;
1000
+ left: 0 !important;
1001
+ right: 0 !important;
1002
+ width: calc( 60% - 2px ) !important;
1003
+ z-index: 999999;
1004
+ top: 0 !important;
1005
+ }
1006
+ @media only screen and (min-width: 768px) {
1007
+ .theme-browser .theme {
1008
+ width: 33%;
1009
+ margin: 0 0 1em 0em;
1010
+ box-shadow: none;
1011
+ }
1012
+ }
1013
+ .theme-browser .theme .theme-screenshot:after {
1014
+ //padding-top: 118%;
1015
+ }
1016
+ .theme-browser .theme {
1017
+ border: none;
1018
+ }
1019
+ #wp-filter-search-input {
1020
+ font-weight: 400;
1021
+ width: 100%;
1022
+ opacity: 1;
1023
+ height: 46px;
1024
+ background: #fff;
1025
+ line-height: 32px;
1026
+ border-radius: 0 6px 6px 0;
1027
+ font-size: 13px;
1028
+ padding: 5px 20px;
1029
+ border: 1px solid #DDDDDD;
1030
+ border-left: 1px solid #DDDDDD;
1031
+ box-shadow: none;
1032
+ }
1033
+ @media only screen and (min-width: 1200px) {
1034
+ #responsive-sites-filters .search-form {
1035
+ width: 600px;
1036
+ margin: 0 auto;
1037
+ }
1038
+ }
1039
+ .responsive-sites-logo-wrap {
1040
+ width: 42px;
1041
+ height: 42px;
1042
+ }
1043
+ #responsive-sites-menu-page .nav-tab-wrapper .logo,
1044
+ #responsive-sites-menu-page .form {
1045
+ display: flex;
1046
+ align-items: center;
1047
+ }
1048
+ #responsive-sites-menu-page .nav-tab-wrapper .logo {
1049
+ border-right: 1px solid #dddddd;
1050
+ padding: 13px 20px 14px 20px;
1051
+ }
1052
+ #responsive-sites-menu-page .page-builder-icon .selected-page-builder {
1053
+ height: 42px;
1054
+ position: relative;
1055
+ cursor: pointer;
1056
+ display: flex;
1057
+ padding: 0 12px 0 12px;
1058
+ border: 1px solid #DDDDDD;
1059
+ width: 96px;
1060
+ justify-content: space-between;
1061
+ align-items: center;
1062
+ font-weight: 500;
1063
+ border-radius: 6px;
1064
+ background-color: #ffffff;
1065
+ }
1066
+ .page-builder-icon {
1067
+ display: inline-block;
1068
+ border-right: 0;
1069
+ }
1070
+
1071
+ @media only screen and (min-width: 768px) {
1072
+ .theme-browser .theme {
1073
+ width: 33%;
1074
+ padding: 1%;
1075
+ margin: 0 0 1em 0em;
1076
+ box-shadow: none;
1077
+ }
1078
+ }
1079
+
1080
+ @media only screen and (min-width: 1640px) {
1081
+ .theme-browser .theme:nth-child(3n) {
1082
+ margin-right: 0;
1083
+ }
1084
+ .theme-browser .theme:nth-child(4n) {
1085
+ margin-right: 0;
1086
+ }
1087
+ }
1088
+ @media screen and (max-width: 480px) {
1089
+ #responsive-sites-menu-page .nav-tab-wrapper {
1090
+ position: relative;
1091
+ top: 0;
1092
+ left: 0;
1093
+ }
1094
+ }
1095
+ @media screen and (max-width: 782px) {
1096
+ #responsive-sites-menu-page .nav-tab-wrapper {
1097
+ margin: 0;
1098
+ top: 0;
1099
+ }
1100
+ }
1101
+ @media screen and (max-width: 480px) {
1102
+ .hide-on-mobile {
1103
+ display: none;
1104
+ }
1105
+ }
1106
+ @media screen and (min-width: 481px) {
1107
+ .hide-on-desktop {
1108
+ display: none;
1109
+ }
1110
+ .responsive-sites__category-filter-items {
1111
+ z-index: 99;
1112
+ }
1113
+ }
1114
+ @media screen and (max-width: 480px) {
1115
+ #responsive-sites-filters.hide-on-desktop {
1116
+ box-shadow: 25px 0 30px rgba(28, 39, 60, 0.09);
1117
+ border-bottom: 1px solid #dddddd;
1118
+ background: #fff;
1119
+ padding: 10px;
1120
+ }
1121
+ }
1122
+ #responsive-sites-filters .section-left {
1123
+ flex: 1;
1124
+ }
1125
+ #responsive-sites .ra-site-single .inner {
1126
+ position: relative;
1127
+ border-radius: 2px;
1128
+ overflow: initial;
1129
+ border: 1px solid #ddd;
1130
+ transition: all 0.4s;
1131
+ }
1132
+ .responsive-sites-autocomplete-result .ui-autocomplete {
1133
+ text-align: left;
1134
+ left: 0 !important;
1135
+ right: 0 !important;
1136
+ width: calc( 100% - 2px ) !important;
1137
+ z-index: 999999;
1138
+ top: 0 !important;
1139
+ }
1140
+ .sync-ready-sites-templates-wrap a {
1141
+ display: inline-block;
1142
+ margin: 0 10px;
1143
+ padding: 15px 0;
1144
+ border-bottom: 4px solid #fff;
1145
+ color: #646970;
1146
+ cursor: pointer;
1147
+ box-shadow: none;
1148
+ }
1149
+ .sync-ready-sites-templates-wrap .dashicons {
1150
+ text-decoration: none;
1151
+ font-size: 25px;
1152
+ width: 40px;
1153
+ height: 20px;
1154
+ }
1155
+ .responsive-ready-sites-sync-templates-button.updating-message {
1156
+ animation: rotation 2s infinite linear;
1157
+ }
1158
+ .responsive_page_responsive-add-ons .responsive-ready-sites-notice{
1159
+ display: block;
1160
+ }
1161
+ .responsive_page_responsive-add-ons #wpbody-content {
1162
+ padding-top: 80px;
1163
+ }
admin/js/render-responsive-ready-sites.js CHANGED
@@ -27,7 +27,6 @@
27
  {
28
  this._bind();
29
  this._setActiveSite();
30
- this._loadFirstGrid();
31
  },
32
 
33
  /**
27
  {
28
  this._bind();
29
  this._setActiveSite();
 
30
  },
31
 
32
  /**
admin/js/responsive-ready-sites-admin.js CHANGED
@@ -147,6 +147,7 @@ var ResponsiveSitesAjaxQueue = (function() {
147
  * Responsive Sites Admin
148
  *
149
  * - init()
 
150
  * - _bind()
151
  * - _resetPagedCount()
152
  * - _doNothing()
@@ -197,6 +198,7 @@ var ResponsiveSitesAjaxQueue = (function() {
197
  * - _import_wpform()
198
  * - _importPage()
199
  * - ucwords()
 
200
  */
201
  ResponsiveSitesAdmin = {
202
 
@@ -216,6 +218,9 @@ var ResponsiveSitesAjaxQueue = (function() {
216
  widgets_data: '',
217
  site_options_data: '',
218
 
 
 
 
219
  templateData: {},
220
 
221
  site_customizer_data: '',
@@ -231,17 +236,64 @@ var ResponsiveSitesAjaxQueue = (function() {
231
  processing_single_template: false,
232
  pro_plugins_flag: false,
233
 
 
 
234
  init: function()
235
  {
 
236
  this._resetPagedCount();
237
  this._bind();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  },
239
 
 
240
  /**
241
  * Binds events for the Responsive Ready Sites.
242
  */
243
  _bind: function()
244
  {
 
 
 
 
 
 
 
 
 
 
 
245
  // Site Import events.
246
  $( document ).on( 'click' , '.import-demo-data, .responsive-ready-site-import-free', ResponsiveSitesAdmin._importDemo );
247
  $( document ).on( 'click' , '.theme-browser .inactive.ra-site-single .theme-screenshot, .theme-browser .inactive.ra-site-single .more-details, .theme-browser .inactive.ra-site-single .install-theme-preview', ResponsiveSitesAdmin._preview );
@@ -278,6 +330,15 @@ var ResponsiveSitesAjaxQueue = (function() {
278
  // Wordpress Plugin install events.
279
  $( document ).on( 'wp-plugin-installing' , ResponsiveSitesAdmin._pluginInstalling );
280
  $( document ).on( 'wp-plugin-install-success' , ResponsiveSitesAdmin._pluginInstallSuccess );
 
 
 
 
 
 
 
 
 
281
  },
282
 
283
  /**
@@ -1830,6 +1891,513 @@ var ResponsiveSitesAjaxQueue = (function() {
1830
  return str;
1831
  },
1832
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1833
  };
1834
 
1835
  /**
147
  * Responsive Sites Admin
148
  *
149
  * - init()
150
+ * - _show_default_page_builder_sites()
151
  * - _bind()
152
  * - _resetPagedCount()
153
  * - _doNothing()
198
  * - _import_wpform()
199
  * - _importPage()
200
  * - ucwords()
201
+ * - _sync_templates_library_with_ajax()
202
  */
203
  ResponsiveSitesAdmin = {
204
 
218
  widgets_data: '',
219
  site_options_data: '',
220
 
221
+ filter_array: [],
222
+ autocompleteTags: [],
223
+
224
  templateData: {},
225
 
226
  site_customizer_data: '',
236
  processing_single_template: false,
237
  pro_plugins_flag: false,
238
 
239
+ mouseLocation : false,
240
+
241
  init: function()
242
  {
243
+ this._show_default_page_builder_sites();
244
  this._resetPagedCount();
245
  this._bind();
246
+ this._addAutocomplete();
247
+ this._autocomplete();
248
+ },
249
+
250
+ _show_default_page_builder_sites: function() {
251
+
252
+ if( Object.keys( responsiveSitesAdmin.default_page_builder_sites ).length ) {
253
+
254
+ var template = wp.template( 'responsive-sites-list' );
255
+
256
+ var data = responsiveSitesAdmin.default_page_builder_sites;
257
+
258
+ data = ResponsiveSitesAdmin._filter_sites_by_page_builder(data);
259
+
260
+ ResponsiveSitesAdmin.add_sites( data );
261
+
262
+ } else {
263
+
264
+ var temp = [];
265
+ for (var i = 0; i < 8; i++) {
266
+ temp['id-' + i] = {
267
+ 'title' : 'Lorem Ipsum',
268
+ 'class' : 'placeholder-site',
269
+ 'slug' : 'placeholder-site'
270
+ };
271
+ }
272
+
273
+ ResponsiveSitesAdmin.add_sites(temp);
274
+ $('#respnonsive-sites').addClass('temp');
275
+
276
+ ResponsiveSitesAdmin._sync_templates_library_with_ajax( true );
277
+ }
278
  },
279
 
280
+
281
  /**
282
  * Binds events for the Responsive Ready Sites.
283
  */
284
  _bind: function()
285
  {
286
+
287
+ $( '.responsive-sites__category-filter-anchor, .responsive-sites__category-filter-items' ).hover(function(){
288
+ ResponsiveSitesAdmin.mouseLocation = true;
289
+ }, function(){
290
+ ResponsiveSitesAdmin.mouseLocation = false;
291
+ });
292
+
293
+ $( "body" ).mouseup(function(){
294
+ if( ! ResponsiveSitesAdmin.mouseLocation ) ResponsiveSitesAdmin._closeFilter();
295
+ });
296
+
297
  // Site Import events.
298
  $( document ).on( 'click' , '.import-demo-data, .responsive-ready-site-import-free', ResponsiveSitesAdmin._importDemo );
299
  $( document ).on( 'click' , '.theme-browser .inactive.ra-site-single .theme-screenshot, .theme-browser .inactive.ra-site-single .more-details, .theme-browser .inactive.ra-site-single .install-theme-preview', ResponsiveSitesAdmin._preview );
330
  // Wordpress Plugin install events.
331
  $( document ).on( 'wp-plugin-installing' , ResponsiveSitesAdmin._pluginInstalling );
332
  $( document ).on( 'wp-plugin-install-success' , ResponsiveSitesAdmin._pluginInstallSuccess );
333
+
334
+ //Improved layout
335
+ $( document ).on( 'click', '.responsive-sites__category-filter-anchor', ResponsiveSitesAdmin._toggleFilter );
336
+ $( document ).on('click', '.page-builder-icon', ResponsiveSitesAdmin._toggle_page_builder_list );
337
+ $( document ).on( 'click', '.responsive-sites__filter-wrap-checkbox, .responsive-sites__filter-wrap', ResponsiveSitesAdmin._filterClick );
338
+ $( document ).on('keyup input' , '#wp-filter-search-input', ResponsiveSitesAdmin._search );
339
+ $( document ).on( 'click' , '.nav-tab-wrapper .page-builders li', ResponsiveSitesAdmin._change_page_builder );
340
+ $( document ).on('click' , '.ui-autocomplete .ui-menu-item', ResponsiveSitesAdmin._show_search_term );
341
+ $( document ).on('click', '.responsive-ready-sites-sync-templates-button', ResponsiveSitesAdmin._sync_library);
342
  },
343
 
344
  /**
1891
  return str;
1892
  },
1893
 
1894
+ _sync_templates_library_with_ajax: function( is_append ) {
1895
+
1896
+ $.ajax({
1897
+ url: responsiveSitesAdmin.ajaxurl,
1898
+ type: 'POST',
1899
+ data: {
1900
+ action: 'responsive-sites-get-sites-request-count',
1901
+ },
1902
+ })
1903
+ .fail(function (jqXHR) {
1904
+ console.log('The api request to fetch the sites request count fails');
1905
+ })
1906
+ .done(function (response) {
1907
+
1908
+ var total = response.data;
1909
+
1910
+ for( let i = 1; i <= total; i++ ) {
1911
+
1912
+ ResponsiveSitesAjaxQueue.add({
1913
+ url: responsiveSitesAdmin.ajaxurl,
1914
+ type: 'POST',
1915
+ data: {
1916
+ action : 'responsive-ready-sites-import-sites',
1917
+ page_no : i,
1918
+ },
1919
+ success: function( result ){
1920
+ if( is_append ) {
1921
+ if( ! ResponsiveSitesAdmin.isEmpty( result.data ) ) {
1922
+
1923
+ var template = wp.template( 'responsive-sites-list' );
1924
+
1925
+ var data = ResponsiveSitesAdmin._filter_sites_by_page_builder(result.data);
1926
+
1927
+ // First fill the placeholders and then append remaining sites.
1928
+ if ($('.placeholder-site').length) {
1929
+ for (site_id in result.data) {
1930
+ if ($('.placeholder-site').length) {
1931
+ $('.placeholder-site').first().remove();
1932
+ }
1933
+ }
1934
+ if ($('#responsive-sites .site-single:not(.placeholder-site)').length) {
1935
+ $('#responsive-sites .site-single:not(.placeholder-site)').last().after(template(data));
1936
+ } else {
1937
+ $('#responsive-sites').prepend(template(data));
1938
+ }
1939
+ } else {
1940
+ $('#responsive-sites').append(template(data));
1941
+ }
1942
+
1943
+ responsiveSitesAdmin.default_page_builder_sites = $.extend({}, responsiveSitesAdmin.default_page_builder_sites, result.data);
1944
+ }
1945
+
1946
+ }
1947
+
1948
+ if (i === total && responsiveSitesAdmin.strings.syncCompleteMessage) {
1949
+ $('#wpbody-content').find('.responsive-sites-sync-templates-library-message').remove();
1950
+ var noticeContent = wp.updates.adminNotice({
1951
+ className: 'notice responsive-ready-sites-notice notice-success is-dismissible responsive-ready-sites-sync-templates-library-message',
1952
+ message: responsiveSitesAdmin.strings.syncCompleteMessage + ' <button type="button" class="notice-dismiss"><span class="screen-reader-text">' + responsiveSitesAdmin.dismiss + '</span></button>',
1953
+ });
1954
+ $('#screen-meta').after(noticeContent);
1955
+
1956
+ $('.responsive-ready-sites-sync-templates-button').removeClass('updating-message');
1957
+ }
1958
+ }
1959
+ });
1960
+ }
1961
+ // Run the AJAX queue.
1962
+ ResponsiveSitesAjaxQueue.run();
1963
+ });
1964
+ ResponsiveSitesAdmin._sync_templates_library_complete();
1965
+ },
1966
+
1967
+ _sync_templates_library_complete: function () {
1968
+ $.ajax({
1969
+ url: responsiveSitesAdmin.ajaxurl,
1970
+ type: 'POST',
1971
+ data: {
1972
+ action: 'responsive-ready-sites-update-templates-library-complete',
1973
+ },
1974
+ }).done(function (response) {
1975
+ console.log("Ready Sites data Updated");
1976
+ });
1977
+ },
1978
+
1979
+ _sync_library: function (event) {
1980
+ event.preventDefault();
1981
+ var button = $(this);
1982
+
1983
+ if (button.hasClass('updating-message')) {
1984
+ return;
1985
+ }
1986
+
1987
+ button.addClass('updating-message');
1988
+
1989
+ $('.responsive-ready-sites-sync-templates-library-message').remove();
1990
+
1991
+ var noticeContent = wp.updates.adminNotice({
1992
+ className: 'responsive-ready-sites-sync-templates-library-message responsive-ready-sites-notice notice notice-info',
1993
+ message: responsiveSitesAdmin.syncTemplatesLibraryStart + '<button type="button" class="notice-dismiss"><span class="screen-reader-text">' + responsiveSitesAdmin.dismiss + '</span></button>',
1994
+ });
1995
+
1996
+ $('#screen-meta').after(noticeContent);
1997
+
1998
+ $(document).trigger('wp-updates-notice-added');
1999
+
2000
+ $.ajax({
2001
+ url: responsiveSitesAdmin.ajaxurl,
2002
+ type: 'POST',
2003
+ data: {
2004
+ action: 'responsive-ready-sites-update-templates-library',
2005
+ },
2006
+ })
2007
+ .done(function (response) {
2008
+ if (response.success) {
2009
+ if ('updated' === response.data) {
2010
+
2011
+ $('#wpbody-content').find('.responsive-ready-sites-sync-templates-library-message').remove();
2012
+ var noticeContent = wp.updates.adminNotice({
2013
+ className: 'notice responsive-ready-sites-notice notice-success is-dismissible responsive-ready-sites-sync-templates-library-message',
2014
+ message: responsiveSitesAdmin.strings.syncCompleteMessage + ' <button type="button" class="notice-dismiss"><span class="screen-reader-text">' + responsiveSitesAdmin.dismiss + '</span></button>',
2015
+ });
2016
+ $('#screen-meta').after(noticeContent);
2017
+ button.removeClass('updating-message');
2018
+ } else {
2019
+ ResponsiveSitesAdmin._sync_templates_library_with_ajax();
2020
+ }
2021
+ } else {
2022
+ $('#wpbody-content').find('.responsive-ready-sites-sync-templates-library-message').remove();
2023
+ var noticeContent = wp.updates.adminNotice({
2024
+ className: 'notice responsive-ready-sites-notice notice-error is-dismissible responsive-ready-sites-sync-templates-library-message',
2025
+ message: response.data + ' <button type="button" class="notice-dismiss"><span class="screen-reader-text">' + responsiveSitesAdmin.dismiss + '</span></button>',
2026
+ });
2027
+ $('#screen-meta').after(noticeContent);
2028
+ button.removeClass('updating-message');
2029
+ }
2030
+ });
2031
+ },
2032
+
2033
+ _toggleFilter: function( e ) {
2034
+
2035
+ var items = $( '.responsive-sites__category-filter-items' );
2036
+
2037
+ if ( items.hasClass( 'visible' ) ) {
2038
+ items.removeClass( 'visible' );
2039
+ items.hide();
2040
+ } else {
2041
+ items.addClass( 'visible' );
2042
+ items.show();
2043
+ }
2044
+ },
2045
+
2046
+ _toggle_page_builder_list: function( event ) {
2047
+ event.preventDefault();
2048
+ $(this).toggleClass( 'active' );
2049
+ $('body').toggleClass( 'showing-page-builders' );
2050
+ },
2051
+
2052
+
2053
+ _closeFilter: function( e ) {
2054
+
2055
+ var items = $( '.responsive-sites__category-filter-items' );
2056
+ items.removeClass( 'visible' );
2057
+ items.hide();
2058
+ },
2059
+
2060
+ _filterClick: function( e ) {
2061
+
2062
+ ResponsiveSitesAdmin.filter_array = [];
2063
+
2064
+ if ( $( this ).hasClass( 'responsive-sites__filter-wrap' ) ) {
2065
+ $( '.responsive-sites__category-filter-anchor' ).attr( 'data-slug', $( this ).data( 'slug' ) );
2066
+ $( '.responsive-sites__category-filter-items' ).find( '.responsive-sites__filter-wrap' ).removeClass( 'category-active' );
2067
+ $( this ).addClass( 'category-active' );
2068
+ $( '.responsive-sites__category-filter-anchor' ).text( $( this ).text() );
2069
+ $( '.responsive-sites__category-filter-anchor' ).trigger( 'click' );
2070
+ $( '#wp-filter-search-input' ).val( '' );
2071
+ }
2072
+
2073
+ var $filter_name = $( '.responsive-sites__category-filter-anchor' ).attr( 'data-slug' );
2074
+
2075
+ if ( '' != $filter_name ) {
2076
+ ResponsiveSitesAdmin.filter_array.push( $filter_name );
2077
+ }
2078
+
2079
+ if( $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).length ) {
2080
+ $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]' ).removeClass('active');
2081
+ $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).addClass('active');
2082
+ }
2083
+ var $filter_type = $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).val();
2084
+
2085
+ if ( '' != $filter_type ) {
2086
+ ResponsiveSitesAdmin.filter_array.push( $filter_type );
2087
+ }
2088
+
2089
+ ResponsiveSitesAdmin._closeFilter();
2090
+
2091
+ $( '#wp-filter-search-input' ).trigger( 'keyup' );
2092
+ },
2093
+
2094
+ _search: function(event) {
2095
+
2096
+ var search_input = $( this ),
2097
+ search_term = $.trim( search_input.val() ) || '';
2098
+
2099
+ if( 13 === event.keyCode ) {
2100
+ $('.responsive-sites-autocomplete-result .ui-autocomplete').hide();
2101
+ $('.search-form').removeClass('searching');
2102
+ $('#responsive-sites-admin').removeClass('searching');
2103
+ }
2104
+
2105
+ $('body').removeClass('responsive-sites-no-search-result');
2106
+
2107
+ var searchTemplateFlag = false,
2108
+ items = [];
2109
+
2110
+ if( search_term.length ) {
2111
+ search_input.addClass('has-input');
2112
+ $('#responsive-sites-admin').addClass('searching');
2113
+ searchTemplateFlag = true;
2114
+ } else {
2115
+ search_input.removeClass('has-input');
2116
+ $('#responsive-sites-admin').removeClass('searching');
2117
+ }
2118
+
2119
+ items = ResponsiveSitesAdmin._get_sites_and_pages_by_search_term( search_term );
2120
+
2121
+ if( ! ResponsiveSitesAdmin.isEmpty( items ) ) {
2122
+ if ( searchTemplateFlag ) {
2123
+ ResponsiveSitesAdmin.add_sites_after_search( items );
2124
+ } else {
2125
+ ResponsiveSitesAdmin.add_sites( items );
2126
+ }
2127
+ } else {
2128
+ if( search_term.length ) {
2129
+ $('body').addClass('responsive-sites-no-search-result');
2130
+ }
2131
+ $('#responsive-sites').html( wp.template('responsive-sites-suggestions') );
2132
+ }
2133
+ },
2134
+
2135
+ _get_sites_and_pages_by_search_term: function( search_term ) {
2136
+
2137
+ var items = [],
2138
+ tags_strings = [];
2139
+ search_term = search_term.toLowerCase();
2140
+
2141
+ var $page_builder = $('.page-builders .active').attr('data-page-builder') || 'elementor';
2142
+
2143
+ if ( search_term == '' && ResponsiveSitesAdmin.filter_array.length == 0 && $page_builder == 'all' ) {
2144
+ return responsiveSitesAdmin.default_page_builder_sites;
2145
+ }
2146
+
2147
+ var $filter_type = $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).val();
2148
+ var $filter_name = $( '.responsive-sites__category-filter-anchor' ).attr( 'data-slug' );
2149
+
2150
+ for( site_id in responsiveSitesAdmin.default_page_builder_sites ) {
2151
+
2152
+ var current_site = responsiveSitesAdmin.default_page_builder_sites[site_id];
2153
+ var text_match = true;
2154
+ var free_match = true;
2155
+ var category_match = true;
2156
+ var page_builder_match = false;
2157
+ var match_id = '';
2158
+
2159
+ if ( '' != search_term ) {
2160
+ text_match = false;
2161
+ }
2162
+
2163
+ if ( '' != $filter_name ) {
2164
+ category_match = false;
2165
+ }
2166
+
2167
+ if ( '' != $filter_type ) {
2168
+ free_match = false;
2169
+ }
2170
+
2171
+ if( '' != $page_builder) {
2172
+ page_builder_match = false;
2173
+ }
2174
+
2175
+ // Check in site title.
2176
+ if( current_site['title'] ) {
2177
+ var site_title = ResponsiveSitesAdmin._unescape_lower( current_site['title']['rendered'] );
2178
+
2179
+ if( site_title.toLowerCase().includes( search_term ) ) {
2180
+ text_match = true;
2181
+ match_id = site_id;
2182
+ }
2183
+ }
2184
+
2185
+ // Check in site tags.
2186
+ if ( null !== current_site['sites_tags'] && Object.keys(current_site['sites_tags']).length) {
2187
+ for( tag_id in current_site['sites_tags'] ) {
2188
+ var tag_title = current_site['sites_tags'][tag_id];
2189
+ tag_title = ResponsiveSitesAdmin._unescape_lower(tag_title.replace('-', ' '));
2190
+ if (tag_title.toLowerCase().includes(search_term)) {
2191
+ text_match = true;
2192
+ match_id = site_id;
2193
+ }
2194
+ }
2195
+ }
2196
+
2197
+ for( filter_id in ResponsiveSitesAdmin.filter_array ) {
2198
+ var slug = ResponsiveSitesAdmin.filter_array[filter_id];
2199
+ if( slug == 'free' && 'free' == current_site['demo_type'] ) {
2200
+ free_match = true;
2201
+ match_id = site_id;
2202
+ }
2203
+ if( slug == 'premium' && 'free' != current_site['demo_type'] ) {
2204
+ free_match = true;
2205
+ match_id = site_id;
2206
+ }
2207
+ if ( slug != 'free' && slug != 'premium' && undefined != slug ) {
2208
+ for( cat_id in current_site['sites_category'] ) {
2209
+ if( slug.toLowerCase() == current_site['sites_category'][cat_id] ) {
2210
+ category_match = true;
2211
+ match_id = site_id;
2212
+ }
2213
+ }
2214
+ }
2215
+ }
2216
+
2217
+ if ( $page_builder == 'all' || current_site['page_builder'] == $page_builder ) {
2218
+ page_builder_match = true;
2219
+ }
2220
+
2221
+ if ( '' != match_id ) {
2222
+ if ( text_match && category_match && free_match && page_builder_match ) {
2223
+ items[site_id] = current_site;
2224
+ items[site_id]['type'] = 'site';
2225
+ items[site_id]['site_id'] = site_id;
2226
+ items[site_id]['pages_count'] = ( undefined != current_site['pages'] ) ? Object.keys( current_site['pages'] ).length : 0;
2227
+ tags_strings.push( ResponsiveSitesAdmin._unescape_lower( current_site['title']['rendered'] ));
2228
+
2229
+ if ( null !== current_site['sites_tags'] && Object.keys(current_site['sites_tags']).length) {
2230
+ for (tag_id in current_site['sites_tags']) {
2231
+ var tag_title = current_site['sites_tags'][tag_id];
2232
+ tag_title = ResponsiveSitesAdmin._unescape_lower(tag_title.replace('-', ' '));
2233
+ if (tag_title.toLowerCase().includes(search_term)) {
2234
+ tags_strings.push(ResponsiveSitesAdmin._unescape_lower(tag_title));
2235
+ }
2236
+ }
2237
+ }
2238
+ }
2239
+ }
2240
+ }
2241
+
2242
+ if ( tags_strings.length > 0 ) {
2243
+ ResponsiveSitesAdmin.autocompleteTags = tags_strings;
2244
+ ResponsiveSitesAdmin._autocomplete();
2245
+ }
2246
+
2247
+ return items;
2248
+ },
2249
+
2250
+ _filter_sites_by_page_builder: function( data ) {
2251
+
2252
+ var items = [];
2253
+
2254
+ var $page_builder = $('.page-builders .active').attr('data-page-builder') || 'elementor';
2255
+
2256
+ for( site_id in data ) {
2257
+
2258
+ var current_site = data[site_id];
2259
+
2260
+ var page_builder_match = false;
2261
+
2262
+ if ( current_site['page_builder'] === $page_builder ) {
2263
+ page_builder_match = true;
2264
+ }
2265
+ if ( page_builder_match ) {
2266
+ items[site_id] = current_site;
2267
+ items[site_id]['type'] = 'site';
2268
+ items[site_id]['site_id'] = site_id;
2269
+ items[site_id]['pages_count'] = ( undefined != current_site['pages'] ) ? Object.keys( current_site['pages'] ).length : 0;
2270
+ }
2271
+ }
2272
+
2273
+ return items;
2274
+ },
2275
+
2276
+ _unescape_lower: function( input_string ) {
2277
+ var input_string = ResponsiveSitesAdmin._unescape( input_string );
2278
+ return input_string.toLowerCase();
2279
+ },
2280
+
2281
+ _unescape: function( input_string ) {
2282
+ var title = _.unescape( input_string );
2283
+
2284
+ // @todo check why below character not escape with function _.unescape();
2285
+ title = title.replace('&#8211;', '-' );
2286
+ title = title.replace('&#8217;', "'" );
2287
+
2288
+ return title;
2289
+ },
2290
+
2291
+ isEmpty: function(obj) {
2292
+ for(var key in obj) {
2293
+ if(obj.hasOwnProperty(key))
2294
+ return false;
2295
+ }
2296
+ return true;
2297
+ },
2298
+
2299
+ add_sites_after_search: function( data ) {
2300
+ var template = wp.template( 'responsive-sites-list' );
2301
+
2302
+ $('#responsive-sites').html( template( data ) );
2303
+ },
2304
+
2305
+
2306
+ add_sites: function( data ) {
2307
+ var template = wp.template( 'responsive-sites-list' );
2308
+
2309
+ $('#responsive-sites').html( template( data ) );
2310
+ },
2311
+
2312
+ _change_page_builder: function() {
2313
+
2314
+ ResponsiveSitesAdmin.filter_array = [];
2315
+
2316
+ var $filter_name = $( '.responsive-sites__category-filter-anchor' ).attr( 'data-slug' );
2317
+
2318
+ if ( '' != $filter_name ) {
2319
+ ResponsiveSitesAdmin.filter_array.push( $filter_name );
2320
+ }
2321
+
2322
+ if( $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).length ) {
2323
+ $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]' ).removeClass('active');
2324
+ $( '.responsive-sites__filter-wrap-checkbox input[name=responsive-sites-radio]:checked' ).addClass('active');
2325
+ }
2326
+ var $filter_type = $( '.responsive-sites__filter-wrap-checkbox .checkbox.active' ).val();
2327
+
2328
+ if ( '' != $filter_type ) {
2329
+ ResponsiveSitesAdmin.filter_array.push( $filter_type );
2330
+ }
2331
+
2332
+ ResponsiveSitesAdmin._closeFilter();
2333
+
2334
+ var page_builder_slug = $(this).attr('data-page-builder') || '';
2335
+ var page_builder_title = $(this).find('.title').text() || '';
2336
+
2337
+ if( page_builder_title ) {
2338
+ $('.selected-page-builder').find('.page-builder-title').text( page_builder_title );
2339
+ }
2340
+
2341
+ if( $('.page-builders [data-page-builder="'+page_builder_slug+'"]').length ) {
2342
+ $('.page-builders [data-page-builder="'+page_builder_slug+'"]').siblings().removeClass('active');
2343
+ $('.page-builders [data-page-builder="'+page_builder_slug+'"]').addClass('active');
2344
+ }
2345
+
2346
+ $( '#wp-filter-search-input' ).trigger( 'keyup' );
2347
+ },
2348
+
2349
+ _addAutocomplete: function() {
2350
+
2351
+ var sites = responsiveSitesAdmin.default_page_builder_sites || [];
2352
+ var strings = [];
2353
+
2354
+ // Add site title's in autocomplete.
2355
+ for( site_id in sites ) {
2356
+
2357
+ var title = ResponsiveSitesAdmin._unescape( sites[ site_id ]['title'] );
2358
+
2359
+ title = title.toLowerCase().replace('&#8211;', '-' );
2360
+
2361
+ strings.push( title );
2362
+ }
2363
+
2364
+ ResponsiveSitesAdmin.autocompleteTags = strings;
2365
+ },
2366
+
2367
+ _autocomplete: function() {
2368
+
2369
+ var strings = ResponsiveSitesAdmin.autocompleteTags;
2370
+ strings = _.uniq( strings );
2371
+ strings = _.sortBy( strings );
2372
+
2373
+ $( "#wp-filter-search-input" ).autocomplete({
2374
+ appendTo: ".responsive-sites-autocomplete-result",
2375
+ classes: {
2376
+ "ui-autocomplete": "responsive-sites-auto-suggest"
2377
+ },
2378
+ source: function(request, response) {
2379
+ var results = $.ui.autocomplete.filter(strings, request.term);
2380
+
2381
+ // Show only 10 results.
2382
+ response(results.slice(0, 15));
2383
+ },
2384
+ open: function( event, ui ) {
2385
+ $('.search-form').addClass( 'searching' );
2386
+ },
2387
+ close: function( event, ui ) {
2388
+ $('.search-form').removeClass( 'searching' );
2389
+ }
2390
+ });
2391
+
2392
+ $( "#wp-filter-search-input" ).focus();
2393
+ },
2394
+
2395
+ _show_search_term: function() {
2396
+ var search_term = $(this).text() || '';
2397
+ $('#wp-filter-search-input').val( search_term );
2398
+ $('#wp-filter-search-input').trigger( 'keyup' );
2399
+ },
2400
+
2401
  };
2402
 
2403
  /**
admin/partials/responsive-ready-sites-admin-display.php CHANGED
@@ -23,9 +23,6 @@
23
  <div class="theme-browser rendered">
24
  <div id="responsive-sites" class="themes wp-clearfix"></div>
25
  </div>
26
- <div class="spinner-wrap">
27
- <span class="spinner"></span>
28
- </div>
29
 
30
  </div>
31
 
@@ -36,35 +33,32 @@
36
  ?>
37
 
38
  <script type="text/template" id="tmpl-responsive-sites-list">
39
-
40
- <# if ( data.items.length ) { #>
41
-
42
- <# for ( key in data.items ) { #>
43
- <div class="theme inactive ra-site-single {{ data.items[ key ].status }}" tabindex="0" aria-describedby="responsive-theme-action responsive-theme-name"
44
- data-demo-id="{{{ data.items[ key ].id }}}"
45
- data-demo-url="{{{ data.items[ key ]['site_url'] }}}"
46
- data-demo-slug="{{{ data.items[ key ].slug }}}"
47
- data-demo-name="{{{ data.items[ key ].title.rendered }}}"
48
  data-active-site="{{{ data.active_site }}}"
49
- data-demo-type="{{{ data.items[ key ].demo_type }}}"
50
- data-wpforms-path="{{{ data.items[ key ].wpforms_path }}}"
51
- data-allow-pages="{{{ data.items[ key ].allow_pages }}}"
52
- data-check_plugins_installed="{{{ data.items[ key ].check_plugins_installed }}}"
53
- data-screenshot="{{{ data.items[ key ]['featured_image_url'] }}}"
54
- data-required-plugins="{{ JSON.stringify(data.items[ key ]['required_plugins']) }}"
55
- data-pages="{{ JSON.stringify(data.items[ key ]['pages'] )}}"
56
- data-required-pro-plugins="{{ JSON.stringify(data.items[ key ]['required_pro_plugins']) }}">
57
- <input type="hidden" class="site_options_data" value="{{ JSON.stringify(data.items[ key ][ 'site_options_data' ]) }}">
58
  <div class="inner">
59
- <span class="site-preview" data-href="{{ data.items[ key ]['responsive-site-url'] }}?TB_iframe=true&width=600&height=550" data-title="data title">
60
- <div class="theme-screenshot" style="background-image: url('{{ data.items[ key ]['featured_image_url'] }}');"></div>
61
  </span>
62
- <span class="demo-type {{{ data.items[ key ].demo_type }}}">{{{ data.items[ key ].demo_type }}}</span>
63
- <# if (data.items[ key ].slug === data.active_site ) { #>
64
  <span class="current_active_site"><?php esc_html_e( 'Currently Active', 'responsive-addons' ); ?></span>
65
  <# } #>
66
  <div class="theme-id-container">
67
- <h3 class="theme-name" id="responsive-theme-name">{{{ data.items[ key ].title.rendered }}}</h3>
68
  <div class="theme-actions">
69
  <button class="button-primary button preview install-theme-preview"><?php esc_html_e( 'Preview', 'responsive-addons' ); ?></button>
70
  </div>
@@ -72,30 +66,24 @@
72
  </div>
73
  </div>
74
  <# } #>
75
- <# } else { #>
76
- <p class="no-themes" style="display:block;">
77
- <?php esc_html_e( 'No Demos found', 'responsive-addons' ); ?>
78
- <span class="description">
79
- <?php
80
- /* translators: %1$s External Link */
81
- printf( esc_html__( 'No More Sites', 'responsive-addons' ) );
82
- ?>
83
- </span>
84
- </p>
85
- <# } #>
86
  </script>
87
  <?php
88
  /** Site suggestion block */
89
  ?>
90
  <script type="text/template" id="tmpl-responsive-sites-suggestions">
91
- <div class="theme inactive ra-site-single responsive-sites-suggestions">
92
  <div class="inner">
93
- <p>
94
- <?php
95
- /* translators: %1$s External Link */
96
- printf( __( 'Can\'t find a Responsive Ready Site that suits your purpose ?<br><a target="_blank" href="%1$s">Suggest A Site</a>', 'responsive-addons' ), esc_url( 'mailto:support@cyberchimps.com?Subject=New%20Site%20Suggestion' ) );
97
- ?>
98
- </p>
 
 
 
 
 
99
  </div>
100
  </div>
101
  </script>
@@ -411,6 +399,8 @@
411
  </div>
412
  </div>
413
  </script>
 
 
414
 
415
 
416
 
23
  <div class="theme-browser rendered">
24
  <div id="responsive-sites" class="themes wp-clearfix"></div>
25
  </div>
 
 
 
26
 
27
  </div>
28
 
33
  ?>
34
 
35
  <script type="text/template" id="tmpl-responsive-sites-list">
36
+ <# for ( key in data ) { #>
37
+ <div class="theme inactive ra-site-single {{ data[ key ].status }} {{ data[ key ].class }}" tabindex="0" aria-describedby="responsive-theme-action responsive-theme-name"
38
+ data-demo-id="{{{ data[ key ].id }}}"
39
+ data-demo-url="{{{ data[ key ]['site_url'] }}}"
40
+ data-demo-slug="{{{ data[ key ].slug }}}"
41
+ data-demo-name="{{{ data[ key ].title.rendered }}}"
 
 
 
42
  data-active-site="{{{ data.active_site }}}"
43
+ data-demo-type="{{{ data[ key ].demo_type }}}"
44
+ data-wpforms-path="{{{ data[ key ].wpforms_path }}}"
45
+ data-allow-pages="{{{ data[ key ].allow_pages }}}"
46
+ data-check_plugins_installed="{{{ data[ key ].check_plugins_installed }}}"
47
+ data-screenshot="{{{ data[ key ]['featured_image_url'] }}}"
48
+ data-required-plugins="{{ JSON.stringify(data[ key ]['required_plugins']) }}"
49
+ data-pages="{{ JSON.stringify(data[ key ]['pages'] )}}"
50
+ data-required-pro-plugins="{{ JSON.stringify(data[ key ]['required_pro_plugins']) }}">
51
+ <input type="hidden" class="site_options_data" value="{{ JSON.stringify(data[ key ][ 'site_options_data' ]) }}">
52
  <div class="inner">
53
+ <span class="site-preview" data-href="{{ data[ key ]['responsive-site-url'] }}?TB_iframe=true&width=600&height=550" data-title="data title">
54
+ <div class="theme-screenshot" style="background-image: url('{{ data[ key ]['featured_image_url'] }}');"></div>
55
  </span>
56
+ <span class="demo-type {{{ data[ key ].demo_type }}}">{{{ data[ key ].demo_type }}}</span>
57
+ <# if (data[ key ].slug === data.active_site ) { #>
58
  <span class="current_active_site"><?php esc_html_e( 'Currently Active', 'responsive-addons' ); ?></span>
59
  <# } #>
60
  <div class="theme-id-container">
61
+ <h3 class="theme-name" id="responsive-theme-name">{{{ data[ key ].title.rendered }}}</h3>
62
  <div class="theme-actions">
63
  <button class="button-primary button preview install-theme-preview"><?php esc_html_e( 'Preview', 'responsive-addons' ); ?></button>
64
  </div>
66
  </div>
67
  </div>
68
  <# } #>
 
 
 
 
 
 
 
 
 
 
 
69
  </script>
70
  <?php
71
  /** Site suggestion block */
72
  ?>
73
  <script type="text/template" id="tmpl-responsive-sites-suggestions">
74
+ <div class="responsive-sites-suggestions">
75
  <div class="inner">
76
+ <h3><?php esc_html_e( 'Sorry No Results Found.', 'responsive-addons' ); ?></h3>
77
+ <div class="content">
78
+ <div class="description">
79
+ <p>
80
+ <?php
81
+ /* translators: %1$s External Link */
82
+ printf( __( 'Can\'t find a Responsive Ready Site that suits your purpose ?<br><a target="_blank" href="%1$s">Suggest A Site</a>', 'responsive-addons' ), esc_url( 'mailto:support@cyberchimps.com?Subject=New%20Site%20Suggestion' ) );
83
+ ?>
84
+ </p>
85
+ </div>
86
+ </div>
87
  </div>
88
  </div>
89
  </script>
399
  </div>
400
  </div>
401
  </script>
402
+ <?php
403
+ wp_print_admin_notice_templates();
404
 
405
 
406
 
admin/rollback/class-responsive-plugin-install-helper.php CHANGED
@@ -148,7 +148,7 @@ class Responsive_Plugin_Install_Helper {
148
  public function enqueue_scripts() {
149
  wp_enqueue_script( 'plugin-install' );
150
  wp_enqueue_script( 'updates' );
151
- wp_enqueue_script( 'responsive-plugin-install-helper', get_template_directory_uri() . '/inc/customizer/controls/ui/helper-plugin-install/helper-script.js', array( 'jquery' ), RESPONSIVE_THEME_VERSION, true );
152
  wp_localize_script(
153
  'responsive-plugin-install-helper',
154
  'responsive_plugin_helper',
148
  public function enqueue_scripts() {
149
  wp_enqueue_script( 'plugin-install' );
150
  wp_enqueue_script( 'updates' );
151
+ wp_enqueue_script( 'responsive-plugin-install-helper', get_template_directory_uri() . '/inc/customizer/controls/ui/helper-plugin-install/helper-script.js', array( 'jquery' ), RESPONSIVE_ADDONS_VER, true );
152
  wp_localize_script(
153
  'responsive-plugin-install-helper',
154
  'responsive_plugin_helper',
includes/class-responsive-add-ons.php CHANGED
@@ -46,27 +46,27 @@ class Responsive_Add_Ons {
46
  */
47
  public function __construct() {
48
 
49
- add_action( 'admin_init', array( &$this, 'admin_init' ) );
50
- add_action( 'admin_notices', array( &$this, 'add_theme_installation_notice' ), 1 );
51
- add_action( 'wp_head', array( &$this, 'responsive_head' ) );
52
- add_action( 'plugins_loaded', array( &$this, 'responsive_addons_translations' ) );
53
  $plugin = plugin_basename( __FILE__ );
54
- add_filter( "plugin_action_links_$plugin", array( &$this, 'plugin_settings_link' ) );
55
 
56
  // Responsive Ready Site Importer Menu.
57
- add_action( 'admin_enqueue_scripts', array( &$this, 'responsive_ready_sites_admin_enqueue_scripts' ) );
58
 
59
- add_action( 'admin_enqueue_scripts', array( &$this, 'responsive_ready_sites_admin_enqueue_styles' ) );
60
 
61
  if ( is_admin() ) {
62
  add_action( 'wp_ajax_responsive-ready-sites-activate-theme', array( $this, 'activate_theme' ) );
63
- add_action( 'wp_ajax_responsive-ready-sites-required-plugins', array( &$this, 'required_plugin' ) );
64
- add_action( 'wp_ajax_responsive-ready-sites-required-plugin-activate', array( &$this, 'required_plugin_activate' ) );
65
- add_action( 'wp_ajax_responsive-ready-sites-set-reset-data', array( &$this, 'set_reset_data' ) );
66
- add_action( 'wp_ajax_responsive-ready-sites-backup-settings', array( &$this, 'backup_settings' ) );
67
- add_action( 'wp_ajax_responsive-is-theme-active', array( &$this, 'check_responsive_theme_active' ) );
68
  // Dismiss admin notice.
69
- add_action( 'wp_ajax_responsive-notice-dismiss', array( &$this, 'dismiss_notice' ) );
70
  // Check if Responsive Addons pro plugin is active.
71
  add_action( 'wp_ajax_check-responsive-add-ons-pro-installed', array( $this, 'is_responsive_pro_is_installed' ) );
72
 
@@ -272,7 +272,7 @@ class Responsive_Add_Ons {
272
  register_setting(
273
  'responsive_addons',
274
  'responsive_addons_options',
275
- array( &$this, 'responsive_addons_sanitize' )
276
  );
277
 
278
  }
@@ -394,10 +394,10 @@ class Responsive_Add_Ons {
394
  *
395
  * @since 2.0.0
396
  */
397
- public function responsive_ready_sites_admin_enqueue_scripts( $hook ) {
398
 
399
- wp_enqueue_script( 'install-responsive-theme', RESPONSIVE_ADDONS_URI . 'admin/js/install-responsive-theme.js', array( 'jquery', 'updates' ), '2.0.3', true );
400
- wp_enqueue_style( 'install-responsive-theme', RESPONSIVE_ADDONS_URI . 'admin/css/install-responsive-theme.css', null, '2.0.3', 'all' );
401
  $data = apply_filters(
402
  'responsive_sites_install_theme_localize_vars',
403
  array(
@@ -413,13 +413,7 @@ class Responsive_Add_Ons {
413
 
414
  if ( 'responsive_page_responsive-add-ons' === $hook && empty( $_GET['action'] ) ) {
415
 
416
- wp_enqueue_script( 'responsive-ready-sites-fetch', RESPONSIVE_ADDONS_URI . 'admin/js/fetch.umd.js', array( 'jquery' ), '2.0.0', true );
417
-
418
- wp_enqueue_script( 'responsive-ready-sites-api', RESPONSIVE_ADDONS_URI . 'admin/js/responsive-ready-sites-api.js', array( 'jquery', 'responsive-ready-sites-fetch' ), '2.0.0', true );
419
-
420
- wp_enqueue_script( 'responsive-ready-sites-admin-js', RESPONSIVE_ADDONS_URI . 'admin/js/responsive-ready-sites-admin.js', array( 'jquery', 'wp-util', 'updates' ), '2.0.0', true );
421
-
422
- wp_enqueue_script( 'render-responsive-ready-sites', RESPONSIVE_ADDONS_URI . 'admin/js/render-responsive-ready-sites.js', array( 'wp-util', 'responsive-ready-sites-api', 'jquery' ), '2.0.0', true );
423
 
424
  $data = apply_filters(
425
  'responsive_sites_localize_vars',
@@ -432,38 +426,35 @@ class Responsive_Add_Ons {
432
  'required_plugins' => array(),
433
  'ApiURL' => self::$api_url,
434
  'importSingleTemplateButtonTitle' => __( 'Import "%s" Template', 'responsive-addons' ),
 
 
 
 
 
 
 
 
435
  )
436
  );
437
 
438
  wp_localize_script( 'responsive-ready-sites-admin-js', 'responsiveSitesAdmin', $data );
 
 
439
 
440
- $data = apply_filters(
441
- 'responsive_sites_localize_vars',
442
- array(
443
- 'ApiURL' => self::$api_url,
444
- )
445
- );
446
-
447
- // Use this for premium demos.
448
- $request_params = apply_filters(
449
- 'responsive_sites_api_params',
450
- array(
451
- 'site_url' => '',
452
- 'per_page' => 15,
453
- )
454
- );
455
-
456
- wp_localize_script( 'responsive-ready-sites-api', 'responsiveSitesApi', $data );
457
- $data = apply_filters(
458
- 'responsive_sites_render_localize_vars',
459
- array(
460
- 'sites' => $request_params,
461
- 'settings' => array(),
462
- 'active_site_data' => $this->get_active_site_data(),
463
- )
464
- );
465
 
466
- wp_localize_script( 'render-responsive-ready-sites', 'responsiveSitesRender', $data );
 
 
 
 
467
  }
468
  }
469
 
@@ -472,10 +463,12 @@ class Responsive_Add_Ons {
472
  *
473
  * @since 2.0.0
474
  */
475
- public function responsive_ready_sites_admin_enqueue_styles() {
476
- // Responsive Ready Sites admin styles.
477
- wp_register_style( 'responsive-ready-sites-admin', RESPONSIVE_ADDONS_URI . 'admin/css/responsive-ready-sites-admin.css', false, '1.0.0' );
478
- wp_enqueue_style( 'responsive-ready-sites-admin' );
 
 
479
  }
480
 
481
  /**
@@ -717,22 +710,212 @@ class Responsive_Add_Ons {
717
  }
718
  ?>
719
  <div class="wrap">
720
- <h1><?php esc_html_e( 'Responsive Importer Options', 'responsive-addons' ); ?></h1>
721
- <h2 class="nav-tab-wrapper">
722
- <span class="nav-tab
723
- <?php
724
- if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'go_pro' != $_GET['action'] && 'license' != $_GET['action'] && 'pro_support' != $_GET['action'] ) {
725
- echo ' nav-tab-active';}
726
- ?>
727
- "><?php esc_html_e( 'Templates', 'responsive-addons' ); ?></span>
728
- </h2>
729
  <?php
 
730
  do_action( 'responsive_addons_importer_page' );
731
  ?>
732
  </div>
733
 
734
  <?php
735
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
 
737
  /**
738
  * Check if Responsive Addons Pro is installed.
@@ -988,4 +1171,77 @@ class Responsive_Add_Ons {
988
 
989
  exit;
990
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
991
  }
46
  */
47
  public function __construct() {
48
 
49
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
50
+ add_action( 'admin_notices', array( $this, 'add_theme_installation_notice' ), 1 );
51
+ add_action( 'wp_head', array( $this, 'responsive_head' ) );
52
+ add_action( 'plugins_loaded', array( $this, 'responsive_addons_translations' ) );
53
  $plugin = plugin_basename( __FILE__ );
54
+ add_filter( "plugin_action_links_$plugin", array( $this, 'plugin_settings_link' ) );
55
 
56
  // Responsive Ready Site Importer Menu.
57
+ add_action( 'admin_enqueue_scripts', array( $this, 'responsive_ready_sites_admin_enqueue_scripts' ) );
58
 
59
+ add_action( 'admin_enqueue_scripts', array( $this, 'responsive_ready_sites_admin_enqueue_styles' ) );
60
 
61
  if ( is_admin() ) {
62
  add_action( 'wp_ajax_responsive-ready-sites-activate-theme', array( $this, 'activate_theme' ) );
63
+ add_action( 'wp_ajax_responsive-ready-sites-required-plugins', array( $this, 'required_plugin' ) );
64
+ add_action( 'wp_ajax_responsive-ready-sites-required-plugin-activate', array( $this, 'required_plugin_activate' ) );
65
+ add_action( 'wp_ajax_responsive-ready-sites-set-reset-data', array( $this, 'set_reset_data' ) );
66
+ add_action( 'wp_ajax_responsive-ready-sites-backup-settings', array( $this, 'backup_settings' ) );
67
+ add_action( 'wp_ajax_responsive-is-theme-active', array( $this, 'check_responsive_theme_active' ) );
68
  // Dismiss admin notice.
69
+ add_action( 'wp_ajax_responsive-notice-dismiss', array( $this, 'dismiss_notice' ) );
70
  // Check if Responsive Addons pro plugin is active.
71
  add_action( 'wp_ajax_check-responsive-add-ons-pro-installed', array( $this, 'is_responsive_pro_is_installed' ) );
72
 
272
  register_setting(
273
  'responsive_addons',
274
  'responsive_addons_options',
275
+ array( $this, 'responsive_addons_sanitize' )
276
  );
277
 
278
  }
394
  *
395
  * @since 2.0.0
396
  */
397
+ public function responsive_ready_sites_admin_enqueue_scripts( $hook = '' ) {
398
 
399
+ wp_enqueue_script( 'install-responsive-theme', RESPONSIVE_ADDONS_URI . 'admin/js/install-responsive-theme.js', array( 'jquery', 'updates' ), RESPONSIVE_ADDONS_VER, true );
400
+ wp_enqueue_style( 'install-responsive-theme', RESPONSIVE_ADDONS_URI . 'admin/css/install-responsive-theme.css', null, RESPONSIVE_ADDONS_VER, 'all' );
401
  $data = apply_filters(
402
  'responsive_sites_install_theme_localize_vars',
403
  array(
413
 
414
  if ( 'responsive_page_responsive-add-ons' === $hook && empty( $_GET['action'] ) ) {
415
 
416
+ wp_enqueue_script( 'responsive-ready-sites-admin-js', RESPONSIVE_ADDONS_URI . 'admin/js/responsive-ready-sites-admin.js', array( 'jquery', 'wp-util', 'updates', 'jquery-ui-autocomplete' ), RESPONSIVE_ADDONS_VER, true );
 
 
 
 
 
 
417
 
418
  $data = apply_filters(
419
  'responsive_sites_localize_vars',
426
  'required_plugins' => array(),
427
  'ApiURL' => self::$api_url,
428
  'importSingleTemplateButtonTitle' => __( 'Import "%s" Template', 'responsive-addons' ),
429
+ 'default_page_builder_sites' => $this->get_sites_by_page_builder(),
430
+ 'strings' => array(
431
+ 'syncCompleteMessage' => $this->get_sync_complete_message(),
432
+ /* translators: %s is a template name */
433
+ 'importSingleTemplate' => __( 'Import "%s" Template', 'responsive-addons' ),
434
+ ),
435
+ 'dismiss' => __( 'Dismiss this notice.', 'responsive-addons' ),
436
+ 'syncTemplatesLibraryStart' => '<span class="message">' . esc_html__( 'Syncing ready sites templates in the background. The process can take anywhere between 2 to 3 minutes. We will notify you once done.', 'responsive-addons' ) . '</span>',
437
  )
438
  );
439
 
440
  wp_localize_script( 'responsive-ready-sites-admin-js', 'responsiveSitesAdmin', $data );
441
+ }
442
+ }
443
 
444
+ /**
445
+ * Get Sync Complete Message
446
+ *
447
+ * @since 2.0.0
448
+ * @param boolean $echo Echo the message.
449
+ * @return mixed
450
+ */
451
+ public function get_sync_complete_message( $echo = false ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
 
453
+ $message = __( 'Ready Sites data refreshed!', 'responsive-addons' );
454
+ if ( $echo ) {
455
+ echo esc_html( $message );
456
+ } else {
457
+ return esc_html( $message );
458
  }
459
  }
460
 
463
  *
464
  * @since 2.0.0
465
  */
466
+ public function responsive_ready_sites_admin_enqueue_styles( $hook = '' ) {
467
+ if ( 'toplevel_page_responsive_add_ons' === $hook || 'responsive_page_responsive-add-ons' === $hook || 'responsive_page_responsive_add_ons_go_pro' === $hook ) {
468
+ // Responsive Ready Sites admin styles.
469
+ wp_register_style( 'responsive-ready-sites-admin', RESPONSIVE_ADDONS_URI . 'admin/css/responsive-ready-sites-admin.css', false, RESPONSIVE_ADDONS_VER );
470
+ wp_enqueue_style( 'responsive-ready-sites-admin' );
471
+ }
472
  }
473
 
474
  /**
710
  }
711
  ?>
712
  <div class="wrap">
 
 
 
 
 
 
 
 
 
713
  <?php
714
+ $this->init_nav_menu( 'general' );
715
  do_action( 'responsive_addons_importer_page' );
716
  ?>
717
  </div>
718
 
719
  <?php
720
  }
721
+ /**
722
+ * Init Nav Menu
723
+ *
724
+ * @param mixed $action Action name.
725
+ * @since 2.5.0
726
+ */
727
+ public function init_nav_menu( $action = '' ) {
728
+
729
+ if ( '' !== $action ) {
730
+ $this->render_tab_menu( $action );
731
+ }
732
+ }
733
+
734
+ /**
735
+ * Render tab menu
736
+ *
737
+ * @param mixed $action Action name.
738
+ * @since 2.5.0
739
+ */
740
+ public function render_tab_menu( $action = '' ) {
741
+ ?>
742
+ <div id="responsive-sites-menu-page">
743
+ <?php $this->render( $action ); ?>
744
+ </div>
745
+ <?php
746
+ }
747
+
748
+
749
+ /**
750
+ * Prints HTML content for tabs
751
+ *
752
+ * @param mixed $action Action name.
753
+ * @since 2.5.0
754
+ */
755
+ public function render( $action ) {
756
+ ?>
757
+ <div class="nav-tab-wrapper">
758
+ <div class="logo">
759
+ <div class="responsive-sites-logo-wrap">
760
+ <img src="<?php echo esc_url( RESPONSIVE_ADDONS_URI . 'admin/images/responsive-thumbnail.jpg' ); ?>">
761
+ </div>
762
+ </div>
763
+ <div id="responsive-sites-filters" class="hide-on-mobile">
764
+ <?php $this->site_filters(); ?>
765
+ </div>
766
+ <div class="form">
767
+ <div class="sync-ready-sites-templates-wrap header-actions">
768
+ <div class="filters-slug">
769
+ <a title="<?php esc_html_e( 'Sync Ready Sites', 'responsive-add-ons' ); ?>" href="#" class="responsive-ready-sites-sync-templates-button">
770
+ <span class="dashicons dashicons-update-alt"></span>
771
+ </a>
772
+ </div>
773
+ </div>
774
+ <span class="page-builder-icon">
775
+ <div class="selected-page-builder">
776
+ <?php
777
+ $page_builder = array(
778
+ 'name' => 'Elementor',
779
+ 'slug' => 'elementor',
780
+ );
781
+ if ( $page_builder ) {
782
+ ?>
783
+ <span class="page-builder-title"><?php echo esc_html( $page_builder['name'] ); ?></span>
784
+ <span class="dashicons dashicons-arrow-down"></span>
785
+ <?php } ?>
786
+ </div>
787
+ <ul class="page-builders">
788
+ <?php
789
+ $default_page_builder = 'elementor';
790
+ $page_builders = $this->get_default_page_builders();
791
+ foreach ( $page_builders as $key => $page_builder ) {
792
+ $class = '';
793
+ if ( $default_page_builder === $page_builder['slug'] ) {
794
+ $class = 'active';
795
+ }
796
+ ?>
797
+ <li data-page-builder="<?php echo esc_html( $page_builder['slug'] ); ?>" class="<?php echo esc_html( $class ); ?>">
798
+ <div class="title"><?php echo esc_html( $page_builder['name'] ); ?></div>
799
+ </li>
800
+ <?php
801
+ }
802
+ ?>
803
+ </ul>
804
+ <form id="responsive-sites-welcome-form-inline" enctype="multipart/form-data" method="post" style="display: none;">
805
+ <div class="fields">
806
+ <input type="hidden" name="page_builder" class="page-builder-input" required="required" />
807
+ </div>
808
+ <input type="hidden" name="message" value="saved" />
809
+ <?php wp_nonce_field( 'responsive-sites-welcome-screen', 'responsive-sites-page-builder' ); ?>
810
+ </form>
811
+ </span>
812
+ </div>
813
+ </div><!-- .nav-tab-wrapper -->
814
+ <div id="responsive-sites-filters" class="hide-on-desktop">
815
+ <?php $this->site_filters(); ?>
816
+ </div>
817
+ <?php
818
+ }
819
+
820
+ /**
821
+ * Site Filters
822
+ *
823
+ * @since 2.5.0
824
+ *
825
+ * @return void
826
+ */
827
+ public function site_filters() {
828
+ ?>
829
+ <div class="wp-filter hide-if-no-js">
830
+ <div class="section-left">
831
+ <div class="search-form">
832
+ <?php
833
+ $categories = array(
834
+ array(
835
+ 'name' => 'Business',
836
+ 'slug' => 'business',
837
+ ),
838
+ array(
839
+ 'name' => 'Blog',
840
+ 'slug' => 'blog',
841
+ ),
842
+ array(
843
+ 'name' => 'Ecommerce',
844
+ 'slug' => 'ecommerce',
845
+ ),
846
+ array(
847
+ 'name' => 'Onepage',
848
+ 'slug' => 'onepage',
849
+ ),
850
+ );
851
+ if ( ! empty( $categories ) ) {
852
+ ?>
853
+ <div id="responsive-sites__category-filter" class="dropdown-check-list" tabindex="100">
854
+ <span class="responsive-sites__category-filter-anchor" data-slug=""><?php esc_html_e( 'All', 'responsive-addons' ); ?></span>
855
+ <ul class="responsive-sites__category-filter-items">
856
+ <li class="responsive-sites__filter-wrap category-active" data-slug=""><?php esc_html_e( 'All', 'responsive-addons' ); ?> </li>
857
+ <?php
858
+ foreach ( $categories as $key => $value ) {
859
+ ?>
860
+ <li class="responsive-sites__filter-wrap" data-slug="<?php echo esc_attr( $value['slug'] ); ?>"><?php echo esc_html( $value['name'] ); ?> </li>
861
+ <?php
862
+ }
863
+ ?>
864
+ <li class="responsive-sites__filter-wrap-checkbox first-wrap">
865
+ <label>
866
+ <input id="radio-all" type="radio" name="responsive-sites-radio" class="checkbox active" value="" checked /><?php esc_html_e( 'All', 'responsive-addons' ); ?>
867
+ </label>
868
+ </li>
869
+ <li class="responsive-sites__filter-wrap-checkbox">
870
+ <label>
871
+ <input id="radio-free" type="radio" name="responsive-sites-radio" class="checkbox" value="free" /><?php esc_html_e( 'Free', 'responsive-addons' ); ?>
872
+ </label>
873
+ </li>
874
+ <li class="responsive-sites__filter-wrap-checkbox">
875
+ <label>
876
+ <input id="radio-premium" type="radio" name="responsive-sites-radio" class="checkbox" value="premium" /><?php esc_html_e( 'Premium', 'responsive-addons' ); ?>
877
+ </label>
878
+ </li>
879
+ </ul>
880
+ </div>
881
+ <?php
882
+ }
883
+ ?>
884
+ <input autocomplete="off" placeholder="<?php esc_html_e( 'Search...', 'responsive-addons' ); ?>" type="search" aria-describedby="live-search-desc" id="wp-filter-search-input" class="wp-filter-search">
885
+ <span class="responsive-icon-search search-icon"></span>
886
+ <div class="responsive-sites-autocomplete-result"></div>
887
+ </div>
888
+ </div>
889
+ </div>
890
+ <?php
891
+ }
892
+
893
+
894
+ /**
895
+ * Get Default Page Builders
896
+ *
897
+ * @since 2.5.0
898
+ * @return array
899
+ */
900
+ public function get_default_page_builders() {
901
+ return array(
902
+ array(
903
+ 'id' => 1,
904
+ 'slug' => 'all',
905
+ 'name' => 'ALL',
906
+ ),
907
+ array(
908
+ 'id' => 2,
909
+ 'slug' => 'elementor',
910
+ 'name' => 'Elementor',
911
+ ),
912
+ array(
913
+ 'id' => 3,
914
+ 'slug' => 'gutenberg',
915
+ 'name' => 'Gutenberg',
916
+ ),
917
+ );
918
+ }
919
 
920
  /**
921
  * Check if Responsive Addons Pro is installed.
1171
 
1172
  exit;
1173
  }
1174
+
1175
+ /**
1176
+ * Get all sites
1177
+ *
1178
+ * @since 2.5.0
1179
+ * @return array All sites.
1180
+ */
1181
+ public function get_all_sites() {
1182
+ $sites_and_pages = array();
1183
+
1184
+ $total_requests = $this->get_total_requests();
1185
+
1186
+ for ( $page = 1; $page <= $total_requests; $page++ ) {
1187
+ $current_page_data = get_site_option( 'responsive-ready-sites-and-pages-page-' . $page, array() );
1188
+ if ( ! empty( $current_page_data ) ) {
1189
+ foreach ( $current_page_data as $page_id => $page_data ) {
1190
+ $sites_and_pages[] = $page_data;
1191
+ }
1192
+ }
1193
+ }
1194
+ return $sites_and_pages;
1195
+ }
1196
+
1197
+ /**
1198
+ * Get Page Builder Sites
1199
+ *
1200
+ * @since 2.5.0
1201
+ *
1202
+ * @param string $default_page_builder default page builder slug.
1203
+ * @return array page builder sites.
1204
+ */
1205
+ public function get_sites_by_page_builder() {
1206
+ $sites_and_pages = $this->get_all_sites();
1207
+ $current_page_builder_sites = array();
1208
+ if ( ! empty( $sites_and_pages ) ) {
1209
+ foreach ( $sites_and_pages as $site_id => $site_details ) {
1210
+ $current_page_builder_sites[] = $site_details;
1211
+ }
1212
+ }
1213
+
1214
+ return $current_page_builder_sites;
1215
+ }
1216
+
1217
+ /**
1218
+ * Get Total Requests
1219
+ *
1220
+ * @since 2.5.0
1221
+ * @return integer
1222
+ */
1223
+ public function get_total_requests() {
1224
+
1225
+ $api_args = array(
1226
+ 'timeout' => 60,
1227
+ );
1228
+
1229
+ $api_url = self::$api_url . 'get-ready-sites-requests-count/?per_page=15';
1230
+
1231
+ $response = wp_remote_get( $api_url, $api_args );
1232
+
1233
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
1234
+
1235
+ $total_requests = json_decode( wp_remote_retrieve_body( $response ), true );
1236
+
1237
+ if ( isset( $total_requests ) ) {
1238
+
1239
+ update_site_option( 'responsive-ready-sites-requests', $total_requests );
1240
+
1241
+ return $total_requests;
1242
+ }
1243
+ }
1244
+
1245
+ $this->get_total_requests();
1246
+ }
1247
  }
includes/importers/batch-processing/class-responsive-ready-sites-batch-processing-importer.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Batch Processing Importer
4
+ *
5
+ * @package Responsive Addons
6
+ * @since 2.5.0
7
+ */
8
+
9
+ if ( ! class_exists( 'Responsive_Ready_Sites_Batch_Processing_Importer' ) ) :
10
+
11
+ /**
12
+ * Responsive Ready Sites Batch Processing Importer
13
+ *
14
+ * @since 2.5.0
15
+ */
16
+ class Responsive_Ready_Sites_Batch_Processing_Importer {
17
+
18
+ /**
19
+ * Instance
20
+ *
21
+ * @since 2.5.0
22
+ * @access private
23
+ * @var object Class object.
24
+ */
25
+ private static $instance;
26
+
27
+ /**
28
+ * API Url
29
+ *
30
+ * @since 2.5.0
31
+ * @var string API Url
32
+ */
33
+ public static $api_url;
34
+
35
+ /**
36
+ * Initiator
37
+ *
38
+ * @since 2.5.0
39
+ * @return object initialized object of class.
40
+ */
41
+ public static function get_instance() {
42
+
43
+ if ( ! isset( self::$instance ) ) {
44
+ self::$instance = new self();
45
+ }
46
+ return self::$instance;
47
+ }
48
+
49
+ /**
50
+ * Constructor
51
+ *
52
+ * @since 2.5.0
53
+ */
54
+ public function __construct() {
55
+ self::set_api_url();
56
+ }
57
+
58
+ /**
59
+ * Import
60
+ *
61
+ * @since 2.5.0
62
+ *
63
+ * @param integer $page Page number.
64
+ * @return array
65
+ */
66
+ public function import_sites( $page = 1 ) {
67
+
68
+ $api_args = array(
69
+ 'timeout' => 60,
70
+ );
71
+ $sites_and_pages = array();
72
+
73
+ $query_args = apply_filters(
74
+ 'cyb_sites_import_sites_query_args',
75
+ array(
76
+ 'per_page' => 15,
77
+ 'page' => $page,
78
+ )
79
+ );
80
+
81
+ $api_url = add_query_arg( $query_args, self::$api_url . 'cyberchimps-sites' );
82
+
83
+ $response = wp_remote_get( $api_url, $api_args );
84
+
85
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
86
+ $sites_and_pages = json_decode( wp_remote_retrieve_body( $response ), true );
87
+
88
+ if ( isset( $sites_and_pages['code'] ) ) {
89
+ $message = isset( $sites_and_pages['message'] ) ? $sites_and_pages['message'] : '';
90
+ return $message;
91
+ } else {
92
+
93
+ foreach ( $sites_and_pages as $key => $site ) {
94
+ $sites_and_pages[ 'id-' . $site['id'] ] = $site;
95
+ unset( $sites_and_pages[ $key ] );
96
+ }
97
+ update_site_option( 'responsive-ready-sites-and-pages-page-' . $page, $sites_and_pages );
98
+ }
99
+ } else {
100
+ error_log( 'API Error: ' . $response->get_error_message() );
101
+ }
102
+
103
+ return $sites_and_pages;
104
+ }
105
+
106
+ /**
107
+ * Get an instance of WP_Filesystem_Direct.
108
+ *
109
+ * @since 2.5.0
110
+ * @return object A WP_Filesystem_Direct instance.
111
+ */
112
+ public static function get_filesystem() {
113
+ global $wp_filesystem;
114
+
115
+ require_once ABSPATH . '/wp-admin/includes/file.php';
116
+
117
+ WP_Filesystem();
118
+
119
+ return $wp_filesystem;
120
+ }
121
+
122
+ /**
123
+ * Setter for $api_url
124
+ *
125
+ * @since 2.5.0
126
+ */
127
+ public static function set_api_url() {
128
+ self::$api_url = apply_filters( 'responsive_ready_sites_api_url', 'https://ccreadysites.cyberchimps.com/wp-json/wp/v2/' );
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Initiating by calling 'get_instance()' method
134
+ */
135
+ Responsive_Ready_Sites_Batch_Processing_Importer::get_instance();
136
+
137
+ endif;
includes/importers/batch-processing/class-responsive-ready-sites-batch-processing.php CHANGED
@@ -42,6 +42,23 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Batch_Processing' ) ) :
42
  */
43
  public static $process_single;
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Initiator
47
  *
@@ -79,6 +96,9 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Batch_Processing' ) ) :
79
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-elementor.php';
80
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-gutenberg.php';
81
 
 
 
 
82
  // Menu fix.
83
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-menu.php';
84
 
@@ -89,6 +109,18 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Batch_Processing' ) ) :
89
  add_action( 'responsive_ready_sites_import_complete', array( $this, 'start_process' ) );
90
 
91
  add_action( 'responsive_ready_sites_process_template', array( $this, 'start_process_page' ) );
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
  /**
@@ -205,6 +237,294 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Batch_Processing' ) ) :
205
  return $post_types;
206
  }
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
 
210
  /**
42
  */
43
  public static $process_single;
44
 
45
+ /**
46
+ * API Url
47
+ *
48
+ * @since 2.5.0
49
+ * @var string API Url
50
+ */
51
+ public static $api_url;
52
+
53
+ /**
54
+ * Last Export Checksums
55
+ *
56
+ * @since 2.5.0
57
+ * @var object Class object.
58
+ * @access public
59
+ */
60
+ public $last_xml_export_checksums;
61
+
62
  /**
63
  * Initiator
64
  *
96
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-elementor.php';
97
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-gutenberg.php';
98
 
99
+ // Batch Processing Importer.
100
+ require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-importer.php';
101
+
102
  // Menu fix.
103
  require_once $responsive_ready_sites_batch_processing . 'class-responsive-ready-sites-batch-processing-menu.php';
104
 
109
  add_action( 'responsive_ready_sites_import_complete', array( $this, 'start_process' ) );
110
 
111
  add_action( 'responsive_ready_sites_process_template', array( $this, 'start_process_page' ) );
112
+
113
+ add_action( 'wp_ajax_responsive-ready-sites-import-sites', array( $this, 'import_sites' ) );
114
+
115
+ add_action( 'wp_ajax_responsive-sites-get-sites-request-count', array( $this, 'ready_sites_requests_count' ) );
116
+
117
+ add_action( 'wp_ajax_responsive-ready-sites-update-templates-library', array( $this, 'update_sites_library' ) );
118
+
119
+ add_action( 'wp_ajax_responsive-ready-sites-update-templates-library-complete', array( $this, 'update_templates_library_complete' ) );
120
+
121
+ add_action( 'admin_head', array( $this, 'initialize_ready_sites_templates_importer' ) );
122
+
123
+ self::set_api_url();
124
  }
125
 
126
  /**
237
  return $post_types;
238
  }
239
 
240
+ /**
241
+ * Import Sites
242
+ *
243
+ * @since 2.5.0
244
+ * @return void
245
+ */
246
+ public function import_sites() {
247
+ $page_no = isset( $_POST['page_no'] ) ? absint( $_POST['page_no'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
248
+ if ( $page_no ) {
249
+ $sites_and_pages = Responsive_Ready_Sites_Batch_Processing_Importer::get_instance()->import_sites( $page_no );
250
+
251
+ wp_send_json_success( $sites_and_pages );
252
+ }
253
+
254
+ wp_send_json_error();
255
+ }
256
+
257
+ /**
258
+ * Update Library Complete
259
+ *
260
+ * @since 2.5.0
261
+ * @return void
262
+ */
263
+ public function update_templates_library_complete() {
264
+ $this->update_latest_checksums();
265
+ wp_send_json_success();
266
+ }
267
+
268
+ /**
269
+ * Update Latest Checksums
270
+ *
271
+ * Store latest checksum after batch complete.
272
+ *
273
+ * @since 2.5.0
274
+ * @return void
275
+ */
276
+ public function update_latest_checksums() {
277
+ $latest_checksums = get_site_option( 'responsive-ready-sites-last-xml-export-checksums-latest', '' );
278
+ update_site_option( 'responsive-ready-sites-last-xml-export-checksums', $latest_checksums );
279
+ }
280
+
281
+ /**
282
+ * Get Total Requests
283
+ *
284
+ * @since 2.5.0
285
+ * @return integer
286
+ */
287
+ public function get_total_requests() {
288
+
289
+ $api_args = array(
290
+ 'timeout' => 60,
291
+ );
292
+
293
+ $api_url = self::$api_url . 'get-ready-sites-requests-count/?per_page=15';
294
+
295
+ $response = wp_remote_get( $api_url, $api_args );
296
+
297
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
298
+
299
+ $total_requests = json_decode( wp_remote_retrieve_body( $response ), true );
300
+
301
+ if ( isset( $total_requests ) ) {
302
+
303
+ update_site_option( 'responsive-ready-sites-requests', $total_requests );
304
+
305
+ return $total_requests;
306
+ }
307
+ }
308
+
309
+ $this->get_total_requests();
310
+ }
311
+
312
+ /**
313
+ * Sites Requests Count
314
+ *
315
+ * @since 2.5.0
316
+ * @return void
317
+ */
318
+ public function ready_sites_requests_count() {
319
+
320
+ // Get count.
321
+ $total_requests = $this->get_total_requests();
322
+ if ( $total_requests ) {
323
+ wp_send_json_success( $total_requests );
324
+ }
325
+
326
+ wp_send_json_error();
327
+ }
328
+
329
+ /**
330
+ * Setter for $api_url
331
+ *
332
+ * @since 2.5.0
333
+ */
334
+ public static function set_api_url() {
335
+ self::$api_url = apply_filters( 'responsive_ready_sites_api_url', 'https://ccreadysites.cyberchimps.com/wp-json/wp/v2/' );
336
+ }
337
+
338
+ /**
339
+ * Update Sites Library
340
+ *
341
+ * @since 2.5.0
342
+ * @return void
343
+ */
344
+ public function update_sites_library() {
345
+
346
+ if ( 'no' === $this->get_last_export_checksums() ) {
347
+ wp_send_json_success( 'updated' );
348
+ }
349
+
350
+ $import_with = 'ajax';
351
+
352
+ wp_send_json_success( $import_with );
353
+ }
354
+
355
+ /**
356
+ * Get Last Exported Checksum Status
357
+ *
358
+ * @since 2.5.0
359
+ * @return string Checksums Status.
360
+ */
361
+ public function get_last_export_checksums() {
362
+
363
+ $old_last_export_checksums = get_site_option( 'responsive-ready-sites-last-xml-export-checksums', '' );
364
+
365
+ $new_last_export_checksums = $this->set_last_export_checksums();
366
+
367
+ $checksums_status = 'no';
368
+
369
+ if ( empty( $old_last_export_checksums ) ) {
370
+ $checksums_status = 'yes';
371
+ }
372
+
373
+ if ( $new_last_export_checksums !== $old_last_export_checksums ) {
374
+ $checksums_status = 'yes';
375
+ }
376
+
377
+ return apply_filters( 'responsive_ready_sites_checksums_status', $checksums_status );
378
+ }
379
+
380
+ /**
381
+ * Set Last Exported Checksum
382
+ *
383
+ * @since 2.5.0
384
+ * @return string Checksums Status.
385
+ */
386
+ public function set_last_export_checksums() {
387
+
388
+ if ( ! empty( $this->last_export_checksums ) ) {
389
+ return $this->last_export_checksums;
390
+ }
391
+
392
+ $api_args = array(
393
+ 'timeout' => 60,
394
+ );
395
+
396
+ $response = wp_remote_get( self::$api_url . 'get-last-xml-export-checksum', $api_args );
397
+
398
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
399
+ $result = json_decode( wp_remote_retrieve_body( $response ), true );
400
+
401
+ // Set last export checksums.
402
+ if ( ! empty( $result['last_xml_export_checksums'] ) ) {
403
+ update_site_option( 'responsive-ready-sites-last-xml-export-checksums-latest', $result['last_xml_export_checksums'] );
404
+
405
+ $this->last_xml_export_checksums = $result['last_xml_export_checksums'];
406
+ }
407
+ }
408
+
409
+ return $this->last_xml_export_checksums;
410
+ }
411
+
412
+ /**
413
+ * Start Importer
414
+ *
415
+ * @since 2.5.0
416
+ * @return void
417
+ */
418
+ public function initialize_ready_sites_templates_importer() {
419
+
420
+ $is_fresh_site = get_site_option( 'responsive-ready-sites-fresh-site', '' );
421
+
422
+ // Process initially for the fresh user.
423
+ if ( isset( $_GET['reset'] ) ) {
424
+ // Process Ready sites data import.
425
+ $this->process_batch();
426
+ } elseif ( empty( $is_fresh_site ) ) {
427
+ $this->process_batch();
428
+ update_site_option( 'responsive-ready-sites-fresh-site', 'yes', 'no' );
429
+ } else {
430
+ $current_screen = get_current_screen();
431
+ // return if not Responsive Ready Sites grid page.
432
+ if ( ! is_object( $current_screen ) && null === $current_screen ) {
433
+ return;
434
+ }
435
+ if ( 'responsive_page_responsive-add-ons' === $current_screen->id ) {
436
+ // Process import.
437
+ $this->process_ready_sites_templates_data_import();
438
+ }
439
+ }
440
+ }
441
+
442
+ /**
443
+ * Process Import
444
+ *
445
+ * @since 2.5.0
446
+ *
447
+ * @return mixed Null if process is already started.
448
+ */
449
+ public function process_ready_sites_templates_data_import() {
450
+
451
+ // Batch is already started? Then return.
452
+ $status = get_site_option( 'responsive-ready-sites-batch-status' );
453
+ if ( 'in-process' === $status ) {
454
+ return;
455
+ }
456
+
457
+ // Check batch expiry.
458
+ $expired = get_transient( 'responsive-ready-sites-import-templates-check' );
459
+ if ( false !== $expired ) {
460
+ return;
461
+ }
462
+
463
+ // For 1 week.
464
+ set_transient( 'responsive-ready-sites-import-templates-check', 'true', WEEK_IN_SECONDS );
465
+
466
+ update_site_option( 'responsive-ready-sites-batch-status', 'in-process' );
467
+
468
+ // Process batch.
469
+ $this->process_batch();
470
+ }
471
+
472
+ /**
473
+ * Process Batch
474
+ *
475
+ * @since 2.5.0
476
+ * @return mixed
477
+ */
478
+ public function process_batch() {
479
+
480
+ if ( 'no' === $this->get_last_export_checksums() ) {
481
+ return;
482
+ }
483
+
484
+ // Get count.
485
+ $total_requests = $this->get_total_requests();
486
+ if ( $total_requests ) {
487
+
488
+ $api_args = array(
489
+ 'timeout' => 60,
490
+ );
491
+
492
+ for ( $page = 1; $page <= $total_requests; $page++ ) {
493
+ $sites_and_pages = array();
494
+
495
+ $query_args = apply_filters(
496
+ 'cyb_sites_import_sites_query_args',
497
+ array(
498
+ 'per_page' => 15,
499
+ 'page' => $page,
500
+ )
501
+ );
502
+
503
+ $api_url = add_query_arg( $query_args, self::$api_url . 'cyberchimps-sites' );
504
+
505
+ $response = wp_remote_get( $api_url, $api_args );
506
+
507
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
508
+ $sites_and_pages = json_decode( wp_remote_retrieve_body( $response ), true );
509
+
510
+ if ( isset( $sites_and_pages['code'] ) ) {
511
+ $message = isset( $sites_and_pages['message'] ) ? $sites_and_pages['message'] : '';
512
+ return $message;
513
+ } else {
514
+ foreach ( $sites_and_pages as $key => $site ) {
515
+ $sites_and_pages[ 'id-' . $site['id'] ] = $site;
516
+ unset( $sites_and_pages[ $key ] );
517
+ }
518
+ update_site_option( 'responsive-ready-sites-and-pages-page-' . $page, $sites_and_pages );
519
+ }
520
+ } else {
521
+ error_log( 'API Error: ' . $response->get_error_message() );
522
+ }
523
+ }
524
+ }
525
+
526
+ delete_site_option( 'responsive-ready-sites-batch-status' );
527
+ }
528
  }
529
 
530
  /**
includes/importers/class-responsive-ready-sites-importer.php CHANGED
@@ -352,6 +352,7 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Importer' ) ) :
352
  update_option( '_responsive_sites_old_customizer_data', $customizer_data );
353
 
354
  if ( isset( $customizer_data['responsive_settings'] ) ) {
 
355
  update_option( 'responsive_theme_options', $customizer_data['responsive_settings'] );
356
  }
357
 
@@ -359,8 +360,10 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Importer' ) ) :
359
  $current_theme = wp_get_theme();
360
  if ( is_child_theme() && 'Responsive' === $current_theme->parent()->get( 'Name' ) ) {
361
  $current_theme = str_replace( ' ', '-', strtolower( $current_theme ) );
 
362
  update_option( 'theme_mods_' . $current_theme, $customizer_data['theme_mods_responsive'] );
363
  } else {
 
364
  update_option( 'theme_mods_responsive', $customizer_data['theme_mods_responsive'] );
365
  }
366
  }
@@ -394,13 +397,13 @@ if ( ! class_exists( 'Responsive_Ready_Sites_Importer' ) ) :
394
 
395
  $widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripcslashes( $_POST['widgets_data'] ) ) : ''; //phpcs:ignore
396
 
397
- Responsive_Ready_Sites_Importer_Log::add( 'Imported - Widgets ' . wp_json_encode( $widgets_data ) );
398
-
399
  if ( ! empty( $widgets_data ) ) {
400
 
401
  $widgets_importer = Responsive_Ready_Sites_Widgets_Importer::instance();
402
  $status = $widgets_importer->import_widgets_data( $widgets_data );
403
 
 
 
404
  // Set meta for tracking the post.
405
  if ( is_object( $widgets_data ) ) {
406
  $widgets_data = (array) $widgets_data;
352
  update_option( '_responsive_sites_old_customizer_data', $customizer_data );
353
 
354
  if ( isset( $customizer_data['responsive_settings'] ) ) {
355
+ Responsive_Ready_Sites_Importer_Log::add( 'Old Responsive Theme Options ' . wp_json_encode( get_option( 'responsive_theme_options', array() ) ) );
356
  update_option( 'responsive_theme_options', $customizer_data['responsive_settings'] );
357
  }
358
 
360
  $current_theme = wp_get_theme();
361
  if ( is_child_theme() && 'Responsive' === $current_theme->parent()->get( 'Name' ) ) {
362
  $current_theme = str_replace( ' ', '-', strtolower( $current_theme ) );
363
+ Responsive_Ready_Sites_Importer_Log::add( 'Backup - Responsive Theme Mods ' . wp_json_encode( get_option( 'theme_mods_' . $current_theme, array() ) ) );
364
  update_option( 'theme_mods_' . $current_theme, $customizer_data['theme_mods_responsive'] );
365
  } else {
366
+ Responsive_Ready_Sites_Importer_Log::add( 'Backup - Responsive Theme Mods ' . wp_json_encode( get_option( 'theme_mods_responsive', array() ) ) );
367
  update_option( 'theme_mods_responsive', $customizer_data['theme_mods_responsive'] );
368
  }
369
  }
397
 
398
  $widgets_data = ( isset( $_POST['widgets_data'] ) ) ? (object) json_decode( stripcslashes( $_POST['widgets_data'] ) ) : ''; //phpcs:ignore
399
 
 
 
400
  if ( ! empty( $widgets_data ) ) {
401
 
402
  $widgets_importer = Responsive_Ready_Sites_Widgets_Importer::instance();
403
  $status = $widgets_importer->import_widgets_data( $widgets_data );
404
 
405
+ Responsive_Ready_Sites_Importer_Log::add( 'Imported - Widgets ' . wp_json_encode( $widgets_data ) );
406
+
407
  // Set meta for tracking the post.
408
  if ( is_object( $widgets_data ) ) {
409
  $widgets_data = (array) $widgets_data;
readme.txt CHANGED
@@ -1,111 +1,192 @@
1
- === Gutenberg & Elementor Templates Importer For Responsive ===
2
  Contributors: cyberchimps
3
  Donate Link: https://cyberchimps.com
4
- Tags: one click demo import, gutenberg, elementor, templates
5
  Requires at least: 5.0
6
- Tested up to: 5.6
7
  Requires PHP: 5.6
8
- Stable tag: 2.4.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Import Gutenberg & Elementor Templates for the Responsive WordPress theme.
13
 
14
  == Description ==
15
 
16
- Import Gutenberg & Elementor Templates for the Responsive WordPress theme.
17
 
18
- Get fully working ready-to-use website templates built for the Elementor page builder and the new WordPress blocks editor (Gutenberg). All you have to do is import a website template, edit the content and launch your website.
19
 
20
  This plugin extends the popular [Responsive theme](https://wordpress.org/themes/responsive/). It adds the following features:
21
 
22
  - One click demo import of ready-to-use, Gutenberg & Elementor templates
23
  - Ability to rollback the Responsive theme to a previous version
 
 
24
 
25
  = What are ready-to-use website templates? =
26
- The Responsive theme comes with ready-to-use [website templates](https://cyberchimps.com/responsive-ready-websites/).
 
 
 
 
27
 
28
- Website templates help you save time designing your website. All you have to do is import a template, edit it with a drag & drop editor and launch.
 
 
 
 
 
 
29
 
 
30
  These website templates have the following features:
31
 
32
- - Pre-designed pages such as homepage, about, services and contact.
33
  - Responsive designs that work on all devices.
34
- - Designed with Elementor page builder for easy drag & drop editing.
35
- - Copyright free stock images, that you can use on your website.
36
  - Automatically installs all necessary plugins.
37
 
38
  = What website templates can I import? =
39
- Responsive comes with 30+ ready-to-use WordPress [website templates](https://cyberchimps.com/responsive-ready-websites/).
40
 
41
  **Business Website Templates For Responsive Theme**
42
 
43
- - Startup WordPress Template
44
- - Business WordPress Template
45
- - Corporate WordPress Template
 
 
 
 
 
46
 
47
- **Health & Fitness Website Templates For Responsive Theme**
 
 
 
 
 
48
 
49
- - Health Coach WordPress Template
50
- - Gym WordPress Template
51
- - Yoga WordPress Template
52
 
53
  **Local Business Website Templates For Responsive Theme**
54
 
55
- - Accountant WordPress Template
56
- - Lawyer WordPress Template
57
- - Restaurant WordPress Template
58
- - Photography WordPress Template
59
- - Tattoo Studio WordPress Templates
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  **Real Estate Website Templates For Responsive Theme**
62
 
63
- - Construction WordPress Template
64
- - Real Estate WordPress Template
65
- - Interior Decorator WordPress Template
 
66
 
67
  **Blogs Templates For Responsive Theme**
68
 
69
- - Cooking & Recipe Blog WordPress Templates
70
- - Travel Blog WordPress Templates
71
- - Lifestyle Blog WordPress Templates
 
72
 
73
  **WooCommerce WordPress Templates**
74
 
75
- - General store website templates
76
- - Fashion & jewellery website templates
77
- - Furniture store website templates
 
 
 
 
 
 
 
 
 
 
78
 
79
  = How to import ready sites? =
80
  Here's how it works:
81
 
82
  [youtube https://www.youtube.com/watch?v=JNeQKg1QJhk&t=2s]
83
 
 
 
 
 
 
 
84
  == Frequently Asked Questions ==
85
 
86
  = 1. Are all the ready sites free? =
87
- We have 22+ free and Pro Ready Sites. With Responsive Ready Sites Importer, you will get access to all free sites. To import Pro templates, you will have to install [Responsive Pro](https://cyberchimps.com/responsive-pricing/?utm_source=wordpress-org&utm_medium=responsive-add-ons&utm_campaign=responsive-pricing&utm_content=faq-responsive-pro).
88
 
89
  = 2. Will Responsive Ready Sites Importer work on my theme? =
90
  The templates are built with customizer settings of Responsive Theme to provide maximum control to you. Hence, to use Responsive Ready Sites Importer, you will have to install Responsive Theme.
91
 
92
  = 3. Do I need to install any other plugins? =
93
- Absolutely not! Once you install the plugin, it will take care of all other dependencies. You can sit back and let importer do the job.
94
 
95
  == Installation ==
96
 
97
- 1. Upload the plugin zip from admin & Activate the plugin
98
- 2. Go to Appearance > Responsive Options > AddOns to see all ready sites.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  3. Preview & click on Import site to import the site.
 
 
 
 
 
100
 
101
  == Screenshots ==
102
 
103
- 1. Go to Appearance > Responsive Options > AddOns to see all ready sites.
104
  2. Preview & click on Import site to import.
105
  3. You will be able to see the import process
106
  4. Your website is ready
107
 
108
  == Changelog ==
 
 
 
 
109
  = 2.4.3 - 30th December 2020 =
110
  * Feature - Prompt user to install the third party plugins
111
  * Feature - Get user consent before deleting previous imported ready site
@@ -249,4 +330,7 @@ Absolutely not! Once you install the plugin, it will take care of all other depe
249
  * Bug fixes
250
 
251
  = 1.0.0 =
252
- * Initial set up and release
 
 
 
1
+ === Responsive Template Importer - Elementor & Gutenberg Themes===
2
  Contributors: cyberchimps
3
  Donate Link: https://cyberchimps.com
4
+ Tags: elementor, gutenberg, one click demo import, templates, website templates, ready site templates, ready to import websites, elementor landing page templates, template for elementor, free elementor templates download, free landing page templates, ready made websites free, free landing page templates for elementor, free landing page templates for gutenberg, templates for gutenberg
5
  Requires at least: 5.0
6
+ Tested up to: 5.8.2
7
  Requires PHP: 5.6
8
+ Stable tag: 2.5.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Import free and pro Gutenberg and Elementor Templates for the Responsive WordPress theme.
13
 
14
  == Description ==
15
 
16
+ **Import free and pro Gutenberg and Elementor Templates for the Responsive WordPress theme.**
17
 
18
+ Get fully working and professionally designed ready-to-use website templates built for the Elementor page builder and Gutenberg - the new WordPress blocks editor. All you have to do is import a website template, edit the content and launch your website.
19
 
20
  This plugin extends the popular [Responsive theme](https://wordpress.org/themes/responsive/). It adds the following features:
21
 
22
  - One click demo import of ready-to-use, Gutenberg & Elementor templates
23
  - Ability to rollback the Responsive theme to a previous version
24
+ - Option to import the entire website or selected pages, which allows you to mix and match while building website
25
+
26
 
27
  = What are ready-to-use website templates? =
28
+ The Responsive theme comes with **60+ ready-to-use [website templates](https://cyberchimps.com/responsive-ready-websites/)**
29
+
30
+ Website templates help you save time designing your website. All you have to do is import a template, edit it with a drag & drop editor, and launch.
31
+
32
+ [Plugin reviews](https://wordpress.org/plugins/responsive-add-ons/#reviews)
33
 
34
+ > A very stable, reliable, lean and fast-loading theme with minimum hassle. Also great support. Thank you!
35
+ >
36
+ > Totally as advertised. I love the Ready-Sites package!
37
+ >
38
+ > Great, classic design!
39
+ >
40
+ > Very easy to use
41
 
42
+ = Features =
43
  These website templates have the following features:
44
 
45
+ - Pre-designed pages such as homepage, about, services, and contact.
46
  - Responsive designs that work on all devices.
47
+ - Easy drag & drop editing.
48
+ - Copyright-free stock images that you can use on your website.
49
  - Automatically installs all necessary plugins.
50
 
51
  = What website templates can I import? =
52
+ Responsive comes with 60+ ready-to-use WordPress [website templates](https://cyberchimps.com/responsive-ready-websites/).
53
 
54
  **Business Website Templates For Responsive Theme**
55
 
56
+ - [Startup WordPress Template](https://cyberchimps.com/wordpress-themes/startup-business/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
57
+ - [Business WordPress Template](https://cyberchimps.com/wordpress-themes/business-template/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
58
+ - [Corporate WordPress Template](https://cyberchimps.com/wordpress-themes/corporate-business/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
59
+ - [Help and Documentation WordPress Template](https://cyberchimps.com/wordpress-themes/documentation-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
60
+ - [Mobile app and software WordPress Template](https://cyberchimps.com/wordpress-themes/apppress/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
61
+ - [Question and Answer WordPress Template](https://cyberchimps.com/wordpress-themes/question-and-answer/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
62
+ - [Learning Management System (LMS) WordPress Template](https://cyberchimps.com/wordpress-themes/lms/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
63
+ - [Insurance WordPress Template](https://cyberchimps.com/wordpress-themes/insurance/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
64
 
65
+ **Health & Wellness Website Templates For Responsive Theme**
66
+
67
+ - [Health Coach WordPress Template](https://cyberchimps.com/wordpress-themes/health-coach/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
68
+ - [Gym WordPress Template](https://cyberchimps.com/wordpress-themes/fitness-gym/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
69
+ - [Yoga WordPress Template](https://cyberchimps.com/wordpress-themes/yoga-instructor/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
70
+ - [Spa Center WordPress Template](https://cyberchimps.com/wordpress-themes/spa/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
71
 
 
 
 
72
 
73
  **Local Business Website Templates For Responsive Theme**
74
 
75
+ - [Accountant WordPress Template](https://cyberchimps.com/wordpress-themes/accountant/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
76
+ - [Lawyer WordPress Template](https://cyberchimps.com/wordpress-themes/corporate-lawyer/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
77
+ - [Consulting WordPress Template](https://cyberchimps.com/wordpress-themes/techmo-wordpress-consulting-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
78
+ - [Restaurant WordPress Template](https://cyberchimps.com/wordpress-themes/restaurant/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
79
+ - [Photography WordPress Template](https://cyberchimps.com/wordpress-themes/wordpress-photography-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
80
+ - [Tattoo Studio WordPress Template](https://cyberchimps.com/wordpress-themes/tattoo-studio/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
81
+ - [Barber shop WordPress Template](https://cyberchimps.com/wordpress-themes/barber-shop/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
82
+ - [Doctor WordPress Template](https://cyberchimps.com/wordpress-themes/doctor/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
83
+ - [Dental Clinic WordPress Template](https://cyberchimps.com/wordpress-themes/dental-clinic/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
84
+ - [Travel Agency WordPress Template](https://cyberchimps.com/wordpress-themes/travel-agency/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
85
+ - [Transport and Logistics WordPress Template](https://cyberchimps.com/wordpress-themes/transport/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
86
+ - [Finance Consulting WordPress Template](https://cyberchimps.com/wordpress-themes/finplan-finance-consulting-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
87
+ - [Portfolio for Web developer WordPress Template](https://cyberchimps.com/wordpress-themes/portfolio/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
88
+ - [Kindergarten and Daycare WordPress Template](https://cyberchimps.com/wordpress-themes/tiny-tots-kindergarten-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
89
+ - [School WordPress Template](https://cyberchimps.com/wordpress-themes/edukids-premium-school-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
90
+
91
 
92
  **Real Estate Website Templates For Responsive Theme**
93
 
94
+ - [Construction WordPress Template](https://cyberchimps.com/wordpress-themes/construction/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
95
+ - [Real Estate WordPress Template](https://cyberchimps.com/wordpress-themes/real-estate-pro-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
96
+ - [Interior Decorator WordPress Template](https://cyberchimps.com/wordpress-themes/interior-design-pro-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
97
+ - [Home Decor WordPress Template](https://cyberchimps.com/wordpress-themes/home-decor/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
98
 
99
  **Blogs Templates For Responsive Theme**
100
 
101
+ - [Cooking & Recipe Blog WordPress Template](https://cyberchimps.com/wordpress-themes/food/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
102
+ - [Travel Blog WordPress Template](https://cyberchimps.com/wordpress-themes/travel-blogger/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
103
+ - [Lifestyle Blog WordPress Template](https://cyberchimps.com/wordpress-themes/lifestyle/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
104
+ - [ Personal Podcast WordPress Template](https://cyberchimps.com/wordpress-themes/podcast/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
105
 
106
  **WooCommerce WordPress Templates**
107
 
108
+ - [eCommerce store WordPress template](https://cyberchimps.com/wordpress-themes/ecommerce-fashion/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
109
+ - [ Fashion Shop WordPress Template](https://cyberchimps.com/wordpress-themes/fashion-shop/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
110
+ - [Jewellery WordPress template](https://cyberchimps.com/wordpress-themes/jewellery-shop/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
111
+ - [Pet Shop WordPress Template](https://cyberchimps.com/wordpress-themes/pet-shop/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
112
+ - [Online furniture store WordPress template](https://cyberchimps.com/wordpress-themes/furniture-shop/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
113
+ - [Online Toy Store WordPress template](https://cyberchimps.com/wordpress-themes/toyziez-toy-store-wordpress-theme/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
114
+
115
+ **Others**
116
+
117
+ - [Church WordPress Template](https://cyberchimps.com/wordpress-themes/church/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
118
+ - [Charity WordPress Template](https://cyberchimps.com/wordpress-themes/charity/?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=readysites)
119
+
120
+
121
 
122
  = How to import ready sites? =
123
  Here's how it works:
124
 
125
  [youtube https://www.youtube.com/watch?v=JNeQKg1QJhk&t=2s]
126
 
127
+ == Help Resources==
128
+
129
+ Check out the following help resources to know more about Ready Site importer Plugin:
130
+ [Product Documentation](https://docs.cyberchimps.com/responsive/responsive-sites?utm_source=wordpress-org&utm_medium=responsive-ad-ons&utm_campaign=helpresources)
131
+ [Video Guides](https://youtube.com/playlist?list=PLXTwxw3ZJwPSpE3RYanAdYgnDptbSvjXl)
132
+
133
  == Frequently Asked Questions ==
134
 
135
  = 1. Are all the ready sites free? =
136
+ We have 60+ free and Pro Ready Sites. With Responsive Ready Sites Importer, you will get access to all free sites. To import Pro templates, you will have to install [Responsive Pro](https://cyberchimps.com/pricing/?utm_source=wordpress-org&utm_medium=responsive-add-ons&utm_campaign=responsive-pricing&utm_content=faq-responsive-pro).
137
 
138
  = 2. Will Responsive Ready Sites Importer work on my theme? =
139
  The templates are built with customizer settings of Responsive Theme to provide maximum control to you. Hence, to use Responsive Ready Sites Importer, you will have to install Responsive Theme.
140
 
141
  = 3. Do I need to install any other plugins? =
142
+ Absolutely not! Once you install the plugin, it will take care of all other dependencies. You can sit back and let the importer do the job.
143
 
144
  == Installation ==
145
 
146
+ You can install the Responsive Ready Site Importer plugin using any of the following two methods:
147
+
148
+ **WordPress Admin Dashboard Installation**
149
+
150
+ To install the Responsive Ready Sites Importer Plugin manually from the WordPress admin dashboard:
151
+
152
+ 1.Download the latest Responsive Ready Sites Importer plugin.
153
+ 2. Login to your WordPress Dashboard
154
+ 3. Go to Plugins > Add New
155
+ 4. Upload the downloaded plugin zip file
156
+ 5. Install and activate it
157
+
158
+ **FTP Installation**
159
+ To install the Responsive Ready Sites Importer Plugin via FTP:
160
+ 1. Download Responsive Ready Sites Importer zip
161
+ 2. Unzip the Responsive Ready Sites Importer zip file
162
+ 3. Open your WordPress site via FTP. We would recommend you to use FileZilla
163
+ 4. From FTP, visit the root of the WordPress install
164
+ 5. Now visit wp-content folder > plugins
165
+ 6. Upload Responsive Ready Sites Importer unzipped folder from step 2
166
+
167
+ **How to use the plugin?**
168
+ After installing the plugin, you can import the ready to use website templates using the following steps:
169
+ 1. On your WordPress Dashboard, click on Responsive > Ready Sites to see all ready sites.2.
170
+ 2. Filter the templates based on niche or website builder.
171
  3. Preview & click on Import site to import the site.
172
+ 4. You can also choose to import a template, instead of the whole site.
173
+ 5. You can import any of the free templates using the Ready Site Importer Plugin.
174
+ 6. For importing the premium templates you need to install the Responsive Pro plugin that can be purchased from [CyberChimps Website](https://cyberchimps.com/pricing/?utm_source=wordpress-org&utm_medium=responsive-add-ons&utm_campaign=responsive-pricing&utm_content=faq-responsive-pro)
175
+ 7. With the Pro version you will get Premium templates, Priority support and automatic updates to Pro plugin.
176
+
177
 
178
  == Screenshots ==
179
 
180
+ 1. Go to Responsive > Ready Sites to see all ready sites.
181
  2. Preview & click on Import site to import.
182
  3. You will be able to see the import process
183
  4. Your website is ready
184
 
185
  == Changelog ==
186
+ = 2.5.0 - 15th April 2021 =
187
+ * Feature - Added filters on ready sites grid page to filter the ready sites based on page builder and categories
188
+ * Feature - Search box on the ready sites grid page to search for the ready sites
189
+
190
  = 2.4.3 - 30th December 2020 =
191
  * Feature - Prompt user to install the third party plugins
192
  * Feature - Get user consent before deleting previous imported ready site
330
  * Bug fixes
331
 
332
  = 1.0.0 =
333
+ * Initial set up and release
334
+ readme.txt
335
+ Displaying readme.txt.
336
+
responsive-add-ons.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Responsive Ready Sites Importer
4
  * Plugin URI: http://wordpress.org/plugins/responsive-add-ons/
5
  * Description: Import Responsive Ready Sites that help you launch your website quickly. Just import, update & hit the launch button.
6
- * Version: 2.4.3
7
  * Author: CyberChimps
8
  * License: GPL2
9
  *
@@ -45,7 +45,7 @@ if ( ! defined( 'RESPONSIVE_ADDONS_URI' ) ) {
45
  }
46
 
47
  if ( ! defined( 'RESPONSIVE_ADDONS_VER' ) ) {
48
- define( 'RESPONSIVE_ADDONS_VER', '2.4.3' );
49
  }
50
 
51
  if ( ! function_exists( 'ra_fs' ) ) {
@@ -65,7 +65,7 @@ if ( ! function_exists( 'ra_fs' ) ) {
65
  'slug' => 'responsive-add-ons',
66
  'product_name' => 'Responsive Ready Sites Importer',
67
  'module_type' => 'plugin',
68
- 'version' => '2.4.3',
69
  'plugin_basename' => 'responsive-add-ons/responsive-add-ons.php',
70
  'plugin_url' => RESPONSIVE_ADDONS_DIR_URL,
71
  )
3
  * Plugin Name: Responsive Ready Sites Importer
4
  * Plugin URI: http://wordpress.org/plugins/responsive-add-ons/
5
  * Description: Import Responsive Ready Sites that help you launch your website quickly. Just import, update & hit the launch button.
6
+ * Version: 2.5.0
7
  * Author: CyberChimps
8
  * License: GPL2
9
  *
45
  }
46
 
47
  if ( ! defined( 'RESPONSIVE_ADDONS_VER' ) ) {
48
+ define( 'RESPONSIVE_ADDONS_VER', '2.5.0' );
49
  }
50
 
51
  if ( ! function_exists( 'ra_fs' ) ) {
65
  'slug' => 'responsive-add-ons',
66
  'product_name' => 'Responsive Ready Sites Importer',
67
  'module_type' => 'plugin',
68
+ 'version' => '2.5.0',
69
  'plugin_basename' => 'responsive-add-ons/responsive-add-ons.php',
70
  'plugin_url' => RESPONSIVE_ADDONS_DIR_URL,
71
  )