Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager - Version 2.5.1

Version Description

Sort your folders based on name and creation date. We've also added some usability improvements, fixed some WPML and Polylang issue, and fixed some bugs

Download this release

Release Info

Developer galdub
Plugin Icon wp plugin Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager
Version 2.5.1
Comparing to
See all releases

Code changes from version 2.5 to 2.5.1

assets/css/design.css CHANGED
@@ -14,7 +14,6 @@
14
  margin: 0;
15
  padding: 0;
16
  top: 0;
17
- margin-top: 0;
18
  max-height: 100% !important;
19
  width: 100%;
20
  border-radius: 2px;
@@ -37,12 +36,10 @@
37
  border: 0;
38
  margin: 0;
39
  padding: 0;
40
- padding-top: 0;
41
  height: 30px;
42
  width: 200px;
43
  text-indent: 30px;
44
  background: 0 0;
45
- border-radius: 0;
46
  box-shadow: none;
47
  font-size: 14px;
48
  line-height: 26px;
@@ -100,7 +97,7 @@ li.active > span > i.fa-folder:before {
100
  top: 32px;
101
  left: 160px;
102
  bottom: 0;
103
- width: 305px;
104
  box-sizing: border-box;
105
  z-index: 1;
106
  direction: ltr;
@@ -120,7 +117,7 @@ html[dir=rtl] body.folded .wcp-content {
120
  right: 36px
121
  }
122
  body.wp-admin #wpcontent {
123
- padding-left: 310px;
124
  transition: all .15s linear;
125
  -webkit-transition: all .15s linear;
126
  -moz-transition: all .15s linear
@@ -323,18 +320,18 @@ body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon i, body:not(
323
  margin: 0;
324
  padding: 0
325
  }
326
- .form-options li {
327
  display: inline-block;
328
- margin: 0 5px 0 0;
329
  vertical-align: top
330
  }
331
- .form-options li.last {
332
  margin: 0
333
  }
334
- .form-options li a {
335
  display: inline-block;
336
  text-decoration: none;
337
- padding: 5px 10px;
338
  color: #000;
339
  background: #ccc;
340
  box-shadow: 0 1px 0 #ccc;
@@ -343,17 +340,17 @@ body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon i, body:not(
343
  border-radius: 3px;
344
  margin: 0 0 12px 0
345
  }
346
- .form-options li.last a {
347
  padding: 3px
348
  }
349
- .form-options li.last a span.icon {
350
  font-size: 28px;
351
  line-height: 22px
352
  }
353
  a#expand-collapse-list.all-open span:before {
354
  content: "\e911"
355
  }
356
- .form-options li a:hover {
357
  background: #404040;
358
  color: #fff;
359
  border: solid 1px #404040
@@ -552,6 +549,12 @@ li.active-menu {
552
  .wp-list-table th {
553
  width: auto !important
554
  }
 
 
 
 
 
 
555
  .wp-list-table #wcp_move {
556
  width: 20px !important
557
  }
@@ -1158,7 +1161,7 @@ span.media-info-message.active {
1158
  .wp-core-ui .button-primary.select-all-item-btn.active {
1159
  display: inline-block !important
1160
  }
1161
- .form-options li.last.folder-checkbox {
1162
  padding: 8px 0 0 6px
1163
  }
1164
  #custom-menu input.checkbox {
@@ -1176,9 +1179,9 @@ span.media-info-message.active {
1176
  -webkit-transform: rotate(0);
1177
  transform: rotate(0)
1178
  } 100% {
1179
- -webkit-transform: rotate(359deg);
1180
- transform: rotate(359deg)
1181
- }}
1182
  .folder-form-buttons a:focus, .folder-form-buttons a:hover, .folder-form-buttons button:focus, .folder-form-buttons button:hover {
1183
  color: #fff;
1184
  background-image: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1))
@@ -1252,68 +1255,68 @@ span.folder-loader-ajax {
1252
  -webkit-transform: scale(1.5);
1253
  transform: scale(1.5)
1254
  } 100% {
1255
- opacity: 1;
1256
- -webkit-transform: scale(1);
1257
- transform: scale(1)
1258
- }}
1259
  @keyframes scaleAnimation {
1260
  0% {
1261
  opacity: 0;
1262
  -webkit-transform: scale(1.5);
1263
  transform: scale(1.5)
1264
  } 100% {
1265
- opacity: 1;
1266
- -webkit-transform: scale(1);
1267
- transform: scale(1)
1268
- }}
1269
  @-webkit-keyframes drawCircle {
1270
  0% {
1271
  stroke-dashoffset: 151px
1272
  } 100% {
1273
- stroke-dashoffset: 0
1274
- }}
1275
  @keyframes drawCircle {
1276
  0% {
1277
  stroke-dashoffset: 151px
1278
  } 100% {
1279
- stroke-dashoffset: 0
1280
- }}
1281
  @-webkit-keyframes drawCheck {
1282
  0% {
1283
  stroke-dashoffset: 36px
1284
  } 100% {
1285
- stroke-dashoffset: 0
1286
- }}
1287
  @keyframes drawCheck {
1288
  0% {
1289
  stroke-dashoffset: 36px
1290
  } 100% {
1291
- stroke-dashoffset: 0
1292
- }}
1293
  @-webkit-keyframes fadeOut {
1294
  0% {
1295
  opacity: 1
1296
  } 100% {
1297
- opacity: 0
1298
- }}
1299
  @keyframes fadeOut {
1300
  0% {
1301
  opacity: 1
1302
  } 100% {
1303
- opacity: 0
1304
- }}
1305
  @-webkit-keyframes fadeIn {
1306
  0% {
1307
  opacity: 0
1308
  } 100% {
1309
- opacity: 1
1310
- }}
1311
  @keyframes fadeIn {
1312
  0% {
1313
  opacity: 0
1314
  } 100% {
1315
- opacity: 1
1316
- }}
1317
  #successAnimationCircle {
1318
  stroke-dasharray: 151px 151px;
1319
  stroke: #2ce0a7
@@ -1436,8 +1439,8 @@ select#media-attachment-taxonomy-filter {
1436
  0% {
1437
  background-position: 0 0
1438
  } 100% {
1439
- background-position: 50px 50px
1440
- }}
1441
  .orange-bg > span {
1442
  background-color: #ff5983
1443
  }
@@ -1543,6 +1546,69 @@ span.folder-count:empty {
1543
  filter: invert(0%);
1544
  -webkit-filter: invert(0%);
1545
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1546
  @media screen and (max-width: 960px) {
1547
  .wcp-content {
1548
  left: 36px
14
  margin: 0;
15
  padding: 0;
16
  top: 0;
 
17
  max-height: 100% !important;
18
  width: 100%;
19
  border-radius: 2px;
36
  border: 0;
37
  margin: 0;
38
  padding: 0;
 
39
  height: 30px;
40
  width: 200px;
41
  text-indent: 30px;
42
  background: 0 0;
 
43
  box-shadow: none;
44
  font-size: 14px;
45
  line-height: 26px;
97
  top: 32px;
98
  left: 160px;
99
  bottom: 0;
100
+ width: 315px;
101
  box-sizing: border-box;
102
  z-index: 1;
103
  direction: ltr;
117
  right: 36px
118
  }
119
  body.wp-admin #wpcontent {
120
+ padding-left: 335px;
121
  transition: all .15s linear;
122
  -webkit-transition: all .15s linear;
123
  -moz-transition: all .15s linear
320
  margin: 0;
321
  padding: 0
322
  }
323
+ .form-options > ul > li {
324
  display: inline-block;
325
+ margin: 0 2px 0 0;
326
  vertical-align: top
327
  }
328
+ .form-options > ul > li.last {
329
  margin: 0
330
  }
331
+ .form-options > ul > li > a {
332
  display: inline-block;
333
  text-decoration: none;
334
+ padding: 5px 5px;
335
  color: #000;
336
  background: #ccc;
337
  box-shadow: 0 1px 0 #ccc;
340
  border-radius: 3px;
341
  margin: 0 0 12px 0
342
  }
343
+ .form-options > ul > li.last > a {
344
  padding: 3px
345
  }
346
+ .form-options > ul > li.last > a span.icon {
347
  font-size: 28px;
348
  line-height: 22px
349
  }
350
  a#expand-collapse-list.all-open span:before {
351
  content: "\e911"
352
  }
353
+ .form-options > ul > li > a:hover {
354
  background: #404040;
355
  color: #fff;
356
  border: solid 1px #404040
549
  .wp-list-table th {
550
  width: auto !important
551
  }
552
+ .wp-list-table th.column-title {
553
+ width: 35% !important;
554
+ }
555
+ .fixed .column-author, .fixed .column-date, .fixed .column-format, .fixed .column-links, .fixed .column-parent, .fixed .column-posts {
556
+ width: 10% !important;
557
+ }
558
  .wp-list-table #wcp_move {
559
  width: 20px !important
560
  }
1161
  .wp-core-ui .button-primary.select-all-item-btn.active {
1162
  display: inline-block !important
1163
  }
1164
+ .form-options > ul > li.last.folder-checkbox {
1165
  padding: 8px 0 0 6px
1166
  }
1167
  #custom-menu input.checkbox {
1179
  -webkit-transform: rotate(0);
1180
  transform: rotate(0)
1181
  } 100% {
1182
+ -webkit-transform: rotate(359deg);
1183
+ transform: rotate(359deg)
1184
+ }}
1185
  .folder-form-buttons a:focus, .folder-form-buttons a:hover, .folder-form-buttons button:focus, .folder-form-buttons button:hover {
1186
  color: #fff;
1187
  background-image: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1))
1255
  -webkit-transform: scale(1.5);
1256
  transform: scale(1.5)
1257
  } 100% {
1258
+ opacity: 1;
1259
+ -webkit-transform: scale(1);
1260
+ transform: scale(1)
1261
+ }}
1262
  @keyframes scaleAnimation {
1263
  0% {
1264
  opacity: 0;
1265
  -webkit-transform: scale(1.5);
1266
  transform: scale(1.5)
1267
  } 100% {
1268
+ opacity: 1;
1269
+ -webkit-transform: scale(1);
1270
+ transform: scale(1)
1271
+ }}
1272
  @-webkit-keyframes drawCircle {
1273
  0% {
1274
  stroke-dashoffset: 151px
1275
  } 100% {
1276
+ stroke-dashoffset: 0
1277
+ }}
1278
  @keyframes drawCircle {
1279
  0% {
1280
  stroke-dashoffset: 151px
1281
  } 100% {
1282
+ stroke-dashoffset: 0
1283
+ }}
1284
  @-webkit-keyframes drawCheck {
1285
  0% {
1286
  stroke-dashoffset: 36px
1287
  } 100% {
1288
+ stroke-dashoffset: 0
1289
+ }}
1290
  @keyframes drawCheck {
1291
  0% {
1292
  stroke-dashoffset: 36px
1293
  } 100% {
1294
+ stroke-dashoffset: 0
1295
+ }}
1296
  @-webkit-keyframes fadeOut {
1297
  0% {
1298
  opacity: 1
1299
  } 100% {
1300
+ opacity: 0
1301
+ }}
1302
  @keyframes fadeOut {
1303
  0% {
1304
  opacity: 1
1305
  } 100% {
1306
+ opacity: 0
1307
+ }}
1308
  @-webkit-keyframes fadeIn {
1309
  0% {
1310
  opacity: 0
1311
  } 100% {
1312
+ opacity: 1
1313
+ }}
1314
  @keyframes fadeIn {
1315
  0% {
1316
  opacity: 0
1317
  } 100% {
1318
+ opacity: 1
1319
+ }}
1320
  #successAnimationCircle {
1321
  stroke-dasharray: 151px 151px;
1322
  stroke: #2ce0a7
1439
  0% {
1440
  background-position: 0 0
1441
  } 100% {
1442
+ background-position: 50px 50px
1443
+ }}
1444
  .orange-bg > span {
1445
  background-color: #ff5983
1446
  }
1546
  filter: invert(0%);
1547
  -webkit-filter: invert(0%);
1548
  }
1549
+ .form-options > ul > li.last > a.sort-folder-order {
1550
+ width: 32px;
1551
+ height: 30px;
1552
+ padding: 7px;
1553
+ text-align: center;
1554
+ display: inline-block;
1555
+ box-sizing: border-box;
1556
+ }
1557
+ .sort-folder-order svg {
1558
+ width: 100%;
1559
+ height: 100%;
1560
+ fill: #000;
1561
+ }
1562
+ .sort-folder-order:hover svg {
1563
+ fill: #ffffff;
1564
+ }
1565
+ .folder-order {
1566
+ position: relative;
1567
+ }
1568
+ .folder-sort-menu {
1569
+ position: absolute;
1570
+ right: 0;
1571
+ width: 120px;
1572
+ z-index: 101;
1573
+ background: #fff;
1574
+ -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
1575
+ -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
1576
+ box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
1577
+ display: none;
1578
+ }
1579
+ .folder-order.active .folder-sort-menu {
1580
+ display: block;
1581
+ }
1582
+ .folder-order.active .sort-folder-order {
1583
+ background: #404040;
1584
+ color: #fff;
1585
+ border: solid 1px #404040;
1586
+ }
1587
+ .folder-order.active .sort-folder-order svg {
1588
+ fill: #fff;
1589
+ }
1590
+ .folder-sort-menu li {
1591
+ display: block;
1592
+ margin: 0;
1593
+ padding: 0;
1594
+ background: transparent;
1595
+ }
1596
+ .folder-sort-menu li a {
1597
+ display: block;
1598
+ margin: 0;
1599
+ padding: 3px 5px;
1600
+ background: transparent;
1601
+ color: #848484;
1602
+ text-decoration: none;
1603
+ font-size: 14px;
1604
+ }
1605
+ .folder-sort-menu li a:hover, .folder-sort-menu li a.active {
1606
+ background: #efefef;
1607
+ color: #000;
1608
+ }
1609
+ .dynamic-menu.bottom-fix {
1610
+ bottom: 0;
1611
+ }
1612
  @media screen and (max-width: 960px) {
1613
  .wcp-content {
1614
  left: 36px
assets/css/design.min.css CHANGED
@@ -1 +1 @@
1
- .wcp-custom-menu{padding-left:0}.wcp-custom-menu{position:relative}.wcp-container ul{list-style:none}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;margin-top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;padding-top:0;height:30px;width:200px;text-indent:30px;background:0 0;border-radius:0;box-shadow:none;font-size:14px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden}.wcp-container .first-title{margin-left:10px}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:10px;top:10px}i.fa-caret-right{transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}li.active>span>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}li.active>span>i.fa-folder:before{content:"\f07c"}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}.nav-icon{display:none;left:-20px!important}.has-sub-tree>.nav-icon{display:block}.wcp-content{position:fixed!important;top:32px;left:160px;bottom:0;width:305px;box-sizing:border-box;z-index:1;direction:ltr;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] .wcp-content{left:auto;right:160px}body.folded .wcp-content{left:36px}html[dir=rtl] body.folded .wcp-content{left:auto;right:36px}body.wp-admin #wpcontent{padding-left:310px;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] body.wp-admin #wpcontent{padding-left:0;padding-right:320px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.form-operations{border:solid 1px #e5e5e5;border-right:none;margin-bottom:20px}.form-operations ul{margin:0;padding:0}.form-operations li{display:block;float:left;width:20%;text-align:center;background:#fff;margin:0;padding:0}.form-operations li a{display:block;padding:10px 0;border-right:solid 1px #e5e5e5;font-size:16px;color:#727272}.clearfix{clear:both}.wcp-parent-data{position:relative}.wcp-parent{position:absolute;left:-21px;font-weight:700;font-size:14px}.wcp-parent .fa{font-size:18px;margin-right:8px}.wcp-form-data{background:#fff;border:solid 1px #f1f1f1;padding:15px;display:none;margin-bottom:20px}.wcp-form-title{color:#727272;font-size:14px;text-transform:uppercase;padding:0 0 10px 0}.wcp-form-data .form-field{padding:0 0 10px 0}.wcp-form-data .form-field input,.wcp-form-data .form-field select{width:100%}button#wcp-save-folder{float:right}.wcp-form-message span{display:block;padding:5px 10px;background:#ffabab;margin-bottom:10px;color:#000;border:solid 1px #8c0000;border-radius:4px}.wcp-container .route.active-item>h3.title{background:#008ec2;color:#fff;border-radius:4px}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}.route.active-item>span.ui-icon{background:#008ec2;color:#fff}#custom-menu.active>ul>li.route{display:block}.wcp-parent.active>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.wcp-parent.active>i.fa-folder:before{content:"\f07c"}.wcp-container .route .title img{display:none;width:14px;height:14px;margin:5px auto 0}.wcp-container .route .title:hover{background:#dfdfdf;cursor:pointer}.wcp-container .route .title.wcp-drop-hover img.move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover img.move-folder-icon{display:block}.wcp-container .route .title.wcp-drop-hover .ui-icon i,.wcp-container .route .title.wcp-drop-hover .ui-icon img.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon i,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon img.folder-sticky-icon{display:none}.route.is-sticky>h3.title>.ui-icon>.folder-sticky-icon{display:block;width:100%;height:auto;margin:3px auto 0}.route.is-sticky.active-item>h3.title>.ui-icon>.folder-sticky-icon{filter:invert(100%);-webkit-filter:invert(100%)}.route.is-sticky>h3.title>.ui-icon>i{display:none}.wcp-container .route .title.wcp-drop-hover img{filter:invert(100%);-webkit-filter:invert(100%)}.add-new-folder{text-decoration:none;display:block;float:right;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:24px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}.add-new-folder:focus,.add-new-folder:hover{color:#fff}.add-new-folder:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.add-new-folder span{display:block;float:left;line-height:20px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:10px 0 0 10px;margin:0 0}.form-options ul{margin:0;padding:0}.form-options li{display:inline-block;margin:0 5px 0 0;vertical-align:top}.form-options li.last{margin:0}.form-options li a{display:inline-block;text-decoration:none;padding:5px 10px;color:#000;background:#ccc;box-shadow:0 1px 0 #ccc;vertical-align:middle;border:solid 1px #ccc;border-radius:3px;margin:0 0 12px 0}.form-options li.last a{padding:3px}.form-options li.last a span.icon{font-size:28px;line-height:22px}a#expand-collapse-list.all-open span:before{content:"\e911"}.form-options li a:hover{background:#404040;color:#fff;border:solid 1px #404040}.form-options span.icon{font-size:18px;display:inline-block;vertical-align:top}.un-categorised-items{border-radius:3px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;border-radius:3px;display:block;text-decoration:none;font-size:14px;line-height:18px}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:#dfdfdf;border-radius:3px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2!important;color:#fff!important}.un-categorised-items.active-item a{color:#fff!important}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#444!important}span.total-count{float:right;background:#fff;padding:0 5px;border:solid 1px #ccc;font-size:10px;line-height:16px;border-radius:2px}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}#custom-menu .wcp-icon{font-size:20px;line-height:24px}.route.active>.nav-icon>.folder-icon-arrow_right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.route.active>.ui-icon>.folder-icon-folder:before{content:"\e90c"}.wcp-container .route span.total-count{position:relative;font-size:8px;float:right;text-align:center;width:auto;background:#fff;display:block;margin:4px 3px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.dynamic-menu{position:absolute;left:50px;background:#fff;width:170px;padding:0;z-index:101;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.sticky-folders .dynamic-menu{left:auto;right:50px}.dynamic-menu li{position:relative;width:100%;display:inline-block!important;padding:2px 0;margin:0}.dynamic-menu a{text-decoration:none;color:#848484;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:top;margin-right:5px;top:0!important}.dynamic-menu ul>li>a>span span{top:auto;height:auto;width:auto;margin:0;left:auto;vertical-align:baseline;display:inline}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.dynamic-menu ul li span{font-size:20px;vertical-align:middle}.dynamic-menu ul li span.sticky-folder-icon{width:20px}.wcp-form-input{padding-left:35px;box-sizing:border-box;position:relative}.wcp-form-input input{width:100%}.wcp-form-btn{padding:4px 0 4px 2px}.wcp-form-input:before{content:"\e90d";font-family:folder-icon!important;speak:none;position:absolute;left:0;font-size:28px;top:5px}.add-new-folder-btn{margin-right:5px!important}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.route.is-high>.ui-icon>i:before{content:"\e900"!important}.route.is-high.active>.ui-icon>i:before{content:"\e90c"!important;z-index:11;color:#444;font-size:20px}.route.is-high.active>.ui-icon>i:after{content:"\e907";margin-left:-1.2em;color:#444;font-size:11px;top:1px;position:absolute}.route.is-high.active.active-item>.ui-icon>i:after,.route.is-high.active.active-item>.ui-icon>i:before{color:#fff}li.active-menu{z-index:2!important}.wp-list-table th{width:auto!important}.wp-list-table #wcp_move{width:20px!important}td.wcp_move.column-wcp_move{vertical-align:middle}.wp-list-table tr td .wcp-move-file{vertical-align:middle;opacity:0}.wp-list-table td.wcp_move.column-wcp_move.wcp-draggable,.wp-list-table tr:hover td .wcp-move-file{opacity:1}.wcp-drop-hover{background:#0073aa!important;z-index:2!important;color:#fff!important}.wcp-drop-hover span{color:#fff!important}.ui-draggable-dragging{z-index:1051!important}.wcp-hover-list{background:#008ec2!important;color:#fff;position:relative}.wcp-hover-list a{color:#fff}.wcp-hover-list span.total-count{color:#000}span.wcp-item{display:none}.wcp-move-file{cursor:move}.wcp-drop-hover-list a.folder-view{background:#008ec2;color:#fff;border:solid 1px #fff;position:relative}.tree-structure .folder-view{display:block;border:1px solid #dadce0;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#fff}.tree-structure .folder-view:hover{background:#008ec2;color:#fff}.wcp-drop-hover-list a.folder-view:before{width:100%;height:100%;content:"";position:absolute;top:-2px;left:-2px;border:solid 1px #008ec2;padding:1px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.ui-draggable-dragging.wcp-move-file{z-index:5001;display:inline-block;border:solid 2px #0073aa;padding:5px 10px;border-radius:5px;background:#e4f6ff;z-index:2001;position:fixed!important;max-width:230px;overflow:hidden;width:auto!important}.ui-draggable-dragging.wcp-move-file span{display:block;float:left}.ui-draggable-dragging.wcp-move-file span.wcp-move{margin-right:5px;display:block;float:left}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 80px);overflow:hidden;white-space:nowrap}.ui-resizable-handle.ui-resizable-e{position:absolute;top:0;height:100%;height:100vh;width:1px;right:0;border-right:1px solid #ccc;cursor:col-resize}.ui-resizable-handle.ui-resizable-e:before,.ui-resizable-handle.ui-resizable-w:before{content:"";top:68px;width:3px;height:53px;position:absolute;border-left:solid 1px #ccc;border-right:solid 1px #ccc;left:-1px}.ui-resizable-handle.ui-resizable-w{position:absolute;top:0;height:100%;height:100vh;width:1px;left:0;border-right:1px solid #ccc;cursor:col-resize}div#custom-menu{padding-bottom:150px;padding-left:4px}.sticky-folders li a span.star-icon,.wcp-container .route span.star-icon{position:relative;top:2px;left:auto;float:right;font-family:folder-icon!important;speak:none;color:#ffc90e;display:none;font-size:20px;font-weight:700}.sticky-folders li a span.update-inline-record,.wcp-container .route span.update-inline-record{position:relative;left:auto;top:2px;float:right;width:0;height:22px;font-family:folder-icon!important;font-size:16px;overflow:hidden;transition:all .25s linear;-webkit-transition:all .25s linear;-moz-transition:all .25s linear}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}.sticky-folders li a:hover .folder-count{margin:0 3px 0 0}.sticky-folders li a span.update-inline-record:after,.wcp-container .route span.update-inline-record:after{content:"\e910"}.sticky-folders li.is-high a span.star-icon,.wcp-container .route.is-high>h3>span.star-icon{display:block}.sticky-folders li a span.star-icon:after,.wcp-container .route span.star-icon:after{content:"\e907"}.tree-structure li{display:block;width:auto;float:left;margin:0;padding:0}.tree-structure .folder-item{padding:8px;position:relative}.tree-structure .folder-view{display:block;border:1px solid #dadce0;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#fff}.tree-structure .folder-view span.item-name{display:block;padding:10px 25px 10px 50px;position:relative;width:100%;overflow:hidden;height:38px;font-size:16px;box-sizing:border-box}.folder-view span.item-name:before{content:"\e90d";font-family:folder-icon!important;position:absolute;left:15px;font-size:24px}.folder-view.is-high span.item-name:before{content:"\e900"}.folder-view.is-post span.item-name:before{content:"\e901"}.tree-structure span.folder-option{position:absolute;right:0;font-family:folder-icon!important;top:0;font-size:20px;line-height:38px;z-index:1;cursor:pointer;display:none}.tree-structure .folder-view:hover span.folder-option{display:block}.tree-structure span.folder-option:hover{color:#f51366}.tree-structure span.folder-option:after{content:"\e90a"}.tree-structure li{position:relative}.tree-structure{margin-left:-8px;margin-right:-8px}.tree-structure .folder-view span.folder-title{overflow:hidden;width:100%;height:18px;display:block}.swal2-popup .swal2-title{line-height:36px}.attachments-browser.ui-draggable-dragging .media-sidebar,.attachments-browser.ui-draggable-dragging .media-toolbar,.attachments-browser.ui-draggable-dragging .uploader-inline,.attachments-browser.ui-draggable-dragging ul.attachments{display:none}.attachments.ui-sortable.ui-draggable-dragging{z-index:5000}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{width:2px!important;background-color:#0073aa!important;background-color:rgba(0,115,170,.6)!important;box-shadow:none!important}.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#0073aa!important}.mCSB_outside+.mCSB_scrollTools{right:-15px!important}body.upload-php.eml-grid #wpbody{position:relative!important;top:0!important;bottom:auto!important;left:auto!important;right:auto!important;height:auto}#footer-thankyou{display:none}span.upgrade-message{padding:0 0 10px;background:#fff;display:inline-block;font-size:14px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.media-toolbar.sticky-media{position:fixed;top:32px;right:18px!important;left:auto}.media-position{width:1px;height:1px}.media-frame.mode-grid .media-toolbar{margin:0!important}.button-disabled{cursor:no-drop;pointer-events:none}.wcp-hide-show-buttons{position:absolute;top:25px;right:-20px;z-index:10001}html[dir=rtl] .wcp-hide-show-buttons{left:-20px;right:auto}.wcp-hide-show-buttons .toggle-buttons{background:#f51366;color:#fff;display:inline-block;margin:0;padding:0;float:left;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%;display:none;width:20px;height:20px;cursor:pointer;position:relative}.wcp-hide-show-buttons:hover .toggle-buttons:after{content:"";width:100%;height:100%;background:0 0;position:absolute;top:0;left:0;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-top-left-radius:50%;-webkit-border-bottom-left-radius:50%;-moz-border-radius-top-left:50%;-moz-border-radius-bottom-left:50%;border-top-left-radius:50%;border-bottom-left-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.hide-folders-area .wcp-content{width:0!important}.hide-folders-area .wcp-container{display:none}.wcp-hide-show-buttons .toggle-buttons.active{display:block}#wcp-content.no-transition .wcp-container{display:none}button.button.organize-button{vertical-align:middle;text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:14px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}button.button.organize-button:focus,button.button.organize-button:hover{color:#fff}button.button.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.tree-structure-content ul{margin:0;padding:0}.tree-structure-content{padding:10px 20px 10px;background:#fff;margin:10px 0 15px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border:solid 1px #ccc}.tree-structure-content .tree-structure{height:55px;overflow:hidden;transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}.tree-structure-content.active .tree-structure{height:auto}.folders-toggle-button{height:15px;text-align:center;position:relative}.folders-toggle-button span{background:#f51366;color:#fff;height:20px;width:30px;text-align:center;display:block;margin:0 auto;position:absolute;left:0;right:0;bottom:-10px;cursor:pointer;font-family:dashicons;font-size:20px;line-height:20px}.folders-toggle-button span:after{content:"\f347"}.tree-structure-content.active .folders-toggle-button span:after{content:"\f343"}span.media-info-message{vertical-align:middle;line-height:20px;font-weight:700;color:#f51366;padding:0 0 10px 0;display:none!important}span.media-info-message.active{display:block!important}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.folder-popup-form.disabled{pointer-events:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.folder-form-buttons a,.folder-form-buttons button{display:inline-block;padding:10px 20px;text-decoration:none;margin:10px 3px;font-size:18px;line-height:22px;border-radius:.25em;color:#fff;border:none}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear}[data-tooltip]{position:relative}[data-tooltip]::after,[data-tooltip]::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}[data-tooltip]::before{content:'';border:5px solid transparent;z-index:1001}[data-tooltip]::after{content:attr(data-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}[data-tooltip]:hover::after,[data-tooltip]:hover::before{display:block;opacity:1}[data-tooltip]:not([flow])::before,[data-tooltip][flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}[data-tooltip]:not([flow])::after,[data-tooltip][flow^=up]::after{bottom:calc(100% + 5px)}[data-tooltip]:not([flow])::after,[data-tooltip]:not([flow])::before,[data-tooltip][flow^=up]::after,[data-tooltip][flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}#remove-folder-item{width:126px!important}.wp-core-ui .button-primary.select-all-item-btn{margin:11px 11px 11px 0;display:none!important}.wp-core-ui .button-primary.select-all-item-btn.active{display:inline-block!important}.form-options li.last.folder-checkbox{padding:8px 0 0 6px}#custom-menu input.checkbox{display:none}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a:focus,.folder-form-buttons a:hover,.folder-form-buttons button:focus,.folder-form-buttons button:hover{color:#fff;background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.folder-form-buttons a:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.form-cancel-btn{background-color:#aaa}.form-submit-btn{background-color:#3085d6}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;line-height:30px}.folder-form-input input{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box;height:2.625em;padding:0 .75em;margin:1em auto}.folder-form-message{font-size:16px;line-height:20px;margin:25px 0}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-errors.active{display:block}.sticky-menu #adminmenuwrap{position:relative!important}span.folder-loader-ajax{float:right;margin:0 8px 0 0;line-height:30px;display:none}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:34px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}.folder-loader-ajax img.active{display:inline-block}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.mCSB_scrollTools a+.mCSB_draggerContainer{margin:10px 0!important}.popup-folder-title{font-weight:700;font-size:24px;padding:0 0 20px 0}.select-box{padding:20px 0 10px 0}.select-box select{width:100%;max-width:300px}.actions #media_folder,select.media-select-folder{width:132px}select#media-attachment-taxonomy-filter{width:132px}.custom-media-select{float:right;padding:10px 0 0 0;display:none}.custom-media-select.active{display:block}.folder-progress{background:#b4b9be;border-radius:4px;margin:5px 0 0 0;position:relative}.folder-meter{height:20px;position:relative;background:#f1f1f1;padding:0;width:0%;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.folder-meter>span{display:block;height:100%;-webkit-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);-moz-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);position:relative;overflow:hidden;border-radius:4px}.folder-animate>span>span,.folder-meter>span:after,.folder-progress:after{content:"";position:absolute;border-radius:4px;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:50px 50px;-moz-background-size:50px 50px;-webkit-animation:move 2s linear infinite;overflow:hidden}.folder-animate>span:after{display:none}@-webkit-keyframes move{0%{background-position:0 0}100%{background-position:50px 50px}}.orange-bg>span{background-color:#ff5983}.media-folder-loader{padding:10px 0 15px;display:none}.media-folder-loader>span{font-weight:700}.sticky-folders{display:none;padding:0 0 5px;margin:0 0 5px;border-bottom:solid 1px #ccc}.top-settings{padding:0 0 5px;margin:0 0 5px;border-bottom:solid 1px #ccc}.sticky-folders.active{display:block}.sticky-folders ul{margin:0;padding:0}.sticky-folders>ul>li{display:block;margin:0;padding:0}.sticky-folders>ul>li>a{display:block;color:#444;padding:7px;border-radius:3px;text-decoration:none;font-size:16px;line-height:18px}.sticky-folders ul li a.active,.sticky-folders ul li a:hover{background:#dfdfdf;border-radius:3px}.sticky-folders ul li a.active-item{background-color:#008ec2!important;color:#fff}.sticky-folders ul li a.active-item img{filter:invert(100%);-webkit-filter:invert(100%)}.sticky-folders ul li a span{display:inline-block;vertical-align:middle;line-height:18px}.sticky-folders ul li a span.sticky-icon{width:18px;height:18px;margin-right:3px}.sticky-folders ul li a span.sticky-icon img{width:100%;height:100%}.sticky-wcp-custom-form a:focus{box-shadow:none;outline:0}span.folder-count{float:right;background:#fff;padding:0 5px;border:solid 1px #ccc;font-size:10px;line-height:16px;border-radius:2px;color:#444!important}span.folder-count:empty{display:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}.sticky-title img{display:inline-block;vertical-align:middle;height:20px;width:20px}.sticky-folder-icon img{width:100%;filter:invert(50%);-webkit-filter:invert(50%)}.dynamic-menu .sticky-folder:hover img{filter:invert(0);-webkit-filter:invert(0)}@media screen and (max-width:960px){.wcp-content{left:36px}html[dir=rtl] .wcp-content{right:36px;left:auto}}@media screen and (max-width:780px){.wcp-content{left:0}html[dir=rtl] .wcp-content{right:0}}@media screen and (max-width:640px){.wcp-content{left:0;position:relative!important;width:100%!important;padding-bottom:100px;top:0;right:0;display:block}.ui-resizable-handle.ui-resizable-e{display:none!important}.hide-folders-area .wcp-container{display:block}.wcp-hide-show-buttons{display:none}.hide-folders-area .wcp-content{width:100%!important}body.wp-admin #wpcontent{padding:0!important}#wpbody-content{padding-bottom:30px}}
1
+ .wcp-custom-menu{padding-left:0}.wcp-custom-menu{position:relative}.wcp-container ul{list-style:none}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;height:30px;width:200px;text-indent:30px;background:0 0;box-shadow:none;font-size:14px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden}.wcp-container .first-title{margin-left:10px}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:10px;top:10px}i.fa-caret-right{transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}li.active>span>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}li.active>span>i.fa-folder:before{content:"\f07c"}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}.nav-icon{display:none;left:-20px!important}.has-sub-tree>.nav-icon{display:block}.wcp-content{position:fixed!important;top:32px;left:160px;bottom:0;width:315px;box-sizing:border-box;z-index:1;direction:ltr;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] .wcp-content{left:auto;right:160px}body.folded .wcp-content{left:36px}html[dir=rtl] body.folded .wcp-content{left:auto;right:36px}body.wp-admin #wpcontent{padding-left:335px;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] body.wp-admin #wpcontent{padding-left:0;padding-right:320px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.form-operations{border:solid 1px #e5e5e5;border-right:none;margin-bottom:20px}.form-operations ul{margin:0;padding:0}.form-operations li{display:block;float:left;width:20%;text-align:center;background:#fff;margin:0;padding:0}.form-operations li a{display:block;padding:10px 0;border-right:solid 1px #e5e5e5;font-size:16px;color:#727272}.clearfix{clear:both}.wcp-parent-data{position:relative}.wcp-parent{position:absolute;left:-21px;font-weight:700;font-size:14px}.wcp-parent .fa{font-size:18px;margin-right:8px}.wcp-form-data{background:#fff;border:solid 1px #f1f1f1;padding:15px;display:none;margin-bottom:20px}.wcp-form-title{color:#727272;font-size:14px;text-transform:uppercase;padding:0 0 10px 0}.wcp-form-data .form-field{padding:0 0 10px 0}.wcp-form-data .form-field input,.wcp-form-data .form-field select{width:100%}button#wcp-save-folder{float:right}.wcp-form-message span{display:block;padding:5px 10px;background:#ffabab;margin-bottom:10px;color:#000;border:solid 1px #8c0000;border-radius:4px}.wcp-container .route.active-item>h3.title{background:#008ec2;color:#fff;border-radius:4px}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}.route.active-item>span.ui-icon{background:#008ec2;color:#fff}#custom-menu.active>ul>li.route{display:block}.wcp-parent.active>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.wcp-parent.active>i.fa-folder:before{content:"\f07c"}.wcp-container .route .title img{display:none;width:14px;height:14px;margin:5px auto 0}.wcp-container .route .title:hover{background:#dfdfdf;cursor:pointer}.wcp-container .route .title.wcp-drop-hover img.move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover img.move-folder-icon{display:block}.wcp-container .route .title.wcp-drop-hover .ui-icon i,.wcp-container .route .title.wcp-drop-hover .ui-icon img.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon i,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon img.folder-sticky-icon{display:none}.route.is-sticky>h3.title>.ui-icon>.folder-sticky-icon{display:block;width:100%;height:auto;margin:3px auto 0}.route.is-sticky.active-item>h3.title>.ui-icon>.folder-sticky-icon{filter:invert(100%);-webkit-filter:invert(100%)}.route.is-sticky>h3.title>.ui-icon>i{display:none}.wcp-container .route .title.wcp-drop-hover img{filter:invert(100%);-webkit-filter:invert(100%)}.add-new-folder{text-decoration:none;display:block;float:right;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:24px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}.add-new-folder:focus,.add-new-folder:hover{color:#fff}.add-new-folder:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.add-new-folder span{display:block;float:left;line-height:20px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:10px 0 0 10px;margin:0 0}.form-options ul{margin:0;padding:0}.form-options>ul>li{display:inline-block;margin:0 2px 0 0;vertical-align:top}.form-options>ul>li.last{margin:0}.form-options>ul>li>a{display:inline-block;text-decoration:none;padding:5px 5px;color:#000;background:#ccc;box-shadow:0 1px 0 #ccc;vertical-align:middle;border:solid 1px #ccc;border-radius:3px;margin:0 0 12px 0}.form-options>ul>li.last>a{padding:3px}.form-options>ul>li.last>a span.icon{font-size:28px;line-height:22px}a#expand-collapse-list.all-open span:before{content:"\e911"}.form-options>ul>li>a:hover{background:#404040;color:#fff;border:solid 1px #404040}.form-options span.icon{font-size:18px;display:inline-block;vertical-align:top}.un-categorised-items{border-radius:3px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;border-radius:3px;display:block;text-decoration:none;font-size:14px;line-height:18px}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:#dfdfdf;border-radius:3px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2!important;color:#fff!important}.un-categorised-items.active-item a{color:#fff!important}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#444!important}span.total-count{float:right;background:#fff;padding:0 5px;border:solid 1px #ccc;font-size:10px;line-height:16px;border-radius:2px}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}#custom-menu .wcp-icon{font-size:20px;line-height:24px}.route.active>.nav-icon>.folder-icon-arrow_right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.route.active>.ui-icon>.folder-icon-folder:before{content:"\e90c"}.wcp-container .route span.total-count{position:relative;font-size:8px;float:right;text-align:center;width:auto;background:#fff;display:block;margin:4px 3px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.dynamic-menu{position:absolute;left:50px;background:#fff;width:170px;padding:0;z-index:101;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.sticky-folders .dynamic-menu{left:auto;right:50px}.dynamic-menu li{position:relative;width:100%;display:inline-block!important;padding:2px 0;margin:0}.dynamic-menu a{text-decoration:none;color:#848484;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:top;margin-right:5px;top:0!important}.dynamic-menu ul>li>a>span span{top:auto;height:auto;width:auto;margin:0;left:auto;vertical-align:baseline;display:inline}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.dynamic-menu ul li span{font-size:20px;vertical-align:middle}.dynamic-menu ul li span.sticky-folder-icon{width:20px}.wcp-form-input{padding-left:35px;box-sizing:border-box;position:relative}.wcp-form-input input{width:100%}.wcp-form-btn{padding:4px 0 4px 2px}.wcp-form-input:before{content:"\e90d";font-family:folder-icon!important;speak:none;position:absolute;left:0;font-size:28px;top:5px}.add-new-folder-btn{margin-right:5px!important}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.route.is-high>.ui-icon>i:before{content:"\e900"!important}.route.is-high.active>.ui-icon>i:before{content:"\e90c"!important;z-index:11;color:#444;font-size:20px}.route.is-high.active>.ui-icon>i:after{content:"\e907";margin-left:-1.2em;color:#444;font-size:11px;top:1px;position:absolute}.route.is-high.active.active-item>.ui-icon>i:after,.route.is-high.active.active-item>.ui-icon>i:before{color:#fff}li.active-menu{z-index:2!important}.wp-list-table th{width:auto!important}.wp-list-table th.column-title{width:35%!important}.fixed .column-author,.fixed .column-date,.fixed .column-format,.fixed .column-links,.fixed .column-parent,.fixed .column-posts{width:10%!important}.wp-list-table #wcp_move{width:20px!important}td.wcp_move.column-wcp_move{vertical-align:middle}.wp-list-table tr td .wcp-move-file{vertical-align:middle;opacity:0}.wp-list-table td.wcp_move.column-wcp_move.wcp-draggable,.wp-list-table tr:hover td .wcp-move-file{opacity:1}.wcp-drop-hover{background:#0073aa!important;z-index:2!important;color:#fff!important}.wcp-drop-hover span{color:#fff!important}.ui-draggable-dragging{z-index:1051!important}.wcp-hover-list{background:#008ec2!important;color:#fff;position:relative}.wcp-hover-list a{color:#fff}.wcp-hover-list span.total-count{color:#000}span.wcp-item{display:none}.wcp-move-file{cursor:move}.wcp-drop-hover-list a.folder-view{background:#008ec2;color:#fff;border:solid 1px #fff;position:relative}.tree-structure .folder-view{display:block;border:1px solid #dadce0;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#fff}.tree-structure .folder-view:hover{background:#008ec2;color:#fff}.wcp-drop-hover-list a.folder-view:before{width:100%;height:100%;content:"";position:absolute;top:-2px;left:-2px;border:solid 1px #008ec2;padding:1px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.ui-draggable-dragging.wcp-move-file{z-index:5001;display:inline-block;border:solid 2px #0073aa;padding:5px 10px;border-radius:5px;background:#e4f6ff;z-index:2001;position:fixed!important;max-width:230px;overflow:hidden;width:auto!important}.ui-draggable-dragging.wcp-move-file span{display:block;float:left}.ui-draggable-dragging.wcp-move-file span.wcp-move{margin-right:5px;display:block;float:left}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 80px);overflow:hidden;white-space:nowrap}.ui-resizable-handle.ui-resizable-e{position:absolute;top:0;height:100%;height:100vh;width:1px;right:0;border-right:1px solid #ccc;cursor:col-resize}.ui-resizable-handle.ui-resizable-e:before,.ui-resizable-handle.ui-resizable-w:before{content:"";top:68px;width:3px;height:53px;position:absolute;border-left:solid 1px #ccc;border-right:solid 1px #ccc;left:-1px}.ui-resizable-handle.ui-resizable-w{position:absolute;top:0;height:100%;height:100vh;width:1px;left:0;border-right:1px solid #ccc;cursor:col-resize}div#custom-menu{padding-bottom:150px;padding-left:4px}.sticky-folders li a span.star-icon,.wcp-container .route span.star-icon{position:relative;top:2px;left:auto;float:right;font-family:folder-icon!important;speak:none;color:#ffc90e;display:none;font-size:20px;font-weight:700}.sticky-folders li a span.update-inline-record,.wcp-container .route span.update-inline-record{position:relative;left:auto;top:2px;float:right;width:0;height:22px;font-family:folder-icon!important;font-size:16px;overflow:hidden;transition:all .25s linear;-webkit-transition:all .25s linear;-moz-transition:all .25s linear}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}.sticky-folders li a:hover .folder-count{margin:0 3px 0 0}.sticky-folders li a span.update-inline-record:after,.wcp-container .route span.update-inline-record:after{content:"\e910"}.sticky-folders li.is-high a span.star-icon,.wcp-container .route.is-high>h3>span.star-icon{display:block}.sticky-folders li a span.star-icon:after,.wcp-container .route span.star-icon:after{content:"\e907"}.tree-structure li{display:block;width:auto;float:left;margin:0;padding:0}.tree-structure .folder-item{padding:8px;position:relative}.tree-structure .folder-view{display:block;border:1px solid #dadce0;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#fff}.tree-structure .folder-view span.item-name{display:block;padding:10px 25px 10px 50px;position:relative;width:100%;overflow:hidden;height:38px;font-size:16px;box-sizing:border-box}.folder-view span.item-name:before{content:"\e90d";font-family:folder-icon!important;position:absolute;left:15px;font-size:24px}.folder-view.is-high span.item-name:before{content:"\e900"}.folder-view.is-post span.item-name:before{content:"\e901"}.tree-structure span.folder-option{position:absolute;right:0;font-family:folder-icon!important;top:0;font-size:20px;line-height:38px;z-index:1;cursor:pointer;display:none}.tree-structure .folder-view:hover span.folder-option{display:block}.tree-structure span.folder-option:hover{color:#f51366}.tree-structure span.folder-option:after{content:"\e90a"}.tree-structure li{position:relative}.tree-structure{margin-left:-8px;margin-right:-8px}.tree-structure .folder-view span.folder-title{overflow:hidden;width:100%;height:18px;display:block}.swal2-popup .swal2-title{line-height:36px}.attachments-browser.ui-draggable-dragging .media-sidebar,.attachments-browser.ui-draggable-dragging .media-toolbar,.attachments-browser.ui-draggable-dragging .uploader-inline,.attachments-browser.ui-draggable-dragging ul.attachments{display:none}.attachments.ui-sortable.ui-draggable-dragging{z-index:5000}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{width:2px!important;background-color:#0073aa!important;background-color:rgba(0,115,170,.6)!important;box-shadow:none!important}.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{background-color:#0073aa!important}.mCSB_outside+.mCSB_scrollTools{right:-15px!important}body.upload-php.eml-grid #wpbody{position:relative!important;top:0!important;bottom:auto!important;left:auto!important;right:auto!important;height:auto}#footer-thankyou{display:none}span.upgrade-message{padding:0 0 10px;background:#fff;display:inline-block;font-size:14px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.media-toolbar.sticky-media{position:fixed;top:32px;right:18px!important;left:auto}.media-position{width:1px;height:1px}.media-frame.mode-grid .media-toolbar{margin:0!important}.button-disabled{cursor:no-drop;pointer-events:none}.wcp-hide-show-buttons{position:absolute;top:25px;right:-20px;z-index:10001}html[dir=rtl] .wcp-hide-show-buttons{left:-20px;right:auto}.wcp-hide-show-buttons .toggle-buttons{background:#f51366;color:#fff;display:inline-block;margin:0;padding:0;float:left;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%;display:none;width:20px;height:20px;cursor:pointer;position:relative}.wcp-hide-show-buttons:hover .toggle-buttons:after{content:"";width:100%;height:100%;background:0 0;position:absolute;top:0;left:0;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-top-left-radius:50%;-webkit-border-bottom-left-radius:50%;-moz-border-radius-top-left:50%;-moz-border-radius-bottom-left:50%;border-top-left-radius:50%;border-bottom-left-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.hide-folders-area .wcp-content{width:0!important}.hide-folders-area .wcp-container{display:none}.wcp-hide-show-buttons .toggle-buttons.active{display:block}#wcp-content.no-transition .wcp-container{display:none}button.button.organize-button{vertical-align:middle;text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:14px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}button.button.organize-button:focus,button.button.organize-button:hover{color:#fff}button.button.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.tree-structure-content ul{margin:0;padding:0}.tree-structure-content{padding:10px 20px 10px;background:#fff;margin:10px 0 15px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border:solid 1px #ccc}.tree-structure-content .tree-structure{height:55px;overflow:hidden;transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}.tree-structure-content.active .tree-structure{height:auto}.folders-toggle-button{height:15px;text-align:center;position:relative}.folders-toggle-button span{background:#f51366;color:#fff;height:20px;width:30px;text-align:center;display:block;margin:0 auto;position:absolute;left:0;right:0;bottom:-10px;cursor:pointer;font-family:dashicons;font-size:20px;line-height:20px}.folders-toggle-button span:after{content:"\f347"}.tree-structure-content.active .folders-toggle-button span:after{content:"\f343"}span.media-info-message{vertical-align:middle;line-height:20px;font-weight:700;color:#f51366;padding:0 0 10px 0;display:none!important}span.media-info-message.active{display:block!important}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.folder-popup-form.disabled{pointer-events:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}.folder-form-buttons a,.folder-form-buttons button{display:inline-block;padding:10px 20px;text-decoration:none;margin:10px 3px;font-size:18px;line-height:22px;border-radius:.25em;color:#fff;border:none}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear}[data-tooltip]{position:relative}[data-tooltip]::after,[data-tooltip]::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}[data-tooltip]::before{content:'';border:5px solid transparent;z-index:1001}[data-tooltip]::after{content:attr(data-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}[data-tooltip]:hover::after,[data-tooltip]:hover::before{display:block;opacity:1}[data-tooltip]:not([flow])::before,[data-tooltip][flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}[data-tooltip]:not([flow])::after,[data-tooltip][flow^=up]::after{bottom:calc(100% + 5px)}[data-tooltip]:not([flow])::after,[data-tooltip]:not([flow])::before,[data-tooltip][flow^=up]::after,[data-tooltip][flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}#remove-folder-item{width:126px!important}.wp-core-ui .button-primary.select-all-item-btn{margin:11px 11px 11px 0;display:none!important}.wp-core-ui .button-primary.select-all-item-btn.active{display:inline-block!important}.form-options>ul>li.last.folder-checkbox{padding:8px 0 0 6px}#custom-menu input.checkbox{display:none}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a:focus,.folder-form-buttons a:hover,.folder-form-buttons button:focus,.folder-form-buttons button:hover{color:#fff;background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.folder-form-buttons a:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.form-cancel-btn{background-color:#aaa}.form-submit-btn{background-color:#3085d6}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;line-height:30px}.folder-form-input input{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box;height:2.625em;padding:0 .75em;margin:1em auto}.folder-form-message{font-size:16px;line-height:20px;margin:25px 0}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-errors.active{display:block}.sticky-menu #adminmenuwrap{position:relative!important}span.folder-loader-ajax{float:right;margin:0 8px 0 0;line-height:30px;display:none}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:34px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}.folder-loader-ajax img.active{display:inline-block}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.mCSB_scrollTools a+.mCSB_draggerContainer{margin:10px 0!important}.popup-folder-title{font-weight:700;font-size:24px;padding:0 0 20px 0}.select-box{padding:20px 0 10px 0}.select-box select{width:100%;max-width:300px}.actions #media_folder,select.media-select-folder{width:132px}select#media-attachment-taxonomy-filter{width:132px}.custom-media-select{float:right;padding:10px 0 0 0;display:none}.custom-media-select.active{display:block}.folder-progress{background:#b4b9be;border-radius:4px;margin:5px 0 0 0;position:relative}.folder-meter{height:20px;position:relative;background:#f1f1f1;padding:0;width:0%;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.folder-meter>span{display:block;height:100%;-webkit-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);-moz-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);position:relative;overflow:hidden;border-radius:4px}.folder-animate>span>span,.folder-meter>span:after,.folder-progress:after{content:"";position:absolute;border-radius:4px;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:50px 50px;-moz-background-size:50px 50px;-webkit-animation:move 2s linear infinite;overflow:hidden}.folder-animate>span:after{display:none}@-webkit-keyframes move{0%{background-position:0 0}100%{background-position:50px 50px}}.orange-bg>span{background-color:#ff5983}.media-folder-loader{padding:10px 0 15px;display:none}.media-folder-loader>span{font-weight:700}.sticky-folders{display:none;padding:0 0 5px;margin:0 0 5px;border-bottom:solid 1px #ccc}.top-settings{padding:0 0 5px;margin:0 0 5px;border-bottom:solid 1px #ccc}.sticky-folders.active{display:block}.sticky-folders ul{margin:0;padding:0}.sticky-folders>ul>li{display:block;margin:0;padding:0}.sticky-folders>ul>li>a{display:block;color:#444;padding:7px;border-radius:3px;text-decoration:none;font-size:16px;line-height:18px}.sticky-folders ul li a.active,.sticky-folders ul li a:hover{background:#dfdfdf;border-radius:3px}.sticky-folders ul li a.active-item{background-color:#008ec2!important;color:#fff}.sticky-folders ul li a.active-item img{filter:invert(100%);-webkit-filter:invert(100%)}.sticky-folders ul li a span{display:inline-block;vertical-align:middle;line-height:18px}.sticky-folders ul li a span.sticky-icon{width:18px;height:18px;margin-right:3px}.sticky-folders ul li a span.sticky-icon img{width:100%;height:100%}.sticky-wcp-custom-form a:focus{box-shadow:none;outline:0}span.folder-count{float:right;background:#fff;padding:0 5px;border:solid 1px #ccc;font-size:10px;line-height:16px;border-radius:2px;color:#444!important}span.folder-count:empty{display:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}.sticky-title img{display:inline-block;vertical-align:middle;height:20px;width:20px}.sticky-folder-icon img{width:100%;filter:invert(50%);-webkit-filter:invert(50%)}.dynamic-menu .sticky-folder:hover img{filter:invert(0);-webkit-filter:invert(0)}.form-options>ul>li.last>a.sort-folder-order{width:32px;height:30px;padding:7px;text-align:center;display:inline-block;box-sizing:border-box}.sort-folder-order svg{width:100%;height:100%;fill:#000}.sort-folder-order:hover svg{fill:#fff}.folder-order{position:relative}.folder-sort-menu{position:absolute;right:0;width:120px;z-index:101;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25);display:none}.folder-order.active .folder-sort-menu{display:block}.folder-order.active .sort-folder-order{background:#404040;color:#fff;border:solid 1px #404040}.folder-order.active .sort-folder-order svg{fill:#fff}.folder-sort-menu li{display:block;margin:0;padding:0;background:0 0}.folder-sort-menu li a{display:block;margin:0;padding:3px 5px;background:0 0;color:#848484;text-decoration:none;font-size:14px}.folder-sort-menu li a.active,.folder-sort-menu li a:hover{background:#efefef;color:#000}.dynamic-menu.bottom-fix{bottom:0}@media screen and (max-width:960px){.wcp-content{left:36px}html[dir=rtl] .wcp-content{right:36px;left:auto}}@media screen and (max-width:780px){.wcp-content{left:0}html[dir=rtl] .wcp-content{right:0}}@media screen and (max-width:640px){.wcp-content{left:0;position:relative!important;width:100%!important;padding-bottom:100px;top:0;right:0;display:block}.ui-resizable-handle.ui-resizable-e{display:none!important}.hide-folders-area .wcp-container{display:block}.wcp-hide-show-buttons{display:none}.hide-folders-area .wcp-content{width:100%!important}body.wp-admin #wpcontent{padding:0!important}#wpbody-content{padding-bottom:30px}}
assets/js/custom.js CHANGED
@@ -14,6 +14,7 @@ var folderIDs = "";
14
  var isMultipleRemove = false;
15
  var isItFromMedia = false;
16
  var $action_form;
 
17
 
18
  var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
19
  "<div class='folder-item is-folder' data-id='__folder_id__'>" +
@@ -32,6 +33,36 @@ jQuery(document).ready(function(){
32
  // return false;
33
  //});
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  if(wcp_settings.post_type == "attachment") {
36
  if(!jQuery(".move-to-folder-top").length) {
37
  jQuery("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>");
@@ -41,6 +72,7 @@ jQuery(document).ready(function(){
41
  }
42
  }
43
 
 
44
  if(wcp_settings.page_url != wcp_settings.current_url) {
45
  folderCurrentURL = wcp_settings.current_url;
46
  }
@@ -315,7 +347,7 @@ function removeMultipleFolderItems() {
315
  jQuery(".form-loader-count").css("width", "100%");
316
  jQuery.ajax({
317
  url: wcp_settings.ajax_url,
318
- data: "type=" + wcp_settings.post_type + "&action=wcp_remove_muliple_folder&term_id=" + folderIDs,
319
  method: 'post',
320
  success: function (res) {
321
  res = jQuery.parseJSON(res);
@@ -344,7 +376,9 @@ function removeMultipleFolderItems() {
344
  jQuery(".header-posts a").trigger("click");
345
  activeRecordID = 0;
346
  }
347
- }
 
 
348
  jQuery("#folder-hide-show-checkbox").attr("checked", false);
349
  jQuery("#custom-menu input.checkbox").attr("checked", false);
350
  jQuery("#custom-menu").removeClass("show-folder-checkbox");
@@ -396,7 +430,7 @@ function set_default_folders(post_id) {
396
  jQuery.ajax({
397
  url: wcp_settings.ajax_url,
398
  type: 'post',
399
- data: 'action=save_folder_last_status&post_type='+wcp_settings.post_type+"&post_id="+post_id,
400
  cache: false,
401
  async: false,
402
  success: function(){
@@ -515,6 +549,11 @@ function resetMediaAndPosts() {
515
  jQuery("#title_"+res.taxonomies[i].term_id+" .star-icon").before("<span class='total-count'></span>");
516
  }
517
  jQuery("#title_"+res.taxonomies[i].term_id+" .total-count").text(parseInt(res.taxonomies[i].trash_count));
 
 
 
 
 
518
  }
519
 
520
  jQuery("#custom-menu .total-count").each(function(){
@@ -522,6 +561,12 @@ function resetMediaAndPosts() {
522
  jQuery(this).remove();
523
  }
524
  });
 
 
 
 
 
 
525
  }
526
  });
527
  jQuery(".folder-loader-ajax").addClass("active");
@@ -529,7 +574,7 @@ function resetMediaAndPosts() {
529
  jQuery("#folder-posts-filter").load(folderCurrentURL + " #posts-filter", function () {
530
  var obj = { Title: "", Url: folderCurrentURL };
531
  history.pushState(obj, obj.Title, obj.Url);
532
- if (!jQuery(".tree-structure").length) {
533
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
534
  }
535
  add_active_item_to_list();
@@ -539,7 +584,7 @@ function resetMediaAndPosts() {
539
  jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", false, function (res) {
540
  var obj = { Title: "", Url: folderCurrentURL };
541
  history.pushState(obj, obj.Title, obj.Url);
542
- if (!jQuery(".tree-structure").length) {
543
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
544
  }
545
  add_active_item_to_list();
@@ -570,6 +615,21 @@ function add_active_item_to_list() {
570
  });
571
 
572
  apply_animation_height();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  }
574
 
575
  document.onkeydown = function(evt) {
@@ -663,7 +723,9 @@ jQuery(document).ready(function(){
663
  n_o_file = parseInt(wcp_settings.folders);
664
 
665
  if(wcp_settings.post_type == "attachment") {
666
- jQuery(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div><div class="folders-toggle-button"><span></span></div></div>');
 
 
667
 
668
  add_menu_to_list();
669
 
@@ -690,7 +752,7 @@ jQuery(document).ready(function(){
690
  var obj = { Title: jQuery("#wcp_folder_"+activeRecordID).data("slug"), Url: folderCurrentURL };
691
  history.pushState(obj, obj.Title, obj.Url);
692
  set_default_folders(jQuery("#wcp_folder_"+activeRecordID).data("slug"));
693
- if (!jQuery(".tree-structure").length) {
694
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
695
  }
696
  triggerInlineUpdate();
@@ -700,7 +762,7 @@ jQuery(document).ready(function(){
700
  var obj = { Title: jQuery("#wcp_folder_"+activeRecordID).data("slug"), Url: folderCurrentURL };
701
  history.pushState(obj, obj.Title, obj.Url);
702
  set_default_folders(jQuery("#wcp_folder_"+activeRecordID).data("slug"));
703
- if (!jQuery(".tree-structure").length) {
704
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
705
  }
706
  triggerInlineUpdate();
@@ -740,7 +802,7 @@ jQuery(document).ready(function(){
740
  var obj = { Title: "", Url: folderCurrentURL };
741
  history.pushState(obj, obj.Title, obj.Url);
742
  set_default_folders("all");
743
- if (!jQuery(".tree-structure").length) {
744
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
745
  }
746
  triggerInlineUpdate();
@@ -750,7 +812,7 @@ jQuery(document).ready(function(){
750
  var obj = { Title: "", Url: folderCurrentURL };
751
  history.pushState(obj, obj.Title, obj.Url);
752
  set_default_folders("all");
753
- if (!jQuery(".tree-structure").length) {
754
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
755
  }
756
  triggerInlineUpdate();
@@ -762,6 +824,7 @@ jQuery(document).ready(function(){
762
  }
763
  add_active_item_to_list();
764
  });
 
765
  jQuery("h3.title").livequery(function(){
766
  jQuery(this).droppable({
767
  accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
@@ -896,7 +959,7 @@ jQuery(document).ready(function(){
896
  var obj = { Title: "", Url: folderCurrentURL };
897
  history.pushState(obj, obj.Title, obj.Url);
898
  set_default_folders("all");
899
- if (!jQuery(".tree-structure").length) {
900
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
901
  }
902
  add_active_item_to_list();
@@ -907,7 +970,7 @@ jQuery(document).ready(function(){
907
  var obj = { Title: "", Url: folderCurrentURL };
908
  history.pushState(obj, obj.Title, obj.Url);
909
  set_default_folders("all");
910
- if (!jQuery(".tree-structure").length) {
911
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
912
  }
913
  add_active_item_to_list();
@@ -938,7 +1001,7 @@ jQuery(document).ready(function(){
938
  var obj = { Title: "", Url: folderCurrentURL };
939
  history.pushState(obj, obj.Title, obj.Url);
940
  set_default_folders("-1");
941
- if (!jQuery(".tree-structure").length) {
942
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
943
  }
944
  add_active_item_to_list();
@@ -949,7 +1012,7 @@ jQuery(document).ready(function(){
949
  var obj = { Title: "", Url: folderCurrentURL };
950
  history.pushState(obj, obj.Title, obj.Url);
951
  set_default_folders("-1");
952
- if (!jQuery(".tree-structure").length) {
953
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
954
  }
955
  add_active_item_to_list();
@@ -1306,6 +1369,13 @@ jQuery(document).ready(function(){
1306
  "</ul></div>";
1307
  jQuery(this).after(menuHtml);
1308
  jQuery(this).parents("li.route").addClass("active-menu");
 
 
 
 
 
 
 
1309
  return false;
1310
  });
1311
  });
@@ -1531,6 +1601,14 @@ jQuery(document).ready(function(){
1531
  "</ul></div>";
1532
  jQuery(this).closest("h3.title").after(menuHtml);
1533
  jQuery(this).parents("li.route").addClass("active-menu");
 
 
 
 
 
 
 
 
1534
  });
1535
  });
1536
  //check_for_sub_menu();
@@ -1847,6 +1925,9 @@ if(wcp_settings.post_type == "attachment") {
1847
  for (i = 0; i < res.taxonomies.length; i++) {
1848
  selectedDD.append("<option value='" + res.taxonomies[i].term_id + "'>" + res.taxonomies[i].name + " (" + res.taxonomies[i].trash_count + ")</option>");
1849
  jQuery(".media-select-folder").append("<option value='" + res.taxonomies[i].term_id + "'>" + res.taxonomies[i].name + " (" + res.taxonomies[i].trash_count + ")</option>");
 
 
 
1850
  }
1851
  selectedDD.val(selectedVal);
1852
  jQuery(".media-select-folder").val("");
@@ -1866,6 +1947,14 @@ if(wcp_settings.post_type == "attachment") {
1866
  jQuery("#title_"+res.taxonomies[i].term_id+" .star-icon").before("<span class='total-count'></span>");
1867
  }
1868
  jQuery("#title_"+res.taxonomies[i].term_id+" .total-count").text(parseInt(res.taxonomies[i].trash_count));
 
 
 
 
 
 
 
 
1869
  }
1870
 
1871
  jQuery("#custom-menu .total-count").each(function(){
@@ -1873,6 +1962,12 @@ if(wcp_settings.post_type == "attachment") {
1873
  jQuery(this).remove();
1874
  }
1875
  });
 
 
 
 
 
 
1876
  }
1877
  if(activeRecordID != "") {
1878
  jQuery("#wcp_folder_"+activeRecordID).addClass("active-item");
14
  var isMultipleRemove = false;
15
  var isItFromMedia = false;
16
  var $action_form;
17
+ var lastOrderStatus = "";
18
 
19
  var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
20
  "<div class='folder-item is-folder' data-id='__folder_id__'>" +
33
  // return false;
34
  //});
35
 
36
+ jQuery(document).on("click", ".folder-sort-menu a", function(e) {
37
+ e.stopPropagation();
38
+ e.preventDefault();
39
+ jQuery(".form-loader-count").css("width", "100%");
40
+ jQuery(".folder-order").removeClass("active");
41
+ lastOrderStatus = jQuery(this).attr("data-sort");
42
+ jQuery.ajax({
43
+ url: wcp_settings.ajax_url,
44
+ data: "type=" + wcp_settings.post_type + "&action=wcp_folders_by_order&nonce=" + wcp_settings.nonce+"&order="+jQuery(this).attr("data-sort"),
45
+ method: 'post',
46
+ success: function (res) {
47
+ res = jQuery.parseJSON(res);
48
+ if(res.status == 1) {
49
+ jQuery("#space_0").html(res.data);
50
+ }
51
+ jQuery(".form-loader-count").css("width", "0");
52
+ add_active_item_to_list();
53
+ }
54
+ });
55
+ });
56
+
57
+ jQuery(document).on("click", "body, html", function(){
58
+ jQuery(".folder-order").removeClass("active");
59
+ });
60
+
61
+ jQuery(document).on("click", "#sort-order-list", function(e){
62
+ e.stopPropagation();
63
+ jQuery(".folder-order").toggleClass("active");
64
+ });
65
+
66
  if(wcp_settings.post_type == "attachment") {
67
  if(!jQuery(".move-to-folder-top").length) {
68
  jQuery("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>");
72
  }
73
  }
74
 
75
+
76
  if(wcp_settings.page_url != wcp_settings.current_url) {
77
  folderCurrentURL = wcp_settings.current_url;
78
  }
347
  jQuery(".form-loader-count").css("width", "100%");
348
  jQuery.ajax({
349
  url: wcp_settings.ajax_url,
350
+ data: "type=" + wcp_settings.post_type + "&action=wcp_remove_muliple_folder&term_id=" + folderIDs+"&nonce="+wcp_settings.nonce,
351
  method: 'post',
352
  success: function (res) {
353
  res = jQuery.parseJSON(res);
376
  jQuery(".header-posts a").trigger("click");
377
  activeRecordID = 0;
378
  }
379
+ } else {
380
+ window.location.reload();
381
+ }
382
  jQuery("#folder-hide-show-checkbox").attr("checked", false);
383
  jQuery("#custom-menu input.checkbox").attr("checked", false);
384
  jQuery("#custom-menu").removeClass("show-folder-checkbox");
430
  jQuery.ajax({
431
  url: wcp_settings.ajax_url,
432
  type: 'post',
433
+ data: 'action=save_folder_last_status&post_type='+wcp_settings.post_type+"&post_id="+post_id+"&nonce="+wcp_settings.nonce,
434
  cache: false,
435
  async: false,
436
  success: function(){
549
  jQuery("#title_"+res.taxonomies[i].term_id+" .star-icon").before("<span class='total-count'></span>");
550
  }
551
  jQuery("#title_"+res.taxonomies[i].term_id+" .total-count").text(parseInt(res.taxonomies[i].trash_count));
552
+
553
+ if(!jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" .folder-count").length) {
554
+ jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" a").append("<span class='folder-count'></span>")
555
+ }
556
+ jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" .folder-count").text(parseInt(res.taxonomies[i].trash_count));
557
  }
558
 
559
  jQuery("#custom-menu .total-count").each(function(){
561
  jQuery(this).remove();
562
  }
563
  });
564
+
565
+ jQuery(".sticky-folders .folder-count").each(function(){
566
+ if(parseInt(jQuery(this).text()) == 0) {
567
+ jQuery(this).remove();
568
+ }
569
+ });
570
  }
571
  });
572
  jQuery(".folder-loader-ajax").addClass("active");
574
  jQuery("#folder-posts-filter").load(folderCurrentURL + " #posts-filter", function () {
575
  var obj = { Title: "", Url: folderCurrentURL };
576
  history.pushState(obj, obj.Title, obj.Url);
577
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
578
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
579
  }
580
  add_active_item_to_list();
584
  jQuery("#wpbody").load(folderCurrentURL + " #wpbody-content", false, function (res) {
585
  var obj = { Title: "", Url: folderCurrentURL };
586
  history.pushState(obj, obj.Title, obj.Url);
587
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
588
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
589
  }
590
  add_active_item_to_list();
615
  });
616
 
617
  apply_animation_height();
618
+
619
+ if(wcp_settings.post_type == "attachment") {
620
+ if(!jQuery(".move-to-folder-top").length) {
621
+ jQuery("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>");
622
+ }
623
+ if(!jQuery(".move-to-folder-bottom").length) {
624
+ jQuery("#bulk-action-selector-bottom").append("<option class='move-to-folder-bottom' value='move_to_folder'>Move to Folder</option>");
625
+ }
626
+ }
627
+
628
+ jQuery(".sticky-folders .active-item").removeClass("active-item");
629
+ if(jQuery("#custom-menu li.route.active-item").length) {
630
+ var activeTermId = jQuery("#custom-menu li.route.active-item").data("folder-id");
631
+ jQuery(".sticky-folders .sticky-folder-"+activeTermId+" a").addClass("active-item");
632
+ }
633
  }
634
 
635
  document.onkeydown = function(evt) {
723
  n_o_file = parseInt(wcp_settings.folders);
724
 
725
  if(wcp_settings.post_type == "attachment") {
726
+ if(wcp_settings.show_in_page == "show") {
727
+ jQuery(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div><div class="folders-toggle-button"><span></span></div></div>');
728
+ }
729
 
730
  add_menu_to_list();
731
 
752
  var obj = { Title: jQuery("#wcp_folder_"+activeRecordID).data("slug"), Url: folderCurrentURL };
753
  history.pushState(obj, obj.Title, obj.Url);
754
  set_default_folders(jQuery("#wcp_folder_"+activeRecordID).data("slug"));
755
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
756
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
757
  }
758
  triggerInlineUpdate();
762
  var obj = { Title: jQuery("#wcp_folder_"+activeRecordID).data("slug"), Url: folderCurrentURL };
763
  history.pushState(obj, obj.Title, obj.Url);
764
  set_default_folders(jQuery("#wcp_folder_"+activeRecordID).data("slug"));
765
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
766
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
767
  }
768
  triggerInlineUpdate();
802
  var obj = { Title: "", Url: folderCurrentURL };
803
  history.pushState(obj, obj.Title, obj.Url);
804
  set_default_folders("all");
805
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
806
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
807
  }
808
  triggerInlineUpdate();
812
  var obj = { Title: "", Url: folderCurrentURL };
813
  history.pushState(obj, obj.Title, obj.Url);
814
  set_default_folders("all");
815
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
816
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
817
  }
818
  triggerInlineUpdate();
824
  }
825
  add_active_item_to_list();
826
  });
827
+
828
  jQuery("h3.title").livequery(function(){
829
  jQuery(this).droppable({
830
  accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
959
  var obj = { Title: "", Url: folderCurrentURL };
960
  history.pushState(obj, obj.Title, obj.Url);
961
  set_default_folders("all");
962
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
963
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
964
  }
965
  add_active_item_to_list();
970
  var obj = { Title: "", Url: folderCurrentURL };
971
  history.pushState(obj, obj.Title, obj.Url);
972
  set_default_folders("all");
973
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
974
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
975
  }
976
  add_active_item_to_list();
1001
  var obj = { Title: "", Url: folderCurrentURL };
1002
  history.pushState(obj, obj.Title, obj.Url);
1003
  set_default_folders("-1");
1004
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
1005
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1006
  }
1007
  add_active_item_to_list();
1012
  var obj = { Title: "", Url: folderCurrentURL };
1013
  history.pushState(obj, obj.Title, obj.Url);
1014
  set_default_folders("-1");
1015
+ if (wcp_settings.show_in_page == "show" && !jQuery(".tree-structure").length) {
1016
  jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1017
  }
1018
  add_active_item_to_list();
1369
  "</ul></div>";
1370
  jQuery(this).after(menuHtml);
1371
  jQuery(this).parents("li.route").addClass("active-menu");
1372
+ if((jQuery(this).offset().top + jQuery(".dynamic-menu").height()) > (jQuery(window).height() - 20)) {
1373
+ jQuery(".dynamic-menu").addClass("bottom-fix");
1374
+
1375
+ if(jQuery(".dynamic-menu.bottom-fix").offset().top < jQuery("#custom-scroll-menu").offset().top) {
1376
+ jQuery(".dynamic-menu").removeClass("bottom-fix");
1377
+ }
1378
+ }
1379
  return false;
1380
  });
1381
  });
1601
  "</ul></div>";
1602
  jQuery(this).closest("h3.title").after(menuHtml);
1603
  jQuery(this).parents("li.route").addClass("active-menu");
1604
+
1605
+ if((jQuery(this).closest("h3.title").offset().top + jQuery(".dynamic-menu").height()) > (jQuery(window).height() - 20)) {
1606
+ jQuery(".dynamic-menu").addClass("bottom-fix");
1607
+
1608
+ if(jQuery(".dynamic-menu.bottom-fix").offset().top < jQuery("#custom-scroll-menu").offset().top) {
1609
+ jQuery(".dynamic-menu").removeClass("bottom-fix");
1610
+ }
1611
+ }
1612
  });
1613
  });
1614
  //check_for_sub_menu();
1925
  for (i = 0; i < res.taxonomies.length; i++) {
1926
  selectedDD.append("<option value='" + res.taxonomies[i].term_id + "'>" + res.taxonomies[i].name + " (" + res.taxonomies[i].trash_count + ")</option>");
1927
  jQuery(".media-select-folder").append("<option value='" + res.taxonomies[i].term_id + "'>" + res.taxonomies[i].name + " (" + res.taxonomies[i].trash_count + ")</option>");
1928
+
1929
+ jQuery("#title_"+res.taxonomies[i].term_id).attr("title", res.taxonomies[i].term_name);
1930
+ jQuery("#title_"+res.taxonomies[i].term_id+" .title-text").html(res.taxonomies[i].term_name);
1931
  }
1932
  selectedDD.val(selectedVal);
1933
  jQuery(".media-select-folder").val("");
1947
  jQuery("#title_"+res.taxonomies[i].term_id+" .star-icon").before("<span class='total-count'></span>");
1948
  }
1949
  jQuery("#title_"+res.taxonomies[i].term_id+" .total-count").text(parseInt(res.taxonomies[i].trash_count));
1950
+
1951
+ if(!jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" .folder-count").length) {
1952
+ jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" a").append("<span class='folder-count'></span>")
1953
+ }
1954
+ jQuery(".sticky-folders .sticky-folder-"+res.taxonomies[i].term_id+" .folder-count").text(parseInt(res.taxonomies[i].trash_count));
1955
+
1956
+ jQuery("#title_"+res.taxonomies[i].term_id).attr("title", res.taxonomies[i].term_name);
1957
+ jQuery("#title_"+res.taxonomies[i].term_id+" .title-text").html(res.taxonomies[i].term_name);
1958
  }
1959
 
1960
  jQuery("#custom-menu .total-count").each(function(){
1962
  jQuery(this).remove();
1963
  }
1964
  });
1965
+
1966
+ jQuery(".sticky-folders .folder-count").each(function(){
1967
+ if(parseInt(jQuery(this).text()) == 0) {
1968
+ jQuery(this).remove();
1969
+ }
1970
+ });
1971
  }
1972
  if(activeRecordID != "") {
1973
  jQuery("#wcp_folder_"+activeRecordID).addClass("active-item");
assets/js/media.js CHANGED
@@ -163,8 +163,8 @@ jQuery(document).on("change", ".folder_for_media", function(){
163
  jQuery("body").append("<div class='folder-media-popup-form' id='custom-folder-media-popup-form'></div>");
164
  jQuery("#custom-folder-media-popup-form").append("<div class='media-popup-form' id='custom-popup-form-content'></div>");
165
  jQuery(".media-popup-form").append('<div id="add-update-folder-title" class="add-update-folder-title">You\'ve reached the 10 folder limitation!</div>');
166
- jQuery(".media-popup-form").append('<div class="folder-form-message">Unlock unlimited amount of folders by activating your license key.</div>');
167
- jQuery(".media-popup-form").append('<div class="folder-form-buttons"><a href="javascript:;" class="remove-media-form">Cancel</a><a href="'+folders_media_options.activate_url+'" target="_blank" class="form-submit-btn" style="width: 145px">Activate your key</button></div>');
168
  }
169
  } else {
170
  if (jQuery("#custom-folder-media-popup-form").length) {
163
  jQuery("body").append("<div class='folder-media-popup-form' id='custom-folder-media-popup-form'></div>");
164
  jQuery("#custom-folder-media-popup-form").append("<div class='media-popup-form' id='custom-popup-form-content'></div>");
165
  jQuery(".media-popup-form").append('<div id="add-update-folder-title" class="add-update-folder-title">You\'ve reached the 10 folder limitation!</div>');
166
+ jQuery(".media-popup-form").append('<div class="folder-form-message">Unlock unlimited amount of folders by upgrading to one of our pro plans.</div>');
167
+ jQuery(".media-popup-form").append('<div class="folder-form-buttons"><a href="javascript:;" class="remove-media-form">Cancel</a><a href="'+folders_media_options.activate_url+'" target="_blank" class="form-submit-btn" style="width: 120px">See Pro Plans</button></div>');
168
  }
169
  } else {
170
  if (jQuery("#custom-folder-media-popup-form").length) {
assets/js/new-media.js CHANGED
@@ -1 +1,111 @@
1
- var folders_media={addMedia:function(){jQuery("body").hasClass("media-new-php")&&setTimeout(function(){"undefined"!=typeof uploader&&jQuery(".folder_for_media").length&&uploader&&uploader.bind("BeforeUpload",function(e,d){e.settings.multipart_params.folder_for_media=jQuery(".folder_for_media").val(),jQuery("#media-item-"+d.id).find(".filename")})}.bind(this),500)}};jQuery(document).ready(function(){folders_media.addMedia()});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var folders_media = {
2
+ addMedia: function () {
3
+ jQuery("body").hasClass("media-new-php") && setTimeout(function () {
4
+ "undefined" != typeof uploader && jQuery(".folder_for_media").length && uploader && uploader.bind("BeforeUpload", function (e, d) {
5
+ e.settings.multipart_params.folder_for_media = jQuery(".folder_for_media").val(), jQuery("#media-item-" + d.id).find(".filename")
6
+ })
7
+ }.bind(this), 500)
8
+ }
9
+ };
10
+ jQuery(document).ready(function () {
11
+ folders_media.addMedia()
12
+ });
13
+ var selectedFolderMediaId;
14
+ jQuery(document).on("change", ".folder_for_media", function(){
15
+ if(jQuery(this).val() != "add-folder" && jQuery(this).val() != null) {
16
+ selectedFolderMediaId = jQuery(this).val();
17
+ } else if(jQuery(this).val() == "add-folder") {
18
+ selectedFolderMediaId = -1;
19
+ if(!jQuery("#wcp-content").length) {
20
+ if(folders_media_options.is_key_active == 0 && folders_media_options.folders >= 10) {
21
+ if (jQuery("#custom-folder-media-popup-form").length) {
22
+ jQuery("#custom-folder-media-popup-form").remove();
23
+ }
24
+ if (!jQuery("#custom-folder-media-popup-form").length) {
25
+ jQuery("body").append("<div class='folder-media-popup-form' id='custom-folder-media-popup-form'></div>");
26
+ jQuery("#custom-folder-media-popup-form").append("<div class='media-popup-form' id='custom-popup-form-content'></div>");
27
+ jQuery(".media-popup-form").append('<div id="add-update-folder-title" class="add-update-folder-title">You\'ve reached the 10 folder limitation!</div>');
28
+ jQuery(".media-popup-form").append('<div class="folder-form-message">Unlock unlimited amount of folders by upgrading to one of our pro plans.</div>');
29
+ jQuery(".media-popup-form").append('<div class="folder-form-buttons"><a href="javascript:;" class="remove-media-form">Cancel</a><a href="'+folders_media_options.activate_url+'" target="_blank" class="form-submit-btn" style="width: 120px">See Pro Plans</button></div>');
30
+ }
31
+ } else {
32
+ if (jQuery("#custom-folder-media-popup-form").length) {
33
+ jQuery("#custom-folder-media-popup-form").remove();
34
+ }
35
+ if (!jQuery("#custom-folder-media-popup-form").length) {
36
+ jQuery("body").append("<div class='folder-media-popup-form' id='custom-folder-media-popup-form'></div>");
37
+ jQuery("#custom-folder-media-popup-form").append("<div class='media-popup-form' id='custom-popup-form-content'></div>");
38
+ jQuery("#custom-popup-form-content").append("<form action='#' id='folder-media-popup-form' method='post'></form>");
39
+ jQuery("#folder-media-popup-form").append('<div id="add-update-folder-title" class="add-update-folder-title">Add Folder</div>');
40
+ jQuery("#folder-media-popup-form").append('<div class="folder-form-input"><input id="media-folder-name" autocomplete="off" placeholder="Folder name" class=""></div>');
41
+ jQuery("#folder-media-popup-form").append('<div class="folder-form-errors" id="media-form-error"><span class="dashicons dashicons-info"></span> Please enter folder name</div>');
42
+ jQuery("#folder-media-popup-form").append('<div class="folder-form-buttons"><button type="submit" class="form-submit-btn" id="save-media-folder" style="width: 106px">Submit</button><a href="javascript:;" class="remove-media-form">Cancel</a></div>');
43
+ jQuery("#media-folder-name").focus();
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ if(jQuery(".media-toolbar #media-attachment-taxonomy-filter").length) {
50
+ jQuery("#media-attachment-taxonomy-filter").val(jQuery(this).val());
51
+ jQuery("#media-attachment-taxonomy-filter").trigger("change");
52
+ }
53
+ });
54
+
55
+ jQuery(document).on("submit", "#folder-media-popup-form", function(){
56
+ if(jQuery.trim(jQuery("#media-folder-name").val()) == "") {
57
+ jQuery("#media-form-error").show();
58
+ jQuery("#media-folder-name").focus();
59
+ } else {
60
+ jQuery("button#save-media-folder").html("<span class='spinner-border'></span>");
61
+ jQuery("button#save-media-folder").attr("disabled", true);
62
+ var orderNumber = -1;
63
+ jQuery(".folder_for_media option").each(function(){
64
+ thisText = jQuery(this).text();
65
+ if(jQuery.trim(thisText[0]) != "") {
66
+ orderNumber++;
67
+ }
68
+ });
69
+ jQuery.ajax({
70
+ url: folders_media_options.ajax_url,
71
+ data: "action=wcp_add_new_folder&parent_id=0&is_from_media=1&type=attachment&term_id=0&order="+orderNumber+"&name="+jQuery.trim(jQuery("#media-folder-name").val())+"&nonce=" +folders_media_options.nonce,
72
+ type: 'post',
73
+ success: function (res) {
74
+ result = jQuery.parseJSON(res);
75
+ if (result.status == '1') {
76
+ resetMediaID = result.id;
77
+ folders_media_options.is_key_active = result.is_key_active;
78
+ folders_media_options.folders = result.folders;
79
+ //resetSelectMediaDropDown();
80
+ jQuery(".folder_for_media option:last").before("<option value='"+result.id+"'>"+jQuery.trim(jQuery("#media-folder-name").val())+"</option>");
81
+ jQuery(".folder_for_media").val(result.id).trigger("change");
82
+ jQuery(".folder-media-popup-form").remove();
83
+ } else {
84
+ jQuery(".folder-form-errors").html(result.message).show();
85
+ jQuery("button#save-media-folder").attr("disabled", false);
86
+ jQuery("button#save-media-folder").html("Submit");
87
+ }
88
+ }
89
+ });
90
+ }
91
+ return false;
92
+ });
93
+
94
+ jQuery(document).on("click", ".remove-media-form", function(e){
95
+ e.stopPropagation();
96
+ jQuery("#custom-folder-media-popup-form").remove();
97
+ jQuery(".folder_for_media").val("-1").trigger("change");
98
+ jQuery("#media-attachment-taxonomy-filter").each(function(){
99
+ jQuery(this).val("all").trigger("change");
100
+ });
101
+ });
102
+ jQuery(document).on("click", "#custom-folder-media-popup-form", function (e) {
103
+ jQuery("#custom-folder-media-popup-form").remove();
104
+ jQuery(".folder_for_media").val("-1").trigger("change");
105
+ jQuery("#media-attachment-taxonomy-filter").each(function(){
106
+ jQuery(this).val("all").trigger("change");
107
+ });
108
+ });
109
+ jQuery(document).on("click", ".media-popup-form", function (e) {
110
+ e.stopPropagation();
111
+ });
folders.php CHANGED
@@ -2,14 +2,14 @@
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
- * Version: 2.5
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
9
  * Domain Path: /languages
10
  */
11
 
12
- defined('ABSPATH') or wp_die('Nope, not accessing this');
13
 
14
  if(!defined("WCP_FOLDERS_PLUGIN_FILE")) {
15
  define('WCP_FOLDERS_PLUGIN_FILE', __FILE__);
@@ -30,7 +30,7 @@ if(!defined("WCP_FOLDER_URL")) {
30
  define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
31
  }
32
  if(!defined("WCP_FOLDER_VERSION")) {
33
- define('WCP_FOLDER_VERSION', "2.5");
34
  }
35
 
36
  include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
+ * Version: 2.5.1
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
9
  * Domain Path: /languages
10
  */
11
 
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  if(!defined("WCP_FOLDERS_PLUGIN_FILE")) {
15
  define('WCP_FOLDERS_PLUGIN_FILE', __FILE__);
30
  define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
31
  }
32
  if(!defined("WCP_FOLDER_VERSION")) {
33
+ define('WCP_FOLDER_VERSION', "2.5.1");
34
  }
35
 
36
  include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
includes/class-affiliate.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Folder_affiliate_program {
3
 
4
  public $plugin_name = "Folders";
@@ -12,160 +13,164 @@ class Folder_affiliate_program {
12
  }
13
 
14
  public function affiliate_program() {
15
- $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
16
- $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
17
- if(!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug."_affiliate_program")) {
18
- if($days == -1) {
19
- add_option($this->plugin_slug."_hide_affiliate_box", "1");
20
- } else {
21
- $date = date("Y-m-d", strtotime("+".$days." days"));
22
- update_option($this->plugin_slug."_show_affiliate_box_after", $date);
 
 
23
  }
 
24
  }
25
- die;
26
  }
27
 
28
  public function admin_notices() {
29
- $is_hidden = get_option($this->plugin_slug."_hide_affiliate_box");
30
- if($is_hidden !== false) {
31
- return;
32
- }
33
- $date_to_show = get_option($this->plugin_slug."_show_affiliate_box_after");
34
- if($date_to_show === false || empty($date_to_show)) {
35
- $date = date("Y-m-d", strtotime("+5 days"));
36
- update_option($this->plugin_slug."_show_affiliate_box_after", $date);
37
- return;
38
- }
39
- $current_date = date("Y-m-d");
40
- if($current_date < $date_to_show) {
41
- return;
42
- }
43
- ?>
44
- <style>
45
- .<?php echo $this->plugin_slug ?>-premio-affiliate p a {
46
- display: inline-block;
47
- float: right;
48
- text-decoration: none;
49
- color: #999999;
50
- position: absolute;
51
- right: 12px;
52
- top: 12px;
53
- }
54
- .<?php echo $this->plugin_slug ?>-premio-affiliate p a:hover, .<?php echo $this->plugin_slug ?>-premio-affiliate p a:focus {
55
- color: #333333;
56
- }
57
- .<?php echo $this->plugin_slug ?>-premio-affiliate .button span {
58
- display: inline-block;
59
- line-height: 27px;
60
- font-size: 16px;
61
- }
62
- .<?php echo $this->plugin_slug ?>-premio-affiliate {
63
- padding: 1px 100px 12px 12px;
64
- margin: 15px 15px 2px;
65
- position: relative;
66
- }
67
- .<?php echo $this->plugin_slug ?>-affiliate-popup {
68
- position: fixed;
69
- width: 100%;
70
- height: 100%;
71
- z-index: 10001;
72
- background: rgba(0,0,0,0.65);
73
- top: 0;
74
- left: 0;
75
- display: none;
76
- }
77
- .<?php echo $this->plugin_slug ?>-affiliate-popup-content {
78
- background: #ffffff;
79
- padding: 20px;
80
- position: absolute;
81
- max-width: 450px;
82
- width: 100%;
83
- margin: 0 auto;
84
- top: 45%;
85
- left: 0;
86
- right: 0;
87
- -webkit-border-radius: 5px;
88
- -moz-border-radius: 5px;
89
- border-radius: 5px;: ;
90
- }
91
- .<?php echo $this->plugin_slug ?>-affiliate-title {
92
- padding: 0 0 10px 0;
93
- font-weight: bold;
94
  }
95
- .<?php echo $this->plugin_slug ?>-affiliate-options a {
96
- display: block;
97
- margin: 5px 0 5px 0;
98
- color: #333;
99
- text-decoration: none;
100
- }
101
- .<?php echo $this->plugin_slug ?>-affiliate-options a.dismiss {
102
- color: #999;
103
- }
104
- .<?php echo $this->plugin_slug ?>-affiliate-options a:hover, .affiliate-options a:focus {
105
- color: #0073aa;
106
- }
107
- button.<?php echo $this->plugin_slug ?>-close-affiliate-popup {
108
- position: absolute;
109
- top: 5px;
110
- right: 0;
111
- border: none;
112
- background: transparent;
113
- cursor: pointer;
114
  }
115
- a.button.button-primary.<?php echo $this->plugin_slug ?>-affiliate-btn {
116
- font-size: 14px;
117
- background: #F51366;
118
- color: #fff;
119
- border: solid 1px #F51366;
120
- border-radius: 3px;
121
- line-height: 24px;
122
- -webkit-box-shadow: 0 3px 5px -3px #333333;
123
- -moz-box-shadow: 0 3px 5px -3px #333333;
124
- box-shadow: 0 3px 5px -3px #333333;
125
- text-shadow: none;
126
  }
127
- </style>
128
- <div class="notice notice-info chaty-notice <?php echo $this->plugin_slug ?>-premio-affiliate <?php echo $this->plugin_slug ?>-premio-affiliate">
129
- <p>Hi there, you've been using <?php echo $this->plugin_name ?> for a while now. Do you know that <b><?php echo $this->plugin_name ?></b> has an affiliate program? Join now and get <b>25% lifetime commission</b> <a href="javascript:;" class="dismiss-btn"><span class="dashicons dashicons-no-alt"></span> Dismiss</a></p>
130
- <div class="clear clearfix"></div>
131
- <a class="button button-primary <?php echo $this->plugin_slug ?>-affiliate-btn" target="_blank" href="https://premio.io/affiliates/?utm_source=inapp&plugin=folders&domain=<?php echo $_SERVER['HTTP_HOST'] ?>">Tell me more <span class="dashicons dashicons-arrow-right-alt"></span></a>
132
- </div>
133
- <div class="<?php echo $this->plugin_slug ?>-affiliate-popup">
134
- <div class="<?php echo $this->plugin_slug ?>-affiliate-popup-content">
135
- <button class="<?php echo $this->plugin_slug ?>-close-affiliate-popup"><span class="dashicons dashicons-no-alt"></span></button>
136
- <div class="<?php echo $this->plugin_slug ?>-affiliate-title">Would you like us to remind you about this later?</div>
137
- <div class="<?php echo $this->plugin_slug ?>-affiliate-options">
138
- <a href="javascript:;" data-days="3">Remind me in 3 days</a>
139
- <a href="javascript:;" data-days="10">Remind me in 10 days</a>
140
- <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  </div>
142
  </div>
143
- </div>
144
- <script>
145
- jQuery(document).ready(function(){
146
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-affiliate p a.dismiss-btn", function(){
147
- jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").show();
148
- });
149
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-affiliate-popup", function(){
150
- jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
151
- });
152
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-affiliate-options a", function(){
153
- var dataDays = jQuery(this).attr("data-days");
154
- jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
155
- jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").hide();
156
- jQuery.ajax({
157
- url: "<?php echo admin_url("admin-ajax.php") ?>",
158
- data: "action=<?php echo esc_attr($this->plugin_slug) ?>_affiliate_program&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_affiliate_program")) ?>",
159
- type: "post",
160
- success: function() {
161
- jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").remove();
162
- jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").remove();
163
- }
164
  });
165
  });
166
- });
167
- </script>
168
- <?php
169
  }
170
  }
171
  $Folder_affiliate_program = new Folder_affiliate_program();
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  class Folder_affiliate_program {
4
 
5
  public $plugin_name = "Folders";
13
  }
14
 
15
  public function affiliate_program() {
16
+ if (current_user_can('manage_options')) {
17
+ $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
18
+ $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
19
+ if (!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug . "_affiliate_program")) {
20
+ if ($days == -1) {
21
+ add_option($this->plugin_slug . "_hide_affiliate_box", "1");
22
+ } else {
23
+ $date = date("Y-m-d", strtotime("+" . $days . " days"));
24
+ update_option($this->plugin_slug . "_show_affiliate_box_after", $date);
25
+ }
26
  }
27
+ die;
28
  }
 
29
  }
30
 
31
  public function admin_notices() {
32
+ if (current_user_can('manage_options')) {
33
+ $is_hidden = get_option($this->plugin_slug."_hide_affiliate_box");
34
+ if($is_hidden !== false) {
35
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
+ $date_to_show = get_option($this->plugin_slug."_show_affiliate_box_after");
38
+ if($date_to_show === false || empty($date_to_show)) {
39
+ $date = date("Y-m-d", strtotime("+5 days"));
40
+ update_option($this->plugin_slug."_show_affiliate_box_after", $date);
41
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
+ $current_date = date("Y-m-d");
44
+ if($current_date < $date_to_show) {
45
+ return;
 
 
 
 
 
 
 
 
46
  }
47
+ ?>
48
+ <style>
49
+ .<?php echo $this->plugin_slug ?>-premio-affiliate p a {
50
+ display: inline-block;
51
+ float: right;
52
+ text-decoration: none;
53
+ color: #999999;
54
+ position: absolute;
55
+ right: 12px;
56
+ top: 12px;
57
+ }
58
+ .<?php echo $this->plugin_slug ?>-premio-affiliate p a:hover, .<?php echo $this->plugin_slug ?>-premio-affiliate p a:focus {
59
+ color: #333333;
60
+ }
61
+ .<?php echo $this->plugin_slug ?>-premio-affiliate .button span {
62
+ display: inline-block;
63
+ line-height: 27px;
64
+ font-size: 16px;
65
+ }
66
+ .<?php echo $this->plugin_slug ?>-premio-affiliate {
67
+ padding: 1px 100px 12px 12px;
68
+ margin: 15px 15px 2px;
69
+ position: relative;
70
+ }
71
+ .<?php echo $this->plugin_slug ?>-affiliate-popup {
72
+ position: fixed;
73
+ width: 100%;
74
+ height: 100%;
75
+ z-index: 10001;
76
+ background: rgba(0,0,0,0.65);
77
+ top: 0;
78
+ left: 0;
79
+ display: none;
80
+ }
81
+ .<?php echo $this->plugin_slug ?>-affiliate-popup-content {
82
+ background: #ffffff;
83
+ padding: 20px;
84
+ position: absolute;
85
+ max-width: 450px;
86
+ width: 100%;
87
+ margin: 0 auto;
88
+ top: 45%;
89
+ left: 0;
90
+ right: 0;
91
+ -webkit-border-radius: 5px;
92
+ -moz-border-radius: 5px;
93
+ border-radius: 5px;: ;
94
+ }
95
+ .<?php echo $this->plugin_slug ?>-affiliate-title {
96
+ padding: 0 0 10px 0;
97
+ font-weight: bold;
98
+ }
99
+ .<?php echo $this->plugin_slug ?>-affiliate-options a {
100
+ display: block;
101
+ margin: 5px 0 5px 0;
102
+ color: #333;
103
+ text-decoration: none;
104
+ }
105
+ .<?php echo $this->plugin_slug ?>-affiliate-options a.dismiss {
106
+ color: #999;
107
+ }
108
+ .<?php echo $this->plugin_slug ?>-affiliate-options a:hover, .affiliate-options a:focus {
109
+ color: #0073aa;
110
+ }
111
+ button.<?php echo $this->plugin_slug ?>-close-affiliate-popup {
112
+ position: absolute;
113
+ top: 5px;
114
+ right: 0;
115
+ border: none;
116
+ background: transparent;
117
+ cursor: pointer;
118
+ }
119
+ a.button.button-primary.<?php echo $this->plugin_slug ?>-affiliate-btn {
120
+ font-size: 14px;
121
+ background: #F51366;
122
+ color: #fff;
123
+ border: solid 1px #F51366;
124
+ border-radius: 3px;
125
+ line-height: 24px;
126
+ -webkit-box-shadow: 0 3px 5px -3px #333333;
127
+ -moz-box-shadow: 0 3px 5px -3px #333333;
128
+ box-shadow: 0 3px 5px -3px #333333;
129
+ text-shadow: none;
130
+ }
131
+ </style>
132
+ <div class="notice notice-info chaty-notice <?php echo $this->plugin_slug ?>-premio-affiliate <?php echo $this->plugin_slug ?>-premio-affiliate">
133
+ <p>Hi there, you've been using <?php echo $this->plugin_name ?> for a while now. Do you know that <b><?php echo $this->plugin_name ?></b> has an affiliate program? Join now and get <b>25% lifetime commission</b> <a href="javascript:;" class="dismiss-btn"><span class="dashicons dashicons-no-alt"></span> Dismiss</a></p>
134
+ <div class="clear clearfix"></div>
135
+ <a class="button button-primary <?php echo $this->plugin_slug ?>-affiliate-btn" target="_blank" href="https://premio.io/affiliates/?utm_source=inapp&plugin=folders&domain=<?php echo $_SERVER['HTTP_HOST'] ?>">Tell me more <span class="dashicons dashicons-arrow-right-alt"></span></a>
136
+ </div>
137
+ <div class="<?php echo $this->plugin_slug ?>-affiliate-popup">
138
+ <div class="<?php echo $this->plugin_slug ?>-affiliate-popup-content">
139
+ <button class="<?php echo $this->plugin_slug ?>-close-affiliate-popup"><span class="dashicons dashicons-no-alt"></span></button>
140
+ <div class="<?php echo $this->plugin_slug ?>-affiliate-title">Would you like us to remind you about this later?</div>
141
+ <div class="<?php echo $this->plugin_slug ?>-affiliate-options">
142
+ <a href="javascript:;" data-days="3">Remind me in 3 days</a>
143
+ <a href="javascript:;" data-days="10">Remind me in 10 days</a>
144
+ <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
145
+ </div>
146
  </div>
147
  </div>
148
+ <script>
149
+ jQuery(document).ready(function(){
150
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-affiliate p a.dismiss-btn", function(){
151
+ jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").show();
152
+ });
153
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-affiliate-popup", function(){
154
+ jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
155
+ });
156
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-affiliate-options a", function(){
157
+ var dataDays = jQuery(this).attr("data-days");
158
+ jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
159
+ jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").hide();
160
+ jQuery.ajax({
161
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
162
+ data: "action=<?php echo esc_attr($this->plugin_slug) ?>_affiliate_program&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_affiliate_program")) ?>",
163
+ type: "post",
164
+ success: function() {
165
+ jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").remove();
166
+ jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").remove();
167
+ }
168
+ });
169
  });
170
  });
171
+ </script>
172
+ <?php
173
+ }
174
  }
175
  }
176
  $Folder_affiliate_program = new Folder_affiliate_program();
includes/class-polylang.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ class WCP_Folder_PolyLang {
4
+ private $active;
5
+ private $pl_term_taxonomy_id;
6
+ private $total;
7
+ private $table_filebird_polylang;
8
+ public $delete_process_id;
9
+
10
+ public function __construct()
11
+ {
12
+ $this->active = false;
13
+ $this->total = 0;
14
+ $this->delete_process_id = null;
15
+ add_action("admin_init", array($this, 'init'));
16
+ }
17
+
18
+
19
+ public function init()
20
+ {
21
+ global $wpdb, $polylang;
22
+ $this->active = function_exists("pll_get_post_translations");
23
+
24
+ if ($this->active) {
25
+ if (isset($polylang->curlang) && is_object($polylang->curlang))
26
+ {
27
+ $this->pl_term_taxonomy_id = $polylang->curlang->term_taxonomy_id;
28
+
29
+ add_filter('premio_folder_item_in_taxonomy', array($this, 'items_in_taxonomy'), 10, 2);
30
+ add_filter('premio_folder_un_categorized_items', array($this, 'un_categorized_items'), 10, 2);
31
+ add_filter('premio_folder_all_categorized_items', array($this, 'all_categorized_items'), 10, 2);
32
+ }
33
+ }
34
+ }
35
+
36
+ public function set_total($post_type){
37
+ if ($this->active) {
38
+ $where = "posts.post_status = 'inherit' OR posts.post_status = 'private'";
39
+ if($post_type != 'attachment') {
40
+ $where = "post_status != 'trash'";
41
+ }
42
+ global $wpdb;
43
+ $query = "SELECT COUNT(tmp.ID) FROM
44
+ (
45
+ SELECT posts.ID
46
+ FROM {$wpdb->posts} AS posts
47
+ LEFT JOIN {$wpdb->term_relationships} AS trs
48
+ ON posts.ID = trs.object_id
49
+ LEFT JOIN {$wpdb->postmeta} AS postmeta
50
+ ON (posts.ID = postmeta.post_id AND postmeta.meta_key = '_wp_attached_file')
51
+ WHERE posts.post_type = '{$post_type}'
52
+ AND trs.term_taxonomy_id IN ({$this->pl_term_taxonomy_id})
53
+ AND ({$where})
54
+ GROUP BY posts.ID
55
+ ) as tmp";
56
+ $this->total = (int)$wpdb->get_var($query);
57
+ }
58
+ }
59
+
60
+ public function items_in_taxonomy($term_id, $arg = array()) {
61
+ if ($this->active) {
62
+ $post_type = isset($arg['post_type']) ? $arg['post_type'] : "";
63
+ $taxonomy = isset($arg['taxonomy']) ? $arg['taxonomy'] : "";
64
+ $where = "posts.post_status = 'inherit' OR posts.post_status = 'private'";
65
+ if($post_type != 'attachment') {
66
+ $where = "post_status != 'trash'";
67
+ }
68
+ global $wpdb;
69
+ $term_taxonomy_id = get_term_by('id', (int)$term_id, $taxonomy, OBJECT)->term_taxonomy_id;
70
+ $query = "SELECT COUNT(tmp.ID) FROM
71
+ (
72
+ SELECT posts.ID FROM {$wpdb->posts} AS posts
73
+ LEFT JOIN {$wpdb->term_relationships} AS tr1
74
+ ON (posts.ID = tr1.object_id)
75
+ INNER JOIN {$wpdb->term_relationships} AS tr2
76
+ ON (posts.ID = tr2.object_id and tr2.term_taxonomy_id IN ($term_taxonomy_id))
77
+ LEFT JOIN {$wpdb->postmeta} AS postmeta ON ( posts.ID = postmeta.post_id AND postmeta.meta_key = '_wp_attached_file' )
78
+ WHERE (tr1.term_taxonomy_id IN ({$this->pl_term_taxonomy_id}))
79
+ AND posts.post_type = '{$post_type}'
80
+ AND (({$where}))
81
+ GROUP BY posts.ID
82
+ ) as tmp
83
+ ";
84
+ $counter = (int)$wpdb->get_var($query);
85
+ return $counter ? $counter : 0;
86
+ }
87
+ return null;
88
+ }
89
+
90
+ public function un_categorized_items($post_type, $taxonomy) {
91
+ if ($this->active) {
92
+ global $wpdb;
93
+ $where = "posts.post_status = 'inherit' OR posts.post_status = 'private'";
94
+ if($post_type != 'attachment') {
95
+ $where = "post_status != 'trash'";
96
+ }
97
+ $query = "SELECT COUNT(tmp.ID) FROM
98
+ (
99
+ SELECT posts.ID
100
+ FROM {$wpdb->posts} AS posts
101
+ INNER JOIN {$wpdb->term_relationships} AS tr1
102
+ ON posts.ID = tr1.object_id AND tr1.term_taxonomy_id IN ({$this->pl_term_taxonomy_id})
103
+ INNER JOIN {$wpdb->term_relationships} AS tr2
104
+ ON (tr2.object_id = posts.ID)
105
+ JOIN {$wpdb->term_taxonomy} as tx
106
+ ON tx.term_taxonomy_id = tr2.term_taxonomy_id AND tx.taxonomy = '{$taxonomy}'
107
+
108
+ WHERE posts.post_type = '{$post_type}'
109
+ AND ({$where})
110
+ GROUP BY posts.ID
111
+ ) as tmp";
112
+ $fileInFolder = (int)$wpdb->get_var($query);
113
+ $fileInFolder = !($fileInFolder)?0:$fileInFolder;
114
+ $this->set_total($post_type);
115
+ return $this->total - $fileInFolder;
116
+ }
117
+ return null;
118
+ }
119
+
120
+ public function all_categorized_items($post_type) {
121
+ if ($this->active) {
122
+ $this->set_total($post_type);
123
+ return $this->total;
124
+ }
125
+ return null;
126
+ }
127
+ }
128
+ if(class_exists('WCP_Folder_PolyLang')) {
129
+ $WCP_Folder_PolyLang = new WCP_Folder_PolyLang();
130
+
131
+ }
includes/class-review-box.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /* Free/Pro Class name change */
3
  class folders_review_box {
4
 
@@ -8,273 +9,277 @@ class folders_review_box {
8
 
9
  public function __construct() {
10
 
11
- add_action("wp_ajax_".$this->plugin_slug."_review_box", array($this, "affiliate_program"));
12
 
13
  add_action('admin_notices', array($this, 'admin_notices'));
14
  }
15
 
16
- public function affiliate_program() {
17
- $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
18
- $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
19
- if(!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug."_review_box")) {
20
- if($days == -1) {
21
- add_option($this->plugin_slug."_hide_review_box", "1");
22
- } else {
23
- $date = date("Y-m-d", strtotime("+".$days." days"));
24
- update_option($this->plugin_slug."_show_review_box_after", $date);
 
 
25
  }
 
26
  }
27
- die;
28
  }
29
 
30
  public function admin_notices() {
31
- $is_hidden = get_option($this->plugin_slug."_hide_review_box");
32
- if($is_hidden !== false) {
33
- return;
34
- }
35
- $current_count = get_option($this->plugin_slug."_show_review_box_after");
36
- if($current_count === false) {
37
- $date = date("Y-m-d", strtotime("+7 days"));
38
- add_option($this->plugin_slug."_show_review_box_after", $date);
39
- return;
40
- } else if($current_count < 35) {
41
- return;
42
- }
43
- $date_to_show = get_option($this->plugin_slug."_show_review_box_after");
44
- if($date_to_show !== false) {
45
- $current_date = date("Y-m-d");
46
- if($current_date < $date_to_show) {
47
  return;
48
  }
49
- }
50
- ?>
51
- <style>
52
- .<?php echo $this->plugin_slug ?>-premio-review-box p a {
53
- display: inline-block;
54
- float: right;
55
- text-decoration: none;
56
- color: #999999;
57
- position: absolute;
58
- right: 12px;
59
- top: 12px;
60
- }
61
- .<?php echo $this->plugin_slug ?>-premio-review-box p a:hover, .<?php echo $this->plugin_slug ?>-premio-review-box p a:focus {
62
- color: #333333;
63
- }
64
- .<?php echo $this->plugin_slug ?>-premio-review-box .button span {
65
- display: inline-block;
66
- line-height: 27px;
67
- font-size: 16px;
68
- }
69
- .<?php echo $this->plugin_slug ?>-review-box-popup {
70
- position: fixed;
71
- width: 100%;
72
- height: 100%;
73
- z-index: 10001;
74
- background: rgba(0,0,0,0.65);
75
- top: 0;
76
- left: 0;
77
- display: none;
78
- }
79
- .<?php echo $this->plugin_slug ?>-review-box-popup-content {
80
- background: #ffffff;
81
- padding: 20px;
82
- position: absolute;
83
- max-width: 450px;
84
- width: 100%;
85
- margin: 0 auto;
86
- top: 45%;
87
- left: 0;
88
- right: 0;
89
- -webkit-border-radius: 5px;
90
- -moz-border-radius: 5px;
91
- border-radius: 5px;: ;
92
- }
93
- .<?php echo $this->plugin_slug ?>-review-box-title {
94
- padding: 0 0 10px 0;
95
- font-weight: bold;
96
- }
97
- .<?php echo $this->plugin_slug ?>-review-box-options a {
98
- display: block;
99
- margin: 5px 0 5px 0;
100
- color: #333;
101
- text-decoration: none;
102
- }
103
- .<?php echo $this->plugin_slug ?>-review-box-options a.dismiss {
104
- color: #999;
105
- }
106
- .<?php echo $this->plugin_slug ?>-review-box-options a:hover, .affiliate-options a:focus {
107
- color: #0073aa;
108
- }
109
- button.<?php echo $this->plugin_slug ?>-close-review-box-popup {
110
- position: absolute;
111
- top: 5px;
112
- right: 0;
113
- border: none;
114
- background: transparent;
115
- cursor: pointer;
116
- }
117
- a.button.button-primary.<?php echo $this->plugin_slug ?>-review-box-btn {
118
- font-size: 14px;
119
- background: #F51366;
120
- color: #fff;
121
- border: solid 1px #F51366;
122
- border-radius: 3px;
123
- line-height: 24px;
124
- -webkit-box-shadow: 0 3px 5px -3px #333333;
125
- -moz-box-shadow: 0 3px 5px -3px #333333;
126
- box-shadow: 0 3px 5px -3px #333333;
127
- text-shadow: none;
128
- }
129
- .notice.notice-info.premio-notice {
130
- position: relative;
131
- padding: 1px 30px 1px 12px;
132
- }
133
- .notice.notice-info.premio-notice ul li {
134
- margin: 0;
135
- }
136
- .notice.notice-info.premio-notice ul li a {
137
- color: #0073aa;
138
- font-size: 14px;
139
- text-decoration: underline;
140
- }
141
- .<?php echo $this->plugin_slug ?>-premio-review-box p {
142
- display: inline-block;
143
- line-height: 30px;
144
- vertical-align: middle;
145
- padding: 0 10px 0 0;
146
- }
147
- .<?php echo $this->plugin_slug ?>-premio-review-box p img {
148
- width: 30px;
149
- height: 30px;
150
- display: inline-block;
151
- margin: 0 10px;
152
- vertical-align: middle;
153
- border-radius: 15px;
154
- }
155
- .review-thanks-img img {
156
- width: 100%;
157
- height: auto;
158
- max-width: 200px;
159
- }
160
- .review-thanks-msg {
161
- padding: 5px 0 0 10px;
162
- display: inline-block;
163
- text-align: left;
164
- }
165
- .review-thanks-box {
166
- padding: 10px 0 10px 0;
167
- position: relative;
168
- text-align: center;
169
- display: none;
170
- }
171
- .review-box-default {
172
- }
173
- .review-thanks-btn {
174
- border: 0;
175
- background: transparent;
176
- position: absolute;
177
- right: -30px;
178
- top: 5px;
179
- }
180
- .review-thanks-img {
181
- display: inline-block;
182
- vertical-align: top;
183
- width: 200px;
184
- }
185
- .thanks-msg-title {
186
- font-weight: bold;
187
- font-size: 18px;
188
- }
189
- .thanks-msg-desc {
190
- padding: 24px 0;
191
  }
192
- .thanks-msg-footer {
193
- font-weight: bold;
 
 
 
 
194
  }
195
- </style>
196
- <div class="notice notice-info premio-notice <?php echo $this->plugin_slug ?>-premio-review-box <?php echo $this->plugin_slug ?>-premio-review-box">
197
- <div class="review-box-default" id="default-review-box-<?php echo $this->plugin_slug ?>">
198
- <p>
199
- Hi there, it seems like <b><?php echo $this->plugin_name ?></b> is bringing you some value, and that's pretty awesome! Can you please show us some love and rate <?php echo $this->plugin_name ?> on WordPress? It'll only take 2 minutes of your time, and will really help us spread the word
200
- - <b>Gal Dubinski</b>, Co-founder <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."../assets/images/premio-owner.png") ?>" />
201
- <a href="javascript:;" class="dismiss-btn <?php echo $this->plugin_slug ?>-premio-review-dismiss-btn"><span class="dashicons dashicons-no-alt"></span></a>
202
- </p>
203
- <div class="clear clearfix"></div>
204
- <ul>
205
- <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="https://wordpress.org/support/plugin/folders/reviews/?filter=5" target="_blank">I'd love to help :)</a></li>
206
- <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-future-btn" href="javascript:;">Not this time</a></li>
207
- <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="javascript:;">I've already rated you</a></li>
208
- </ul>
209
- </div>
210
- <div class="review-thanks-box" id="review-thanks-<?php echo $this->plugin_slug ?>">
211
- <button class="<?php echo $this->plugin_slug ?>-close-thanks-btn review-thanks-btn"><span class="dashicons dashicons-no-alt"></span></button>
212
-
213
- <div class="review-thanks-img">
214
- <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."../assets/images/thanks.gif") ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  </div>
216
- <div class="review-thanks-msg">
217
- <div class="thanks-msg-title">You are awesome &#128591;</div>
218
- <div class="thanks-msg-desc">Thanks for your support, We really appreciate it!</div>
219
- <div class="thanks-msg-footer">Premio team</div>
 
 
 
 
 
 
 
 
220
  </div>
221
- <div class="clear clearfix"></div>
222
  </div>
223
- </div>
224
- <div class="<?php echo $this->plugin_slug ?>-review-box-popup">
225
- <div class="<?php echo $this->plugin_slug ?>-review-box-popup-content">
226
- <button class="<?php echo $this->plugin_slug ?>-close-review-box-popup"><span class="dashicons dashicons-no-alt"></span></button>
227
- <div class="<?php echo $this->plugin_slug ?>-review-box-title">Would you like us to remind you about this later?</div>
228
- <div class="<?php echo $this->plugin_slug ?>-review-box-options">
229
- <a href="javascript:;" data-days="3">Remind me in 3 days</a>
230
- <a href="javascript:;" data-days="10">Remind me in 10 days</a>
231
- <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
232
  </div>
233
  </div>
234
- </div>
235
- <script>
236
- jQuery(document).ready(function(){
237
- jQuery("body").addClass("has-premio-box");
238
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-review-dismiss-btn, .<?php echo $this->plugin_slug ?>-premio-review-box-future-btn", function(){
239
- jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").show();
240
- });
241
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-review-box-popup", function(){
242
- jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").hide();
243
- });
244
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-thanks-btn", function(){
245
- jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
246
- jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
247
- });
248
- jQuery(document).on("click",".<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn",function(){
249
- jQuery("#default-review-box-<?php echo $this->plugin_slug ?>").hide();
250
- jQuery("#review-thanks-<?php echo $this->plugin_slug ?>").show();
251
- jQuery.ajax({
252
- url: "<?php echo admin_url("admin-ajax.php") ?>",
253
- data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days=-1&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
254
- type: "post",
255
- success: function() {
256
 
257
- }
 
258
  });
259
- });
260
- jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-review-box-options a", function(){
261
- var dataDays = jQuery(this).attr("data-days");
262
- jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
263
- jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
264
- jQuery("body").removeClass("has-premio-box");
265
- jQuery.ajax({
266
- url: "<?php echo admin_url("admin-ajax.php") ?>",
267
- data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
268
- type: "post",
269
- success: function() {
270
- jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
271
- jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
272
- }
273
  });
274
  });
275
- });
276
- </script>
277
- <?php
278
  }
279
  }
280
  $folders_review_box = new folders_review_box();
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  /* Free/Pro Class name change */
4
  class folders_review_box {
5
 
9
 
10
  public function __construct() {
11
 
12
+ add_action("wp_ajax_".$this->plugin_slug."_review_box", array($this, "review_box"));
13
 
14
  add_action('admin_notices', array($this, 'admin_notices'));
15
  }
16
 
17
+ public function review_box() {
18
+ if (current_user_can('manage_options')) {
19
+ $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
20
+ $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
21
+ if (!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug . "_review_box")) {
22
+ if ($days == -1) {
23
+ add_option($this->plugin_slug . "_hide_review_box", "1");
24
+ } else {
25
+ $date = date("Y-m-d", strtotime("+" . $days . " days"));
26
+ update_option($this->plugin_slug . "_show_review_box_after", $date);
27
+ }
28
  }
29
+ die;
30
  }
 
31
  }
32
 
33
  public function admin_notices() {
34
+ if (current_user_can('manage_options')) {
35
+ $is_hidden = get_option($this->plugin_slug."_hide_review_box");
36
+ if($is_hidden !== false) {
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  return;
38
  }
39
+ $current_count = get_option($this->plugin_slug."_show_review_box_after");
40
+ if($current_count === false) {
41
+ $date = date("Y-m-d", strtotime("+7 days"));
42
+ add_option($this->plugin_slug."_show_review_box_after", $date);
43
+ return;
44
+ } else if($current_count < 35) {
45
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
+ $date_to_show = get_option($this->plugin_slug."_show_review_box_after");
48
+ if($date_to_show !== false) {
49
+ $current_date = date("Y-m-d");
50
+ if($current_date < $date_to_show) {
51
+ return;
52
+ }
53
  }
54
+ ?>
55
+ <style>
56
+ .<?php echo $this->plugin_slug ?>-premio-review-box p a {
57
+ display: inline-block;
58
+ float: right;
59
+ text-decoration: none;
60
+ color: #999999;
61
+ position: absolute;
62
+ right: 12px;
63
+ top: 12px;
64
+ }
65
+ .<?php echo $this->plugin_slug ?>-premio-review-box p a:hover, .<?php echo $this->plugin_slug ?>-premio-review-box p a:focus {
66
+ color: #333333;
67
+ }
68
+ .<?php echo $this->plugin_slug ?>-premio-review-box .button span {
69
+ display: inline-block;
70
+ line-height: 27px;
71
+ font-size: 16px;
72
+ }
73
+ .<?php echo $this->plugin_slug ?>-review-box-popup {
74
+ position: fixed;
75
+ width: 100%;
76
+ height: 100%;
77
+ z-index: 10001;
78
+ background: rgba(0,0,0,0.65);
79
+ top: 0;
80
+ left: 0;
81
+ display: none;
82
+ }
83
+ .<?php echo $this->plugin_slug ?>-review-box-popup-content {
84
+ background: #ffffff;
85
+ padding: 20px;
86
+ position: absolute;
87
+ max-width: 450px;
88
+ width: 100%;
89
+ margin: 0 auto;
90
+ top: 45%;
91
+ left: 0;
92
+ right: 0;
93
+ -webkit-border-radius: 5px;
94
+ -moz-border-radius: 5px;
95
+ border-radius: 5px;: ;
96
+ }
97
+ .<?php echo $this->plugin_slug ?>-review-box-title {
98
+ padding: 0 0 10px 0;
99
+ font-weight: bold;
100
+ }
101
+ .<?php echo $this->plugin_slug ?>-review-box-options a {
102
+ display: block;
103
+ margin: 5px 0 5px 0;
104
+ color: #333;
105
+ text-decoration: none;
106
+ }
107
+ .<?php echo $this->plugin_slug ?>-review-box-options a.dismiss {
108
+ color: #999;
109
+ }
110
+ .<?php echo $this->plugin_slug ?>-review-box-options a:hover, .affiliate-options a:focus {
111
+ color: #0073aa;
112
+ }
113
+ button.<?php echo $this->plugin_slug ?>-close-review-box-popup {
114
+ position: absolute;
115
+ top: 5px;
116
+ right: 0;
117
+ border: none;
118
+ background: transparent;
119
+ cursor: pointer;
120
+ }
121
+ a.button.button-primary.<?php echo $this->plugin_slug ?>-review-box-btn {
122
+ font-size: 14px;
123
+ background: #F51366;
124
+ color: #fff;
125
+ border: solid 1px #F51366;
126
+ border-radius: 3px;
127
+ line-height: 24px;
128
+ -webkit-box-shadow: 0 3px 5px -3px #333333;
129
+ -moz-box-shadow: 0 3px 5px -3px #333333;
130
+ box-shadow: 0 3px 5px -3px #333333;
131
+ text-shadow: none;
132
+ }
133
+ .notice.notice-info.premio-notice {
134
+ position: relative;
135
+ padding: 1px 30px 1px 12px;
136
+ }
137
+ .notice.notice-info.premio-notice ul li {
138
+ margin: 0;
139
+ }
140
+ .notice.notice-info.premio-notice ul li a {
141
+ color: #0073aa;
142
+ font-size: 14px;
143
+ text-decoration: underline;
144
+ }
145
+ .<?php echo $this->plugin_slug ?>-premio-review-box p {
146
+ display: inline-block;
147
+ line-height: 30px;
148
+ vertical-align: middle;
149
+ padding: 0 10px 0 0;
150
+ }
151
+ .<?php echo $this->plugin_slug ?>-premio-review-box p img {
152
+ width: 30px;
153
+ height: 30px;
154
+ display: inline-block;
155
+ margin: 0 10px;
156
+ vertical-align: middle;
157
+ border-radius: 15px;
158
+ }
159
+ .review-thanks-img img {
160
+ width: 100%;
161
+ height: auto;
162
+ max-width: 200px;
163
+ }
164
+ .review-thanks-msg {
165
+ padding: 5px 0 0 10px;
166
+ display: inline-block;
167
+ text-align: left;
168
+ }
169
+ .review-thanks-box {
170
+ padding: 10px 0 10px 0;
171
+ position: relative;
172
+ text-align: center;
173
+ display: none;
174
+ }
175
+ .review-box-default {
176
+ }
177
+ .review-thanks-btn {
178
+ border: 0;
179
+ background: transparent;
180
+ position: absolute;
181
+ right: -30px;
182
+ top: 5px;
183
+ }
184
+ .review-thanks-img {
185
+ display: inline-block;
186
+ vertical-align: top;
187
+ width: 200px;
188
+ }
189
+ .thanks-msg-title {
190
+ font-weight: bold;
191
+ font-size: 18px;
192
+ }
193
+ .thanks-msg-desc {
194
+ padding: 24px 0;
195
+ }
196
+ .thanks-msg-footer {
197
+ font-weight: bold;
198
+ }
199
+ </style>
200
+ <div class="notice notice-info premio-notice <?php echo $this->plugin_slug ?>-premio-review-box <?php echo $this->plugin_slug ?>-premio-review-box">
201
+ <div class="review-box-default" id="default-review-box-<?php echo $this->plugin_slug ?>">
202
+ <p>
203
+ Hi there, it seems like <b><?php echo $this->plugin_name ?></b> is bringing you some value, and that's pretty awesome! Can you please show us some love and rate <?php echo $this->plugin_name ?> on WordPress? It'll only take 2 minutes of your time, and will really help us spread the word
204
+ - <b>Gal Dubinski</b>, Co-founder <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."../assets/images/premio-owner.png") ?>" />
205
+ <a href="javascript:;" class="dismiss-btn <?php echo $this->plugin_slug ?>-premio-review-dismiss-btn"><span class="dashicons dashicons-no-alt"></span></a>
206
+ </p>
207
+ <div class="clear clearfix"></div>
208
+ <ul>
209
+ <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="https://wordpress.org/support/plugin/folders/reviews/?filter=5" target="_blank">I'd love to help :)</a></li>
210
+ <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-future-btn" href="javascript:;">Not this time</a></li>
211
+ <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="javascript:;">I've already rated you</a></li>
212
+ </ul>
213
  </div>
214
+ <div class="review-thanks-box" id="review-thanks-<?php echo $this->plugin_slug ?>">
215
+ <button class="<?php echo $this->plugin_slug ?>-close-thanks-btn review-thanks-btn"><span class="dashicons dashicons-no-alt"></span></button>
216
+
217
+ <div class="review-thanks-img">
218
+ <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."../assets/images/thanks.gif") ?>" />
219
+ </div>
220
+ <div class="review-thanks-msg">
221
+ <div class="thanks-msg-title">You are awesome &#128591;</div>
222
+ <div class="thanks-msg-desc">Thanks for your support, We really appreciate it!</div>
223
+ <div class="thanks-msg-footer">Premio team</div>
224
+ </div>
225
+ <div class="clear clearfix"></div>
226
  </div>
 
227
  </div>
228
+ <div class="<?php echo $this->plugin_slug ?>-review-box-popup">
229
+ <div class="<?php echo $this->plugin_slug ?>-review-box-popup-content">
230
+ <button class="<?php echo $this->plugin_slug ?>-close-review-box-popup"><span class="dashicons dashicons-no-alt"></span></button>
231
+ <div class="<?php echo $this->plugin_slug ?>-review-box-title">Would you like us to remind you about this later?</div>
232
+ <div class="<?php echo $this->plugin_slug ?>-review-box-options">
233
+ <a href="javascript:;" data-days="3">Remind me in 3 days</a>
234
+ <a href="javascript:;" data-days="10">Remind me in 10 days</a>
235
+ <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
236
+ </div>
237
  </div>
238
  </div>
239
+ <script>
240
+ jQuery(document).ready(function(){
241
+ jQuery("body").addClass("has-premio-box");
242
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-review-dismiss-btn, .<?php echo $this->plugin_slug ?>-premio-review-box-future-btn", function(){
243
+ jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").show();
244
+ });
245
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-review-box-popup", function(){
246
+ jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").hide();
247
+ });
248
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-thanks-btn", function(){
249
+ jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
250
+ jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
251
+ });
252
+ jQuery(document).on("click",".<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn",function(){
253
+ jQuery("#default-review-box-<?php echo $this->plugin_slug ?>").hide();
254
+ jQuery("#review-thanks-<?php echo $this->plugin_slug ?>").show();
255
+ jQuery.ajax({
256
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
257
+ data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days=-1&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
258
+ type: "post",
259
+ success: function() {
 
260
 
261
+ }
262
+ });
263
  });
264
+ jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-review-box-options a", function(){
265
+ var dataDays = jQuery(this).attr("data-days");
266
+ jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
267
+ jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
268
+ jQuery("body").removeClass("has-premio-box");
269
+ jQuery.ajax({
270
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
271
+ data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
272
+ type: "post",
273
+ success: function() {
274
+ jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
275
+ jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
276
+ }
277
+ });
278
  });
279
  });
280
+ </script>
281
+ <?php
282
+ }
283
  }
284
  }
285
  $folders_review_box = new folders_review_box();
includes/class-wpml.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ class WCP_Folder_WPML {
4
+ private $is_wpml_active;
5
+ private $total;
6
+ private $lang;
7
+ private $table_icl_translations;
8
+
9
+ protected $post_translations;
10
+ private $sitepress;
11
+ private $settings;
12
+
13
+ public function __construct()
14
+ {
15
+ $this->is_wpml_active = false;
16
+ $this->total = 0;
17
+ add_action("admin_init", array($this, 'init'));
18
+ }
19
+
20
+ public function init()
21
+ {
22
+ global $sitepress, $wpdb;
23
+ $is_wpml_active = $sitepress !== null && get_class($sitepress) === "SitePress";
24
+
25
+ if ($is_wpml_active) {
26
+ $settings = $sitepress->get_setting('custom_posts_sync_option', array());
27
+ if ($sitepress->get_current_language() !== 'all') {
28
+ $this->is_wpml_active = true;
29
+ $this->settings = $settings;
30
+ $this->lang = $sitepress->get_current_language();
31
+ $this->table_icl_translations = $wpdb->prefix . 'icl_translations';
32
+ }
33
+ $this->sitepress = $sitepress;
34
+ $this->post_translations = $sitepress->post_translations();
35
+ }
36
+
37
+ if ($this->is_wpml_active) {
38
+ add_filter('premio_folder_item_in_taxonomy', array($this, 'items_in_taxonomy'), 10, 2);
39
+ add_filter('premio_folder_un_categorized_items', array($this, 'un_categorized_items'), 10, 2);
40
+ add_filter('premio_folder_all_categorized_items', array($this, 'all_categorized_items'), 10, 2);
41
+ }
42
+ }
43
+
44
+ public function set_total($post_type){
45
+ if($this->is_wpml_active && isset($this->settings[$post_type]) && $this->settings[$post_type]) {
46
+ global $wpdb;
47
+ $query = "SELECT COUNT(DISTINCT(p.id))
48
+ FROM {$this->table_icl_translations} AS wpmlt
49
+ INNER JOIN {$wpdb->posts} AS p ON p.id = wpmlt.element_id
50
+ WHERE wpmlt.element_type = 'post_{$post_type}'
51
+ AND wpmlt.language_code = '{$this->lang}'";
52
+ if($post_type == 'attachment') {
53
+ $query .= " AND (p.post_status = 'inherit' OR p.post_status = 'private')";
54
+ } else {
55
+ $query .= " AND p.post_status != 'trash'";
56
+ }
57
+ $this->total = (int)$wpdb->get_var($query);
58
+ }
59
+ }
60
+
61
+ public function items_in_taxonomy($term_id, $arg = array()) {
62
+ $post_type = isset($arg['post_type'])?$arg['post_type']:"";
63
+ $taxonomy = isset($arg['taxonomy'])?$arg['taxonomy']:"";
64
+ if($this->is_wpml_active && isset($this->settings[$post_type]) && $this->settings[$post_type]) {
65
+ global $wpdb;
66
+ $term_taxonomy_id = get_term_by('id', (int)$term_id, $taxonomy, OBJECT)->term_taxonomy_id;
67
+ $join = "INNER JOIN {$wpdb->term_relationships} AS term_rela ON term_rela.object_id = wpmlt.element_id";
68
+ $where = "wpmlt.element_type = 'post_{$post_type}' AND term_rela.term_taxonomy_id = {$term_taxonomy_id} AND wpmlt.language_code = '{$this->lang}'";
69
+ $query = "SELECT wpmlt.element_id FROM {$this->table_icl_translations} AS wpmlt " . $join . " WHERE " . $where;
70
+ $all_ids = $wpdb->get_col($query);
71
+ $counter = 0;
72
+ if (count($all_ids) > 0) {
73
+ if($post_type == 'attachment') {
74
+ $query = "SELECT COUNT(*) FROM {$wpdb->posts} WHERE `ID` IN (" . implode(',', $all_ids) . ") AND (post_status = 'inherit' OR post_status = 'private')";
75
+ $counter = $wpdb->get_var($query);
76
+ } else {
77
+ $query = "SELECT COUNT(*) FROM {$wpdb->posts} WHERE `ID` IN (" . implode(',', $all_ids) . ") AND post_status != 'trash'";
78
+ $counter = $wpdb->get_var($query);
79
+ }
80
+ }
81
+ return !empty($counter) ? $counter : 0;
82
+ }
83
+ return null;
84
+ }
85
+
86
+ public function un_categorized_items($post_type, $taxonomy) {
87
+
88
+ if($this->is_wpml_active && isset($this->settings[$post_type]) && $this->settings[$post_type]) {
89
+
90
+ global $wpdb;
91
+ $query = "SELECT COUNT(DISTINCT(tmp_table.ID))
92
+ FROM (SELECT * FROM {$this->table_icl_translations} as wpmlt
93
+ INNER JOIN {$wpdb->posts} as p on p.id = wpmlt.element_id
94
+ WHERE wpmlt.element_type = 'post_{$post_type}'
95
+ and wpmlt.language_code = '{$this->lang}') as tmp_table
96
+ JOIN {$wpdb->term_relationships} as term_relationships on tmp_table.element_id = term_relationships.object_id
97
+ JOIN {$wpdb->term_taxonomy} as term_taxonomy on term_relationships.term_taxonomy_id = term_taxonomy.term_taxonomy_id
98
+ WHERE taxonomy = '{$taxonomy}'";
99
+ $fileInFolder = (int)$wpdb->get_var($query);
100
+
101
+ $this->set_total($post_type);
102
+
103
+ return $this->total - $fileInFolder;
104
+ }
105
+ return null;
106
+ }
107
+
108
+ public function all_categorized_items($post_type) {
109
+ if($this->is_wpml_active && isset($this->settings[$post_type]) && $this->settings[$post_type]) {
110
+ $this->set_total($post_type);
111
+ return $this->total;
112
+ }
113
+ return null;
114
+ }
115
+ }
116
+ if(class_exists('WCP_Folder_WPML')) {
117
+ $folder_WPML = new WCP_Folder_WPML();
118
+ }
includes/folders.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  /* Free/Pro Class name change */
4
  class WCP_Folders
5
  {
@@ -67,6 +67,8 @@ class WCP_Folders
67
  add_action('wp_ajax_wcp_change_all_status', array($this, 'wcp_change_all_status'));
68
  /* Update width Data */
69
  add_action('wp_ajax_save_folder_last_status', array($this, 'save_folder_last_status'));
 
 
70
  self::$folders = 10;
71
 
72
  /* Send message on plugin deactivate */
@@ -140,12 +142,99 @@ class WCP_Folders
140
  add_filter('mla_media_modal_query_final_terms', array( $this, 'media_modal_query_final_terms'), 10, 3);
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  public function save_folder_last_status(){
144
- $post_type = filter_input(INPUT_POST, 'post_type', FILTER_SANITIZE_STRING);
145
- $post_id = filter_input(INPUT_POST, 'post_id', FILTER_SANITIZE_STRING);
146
- if(!empty($post_type) && !empty($post_id)) {
147
- delete_option("last_folder_status_for".$post_type);
148
- add_option("last_folder_status_for".$post_type, $post_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
150
  }
151
 
@@ -177,14 +266,44 @@ class WCP_Folders
177
 
178
  $post_table = $wpdb->prefix."posts";
179
  $term_table = $wpdb->prefix."term_relationships";
180
- foreach ( $terms as $key=>$term ) {
181
- if(isset($term->term_id)) {
182
- $result = $wpdb->get_var("SELECT COUNT(*) FROM {$post_table} p JOIN {$term_table} rl ON p.ID = rl.object_id WHERE rl.term_taxonomy_id = '{$term->term_id}' AND p.post_status != 'trash' LIMIT 1");
183
- if (intval($result) > 0) {
184
- $terms[$key]->trash_count = intval($result);
185
- } else {
186
- $terms[$key]->trash_count = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
 
188
  }
189
  }
190
  return $terms;
@@ -381,7 +500,7 @@ class WCP_Folders
381
  <select name="folder_for_media" class="folder_for_media">
382
  <option value="-1">- <?php esc_html_e('Unassigned', WCP_FOLDER) ?></option>
383
  <?php echo $options ?>
384
- <?php if(($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") || ($request !== false)) {?>
385
  <option value="add-folder"><?php esc_html_e('+ Create a New Folder', WCP_FOLDER) ?></option>
386
  <?php } ?>
387
  </select>
@@ -497,6 +616,9 @@ class WCP_Folders
497
  } else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
498
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
499
  $errorCounter++;
 
 
 
500
  }
501
  if ($errorCounter == 0) {
502
  $type = self::sanitize_options($postData['type']);
@@ -563,7 +685,7 @@ class WCP_Folders
563
 
564
  $post_type = $postData['type'];
565
 
566
- $ttpsts = wp_count_posts($post_type)->inherit;
567
 
568
  $empty_items = self::get_tempt_posts($post_type);
569
 
@@ -586,11 +708,7 @@ class WCP_Folders
586
 
587
  $post_type = $postData['type'];
588
 
589
- if($post_type != 'attachment') {
590
- $ttpsts = self::get_ttlpst($post_type);
591
- } else {
592
- $ttpsts = wp_count_posts($post_type)->inherit;
593
- }
594
 
595
  $empty_items = self::get_tempt_posts($post_type);
596
 
@@ -655,8 +773,13 @@ class WCP_Folders
655
  $term_table = $wpdb->prefix."term_relationships";
656
  $term_taxonomy_table = $wpdb->prefix."term_taxonomy";
657
  $taxonomy = self::get_custom_post_type($post_type);
658
- if ($post_type != "attachment") {
659
- $query = "SELECT COUNT(DISTINCT({$post_table}.ID)) AS total_records FROM {$post_table} WHERE 1=1 AND (
 
 
 
 
 
660
  NOT EXISTS (
661
  SELECT 1
662
  FROM {$term_table}
@@ -666,8 +789,8 @@ class WCP_Folders
666
  AND {$term_table}.object_id = {$post_table}.ID
667
  )
668
  ) AND {$post_table}.post_type = '%s' AND (({$post_table}.post_status = 'publish' OR {$post_table}.post_status = 'future' OR {$post_table}.post_status = 'draft' OR {$post_table}.post_status = 'private'))";
669
- } else {
670
- $query = "SELECT COUNT(DISTINCT({$post_table}.ID)) AS total_records FROM {$post_table} WHERE 1=1 AND (
671
  NOT EXISTS (
672
  SELECT 1
673
  FROM {$term_table}
@@ -677,11 +800,12 @@ class WCP_Folders
677
  AND {$term_table}.object_id = {$post_table}.ID
678
  )
679
  ) AND {$post_table}.post_type = '%s' AND {$post_table}.post_status = 'inherit'";
680
- }
681
 
682
- $query = $wpdb->prepare($query, $taxonomy, $post_type);
683
 
684
- $tlrcds = $wpdb->get_var($query);
 
685
 
686
  if(!empty($tlrcds)) {
687
  return $tlrcds;
@@ -761,6 +885,12 @@ class WCP_Folders
761
  }
762
  }
763
 
 
 
 
 
 
 
764
  $is_active = 1;
765
  $folders = -1;
766
  if (!self::check_has_valid_key()) {
@@ -831,9 +961,7 @@ class WCP_Folders
831
  if(!empty($terms)) {
832
  foreach ($terms as $term) {
833
  if(!empty($term) && isset($term->term_id)) {
834
- if(empty($term->trash_count) && !empty($term->count)) {
835
- $term->trash_count = $term->count;
836
- }
837
  $hierarchical_terms[] = $term;
838
  $hierarchical_terms = self::get_child_terms($taxonomy, $hierarchical_terms, $term->term_id, "-");
839
  }
@@ -859,10 +987,8 @@ class WCP_Folders
859
  if(!empty($terms)) {
860
  foreach ($terms as $term) {
861
  if(isset($term->name)) {
862
- if(empty($term->trash_count) && !empty($term->count)) {
863
- $term->trash_count = $term->count;
864
- }
865
  $term->name = $separator . " " . $term->name;
 
866
  $hierarchical_terms[] = $term;
867
  $hierarchical_terms = self::get_child_terms($taxonomy, $hierarchical_terms, $term->term_id, $separator . "-");
868
  }
@@ -991,180 +1117,183 @@ class WCP_Folders
991
  }
992
 
993
  public function wcp_folder_send_message_to_owner() {
994
- $response = array();
995
- $response['status'] = 0;
996
- $response['error'] = 0;
997
- $response['errors'] = array();
998
- $response['message'] = "";
999
- $errorArray = [];
1000
- $errorMessage = esc_attr__("%s is required", WCP_FOLDER);
1001
- $postData = filter_input_array(INPUT_POST);
1002
- if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
1003
- $error = array(
1004
- "key" => "textarea_text",
1005
- "message" => esc_attr__("Please enter your message",WCP_FOLDER)
1006
- );
1007
- $errorArray[] = $error;
1008
- }
1009
- if(!isset($postData['user_email']) || trim($postData['user_email']) == "") {
1010
- $error = array(
1011
- "key" => "user_email",
1012
- "message" => sprintf($errorMessage,__("Email",WCP_FOLDER))
1013
- );
1014
- $errorArray[] = $error;
1015
- } else if(!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
1016
- $error = array(
1017
- 'key' => "user_email",
1018
- "message" => "Email is not valid"
1019
- );
1020
- $errorArray[] = $error;
1021
- }
1022
- if(empty($errorArray)) {
1023
- if(!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
1024
  $error = array(
1025
- "key" => "nonce",
1026
- "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1027
  );
1028
  $errorArray[] = $error;
1029
- } else {
1030
- if(!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  $error = array(
1032
- "key" => "nonce",
1033
  "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1034
  );
1035
  $errorArray[] = $error;
 
 
 
 
 
 
 
 
1036
  }
1037
  }
1038
- }
1039
- if(empty($errorArray)) {
1040
- global $current_user;
1041
- $text_message = self::sanitize_options($postData['textarea_text']);
1042
- $email = self::sanitize_options($postData['user_email'],"email");
1043
- $domain = site_url();
1044
- $user_name = $current_user->first_name." ".$current_user->last_name;
1045
- $subject = "Folder request: ".$domain;
1046
- $headers = "MIME-Version: 1.0\r\n";
1047
- $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
1048
- $headers .= 'From: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1049
- $headers .= 'Reply-To: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1050
- $headers .= 'X-Mailer: PHP/' . phpversion();
1051
- ob_start();
1052
- ?>
1053
- <table border="0" cellspacing="0" cellpadding="5">
1054
- <tr>
1055
- <th>Domain</th>
1056
- <td><?php echo esc_attr($domain) ?></td>
1057
- </tr>
1058
- <tr>
1059
- <th>Email</th>
1060
- <td><?php echo esc_attr($email) ?></td>
1061
- </tr>
1062
- <tr>
1063
- <th>Message</th>
1064
- <td><?php echo esc_attr(nl2br($text_message)) ?></td>
1065
- </tr>
1066
- </table>
1067
- <?php
1068
- $message = ob_get_clean();
1069
- $email_id = "gal@premio.io";
1070
- $status = wp_mail($email_id, $subject, $message, $headers);
1071
- if($status) {
1072
- $response['status'] = 1;
 
 
 
1073
  } else {
1074
- $response['status'] = 0;
1075
- $response['message'] = "Not able to send mail";
1076
  }
1077
- } else {
1078
- $response['error'] = 1;
1079
- $response['errors'] = $errorArray;
1080
  }
1081
- echo json_encode($response);
1082
  }
1083
 
1084
  public function folder_plugin_deactivate() {
1085
- global $current_user;
1086
- $postData = filter_input_array(INPUT_POST);
1087
- $errorCounter = 0;
1088
- $response = array();
1089
- $response['status'] = 0;
1090
- $response['message'] = "";
1091
- $response['valid'] = 1;
1092
- if(!isset($postData['reason']) || empty($postData['reason'])) {
1093
- $errorCounter++;
1094
- $response['message'] = "Please provide reason";
1095
- } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1096
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1097
- $errorCounter++;
1098
- $response['valid'] = 0;
1099
- } else {
1100
- $nonce = self::sanitize_options($postData['nonce']);
1101
- if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
1102
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1103
  $errorCounter++;
1104
  $response['valid'] = 0;
 
 
 
 
 
 
 
1105
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1106
  }
1107
- if($errorCounter == 0) {
1108
- $reason = $postData['reason'];
1109
- $email = "none@none.none";
1110
- if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) {
1111
- $email = $postData['email_id'];
1112
- }
1113
- $domain = site_url();
1114
- $user_name = $current_user->first_name." ".$current_user->last_name;
1115
- $subject = "Folders was removed from {$domain}";
1116
- $headers = "MIME-Version: 1.0\r\n";
1117
- $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
1118
- $headers .= 'From: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1119
- $headers .= 'Reply-To: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1120
- $headers .= 'X-Mailer: PHP/' . phpversion();
1121
- ob_start();
1122
- ?>
1123
- <table border="0" cellspacing="0" cellpadding="5">
1124
- <tr>
1125
- <th>Plugin</th>
1126
- <td>Folders</td>
1127
- </tr>
1128
- <tr>
1129
- <th>Plugin Version</th>
1130
- <!-- Free Pro Version Change -->
1131
- <td><?php echo esc_attr(WCP_FOLDER_VERSION) ?></td>
1132
- </tr>
1133
- <tr>
1134
- <th>Domain</th>
1135
- <td><?php echo esc_attr($domain) ?></td>
1136
- </tr>
1137
- <tr>
1138
- <th>Email</th>
1139
- <td><?php echo esc_attr($email) ?></td>
1140
- </tr>
1141
- <tr>
1142
- <th>Comment</th>
1143
- <td><?php echo esc_attr(nl2br($reason)) ?></td>
1144
- </tr>
1145
- <tr>
1146
- <th>WordPress Version</th>
1147
- <td><?php echo esc_attr(get_bloginfo('version')) ?></td>
1148
- </tr>
1149
- <tr>
1150
- <th>PHP Version</th>
1151
- <td><?php echo esc_attr(PHP_VERSION) ?></td>
1152
- </tr>
1153
- </table>
1154
- <?php
1155
- $content = ob_get_clean();
1156
- $email_id = "gal@premio.io";
1157
- wp_mail($email_id, $subject, $content, $headers);
1158
- $response['status'] = 1;
1159
- }
1160
- echo json_encode($response);
1161
- wp_die();
1162
  }
1163
 
1164
- public static function ttl_fldrs()
1165
- {
1166
  $post_types = get_option(WCP_FOLDER_VAR);
1167
- $post_types = is_array($post_types)?$post_types:array();
1168
  $total = 0;
1169
  foreach ($post_types as $post_type) {
1170
  $post_type = self::get_custom_post_type($post_type);
@@ -1647,6 +1776,9 @@ class WCP_Folders
1647
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1648
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1649
  $errorCounter++;
 
 
 
1650
  } else {
1651
  $type = self::sanitize_options($postData['type']);
1652
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
@@ -1678,6 +1810,7 @@ class WCP_Folders
1678
  $response['message'] = "";
1679
  $postData = filter_input_array(INPUT_POST);
1680
  $errorCounter = 0;
 
1681
  if (!current_user_can("manage_categories")) {
1682
  $error = esc_attr__("You have not permission to remove folder", WCP_FOLDER);
1683
  $errorCounter++;
@@ -1687,6 +1820,15 @@ class WCP_Folders
1687
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1688
  $error = esc_attr__("Your request is not valid", WCP_FOLDER);
1689
  $errorCounter++;
 
 
 
 
 
 
 
 
 
1690
  }
1691
  if ($errorCounter == 0) {
1692
  $term_id = self::sanitize_options($postData['term_id']);
@@ -1961,14 +2103,14 @@ class WCP_Folders
1961
 
1962
  public function is_active_for_screen()
1963
  {
1964
-
1965
  global $typenow, $current_screen;
1966
 
1967
  $postData = filter_input_array(INPUT_POST);
1968
 
1969
- if ((isset($postData['action']) && $postData['action'] == 'inline-save') && (isset($postData['post_type']) && self::is_for_this_post_type($postData['post_type']))) {
1970
- return true;
1971
- }
 
1972
  global $current_screen;
1973
 
1974
  if (self::is_for_this_post_type($typenow) && ('edit' == $current_screen->base || 'upload' == $current_screen->base)) {
@@ -2046,21 +2188,30 @@ class WCP_Folders
2046
  if ( 'plugins.php' !== $pagenow ) {
2047
 
2048
  } else {
2049
- include_once dirname(dirname(__FILE__)) . WCP_DS . "/templates" . WCP_DS . "admin" . WCP_DS . "folder-deactivate-form.php";
 
 
2050
  }
2051
  }
2052
 
2053
  public function get_ttlpst($post_type = "")
2054
  {
2055
  global $typenow;
2056
- if ($post_type == "") {
2057
  $post_type = $typenow;
2058
  }
2059
- if ($typenow == "attachment") {
2060
- return wp_count_posts($post_type)->inherit;
2061
- } else {
2062
- return wp_count_posts($post_type)->publish + wp_count_posts($post_type)->draft + wp_count_posts($post_type)->future + wp_count_posts($post_type)->private;
 
 
 
 
 
 
2063
  }
 
2064
  }
2065
 
2066
  public function autoload()
@@ -2068,6 +2219,8 @@ class WCP_Folders
2068
  $files = array(
2069
  'WCP_Tree_View' => WCP_DS . "includes" . WCP_DS . "tree.class.php",
2070
  'WCP_Form_View' => WCP_DS . "includes" . WCP_DS . "form.class.php",
 
 
2071
  );
2072
 
2073
  foreach ($files as $file) {
@@ -2148,43 +2301,45 @@ class WCP_Folders
2148
 
2149
  $postData = filter_input_array(INPUT_POST);
2150
 
2151
- if(current_user_can("manage_categories")) {
2152
- if (isset($postData['folders_show_in_menu']) && !empty($postData['folders_show_in_menu'])) {
2153
- $show_menu = "off";
2154
- if ($postData['folders_show_in_menu'] == "on") {
2155
- $show_menu = "on";
 
 
 
2156
  }
2157
- update_option("folders_show_in_menu", $show_menu);
2158
- }
2159
 
2160
- if (isset($postData['folders_settings1'])) {
2161
- $posts = array();
2162
- if (isset($postData['folders_settings']) && is_array($postData['folders_settings'])) {
2163
- foreach ($postData['folders_settings'] as $key => $val) {
2164
- $posts[] = $val;
 
2165
  }
 
2166
  }
2167
- update_option("folders_settings", $posts);
2168
- }
2169
 
2170
- if (isset($_POST['folders_settings1'])) {
2171
- $posts = array();
2172
- if (isset($_POST['default_folders']) && is_array($_POST['default_folders'])) {
2173
- foreach ($_POST['default_folders'] as $key => $val) {
2174
- $posts[$key] = $val;
 
2175
  }
 
2176
  }
2177
- update_option("default_folders", $posts);
2178
- }
2179
 
2180
- if (isset($_POST['folders_settings1'])) {
2181
- $posts = array();
2182
- if (isset($_POST['customize_folders']) && is_array($_POST['customize_folders'])) {
2183
- foreach ($_POST['customize_folders'] as $key => $val) {
2184
- $posts[$key] = $val;
 
2185
  }
 
2186
  }
2187
- update_option("customize_folders", $posts);
2188
  }
2189
  }
2190
 
@@ -2457,7 +2612,7 @@ class WCP_Folders
2457
  } else if(isset($_GET[$post_type]) && !empty($_GET[$post_type])) {
2458
  $selected_taxonomy = $_GET[$post_type];
2459
 
2460
- $term = get_term_by('slug', $selected_taxonomy, $post_type );
2461
  if (!empty($term) && is_object($term)) {
2462
  $selected_taxonomy = $term->term_id;
2463
  } else {
@@ -2497,7 +2652,24 @@ class WCP_Folders
2497
 
2498
  if($hook == "media-new.php") {
2499
  if(self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media')) {
 
 
 
 
 
 
 
 
2500
  wp_enqueue_script('wcp-folders-add-new-media', plugin_dir_url(dirname(__FILE__)) . 'assets/js/new-media.js', array('jquery'), WCP_FOLDER_VERSION);
 
 
 
 
 
 
 
 
 
2501
  }
2502
  }
2503
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  /* Free/Pro Class name change */
4
  class WCP_Folders
5
  {
67
  add_action('wp_ajax_wcp_change_all_status', array($this, 'wcp_change_all_status'));
68
  /* Update width Data */
69
  add_action('wp_ajax_save_folder_last_status', array($this, 'save_folder_last_status'));
70
+ /* Update width Data */
71
+ add_action('wp_ajax_wcp_folders_by_order', array($this, 'wcp_folders_by_order'));
72
  self::$folders = 10;
73
 
74
  /* Send message on plugin deactivate */
142
  add_filter('mla_media_modal_query_final_terms', array( $this, 'media_modal_query_final_terms'), 10, 3);
143
  }
144
 
145
+ public function wcp_folders_by_order(){
146
+ $response = array();
147
+ $response['status'] = 0;
148
+ $response['error'] = 0;
149
+ $response['data'] = array();
150
+ $response['message'] = "";
151
+ $postData = filter_input_array(INPUT_POST);
152
+ $errorCounter = 0;
153
+
154
+ if (!isset($postData['order']) || empty($postData['order'])) {
155
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
156
+ $errorCounter++;
157
+ } else if (!isset($postData['type']) || empty($postData['type'])) {
158
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
159
+ $errorCounter++;
160
+ } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
161
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
162
+ $errorCounter++;
163
+ } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
164
+ $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
165
+ $errorCounter++;
166
+ } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
167
+ $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
168
+ $errorCounter++;
169
+ } else {
170
+ $type = self::sanitize_options($postData['type']);
171
+ $nonce = self::sanitize_options($postData['nonce']);
172
+ if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
173
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
174
+ $errorCounter++;
175
+ }
176
+ }
177
+ if ($errorCounter == 0) {
178
+ $response['status'] = 1;
179
+
180
+ $order_field = $postData['order'];
181
+
182
+ $order_by = "";
183
+ $order = "ASC";
184
+
185
+ if($order_field == "a-z" || $order_field == "z-a") {
186
+ $order_by = 'title';
187
+ if($order_field == "z-a") {
188
+ $order = "DESC";
189
+ }
190
+ } else if($order_field == "n-o" || $order_field == "o-n") {
191
+ $order_by = 'ID';
192
+ if($order_field == "o-n") {
193
+ $order = "ASC";
194
+ } else {
195
+ $order = "DESC";
196
+ }
197
+ }
198
+
199
+ if(empty($order_by)) {
200
+ $order = "";
201
+ }
202
+
203
+ $folder_type = self::get_custom_post_type($postData['type']);
204
+ /* Do not change: Free/Pro Class name change */
205
+ $tree_data = WCP_Tree::get_full_tree_data($folder_type, $order_by, $order);
206
+
207
+ $response['data'] = $tree_data['string'];
208
+ }
209
+ echo json_encode($response); die;
210
+ }
211
+
212
  public function save_folder_last_status(){
213
+ $postData = filter_input_array(INPUT_POST);
214
+ $error = 0;
215
+ if (!isset($postData['post_id']) || empty($postData['post_id'])) {
216
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
217
+ $error = 1;
218
+ } else if (!isset($postData['post_type']) || empty($postData['type'])) {
219
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
220
+ $error = 1;
221
+ } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
222
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
223
+ $error = 1;
224
+ } else if ($postData['post_type'] == "page" && !current_user_can("edit_pages")) {
225
+ $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
226
+ $error = 1;
227
+ } else if ($postData['post_type'] != "page" && !current_user_can("edit_posts")) {
228
+ $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
229
+ $error = 1;
230
+ }
231
+ if($error == 0) {
232
+ $post_type = filter_input(INPUT_POST, 'post_type', FILTER_SANITIZE_STRING);
233
+ $post_id = filter_input(INPUT_POST, 'post_id', FILTER_SANITIZE_STRING);
234
+ if (!empty($post_type) && !empty($post_id)) {
235
+ delete_option("last_folder_status_for" . $post_type);
236
+ add_option("last_folder_status_for" . $post_type, $post_id);
237
+ }
238
  }
239
  }
240
 
266
 
267
  $post_table = $wpdb->prefix."posts";
268
  $term_table = $wpdb->prefix."term_relationships";
269
+ $options = get_option(WCP_FOLDER_VAR);
270
+ $option_array = array();
271
+ if(!empty($options)) {
272
+ foreach ($options as $option) {
273
+ $option_array[] = self::get_custom_post_type($option);
274
+ }
275
+ }
276
+ foreach ($terms as $key=>$term ) {
277
+ if(isset($term->term_id) && isset($term->taxonomy) && !empty($term->taxonomy) && in_array($term->taxonomy, $option_array)) {
278
+ $trash_count = null;
279
+ if(has_filter("premio_folder_item_in_taxonomy")) {
280
+ $post_type = "";
281
+ $taxonomy = $term->taxonomy;
282
+
283
+ if ($taxonomy == "post_folder") {
284
+ $post_type = "post";
285
+ } else if ($taxonomy == "folder") {
286
+ $post_type = "page";
287
+ } else if ($taxonomy == "media_folder") {
288
+ $post_type = "attachment";
289
+ } else {
290
+ $post_type = trim($taxonomy, "'_folder'");
291
+ }
292
+ $arg = array(
293
+ 'post_type' => $post_type,
294
+ 'taxonomy' => $taxonomy,
295
+ );
296
+ $trash_count = apply_filters("premio_folder_item_in_taxonomy", $term->term_id, $arg);
297
+ }
298
+ if($trash_count === null) {
299
+ $result = $wpdb->get_var("SELECT COUNT(*) FROM {$post_table} p JOIN {$term_table} rl ON p.ID = rl.object_id WHERE rl.term_taxonomy_id = '{$term->term_id}' AND p.post_status != 'trash' LIMIT 1");
300
+ if (intval($result) > 0) {
301
+ $trash_count = intval($result);
302
+ } else {
303
+ $trash_count = 0;
304
+ }
305
  }
306
+ $terms[$key]->trash_count = $trash_count;
307
  }
308
  }
309
  return $terms;
500
  <select name="folder_for_media" class="folder_for_media">
501
  <option value="-1">- <?php esc_html_e('Unassigned', WCP_FOLDER) ?></option>
502
  <?php echo $options ?>
503
+ <?php if(($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") || ($request !== false) || self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media')) {?>
504
  <option value="add-folder"><?php esc_html_e('+ Create a New Folder', WCP_FOLDER) ?></option>
505
  <?php } ?>
506
  </select>
616
  } else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
617
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
618
  $errorCounter++;
619
+ } else if(!current_user_can("manage_categories")) {
620
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
621
+ $errorCounter++;
622
  }
623
  if ($errorCounter == 0) {
624
  $type = self::sanitize_options($postData['type']);
685
 
686
  $post_type = $postData['type'];
687
 
688
+ $ttpsts = $this->get_ttlpst($post_type);
689
 
690
  $empty_items = self::get_tempt_posts($post_type);
691
 
708
 
709
  $post_type = $postData['type'];
710
 
711
+ $ttpsts = $this->get_ttlpst($post_type);
 
 
 
 
712
 
713
  $empty_items = self::get_tempt_posts($post_type);
714
 
773
  $term_table = $wpdb->prefix."term_relationships";
774
  $term_taxonomy_table = $wpdb->prefix."term_taxonomy";
775
  $taxonomy = self::get_custom_post_type($post_type);
776
+ $tlrcds = null;
777
+ if(has_filter("premio_folder_un_categorized_items")) {
778
+ $tlrcds = apply_filters("premio_folder_un_categorized_items", $post_type, $taxonomy);
779
+ }
780
+ if($tlrcds === null) {
781
+ if ($post_type != "attachment") {
782
+ $query = "SELECT COUNT(DISTINCT({$post_table}.ID)) AS total_records FROM {$post_table} WHERE 1=1 AND (
783
  NOT EXISTS (
784
  SELECT 1
785
  FROM {$term_table}
789
  AND {$term_table}.object_id = {$post_table}.ID
790
  )
791
  ) AND {$post_table}.post_type = '%s' AND (({$post_table}.post_status = 'publish' OR {$post_table}.post_status = 'future' OR {$post_table}.post_status = 'draft' OR {$post_table}.post_status = 'private'))";
792
+ } else {
793
+ $query = "SELECT COUNT(DISTINCT({$post_table}.ID)) AS total_records FROM {$post_table} WHERE 1=1 AND (
794
  NOT EXISTS (
795
  SELECT 1
796
  FROM {$term_table}
800
  AND {$term_table}.object_id = {$post_table}.ID
801
  )
802
  ) AND {$post_table}.post_type = '%s' AND {$post_table}.post_status = 'inherit'";
803
+ }
804
 
805
+ $query = $wpdb->prepare($query, $taxonomy, $post_type);
806
 
807
+ $tlrcds = $wpdb->get_var($query);
808
+ }
809
 
810
  if(!empty($tlrcds)) {
811
  return $tlrcds;
885
  }
886
  }
887
 
888
+ if(!(self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media'))) {
889
+ return;
890
+ }
891
+
892
+ /* Free/Pro URL Change */
893
+ global $typenow;
894
  $is_active = 1;
895
  $folders = -1;
896
  if (!self::check_has_valid_key()) {
961
  if(!empty($terms)) {
962
  foreach ($terms as $term) {
963
  if(!empty($term) && isset($term->term_id)) {
964
+ $term->term_name = $term->name;
 
 
965
  $hierarchical_terms[] = $term;
966
  $hierarchical_terms = self::get_child_terms($taxonomy, $hierarchical_terms, $term->term_id, "-");
967
  }
987
  if(!empty($terms)) {
988
  foreach ($terms as $term) {
989
  if(isset($term->name)) {
 
 
 
990
  $term->name = $separator . " " . $term->name;
991
+ $term->term_name = trim($term->name, "-");
992
  $hierarchical_terms[] = $term;
993
  $hierarchical_terms = self::get_child_terms($taxonomy, $hierarchical_terms, $term->term_id, $separator . "-");
994
  }
1117
  }
1118
 
1119
  public function wcp_folder_send_message_to_owner() {
1120
+ if (current_user_can('manage_options')) {
1121
+ $response = array();
1122
+ $response['status'] = 0;
1123
+ $response['error'] = 0;
1124
+ $response['errors'] = array();
1125
+ $response['message'] = "";
1126
+ $errorArray = [];
1127
+ $errorMessage = esc_attr__("%s is required", WCP_FOLDER);
1128
+ $postData = filter_input_array(INPUT_POST);
1129
+ if (!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1130
  $error = array(
1131
+ "key" => "textarea_text",
1132
+ "message" => esc_attr__("Please enter your message", WCP_FOLDER)
1133
  );
1134
  $errorArray[] = $error;
1135
+ }
1136
+ if (!isset($postData['user_email']) || trim($postData['user_email']) == "") {
1137
+ $error = array(
1138
+ "key" => "user_email",
1139
+ "message" => sprintf($errorMessage, __("Email", WCP_FOLDER))
1140
+ );
1141
+ $errorArray[] = $error;
1142
+ } else if (!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
1143
+ $error = array(
1144
+ 'key' => "user_email",
1145
+ "message" => "Email is not valid"
1146
+ );
1147
+ $errorArray[] = $error;
1148
+ }
1149
+ if (empty($errorArray)) {
1150
+ if (!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
1151
  $error = array(
1152
+ "key" => "nonce",
1153
  "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1154
  );
1155
  $errorArray[] = $error;
1156
+ } else {
1157
+ if (!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
1158
+ $error = array(
1159
+ "key" => "nonce",
1160
+ "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1161
+ );
1162
+ $errorArray[] = $error;
1163
+ }
1164
  }
1165
  }
1166
+ if (empty($errorArray)) {
1167
+ global $current_user;
1168
+ $text_message = self::sanitize_options($postData['textarea_text']);
1169
+ $email = self::sanitize_options($postData['user_email'], "email");
1170
+ $domain = site_url();
1171
+ $user_name = $current_user->first_name . " " . $current_user->last_name;
1172
+ $subject = "Folder request: " . $domain;
1173
+ $headers = "MIME-Version: 1.0\r\n";
1174
+ $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
1175
+ $headers .= 'From: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
1176
+ $headers .= 'Reply-To: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
1177
+ $headers .= 'X-Mailer: PHP/' . phpversion();
1178
+ ob_start();
1179
+ ?>
1180
+ <table border="0" cellspacing="0" cellpadding="5">
1181
+ <tr>
1182
+ <th>Domain</th>
1183
+ <td><?php echo esc_attr($domain) ?></td>
1184
+ </tr>
1185
+ <tr>
1186
+ <th>Email</th>
1187
+ <td><?php echo esc_attr($email) ?></td>
1188
+ </tr>
1189
+ <tr>
1190
+ <th>Message</th>
1191
+ <td><?php echo esc_attr(nl2br($text_message)) ?></td>
1192
+ </tr>
1193
+ </table>
1194
+ <?php
1195
+ $message = ob_get_clean();
1196
+ $email_id = "gal@premio.io";
1197
+ $status = wp_mail($email_id, $subject, $message, $headers);
1198
+ if ($status) {
1199
+ $response['status'] = 1;
1200
+ } else {
1201
+ $response['status'] = 0;
1202
+ $response['message'] = "Not able to send mail";
1203
+ }
1204
  } else {
1205
+ $response['error'] = 1;
1206
+ $response['errors'] = $errorArray;
1207
  }
1208
+ echo json_encode($response);
 
 
1209
  }
 
1210
  }
1211
 
1212
  public function folder_plugin_deactivate() {
1213
+ if (current_user_can('manage_options')) {
1214
+ global $current_user;
1215
+ $postData = filter_input_array(INPUT_POST);
1216
+ $errorCounter = 0;
1217
+ $response = array();
1218
+ $response['status'] = 0;
1219
+ $response['message'] = "";
1220
+ $response['valid'] = 1;
1221
+ if(!isset($postData['reason']) || empty($postData['reason'])) {
1222
+ $errorCounter++;
1223
+ $response['message'] = "Please provide reason";
1224
+ } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
 
 
 
 
 
1225
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1226
  $errorCounter++;
1227
  $response['valid'] = 0;
1228
+ } else {
1229
+ $nonce = self::sanitize_options($postData['nonce']);
1230
+ if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
1231
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1232
+ $errorCounter++;
1233
+ $response['valid'] = 0;
1234
+ }
1235
  }
1236
+ if($errorCounter == 0) {
1237
+ $reason = $postData['reason'];
1238
+ $email = "none@none.none";
1239
+ if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) {
1240
+ $email = $postData['email_id'];
1241
+ }
1242
+ $domain = site_url();
1243
+ $user_name = $current_user->first_name." ".$current_user->last_name;
1244
+ $subject = "Folders was removed from {$domain}";
1245
+ $headers = "MIME-Version: 1.0\r\n";
1246
+ $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
1247
+ $headers .= 'From: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1248
+ $headers .= 'Reply-To: '.$user_name.' <'.$email.'>'.PHP_EOL ;
1249
+ $headers .= 'X-Mailer: PHP/' . phpversion();
1250
+ ob_start();
1251
+ ?>
1252
+ <table border="0" cellspacing="0" cellpadding="5">
1253
+ <tr>
1254
+ <th>Plugin</th>
1255
+ <td>Folders</td>
1256
+ </tr>
1257
+ <tr>
1258
+ <th>Plugin Version</th>
1259
+ <!-- Free Pro Version Change -->
1260
+ <td><?php echo esc_attr(WCP_FOLDER_VERSION) ?></td>
1261
+ </tr>
1262
+ <tr>
1263
+ <th>Domain</th>
1264
+ <td><?php echo esc_attr($domain) ?></td>
1265
+ </tr>
1266
+ <tr>
1267
+ <th>Email</th>
1268
+ <td><?php echo esc_attr($email) ?></td>
1269
+ </tr>
1270
+ <tr>
1271
+ <th>Comment</th>
1272
+ <td><?php echo esc_attr(nl2br($reason)) ?></td>
1273
+ </tr>
1274
+ <tr>
1275
+ <th>WordPress Version</th>
1276
+ <td><?php echo esc_attr(get_bloginfo('version')) ?></td>
1277
+ </tr>
1278
+ <tr>
1279
+ <th>PHP Version</th>
1280
+ <td><?php echo esc_attr(PHP_VERSION) ?></td>
1281
+ </tr>
1282
+ </table>
1283
+ <?php
1284
+ $content = ob_get_clean();
1285
+ $email_id = "gal@premio.io";
1286
+ wp_mail($email_id, $subject, $content, $headers);
1287
+ $response['status'] = 1;
1288
+ }
1289
+ echo json_encode($response);
1290
+ wp_die();
1291
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1292
  }
1293
 
1294
+ public static function ttl_fldrs() {
 
1295
  $post_types = get_option(WCP_FOLDER_VAR);
1296
+ $post_types = is_array($post_types) ? $post_types : array();
1297
  $total = 0;
1298
  foreach ($post_types as $post_type) {
1299
  $post_type = self::get_custom_post_type($post_type);
1776
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1777
  $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1778
  $errorCounter++;
1779
+ } else if (!current_user_can("manage_categories")) {
1780
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1781
+ $errorCounter++;
1782
  } else {
1783
  $type = self::sanitize_options($postData['type']);
1784
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
1810
  $response['message'] = "";
1811
  $postData = filter_input_array(INPUT_POST);
1812
  $errorCounter = 0;
1813
+ $error = "";
1814
  if (!current_user_can("manage_categories")) {
1815
  $error = esc_attr__("You have not permission to remove folder", WCP_FOLDER);
1816
  $errorCounter++;
1820
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1821
  $error = esc_attr__("Your request is not valid", WCP_FOLDER);
1822
  $errorCounter++;
1823
+ } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1824
+ $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1825
+ $errorCounter++;
1826
+ } else {
1827
+ $type = self::sanitize_options($postData['type']);
1828
+ if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
1829
+ $error = esc_attr__("Your request is not valid", WCP_FOLDER);
1830
+ $errorCounter++;
1831
+ }
1832
  }
1833
  if ($errorCounter == 0) {
1834
  $term_id = self::sanitize_options($postData['term_id']);
2103
 
2104
  public function is_active_for_screen()
2105
  {
 
2106
  global $typenow, $current_screen;
2107
 
2108
  $postData = filter_input_array(INPUT_POST);
2109
 
2110
+
2111
+ // if ((isset($postData['action']) && $postData['action'] == 'inline-save') && (isset($postData['post_type']) && self::is_for_this_post_type($postData['post_type']))) {
2112
+ // return true;
2113
+ // }
2114
  global $current_screen;
2115
 
2116
  if (self::is_for_this_post_type($typenow) && ('edit' == $current_screen->base || 'upload' == $current_screen->base)) {
2188
  if ( 'plugins.php' !== $pagenow ) {
2189
 
2190
  } else {
2191
+ if (current_user_can('manage_options')) {
2192
+ include_once dirname(dirname(__FILE__)) . WCP_DS . "/templates" . WCP_DS . "admin" . WCP_DS . "folder-deactivate-form.php";
2193
+ }
2194
  }
2195
  }
2196
 
2197
  public function get_ttlpst($post_type = "")
2198
  {
2199
  global $typenow;
2200
+ if (empty($post_type)) {
2201
  $post_type = $typenow;
2202
  }
2203
+ $item_count = null;
2204
+ if(has_filter("premio_folder_all_categorized_items")) {
2205
+ $item_count = apply_filters("premio_folder_all_categorized_items", $post_type);
2206
+ }
2207
+ if($item_count === null) {
2208
+ if ($post_type == "attachment") {
2209
+ $item_count = wp_count_posts($post_type)->inherit;
2210
+ } else {
2211
+ $item_count = wp_count_posts($post_type)->publish + wp_count_posts($post_type)->draft + wp_count_posts($post_type)->future + wp_count_posts($post_type)->private;
2212
+ }
2213
  }
2214
+ return $item_count;
2215
  }
2216
 
2217
  public function autoload()
2219
  $files = array(
2220
  'WCP_Tree_View' => WCP_DS . "includes" . WCP_DS . "tree.class.php",
2221
  'WCP_Form_View' => WCP_DS . "includes" . WCP_DS . "form.class.php",
2222
+ 'WCP_Folder_WPML' => WCP_DS . "includes" . WCP_DS . "class-wpml.php",
2223
+ 'WCP_Folder_PolyLang' => WCP_DS . "includes" . WCP_DS . "class-polylang.php",
2224
  );
2225
 
2226
  foreach ($files as $file) {
2301
 
2302
  $postData = filter_input_array(INPUT_POST);
2303
 
2304
+ if(current_user_can("manage_categories") && isset($postData['folder_nonce'])) {
2305
+ if(wp_verify_nonce($postData['folder_nonce'], "folder_settings")) {
2306
+ if (isset($postData['folders_show_in_menu']) && !empty($postData['folders_show_in_menu'])) {
2307
+ $show_menu = "off";
2308
+ if ($postData['folders_show_in_menu'] == "on") {
2309
+ $show_menu = "on";
2310
+ }
2311
+ update_option("folders_show_in_menu", $show_menu);
2312
  }
 
 
2313
 
2314
+ if (isset($postData['folders_settings1'])) {
2315
+ $posts = array();
2316
+ if (isset($postData['folders_settings']) && is_array($postData['folders_settings'])) {
2317
+ foreach ($postData['folders_settings'] as $key => $val) {
2318
+ $posts[] = $val;
2319
+ }
2320
  }
2321
+ update_option("folders_settings", $posts);
2322
  }
 
 
2323
 
2324
+ if (isset($_POST['folders_settings1'])) {
2325
+ $posts = array();
2326
+ if (isset($_POST['default_folders']) && is_array($_POST['default_folders'])) {
2327
+ foreach ($_POST['default_folders'] as $key => $val) {
2328
+ $posts[$key] = $val;
2329
+ }
2330
  }
2331
+ update_option("default_folders", $posts);
2332
  }
 
 
2333
 
2334
+ if (isset($_POST['folders_settings1'])) {
2335
+ $posts = array();
2336
+ if (isset($_POST['customize_folders']) && is_array($_POST['customize_folders'])) {
2337
+ foreach ($_POST['customize_folders'] as $key => $val) {
2338
+ $posts[$key] = $val;
2339
+ }
2340
  }
2341
+ update_option("customize_folders", $posts);
2342
  }
 
2343
  }
2344
  }
2345
 
2612
  } else if(isset($_GET[$post_type]) && !empty($_GET[$post_type])) {
2613
  $selected_taxonomy = $_GET[$post_type];
2614
 
2615
+ $term = get_term_by('slug', $selected_taxonomy, $post_type);
2616
  if (!empty($term) && is_object($term)) {
2617
  $selected_taxonomy = $term->term_id;
2618
  } else {
2652
 
2653
  if($hook == "media-new.php") {
2654
  if(self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media')) {
2655
+ wp_enqueue_style( 'folders-media', WCP_FOLDER_URL . 'assets/css/media.css' );
2656
+ $is_active = 1;
2657
+ $folders = -1;
2658
+ if (!self::check_has_valid_key()) {
2659
+ $is_active = 0;
2660
+ $folders = self::ttl_fldrs();
2661
+ }
2662
+
2663
  wp_enqueue_script('wcp-folders-add-new-media', plugin_dir_url(dirname(__FILE__)) . 'assets/js/new-media.js', array('jquery'), WCP_FOLDER_VERSION);
2664
+ wp_localize_script( 'wcp-folders-add-new-media', 'folders_media_options', array(
2665
+ 'terms' => self::get_terms_hierarchical('media_folder'),
2666
+ 'taxonomy' => get_taxonomy('media_folder'),
2667
+ 'ajax_url' => admin_url("admin-ajax.php"),
2668
+ 'activate_url' => admin_url("admin.php?page=wcp_folders_upgrade"),
2669
+ 'nonce' => wp_create_nonce('wcp_folder_nonce_attachment'),
2670
+ 'is_key_active' => $is_active,
2671
+ 'folders' => $folders,
2672
+ ));
2673
  }
2674
  }
2675
  }
includes/form.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or die('Nope, not accessing this');
3
  class WCP_Forms {
4
  public function __construct() {
5
 
@@ -31,9 +31,22 @@ class WCP_Forms {
31
  <li>
32
  <a href="javascript:;" id="inline-remove"><span class="icon folder-icon-delete"></span> <span class="text"><?php esc_html_e("Delete", WCP_FOLDER ) ?></span> </a>
33
  </li>
34
- <li class="last">
35
  <a href="javascript:;" id="expand-collapse-list"><span class="icon folder-icon-expand_more"></span></a>
36
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  <li class="last folder-checkbox">
38
  <input type="checkbox" id="folder-hide-show-checkbox">
39
  </li>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  class WCP_Forms {
4
  public function __construct() {
5
 
31
  <li>
32
  <a href="javascript:;" id="inline-remove"><span class="icon folder-icon-delete"></span> <span class="text"><?php esc_html_e("Delete", WCP_FOLDER ) ?></span> </a>
33
  </li>
34
+ <li>
35
  <a href="javascript:;" id="expand-collapse-list"><span class="icon folder-icon-expand_more"></span></a>
36
  </li>
37
+ <li class="last folder-order">
38
+ <a data-tooltip="Sort Folders" href="javascript:;" id="sort-order-list" class="sort-folder-order">
39
+ <svg xmlns="http://www.w3.org/2000/svg" width="506.667" height="506.667" viewBox="0 0 380 380" preserveAspectRatio="xMidYMid meet"><path d="M91.5 1.9C86.6 5 3.6 88.8 2.2 92c-1.5 3.8-.7 7.1 2.5 10.2l2.5 2.3 64.8.6v131.8l1.1 134.9c2 5.7 3.9 6.2 23.2 6.2 16.2 0 17.5-.1 19.6-2.1 1.2-1.1 2.6-3.2 3.2-4.6.5-1.5.9-54.6.9-134.3V105.1l64.8-.6 2.5-2.3c3.2-3.1 4-6.4 2.5-10.2-1.5-3.4-85.9-88.5-90-90.6-3.5-1.8-4.7-1.8-8.3.5zm173.2 1.7c-1.5 1.5-2.7 3.4-2.8 4.3-.6 11.8-.7 41.3-.8 144.3L261 274h-31.1c-35.5 0-37 .3-39 7-.9 2.9-.8 4.3.3 6.4 1.9 3.7 86.4 88.4 90.1 90.2 1.8 1 4 1.3 5.6.9 4.1-1 90.9-88 92.1-92.3 1-3.9.1-6.9-3-9.7-2.1-1.9-3.8-2-34.6-2.3l-32.4-.3-.2-133.4-.3-133.4-4.2-5.6-18.5-.3-18.5-.2-2.6 2.6z"/></svg>
40
+ </a>
41
+ <div class="folder-sort-menu">
42
+ <ul>
43
+ <li><a data-sort="a-z" href="#">A → Z</a></li>
44
+ <li><a data-sort="z-a" href="#">Z → A</a></li>
45
+ <li><a data-sort="n-o" href="#">Newest → Oldest</a></li>
46
+ <li><a data-sort="o-n" href="#">Oldest → Newest</a></li>
47
+ </ul>
48
+ </div>
49
+ </li>
50
  <li class="last folder-checkbox">
51
  <input type="checkbox" id="folder-hide-show-checkbox">
52
  </li>
includes/plugin.updates.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- defined('ABSPATH') or wp_die('Nope, not accessing this');
4
 
5
  // Exit if accessed directly
6
 
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
  // Exit if accessed directly
6
 
includes/tree.class.php CHANGED
@@ -1,46 +1,58 @@
1
  <?php
2
- defined('ABSPATH') or die('Nope, not accessing this');
3
  class WCP_Tree {
4
 
5
  public function __construct() {
6
 
7
  }
8
 
9
- public static function get_full_tree_data($post_type) {
10
  $isAjax = (defined('DOING_AJAX') && DOING_AJAX)?1:0;
11
  $type = filter_input(INPUT_GET, $post_type, FILTER_SANITIZE_STRING);
12
  if((isset($type) && !empty($type)) || ! $isAjax) {
13
  update_option("selected_" . $post_type . "_folder", "");
14
  }
15
- return self::get_folder_category_data($post_type, 0, 0);
16
  }
17
 
18
- public static function get_folder_category_data($post_type, $parent = 0, $parentStatus = 0) {
19
- $terms = get_terms( $post_type, array(
 
20
  'hide_empty' => false,
21
  'parent' => $parent,
22
- 'orderby' => 'meta_value_num',
23
- 'order' => 'ASC',
24
  'hierarchical' => false,
25
  'update_count_callback' => '_update_generic_term_count',
26
- 'meta_query' => [[
 
 
 
 
 
 
 
27
  'key' => 'wcp_custom_order',
28
  'type' => 'NUMERIC',
29
- ]]
30
- ));
 
 
 
31
  $string = "";
32
  $sticky_string = "";
33
  $child = 0;
34
  $isAjax = (defined('DOING_AJAX') && DOING_AJAX)?1:0;
35
  if(!empty($terms)) {
36
  $child = count($terms);
37
- foreach($terms as $term) {
38
 
 
 
 
39
 
40
  $is_sticky = get_term_meta($term->term_id, "is_folder_sticky", true);
41
 
42
  $status = get_term_meta($term->term_id, "is_active", true);
43
- $return = self::get_folder_category_data($post_type, $term->term_id, $status);
44
  $class = ($status == 1 && $return['child']>0)?"active":"";
45
  $class .= ($return['child'])>0?" has-sub-tree":"";
46
  $term_var = filter_input(INPUT_GET, "term", FILTER_SANITIZE_STRING);
@@ -99,7 +111,7 @@ class WCP_Tree {
99
 
100
  public static function get_option_data_for_select($post_type) {
101
  $string = "<option value='0'>Parent Folder</option>";
102
- $string .= self::get_folder_option_data($post_type, 0, '&nbsp;&nbsp;');
103
  return $string;
104
  }
105
 
1
  <?php
2
+ if(!defined('ABSPATH')) exit;
3
  class WCP_Tree {
4
 
5
  public function __construct() {
6
 
7
  }
8
 
9
+ public static function get_full_tree_data($post_type, $order_by = "", $order = "") {
10
  $isAjax = (defined('DOING_AJAX') && DOING_AJAX)?1:0;
11
  $type = filter_input(INPUT_GET, $post_type, FILTER_SANITIZE_STRING);
12
  if((isset($type) && !empty($type)) || ! $isAjax) {
13
  update_option("selected_" . $post_type . "_folder", "");
14
  }
15
+ return self::get_folder_category_data($post_type, 0, 0, $order_by, $order);
16
  }
17
 
18
+ public static function get_folder_category_data($post_type, $parent = 0, $parentStatus = 0, $order_by = "", $order = "") {
19
+
20
+ $arg = array(
21
  'hide_empty' => false,
22
  'parent' => $parent,
 
 
23
  'hierarchical' => false,
24
  'update_count_callback' => '_update_generic_term_count',
25
+ );
26
+ if(!empty($order_by) && !empty($order)) {
27
+ $arg['orderby'] = $order_by;
28
+ $arg['order'] = $order;
29
+ } else {
30
+ $arg['orderby'] = 'meta_value_num';
31
+ $arg['order'] = 'ASC';
32
+ $arg['meta_query'] = [[
33
  'key' => 'wcp_custom_order',
34
  'type' => 'NUMERIC',
35
+ ]];
36
+ }
37
+
38
+ $terms = get_terms( $post_type, $arg);
39
+
40
  $string = "";
41
  $sticky_string = "";
42
  $child = 0;
43
  $isAjax = (defined('DOING_AJAX') && DOING_AJAX)?1:0;
44
  if(!empty($terms)) {
45
  $child = count($terms);
46
+ foreach($terms as $key=>$term) {
47
 
48
+ if(!empty($order_by) && !empty($order)) {
49
+ update_term_meta($term->term_id, "wcp_custom_order", ($key+1));
50
+ }
51
 
52
  $is_sticky = get_term_meta($term->term_id, "is_folder_sticky", true);
53
 
54
  $status = get_term_meta($term->term_id, "is_active", true);
55
+ $return = self::get_folder_category_data($post_type, $term->term_id, $status, $order_by, $order);
56
  $class = ($status == 1 && $return['child']>0)?"active":"";
57
  $class .= ($return['child'])>0?" has-sub-tree":"";
58
  $term_var = filter_input(INPUT_GET, "term", FILTER_SANITIZE_STRING);
111
 
112
  public static function get_option_data_for_select($post_type) {
113
  $string = "<option value='0'>Parent Folder</option>";
114
+ $string .= self::get_folder_option_data($post_type, 0, '');
115
  return $string;
116
  }
117
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
3
  Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
4
  Requires at least: 3.0.0
5
  Tested up to: 5.4
6
- Stable tag: 2.5
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
@@ -62,6 +62,7 @@ Digital Agencies: You're creating all sorts of content for your clients daily -
62
  * Drag and drop folders, change order, and hierarchy
63
  * Upload directly to a media library folder - you can easily upload images or any other kind of files to a specific folder
64
  * Select a default folder for your media library, posts, pages, and custom posts - you can select the folder that will load by default when you open your media library, pages, posts, and custom posts. For example, you can show all the unassigned files whenever you open the media library.
 
65
  * New! Media Library folders upload progress bar - track the progress of your uploads to the media library in real time.
66
  * Bulk select images and media files and drag them to any folder. No worries, you can also drag and drop media library files one-by-one if you want :)
67
  * Bulk select and delete folders. You can select one folder or more and delete it in the click of a button.
@@ -158,6 +159,9 @@ A live demo for the Folders plugin is available at <a href="https://demo.premio.
158
 
159
  == Changelog ==
160
 
 
 
 
161
  = 2.5 =
162
  When you use a media library folder in pages and posts, your choice will be stored for next uses. We've also fixed some RTL UI issues. You can also remove the upper folders if you want. We've added an option to bulk move files in the media library in list mode (not using drag and drop).
163
 
3
  Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
4
  Requires at least: 3.0.0
5
  Tested up to: 5.4
6
+ Stable tag: 2.5.1
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
62
  * Drag and drop folders, change order, and hierarchy
63
  * Upload directly to a media library folder - you can easily upload images or any other kind of files to a specific folder
64
  * Select a default folder for your media library, posts, pages, and custom posts - you can select the folder that will load by default when you open your media library, pages, posts, and custom posts. For example, you can show all the unassigned files whenever you open the media library.
65
+ * New! Sort your folders - you can sort your folders based on name and creation date
66
  * New! Media Library folders upload progress bar - track the progress of your uploads to the media library in real time.
67
  * Bulk select images and media files and drag them to any folder. No worries, you can also drag and drop media library files one-by-one if you want :)
68
  * Bulk select and delete folders. You can select one folder or more and delete it in the click of a button.
159
 
160
  == Changelog ==
161
 
162
+ = 2.5.1 =
163
+ Sort your folders based on name and creation date. We've also added some usability improvements, fixed some WPML and Polylang issue, and fixed some bugs
164
+
165
  = 2.5 =
166
  When you use a media library folder in pages and posts, your choice will be stored for next uses. We've also fixed some RTL UI issues. You can also remove the upper folders if you want. We've added an option to bulk move files in the media library in list mode (not using drag and drop).
167
 
templates/admin/admin-content.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  ?>
4
  <style>
5
  .ui-state-highlight {
@@ -13,7 +13,7 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
13
  global $typenow;
14
  $width = get_option("wcp_dynamic_width_for_" . $typenow);
15
  if($width == null || empty($width)) {
16
- $width = 292;
17
  }
18
  $width = $width - 40;
19
  $customize_folders = get_option('customize_folders');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  ?>
4
  <style>
5
  .ui-state-highlight {
13
  global $typenow;
14
  $width = get_option("wcp_dynamic_width_for_" . $typenow);
15
  if($width == null || empty($width)) {
16
+ $width = 315;
17
  }
18
  $width = $width - 40;
19
  $customize_folders = get_option('customize_folders');
templates/admin/folder-deactivate-form.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  ?>
4
  <style>
5
  .folder-hidden {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  ?>
4
  <style>
5
  .folder-hidden {
templates/admin/folder-popup.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <div class="folder-popup" id="folder-intro-popup">
2
  <div class="folder-popup-box">
3
  <div class="folder-popup-header">
1
+ <?php if(!defined('ABSPATH')) exit; ?>
2
  <div class="folder-popup" id="folder-intro-popup">
3
  <div class="folder-popup-box">
4
  <div class="folder-popup-header">
templates/admin/general-settings.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  ?>
4
  <!-- do not change here, Free/Pro URL Change -->
5
  <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css' type='text/css' media='all' />
@@ -102,6 +102,7 @@ defined('ABSPATH') or wp_die('Nope, not accessing this');
102
  $default_folders = (empty($default_folders) || !is_array($default_folders))?array():$default_folders;
103
  do_settings_sections( __FILE__ );
104
  ?>
 
105
  <div class="accordion">
106
  <div class="accordion-header">Folders Settings <span class="dashicons dashicons-arrow-down-alt2"></span></div>
107
  <div class="accordion-content" style="display: block">
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  ?>
4
  <!-- do not change here, Free/Pro URL Change -->
5
  <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css' type='text/css' media='all' />
102
  $default_folders = (empty($default_folders) || !is_array($default_folders))?array():$default_folders;
103
  do_settings_sections( __FILE__ );
104
  ?>
105
+ <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>">
106
  <div class="accordion">
107
  <div class="accordion-header">Folders Settings <span class="dashicons dashicons-arrow-down-alt2"></span></div>
108
  <div class="accordion-content" style="display: block">
templates/admin/help.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  ?>
4
  <div class="folder-help-form">
5
  <form action="<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>" method="post" id="folder-help-form">
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  ?>
4
  <div class="folder-help-form">
5
  <form action="<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>" method="post" id="folder-help-form">
templates/admin/update.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <style>
2
 
3
  .updates-form-form {
1
+ <?php if(!defined('ABSPATH')) exit; ?>
2
  <style>
3
 
4
  .updates-form-form {
templates/admin/upgrade-to-pro.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- defined('ABSPATH') or wp_die('Nope, not accessing this');
3
  $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=";
4
  ?>
5
  <link href="<?php echo esc_url(WCP_FOLDER_URL."assets/css/select2.min.css?ver=".WCP_FOLDER_VERSION) ?>" type="text/css" rel="stylesheet" />
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=";
4
  ?>
5
  <link href="<?php echo esc_url(WCP_FOLDER_URL."assets/css/select2.min.css?ver=".WCP_FOLDER_VERSION) ?>" type="text/css" rel="stylesheet" />