first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,921 @@
/**
* Styles for the Widget to be displayed in the plugin
*/
@positiveColor: #bbd2a1;
@webpPositiveColor: #8CC152;
@negativeColor: #D2D3D6;
@neutralColor: #828282;
@errorColor: #fb5d49;
@waringColor: #ffb635;
@greyButtonBg: #f3f3f3;
@greyButtonColor: #656565;
@greenButtonBg: #c9deb2;
@greenButtonColor: #586549;
@orangeButtonBg: #fdd599;
@orangeButtonColor: #a57b3c;
#WBCR {
.premium-label(@position: relative, @positionTop:-8px, @positionLeft:-10px, @positionRight:auto) {
display: inline-block;
position: @position;
content: 'PRO';
background: #ff5722;
border-radius: 4px;
color: #fff;
font-size: 10px;
line-height: 1;
font-style: normal;
padding: 4px 6px;
margin-left: 4px;
vertical-align: top;
top: @positionTop;
left: @positionLeft;
right: @positionRight;
z-index: 11;
}
.factory-bootstrap-000 {
select.form-control {
background: #efefef url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55% !important;
}
.btn-default.active, .factory-bootstrap-000 .btn-default:active {
text-shadow: none;
color: #fff;
background-color: #33aad5;
-webkit-box-shadow: inset 0 1px 1px #0074a2;
box-shadow: inset 0 1px 3px #0074a2;
border-top: 1px solid #0074a2;
border-bottom: 1px solid #0074a2;
border-left: 1px solid #0074a2;
}
.btn-group > .btn:last-of-type {
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
}
.wio-clear {
clear: both;
}
// This code hides tabs custom folders and nextgen gallery
// -----------------------------------------------
#io_folders_statistic-wbcr_clearfy-tab, #io_nextgen_gallery_statistic-wbcr_clearfy-tab {
display: none !important;
}
// Styling tabs on statistics pages
// -----------------------------------------------
.wrio-statistic-nav {
margin: 0;
//box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
background: #efefef;
ul {
margin: 0 0 0 10px;
li {
position: relative;
display: inline-block;
//width: 300px;
margin: 0 5px 0 0;
background: #ffffff;
box-shadow: 0 -2px 0 #eaeaea;
&:hover {
background: #f7f7f7;
}
&.active {
//box-shadow: 0 -2px 0 #c9deb2;
background: #f7f7f7;
border-top: 1px solid #d4d4d4;
border-left: 1px solid #d4d4d4;
border-right: 1px solid #d4d4d4;
border-bottom: 1px solid #f7f7f7;
margin-bottom: -1px;
a {
color: #222;
.wrio-statistic-tab-percent {
border: 2px dashed #8bc34a;
color: #5e8237;
}
}
.dashicons, .dashicons-before:before {
color: #ff8b66;
}
}
.wrio-statistic-tab {
display: block;
padding: 10px 20px 10px 20px;
text-decoration: none;
color: #d4d4d4;
font-size: 22px;
line-height: 2;
&:active, &:focus {
background: 0;
box-shadow: none;
outline: none;
}
.dashicons, .dashicons-before:before {
display: inline-block;
width: 30px;
height: 30px;
font-size: 30px;
line-height: 1.5;
margin-right: 15px;
color: #d4d4d4;
}
.wrio-statistic-tab-percent {
display: inline-block;
width: 42px;
height: 42px;
border-radius: 100px;
border: 2px dashed #e4e4e4;
padding: 5px;
margin-left: 30px;
font-size: 14px;
font-weight: 600;
text-align: center;
color: #bdbdbd;
}
}
.wrio-statistic-tab-premium-label:after {
.premium-label(absolute, 10px, auto, 10px);
}
}
}
}
// Table style. The table is used for optimization log
.wrio-table {
width: 100%;
table-layout: fixed;
box-sizing: border-box;
border-spacing: 3px;
background: #fff;
border-top: 2px dashed #cac9c9;
th, td {
padding: 16px 10px;
text-align: center;
}
th {
background: #f3f3f3;
color: #777777;
box-shadow: 0 1px 0 rgb(216, 216, 216);
&:nth-child(2n+1) {
background: #f9f9f9
}
}
tr.wrio-error {
background-color: #ffe9e9 !important;
}
.wrio-table-spinner {
background: url("../img/quick-start-loader.gif") center center no-repeat;
}
.wrio-table-highlighter {
display: inline-block;
padding: 3px 7px;
background: @greyButtonBg;
}
.wbcr-rio-server-success {
color: @positiveColor;
}
.wbcr-rio-server-error {
color: @errorColor;
}
.wbcr-rio-server-warning {
color: @waringColor;
}
&.wbcr-rio-folders-table {
td:nth-child(3) {
text-align: left;
}
}
}
.wrio-servers {
padding: 20px 20px;
label {
span {
display: block;
font-weight: normal;
font-size: 12px;
color: #b7b2b2;
}
}
#wrio-change-optimization-server {
position: relative;
display: inline-block;
max-width: 400px;
margin-right: 15px;
margin-bottom: 0;
border: 1px solid #d2d0d0;
background-color: #efefef;
}
.wrio-servers-info {
margin: 0 0 0;
padding: 20px;
background: #fff;
}
.wrio-server-status-wrap {
display: inline-block;
margin-top: 8px;
.wrio-server-status {
background: transparent;
color: #fff;
padding: 3px 5px;
border-radius: 4px;
&.wrio-down {
background: #ff5722;
}
&.wrio-stable {
background: #8bc34a;
}
&.wrio-server-check-proccess {
display: inline-block;
height: 10px;
width: 30px;
background: url("../img/quick-start-loader.gif") center no-repeat;
}
}
}
.wrio-premium-user-balance-wrap {
display: inline-block;
margin-top: 8px;
margin-left: 10px;
.wrio-premium-user-balance {
color: #fff;
padding: 3px 5px;
border-radius: 4px;
background: #ffc107;
}
.wrio-premium-user-balance-check-proccess {
display: inline-block;
height: 10px;
width: 30px;
background: url("../img/quick-start-loader.gif") center no-repeat;
}
}
.wrio-premium-user-update-wrap {
display: inline-block;
margin-top: 8px;
margin-left: 10px;
.wrio-premium-user-update {
color: #fff;
padding: 3px 5px;
border-radius: 4px;
background: #ffc107;
}
.wrio-premium-user-update-check-proccess {
display: inline-block;
height: 10px;
width: 30px;
background: url("../img/quick-start-loader.gif") center no-repeat;
}
}
}
.wio-columns {
overflow: hidden;
padding: 15px 0;
counter-reset: cols;
[class^="col-"] {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.col-1-3 {
width: 33.333%;
padding-left: 28px;
}
.col-2-3 {
width: 66.666%;
padding-left: 28px
}
.col-1-2 {
width: 50%;
padding: 0 20px;
}
.col-statistics.col-statistics {
width: 60%;
}
.col-chart.col-chart {
width: 40%;
position: relative;
padding: 20px;
font-size: 12px;
text-transform: uppercase;
background: #f1f1f1b3;
color: #abacaf;
font-weight: bold;
border-radius: 5px;
margin-top: 10px;
text-align: left;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
}
.wio-col {
float: left;
width: 50%;
box-sizing: border-box;
-webkit-flex-basis: 50%;
-ms-flex-preferred-size: 50%;
flex-basis: 50%;
}
.wio-col {
padding-right: 20px;
}
.wio-col + .wio-col {
padding-right: 0;
padding-left: 50px;
}
.wio-col:target {
animation: wiohello 1s 3 linear backwards;
}
.wio-number-you-optimized {
margin-bottom: 1.35em;
overflow: hidden;
#wio-total-optimized-attachments-pct {
color: @neutralColor;
}
.wio-number {
display: table-cell;
padding-right: 15px;
font-size: 48px;
font-weight: bold;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
color: @neutralColor;
}
.wio-text {
display: table-cell;
vertical-align: middle;
overflow: hidden;
font-size: 12px;
color: @neutralColor;
}
& > p {
display: table;
}
}
.wio-bars {
padding-right: 15px;
}
.wio-bars p {
font-size: 12px;
margin-bottom: 5px;
}
.wio-bars + .wio-number-you-optimized {
border-bottom: 0;
padding-top: 0.85em;
}
.wio-bars + .wio-number-you-optimized p {
color: darken(@positiveColor, 10);
}
.wio-bar-negative {
.wio-progress {
background: @negativeColor;
}
.wio-barnb {
color: darken(@negativeColor, 20);
}
}
.wio-progress {
height: 8px;
transition: width .3s;
/*.wio-bar-negative {
width: 92% !important;
}*/
}
.wio-bar-positive {
.wio-progress {
background: @positiveColor;
}
.wio-barnb {
color: darken(@positiveColor, 10);
}
}
.wio-bar-primary {
.wio-progress {
background: @positiveColor;
}
.wio-barnb {
color: darken(@positiveColor, 10);
}
}
.wio-bar-webp {
.wio-progress {
background: @webpPositiveColor;
}
.wio-barnb {
color: darken(@webpPositiveColor, 10);
}
}
.wio-right-outside-number .wio-barnb {
display: block;
margin-right: -5.25em;
text-align: right;
font-weight: bold;
line-height: .8;
}
/* Doughnut */
.wio-chart {
position: relative;
top: 1px;
display: inline-block;
vertical-align: middle;
}
.wio-chart-container {
position: relative;
display: inline-block;
margin-right: 5px;
}
.wio-chart-container canvas {
display: block;
}
.wio-overview-chart-container {
float: left;
margin-right: 20px;
}
.wio-overview-chart-container-webp {
float: right;
margin-left: 20px;
}
.wio-chart-wrapper {
position: relative;
width: 200px;
height: 200px;
}
.wio-chart-percent {
color: #afafaf;
position: absolute;
font-size: 35px;
font-weight: 600;
left: 50%;
bottom: 167px;
z-index: 100;
transform: translateX(-45%);
-webkit-transform: translateX(-45%);
-ms-transform: translateX(-45%);
}
.wio-chart-percent span {
font-size: 20px;
vertical-align: super;
}
#wio-overview-chart-legend {
overflow: hidden;
}
.wio-doughnut-legend li {
display: inline-block;
position: relative;
margin-bottom: 15px;
border-radius: 5px;
padding: 3px 8px 2px 31px;
font-size: 9px;
cursor: default;
-webkit-transition: background-color 200ms ease-in-out;
-moz-transition: background-color 200ms ease-in-out;
-o-transition: background-color 200ms ease-in-out;
transition: background-color 200ms ease-in-out;
}
.wio-doughnut-legend li span {
display: block;
position: absolute;
left: 0;
top: 0;
width: 25px;
height: 25px;
border-radius: 50%;
}
.wio-optimize-button {
min-width: 180px;
padding: 12px 30px;
background: @greenButtonBg;
color: @greenButtonColor;
border: 0;
box-shadow: none;
font-size: 14px;
text-transform: uppercase !important;
font-weight: bold;
border-radius: 4px;
outline: none;
&:active {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}
&:disabled {
background: lighten(@greenButtonBg, 10%);
color: lighten(@greenButtonColor, 30%);
}
&.wio-running {
color: @orangeButtonColor;
background: @orangeButtonBg url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
padding-left: 50px;
}
}
.wio-global-optim-phrase {
width: 180px;
padding-top: 20px;
font-size: 14px;
text-align: center;
}
.wio-total-percent, .wio-total-percent-webp {
color: darken(@positiveColor, 20);
}
#wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
display: none;
}
.wio-text-left {
text-align: left;
}
span.wio-num {
display: inline !important;
position: inherit !important;
}
// WIDGETS SPACE
// -----------------------------------------------
.wio-image-optimize-board {
padding-bottom: 0 !important;
}
.wio-page-statistic {
padding: 20px;
.wio-optimize-statistic {
display: flex;
justify-content: space-between;
}
.wrio-statistic-buttons-wrap {
display: flex;
justify-content: space-between;
}
}
.wio-stat-totals {
padding: 20px 20px;
background: #efefef;
font-weight: bold;
vertical-align: middle;
&__counter {
display: inline-block;
background: #ffffff;
min-width: 30px;
height: 25px;
padding: 2px 5px;
border-radius: 3px;
border: 1px dashed #bdb5b5;
color: #222;
font-weight: normal;
text-align: center;
}
&__loading {
color: #fff;
background: #fff url("../img/quick-start-loader.gif") center no-repeat !important;
background-size: 16px 16px !important;
}
&__totals {
}
&__optimized {
background: #8bc34a;
color: #fff;
}
}
.wrio-optimization-progress {
//margin-top: 30px;
background: none;
padding: 0;
h4 {
font-size: 15px;
font-weight: 700;
}
/*button {
padding: 5px 10px;
border: 0;
font-size: 11px;
text-transform: uppercase !important;
font-weight: bold;
border-radius: 4px;
outline: none;
background: @greyButtonBg;
color: @greyButtonColor;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
&:active {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}
&.wbcr-rio-loading {
width: 56px;
font-size: 0;
background: @greyButtonBg url("../img/quick-start-loader.gif") center no-repeat;
}
&.wbcr-rio-selected {
background: #f3efe2;
color: #d8d8d8;
&:active {
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}
}
}*/
.wbcr-rio-warning-message {
padding: 20px;
background: #efefef;
font-size: 15px;
color: #b7b7b7;
font-style: italic;
}
}
.wio-widget {
padding: 0 !important;
.wio-chart-percent {
font-size: 44px;
line-height: 1;
}
.wio-bars {
width: 60%;
margin-left: 155px;
}
.col-chart.col-chart {
width: 100%;
}
.col-controls {
width: 45%;
padding-left: 5px;
padding-top: 110px
}
.wio-doughnut-legend {
/*padding-top:30px;*/
text-align: left;
}
.wio-widget-bottom {
display: table;
padding-top: 20px !important;
width: 100%;
text-align: right;
}
.wio-widget-bottom li {
display: table-cell;
}
.wio-widget-bottom li:first-child {
text-align: left;
}
}
// FORMS SPACE
// -----------------------------------------------
.factory-checkbox {
&.wrio-checkbox-premium-label:after {
.premium-label();
}
}
.factory-checkbox-disabled {
input, button {
pointer-events: none;
cursor: not-allowed;
opacity: .65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
}
}
#wrio-webp-options, #wrio-error-log-options {
h3 {
font-size: 14px;
margin: 0 0 10px 0;
font-weight: 600;
color: #565656;
}
.wrio-webp-options-info {
color: #8a8787;
font-size: 12px;
}
ul {
padding-left: 0;
li {
&:after {
content: '';
display: block;
clear: both;;
}
label {
font-weight: 600;
}
.wrio-webp-options-radio, .wrio-error-log-options-checkbox {
display: block;
float: left;
margin-top: 2px;
margin-right: 8px;
&:focus {
outline: none;
box-shadow: none;
}
}
.wrio-webp-options-info, .wrio-error-log-options-info {
padding-left: 25px;
}
}
}
}
// MEDIA SPACE
// -----------------------------------------------
@media (max-width: 830px) {
.wio [class^="col-"] {
float: none;
margin-bottom: 1.5em;
}
.wio .col-1-3,
.wio .col-1-2 {
width: auto;
padding: 0 28px;
clear: both;
padding-top: 1em;
}
}
@keyframes wiohello {
0%, 100% {
background: #FFF;
}
50% {
background: #F4F7F9;
}
}
@media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
.wio-columns {
.col-statistics.col-statistics, .col-chart.col-chart {
width: 50%;
}
}
}
@media (max-width: 808px) {
.wio-columns {
.col-statistics.col-statistics, .col-chart.col-chart {
width: auto;
float: none;
padding: 0;
}
.col-chart.col-chart {
margin-top: 3em;
}
}
}
/*@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
.wio-overview-chart-container {
float: none;
margin-right: 0;
}
}
@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
.wio-overview-chart-container {
float: none;
margin-right: 0;
}
.wio-doughnut-legend {
margin-top: 18px;
}
.wio-global-optim-phrase {
padding-top: 0;
width: auto;
}
}*/
}

View File

@@ -0,0 +1,2 @@
<?php
// silence is golden

View File

@@ -0,0 +1,235 @@
/**
* == Custom column & Metabox
*/
.column-wio_optimized_file.column-wio_optimized_file {
width: 300px;
text-align: center;
vertical-align: middle;
}
.column-wio_optimized_file > * {
max-width: 235px;
margin: 0 auto;
}
@media (min-width: 1151px) and (max-width: 1800px) {
.column-wio_optimized_file.column-wio_optimized_file {
width: 235px;
}
}
@media (min-width: 783px) and (max-width: 1150px) {
.column-wio_optimized_file.column-wio_optimized_file {
width: 13em;
}
table.media .column-title .has-media-icon ~ .row-actions.row-actions {
margin-left: 0;
}
}
@media (max-width: 782px) {
table.media .column-wio_optimized_file.column-wio_optimized_file {
text-align: left;
}
table.media .wio-datas-more-action,
table.media .wio-datas-actions-links {
text-align: center;
}
table.media .column-wio_optimized_file > *,
table.media .column-wio_optimized_file .wio-datas-actions-links a {
max-width: 100%;
margin-left: 0;
}
}
@media (min-width: 783px) and (max-width: 1150px), (max-width: 360px) {
table.media .wio-hide-if-small {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
}
}
.compat-field-wio .label {
vertical-align: top;
}
.compat-field-wio ul.wio-datas-list {
margin-top: 7px;
font-size: 11px;
}
ul.wio-datas-list.wio-datas-list {
margin: 0 auto;
color: #555;
font-size: 10px;
}
ul.wio-datas-list .big {
font-size: 12px;
color: #40B1D0;
}
.wio-data-item {
overflow: hidden;
}
li.wio-data-item {
clear: both;
margin-bottom: 2px;
display: flex;
align-items: center;
gap: 5px;
}
ul.wio-datas-list .wio-data-item span.data,
ul.wio-datas-list .wio-data-item strong {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
ul.wio-datas-list .wio-data-item span.data {
text-align: left;
padding-right: 5px;
}
.compat-field-wio .wio-datas-list .wio-data-item .data {
width: 130px;
text-align: left;
font-weight: bold;
}
ul.wio-datas-list .wio-data-item strong {
text-align: left;
padding-left: 5px;
}
.media-sidebar .wio-datas-list .wio-data-item .data {
width: auto;
float: none;
}
.media-sidebar .wio-datas-list .wio-data-item strong {
display: inline-block;
width: auto;
float: none;
}
.media-sidebar .wio-datas-list .wio-data-item .wio-chart {
float: left;
}
.wio-datas-more-action.wio-datas-more-action {
margin: .4em auto;
background: linear-gradient(to bottom, transparent, transparent 49%, rgba(0,0,0,.075) 50%, rgba(0,0,0,.075) 58%, transparent 58%, transparent);
}
.wio-datas-more-action a {
display: inline-block;
padding: 0 5px;
background: #40B1D0;
color: #FFF;
text-transform: uppercase;
font-size: 9px;
font-weight: bold;
line-height: 1.9;
text-decoration: none;
}
.wio-datas-more-action a.is-open {
background: #555;
}
.wio-datas-more-action a.is-open .dashicons {
transform: rotate(180deg);
}
.wio-datas-more-action a .dashicons {
font-size: 14px;
vertical-align: middle;
line-height: .8;
}
.wio-datas-more-action a .dashicons:before {
vertical-align: middle;
line-height: 20px;
}
.wio-datas-more-action .the-text {
display: inline-block;
vertical-align: middle;
height: auto;
line-height: inherit;
}
ul.wio-datas-details.wio-datas-details {
margin: .7em auto;
}
.wio-datas-details strong {
color: #40B1D0;
}
.wio-datas-details .original {
color: #555;
}
.wio-datas-actions-links {
overflow: hidden;
border-top: 2px solid transparent;
padding-top: 5px;
font-size: 8px;
}
.nggform .wio-datas-actions-links {
position: relative;
z-index: 2;
}
.nggform .row-actions {
z-index: 1;
}
.wio-datas-actions-links a {
position: relative;
display: inline-block;
padding-left: 17px;
text-decoration: none;
font-weight: 600;
}
.compat-field-wio .wio-datas-actions-links {
max-width: 300px;
}
.misc-pub-wio .wio-datas-actions-links {
border-top: 2px solid #f2f2f2;
padding-bottom: 5px;
}
/* Library */
.column-wio_optimized_file .wio-datas-actions-links a {
margin: 0 .7em;
padding-left: 15px;
}
/* Media edition */
.compat-field-wio .wio-datas-actions-links a,
.misc-pub-wio .wio-datas-actions-links a {
font-size: 10px;
float: left;
width: 50%;
}
.media-sidebar .compat-field-wio .wio-datas-actions-links a,
.submitbox .misc-pub-wio .wio-datas-actions-links a {
display: block;
width: auto;
float: none;
}
.wio-datas-actions-links a:only-child {
float: none;
width: auto;
}
.wio-datas-details.is-open + .wio-datas-actions-links {
border-top-color: rgba(0,0,0,.075);
}
.wio-datas-actions-links .dashicons {
position: absolute;
left: 0; top: 4px;
width: 12px;
margin-right: 2px;
font-size: 11px;
}
/* Button spacing */
td.column-wio_optimized_file {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 8px;
}
.column-wio_optimized_file .wio-datas-actions-links {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 8px 1em;
}
.column-wio_optimized_file .wio-datas-actions-links a {
margin: 0;
}

View File

@@ -0,0 +1,19 @@
/* PRO labels for dropdown buttons */
button[data-value="googlepage"]:after,
button[data-value="background"]:after {
display: inline-block;
position: absolute;
content: 'PRO';
background: #ff5722;
border-radius: 4px;
color: #fff;
font-size: 10px;
line-height: 1;
font-style: normal;
padding: 4px 6px;
margin-left: 4px;
vertical-align: top;
top: -8px;
right: 0;
z-index: 11;
}

View File

@@ -0,0 +1,410 @@
/**
* == Columns
*/
.wio-columns {
overflow: hidden;
padding: 15px 0;
counter-reset: cols;
}
.wio-columns [class^="col-"] {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.wio-columns .col-1-3 {
width: 33.333%;
padding-left: 28px;
}
.wio .col-2-3 {
width: 66.666%;
padding-left: 28px
}
.wio .col-1-2 {
width: 50%;
padding: 0 20px;
}
@media (max-width: 830px) {
.wio [class^="col-"] {
float: none;
margin-bottom: 1.5em;
}
.wio .col-1-3,
.wio .col-1-2 {
width: auto;
padding: 0 28px;
clear: both;
padding-top: 1em;
}
}
/* Col, behavior depending on parent */
.wio-col {
float: left;
width: 50%;
box-sizing: border-box;
-webkit-flex-basis: 50%;
-ms-flex-preferred-size: 50%;
flex-basis: 50%;
}
.wio-col {
padding-right: 20px;
}
.wio-col + .wio-col {
padding-right: 0;
padding-left: 50px;
}
.wio-col:target {
animation: wiohello 1s 3 linear backwards;
}
@keyframes wiohello {
0%, 100% {
background: #FFF;
}
50% {
background: #F4F7F9;
}
}
.wio-columns .col-statistics.col-statistics {
width: 60%;
}
@media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
.wio-columns .col-statistics.col-statistics,
.wio-columns .col-chart.col-chart {
width: 50%;
}
}
@media (max-width: 808px) {
.wio-columns .col-statistics.col-statistics,
.wio-columns .col-chart.col-chart {
width: auto;
float: none;
padding: 0;
}
.wio-columns .col-chart.col-chart {
margin-top: 3em;
}
}
/* Number display */
.wio-number-you-optimized {
margin-bottom: 1.35em;
overflow: hidden;
}
.wio-number-you-optimized .number {
display: table-cell;
padding-right: 15px;
font-size: 48px;
font-weight: bold;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
color: #000;
}
.wio-number-you-optimized [id="wio-total-optimized-attachments-pct"] {
color: #40B1D0;
}
.wio-number-you-optimized .text {
display: table-cell;
vertical-align: middle;
overflow: hidden;
font-size: 12px;
color: #626E7B;
}
.wio-number-you-optimized > p {
display: table;
}
/* Number and bars */
.wio-bars {
padding-right: 15px;
}
.wio-bars p {
font-size: 12px;
margin-bottom: 5px;
}
.wio-bars + .wio-number-you-optimized {
border-bottom: 0;
padding-top: 0.85em;
}
.wio-bars + .wio-number-you-optimized p {
color: #46b1ce;
}
.wio-bar-negative .wio-progress {
background: #D2D3D6;
}
.wio-bar-negative .wio-barnb {
color: #7A8996;
}
.wio-bar-neutral .wio-progress {
background: #F5A623;
}
.wio-space-left .wio-bar-negative .wio-progress {
background: #C51162;
}
.wio-progress {
height: 8px;
}
.wio-progress {
transition: width .3s;
}
.wio-bar-positive .wio-progress {
background: #8CC152;
}
.wio-bar-positive .wio-barnb {
color: #8CC152;
}
.wio-bar-primary .wio-progress {
background: #8bc34a;
}
.wio-bar-primary .wio-barnb {
color: #8bc34a;
}
.right-outside-number .wio-barnb {
display: block;
margin-right: -5.25em;
text-align: right;
font-weight: bold;
line-height: .8;
}
/* Doughnut */
.wio-chart {
position: relative;
top: 1px;
display: inline-block;
vertical-align: middle;
}
.wio-chart-container {
position: relative;
display: inline-block;
margin-right: 5px;
}
.wio-chart-container canvas {
display: block;
}
.wio-overview-chart-container {
float: left;
margin-right: 20px;
}
@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
.wio-overview-chart-container {
float: none;
margin-right: 0;
}
}
.wio-chart-percent {
position: absolute;
left: 0;
right: 0;
top: 50%;
margin-top: -.5em;
line-height: 1;
text-align: center;
font-size: 55px;
font-weight: bold;
color: #afafaf;
}
.wio-chart-percent span {
font-size: 20px;
vertical-align: super;
}
#wio-overview-chart-legend {
overflow: hidden;
}
.imagify-doughnut-legend {
margin-top: 38px;
list-style: none;
}
.wio-doughnut-legend li {
display: inline-block;
padding-left: 30px;
position: relative;
margin-bottom: 15px;
border-radius: 5px;
padding: 3px 8px 2px 31px;
font-size: 13px;
cursor: default;
-webkit-transition: background-color 200ms ease-in-out;
-moz-transition: background-color 200ms ease-in-out;
-o-transition: background-color 200ms ease-in-out;
transition: background-color 200ms ease-in-out;
}
.wio-doughnut-legend li span {
display: block;
position: absolute;
left: 0;
top: 0;
width: 25px;
height: 25px;
border-radius: 50%;
}
@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
.wio-overview-chart-container {
float: none;
margin-right: 0;
}
.wio-doughnut-legend {
margin-top: 18px;
}
.wio-global-optim-phrase {
padding-top: 0;
width: auto;
}
}
.wio-global-optim-phrase {
width: 180px;
padding-top: 20px;
font-size: 14px;
text-align: center;
}
.wio-clear {
clear: both;
}
.wio-total-percent {
color: #46b1ce;
}
.wio-columns .col-chart.col-chart {
width: 40%;
position: relative;
padding: 20px;
font-size: 12px;
text-transform: uppercase;
background: #f1f1f1b3;
color: #abacaf;
font-weight: bold;
border-radius: 5px;
margin-top: 10px;
text-align: left;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.wio-image-optimize-board {
padding-bottom: 0 !important;
}
.wio-optimize-button {
width: 180px;
padding: 12px 30px;
background: #c9deb2;
color: #586549;
border: 0;
box-shadow: none;
font-size: 16px;
text-transform: uppercase !important;
font-weight: bold;
border-radius: 4px;
outline: none;
}
.wio-optimize-button:active {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}
.wio-optimize-button.running {
color: #a57b3c;
background: #fdd599 url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
}
.wio-widget-bottom {
display: table;
padding-top: 20px !important;
width: 100%;
text-align: right;
}
.wio-widget-bottom li {
display: table-cell;
}
.wio-widget-bottom li:first-child {
text-align: left;
}
.wio-imagify-widget {
padding: 0 !important;
}
.wio-imagify-widget .wio-bars {
width: 60%;
margin-left: 155px;
}
.wio-imagify-widget .col-chart.col-chart {
width: 100%;
}
.wio-imagify-widget .col-controls {
width: 45%;
padding-left: 5px;
padding-top: 110px
}
.wio-imagify-widget .wio-doughnut-legend {
/*padding-top:30px;*/
text-align: left;
}
#wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
display: none;
}
.wio-text-left {
text-align: left;
}
span.wio-num {
display: inline !important;
position: inherit !important;
}

View File

@@ -0,0 +1,155 @@
/* Sub Layer */
body[class*="_rio"] .swal2-container.swal2-shown {
background: rgba(16, 17, 21, 0.9);
z-index: 100000;
}
.wrio-modal {
padding: 0 !important;
}
.wrio-modal .swal2-close {
color: rgba(0, 0, 0, 0.8);
}
.wrio-modal .swal2-modal {
border-radius: 2px;
}
.wrio-modal .swal2-icon {
margin-bottom: 25px;
}
.wrio-modal .swal2-title {
margin: 0;
padding: 28px 32px;
font-size: 24px;
text-align: left;
color: #fff !important;
background: #3e3e3e !important;
}
.wrio-modal .swal2-content {
font-size: 14px;
padding: 28px 32px;
background: #efefef;
}
.wrio-modal .swal2-buttonswrapper {
margin-top: 0;
padding: 22px;
background: #F4F7F9;
}
.wrio-modal .swal2-buttonswrapper a.button svg {
margin-right: 12px;
vertical-align: -2px;
}
.wrio-modal .swal2-buttonswrapper button.loading {
border-radius: 100% !important;
height: 40px !important;
padding: 0 !important;
box-shadow: none !important;
}
.wrio-modal .swal2-buttonswrapper button.swal2-styled {
height: auto;
padding: 12px 32px;
margin: 10px;
font-size: 14px;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 3px;
font-weight: bold;
outline: none;
}
.wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-confirm {
background-color: #fdd599 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #ceac7a !important;
color: #a57b3c !important;
}
.wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-cancel {
background-color: #d2d2d2 !important;
color: #656464 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #a9a9a9;
/*background-color: #c9deb2 !important;
color: #606956 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #a7b994;*/
}
.wrio-modal .swal2-buttonswrapper button.swal2-styled:focus,
.wrio-modal .swal2-buttonswrapper button.swal2-styled:hover {
outline: none;
text-shadow: none;
color: #FFF;
}
.wrio-modal-warning {
background: #FF5722 !important;
}
.wrio-modal-warning .swal2-title {
text-align: center;
color: #222 !important;
background: #efefef !important;
}
.wrio-modal-warning .swal2-content {
font-size: 16px;
padding: 10px 20px 32px;
background: #efefef;
}
.wrio-modal-warning .swal2-buttonswrapper {
background: #efefef;
}
.wrio-modal-error {
background: #dec2c0 !important;
}
.wrio-modal-error .swal2-title {
text-align: center;
color: #222 !important;
background: #efefef !important;
}
.wrio-modal-error .swal2-content {
font-size: 16px;
padding: 10px 20px 32px;
background: #efefef;
}
.wrio-modal-error .swal2-buttonswrapper {
background: #efefef;
}
.wrio-modal-optimization-way {
background: #1F2332 !important;
}
.wrio-modal-optimization-way .wrio-swal-subtitle {
padding: 0 0 28px;
margin-top: 0px;
font-weight: 500;
font-size: 18px;
text-align: left;
color: #8c8888;
background: #efefef;
}
.wrio-modal-optimization-way .wrio-list-infos {
margin: 0;
padding: 0;
}
.wrio-modal-optimization-way .wrio-list-infos li {
display: flex;
align-items: center;
padding: 5px 5px;
text-align: left;
font-size: 14px;
line-height: 1.5;
color: #787575;
}
.wrio-modal-optimization-way .wrio-list-infos li:first-child {
padding-top: 5px;
}
.wrio-modal-optimization-way .wrio-list-infos li:last-child {
padding-bottom: 5px;
}
.wrio-modal-optimization-way .wrio-list-infos li + li {
border-top: 1px solid #E9EFF2;
}
.wrio-modal-optimization-way .wrio-list-infos a:before {
content: '';
display: block;
}
.wrio-modal-optimization-way .wrio-info-icon {
flex-grow: 0;
flex-basis: 50px;
}
.wrio-modal-optimization-way .wrio-info-icon + span {
padding-left: 20px;
}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["sweetalert-custom.less"],"names":[],"mappings":";AACA,IAAI,eAAgB,iBAAgB;EAClC,iCAAA;EACA,eAAA;;AAGF;EACE,qBAAA;;AADF,WAGE;EACE,yBAAA;;AAJJ,WAOE;EACE,kBAAA;;AARJ,WAWE;EACE,mBAAA;;AAZJ,WAeE;EACE,SAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,WAAA;EACA,mBAAA;;AArBJ,WAwBE;EACE,eAAA;EACA,kBAAA;EACA,mBAAA;;AA3BJ,WA8BE;EACE,aAAA;EACA,aAAA;EACA,mBAAA;;AAjCJ,WA8BE,sBAKE,EAAC,OAAQ;EACP,kBAAA;EACA,oBAAA;;AArCN,WA8BE,sBAUE,OAAM;EACJ,8BAAA;EACA,uBAAA;EACA,qBAAA;EACA,2BAAA;;AA5CN,WA8BE,sBAiBE,OAAM;EACJ,YAAA;EACA,kBAAA;EACA,YAAA;EACA,eAAA;EACA,mBAAA;EACA,yBAAA;EACA,kBAAA;EACA,iBAAA;EACA,aAAA;;AAEA,WA5BJ,sBAiBE,OAAM,aAWH;EACC,yBAAA;EACA,4BAAA;EACA,2BAAA;EACA,cAAA;;AAGF,WAnCJ,sBAiBE,OAAM,aAkBH;EACC,yBAAA;EACA,cAAA;EACA,4BAAA;EACA,2BAAA;;;;;;AAOF,WA9CJ,sBAiBE,OAAM,aA6BH;AAAQ,WA9Cb,sBAiBE,OAAM,aA6BM;EACR,aAAA;EACA,iBAAA;EACA,WAAA;;AAMR;EACE,mBAAA;;AADF,mBAGE;EACE,kBAAA;EACA,WAAA;EACA,mBAAA;;AANJ,mBASE;EACE,eAAA;EACA,uBAAA;EACA,mBAAA;;AAZJ,mBAeE;EACE,mBAAA;;AAIJ;EACE,mBAAA;;AADF,iBAGE;EACE,kBAAA;EACA,WAAA;EACA,mBAAA;;AANJ,iBASE;EACE,eAAA;EACA,uBAAA;EACA,mBAAA;;AAZJ,iBAeE;EACE,mBAAA;;AAIJ;EACE,mBAAA;;AADF,4BAGE;EACE,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;EACA,mBAAA;;AAVJ,4BAaE;EACE,SAAA;EACA,UAAA;;AAfJ,4BAaE,iBAIE;EACE,aAAA;EACA,mBAAA;EACA,iBAAA;EACA,gBAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;;AAxBN,4BAaE,iBAcE,GAAE;EACA,gBAAA;;AA5BN,4BAaE,iBAkBE,GAAE;EACA,mBAAA;;AAhCN,4BAaE,iBAsBE,GAAG;EACD,6BAAA;;AApCN,4BAaE,iBA0BE,EAAC;EACC,SAAS,EAAT;EACA,cAAA;;AAzCN,4BA6CE;EACE,YAAA;EACA,gBAAA;;AA/CJ,4BAkDE,gBAAgB;EACd,kBAAA","file":"sweetalert-custom.css"}

View File

@@ -0,0 +1,185 @@
/* Sub Layer */
body[class*="_rio"] .swal2-container.swal2-shown {
background: rgba(16, 17, 21, 0.9);
z-index: 100000;
}
.wrio-modal {
padding: 0 !important;
.swal2-close {
color: rgba(0, 0, 0, .8);
}
.swal2-modal {
border-radius: 2px;
}
.swal2-icon {
margin-bottom: 25px;
}
.swal2-title {
margin: 0;
padding: 28px 32px;
font-size: 24px;
text-align: left;
color: #fff !important;
background: #3e3e3e !important;
}
.swal2-content {
font-size: 14px;
padding: 28px 32px;
background: #efefef;
}
.swal2-buttonswrapper {
margin-top: 0;
padding: 22px;
background: #F4F7F9;
a.button svg {
margin-right: 12px;
vertical-align: -2px;
}
button.loading {
border-radius: 100% !important;
height: 40px !important;
padding: 0 !important;
box-shadow: none !important;
}
button.swal2-styled {
height: auto;
padding: 12px 32px;
margin: 10px;
font-size: 14px;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 3px;
font-weight: bold;
outline: none;
&.swal2-confirm {
background-color: #fdd599 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #ceac7a !important;
color: #a57b3c !important;
}
&.swal2-cancel {
background-color: #d2d2d2 !important;
color: #656464 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #a9a9a9;
/*background-color: #c9deb2 !important;
color: #606956 !important;
text-shadow: none !important;
box-shadow: 0 3px 0 #a7b994;*/
}
&:focus, &:hover {
outline: none;
text-shadow: none;
color: #FFF;
}
}
}
}
.wrio-modal-warning {
background: #FF5722 !important;
.swal2-title {
text-align: center;
color: #222 !important;
background: #efefef !important;
}
.swal2-content {
font-size: 16px;
padding: 10px 20px 32px;
background: #efefef;
}
.swal2-buttonswrapper {
background: #efefef;
}
}
.wrio-modal-error {
background: #dec2c0 !important;
.swal2-title {
text-align: center;
color: #222 !important;
background: #efefef !important;
}
.swal2-content {
font-size: 16px;
padding: 10px 20px 32px;
background: #efefef;
}
.swal2-buttonswrapper {
background: #efefef;
}
}
.wrio-modal-optimization-way {
background: #1F2332 !important;
.wrio-swal-subtitle {
padding: 0 0 28px;
margin-top: 0px;
font-weight: 500;
font-size: 18px;
text-align: left;
color: #8c8888;
background: #efefef;
}
.wrio-list-infos {
margin: 0;
padding: 0;
li {
display: flex;
align-items: center;
padding: 15px 5px;
text-align: left;
font-size: 14px;
line-height: 1.5;
color: #8c8888;
}
li:first-child {
padding-top: 5px;
}
li:last-child {
padding-bottom: 5px;
}
li + li {
border-top: 1px solid #E9EFF2;
}
a:before {
content: '';
display: block;
}
}
.wrio-info-icon {
flex-grow: 0;
flex-basis: 50px;
}
.wrio-info-icon + span {
padding-left: 20px;
}
}

View File

@@ -0,0 +1,716 @@
body.swal2-shown {
overflow-y: hidden; }
body.swal2-iosfix {
position: fixed;
left: 0;
right: 0; }
.swal2-container {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 10px;
background-color: transparent;
z-index: 1060; }
.swal2-container.swal2-fade {
-webkit-transition: background-color .1s;
transition: background-color .1s; }
.swal2-container.swal2-shown {
background-color: rgba(0, 0, 0, 0.4); }
.swal2-modal {
background-color: #fff;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
border-radius: 5px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
text-align: center;
margin: auto;
overflow-x: hidden;
overflow-y: auto;
display: none;
position: relative;
max-width: 100%; }
.swal2-modal:focus {
outline: none; }
.swal2-modal.swal2-loading {
overflow-y: hidden; }
.swal2-modal .swal2-title {
color: #595959;
font-size: 30px;
text-align: center;
font-weight: 600;
text-transform: none;
position: relative;
margin: 0 0 .4em;
padding: 0;
display: block;
word-wrap: break-word; }
.swal2-modal .swal2-buttonswrapper {
margin-top: 15px; }
.swal2-modal .swal2-buttonswrapper:not(.swal2-loading) .swal2-styled[disabled] {
opacity: .4;
cursor: no-drop; }
.swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-confirm {
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 4px solid transparent;
border-color: transparent;
width: 40px;
height: 40px;
padding: 0;
margin: 7.5px;
vertical-align: top;
background-color: transparent !important;
color: transparent;
cursor: default;
border-radius: 100%;
-webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
animation: rotate-loading 1.5s linear 0s infinite normal;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-cancel {
margin-left: 30px;
margin-right: 30px; }
.swal2-modal .swal2-buttonswrapper.swal2-loading :not(.swal2-styled).swal2-confirm::after {
display: inline-block;
content: '';
margin-left: 5px 0 15px;
vertical-align: -1px;
height: 15px;
width: 15px;
border: 3px solid #999999;
-webkit-box-shadow: 1px 1px 1px #fff;
box-shadow: 1px 1px 1px #fff;
border-right-color: transparent;
border-radius: 50%;
-webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
animation: rotate-loading 1.5s linear 0s infinite normal; }
.swal2-modal .swal2-styled {
border: 0;
border-radius: 3px;
-webkit-box-shadow: none;
box-shadow: none;
color: #fff;
cursor: pointer;
font-size: 17px;
font-weight: 500;
margin: 15px 5px 0;
padding: 10px 32px; }
.swal2-modal .swal2-image {
margin: 20px auto;
max-width: 100%; }
.swal2-modal .swal2-close {
background: transparent;
border: 0;
margin: 0;
padding: 0;
width: 38px;
height: 40px;
font-size: 36px;
line-height: 40px;
font-family: serif;
position: absolute;
top: 5px;
right: 8px;
cursor: pointer;
color: #cccccc;
-webkit-transition: color .1s ease;
transition: color .1s ease; }
.swal2-modal .swal2-close:hover {
color: #d55; }
.swal2-modal > .swal2-input,
.swal2-modal > .swal2-file,
.swal2-modal > .swal2-textarea,
.swal2-modal > .swal2-select,
.swal2-modal > .swal2-radio,
.swal2-modal > .swal2-checkbox {
display: none; }
.swal2-modal .swal2-content {
font-size: 18px;
text-align: center;
font-weight: 300;
position: relative;
float: none;
margin: 0;
padding: 0;
line-height: normal;
color: #545454;
word-wrap: break-word; }
.swal2-modal .swal2-input,
.swal2-modal .swal2-file,
.swal2-modal .swal2-textarea,
.swal2-modal .swal2-select,
.swal2-modal .swal2-radio,
.swal2-modal .swal2-checkbox {
margin: 20px auto; }
.swal2-modal .swal2-input,
.swal2-modal .swal2-file,
.swal2-modal .swal2-textarea {
width: 100%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 18px;
border-radius: 3px;
border: 1px solid #d9d9d9;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
-webkit-transition: border-color box-shadow .3s;
transition: border-color box-shadow .3s; }
.swal2-modal .swal2-input.swal2-inputerror,
.swal2-modal .swal2-file.swal2-inputerror,
.swal2-modal .swal2-textarea.swal2-inputerror {
border-color: #f27474 !important;
-webkit-box-shadow: 0 0 2px #f27474 !important;
box-shadow: 0 0 2px #f27474 !important; }
.swal2-modal .swal2-input:focus,
.swal2-modal .swal2-file:focus,
.swal2-modal .swal2-textarea:focus {
outline: none;
border: 1px solid #b4dbed;
-webkit-box-shadow: 0 0 3px #c4e6f5;
box-shadow: 0 0 3px #c4e6f5; }
.swal2-modal .swal2-input:focus::-webkit-input-placeholder,
.swal2-modal .swal2-file:focus::-webkit-input-placeholder,
.swal2-modal .swal2-textarea:focus::-webkit-input-placeholder {
-webkit-transition: opacity .3s .03s ease;
transition: opacity .3s .03s ease;
opacity: .8; }
.swal2-modal .swal2-input:focus:-ms-input-placeholder,
.swal2-modal .swal2-file:focus:-ms-input-placeholder,
.swal2-modal .swal2-textarea:focus:-ms-input-placeholder {
-webkit-transition: opacity .3s .03s ease;
transition: opacity .3s .03s ease;
opacity: .8; }
.swal2-modal .swal2-input:focus::placeholder,
.swal2-modal .swal2-file:focus::placeholder,
.swal2-modal .swal2-textarea:focus::placeholder {
-webkit-transition: opacity .3s .03s ease;
transition: opacity .3s .03s ease;
opacity: .8; }
.swal2-modal .swal2-input::-webkit-input-placeholder,
.swal2-modal .swal2-file::-webkit-input-placeholder,
.swal2-modal .swal2-textarea::-webkit-input-placeholder {
color: #e6e6e6; }
.swal2-modal .swal2-input:-ms-input-placeholder,
.swal2-modal .swal2-file:-ms-input-placeholder,
.swal2-modal .swal2-textarea:-ms-input-placeholder {
color: #e6e6e6; }
.swal2-modal .swal2-input::placeholder,
.swal2-modal .swal2-file::placeholder,
.swal2-modal .swal2-textarea::placeholder {
color: #e6e6e6; }
.swal2-modal .swal2-range input {
float: left;
width: 80%; }
.swal2-modal .swal2-range output {
float: right;
width: 20%;
font-size: 20px;
font-weight: 600;
text-align: center; }
.swal2-modal .swal2-range input,
.swal2-modal .swal2-range output {
height: 43px;
line-height: 43px;
vertical-align: middle;
margin: 20px auto;
padding: 0; }
.swal2-modal .swal2-input {
height: 43px;
padding: 0 12px; }
.swal2-modal .swal2-input[type='number'] {
max-width: 150px; }
.swal2-modal .swal2-file {
font-size: 20px; }
.swal2-modal .swal2-textarea {
height: 108px;
padding: 12px; }
.swal2-modal .swal2-select {
color: #545454;
font-size: inherit;
padding: 5px 10px;
min-width: 40%;
max-width: 100%; }
.swal2-modal .swal2-radio {
border: 0; }
.swal2-modal .swal2-radio label:not(:first-child) {
margin-left: 20px; }
.swal2-modal .swal2-radio input,
.swal2-modal .swal2-radio span {
vertical-align: middle; }
.swal2-modal .swal2-radio input {
margin: 0 3px 0 0; }
.swal2-modal .swal2-checkbox {
color: #545454; }
.swal2-modal .swal2-checkbox input,
.swal2-modal .swal2-checkbox span {
vertical-align: middle; }
.swal2-modal .swal2-validationerror {
background-color: #f0f0f0;
margin: 0 -20px;
overflow: hidden;
padding: 10px;
color: gray;
font-size: 16px;
font-weight: 300;
display: none; }
.swal2-modal .swal2-validationerror::before {
content: '!';
display: inline-block;
width: 24px;
height: 24px;
border-radius: 50%;
background-color: #ea7d7d;
color: #fff;
line-height: 24px;
text-align: center;
margin-right: 10px; }
@supports (-ms-accelerator: true) {
.swal2-range input {
width: 100% !important; }
.swal2-range output {
display: none; } }
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.swal2-range input {
width: 100% !important; }
.swal2-range output {
display: none; } }
.swal2-icon {
width: 80px;
height: 80px;
border: 4px solid transparent;
border-radius: 50%;
margin: 20px auto 30px;
padding: 0;
position: relative;
-webkit-box-sizing: content-box;
box-sizing: content-box;
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.swal2-icon.swal2-error {
border-color: #f27474; }
.swal2-icon.swal2-error .swal2-x-mark {
position: relative;
display: block; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
position: absolute;
height: 5px;
width: 47px;
background-color: #f27474;
display: block;
top: 37px;
border-radius: 2px; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='left'] {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
left: 17px; }
.swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='right'] {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
right: 16px; }
.swal2-icon.swal2-warning {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #f8bb86;
border-color: #facea8;
font-size: 60px;
line-height: 80px;
text-align: center; }
.swal2-icon.swal2-info {
font-family: 'Open Sans', sans-serif;
color: #3fc3ee;
border-color: #9de0f6;
font-size: 60px;
line-height: 80px;
text-align: center; }
.swal2-icon.swal2-question {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #87adbd;
border-color: #c9dae1;
font-size: 60px;
line-height: 80px;
text-align: center; }
.swal2-icon.swal2-success {
border-color: #a5dc86; }
.swal2-icon.swal2-success [class^='swal2-success-circular-line'] {
border-radius: 50%;
position: absolute;
width: 60px;
height: 120px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg); }
.swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='left'] {
border-radius: 120px 0 0 120px;
top: -7px;
left: -33px;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 60px 60px;
transform-origin: 60px 60px; }
.swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='right'] {
border-radius: 0 120px 120px 0;
top: -11px;
left: 30px;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
-webkit-transform-origin: 0 60px;
transform-origin: 0 60px; }
.swal2-icon.swal2-success .swal2-success-ring {
width: 80px;
height: 80px;
border: 4px solid rgba(165, 220, 134, 0.2);
border-radius: 50%;
-webkit-box-sizing: content-box;
box-sizing: content-box;
position: absolute;
left: -4px;
top: -4px;
z-index: 2; }
.swal2-icon.swal2-success .swal2-success-fix {
width: 7px;
height: 90px;
position: absolute;
left: 28px;
top: 8px;
z-index: 1;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
.swal2-icon.swal2-success [class^='swal2-success-line'] {
height: 5px;
background-color: #a5dc86;
display: block;
border-radius: 2px;
position: absolute;
z-index: 2; }
.swal2-icon.swal2-success [class^='swal2-success-line'][class$='tip'] {
width: 25px;
left: 14px;
top: 46px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg); }
.swal2-icon.swal2-success [class^='swal2-success-line'][class$='long'] {
width: 47px;
right: 8px;
top: 38px;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
.swal2-progresssteps {
font-weight: 600;
margin: 0 0 20px;
padding: 0; }
.swal2-progresssteps li {
display: inline-block;
position: relative; }
.swal2-progresssteps .swal2-progresscircle {
background: #3085d6;
border-radius: 2em;
color: #fff;
height: 2em;
line-height: 2em;
text-align: center;
width: 2em;
z-index: 20; }
.swal2-progresssteps .swal2-progresscircle:first-child {
margin-left: 0; }
.swal2-progresssteps .swal2-progresscircle:last-child {
margin-right: 0; }
.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep {
background: #3085d6; }
.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progresscircle {
background: #add8e6; }
.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progressline {
background: #add8e6; }
.swal2-progresssteps .swal2-progressline {
background: #3085d6;
height: .4em;
margin: 0 -1px;
z-index: 10; }
[class^='swal2'] {
-webkit-tap-highlight-color: transparent; }
@-webkit-keyframes showSweetAlert {
0% {
-webkit-transform: scale(0.7);
transform: scale(0.7); }
45% {
-webkit-transform: scale(1.05);
transform: scale(1.05); }
80% {
-webkit-transform: scale(0.95);
transform: scale(0.95); }
100% {
-webkit-transform: scale(1);
transform: scale(1); } }
@keyframes showSweetAlert {
0% {
-webkit-transform: scale(0.7);
transform: scale(0.7); }
45% {
-webkit-transform: scale(1.05);
transform: scale(1.05); }
80% {
-webkit-transform: scale(0.95);
transform: scale(0.95); }
100% {
-webkit-transform: scale(1);
transform: scale(1); } }
@-webkit-keyframes hideSweetAlert {
0% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1; }
100% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
opacity: 0; } }
@keyframes hideSweetAlert {
0% {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1; }
100% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
opacity: 0; } }
.swal2-show {
-webkit-animation: showSweetAlert 0.3s;
animation: showSweetAlert 0.3s; }
.swal2-show.swal2-noanimation {
-webkit-animation: none;
animation: none; }
.swal2-hide {
-webkit-animation: hideSweetAlert 0.15s forwards;
animation: hideSweetAlert 0.15s forwards; }
.swal2-hide.swal2-noanimation {
-webkit-animation: none;
animation: none; }
@-webkit-keyframes animate-success-tip {
0% {
width: 0;
left: 1px;
top: 19px; }
54% {
width: 0;
left: 1px;
top: 19px; }
70% {
width: 50px;
left: -8px;
top: 37px; }
84% {
width: 17px;
left: 21px;
top: 48px; }
100% {
width: 25px;
left: 14px;
top: 45px; } }
@keyframes animate-success-tip {
0% {
width: 0;
left: 1px;
top: 19px; }
54% {
width: 0;
left: 1px;
top: 19px; }
70% {
width: 50px;
left: -8px;
top: 37px; }
84% {
width: 17px;
left: 21px;
top: 48px; }
100% {
width: 25px;
left: 14px;
top: 45px; } }
@-webkit-keyframes animate-success-long {
0% {
width: 0;
right: 46px;
top: 54px; }
65% {
width: 0;
right: 46px;
top: 54px; }
84% {
width: 55px;
right: 0;
top: 35px; }
100% {
width: 47px;
right: 8px;
top: 38px; } }
@keyframes animate-success-long {
0% {
width: 0;
right: 46px;
top: 54px; }
65% {
width: 0;
right: 46px;
top: 54px; }
84% {
width: 55px;
right: 0;
top: 35px; }
100% {
width: 47px;
right: 8px;
top: 38px; } }
@-webkit-keyframes rotatePlaceholder {
0% {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
5% {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
12% {
-webkit-transform: rotate(-405deg);
transform: rotate(-405deg); }
100% {
-webkit-transform: rotate(-405deg);
transform: rotate(-405deg); } }
@keyframes rotatePlaceholder {
0% {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
5% {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg); }
12% {
-webkit-transform: rotate(-405deg);
transform: rotate(-405deg); }
100% {
-webkit-transform: rotate(-405deg);
transform: rotate(-405deg); } }
.swal2-animate-success-line-tip {
-webkit-animation: animate-success-tip 0.75s;
animation: animate-success-tip 0.75s; }
.swal2-animate-success-line-long {
-webkit-animation: animate-success-long 0.75s;
animation: animate-success-long 0.75s; }
.swal2-success.swal2-animate-success-icon .swal2-success-circular-line-right {
-webkit-animation: rotatePlaceholder 4.25s ease-in;
animation: rotatePlaceholder 4.25s ease-in; }
@-webkit-keyframes animate-error-icon {
0% {
-webkit-transform: rotateX(100deg);
transform: rotateX(100deg);
opacity: 0; }
100% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
opacity: 1; } }
@keyframes animate-error-icon {
0% {
-webkit-transform: rotateX(100deg);
transform: rotateX(100deg);
opacity: 0; }
100% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
opacity: 1; } }
.swal2-animate-error-icon {
-webkit-animation: animate-error-icon 0.5s;
animation: animate-error-icon 0.5s; }
@-webkit-keyframes animate-x-mark {
0% {
-webkit-transform: scale(0.4);
transform: scale(0.4);
margin-top: 26px;
opacity: 0; }
50% {
-webkit-transform: scale(0.4);
transform: scale(0.4);
margin-top: 26px;
opacity: 0; }
80% {
-webkit-transform: scale(1.15);
transform: scale(1.15);
margin-top: -6px; }
100% {
-webkit-transform: scale(1);
transform: scale(1);
margin-top: 0;
opacity: 1; } }
@keyframes animate-x-mark {
0% {
-webkit-transform: scale(0.4);
transform: scale(0.4);
margin-top: 26px;
opacity: 0; }
50% {
-webkit-transform: scale(0.4);
transform: scale(0.4);
margin-top: 26px;
opacity: 0; }
80% {
-webkit-transform: scale(1.15);
transform: scale(1.15);
margin-top: -6px; }
100% {
-webkit-transform: scale(1);
transform: scale(1);
margin-top: 0;
opacity: 1; } }
.swal2-animate-x-mark {
-webkit-animation: animate-x-mark 0.5s;
animation: animate-x-mark 0.5s; }
@-webkit-keyframes rotate-loading {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
@keyframes rotate-loading {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }

View File

@@ -0,0 +1,126 @@
/**
* Subscribe Widget Styles
* Matches the onp-container / license-manager styling
*
* @package Robin_Image_Optimizer
*/
.wrio-subscribe-widget {
border: 0;
padding: 0;
border-radius: 5px;
background: rgb(255, 255, 255);
background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 63%, rgba(246, 246, 246, 1) 100%);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
margin-top: 30px;
}
.wrio-subscribe-widget__header {
padding: 20px;
padding-bottom: 0;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.wrio-subscribe-widget__header h3 {
margin: 0;
padding: 0;
font-size: 16px;
}
.wrio-subscribe-widget__body {
padding: 20px;
padding-top: 15px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
.wrio-subscribe-widget__messages {
margin-bottom: 15px;
}
.wrio-subscribe-widget__success {
background: #f0fdf4;
border: 1px solid #bbf7d0;
color: #16a34a;
padding: 12px 15px;
border-radius: 4px;
font-size: 14px;
line-height: 170%;
}
.wrio-subscribe-widget__error {
background: #fef2f2;
border: 1px solid #fecaca;
color: #dc2626;
padding: 12px 15px;
border-radius: 4px;
font-size: 14px;
line-height: 170%;
}
.wrio-subscribe-widget__form {
/* Form container */
}
.wrio-subscribe-widget__form p {
margin: 0 0 10px 0;
padding: 0;
line-height: 170%;
font-size: 14px;
}
.wrio-subscribe-widget__field-wrap {
display: flex;
flex-direction: row;
gap: 10px;
margin-bottom: 12px;
}
.wrio-subscribe-widget__email {
flex: 1;
font-size: 18px;
line-height: 20px;
height: 36px;
padding: 6px 12px;
border: 1px solid #7e8993;
border-radius: 4px;
color: #000;
}
.wrio-subscribe-widget__email:focus {
border-color: #007cba;
box-shadow: 0 0 0 1px #007cba;
outline: none;
}
.wrio-subscribe-widget__button {
white-space: nowrap;
padding: 7px 14px 6px 14px;
text-decoration: none;
}
.wrio-subscribe-widget .wrio-subscribe-widget__checkbox-label {
display: inline-block;
gap: 8px;
font-size: 13px;
color: #333;
line-height: 170%;
margin-top: 5px;
font-weight: normal;
}
.wrio-subscribe-widget__checkbox-label input[type="checkbox"] {
flex-shrink: 0;
margin-top: 0;
}
.wrio-subscribe-widget__checkbox-label a {
color: #0073aa;
text-decoration: none;
}
.wrio-subscribe-widget__checkbox-label a:hover {
text-decoration: underline;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

View File

@@ -0,0 +1,2 @@
<?php
// silence is golden

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,2 @@
<?php
// silence is golden

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,470 @@
jQuery(function ($) {
/**
* Factory function to create a bulk conversion handler for a specific format.
*
* @param {string} format - The conversion format ('webp' or 'avif')
* @param {string} buttonSelector - jQuery selector for the start button
* @returns {Object} - Bulk conversion handler object
*/
function createBulkConversion(format, buttonSelector) {
return {
format: format,
inprogress: false,
serverDown: false,
i18n: {},
settings: {},
startConvertButton: $(buttonSelector),
startOptButton: $('#wrio-start-optimization'),
startWebpButton: $('#wrio-start-conversion'),
startAvifButton: $('#wrio-start-avif-conversion'),
init: function () {
this.i18n = wrio_l18n_bulk_page;
this.settings = wrio_settings_bulk_page;
if (this.startConvertButton.length) {
this.registerEvents();
this.checkInitialRunningState();
}
},
checkInitialRunningState: function () {
// If this conversion button is already running on page load, disable other buttons
if (this.startConvertButton.hasClass('wio-running')) {
this.startOptButton.prop('disabled', true);
// Disable the other conversion button (not this one)
if (this.format === 'webp') {
this.startAvifButton.prop('disabled', true);
} else {
this.startWebpButton.prop('disabled', true);
}
}
},
registerEvents: function () {
var self = this;
this.startConvertButton.on('click', function () {
if ($(this).hasClass('wio-running')) {
self.startOptButton.prop('disabled', false);
self.startWebpButton.prop('disabled', false);
self.startAvifButton.prop('disabled', false);
self.stop();
return;
}
self.showModal();
return false;
});
},
showModal: function () {
var self = this;
var infosModal = $('#wrio-tmpl-' + this.format + '-conversion');
// Fall back to webp template if format-specific one doesn't exist
if (!infosModal.length) {
infosModal = $('#wrio-tmpl-webp-conversion');
}
if (!infosModal.length) {
console.log('[Error]: Html template for modal not found.');
return;
}
var modalTitle = this.format === 'avif'
? (this.i18n.modal_avif_conversion_title || this.i18n.modal_conversion_title)
: this.i18n.modal_conversion_title;
// Swal Information before loading the optimize process.
swal({
title: modalTitle,
html: infosModal.html(),
type: '',
customClass: 'wrio-modal wrio-modal-optimization-way',
showCancelButton: true,
showCloseButton: true,
padding: 0,
width: 740,
confirmButtonText: this.i18n.modal_conversion_manual_button,
cancelButtonText: this.i18n.modal_conversion_cron_button,
reverseButtons: true,
}).then(function (result) {
self.startOptButton.prop('disabled', true);
self.startWebpButton.prop('disabled', true);
self.startAvifButton.prop('disabled', true);
self.startConvertButton.prop('disabled', false); // Re-enable current button for stop
self.process();
window.onbeforeunload = function () {
return self.i18n.leave_page_warning;
}
}, function (dismiss) {
if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
self.startOptButton.prop('disabled', true);
self.startWebpButton.prop('disabled', true);
self.startAvifButton.prop('disabled', true);
self.startConvertButton.prop('disabled', false); // Re-enable current button for stop
self.process('cron');
} else {
throw dismiss;
}
});
},
/**
* Start conversion
* @param {string} type - 'cron' or undefined for manual
*/
process: function (type) {
var self = this;
this.inprogress = true;
var sendData = {
'action': 'wrio-bulk-conversion-process',
'scope': this.settings.scope,
'format': this.format,
'multisite': 0,
'_wpnonce': this.settings.conversion_nonce,
};
this.setButtonStyleRun(type);
if ('cron' === type) {
this.startConvertButton.addClass('wrio-cron-mode');
sendData['action'] = 'wrio-' + this.format + '-cron-start';
$.post(ajaxurl, sendData, function (response) {
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Start cron).');
console.log(sendData);
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
} else {
if (response.data && response.data.stop) {
self.stop();
}
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
return;
}
this.showMessage(this.i18n.conversion_inprogress.replace("%s", parseInt($('#wio-unoptimized-num').text())));
sendData['reset_current_errors'] = 1;
this.sendRequest(sendData);
},
stop: function () {
var self = this;
this.inprogress = false;
window.onbeforeunload = null;
self.setButtonStyleStop();
self.destroyMessages();
if (this.startConvertButton.hasClass('wrio-cron-mode')) {
this.startConvertButton.removeClass('wrio-cron-mode');
$.post(ajaxurl, {
'action': 'wrio-' + this.format + '-cron-stop',
'_wpnonce': self.settings.conversion_nonce,
'scope': self.settings.scope
}, function (response) {
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Stop cron).');
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
} else {
self.startOptButton.prop('disabled', false);
self.startWebpButton.prop('disabled', false);
self.startAvifButton.prop('disabled', false);
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
}
},
complete: function () {
this.inprogress = false;
window.onbeforeunload = null;
this.setButtonStyleComplete();
},
setButtonStyleRun: function (mode) {
this.startConvertButton.addClass('wio-running');
if ("cron" === mode) {
this.startConvertButton.text(this.i18n.modal_conversion_cron_button_stop);
return;
}
this.startConvertButton.text(this.i18n.button_stop);
},
setButtonStyleComplete: function () {
this.showMessage(this.i18n.conversion_complete);
this.startConvertButton.text(this.i18n.button_completed);
this.startConvertButton.removeClass('wio-running');
this.startConvertButton.prop('disabled', true);
this.startOptButton.prop('disabled', false);
this.startWebpButton.prop('disabled', false);
this.startAvifButton.prop('disabled', false);
},
setButtonStyleStop: function () {
this.startConvertButton.removeClass('wio-running');
var buttonText = this.format === 'avif'
? (this.i18n.avif_button_start || 'Convert to AVIF')
: this.i18n.webp_button_start;
this.startConvertButton.text(buttonText);
},
showMessage: function (text) {
var contanier = $('.wio-page-statistic'),
message;
if (contanier.find('.wrio-statistic-message').length) {
message = contanier.find('.wrio-statistic-message');
} else {
message = $('<div>');
message.addClass('wrio-statistic-message');
contanier.append(message);
}
message.html(text);
},
throwError: function (error_message) {
this.stop();
var noticeId = $.wbcr_factory_templates_759.app.showNotice(error_message, 'danger');
setTimeout(function () {
$.wbcr_factory_templates_759.app.hideNotice(noticeId);
}, 10000);
},
destroyMessages: function () {
$('.wio-page-statistic').find('.wrio-statistic-message').empty();
},
sendRequest: function (data) {
var self = this;
if (!this.inprogress) {
return;
}
$.post(ajaxurl, data, function (response) {
if (!self.inprogress) {
return;
}
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Try to optimize images).');
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
return;
}
data.reset_current_errors = 0;
if (!response.data.end) {
$('#wio-total-unoptimized').text(parseInt(response.data.remain));
self.showMessage(self.i18n.conversion_inprogress.replace("%s", parseInt(response.data.remain)));
self.sendRequest(data);
} else {
$('#wio-total-unoptimized').text(response.data.remain);
self.complete();
}
redraw_statistics(response.data.statistic);
if (response.data.last_optimized) {
self.updateLog(response.data.last_optimized);
}
if (response.data.last_converted) {
self.updateLog(response.data.last_converted);
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
},
updateLog: function (new_item_data) {
var self = this;
var limit = 100,
tableEl = $('.wrio-optimization-progress .wrio-table');
if (!tableEl.length || !new_item_data) {
return;
}
// Clear empty table state
if ($('.wrio-table-container-empty').length) {
$('.wrio-table-container-empty').addClass('wrio-table-container').removeClass('wrio-table-container-empty');
if (tableEl.find('tbody').length) {
tableEl.find('tbody').empty();
}
}
$.each(new_item_data, function (index, value) {
var trEl = $('<tr>'),
tdEl = $('<td>'),
webpSize = value.webp_size ? value.webp_size : '-',
avifSize = value.avif_size ? value.avif_size : '-';
if (tableEl.find('.wrio-row-id-' + value.id).length) {
tableEl.find('.wrio-row-id-' + value.id).remove();
}
trEl.addClass('flash').addClass('wrio-table-item').addClass('wrio-row-id-' + value.id);
if ('error' === value.type) {
trEl.addClass('wrio-error');
}
var preview = $('<img width="40" height="40" src="' + value.thumbnail_url + '" alt="">'),
previewUrl = $('<a href="' + value.url + '" target="_blank">' + value.file_name + '</a>');
tableEl.prepend(trEl);
trEl.append(tdEl.clone().append(preview));
trEl.append(tdEl.clone().append(previewUrl));
if ('error' === value.type) {
var colspan = value.scope !== 'custom-folders' ? '7' : '6';
trEl.append(tdEl.clone().attr('colspan', colspan).text("Error: " + value.error_msg));
} else {
trEl.append(tdEl.clone().text(value.original_size));
trEl.append(tdEl.clone().text(value.optimized_size));
trEl.append(tdEl.clone().text(webpSize));
trEl.append(tdEl.clone().text(avifSize));
trEl.append(tdEl.clone().text(value.original_saving));
if ("custom-folders" !== self.settings.scope) {
trEl.append(tdEl.clone().text(value.thumbnails_count));
}
trEl.append(tdEl.clone().text(value.total_saving));
}
});
if (tableEl.find('tr').length > limit) {
var diff = tableEl.find('tr').length - limit;
for (var i = 0; i < diff; i++) {
tableEl.find('tr:last').remove();
}
}
}
};
}
// Create WebP conversion handler
var bulkConversionWebp = createBulkConversion('webp', '#wrio-start-conversion');
// Create AVIF conversion handler
var bulkConversionAvif = createBulkConversion('avif', '#wrio-start-avif-conversion');
$(document).ready(function () {
bulkConversionWebp.init();
bulkConversionAvif.init();
$('[data-toggle="tooltip"]').tooltip();
});
var ajaxUrl = ajaxurl;
var ai_data;
function redraw_statistics(statistic) {
// Update WebP stats - chart data attributes
$('#wio-webp-chart').attr('data-unoptimized', statistic.unconverted)
.attr('data-optimized', statistic.converted)
.attr('data-errors', statistic.webp_error);
// Update WebP percent display
$('#wio-overview-chart-percent-webp').text(statistic.webp_percent_line);
// Update WebP legend
$('#wio-webp-pending').text(statistic.unconverted);
$('#wio-webp-converted').text(statistic.converted);
$('#wio-webp-error').text(statistic.webp_error);
$('#wio-webp-done').text(statistic.converted);
// Update AVIF stats (if available)
if (statistic.avif_unconverted !== undefined) {
$('#wio-avif-chart').attr('data-unoptimized', statistic.avif_unconverted)
.attr('data-optimized', statistic.avif_converted)
.attr('data-errors', statistic.avif_error);
// Update AVIF percent display
$('#wio-overview-chart-percent-avif').text(statistic.avif_percent_line);
// Update AVIF legend
$('#wio-avif-pending').text(statistic.avif_unconverted);
$('#wio-avif-converted').text(statistic.avif_converted);
$('#wio-avif-error').text(statistic.avif_error);
$('#wio-avif-done').text(statistic.avif_converted);
}
var credits = $('.wrio-premium-user-balance');
if (credits.attr('data-server') !== "server_5") {
credits.text(statistic.credits);
}
if (window.wio_chart_webp) {
window.wio_chart_webp.data.datasets[0].data[0] = statistic.webp_error; // errors
window.wio_chart_webp.data.datasets[0].data[1] = statistic.converted; // optimized
window.wio_chart_webp.data.datasets[0].data[2] = statistic.unconverted; // unoptimized
window.wio_chart_webp.update();
}
if (window.wio_chart_avif && statistic.avif_unconverted !== undefined) {
window.wio_chart_avif.data.datasets[0].data[0] = statistic.avif_error; // errors
window.wio_chart_avif.data.datasets[0].data[1] = statistic.avif_converted; // optimized
window.wio_chart_avif.data.datasets[0].data[2] = statistic.avif_unconverted; // unoptimized
window.wio_chart_avif.update();
}
if ($('#wio-overview-chart-percent-webp').text() == '100') {
window.onbeforeunload = null;
}
}
});

View File

@@ -0,0 +1,646 @@
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes === 0) {
return '0 Byte';
}
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if (i === 0) {
return bytes + ' ' + sizes[i];
}
return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
}
jQuery(function ($) {
var bulkOptimization = {
inprogress: false,
serverDown: false,
i18n: {},
settings: {},
init: function () {
if (wrio_l18n_bulk_page === undefined || wrio_settings_bulk_page === undefined) {
console.log('[Error]: Required global variables are not declared.');
return;
}
this.i18n = wrio_l18n_bulk_page;
this.settings = wrio_settings_bulk_page;
this.startOptButton = $('#wrio-start-optimization');
this.registerEvents();
this.checkServerStatus();
//this.calculateTotalImages();
this.checkPremiumUserBalance();
},
registerEvents: function () {
var self = this;
this.startOptButton.on('click', function () {
self.startOptButton = $(this);
if ($(this).hasClass('wio-running')) {
self.stop();
return;
}
if (self.serverDown) {
$.wrio_modal.showErrorModal(self.i18n.server_down_warning);
return;
}
if ("1" === self.settings.need_migration) {
$.wrio_modal.showErrorModal(self.i18n.need_migrations);
return;
}
if ("0" === self.settings.images_backup) {
$.wrio_modal.showWarningModal(self.i18n.process_without_backup, function () {
self.showModal();
});
return;
}
self.showModal();
return false;
});
},
checkPremiumUserBalance: function () {
var self = this,
userBalance = $('.wrio-premium-user-balance'),
balanceResetAt = $('.wrio-premium-user-update'),
data = {
'action': 'wbcr-rio-check-user-balance',
'_wpnonce': self.settings.optimization_nonce
};
userBalance.addClass('wrio-premium-user-balance-check-proccess');
userBalance.text('');
balanceResetAt.addClass('wrio-premium-user-update-check-proccess');
balanceResetAt.text('');
$.post(ajaxurl, data, function (response) {
userBalance.removeClass('wrio-premium-user-balance-check-proccess');
balanceResetAt.removeClass('wrio-premium-user-update-check-proccess');
if (!response || !response.data || !response.success) {
console.log('[Error]: Response error');
response.data && response.data.error && console.log(response.data.error);
if (!response || !response.data) {
console.log(response);
}
userBalance.text('error');
balanceResetAt.text('error');
} else {
userBalance.text(response.data?.balance);
balanceResetAt.text(response.data?.reset_at);
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
},
checkServerStatus: function () {
var self = this,
serverStatus = $('.wrio-server-status'),
data = {
'action': 'wbcr-rio-check-servers-status',
'_wpnonce': self.settings.optimization_nonce
};
self.serverDown = false;
serverStatus.addClass('wrio-server-check-proccess');
serverStatus.text('');
serverStatus.removeClass('wrio-down').removeClass('wrio-stable');
self.startOptButton.prop('disabled', true);
$.post(ajaxurl, data, function (response) {
serverStatus.removeClass('wrio-server-check-proccess');
if (!response || !response.data || !response.success) {
console.log('[Error]: Response error');
response.data && response.data.error && console.log(response.data.error);
if (!response || !response.data) {
console.log(response);
}
serverStatus.addClass('wrio-down');
serverStatus.text(self.i18n.server_status_down);
self.serverDown = true;
return;
} else {
serverStatus.addClass('wrio-stable');
serverStatus.text(self.i18n.server_status_stable);
}
self.startOptButton.prop('disabled', false);
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
},
calculateTotalImages: function () {
var self = this,
total_num = $('#wio-total-num'),
data = {
'action': 'wbcr-rio-calculate-total-images',
'_wpnonce': self.settings.optimization_nonce
};
total_num.addClass('wrio-calculate-process');
total_num.text('');
$.post(ajaxurl, data, function (response) {
total_num.removeClass('wrio-calculate-process');
if (!response || !response.data || !response.success) {
console.log('[Error]: Response error');
response.data && response.data.error && console.log(response.data.error);
if (!response || !response.data) {
console.log(response);
}
total_num.text('');
return;
} else {
if (typeof (response.data.total) !== "undefined") {
total_num.addClass('wrio-total-images');
total_num.text(response.data.total);
}
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
},
showModal: function () {
var self = this;
var infosModal = $('#wrio-tmpl-bulk-optimization');
if (!infosModal.length) {
console.log('[Error]: Html template for modal not found.');
return;
}
// Swal Information before loading the optimize process.
swal({
title: this.i18n.modal_optimization_title,
html: infosModal.html(),
type: '',
customClass: 'wrio-modal wrio-modal-optimization-way',
showCancelButton: true,
showCloseButton: true,
padding: 0,
width: 740,
confirmButtonText: this.i18n.modal_optimization_manual_button,
cancelButtonText: this.i18n.modal_optimization_cron_button,
reverseButtons: true,
}).then(function (result) {
self.process();
window.onbeforeunload = function () {
return self.i18n.leave_page_warning;
}
}, function (dismiss) {
if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
self.process('cron');
} else {
throw dismiss;
}
});
},
/**
* Start optimization
* @param {string} type
*/
process: function (type) {
var self = this;
this.inprogress = true;
var sendData = {
'action': 'wrio-bulk-optimization-process',
'scope': this.settings.scope,
'multisite': 0,
'_wpnonce': this.settings.optimization_nonce,
};
this.setButtonStyleRun(type);
if ('cron' === type) {
this.startOptButton.addClass('wrio-cron-mode');
sendData['action'] = 'wrio-cron-start';
$.post(ajaxurl, sendData, function (response) {
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Start cron).');
console.log(sendData);
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
} else {
if (response.data && response.data.stop) {
self.stop();
}
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
return;
}
this.showMessage(this.i18n.optimization_inprogress.replace("%s", parseInt($('#wio-unoptimized-num').text())));
// show message: Optimization remined
/*if( "1" === this.settings.is_network_admin ) {
sendData['multisite'] = 1;
}*/
sendData['reset_current_errors'] = 1;
this.sendRequest(sendData);
},
stop: function () {
var self = this;
this.inprogress = false;
window.onbeforeunload = null;
self.setButtonStyleStop();
self.destroyMessages();
if (this.startOptButton.hasClass('wrio-cron-mode')) {
this.startOptButton.removeClass('wrio-cron-mode');
$.post(ajaxurl, {
'action': 'wrio-cron-stop',
'_wpnonce': self.settings.optimization_nonce,
'scope': self.settings.scope
}, function (response) {
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Stop cron).');
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
}
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
}
},
complete: function () {
this.inprogress = false;
window.onbeforeunload = null;
this.setButtonStyleComplete();
},
setButtonStyleRun: function (mode) {
this.startOptButton.addClass('wio-running');
if ("cron" === mode) {
this.startOptButton.text(this.i18n.modal_optimization_cron_button_stop);
return;
}
this.startOptButton.text(this.i18n.button_stop);
},
setButtonStyleComplete: function () {
this.showMessage(this.i18n.optimization_complete);
this.startOptButton.text(this.i18n.button_completed);
this.startOptButton.removeClass('wio-running');
this.startOptButton.prop('disabled', true);
},
setButtonStyleStop: function () {
this.startOptButton.removeClass('wio-running');
this.startOptButton.text(this.i18n.button_start);
},
showMessage: function (text) {
var contanier = $('.wio-page-statistic'),
message;
if (contanier.find('.wrio-statistic-message').length) {
message = contanier.find('.wrio-statistic-message');
} else {
message = $('<div>');
message.addClass('wrio-statistic-message');
contanier.append(message);
}
message.html(text);
},
throwError: function (error_message) {
this.stop();
var noticeId = $.wbcr_factory_templates_759.app.showNotice(error_message, 'danger');
setTimeout(function () {
$.wbcr_factory_templates_759.app.hideNotice(noticeId);
}, 10000);
},
destroyMessages: function () {
$('.wio-page-statistic').find('.wrio-statistic-message').empty();
},
sendRequest: function (data) {
var self = this;
if (!this.inprogress) {
return;
}
$.post(ajaxurl, data, function (response) {
if (!self.inprogress) {
return;
}
console.log(response);
if (!response || !response.success) {
console.log('[Error]: Failed ajax request (Try to optimize images).');
console.log(response);
if (response.data && response.data.error_message) {
self.throwError(response.data.error_message);
}
return;
}
data.reset_current_errors = 0;
if (!response.data.end) {
$('#wio-total-unoptimized').text(parseInt(response.data.remain));
self.showMessage(self.i18n.optimization_inprogress.replace("%s", parseInt(response.data.remain)));
self.sendRequest(data);
} else {
$('#wio-total-unoptimized').text(response.data.remain);
self.complete();
// если мультисайт режим, то не скрываем кнопку запуска оптимизации
/*if( $('#wbcr-rio-current-blog').length ) {
$('#wio-start-optimization').toggleClass('wio-running');
} else {
$('#wio-start-optimization').hide();
}*/
}
redraw_statistics(response.data.statistic);
self.updateLog(response.data.last_optimized);
}).fail(function (xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
self.throwError(error);
});
},
updateLog: function (new_item_data) {
const self = this;
const limit = 100;
const tableEl = $('.wrio-optimization-progress .wrio-table');
if (!tableEl.length || !new_item_data) {
return;
}
// Handle empty table state
if ($('.wrio-table-container-empty').length) {
$('.wrio-table-container-empty').addClass('wrio-table-container').removeClass('wrio-table-container-empty');
if (tableEl.find('tbody').length) {
tableEl.find('tbody').empty();
}
}
$.each(new_item_data, function (index, value) {
const attachmentId = value.attachment_id || value.id;
const existingRow = tableEl.find('[data-attachment-id="' + attachmentId + '"]');
if (existingRow.length) {
// Update existing row data
self.updateRowData(existingRow, value);
// Move existing row to top of the table
existingRow.detach();
tableEl.find('tbody').prepend(existingRow);
// Re-trigger flash animation
existingRow.removeClass('flash');
// Force reflow to restart animation
existingRow[0].offsetWidth;
existingRow.addClass('flash');
} else {
// Create new row and add to top
const trEl = self.buildLogRow(value);
tableEl.find('tbody').prepend(trEl);
}
});
// Enforce row limit
self.enforceRowLimit(tableEl, limit);
},
updateRowData: function (row, data) {
// Update optimized size cell
row.find('.wrio-optimized-size').text(data.optimized_size);
// Update WebP size if present
if (data.webp_size) {
const webpCell = row.find('.wrio-webp-size');
if (webpCell.length) {
webpCell.text(data.webp_size);
}
}
// Update AVIF size if present
if (data.avif_size) {
const avifCell = row.find('.wrio-avif-size');
if (avifCell.length) {
avifCell.text(data.avif_size);
}
}
// Update total saving
row.find('.wrio-total-saving').text(data.total_saving);
// Update thumbnails count
if (data.thumbnails_count !== undefined) {
row.find('.wrio-thumbnails-count').text(data.thumbnails_count);
}
// Update error state if needed
if (data.type === 'error') {
row.addClass('wrio-error');
} else {
row.removeClass('wrio-error');
}
},
buildLogRow: function (value) {
const attachmentId = value.attachment_id || value.id;
const trEl = $('<tr>')
.addClass('flash wrio-table-item')
.addClass('wrio-row-id-' + value.id)
.attr('data-attachment-id', attachmentId);
if (value.type === 'error') {
trEl.addClass('wrio-error');
}
// Build cells with classes for easy updates
const preview = $('<img width="40" height="40" src="' + value.thumbnail_url + '" alt="">');
const previewUrl = $('<a href="' + value.url + '" target="_blank">' + value.file_name + '</a>');
trEl.append($('<td>').append(preview));
trEl.append($('<td>').append(previewUrl));
if (value.type === 'error') {
const colspan = this.settings.scope !== 'custom-folders' ? '4' : '3';
trEl.append($('<td>').attr('colspan', colspan).text("Error: " + value.error_msg));
} else {
trEl.append($('<td class="wrio-original-size">').text(value.original_size));
trEl.append($('<td class="wrio-optimized-size">').text(value.optimized_size));
if ("custom-folders" !== this.settings.scope) {
trEl.append($('<td class="wrio-thumbnails-count">').text(value.thumbnails_count));
}
trEl.append($('<td class="wrio-total-saving">').text(value.total_saving));
}
return trEl;
},
enforceRowLimit: function (tableEl, limit) {
const rows = tableEl.find('tbody tr');
if (rows.length > limit) {
rows.slice(limit).remove();
}
}
};
$(document).ready(function () {
bulkOptimization.init();
$('[data-toggle="tooltip"]').tooltip();
});
var ajaxUrl = ajaxurl;
var ai_data;
function redraw_statistics(statistic) {
$('#wio-main-chart').attr('data-unoptimized', statistic.unoptimized)
.attr('data-optimized', statistic.optimized)
.attr('data-errors', statistic.error);
$('#wio-total-optimized-attachments').text(statistic.optimized); // optimized
$('#wio-original-size').text(bytesToSize(statistic.original_size));
$('#wio-optimized-size').text(bytesToSize(statistic.optimized_size));
$('#wio-total-saved').text(statistic.save_size_percent + '%');
$('#wio-overview-chart-percent').text(statistic.optimized_percent);
$('.wio-total-percent').text(statistic.optimized_percent + '%');
$('#wio-optimized-bar').css('width', statistic.percent_line + '%');
$('#wio-unoptimized-num').text(statistic.unoptimized);
$('#wio-optimized-num').text(statistic.optimized);
$('#wio-error-num').text(statistic.error);
if(statistic.quota_limit) {
$('.wrio-premium-user-balance').text(statistic.quota_limit);
}
if ($('.wrio-statistic-nav li.active').length) {
$('.wrio-statistic-nav li.active').find('span.wio-statistic-tab-percent').text(statistic.optimized_percent + '%');
}
window.wio_chart.data.datasets[0].data[0] = statistic.error; // errors
window.wio_chart.data.datasets[0].data[1] = statistic.optimized; // optimized
window.wio_chart.data.datasets[0].data[2] = statistic.unoptimized; // unoptimized
window.wio_chart.update();
if ($('#wio-overview-chart-percent').text() == '100%') {
window.onbeforeunload = null;
}
}
/*$('#wbcr-rio-current-blog').on('change', function() {
var self = $(this);
$('#wio-start-msg-complete').hide();
$(this).attr('disabled', true);
$('#wio-start-optimization').attr('disabled', true);
var ai_data = {
'action': 'wbcr_rio_update_current_blog',
'wpnonce': $(this).data('nonce'),
'current_blog_id': $(this).find('option:selected').val(),
'context': $(this).attr('data-context')
};
$.post(ajaxUrl, ai_data, function(response) {
self.removeAttr('disabled');
$('#wio-start-optimization').removeAttr('disabled');
redraw_statistics(response.data.statistic);
});
});*/
// AVIF upsell banner dismiss handler
$(document).on('click', '.wrio-avif-banner-dismiss', function () {
var $banner = $(this).closest('.wrio-avif-upsell-banner');
$.post(ajaxurl, {
action: 'wrio_dismiss_avif_banner',
nonce: $banner.data('nonce')
}, function () {
$banner.slideUp(300, function () {
$(this).remove();
});
});
});
});

View File

@@ -0,0 +1,169 @@
(function ($) {
class BulkOptimization {
constructor(ajaxUrl, i18n, settings) {
if (!i18n || !settings) {
console.error('[Error]: Required global variables are missing.');
return;
}
this.ajaxUrl = ajaxUrl;
this.i18n = i18n;
this.settings = settings;
this.totalImages = 0;
this.countAttachments = 0;
this.countThumbs = 0;
}
/**
* Initializes the bulk optimization process by chaining multiple calculations.
* If any error occurs during the process, it will be caught and handled.
*/
init() {
this.calculateTotalAttachments()
.then(() => this.calculateTotalThumbs())
.then(() => this.calculateTotalImages())
.catch((error) => this.throwError(error));
}
/**
* Sends an AJAX POST request to the server.
*
* @param {string} action - The AJAX action to trigger on the server.
* @param {Object} additionalData - Additional data to send with the request.
* @returns {Promise<Object>} - A promise that resolves with the response data from the server.
* @throws Will throw an error if the response is invalid or the request fails.
*/
async postAjax(action, additionalData = {}) {
const data = {
action: action,
_wpnonce: this.settings.optimization_nonce,
...additionalData,
};
try {
const response = await $.post(this.ajaxUrl, data);
if (!response || !response.success || !response.data) {
console.error('[Error]: Invalid AJAX response.', response);
if (response?.data?.error) {
console.error(response.data.error);
}
throw new Error(this.i18n.ajaxError || 'AJAX Error Occurred');
}
return response.data;
} catch (xhr) {
console.error('[Error]: AJAX Request Failed.', xhr);
throw xhr;
}
}
/**
* Calculates the total number of attachments.
*
* This method sends an AJAX request to the server to fetch the total
* number of media attachments and updates the corresponding UI element with the result.
*
* @returns {Promise<void>} - A promise that resolves when the calculation is complete.
*/
async calculateTotalAttachments() {
try {
const data = await this.postAjax('wbcr-rio-calculate-total-attachments');
this.countAttachments = data.found_attachments;
$('#wio-stat-totals__originals')
.removeClass('wio-stat-totals__loading')
.text(data.found_attachments);
} catch (error) {
this.throwError(error);
}
}
/**
* Updates the total count of images by summing attachments and thumbnails.
*
* This method does not send an AJAX request. Instead, it calculates the total
* number of found images and updates the corresponding UI element.
*/
async calculateTotalImages() {
this.totalImages = this.countAttachments + this.countThumbs;
$('#wio-stat-totals__totals')
.removeClass('wio-stat-totals__loading')
.text(this.totalImages);
}
/**
* Calculates the total number of thumbnails in a paginated manner.
*
* This method sends multiple AJAX requests based on the `offset` returned
* from the server. It stops once the `done` parameter is `true` and accumulates
* the total number of thumbnails found during the process.
*
* @returns {Promise<void>} - A promise that resolves when all requests are complete.
* @throws Will throw an error if `next_offset` is missing or undefined in the response.
*/
async calculateTotalThumbs() {
try {
let offset = 0;
let totalThumbs = 0;
// Sequentially fetch thumbnail counts in batches
while (true) {
const data = await this.postAjax('wbcr-rio-calculate-total-thumbs', { offset });
// Update the total thumbnail counter
totalThumbs = data.found_thumbs;
// Update the thumbnails count in the UI
$('#wio-stat-totals__thumbnails')
.removeClass('wio-stat-totals__loading')
.text(totalThumbs);
// Break the loop if the server indicates the process is complete
if (data.done) {
break;
}
// Update the offset for the next request
offset = data.next_offset;
// Validate the offset to avoid infinite loops
if (offset === undefined || offset === null) {
console.error('[Error]: Missing offset in server response.');
throw new Error('Invalid server response: offset is undefined.');
}
}
this.countThumbs = totalThumbs;
} catch (error) {
this.throwError(error);
}
}
/**
* Handles errors by logging them to the console and displaying an alert.
*
* This method provides a standardized way to handle any unexpected errors
* that occur during the execution of the bulk optimization process.
*
* @param {Error|string} error - The error message or object to handle.
*/
throwError(error) {
console.error('[Error]:', error);
alert(this.i18n.generalError || 'An error occurred. Please try again.');
}
}
// Initialize the bulk optimization process on document ready
$(document).ready(() => {
const bulkOptimization = new BulkOptimization(
ajaxurl, // The URL for WordPress AJAX requests
window.wrio_l18n_bulk_page, // Localization data for the UI
window.wrio_settings_bulk_page // Settings data for the optimization
);
bulkOptimization.init();
});
})(jQuery);

View File

@@ -0,0 +1,2 @@
<?php
// silence is golden

View File

@@ -0,0 +1,52 @@
jQuery(function($) {
$('#wbcr-wio-meta-migration-action').on('click', function() {
var data = {
'action': 'wrio_meta_migrations',
'_wpnonce': $(this).data('nonce'),
};
$(this).addClass('disabled').text('Please wait...');
send_request($(this), data);
});
function send_request(button, data) {
$.post(window.ajaxurl, data, function(response) {
console.log(response);
if( !response || !response.data ) {
console.log('An unknown server error has occurred.');
console.log(response);
return false;
}
if( !response.data.need_more_time ) {
if( button.closest('.notice').length ) {
button.closest('.notice').remove();
}
if( button.closest('.alert').length ) {
button.closest('.alert').remove();
}
return false;
}
button.text(response.data.message);
send_request(button, data);
}).fail(function(xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
data.limit = 5;
data.error = 1;
setTimeout(function() {
send_request(button, data);
}, 2000);
});
}
});

View File

@@ -0,0 +1,57 @@
/**
* A set of tools for creating pop-ups. You can create a popup
* using a global method call.
*
* @version 1.0
*/
(function($) {
'use strict';
if( !$.wrio_modal ) {
$.wrio_modal = {};
}
$.wrio_modal = $.wrio_popup || {
showErrorModal: function(text) {
if( !text ) {
console.log('[Error]: Text required.');
return;
}
swal({
title: 'Error',
text: text,
type: 'error',
customClass: 'wrio-modal wrio-modal-error',
width: 500,
confirmButtonText: 'OK',
});
},
showWarningModal: function(text, callback) {
if( !text ) {
console.log('[Error]: Text required.');
return;
}
swal({
title: 'Warning',
text: text,
type: 'warning',
customClass: 'wrio-modal wrio-modal-warning',
width: 500,
showCancelButton: true,
showCloseButton: true,
confirmButtonText: 'OK',
}).then(function(result) {
if( callback ) {
callback();
}
}).catch(swal.noop);
},
};
})(jQuery);

View File

@@ -0,0 +1,209 @@
jQuery(function($){
var ajaxUrl = ajaxurl;
// Delivery Mode Toggle Handler
// Handles the visibility of the delivery mode options based on WebP and AVIF conversion toggles
var $webpToggle = $('input[name="wbcr_io_convert_webp_format"]');
var $avifToggle = $('input[name="wbcr_io_convert_avif_format"]');
var $deliveryModeSection = $('.wrio-conversion-delivery-options');
// Function to check if at least one toggle is enabled
function updateDeliveryModeVisibility() {
var isWebpEnabled = $webpToggle.val() === '1';
var isAvifEnabled = $avifToggle.val() === '1';
// Show delivery mode section only if at least one format is enabled
if (isWebpEnabled || isAvifEnabled) {
$deliveryModeSection.slideDown(300);
} else {
$deliveryModeSection.slideUp(300);
}
}
// Attach event listeners to both toggles
if ($webpToggle.length && $avifToggle.length && $deliveryModeSection.length) {
// Get the button containers for both toggles
var $webpButtons = $webpToggle.closest('.factory-checkbox').find('button');
var $avifButtons = $avifToggle.closest('.factory-checkbox').find('button');
// Initial check on page load
updateDeliveryModeVisibility();
// Listen for clicks on the factory buttons
$webpButtons.on('click', function() {
setTimeout(updateDeliveryModeVisibility, 50);
});
$avifButtons.on('click', function() {
setTimeout(updateDeliveryModeVisibility, 50);
});
// Also listen for direct changes on the hidden inputs (fallback)
$webpToggle.on('change', function() {
updateDeliveryModeVisibility();
});
$avifToggle.on('change', function() {
updateDeliveryModeVisibility();
});
}
$('#wio-restore-backup-btn').on('click', function() {
if ( $('#wio-multisite-mode').length ) {
$('#wio-multisite-mode').toggle();
$('#wio-multisite-confirm').attr('data-action', 'restore');
$('#wio-multisite-restore-progress').empty();
return false;
}
result = confirm( $(this).attr('data-confirm') );
if ( ! result ) {
return false;
}
$(this).hide();
$('#wio-restore-backup-progress').show();
var ai_data = {
'total' : '?',
'action': 'wio_restore_backup',
'_wpnonce': $('#wio-iph-nonce').val()
};
send_post_data(ai_data);
return false;
});
$('#wio-clear-backup-btn').on('click', function() {
$('#wio-restore-backup-msg').hide();
if ( $('#wio-multisite-mode').length ) {
$('#wio-multisite-mode').toggle();
$('#wio-multisite-confirm').attr('data-action', 'clear');
$('#wio-multisite-restore-progress').empty();
return false;
}
result = confirm( $(this).attr('data-confirm') );
if ( ! result ) {
return false;
}
var data = {
'action': 'wio_clear_backup',
'_wpnonce': $('#wio-iph-nonce').val()
};
$.post(ajaxUrl, data, function(response) {
$('#wio-clear-backup-msg').show();
});
});
$('#wio-multisite-confirm').on('click', function() {
var action = $(this).attr('data-action');
// если запущена очистка резервных копий
if ( action == 'clear' ) {
result = confirm( $('#wio-clear-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
if ( ! result ) {
return false;
}
var blogs = [];
$('.wbcr_io_multisite_blogs:checked').each(function() {
blogs.push( $(this).val() );
});
var data = {
'action': 'wio_clear_backup',
'_wpnonce': $('#wio-iph-nonce').val(),
'blogs': blogs
};
$.post(ajaxUrl, data, function(response) {
$('#wio-clear-backup-msg').show();
$('#wio-multisite-mode').toggle();
});
return false;
}
// если запущено восстановление из резервных копий
if ( action == 'restore' ) {
result = confirm( $('#wio-restore-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
if ( ! result ) {
return false;
}
$('#wio-multisite-mode').toggle();
$('#wio-multisite-restore-progress').empty();
$('.wbcr_io_multisite_blogs:checked').each(function() {
$('#wio-multisite-restore-progress').append('\
<label>'+$(this).attr('data-name')+'</label>\
<div class="progress">\
<div id="wio-restore-backup-progress-'+$(this).val()+'" class="wio-restore-backup-progressbar progress-bar progress-bar-success" data-id="'+$(this).val()+'" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">\
</div>\
</div>\
');
});
$('#wio-multisite-restore-progress').show();
if ( ! $('.wio-restore-backup-progressbar').length ) {
$('#wio-restore-backup-msg').show();
return false;
}
var ai_data = {
'total' : '?',
'action': 'wio_restore_backup',
'_wpnonce': $('#wio-iph-nonce').val(),
'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
};
send_multisite_post_data(ai_data);
return false;
}
});
$('#wbcr_io_multisite_blog_all').on('change', function() {
if ( $(this).attr('checked') == 'checked' ) {
$('.wbcr_io_multisite_blogs').attr('checked', true);
} else {
$('.wbcr_io_multisite_blogs').removeAttr('checked');
}
});
$('.wbcr_io_multisite_blogs').on('change', function() {
var all_checked = true;
$('.wbcr_io_multisite_blogs').each(function() {
if ( $(this).attr('checked') != 'checked' ) {
all_checked = false;
}
});
if ( all_checked ) {
$('#wbcr_io_multisite_blog_all').attr('checked', true);
} else {
$('#wbcr_io_multisite_blog_all').removeAttr('checked');
}
});
function send_post_data(data){
$.post(ajaxUrl, data, function(response) {
if ( ! response.end ) {
data.total = response.total;
send_post_data(data);
$('#wio-restore-backup-progress').find('.progress-bar').css( 'width', response.percent + '%' );
} else {
$('#wio-restore-backup-progress').find('.progress-bar').css( 'width', '100%' );
$('#wio-restore-backup-msg').show();
}
});
}
function send_multisite_post_data(data){
$.post(ajaxUrl, data, function(response) {
if ( ! response.end ) {
data.total = response.total;
send_multisite_post_data(data);
$('#wio-restore-backup-progress-' + data.blog_id).css( 'width', response.percent + '%' );
} else {
$('#wio-restore-backup-progress-' + data.blog_id).css( 'width', '100%' ).removeClass('wio-restore-backup-progressbar');
if ( $('.wio-restore-backup-progressbar').length ) {
var ai_data = {
'total' : '?',
'action': 'wio_restore_backup',
'_wpnonce': $('#wio-iph-nonce').val(),
'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
};
send_multisite_post_data(ai_data);
} else {
$('#wio-restore-backup-msg').show();
}
}
});
}
});

View File

@@ -0,0 +1,5 @@
jQuery(document).ready(function($) {
// Disable premium dropdown buttons for non-licensed users
$('button[data-value="googlepage"]').attr('disabled', 'disabled');
$('button[data-value="background"]').attr('disabled', 'disabled');
});

View File

@@ -0,0 +1,102 @@
jQuery(function($) {
var ajaxUrl = ajaxurl;
$(document).on('click', '.wio-reoptimize', function() {
var ai_data = {
'action' : $(this).attr('data-action'),
'id' : $(this).attr('data-id'),
'level' : $(this).attr('data-level'),
'_wpnonce' : $(this).attr('data-nonce')
};
var td = $(this).closest('td');
var msg = $(this).attr( 'data-waiting-label' );
td.html('<p>'+msg+'</p>');
wio_reoptimize( ai_data, td );
return false;
});
$(document).on('click', '.wio-convert', function() {
var ai_data = {
'action' : $(this).attr('data-action'),
'id' : $(this).attr('data-id'),
'format' : $(this).attr('data-format'),
'_wpnonce' : $(this).attr('data-nonce')
};
var td = $(this).closest('td');
var msg = $(this).attr( 'data-waiting-label' );
td.html('<p>'+msg+'</p>');
wio_convert( ai_data, td );
return false;
});
function wio_reoptimize( ai_data, td ) {
$.post(ajaxUrl, ai_data, function(response) {
if ( response === 'processing' ) {
wio_reoptimize( ai_data, td );
return false;
}
td.html(response);
var btn = $('.wio-reoptimize').first();
if ( btn.closest('.media-frame-content').length ) {
if ( btn.closest('table').find('.wio-datas-list').length ) {
var diminsionName = $('.dimensions').find('strong').clone();
var fileSizeName = $('.file-size').find('strong').clone();
var diminsionSize = btn.closest('table').find('.wio-datas-list').data('dimensions');
var fileSize = btn.closest('table').find('.wio-datas-list').data('size');
$('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
$('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
}
}
});
}
function wio_convert( ai_data, td ) {
$.post(ajaxUrl, ai_data, function(response) {
if ( response === 'processing' ) {
wio_convert( ai_data, td );
return false;
}
td.html(response);
var btn = $('.wio-convert').first();
if ( btn.closest('.media-frame-content').length ) {
if ( btn.closest('table').find('.wio-datas-list').length ) {
var diminsionName = $('.dimensions').find('strong').clone();
var fileSizeName = $('.file-size').find('strong').clone();
var diminsionSize = btn.closest('table').find('.wio-datas-list').data('dimensions');
var fileSize = btn.closest('table').find('.wio-datas-list').data('size');
$('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
$('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
}
}
});
}
$(document).on('click', '.button-wio-restore', function() {
var ai_data = {
'action' : $(this).attr('data-action'),
'id' : $(this).attr('data-id'),
'_wpnonce' : $(this).attr('data-nonce')
};
var td = $(this).closest('td');
var msg = $(this).attr( 'data-waiting-label' );
td.html('<p>'+msg+'</p>');
$.post(ajaxUrl, ai_data, function(response) {
td.html(response);
var btn = $('.wio-reoptimize');
if ( btn.closest('.media-frame-content').length ) {
if ( btn.length ) {
btn = btn.first();
var diminsionName = $('.dimensions').find('strong').clone();
var fileSizeName = $('.file-size').find('strong').clone();
var diminsionSize = btn.data('dimensions');
var fileSize = btn.data('size');
$('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
$('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
}
}
});
return false;
});
});

View File

@@ -0,0 +1,113 @@
jQuery(function ($) {
var chart_html_id = 'wio-main-chart';
var webp_chart_html_id = 'wio-webp-chart';
var avif_chart_html_id = 'wio-avif-chart';
var ctx = document.getElementById(chart_html_id);
var ctx_webp = document.getElementById(webp_chart_html_id);
var ctx_avif = document.getElementById(avif_chart_html_id);
window.wio_chart = new window.robin.Chart(ctx, {
type: 'doughnut',
data: {
datasets: [
{
data: [
$('#' + chart_html_id).attr('data-errors'),
$('#' + chart_html_id).attr('data-optimized'),
$('#' + chart_html_id).attr('data-unoptimized'),
],
backgroundColor: [
'#f1b1b6',
'#8bc34a',
'#d6d6d6',
],
borderWidth: 0,
label: 'Dataset 1'
}
]
},
options: {
legend: {
display: false
},
events: [],
animation: {
easing: 'easeOutBounce'
},
responsive: false,
cutoutPercentage: 80
}
});
if (ctx_webp) {
window.wio_chart_webp = new window.robin.Chart(ctx_webp, {
type: 'doughnut',
data: {
datasets: [
{
data: [
$('#' + webp_chart_html_id).attr('data-errors'),
$('#' + webp_chart_html_id).attr('data-optimized'),
$('#' + webp_chart_html_id).attr('data-unoptimized'),
],
backgroundColor: [
'#f1b1b6',
'#8bc34a',
'#d6d6d6',
],
borderWidth: 0,
label: 'Dataset 1'
}
]
},
options: {
legend: {
display: false
},
events: [],
animation: {
easing: 'easeOutBounce'
},
responsive: false,
cutoutPercentage: 80
}
});
}
if (ctx_avif) {
window.wio_chart_avif = new window.robin.Chart(ctx_avif, {
type: 'doughnut',
data: {
datasets: [
{
data: [
$('#' + avif_chart_html_id).attr('data-errors'),
$('#' + avif_chart_html_id).attr('data-optimized'),
$('#' + avif_chart_html_id).attr('data-unoptimized'),
],
backgroundColor: [
'#f1b1b6',
'#8bc34a',
'#d6d6d6',
],
borderWidth: 0,
label: 'Dataset 1'
}
]
},
options: {
legend: {
display: false
},
events: [],
animation: {
easing: 'easeOutBounce'
},
responsive: false,
cutoutPercentage: 80
}
});
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,148 @@
/**
* License Manager JavaScript
*
* Handles license activation, deactivation, sync, and unsubscribe actions.
* This is a lightweight replacement for clearfy-license-manager.js
*
* @package Robin_Image_Optimizer
*/
jQuery(function($) {
'use strict';
/**
* Handle license action button clicks
*/
$(document).on('click', '.wrio-license-btn', function(e) {
e.preventDefault();
// Remove any existing notices when user tries again
$('.wrio-license-notice').remove();
var $button = $(this),
$wrapper = $('#wrio-license-wrapper'),
action = $button.data('action'),
nonce = $wrapper.data('nonce'),
loaderUrl = $wrapper.data('loader');
// Disable all buttons and show loader inside the clicked button
$('.wrio-license-btn').prop('disabled', true);
$button.prepend('<img class="wrio-loader" src="' + loaderUrl + '" alt="Loading..." style="height: 16px; vertical-align: middle; margin-right: 8px;">');
// Build request data
var data = {
action: 'wrio_license_action',
_wpnonce: nonce,
license_action: action,
licensekey: ''
};
// Include license key for activation
if (action === 'activate') {
data.licensekey = $('#license-key').val().trim();
if (!data.licensekey) {
showNotice('Please enter a license key.', 'error');
resetButtons();
return;
}
}
// Send AJAX request
$.ajax({
url: ajaxurl,
type: 'POST',
dataType: 'json',
data: data,
success: function(response) {
if (response && response.success) {
showNotice(response.data.message, 'success');
// Reload page to show updated license state
setTimeout(function() {
window.location.reload();
}, 1000);
} else {
var errorMsg = response && response.data && response.data.message
? response.data.message
: 'An error occurred. Please try again.';
showNotice(errorMsg, 'error');
resetButtons();
}
},
error: function(xhr, status, error) {
console.error('WRIO License AJAX Error:', {
status: xhr.status,
statusText: xhr.statusText,
responseText: xhr.responseText,
error: error
});
var errorMsg = 'Connection error. Please check your internet connection and try again.';
if (xhr.responseText) {
try {
var response = JSON.parse(xhr.responseText);
if (response.data && response.data.message) {
errorMsg = response.data.message;
}
} catch (e) {
// Response wasn't JSON
}
}
showNotice(errorMsg, 'error');
resetButtons();
}
});
});
/**
* Reset buttons to their original state
*/
function resetButtons() {
$('.wrio-loader').remove();
$('.wrio-license-btn').prop('disabled', false);
}
/**
* Show a notice message
*
* @param {string} message The message to display
* @param {string} type Notice type: 'success' or 'error'
*/
function showNotice(message, type) {
// Remove any existing notices
$('.wrio-license-notice').remove();
var typeClass = type === 'success' ? 'wrio-license-notice--success' : 'wrio-license-notice--error';
var $notice = $('<div class="wrio-license-notice ' + typeClass + '"><p>' + escapeHtml(message) + '</p></div>');
// Insert into the error container
$('#license-form-error-container').html($notice);
// Auto-dismiss after 5 seconds for success messages
if (type === 'success') {
setTimeout(function() {
$notice.fadeOut(function() {
$(this).remove();
});
}, 5000);
}
}
/**
* Escape HTML entities
*
* @param {string} text Text to escape
* @return {string} Escaped text
*/
function escapeHtml(text) {
var map = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return String(text).replace(/[&<>"']/g, function(m) { return map[m]; });
}
});