WP Accessibility - Version 1.2.6

Version Description

  • Truly hides grayscale option, not dependent on CSS.
  • Eliminates in-page anchor focusing, due to conflicts with plug-ins that attach scripts to links with hashes.
  • Remove row action visibility from default admin stylesheet, due to 3.7 changes making those links keyboard accessible.
  • Added row actions always visible option.
Download this release

Release Info

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

Code changes from version 1.2.5 to 1.2.6

diagnostic-head.css CHANGED
@@ -15,7 +15,6 @@ body:before { content: "Currently viewing with diagnostic CSS enabled."; display
15
  background-color: lightyellow !important;
16
  }
17
 
18
-
19
  /*
20
  title element: not empty, unique and in head
21
  */
15
  background-color: lightyellow !important;
16
  }
17
 
 
18
  /*
19
  title element: not empty, unique and in head
20
  */
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: joedolson
3
  Donate link: http://www.joedolson.com/donate.php
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus
5
  Requires at least: 3.4.2
6
- Tested up to: 3.6.0
7
  Stable tag: 1.2.5
8
  License: GPLv2 or later
9
 
@@ -15,24 +15,32 @@ This plug-in helps correct a variety of common accessibility problems in WordPre
15
 
16
  All features can be disabled according to your theme's needs. For advanced users, all of the functions based on modifying stylesheets can be customized using your own custom styles by placing the appropriate stylesheet in your theme directory.
17
 
18
- At the moment, the plug-in can:
19
 
20
- * Remove redundant title attributes from page lists, category lists, and archive menus.
21
  * Enable skip links with WebKit support by enqueuing JavaScript support for moving keyboard focus.
22
  * Add skip links with user-defined targets. (Customizable targets and appearance.)
23
  * Add language and text direction attributes to your HTML attribute
 
 
 
 
 
24
  * Remove the target attribute from links.
25
  * Force a search page error when a search is made with an empty text string. (If your theme has a search.php template.)
26
  * Remove tabindex from elements that are focusable.
27
  * Strip title attributes from images inserted into content.
 
28
  * Add post titles to standard "read more" links.
29
- * Add an outline to the keyboard focus state for focusable elements.
30
- * Add a toolbar toggling between high contrast, large print, and desaturated (grayscale) views of your theme.
31
- * Fix certain accessibility issues in the WordPress admin styles
 
32
  * Show the color contrast between two provided hexadecimal color values.
33
- * Read more about <a href="http://make.wordpress.org/accessibility/wp-accessibility-plugin/">the accessibility problems corrected</a>
34
 
35
- The plug-in is intended to make up for some deficiencies commonly found in themes. It can't correct every problem (by a long shot), but can provide some assistance.
 
 
36
 
37
  Translating my plug-ins is always appreciated. Visit <a href="http://translate.joedolson.com">my translations site</a> to start getting your language into shape!
38
 
@@ -49,6 +57,13 @@ Visit the [WP Accessibility translations site](http://translate.joedolson.com/pr
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
 
52
  = 1.2.5 =
53
 
54
  * Added Spanish translation.
3
  Donate link: http://www.joedolson.com/donate.php
4
  Tags: title, accessibility, accessible, navigation, wcag, a11y, section508, focus
5
  Requires at least: 3.4.2
6
+ Tested up to: 3.7.1
7
  Stable tag: 1.2.5
8
  License: GPLv2 or later
9
 
15
 
16
  All features can be disabled according to your theme's needs. For advanced users, all of the functions based on modifying stylesheets can be customized using your own custom styles by placing the appropriate stylesheet in your theme directory.
17
 
18
+ Accessibility Features provided by WP Accessibility:
19
 
 
20
  * Enable skip links with WebKit support by enqueuing JavaScript support for moving keyboard focus.
21
  * Add skip links with user-defined targets. (Customizable targets and appearance.)
22
  * Add language and text direction attributes to your HTML attribute
23
+ * Add an outline to the keyboard focus state for focusable elements.
24
+ * Add a toolbar toggling between high contrast, large print, and desaturated (grayscale) views of your theme.
25
+
26
+ Accessibility Issues fixed by WP Accessibility:
27
+
28
  * Remove the target attribute from links.
29
  * Force a search page error when a search is made with an empty text string. (If your theme has a search.php template.)
30
  * Remove tabindex from elements that are focusable.
31
  * Strip title attributes from images inserted into content.
32
+ * Remove redundant title attributes from page lists, category lists, and archive menus.
33
  * Add post titles to standard "read more" links.
34
+ * Fix some accessibility issues in the WordPress admin styles
35
+
36
+ Accessibility Tools built into WP Accessibility:
37
+
38
  * Show the color contrast between two provided hexadecimal color values.
39
+ * Enable diagnostic CSS to show CSS-detectable problems in visual editor or on front-end of site.
40
 
41
+ Learn more! <a href="http://make.wordpress.org/accessibility/wp-accessibility-plugin/">Read about the accessibility issues corrected</a> by WP Accessibility!
42
+
43
+ The plug-in is intended to help with deficiencies commonly found in themes and to solve some issues in WordPress core. It can't correct every problem (by a long shot), but provides tools to fix some issues, supplement the accessibility of your site, or identify problems.
44
 
45
  Translating my plug-ins is always appreciated. Visit <a href="http://translate.joedolson.com">my translations site</a> to start getting your language into shape!
46
 
57
 
58
  == Changelog ==
59
 
60
+ = 1.2.6 =
61
+
62
+ * Truly hides grayscale option, not dependent on CSS.
63
+ * Eliminates in-page anchor focusing, due to conflicts with plug-ins that attach scripts to links with hashes.
64
+ * Remove row action visibility from default admin stylesheet, due to 3.7 changes making those links keyboard accessible.
65
+ * Added row actions always visible option.
66
+
67
  = 1.2.5 =
68
 
69
  * Added Spanish translation.
toolbar/js/a11y.js CHANGED
@@ -113,16 +113,17 @@ jQuery(document).ready(function($) {
113
  }, 100);
114
  }
115
 
116
- // Focuses on the correct section of the page if we're page linking
117
  // Thanks to WebAIM.org for this idea
118
  // does not support 'name' targets
 
119
  $('a[href^="#"]').click(function(event) {
120
  var inPageAnchor = "#" + this.href.split('#')[1];
121
-
122
  $(inPageAnchor).scrollTo({ duration: 1000 });
123
  setTimeout(function() {
124
  $(inPageAnchor).focus();
125
  }, 100);
126
  return false;
127
  });
 
128
  });
113
  }, 100);
114
  }
115
 
116
+ // Focuses on the correct section of the page if we're in-page linking
117
  // Thanks to WebAIM.org for this idea
118
  // does not support 'name' targets
119
+ /* Removed, because it conflicts with many other plug-ins.
120
  $('a[href^="#"]').click(function(event) {
121
  var inPageAnchor = "#" + this.href.split('#')[1];
 
122
  $(inPageAnchor).scrollTo({ duration: 1000 });
123
  setTimeout(function() {
124
  $(inPageAnchor).focus();
125
  }, 100);
126
  return false;
127
  });
128
+ */
129
  });
wp-accessibility.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Accessibility
4
  Plugin URI: http://www.joedolson.com/articles/wp-accessibility/
5
  Description: Provides options to improve accessibility in your WordPress site, including removing title attributes.
6
- Version: 1.2.5
7
  Author: Joe Dolson
8
  Author URI: http://www.joedolson.com/
9
 
@@ -36,7 +36,7 @@ function add_wpa_admin_menu() {
36
 
37
  // ACTIVATION
38
  function wpa_install() {
39
- $wpa_version = '1.2.5';
40
  if ( get_option('wpa_installed') != 'true' ) {
41
  add_option('rta_from_nav_menu', 'on');
42
  add_option('rta_from_page_lists', 'on');
@@ -93,6 +93,15 @@ function wpa_admin_stylesheet() {
93
  wp_register_style( 'wp-a11y-css', $file );
94
  wp_enqueue_style( 'wp-a11y-css' );
95
  }
 
 
 
 
 
 
 
 
 
96
  }
97
  function wpa_admin_js() {} // just a placeholder
98
 
@@ -170,8 +179,12 @@ echo
170
  var insert_a11y_toolbar = '<!-- a11y toolbar -->';
171
  insert_a11y_toolbar += '<div class=\"a11y-toolbar\">';
172
  insert_a11y_toolbar += '<ul>';
173
- insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-contrast toggle-contrast\" id=\"is_normal_contrast\" title=\"$contrast\"><span class=\"offscreen\">$contrast</span><i class=\"icon icon-adjust\"></i></a></li>';
174
- insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-grayscale toggle-grayscale\" id=\"is_normal_color\" title=\"$grayscale\"><span class=\"offscreen\">$grayscale</span><i class=\"icon icon-tint\"></i></a></li>';
 
 
 
 
175
  insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-fontsize toggle-fontsize\" id=\"is_normal_fontsize\" title=\"$fontsize\"><span class=\"offscreen\">$fontsize</span><i class=\"icon icon-font\"></i></a></li>';
176
  insert_a11y_toolbar += '</ul>';
177
  insert_a11y_toolbar += '</div>';
@@ -199,10 +212,6 @@ function wpa_css() {
199
  #skiplinks a:active, $vis #skiplinks a:focus { $focus }
200
  ";
201
  }
202
- $enable_grayscale = ( get_option('wpa_toolbar_gs') == 'on' )?true:false;
203
- if ( get_option( 'wpa_toolbar' ) == 'on' && !$enable_grayscale ) {
204
- $styles .= ".a11y-toolbar ul li:nth-child(2) { display: none; }";
205
- }
206
  if ( get_option( 'wpa_focus' ) == 'on' ) {
207
  $color = ( get_option('wpa_focus_color') != '' )?" #".get_option('wpa_focus_color'):'';
208
  $styles .= "
@@ -463,6 +472,7 @@ function wpa_update_settings() {
463
  $wpa_toolbar = ( isset( $_POST['wpa_toolbar'] ) )?'on':'';
464
  $wpa_toolbar_gs = ( isset( $_POST['wpa_toolbar_gs'] ) )?'on':'';
465
  $wpa_admin_css = ( isset( $_POST['wpa_admin_css'] ) )?'on':'';
 
466
  $wpa_diagnostics = ( isset( $_POST['wpa_diagnostics'] ) )?'on':'';
467
  update_option('wpa_lang', $wpa_lang );
468
  update_option('wpa_target', $wpa_target );
@@ -476,6 +486,7 @@ function wpa_update_settings() {
476
  update_option('wpa_focus_color', $wpa_focus_color );
477
  update_option('wpa_continue', $wpa_continue );
478
  update_option('wpa_admin_css', $wpa_admin_css );
 
479
  update_option('wpa_diagnostics', $wpa_diagnostics );
480
  $message = __("Miscellaneous Accessibility Settings Updated",'wp-accessibility');
481
  return "<div class='updated'><p>".$message."</p></div>";
@@ -630,6 +641,7 @@ function wpa_admin_menu() { ?>
630
  <li><input type="checkbox" id="wpa_search" name="wpa_search" <?php if ( get_option('wpa_search') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_search"><?php _e('Force search error on empty search submission (theme must have search.php template)','wp-accessibility'); ?></label></li>
631
  <li><input type="checkbox" id="wpa_tabindex" name="wpa_tabindex" <?php if ( get_option('wpa_tabindex') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_tabindex"><?php _e('Remove tabindex from focusable elements','wp-accessibility'); ?></label></li>
632
  <li><input type="checkbox" id="wpa_admin_css" name="wpa_admin_css" <?php if ( get_option('wpa_admin_css') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_admin_css"><?php _e('Enable WordPress Admin stylesheet','wp-accessibility'); ?></label></li>
 
633
  <li><input type="checkbox" id="wpa_image_titles" name="wpa_image_titles" <?php if ( get_option('wpa_image_titles') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_image_titles"><?php _e('Remove title attribute from images inserted into post content and featured images.','wp-accessibility'); ?></label></li>
634
  <li><input type="checkbox" id="wpa_toolbar" name="wpa_toolbar" <?php if ( get_option('wpa_toolbar') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar"><?php _e('Add Accessibility toolbar with fontsize adjustment and contrast toggle','wp-accessibility'); ?></label></li>
635
  <li><input type="checkbox" id="wpa_toolbar_gs" name="wpa_toolbar_gs" <?php if ( get_option('wpa_toolbar_gs') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar_gs"><?php _e('Include grayscale toggle with Accessibility toolbar','wp-accessibility'); ?></label></li>
@@ -729,7 +741,7 @@ if ( $l_contrast ) {
729
  </p>
730
  <p><?php _e("If you've found WP Accessibility useful, then please consider <a href='http://wordpress.org/extend/plugins/wp-accessibility/'>rating it five stars</a>, <a href='http://www.joedolson.com/donate.php'>making a donation</a>, or <a href='http://translate.joedolson.com/projects/wp-accessibility'>helping with translation</a>.",'wp-accessibility'); ?></p>
731
  <div>
732
- <p><?php _e('<a href="http://www.joedolson.com/donate.php">Make a donation today!</a> Every donation counts - donate $2, $10, or $100 and help me keep this plug-in running!','wp-to-twitter'); ?></p>
733
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
734
  <div>
735
  <input type="hidden" name="cmd" value="_s-xclick" />
3
  Plugin Name: WP Accessibility
4
  Plugin URI: http://www.joedolson.com/articles/wp-accessibility/
5
  Description: Provides options to improve accessibility in your WordPress site, including removing title attributes.
6
+ Version: 1.2.6
7
  Author: Joe Dolson
8
  Author URI: http://www.joedolson.com/
9
 
36
 
37
  // ACTIVATION
38
  function wpa_install() {
39
+ $wpa_version = '1.2.6';
40
  if ( get_option('wpa_installed') != 'true' ) {
41
  add_option('rta_from_nav_menu', 'on');
42
  add_option('rta_from_page_lists', 'on');
93
  wp_register_style( 'wp-a11y-css', $file );
94
  wp_enqueue_style( 'wp-a11y-css' );
95
  }
96
+ if ( get_option( 'wpa_row_actions' ) == 'on' ) {
97
+ if ( file_exists( get_stylesheet_directory() . '/wp-admin-row-actions.css' ) ) {
98
+ $file = get_stylesheet_directory_uri() . '/wp-admin-row-actions.css';
99
+ } else {
100
+ $file = plugins_url('wp-admin-row-actions.css', __FILE__);
101
+ }
102
+ wp_register_style( 'wp-row-actions', $file );
103
+ wp_enqueue_style( 'wp-row-actions' );
104
+ }
105
  }
106
  function wpa_admin_js() {} // just a placeholder
107
 
179
  var insert_a11y_toolbar = '<!-- a11y toolbar -->';
180
  insert_a11y_toolbar += '<div class=\"a11y-toolbar\">';
181
  insert_a11y_toolbar += '<ul>';
182
+ insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-contrast toggle-contrast\" id=\"is_normal_contrast\" title=\"$contrast\"><span class=\"offscreen\">$contrast</span><i class=\"icon icon-adjust\"></i></a></li>';";
183
+ $enable_grayscale = ( get_option('wpa_toolbar_gs') == 'on' )?true:false;
184
+ if ( get_option( 'wpa_toolbar' ) == 'on' && $enable_grayscale ) {
185
+ echo "insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-grayscale toggle-grayscale\" id=\"is_normal_color\" title=\"$grayscale\"><span class=\"offscreen\">$grayscale</span><i class=\"icon icon-tint\"></i></a></li>';";
186
+ }
187
+ echo "
188
  insert_a11y_toolbar += '<li><a href=\"#\" class=\"a11y-toggle-fontsize toggle-fontsize\" id=\"is_normal_fontsize\" title=\"$fontsize\"><span class=\"offscreen\">$fontsize</span><i class=\"icon icon-font\"></i></a></li>';
189
  insert_a11y_toolbar += '</ul>';
190
  insert_a11y_toolbar += '</div>';
212
  #skiplinks a:active, $vis #skiplinks a:focus { $focus }
213
  ";
214
  }
 
 
 
 
215
  if ( get_option( 'wpa_focus' ) == 'on' ) {
216
  $color = ( get_option('wpa_focus_color') != '' )?" #".get_option('wpa_focus_color'):'';
217
  $styles .= "
472
  $wpa_toolbar = ( isset( $_POST['wpa_toolbar'] ) )?'on':'';
473
  $wpa_toolbar_gs = ( isset( $_POST['wpa_toolbar_gs'] ) )?'on':'';
474
  $wpa_admin_css = ( isset( $_POST['wpa_admin_css'] ) )?'on':'';
475
+ $wpa_row_actions = ( isset( $_POST['wpa_row_actions'] ) ) ? 'on' : '';
476
  $wpa_diagnostics = ( isset( $_POST['wpa_diagnostics'] ) )?'on':'';
477
  update_option('wpa_lang', $wpa_lang );
478
  update_option('wpa_target', $wpa_target );
486
  update_option('wpa_focus_color', $wpa_focus_color );
487
  update_option('wpa_continue', $wpa_continue );
488
  update_option('wpa_admin_css', $wpa_admin_css );
489
+ update_option( 'wpa_row_actions', $wpa_row_actions );
490
  update_option('wpa_diagnostics', $wpa_diagnostics );
491
  $message = __("Miscellaneous Accessibility Settings Updated",'wp-accessibility');
492
  return "<div class='updated'><p>".$message."</p></div>";
641
  <li><input type="checkbox" id="wpa_search" name="wpa_search" <?php if ( get_option('wpa_search') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_search"><?php _e('Force search error on empty search submission (theme must have search.php template)','wp-accessibility'); ?></label></li>
642
  <li><input type="checkbox" id="wpa_tabindex" name="wpa_tabindex" <?php if ( get_option('wpa_tabindex') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_tabindex"><?php _e('Remove tabindex from focusable elements','wp-accessibility'); ?></label></li>
643
  <li><input type="checkbox" id="wpa_admin_css" name="wpa_admin_css" <?php if ( get_option('wpa_admin_css') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_admin_css"><?php _e('Enable WordPress Admin stylesheet','wp-accessibility'); ?></label></li>
644
+ <li><input type="checkbox" id="wpa_row_actions" name="wpa_row_actions" <?php if ( get_option('wpa_row_actions') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_row_actions"><?php _e('Make row actions always visible','wp-accessibility'); ?></label></li>
645
  <li><input type="checkbox" id="wpa_image_titles" name="wpa_image_titles" <?php if ( get_option('wpa_image_titles') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_image_titles"><?php _e('Remove title attribute from images inserted into post content and featured images.','wp-accessibility'); ?></label></li>
646
  <li><input type="checkbox" id="wpa_toolbar" name="wpa_toolbar" <?php if ( get_option('wpa_toolbar') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar"><?php _e('Add Accessibility toolbar with fontsize adjustment and contrast toggle','wp-accessibility'); ?></label></li>
647
  <li><input type="checkbox" id="wpa_toolbar_gs" name="wpa_toolbar_gs" <?php if ( get_option('wpa_toolbar_gs') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar_gs"><?php _e('Include grayscale toggle with Accessibility toolbar','wp-accessibility'); ?></label></li>
741
  </p>
742
  <p><?php _e("If you've found WP Accessibility useful, then please consider <a href='http://wordpress.org/extend/plugins/wp-accessibility/'>rating it five stars</a>, <a href='http://www.joedolson.com/donate.php'>making a donation</a>, or <a href='http://translate.joedolson.com/projects/wp-accessibility'>helping with translation</a>.",'wp-accessibility'); ?></p>
743
  <div>
744
+ <p><?php _e('<a href="http://www.joedolson.com/donate.php">Make a donation today!</a> Every donation counts - donate $5, $20, or $100 and help me keep this plug-in running!','wp-to-twitter'); ?></p>
745
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
746
  <div>
747
  <input type="hidden" name="cmd" value="_s-xclick" />
wp-admin-row-actions.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*
2
+ Make Row Actions permanently visible - provided by WP Accessibility / Joe Dolson
3
+ */
4
+ .row-actions { visibility: visible;}
5
+ .row-actions a { opacity: .8; }
6
+ .row-actions a:hover, .row-actions a:focus { opacity: 1; }
wp-admin.css CHANGED
@@ -2,11 +2,7 @@
2
 
3
  Custom Stylesheet provided by WP Accessibility (http://www.joedolson.com/articles/wp-accessibility/)
4
 
5
- */
6
- .row-actions { visibility: visible;}
7
- .row-actions a { opacity: .8; }
8
- .row-actions a:hover, .row-actions a:focus { opacity: 1; }
9
-
10
  a:hover, a:active {
11
  color: #d54e21;
12
  text-decoration: underline!important;
2
 
3
  Custom Stylesheet provided by WP Accessibility (http://www.joedolson.com/articles/wp-accessibility/)
4
 
5
+ */
 
 
 
 
6
  a:hover, a:active {
7
  color: #d54e21;
8
  text-decoration: underline!important;