Changeset 3443433
- Timestamp:
- 01/20/2026 04:33:46 PM (2 months ago)
- Location:
- post-views-counter/trunk
- Files:
-
- 5 edited
-
includes/class-settings-display.php (modified) (2 diffs)
-
includes/class-settings-general.php (modified) (2 diffs)
-
includes/class-settings.php (modified) (2 diffs)
-
post-views-counter.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-views-counter/trunk/includes/class-settings-display.php
r3442638 r3443433 387 387 388 388 if ( is_array( $input ) ) { 389 foreach ( $input as $group => $set ) { 389 foreach ( $input as $group ) { 390 // sanitize value 391 $group = sanitize_key( $group ); 392 390 393 if ( $group === 'robots' || $group === 'ai_bots' ) 391 394 continue; … … 403 406 404 407 if ( is_array( $input ) ) { 405 foreach ( $input as $role => $set ) { 408 foreach ( $input as $role ) { 409 // sanitize value 410 $role = sanitize_key( $role ); 411 406 412 if ( isset( $field['options'][$role] ) ) 407 413 $roles[] = $role; -
post-views-counter/trunk/includes/class-settings-general.php
r3442638 r3443433 484 484 485 485 if ( is_array( $input ) ) { 486 foreach ( $input as $group => $set ) { 486 foreach ( $input as $group ) { 487 // sanitize value 488 $group = sanitize_key( $group ); 489 487 490 // disallow disabled checkboxes 488 491 if ( ! empty( $field['disabled'] ) && in_array( $group, $field['disabled'], true ) ) … … 501 504 502 505 if ( is_array( $input ) ) { 503 foreach ( $input as $role => $set ) { 506 foreach ( $input as $role ) { 507 // sanitize value 508 $role = sanitize_key( $role ); 509 504 510 if ( isset( $field['options'][$role] ) ) 505 511 $roles[] = $role; -
post-views-counter/trunk/includes/class-settings.php
r3442638 r3443433 784 784 $pvc = Post_Views_Counter(); 785 785 786 // map exclude array to separate fields before validation (fields post as exclude[groups]/exclude[roles]) 787 if ( isset( $input['exclude'] ) && is_array( $input['exclude'] ) ) { 788 if ( isset( $input['exclude']['groups'] ) ) 789 $input['exclude_groups'] = $input['exclude']['groups']; 790 791 if ( isset( $input['exclude']['roles'] ) ) 792 $input['exclude_roles'] = $input['exclude']['roles']; 793 } 794 795 // map restrict_display array to separate fields before validation (fields post as restrict_display[groups]/restrict_display[roles]) 796 if ( isset( $input['restrict_display'] ) && is_array( $input['restrict_display'] ) ) { 797 if ( isset( $input['restrict_display']['groups'] ) ) 798 $input['restrict_display_groups'] = $input['restrict_display']['groups']; 799 800 if ( isset( $input['restrict_display']['roles'] ) ) 801 $input['restrict_display_roles'] = $input['restrict_display']['roles']; 802 } 803 786 804 // use internal settings api to validate settings first 787 805 $input = $pvc->settings_api->validate_settings( $input ); … … 796 814 797 815 // merge restrict display fields for backward compatibility 798 if ( isset( $input['restrict_ groups'] ) || isset( $input['restrict_roles'] ) ) {816 if ( isset( $input['restrict_display_groups'] ) || isset( $input['restrict_display_roles'] ) ) { 799 817 $input['restrict_display'] = [ 800 'groups' => isset( $input['restrict_ groups'] ) ? $input['restrict_groups'] : [],801 'roles' => isset( $input['restrict_ roles'] ) ? $input['restrict_roles'] : []818 'groups' => isset( $input['restrict_display_groups'] ) ? $input['restrict_display_groups'] : [], 819 'roles' => isset( $input['restrict_display_roles'] ) ? $input['restrict_display_roles'] : [] 802 820 ]; 803 unset( $input['restrict_ groups'], $input['restrict_roles'] );821 unset( $input['restrict_display_groups'], $input['restrict_display_roles'] ); 804 822 } 805 823 -
post-views-counter/trunk/post-views-counter.php
r3443281 r3443433 3 3 Plugin Name: Post Views Counter 4 4 Description: Post Views Counter allows you to collect and display how many times a post, page, or other content has been viewed in a simple, fast and reliable way. 5 Version: 1.7. 25 Version: 1.7.3 6 6 Author: dFactory 7 7 Author URI: https://dfactory.co/ … … 110 110 'integrations' => [] 111 111 ], 112 'version' => '1.7. 2'112 'version' => '1.7.3' 113 113 ]; 114 114 -
post-views-counter/trunk/readme.txt
r3443281 r3443433 5 5 Requires PHP: 7.0 6 6 Tested up to: 6.9 7 Stable tag: 1.7. 27 Stable tag: 1.7.3 8 8 License: MIT License 9 9 License URI: http://opensource.org/licenses/MIT … … 93 93 == Changelog == 94 94 95 = 1.7.3 = 96 * Fix: Settings validation for exclude/restrict display checkbox fields. 97 * Fix: Map nested array format to flat field keys before validation. 98 * Fix: Restrict display merge logic using correct field names. 99 95 100 = 1.7.2 = 96 101 * Fix: jQuery wrapper applied to vanilla JS files in build output. … … 435 440 == Upgrade Notice == 436 441 437 = 1.7. 2=438 Fixed jQuery wrapper applied to vanilla JS files in build output.442 = 1.7.3 = 443 Fixed settings validation for exclude visitors and restrict display checkbox fields.
Note: See TracChangeset
for help on using the changeset viewer.