Forum Replies Created

Viewing 15 replies - 601 through 615 (of 620 total)
  • Plugin Author crossi72

    (@crossi72)

    Usually this happen when the folder already contains a file with the name you choose, can you check if this is the case?

    Can you write the sequence of operation that produced the error, so I can try to reproduce the problem?

    Thanks for your feedback
    C.

    Plugin Author crossi72

    (@crossi72)

    You need to change the file name, if the plugin does not detect a change to the name of the file it will do nothing.

    I’ll try to remove the control on file name changes, so it will be possible to apply sanitization to actual file names.

    C.

    Plugin Author crossi72

    (@crossi72)

    Hi w3is,
    the plugin rename only the files for which you have changed the name.

    I never thought about this kind of use but I think it can be useful so I’ll release a new version as soon as possibile.

    Thanks for your feedback
    C.

    Plugin Author crossi72

    (@crossi72)

    I can’t reproduce your issue, can you tell me which plugin are active on your site and the WordPress version you are using?

    C.

    Plugin Author crossi72

    (@crossi72)

    I’ve added a sanitization to file name and released a new version, let me know if you still have problems with special characters in file names.

    C.

    Plugin Author crossi72

    (@crossi72)

    I’ll check as soon as possible.

    Thanks for your feedback.

    Plugin Author crossi72

    (@crossi72)

    Thanks for your feedback, I’ll try to fix those issues as soon as possible!

    Thread Starter crossi72

    (@crossi72)

    There was some problem with new versions on WordPress, I’ve updated my custom plugin version on https://www.eurosoftlab.com/media-rename.zip

    Hope this help
    C.

    Thread Starter crossi72

    (@crossi72)

    Those snippets works on main loop, I need to create a second loop different from the first ??

    Thread Starter crossi72

    (@crossi72)

    I’m receiving lots of requests so I published my modified plugin here: https://www.eurosoftlab.com/media-rename.zip

    Hope this help
    C.

    Thread Starter crossi72

    (@crossi72)

    I’d like to contact the plugin author to send him my fix, someone may tell me if is possible to contact the author?

    Thread Starter crossi72

    (@crossi72)

    Send me an email at claudio_at_eurosoftlab_dot_com I’ll send you a full copy of my modified plugin so we can test it on your server.

    Thread Starter crossi72

    (@crossi72)

    Yes, runs like a charm on three test sites (I’m still testing it before releasing on customers servers ^^).
    This is the complete js file:

    (function($) {
    	var $form, $fields, type, is_media_single, fields_count, current_field = 0;
    
    	$.fn.do_rename = function() {
    		var $field = this;
    
    		$.post(
    			ajaxurl, {
    				action: 'media_rename',
    				type: type,
    				_wpnonce: $('input[name=_mr_wp_nonce]', $form).val(),
    				new_filename: $('input', $field).val(),
    				post_id: $('input', $field).data('post-id')
    			}, function (response) {
    				$('.loader', $field).hide();
    
    				if (response != '1') {
    					$('.error', $field).text(response).css('display', 'inline-block');
    				} else {
    					$('input[type=text]', $field).attr('title', $('input[type=text]', $field).val());
    					$('.success', $field).css('display', 'inline-block');
    				}
    
    				if (++current_field == fields_count) {
    					current_field = 0;
    
    					if (!$form.find('.error:visible').length) {
    						$form.submit();
    					}
    				} else {
    					$fields.eq(current_field).do_rename();
    				}
    			}
    		);
    	}
    
    	$(document).ready(function() {
    		$form = $('.wrap form');
    
    		if ($('.wp_attachment_holder .thumbnail').length == 1){
    			is_media_single = true;
    		}
    		else{
    			is_media_single = false;
    		}
    
    		if (!is_media_single) {
    			$('.tablenav select[name^=action]').each(function() {
    				for (label in MRSettings.labels) {
    					$('option:last', this).before( $('<option>').attr('value', label).text( decodeURIComponent(MRSettings.labels[label].replace(/\+/g, '%20')) ) );
    				}
    			});
    		}
    
    		$('#post').submit(process_form_submit);
    		$('.tablenav .button.action').click(process_form_submit);
    	});
    
    	var process_form_submit = function() {
    		type = $(this).siblings('select').length ? $(this).siblings('select').val() : 'rename';
    
    		if (!is_media_single && (type != 'rename' && type != 'rename_retitle') ) return;
    
    		$fields = (is_media_single) ? $('.media-rename', $form) : $('#the-list input:checked', $form).closest('tr').find('.media-rename');
    
    		$fields = $fields.filter(function() {
    			return $('input[type=text]', this).val() != $('input[type=text]', this).attr('title');
    		});
    
    		if (fields_count = $fields.length) {
    			$fields.find('.loader, .error, .success').hide();
    			$fields.find('.loader').css('display', 'inline-block');
    
    			$fields.eq(current_field).do_rename();
    
    			return false;
    		}
    	};
    
    })(jQuery);

    I also added sanitize_file_name in class-media-rename.php but this is only required to process file name containing white spaces.

    Forum: Plugins
    In reply to: [Redirection] RegEx help

    Try this two regular expressions:
    source url /(.*)german
    target url /de

    source url /(.*)german/(.*).html
    target url /de/$2

    Thread Starter crossi72

    (@crossi72)

    I found a solution, in plugins/media-rename/js/scripts.js replace:
    $(document).ready(function() {
    $form = $(‘.wrap form’);
    is_media_single = !$(‘.wp-list-table’).length;
    if (!is_media_single) {
    $(‘.tablenav select[name^=action]’).each(function() {
    for (label in MRSettings.labels) {
    $(‘option:last’, this).before( $(‘<option>’).attr(‘value’, label).text( decodeURIComponent(MRSettings.labels[label].replace(/\+/g, ‘%20’)) ) );
    }
    });
    }
    $(‘#post’).submit(process_form_submit);
    $(‘.tablenav .button.action’).click(process_form_submit);
    });

    with:
    $(document).ready(function() {
    $form = $(‘.wrap form’);

    if ($(‘.wp_attachment_holder .thumbnail’).length == 1){
    is_media_single = true;
    }
    else{
    is_media_single = false;
    }

    if (!is_media_single) {
    $(‘.tablenav select[name^=action]’).each(function() {
    for (label in MRSettings.labels) {
    $(‘option:last’, this).before( $(‘<option>’).attr(‘value’, label).text( decodeURIComponent(MRSettings.labels[label].replace(/\+/g, ‘%20’)) ) );
    }
    });
    }

    $(‘#post’).submit(process_form_submit);
    $(‘.tablenav .button.action’).click(process_form_submit);
    });

Viewing 15 replies - 601 through 615 (of 620 total)