Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,357 @@
|
||||
.main-media-sync-page a:focus {
|
||||
box-shadow: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.main-media-sync-page .media-sync-global-errors {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.main-media-sync-page .media-sync-global-errors.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main-media-sync-page .notice pre {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.main-media-sync-page .notice-files-imported {
|
||||
display: none;
|
||||
}
|
||||
.main-media-sync-page .notice-files-imported.is-visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page .media-sync-button-holder {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.main-media-sync-page .media-sync-button-holder .import-spinner {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.main-media-sync-page .import-options {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.main-media-sync-page .import-options .description {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.main-media-sync-page .import-option-date-type {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.main-media-sync-page .import-option-date-type .import-option-date-type-item {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.main-media-sync-page .import-option-date-type .import-option-date-type-item label {
|
||||
display: block;
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
.main-media-sync-page .import-option-date-type .import-option-date-type-item .description {
|
||||
margin: 5px 0 5px 25px;
|
||||
}
|
||||
|
||||
.main-media-sync-page .import-options .media-sync-dry-run-holder {
|
||||
display: block;
|
||||
padding: 0 0 25px;
|
||||
}
|
||||
.main-media-sync-page .import-options .media-sync-dry-run-holder label {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.main-media-sync-page .import-option-batch-size {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page .media-sync-scan-files-message {
|
||||
display: block;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
/* Progress Bar */
|
||||
.main-media-sync-page .media-sync-progress-holder {
|
||||
display: none;
|
||||
background: #ddd;
|
||||
}
|
||||
.main-media-sync-page .media-sync-progress-holder .media-sync-progress {
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 15px;
|
||||
background: #0073aa;
|
||||
-moz-transition: width .3s ease-in-out;
|
||||
-webkit-transition: width .3s ease-in-out;
|
||||
-o-transition: width .3s ease-in-out;
|
||||
transition: width .3s ease-in-out;
|
||||
}
|
||||
.main-media-sync-page .media-sync-progress-holder.is-visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Counters and other texts */
|
||||
.main-media-sync-page .media-sync-state {
|
||||
display: block;
|
||||
padding: 5px 0 0;
|
||||
}
|
||||
.main-media-sync-page .media-sync-state .media-sync-state-number {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.main-media-sync-page .media-sync-state .media-sync-state-text {
|
||||
font-size: 15px;
|
||||
}
|
||||
.main-media-sync-page .media-sync-state.media-sync-state-note {
|
||||
color: #999;
|
||||
padding: 10px 0 5px;
|
||||
}
|
||||
|
||||
.main-media-sync-page .wp-filter {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.main-media-sync-page .wp-filter .filter-items {
|
||||
padding: 11px 0;
|
||||
}
|
||||
|
||||
/* Raw debug results */
|
||||
.main-media-sync-page .media-sync-html-response-holder {
|
||||
/*background-color: var(--color-dark);*/
|
||||
/*color: var(--color-light);*/
|
||||
border: 1px dotted #ccd0d4;
|
||||
font-family: monospace;
|
||||
padding: 8px 12px;
|
||||
margin: 1em 0;
|
||||
}
|
||||
.main-media-sync-page .media-sync-html-response-title {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
.main-media-sync-page .media-sync-html-response-item-error {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
/* Table Holder */
|
||||
.main-media-sync-page .media-sync-table-holder {
|
||||
position: relative;
|
||||
}
|
||||
.main-media-sync-page .media-sync-table-holder .table-spinner {
|
||||
display: none;
|
||||
}
|
||||
.main-media-sync-page .media-sync-table-holder.is-loading .table-spinner {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-position: 50% 50%;
|
||||
vertical-align: middle;
|
||||
z-index: 2;
|
||||
margin: -15px 0 0 -15px;
|
||||
}
|
||||
.main-media-sync-page .media-sync-table-holder.is-loading:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(250, 250, 250, 0.8);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Table Row */
|
||||
.main-media-sync-page tr.media-sync-list-file.is-first-level-no {
|
||||
float: left;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
visibility: collapse;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-first-level-no.is-expanded {
|
||||
float: none;
|
||||
height: auto;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* Highlight row that was imported successfully */
|
||||
.main-media-sync-page tr.media-sync-list-file.highlight-success td,
|
||||
.main-media-sync-page tr.media-sync-list-file.highlight-success th {
|
||||
background: #fff7b7;
|
||||
}
|
||||
/* Highlight row that was imported with error */
|
||||
.main-media-sync-page tr.media-sync-list-file.highlight-error td,
|
||||
.main-media-sync-page tr.media-sync-list-file.highlight-error th {
|
||||
background: #fb9e9e;
|
||||
}
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file div.error {
|
||||
margin: 10px 0;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-toggle-row {
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-toggle-row:before {
|
||||
content: "\f139";
|
||||
display: block;
|
||||
margin: -2px 0 0 -5px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.with-expanded-children .media-sync-toggle-row:before {
|
||||
content: "\f140";
|
||||
}
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file .dashicons-category {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: -1px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-file-name {
|
||||
display: inline-block;
|
||||
min-width: 18px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-num-items {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parents {
|
||||
margin-right: 2px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-file .media-sync-parents {
|
||||
margin-right: 16px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-file.toggle-arrows-yes .media-sync-parents {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-file.is-in-db-yes .media-sync-file-name {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.main-media-sync-page .widefat tbody td,
|
||||
.main-media-sync-page .widefat tbody th {
|
||||
border-bottom: 1px solid #f9f9f9;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file.is-file td,
|
||||
.main-media-sync-page tr.media-sync-list-file.is-file th {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-in-db-yes .media-sync-already-in-db {
|
||||
display: none;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-in-db-yes:hover .media-sync-already-in-db {
|
||||
display: inline;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file.is-in-db-yes:hover td,
|
||||
.main-media-sync-page tr.media-sync-list-file.is-in-db-yes:hover th {
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent {
|
||||
display: block;
|
||||
float: left;
|
||||
position: relative;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-first-yes i,
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-last-yes i,
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-last-yes:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 9px;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-first-yes i,
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-last-yes i {
|
||||
bottom: 9px;
|
||||
height: 35px;
|
||||
border-left: 1px dotted #555;
|
||||
}
|
||||
.main-media-sync-page tr.media-sync-list-file .media-sync-parent.is-last-yes:after {
|
||||
top: 50%;
|
||||
width: 17px;
|
||||
border-bottom: 1px dotted #555;
|
||||
}
|
||||
|
||||
.main-media-sync-page tr.media-sync-list-file.toggle-arrows-yes .media-sync-parent.is-first-yes i,
|
||||
.main-media-sync-page tr.media-sync-list-file.toggle-arrows-yes .media-sync-parent.is-last-yes i,
|
||||
.main-media-sync-page tr.media-sync-list-file.toggle-arrows-yes .media-sync-parent.is-last-yes:after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
.main-media-sync-page .media-sync-no-results {
|
||||
font-size: 14px;
|
||||
padding: 20px 5px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.main-media-sync-page .widefat tfoot td.check-column,
|
||||
.main-media-sync-page .widefat thead td.check-column {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.main-media-sync-page .widefat tbody th.check-column {
|
||||
padding-top: 9px;
|
||||
}
|
||||
|
||||
|
||||
.media-sync-debugging-stats {
|
||||
border: 1px dotted #ccd0d4;
|
||||
padding: 8px 12px;
|
||||
margin: 15px 0;
|
||||
}
|
||||
.media-sync-debugging-stats .media-sync-debugging-title {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
|
||||
.media-sync-page-settings .media-sync-options-install-add-on-message {
|
||||
padding: 20px 0 5px;
|
||||
}
|
||||
|
||||
.media-sync-page-settings .form-table input[type=text] {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
.media-sync-page-settings .import-option-date-type-item {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
.media-sync-page-settings .import-option-date-type-item .description {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
.media-sync-settings-button-holder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 25px 0;
|
||||
}
|
||||
.media-sync-settings-button-holder p.submit {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.media-sync-settings-button-holder .spinner {
|
||||
float: none;
|
||||
margin: 0 10px;
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
jQuery(document).ready(function($) {
|
||||
try {
|
||||
|
||||
var plugin = $('.main-media-sync-page');
|
||||
var files = plugin.find('.media-sync-list-files');
|
||||
|
||||
plugin.find('.js-import-selected').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var btn = $(this);
|
||||
var form = files.find('form');
|
||||
var isDebug = !!form.find('input[name="is_debug"]').val();
|
||||
var dryRun = !!form.find('input[name="dry_run"]').prop('checked');
|
||||
var filePostDate = form.find('input[name="file_post_date"]:checked').val();
|
||||
var batchSize = parseInt(form.find('input[name="batch_size"]').val());
|
||||
var selectedItems = form.find('.is-file.is-in-db-no input[type="checkbox"]:checked');
|
||||
var items = selectedItems && selectedItems.length ? selectedItems.map(function (index, checkbox) {
|
||||
return {
|
||||
'file': $(checkbox).val(),
|
||||
'row_id': $(checkbox).attr('data-row-id')
|
||||
};
|
||||
}).get() : [];
|
||||
var total = items.length;
|
||||
var batch;
|
||||
var batchCount = 0;
|
||||
var counter = 0;
|
||||
|
||||
function setActiveStatus(isActive) {
|
||||
if(isActive) {
|
||||
// Disable submit button while request is being executed
|
||||
btn.prop('disabled', true);
|
||||
|
||||
// Activate loading icon
|
||||
plugin.find('.import-spinner').addClass('is-active');
|
||||
} else {
|
||||
// Enable submit button
|
||||
btn.prop('disabled', false);
|
||||
|
||||
// Deactivate loading icon
|
||||
plugin.find('.import-spinner').removeClass('is-active');
|
||||
}
|
||||
}
|
||||
|
||||
function outputError(errorMessage = null, error = null, isItemError = false) {
|
||||
console.error("[Media Sync] [Import] " + errorMessage, (error ? error : ''));
|
||||
|
||||
if(!isItemError) {
|
||||
var errors = "[Media Sync] " + errorMessage + (error ? "\nE:\n" + error : '');
|
||||
plugin.find('.js-media-sync-error-placeholder').removeClass('hidden').html(errors);
|
||||
setActiveStatus(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (total <= 0) {
|
||||
outputError('No files selected.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(typeof batchSize === 'number' && batchSize > 0)) {
|
||||
outputError('Batch Size needs to be positive number.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reset stuff
|
||||
plugin.find('.media-sync-progress').css('width', 0);
|
||||
plugin.find('.notice-files-imported').removeClass('is-visible');
|
||||
plugin.find('.js-media-sync-html-responses').html('');
|
||||
plugin.find('.js-media-sync-error-placeholder').addClass('hidden').html('');
|
||||
|
||||
|
||||
// Clear highlighted rows
|
||||
files.find('.media-sync-list-file.highlight-success').removeClass('highlight-success');
|
||||
files.find('.media-sync-list-file.highlight-error').removeClass('highlight-error');
|
||||
|
||||
// Clear file errors
|
||||
files.find('.media-sync-file-error').remove();
|
||||
|
||||
// Show progress bar
|
||||
plugin.find('.media-sync-progress-holder').addClass('is-visible');
|
||||
|
||||
|
||||
function runAjax() {
|
||||
// Take new batch
|
||||
batch = items.splice(0, batchSize);
|
||||
|
||||
// Exit if there is nothing left in batch
|
||||
if (!(batch.length > 0)) {
|
||||
setActiveStatus(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
batchCount++;
|
||||
|
||||
return $.ajax({
|
||||
url: ajax_data.ajax_url + '?mediaSyncBatch=' + batchCount,
|
||||
data: {
|
||||
'action': 'media_sync_import_files',
|
||||
'security': ajax_data.security,
|
||||
'dry_run': dryRun,
|
||||
'file_post_date': filePostDate,
|
||||
'media_items': batch
|
||||
},
|
||||
dataType: isDebug ? 'html' : 'json',
|
||||
method: 'POST'
|
||||
}).done(function (data) {
|
||||
try {
|
||||
|
||||
if(!data) {
|
||||
outputError('No response received');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isDebug) {
|
||||
plugin.find('.js-media-sync-html-responses').append(data);
|
||||
} else {
|
||||
|
||||
var error = data.hasOwnProperty('error') && data.error ? data.error : null;
|
||||
var errorMessage = data.hasOwnProperty('errorMessage') && data.errorMessage ? data.errorMessage : null;
|
||||
|
||||
if(error || errorMessage) {
|
||||
outputError('[Backend error] ' + errorMessage, error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!(data.hasOwnProperty('results') && data.results && data.results.length > 0)) {
|
||||
setActiveStatus(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data.results, function (index, item) {
|
||||
var itemError = item.hasOwnProperty('error') && item.error ? item.error : null;
|
||||
var itemErrorMessage = item.hasOwnProperty('errorMessage') && item.errorMessage ? item.errorMessage : null;
|
||||
|
||||
if(itemError || itemErrorMessage) {
|
||||
outputError('[Item error] ' + itemErrorMessage, itemError, true);
|
||||
}
|
||||
|
||||
if (item.hasOwnProperty('row_id') && item.row_id) {
|
||||
var statusClass = 'error';
|
||||
|
||||
if (item.inserted === true) {
|
||||
counter++;
|
||||
statusClass = 'success';
|
||||
|
||||
console.log("[Media Sync] [" + counter + "] " + (dryRun ? "DRY RUN: " : "Successfully imported: ") + item.row_id);
|
||||
} else {
|
||||
// If we didn't already output the error
|
||||
if(!itemError && !itemErrorMessage) {
|
||||
console.error("[Media Sync] Error importing: " + item.row_id);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
var fileRow = files.find('[id="' + item.row_id + '"]');
|
||||
|
||||
if(itemError || itemErrorMessage) {
|
||||
var errors = (itemErrorMessage ? itemErrorMessage : '') + (itemError ? '\nE:\n' + itemError : '');
|
||||
fileRow.find('.column-primary').append('<div class="error media-sync-file-error">' + errors + '</div>');
|
||||
}
|
||||
|
||||
// Highlight imported or failed row
|
||||
fileRow.addClass('highlight-' + statusClass);
|
||||
} catch (highlightError) {
|
||||
console.log('[Media Sync] Could not highlight imported row.', highlightError);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var animatedCounter = counter;
|
||||
|
||||
// Not really correct progress indicator, it's just animated
|
||||
jQuery({Counter: animatedCounter}).animate({Counter: counter}, {
|
||||
duration: 1000,
|
||||
easing: 'linear',
|
||||
step: function () {
|
||||
// Update "imported" count
|
||||
files.find('.js-media-sync-imported-count').html(Math.ceil(this.Counter));
|
||||
},
|
||||
complete: function () {
|
||||
// Update "imported" count again (sometimes it doesn't set correct value above)
|
||||
files.find('.js-media-sync-imported-count').html(counter);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Update progress bar
|
||||
plugin.find('.media-sync-progress').css('width', ((counter / total) * 100) + '%');
|
||||
|
||||
// If all items are imported successfully (last item)
|
||||
if (counter === total) {
|
||||
|
||||
setActiveStatus(false);
|
||||
|
||||
// Show success message
|
||||
plugin.find('.notice-files-imported').addClass('is-visible');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Run again to go through all batches
|
||||
// It's a recursive call to avoid stacking too many "pending" ajax calls,
|
||||
// but async/await or Promise would be much better
|
||||
runAjax();
|
||||
|
||||
} catch(e) {
|
||||
outputError('Error processing results', e);
|
||||
return false;
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, errorThrown) {
|
||||
|
||||
plugin.find('.js-media-sync-html-responses').append(jqXHR.responseText);
|
||||
|
||||
outputError('[AJAX error] ' + textStatus, errorThrown);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
setActiveStatus(true);
|
||||
|
||||
// Run recursively (to avoid stacking too many "pending" ajax calls)
|
||||
runAjax();
|
||||
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('[Media Sync]', e);
|
||||
alert("[Media Sync]\n" + e);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,107 @@
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var files = $('.main-media-sync-page .media-sync-list-files');
|
||||
var tableHolder = files.find('.media-sync-table-holder');
|
||||
|
||||
// When directory checkbox is changed (direct click or running recursively with .trigger())
|
||||
files.find('.media-sync-list-file.is-dir .js-checkbox').on('change', function (event, type) {
|
||||
|
||||
// Show loading overlay
|
||||
if(type !== "recursive" && !tableHolder.hasClass('is-loading')) {
|
||||
tableHolder.addClass('is-loading');
|
||||
}
|
||||
|
||||
// Find parent row
|
||||
var row = $(this).closest('.media-sync-list-file');
|
||||
// Checked or not
|
||||
var checked = !!$(this).prop('checked');
|
||||
|
||||
// Fake delay to allow loading to show up immediately (before this)
|
||||
setTimeout(function () {
|
||||
|
||||
var childrenCheckboxes = row.siblings('[data-parent-id="' + row.prop('id') + '"]').find('.js-checkbox');
|
||||
|
||||
if (childrenCheckboxes && childrenCheckboxes.length > 0) {
|
||||
|
||||
$.each(childrenCheckboxes, function (index, checkbox) {
|
||||
// If not disabled
|
||||
if (!$(checkbox).prop('disabled')) {
|
||||
// Check / un-check and trigger "change" event to run for inner folders
|
||||
$(checkbox).prop('checked', checked).trigger('change', ['recursive']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update "selected items" counter
|
||||
files.find('.js-media-sync-selected-count').html(files.find('.is-file.is-in-db-no input[type="checkbox"]:checked').length);
|
||||
|
||||
// Hide loading overlay
|
||||
if(type !== "recursive" && tableHolder.hasClass('is-loading')) {
|
||||
tableHolder.removeClass('is-loading');
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// Handle "select all" checkboxes events
|
||||
var selectAllCheckboxes = files.find('.check-column-all input[type="checkbox"]');
|
||||
|
||||
// Cancel other stuff added to this element and click event (from WP), because it's quite slow with all of that
|
||||
selectAllCheckboxes.on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
selectAllCheckboxes.on('change', function(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
// Checked or not
|
||||
var checked = !!$(this).prop('checked');
|
||||
|
||||
// Check other "select all" checkbox (there is one at the top and one at the bottom)
|
||||
selectAllCheckboxes.prop('checked', checked);
|
||||
|
||||
// Check / un-check all first level items and trigger "change" event to run for inner folders
|
||||
$.each(files.find('.media-sync-list-file.level-1 .js-checkbox'), function (index, checkbox) {
|
||||
$(checkbox).prop('checked', checked).trigger('change');
|
||||
});
|
||||
});
|
||||
|
||||
// Update "selected items" counter when selecting individual files
|
||||
files.find('.media-sync-list-file.is-file .js-checkbox').on('change', function () {
|
||||
// Update "selected items" counter
|
||||
files.find('.js-media-sync-selected-count').html(files.find('.is-file.is-in-db-no input[type="checkbox"]:checked').length);
|
||||
});
|
||||
|
||||
|
||||
// Expand / Collapse folders
|
||||
files.find('.media-sync-list-file.is-dir .js-toggle-row').on('click', function () {
|
||||
// Find parent row
|
||||
var row = $(this).closest('.media-sync-list-file');
|
||||
|
||||
// If it's expanded or not
|
||||
var expanded = row.hasClass('with-expanded-children');
|
||||
|
||||
if (expanded) {
|
||||
row.removeClass('with-expanded-children');
|
||||
} else {
|
||||
row.addClass('with-expanded-children');
|
||||
}
|
||||
|
||||
// Each child row
|
||||
$.each(row.siblings('[data-parent-id="' + row.prop('id') + '"]'), function () {
|
||||
|
||||
// If child is dir with expanded children
|
||||
if ($(this).hasClass('is-dir') && $(this).hasClass('with-expanded-children')) {
|
||||
// Trigger click to collapse inner children
|
||||
$(this).find('.js-toggle-row').trigger('click');
|
||||
}
|
||||
|
||||
if (expanded) {
|
||||
$(this).removeClass('is-expanded');
|
||||
} else {
|
||||
$(this).addClass('is-expanded');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,201 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Media Sync\n"
|
||||
"POT-Creation-Date: 2019-12-23 23:42+0100\n"
|
||||
"PO-Revision-Date: 2019-04-03 01:09+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: en_US\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.2.1\n"
|
||||
"X-Poedit-Basepath: ../../../../../../Library/WebServer/Documents/stuff/"
|
||||
"media-sync-svn/trunk\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-KeywordsList: __;_e\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPath-1: .\n"
|
||||
|
||||
#: includes/MediaSync.class.php:27 includes/MediaSync.class.php:436
|
||||
msgid "You do not have sufficient permissions to access this page."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:41 media-sync.php:30 media-sync.php:46
|
||||
msgid "Media Sync"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:47
|
||||
msgid "Please backup your database! This plugin makes database changes."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:50
|
||||
#, php-format
|
||||
msgid "Done! Highlighted files were successfully imported. %s to see changes."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:51
|
||||
msgid "Re-scan"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:62
|
||||
msgid "Sync - uploads directory"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:65
|
||||
msgid "Scan Files"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:69
|
||||
#, php-format
|
||||
msgid ""
|
||||
"Use this to see content of upload dir: %s and import files to Media Library."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:74
|
||||
msgid "Sync - Media Library"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:76
|
||||
msgid "Filter Media Library"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:80
|
||||
msgid ""
|
||||
"Use this to see Media Library items that are missing actual files. This "
|
||||
"takes you to Media Library but with custom filter."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:87
|
||||
msgid "Import Selected"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:92
|
||||
msgid "Date/time to set for newly imported files"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:99
|
||||
msgid "Dry Run (test without making database changes)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:116
|
||||
msgid "Imported"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:120
|
||||
msgid "out of"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:124
|
||||
msgid "selected items"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:128
|
||||
msgid "Files already in Media Library will be skipped during import"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:134
|
||||
msgid "Filter by type"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:136
|
||||
msgid "All files"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:138
|
||||
msgid "Only files missing from Media Library"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:143
|
||||
msgid "Filter"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:165
|
||||
msgid ""
|
||||
"Everything seems fine here, there are no files that are not already in your "
|
||||
"Media Library."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:167
|
||||
msgid "No Results"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:216
|
||||
msgid "Media Sync Settings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:232
|
||||
msgid "Dry Run"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:239
|
||||
msgid "Show \"Dry Run\" option"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:246
|
||||
msgid "Preselected / default value for file date"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:285
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:287
|
||||
msgid "Defaults to what WordPress uses - current time."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:292
|
||||
msgid "File time"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:294
|
||||
msgid "File modification timestamp - when it was last modified."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:299
|
||||
msgid "Smart file time"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:301
|
||||
#, php-format
|
||||
msgid ""
|
||||
"If file timestamp does not match the folder in which it is - it will "
|
||||
"construct the date/time based on the folder: %s."
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:322
|
||||
msgid "Select All"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:326 includes/MediaSync.class.php:377
|
||||
msgid "File"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:406
|
||||
msgid "item"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:406
|
||||
msgid "items"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:410
|
||||
msgid "Already in"
|
||||
msgstr ""
|
||||
|
||||
#: includes/MediaSync.class.php:412
|
||||
msgid "In Trash"
|
||||
msgstr ""
|
||||
|
||||
#: media-sync.php:146 media-sync.php:149
|
||||
msgid "Filter by missing file"
|
||||
msgstr ""
|
||||
|
||||
#: media-sync.php:151
|
||||
msgid "With file"
|
||||
msgstr ""
|
||||
|
||||
#: media-sync.php:153
|
||||
msgid "Without file"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Plugin Name: Media Sync
|
||||
* Plugin URI: https://wordpress.org/plugins/media-sync/
|
||||
* Description: Simple plugin to scan uploads directory and bring files to Media Library.
|
||||
* Version: 1.3.1
|
||||
* Author: Erol Živina
|
||||
* Author URI: https://github.com/erolsk8
|
||||
* License: GPLv2+
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: media-sync
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
|
||||
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'media_sync_link_to_main_plugin_page' );
|
||||
|
||||
/**
|
||||
* Add link below plugin name on 'Plugins' page
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
function media_sync_link_to_main_plugin_page( $links ) {
|
||||
$title = __('Media Sync', 'media-sync');
|
||||
$links[] = '<a href="'. esc_url( get_admin_url(null, 'upload.php?page=media-sync-page') ) .'">' . $title . '</a>';
|
||||
return $links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_action( 'admin_menu', 'media_sync_add_menu_items' );
|
||||
|
||||
/**
|
||||
* Add menu item for this plugin
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
function media_sync_add_menu_items() {
|
||||
|
||||
$title = __('Media Sync', 'media-sync');
|
||||
|
||||
// Add sub item to Media menu
|
||||
if(MediaSync::media_sync_user_has_general_access()) {
|
||||
add_media_page( $title, $title, 'read', 'media-sync-page', 'media_sync_main_page' );
|
||||
}
|
||||
|
||||
// Show options menu only if user can manage options
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
|
||||
// Add sub item to Settings menu
|
||||
add_options_page( $title, $title, 'manage_options', 'media-sync-options', 'media_sync_options_page' );
|
||||
|
||||
// Prepare plugin settings
|
||||
add_action( 'admin_init', 'media_sync_options_setup' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
include( plugin_dir_path(__FILE__) . 'includes/MediaSync.class.php');
|
||||
|
||||
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'media_sync_load_admin_scripts', 100 );
|
||||
|
||||
/**
|
||||
* Load Admin CSS and JS files
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_load_admin_scripts( $hook ) {
|
||||
|
||||
$js_dir = plugin_dir_url( __FILE__ ) . 'admin/js/';
|
||||
$css_dir = plugin_dir_url( __FILE__ ) . 'admin/css/';
|
||||
|
||||
wp_register_script( 'media-sync-js-admin-script', $js_dir . 'script.js', array('jquery'), '1.2.3', true );
|
||||
wp_enqueue_script( 'media-sync-js-admin-script' );
|
||||
|
||||
wp_enqueue_script( 'media-sync-js-admin-ajax-script', $js_dir . 'ajax_script.js', array('jquery'), '1.2.3' );
|
||||
wp_localize_script( 'media-sync-js-admin-ajax-script', 'ajax_data', array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'security' => wp_create_nonce( "media_sync_import_files" )
|
||||
));
|
||||
|
||||
wp_register_style( 'media-sync-css-admin-style', $css_dir . 'style.css', '', '1.2.3');
|
||||
wp_enqueue_style( 'media-sync-css-admin-style' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_action( 'wp_ajax_media_sync_import_files', 'media_sync_import_files' );
|
||||
|
||||
/**
|
||||
* Ajax action to import selected file
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_import_files() {
|
||||
MediaSync::media_sync_import_files();
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_action( 'plugins_loaded', 'media_sync_load_plugin_textdomain' );
|
||||
|
||||
/**
|
||||
* Loads plugin translated strings
|
||||
*
|
||||
* @since 0.1.4
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_load_plugin_textdomain() {
|
||||
load_plugin_textdomain( 'media-sync', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_action('restrict_manage_posts', 'media_sync_missing_media_library_filter');
|
||||
|
||||
/**
|
||||
* Add filter in Media Library for finding missing files
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_missing_media_library_filter()
|
||||
{
|
||||
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
||||
|
||||
// Skip if it's not Media Library
|
||||
$scr = get_current_screen();
|
||||
if (!is_admin() || !is_object($scr) || property_exists($scr, 'base') !== true || $scr->base !== 'upload') return;
|
||||
|
||||
// Get "missing files" filter from URL
|
||||
$missing = filter_input(INPUT_GET, 'media_sync_missing_files', FILTER_SANITIZE_STRING);
|
||||
?>
|
||||
<label for="filter-by-media-sync-missing-files"
|
||||
class="screen-reader-text"><?= __('Filter by missing file', 'media-sync') ?></label>
|
||||
<select name="media_sync_missing_files" id="filter-by-media-sync-missing-files">
|
||||
<option
|
||||
value=""<?= !$missing ? ' selected="selected"' : '' ?>><?= __('Filter by missing file', 'media-sync') ?></option>
|
||||
<option
|
||||
value="no"<?= $missing === 'no' ? ' selected="selected"' : '' ?>><?= __('With file', 'media-sync') ?></option>
|
||||
<option
|
||||
value="yes"<?= $missing === 'yes' ? ' selected="selected"' : '' ?>><?= __('Without file', 'media-sync') ?></option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
add_action('pre_get_posts','media_sync_missing_media_library_apply_filter');
|
||||
|
||||
/**
|
||||
* Apply filter for Media Library items with or without missing files
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param $query
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_missing_media_library_apply_filter($query)
|
||||
{
|
||||
require_once(ABSPATH . 'wp-admin/includes/screen.php');
|
||||
|
||||
// Skip if it's not Media Library
|
||||
$scr = get_current_screen();
|
||||
if (!is_admin() || !is_object($scr) || property_exists($scr, 'base') !== true || $scr->base !== 'upload') return;
|
||||
|
||||
// Get "missing files" filter from URL
|
||||
$missing = filter_input(INPUT_GET, 'media_sync_missing_files', FILTER_SANITIZE_STRING);
|
||||
|
||||
// Skip if "missing files" filter is not applied
|
||||
if (!$missing) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent infinite loop
|
||||
remove_action('pre_get_posts', __FUNCTION__);
|
||||
|
||||
// Get all media library items (to be able to check which ones do not have actual files)
|
||||
$media_library_items = get_posts(
|
||||
array_merge(
|
||||
$query->query,
|
||||
array(
|
||||
'fields' => 'ids',
|
||||
'posts_per_page' => -1
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Get missing files
|
||||
$missing_files = array();
|
||||
foreach ($media_library_items as $id) {
|
||||
// Get absolute path for this file
|
||||
$absolute_path = get_home_path() . str_replace(get_site_url(), "", wp_get_attachment_url($id));
|
||||
|
||||
// Strip double slashes (//) in absolute path
|
||||
$absolute_path = preg_replace('/([^:])(\/{2,})/', '$1/', $absolute_path);
|
||||
|
||||
// If file doesn't actually exists (if it's missing)
|
||||
if (!file_exists($absolute_path)) {
|
||||
$missing_files[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply appropriate filter
|
||||
if ($missing === 'yes') {
|
||||
$query->set('post__in', !empty($missing_files) ? $missing_files : [0]);
|
||||
}
|
||||
|
||||
if ($missing === 'no') {
|
||||
$query->set('post__not_in', $missing_files);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Main function for "Media Sync" page
|
||||
*
|
||||
* @since 0.1.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_main_page() {
|
||||
MediaSync::media_sync_main_page();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Render settings page
|
||||
*
|
||||
* @since 1.1.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_options_page() {
|
||||
MediaSync::media_sync_options_page();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Prepare plugin settings
|
||||
*
|
||||
* @since 1.1.0
|
||||
* @return void
|
||||
*/
|
||||
function media_sync_options_setup() {
|
||||
MediaSync::media_sync_options_setup();
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
=== Media Sync ===
|
||||
Contributors: erolsk8, simonkane
|
||||
Donate link: https://www.paypal.me/erolsk8
|
||||
Tags: media, uploads, import, ftp, server
|
||||
Requires at least: 3.0.1
|
||||
Tested up to: 6.2
|
||||
Requires PHP: 5.5
|
||||
Stable tag: trunk
|
||||
License: GPLv2+
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Simple plugin to scan "uploads" directory and bring those files into Media Library.
|
||||
|
||||
== Description ==
|
||||
|
||||
You can scan all files that are in `uploads` directory and see which ones are actually in Media Library and which ones are just sitting there. Then you can select files you want to import to the database and therefore make them available in Media Library.
|
||||
|
||||
You can also use FTP to upload your files to `uploads` directory and bring those files into Media Library.
|
||||
|
||||
|
||||
= Disclaimers =
|
||||
|
||||
Please read before adding a support topic. Reviews are not intended for support or suggestions.
|
||||
|
||||
1. "For developers"
|
||||
This plugin makes database changes (`wp_posts` and `wp_postmeta` tables), and it was primarily developed to help other developers that are aware of the consequences.
|
||||
|
||||
2. "1 file first"
|
||||
Please be careful and try to import only one file first, to see if it works.
|
||||
|
||||
3. "All at once"
|
||||
This plugin is focused on scanning, selecting, and importing all files at once. So it might not be great for huge amounts of files, since it can use up a lot of memory. Future versions will hopefully solve that problem. For now, you can try to go to Settings -> Media Sync and set it to scan only a specific directory.
|
||||
|
||||
4. "Your setup is unique"
|
||||
Please keep in mind that each WordPress installation is unique, so it's quite possible this plugin will not work in your case. If that happens, please turn on debugging in settings of this plugin, try to figure out why you have that problem, and then describe what you found in the Support section. The more details we have - it's more likely the problem will be solved.
|
||||
|
||||
|
||||
= Ignored files =
|
||||
- index.php,
|
||||
- various hidden files (.DS_Store, .htaccess),
|
||||
- WP generated thumbnails (files ending with for example -100x100.jpg),
|
||||
- WP generated scaled images (files ending with -scaled),
|
||||
- optimized .webp versions of original images (.jpg.webp),
|
||||
- retina thumbnails (-100x100@2x.jpg).
|
||||
|
||||
This is now configurable with a custom hook function and it can totally overwrite [these rules](https://regex101.com/r/FeIIvs/1) or add additional ones.
|
||||
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload `media-sync` directory to the `/wp-content/plugins/` directory
|
||||
2. Activate the plugin through the 'Plugins' menu in WordPress
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Initial Page
|
||||
2. Example of selecting files for import
|
||||
3. Import to Media Library in progress
|
||||
4. Import completed
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Stuck at importing / spins endlessly =
|
||||
|
||||
Please try to increase `max_execution_time` (and/or `memory_limit`) in `php.ini` on server (as described [here](https://thimpress.com/knowledge-base/how-to-increase-maximum-execution-time-for-wordpress-site/)). Or if you have too many files, try going to Settings -> Media Sync and change "Scan directory" to some inner folder.
|
||||
|
||||
= Files not showing up in Media Library =
|
||||
|
||||
Please make sure "Dry Run" option is NOT checked. This is a safety mechanism to make sure you know what you're doing, so be careful, try it first with just one file.
|
||||
|
||||
= Doesn't work =
|
||||
|
||||
Please first try to turn on debugging in Settings -> Media Sync and check [Network tab in Chrome DevTools](https://www.section.io/blog/chrome-developer-tools-tutorial-network/) to see what is going on in the background. Then report actual errors since it's hard to help without knowing the error which is causing the problem.
|
||||
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.3.1 =
|
||||
* Ignore optimized .webp versions of original images (e.g. .jpg.webp) and retina thumbnails (e.g. -100x100@2x.jpg) by default. It's still possible to customize it with `media_sync_filter_is_scan_object_ignored` hook.
|
||||
|
||||
= 1.3.0 =
|
||||
* New option to set custom Batch Size. This might help with errors due to server limits (e.g. max_execution_time).
|
||||
|
||||
= 1.2.9 =
|
||||
* Fix selecting multiple files without clicking on checkbox (e.g. shift-select).
|
||||
* Minor code cleanup.
|
||||
* Update supported WordPress version to 6.2.
|
||||
|
||||
= 1.2.8 =
|
||||
* Create a custom `_msc` record in `wp_postmeta` table to be able to differentiate files imported using this plugin. Could be useful to clean up the database later on.
|
||||
|
||||
= 1.2.7 =
|
||||
* Extend plugin access to "Editor" and "Author" roles.
|
||||
|
||||
= 1.2.6 =
|
||||
* If debugging is turned on, AJAX requests for import are now `html` which is rendered directly in UI.
|
||||
|
||||
= 1.2.5 =
|
||||
* New filter hook (`media_sync_filter_before_update_metadata`) which can be used to customize how metadata is updated or to run additional actions after file import.
|
||||
|
||||
= 1.2.4 =
|
||||
* Handle files with quotes (apostrophes) or other special characters in the file name.
|
||||
* Continue importing other selected files if there was an error with some of the files.
|
||||
* Show errors in UI instead of alert.
|
||||
|
||||
= 1.2.3 =
|
||||
* Better error handling and fallback when finding mime type
|
||||
|
||||
= 1.2.2 =
|
||||
* Fix meta data errors caused by invalid mime types
|
||||
|
||||
= 1.2.1 =
|
||||
* Much better error handling while importing
|
||||
|
||||
= 1.2.0 =
|
||||
* Optimized directory scanning to use less memory
|
||||
* New option to turn on debugging for this plugin
|
||||
* Changed parameters passed to `media_sync_filter_is_scan_object_ignored` hook function
|
||||
* Now requires PHP 5.5
|
||||
|
||||
= 1.1.8 =
|
||||
* Fix handling big ("-scaled.jpg") images [introduced in WordPress 5.3](https://make.wordpress.org/core/2019/10/09/introducing-handling-of-big-images-in-wordpress-5-3/). These files will now be skipped and won't be imported multiple times.
|
||||
* Add handy "Re-scan" button.
|
||||
|
||||
= 1.1.7 =
|
||||
* Fix issues when importing files containing special characters
|
||||
|
||||
= 1.1.6 =
|
||||
* Slight improvements with error handling in JavaScript
|
||||
|
||||
= 1.1.5 =
|
||||
* Always convert backslashes ("\") to forward slashes ("/") to fix various issues when using Windows Server.
|
||||
|
||||
= 1.1.4 =
|
||||
* Important backslash ("\") vs forward slash ("/") fix for use on Windows Server.
|
||||
|
||||
= 1.1.3 =
|
||||
* New option to set "Scan directory" in settings which will allow checking only certain sub directory.
|
||||
* New hook function `media_sync_filter_is_scan_object_ignored` which can be used to overwrite which files are ignored by default or to just skip additional files.
|
||||
|
||||
= 1.1.2 =
|
||||
* Fix Smart File Time on Windows server
|
||||
|
||||
= 1.1.1 =
|
||||
* Reduce the maximum number of items to import per batch from 20 to 10.
|
||||
So batch sizes are now: 1 (importing 1 to 10 items); 5 (importing 11 to 100 items) or 10 (importing more than 100 items)
|
||||
|
||||
= 1.1.0 =
|
||||
* [IMPORTANT] Date of imported Media Library items now defaults to the current date.
|
||||
But there are options to choose before importing and also a possibility to overwrite that using the custom hook.
|
||||
* New options page with the option to disable and hide "Dry Run".
|
||||
* Fix Media Library filter that was showing all items when the filter didn't find any result.
|
||||
|
||||
= 1.0.4 =
|
||||
* Reduce the number of items to import per batch
|
||||
|
||||
= 1.0.3 =
|
||||
* Support multisite network by changing required access [capability](https://wordpress.org/support/article/roles-and-capabilities/#capability-vs-role-table) from `update_plugins` to `import`
|
||||
|
||||
= 1.0.2 =
|
||||
* Another fix for get_current_screen error
|
||||
|
||||
= 1.0.1 =
|
||||
* Fix get_current_screen error
|
||||
|
||||
= 1.0.0 =
|
||||
* New option to clean up Media Library from items that are missing actual files (using custom Media Library filter)
|
||||
* New filter when scanning uploads directory which can help to show only files missing from Media Library
|
||||
|
||||
= 0.1.6 =
|
||||
* Fix PHP short array syntax
|
||||
* Update required PHP version to 5.4
|
||||
|
||||
= 0.1.5 =
|
||||
* Date of imported Media Library item is now set based on file modification timestamp
|
||||
|
||||
= 0.1.4 =
|
||||
* Add plugin localization
|
||||
* Add Serbian translation
|
||||
|
||||
= 0.1.3 =
|
||||
* Various improvements and fixes
|
||||
|
||||
= 0.1.2 =
|
||||
* Fix sorting of directories and files
|
||||
* Minor wording changes and code cleanup
|
||||
|
||||
= 0.1.1 =
|
||||
* Fix error on activation
|
||||
|
||||
= 0.1.0 =
|
||||
* Initial plugin features
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 0.1.0 =
|
||||
Initial plugin features
|
||||
Reference in new issue
Block a user