Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 16 additions & 39 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,37 @@
filter:
paths:
- 'inc/*'
- '*'
excluded_paths:
- 'languages/*'
- 'lib/*'
- 'tests/*'
paths:
- 'inc/*'
- '*'
tools:
php_cpd:
excluded_dirs:
- lib
- tests
- languages
filter:
excluded_paths: ['languages/*', 'lib/*', 'tests/*']
php_pdepend:
excluded_dirs:
- lib
- tests
php_mess_detector:
filter:
excluded_paths: ['languages/*', 'lib/*', 'tests/*']
php_analyzer:
filter:
excluded_paths: ['languages/*', 'lib/*', 'tests/*']
config:
parameter_reference_check: true
checkstyle: { enabled: true, no_trailing_whitespace: true, naming: { enabled: false, local_variable: '', abstract_class_name: '', utility_class_name: '', constant_name: '', property_name: '', method_name: '', parameter_name: '', interface_name: '', type_name: '', exception_name: '', isser_method_name: '' } }
unreachable_code: true
check_access_control: true
typo_checks: true
check_variables: true
suspicious_code: { enabled: true, overriding_parameter: true, overriding_closure_use: true, parameter_closure_use_conflict: true, parameter_multiple_times: true, non_existent_class_in_instanceof_check: true, non_existent_class_in_catch_clause: true, assignment_of_null_return: true, non_commented_switch_fallthrough: true, non_commented_empty_catch_block: true, overriding_private_members: true, use_statement_alias_conflict: true, precedence_in_condition_assignment: true }
dead_assignments: true
verify_php_doc_comments: { enabled: true, parameters: true, return: true, suggest_more_specific_types: true, ask_for_return_if_not_inferrable: true, ask_for_param_type_annotation: true }
loops_must_use_braces: false
check_usage_context: { enabled: false, method_call_on_non_object: { enabled: false, ignore_null_pointer: false }, foreach: { value_as_reference: false, traversable: false }, missing_argument: false, argument_type_checks: disabled }
simplify_boolean_return: true
phpunit_checks: false
reflection_checks: false
precedence_checks: { enabled: false, assignment_in_condition: false, comparison_of_bit_result: false }
basic_semantic_checks: true
doc_comment_fixes: true
reflection_fixes: true
use_statement_fixes: { enabled: false, remove_unused: false, preserve_multiple: false, order_alphabetically: false }
php_code_sniffer:
filter:
excluded_paths: ['languages/*', 'lib/*', 'tests/*']
config:
standard: WordPress
sensiolabs_security_checker:
tab_width: '2'
sniffs: { wordpress: { arrays: { array_declaration_sniff: true }, classes: { valid_class_name_sniff: true }, files: { file_name_sniff: true }, formatting: { multiple_statement_alignment_sniff: true }, functions: { function_call_signature_sniff: true, function_declaration_argument_spacing_sniff: true }, naming_conventions: { valid_function_name_sniff: true }, objects: { object_instantiation_sniff: true }, php: { discouraged_functions_sniff: true }, strings: { double_quote_usage_sniff: true }, white_space: { control_structure_spacing_sniff: true, operator_spacing_sniff: true, php_indent_sniff: true }, xss: { escape_output_sniff: true } } }
sensiolabs_security_checker: true
php_cpd:
excluded_dirs:
- lib
- tests
- languages
filter:
excluded_paths: ['languages/*', 'lib/*', 'tests/*']
php_loc:
names:
1: 'inc/*.php'
- 'inc/*.php'
excluded_dirs:
- lib
- tests
php_pdepend:
excluded_dirs:
- lib
- tests
16 changes: 4 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ php:
env:
- WP_VERSION=master WP_MULTISITE=0
- WP_VERSION=master WP_MULTISITE=1
- WP_VERSION=3.7.1 WP_MULTISITE=0
- WP_VERSION=3.7.1 WP_MULTISITE=1
- WP_VERSION=3.6.1 WP_MULTISITE=0
- WP_VERSION=3.6.1 WP_MULTISITE=1
- WP_VERSION=3.5.2 WP_MULTISITE=0
- WP_VERSION=3.5.2 WP_MULTISITE=1
- WP_VERSION=3.5.1 WP_MULTISITE=0
- WP_VERSION=3.5.1 WP_MULTISITE=1
- WP_VERSION=3.5 WP_MULTISITE=0
- WP_VERSION=3.5 WP_MULTISITE=1
- WP_VERSION=3.4.2 WP_MULTISITE=0
- WP_VERSION=3.4.2 WP_MULTISITE=1
- WP_VERSION=3.4.1 WP_MULTISITE=0
- WP_VERSION=3.4.1 WP_MULTISITE=1
- WP_VERSION=3.4 WP_MULTISITE=0
- WP_VERSION=3.4 WP_MULTISITE=1
- WP_VERSION=3.3.3 WP_MULTISITE=0
- WP_VERSION=3.3.3 WP_MULTISITE=1
- WP_VERSION=3.3.2 WP_MULTISITE=0
- WP_VERSION=3.3.2 WP_MULTISITE=1
- WP_VERSION=3.3.1 WP_MULTISITE=0
- WP_VERSION=3.3.1 WP_MULTISITE=1
- WP_VERSION=3.3 WP_MULTISITE=0
- WP_VERSION=3.3 WP_MULTISITE=1

Expand Down
16 changes: 13 additions & 3 deletions inc/admin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ static function upp_options_box_prefix(){
);
$otherstyles = array(
'8' => '['.__( 'Random', 'uploadplus' ).'] '.mt_rand().$sep,
'9' => '['.__( 'Random 2x', 'uploadplus' ).'] '.md5( mt_rand() ).$sep,
'10' => '['.__( 'Blog name', 'uploadplus' ).'] '.str_replace( array( '.', ' ', '-', '_' ) ,$sep, get_bloginfo( 'name' ) ).$sep,
'A' => '['.__( 'Short blog name', 'uploadplus' ).'] '.str_replace( array( '.', '_', '-', ' ' ), '', get_bloginfo( 'name' ) ).$sep,
#'9' => '['.__( 'Random 2x', 'uploadplus' ).'] '.md5( mt_rand() ).$sep,
'10' => '['.__( 'Blog name', 'uploadplus' ).'] '. self::_clean_case( sanitize_file_name( get_bloginfo( 'name' ) ) ).$sep,
# 'A' => '['.__( 'Short blog name', 'uploadplus' ).'] '.str_replace( array( '.', '_', '-', ' ' ), '', get_bloginfo( 'name' ) ).$sep,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary redundant options.

'B' => __( 'WordPress unique filename', 'uploadplus' ),
'C' => 'username (' . $current_user->user_login . $sep . ')',
);
Expand All @@ -129,6 +129,16 @@ static function upp_options_box_prefix(){
';
$flag = $oflag = '';
foreach ( $datebased as $key => $val ) :

// legacy options
if ( '5' === $key || '6' === $key ):
$key = '4';
elseif ( '9' === $key ):
$key = '8';
elseif ( 'A' === $key ):
$key = '10';
endif;

$flag = ( $prefix == $key && $nullval == '' ) ? 'selected="selected"' : '';
echo '<option value="'.$key.'" label="'.$val.'" '.$flag.'>'.$val.'</option>
';
Expand Down
Loading