WP Accessibility - Version 1.6.6

Version Description

  • Per request, remove font sizing declaration for skip links. Inherit from site.
  • Add default styles for visible skiplinks, rather than allowing to be unstyled.
  • Remove tabindex application on section element from toolbar JS. (Not sure why it was there anyway.)
  • Bug fix: automatic labeling injected double labels on fields with no ID and an implicit label.
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 WP Accessibility
Version 1.6.6
Comparing to
See all releases

Code changes from version 1.6.5 to 1.6.6

js/longdesc.button.js CHANGED
@@ -1,9 +1,9 @@
1
  (function ($) {
2
- 'use strict';
3
- $('img[longdesc]').each(function () {
4
- var longdesc = $(this).attr('longdesc');
5
- var text = '<span>Long Description</span>';
6
- var classes = $(this).attr('class');
7
  var class_array = ( Array.isArray(classes) ) ? classes.split(' ') : [];
8
  var image_id = '';
9
  $.each( class_array, function ( index, value ) {
@@ -23,6 +23,5 @@
23
  }, function () {
24
  $(this).parent('.wpa-ld').children('.longdesc').hide();
25
  });
26
- });
27
- }(jQuery));
28
-
1
  (function ($) {
2
+ 'use strict';
3
+ $('img[longdesc]').each(function () {
4
+ var longdesc = $(this).attr('longdesc');
5
+ var text = '<span>Long Description</span>';
6
+ var classes = $(this).attr('class');
7
  var class_array = ( Array.isArray(classes) ) ? classes.split(' ') : [];
8
  var image_id = '';
9
  $.each( class_array, function ( index, value ) {
23
  }, function () {
24
  $(this).parent('.wpa-ld').children('.longdesc').hide();
25
  });
26
+ });
27
+ }(jQuery));
 
js/longdesc.link.js CHANGED
@@ -1,12 +1,12 @@
1
  (function ($) {
2
- 'use strict';
3
- $('img[longdesc]').each(function () {
4
- var longdesc = $(this).attr('longdesc');
5
- var alt = $(this).attr('alt');
6
- var classes = $(this).attr('class');
7
- $(this).wrap('<div class="wpa-ld" />');
8
- $(this).parent('.wpa-ld').addClass(classes);
9
- $(this).attr('alt', '').attr('class', '');
10
- $(this).parent('.wpa-ld').append('<a href="' + longdesc + '" class="longdesc-link">Description<span> of' + alt + '</span></a>');
11
  });
12
- }(jQuery));
1
  (function ($) {
2
+ 'use strict';
3
+ $('img[longdesc]').each(function () {
4
+ var longdesc = $(this).attr('longdesc');
5
+ var alt = $(this).attr('alt');
6
+ var classes = $(this).attr('class');
7
+ $(this).wrap('<div class="wpa-ld" />');
8
+ $(this).parent('.wpa-ld').addClass(classes);
9
+ $(this).attr('alt', '').attr('class', '');
10
+ $(this).parent('.wpa-ld').append('<a href="' + longdesc + '" class="longdesc-link">Description<span> of' + alt + '</span></a>');
11
  });
12
+ }(jQuery));
js/roles.jquery.js CHANGED
@@ -1,22 +1,21 @@
1
  (function ($) {
2
- 'use strict';
3
- $('nav').each(function () {
4
- $(this).attr('role', 'navigation');
5
- });
6
- $('main').each(function () {
7
- $(this).attr('role', 'main');
8
- });
9
- $('header:first').each(function () {
10
- $(this).attr('role', 'banner');
11
- });
12
- $('footer:last').each(function () {
13
- $(this).attr('role', 'contentinfo');
14
- });
15
- $('input[name=s]').parents('form').attr('role', 'search');
16
- if (wpaComplementary != false) {
17
- $('#' + wpaComplementary).each(function () {
18
- $(this).attr('role', 'complementary');
19
- });
20
- }
21
- }(jQuery));
22
-
1
  (function ($) {
2
+ 'use strict';
3
+ $('nav').each(function () {
4
+ $(this).attr('role', 'navigation');
5
+ });
6
+ $('main').each(function () {
7
+ $(this).attr('role', 'main');
8
+ });
9
+ $('header:first').each(function () {
10
+ $(this).attr('role', 'banner');
11
+ });
12
+ $('footer:last').each(function () {
13
+ $(this).attr('role', 'contentinfo');
14
+ });
15
+ $('input[name=s]').parents('form').attr('role', 'search');
16
+ if (wpaComplementary != false) {
17
+ $('#' + wpaComplementary).each(function () {
18
+ $(this).attr('role', 'complementary');
19
+ });
20
+ }
21
+ }(jQuery));
 
js/skiplinks.webkit.js CHANGED
@@ -1,24 +1,24 @@
1
  (function (linkList, i, URI) {
2
- if (!!(URI = document.documentURI)) {
3
- URI = URI.split('#')[0];
4
- document.addEventListener("DOMContentLoaded", function () {
5
- document.removeEventListener("DOMContentLoaded", arguments.callee, false);
6
- linkList = document.links;
7
- for (i in linkList) {
8
- if (!!linkList[i].hash) {
9
- if (linkList[i].hash.match(/^#./)) {
10
- if ((URI + linkList[i].hash) == linkList[i].href) {
11
- linkList[i].addEventListener("click", function (e, f, g) {
12
- f = document.getElementById(this.hash.slice(1));
13
- if (!(g = f.getAttribute('tabIndex'))) f.setAttribute('tabIndex', -1);
14
- f.focus();
15
- if (!g) f.removeAttribute('tabIndex');
16
- }, false);
17
- }
18
- }
19
- }
20
- }
21
- }, false);
22
- }
23
- return true;
24
  })();
1
  (function (linkList, i, URI) {
2
+ if (!!(URI = document.documentURI)) {
3
+ URI = URI.split('#')[0];
4
+ document.addEventListener("DOMContentLoaded", function () {
5
+ document.removeEventListener("DOMContentLoaded", arguments.callee, false);
6
+ linkList = document.links;
7
+ for (i in linkList) {
8
+ if (!!linkList[i].hash) {
9
+ if (linkList[i].hash.match(/^#./)) {
10
+ if ((URI + linkList[i].hash) == linkList[i].href) {
11
+ linkList[i].addEventListener("click", function (e, f, g) {
12
+ f = document.getElementById(this.hash.slice(1));
13
+ if (!(g = f.getAttribute('tabIndex'))) f.setAttribute('tabIndex', -1);
14
+ f.focus();
15
+ if (!g) f.removeAttribute('tabIndex');
16
+ }, false);
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }, false);
22
+ }
23
+ return true;
24
  })();
js/wpa.labels.js CHANGED
@@ -6,15 +6,17 @@
6
  } else {
7
  var field = $( 'input[name=' + value + ']' );
8
  }
9
- var form_id = field.attr( 'id' );
 
10
  if ( form_id ) {
11
  var label = $( 'label[for=' + form_id + ']' );
12
- var implicit = $( field ).parent( 'label' );
13
  if ( !label.length && !implicit.length ) {
14
  field.before( "<label for='" + form_id + "' class='wpa-screen-reader-text'>" + wpalabels[value] + "</label>" );
15
  }
16
  } else {
17
- field.attr( 'id', 'wpa_label_' + value ).before( "<label for='wpa_label_" + value + "' class='wpa-screen-reader-text'>" + wpalabels[value] + "</label>" );
18
- }
 
 
19
  });
20
  }(jQuery));
6
  } else {
7
  var field = $( 'input[name=' + value + ']' );
8
  }
9
+ var form_id = field.attr( 'id' );
10
+ var implicit = $( field ).parent( 'label' );
11
  if ( form_id ) {
12
  var label = $( 'label[for=' + form_id + ']' );
 
13
  if ( !label.length && !implicit.length ) {
14
  field.before( "<label for='" + form_id + "' class='wpa-screen-reader-text'>" + wpalabels[value] + "</label>" );
15
  }
16
  } else {
17
+ if ( !implicit.length ) {
18
+ field.attr( 'id', 'wpa_label_' + value ).before( "<label for='wpa_label_" + value + "' class='wpa-screen-reader-text'>" + wpalabels[value] + "</label>" );
19
+ }
20
+ }
21
  });
22
  }(jQuery));
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://www.joedolson.com/donate/
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
5
  Requires at least: 3.4.2
6
  Requires PHP: 5.3
7
- Tested up to: 5.0
8
- Stable tag: 1.6.5
9
  Text Domain: wp-accessibility
10
  License: GPLv2 or later
11
 
@@ -65,6 +65,13 @@ The plug-in is intended to help with deficiencies commonly found in themes and t
65
  [Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
66
  * Conflict with NextGen gallery to explore
67
 
 
 
 
 
 
 
 
68
  = 1.6.5 =
69
 
70
  * Bug fix: Widget output should not be styled.
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus, alt text, labels, aria
5
  Requires at least: 3.4.2
6
  Requires PHP: 5.3
7
+ Tested up to: 5.1
8
+ Stable tag: 1.6.6
9
  Text Domain: wp-accessibility
10
  License: GPLv2 or later
11
 
65
  [Suggest a change!](https://github.com/joedolson/wp-accessibility/issues/)
66
  * Conflict with NextGen gallery to explore
67
 
68
+ = 1.6.6 =
69
+
70
+ * Per request, remove font sizing declaration for skip links. Inherit from site.
71
+ * Add default styles for visible skiplinks, rather than allowing to be unstyled.
72
+ * Remove tabindex application on section element from toolbar JS. (Not sure why it was there anyway.)
73
+ * Bug fix: automatic labeling injected double labels on fields with no ID and an implicit label.
74
+
75
  = 1.6.5 =
76
 
77
  * Bug fix: Widget output should not be styled.
toolbar/js/a11y.js CHANGED
@@ -95,11 +95,4 @@ function eraseCookie(name) {
95
  return false;
96
  });
97
 
98
- // Sets a -1 tabindex to ALL sections for .focus()-ing
99
- var sections = document.getElementsByTagName("section");
100
- for (var i = 0, max = sections.length; i < max; i++) {
101
- sections[i].setAttribute('tabindex', -1);
102
- sections[i].className += ' focusable';
103
- }
104
-
105
  } )( jQuery );
95
  return false;
96
  });
97
 
 
 
 
 
 
 
 
98
  } )( jQuery );
wp-accessibility-settings.php CHANGED
@@ -524,6 +524,16 @@ function wpa_admin_settings() {
524
  </form>
525
  </div>
526
  </div>
 
 
 
 
 
 
 
 
 
 
527
  <div class="postbox" id="get-support">
528
  <h2 class='hndle'><?php _e( 'Get Plug-in Support', 'wp-accessibility' ); ?></h2>
529
 
524
  </form>
525
  </div>
526
  </div>
527
+ <div class="postbox" id="privacy">
528
+ <h2 class='hndle'><?php _e( 'Privacy', 'wp-accessibility' ); ?></h2>
529
+
530
+ <div class="inside">
531
+ <h3><?php _e( 'Cookies', 'wp-accessibility' ); ?></h3>
532
+ <p><?php _e( 'The accessibility toolbar sets cookies to maintain awareness of the user\'s selected accessibility options. If the toolbar is not in use, WP Accessibility does not set any cookies.', 'wp-accessibility' ); ?></p>
533
+ <h3><?php _e( 'Information Collected by WP Accessibility', 'wp-accessibility' ); ?></h3>
534
+ <p><?php _e( 'WP Accessibility does not collect any private information about users or visitors.', 'wp-accessibility' ); ?></p>
535
+ </div>
536
+ </div>
537
  <div class="postbox" id="get-support">
538
  <h2 class='hndle'><?php _e( 'Get Plug-in Support', 'wp-accessibility' ); ?></h2>
539
 
wp-accessibility.php CHANGED
@@ -17,7 +17,7 @@
17
  * Domain Path: /lang
18
  * License: GPL-2.0+
19
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
20
- * Version: 1.6.5
21
  */
22
 
23
  /*
@@ -68,7 +68,7 @@ function wpa_admin_menu() {
68
  * Install on activation.
69
  */
70
  function wpa_install() {
71
- $wpa_version = '1.6.5';
72
  if ( 'true' != get_option( 'wpa_installed' ) ) {
73
  add_option( 'rta_from_nav_menu', 'on' );
74
  add_option( 'rta_from_page_lists', 'on' );
@@ -251,27 +251,36 @@ function wpa_css() {
251
  if ( get_option( 'asl_enable' ) == 'on' ) {
252
  $focus = get_option( 'asl_styles_focus' );
253
  // these styles are derived from the WordPress skip link defaults.
254
- $default_focus = 'background-color: #f1f1f1; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto; color: #21759b; display: block; font-size: 14px; font-weight: bold; height: auto; line-height: normal; padding: 15px 23px 14px; position: absolute; left: 5px; top: 5px; text-decoration: none; text-transform: none; width: auto; z-index: 100000;';
 
 
 
 
255
  if ( ! $focus ) {
256
  $focus = $default_focus;
257
  } else {
258
  $focus = $default_focus . $focus;
259
  }
 
 
 
260
  $passive = get_option( 'asl_styles_passive' );
261
  $vis = '';
262
  $invis = '';
263
  // If links are visible, "hover" is a focus style, otherwise, it's a passive style.
264
  if ( 'on' == get_option( 'asl_visible' ) ) {
265
- $vis = '#skiplinks a:hover,';
 
266
  } else {
267
- $invis = '#skiplinks a:hover,';
 
268
  }
269
  $visibility = ( 'on' == get_option( 'asl_visible' ) ) ? 'wpa-visible' : 'wpa-hide';
270
  $is_rtl = ( is_rtl() ) ? '-rtl' : '-ltr';
271
  $class = '.' . $visibility . $is_rtl;
272
  $styles .= "
273
- $class#skiplinks a, $invis $class#skiplinks a:visited { $passive }
274
- $class#skiplinks a:active, $vis $class#skiplinks a:focus { $focus }
275
  ";
276
  }
277
  if ( 'on' == get_option( 'wpa_focus' ) ) {
@@ -619,7 +628,7 @@ $plugins_string
619
  if ( ! $has_read_faq ) {
620
  echo "<div class='message error'><p>" . __( 'Please read the FAQ and other Help documents before making a support request.', 'wp-accessibility' ) . '</p></div>';
621
  } elseif ( ! $request ) {
622
- echo "<div class='message error'><p>" . __( 'Please describe your problem. I\'m not psychic.', 'wp-accessibility' ) . '</p></div>';
623
  } else {
624
  wp_mail( 'plugins@joedolson.com', $subject, $message, $from );
625
  if ( 'Donor' == $has_donated ) {
17
  * Domain Path: /lang
18
  * License: GPL-2.0+
19
  * License URI: http://www.gnu.org/license/gpl-2.0.txt
20
+ * Version: 1.6.6
21
  */
22
 
23
  /*
68
  * Install on activation.
69
  */
70
  function wpa_install() {
71
+ $wpa_version = '1.6.6';
72
  if ( 'true' != get_option( 'wpa_installed' ) ) {
73
  add_option( 'rta_from_nav_menu', 'on' );
74
  add_option( 'rta_from_page_lists', 'on' );
251
  if ( get_option( 'asl_enable' ) == 'on' ) {
252
  $focus = get_option( 'asl_styles_focus' );
253
  // these styles are derived from the WordPress skip link defaults.
254
+ $top = '7px';
255
+ if ( is_admin_bar_showing() ) {
256
+ $top = '37px';
257
+ }
258
+ $default_focus = 'background-color: #f1f1f1; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto; color: #0073aa; display: block; font-weight: 600; height: auto; line-height: normal; padding: 15px 23px 14px; position: absolute; left: 6px; top: ' . $top . '; text-decoration: none; text-transform: none; width: auto; z-index: 100000;';
259
  if ( ! $focus ) {
260
  $focus = $default_focus;
261
  } else {
262
  $focus = $default_focus . $focus;
263
  }
264
+ // Passive default styles derived from WordPress default focus styles.
265
+ $default_passive = 'background-color: #fff; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.2); clip: auto; color: #333; display: block; font-weight: 600; height: auto; line-height: normal; padding: 15px 23px 14px; position: absolute; left: 6px; top: ' . $top . '; text-decoration: none; text-transform: none; width: auto; z-index: 100000;';
266
+
267
  $passive = get_option( 'asl_styles_passive' );
268
  $vis = '';
269
  $invis = '';
270
  // If links are visible, "hover" is a focus style, otherwise, it's a passive style.
271
  if ( 'on' == get_option( 'asl_visible' ) ) {
272
+ $vis = '#skiplinks a:hover,';
273
+ $passive = $default_passive . $passive;
274
  } else {
275
+ $invis = '#skiplinks a:hover,';
276
+ $passive = '';
277
  }
278
  $visibility = ( 'on' == get_option( 'asl_visible' ) ) ? 'wpa-visible' : 'wpa-hide';
279
  $is_rtl = ( is_rtl() ) ? '-rtl' : '-ltr';
280
  $class = '.' . $visibility . $is_rtl;
281
  $styles .= "
282
+ $class#skiplinks a, $class$invis $class#skiplinks a:visited { $passive }
283
+ $class#skiplinks a:active, $class$vis $class#skiplinks a:focus { $focus }
284
  ";
285
  }
286
  if ( 'on' == get_option( 'wpa_focus' ) ) {
628
  if ( ! $has_read_faq ) {
629
  echo "<div class='message error'><p>" . __( 'Please read the FAQ and other Help documents before making a support request.', 'wp-accessibility' ) . '</p></div>';
630
  } elseif ( ! $request ) {
631
+ echo "<div class='message error'><p>" . __( 'Please describe your problem.', 'wp-accessibility' ) . '</p></div>';
632
  } else {
633
  wp_mail( 'plugins@joedolson.com', $subject, $message, $from );
634
  if ( 'Donor' == $has_donated ) {