Архив автора: admin

Доступность WordPress. Сделать ваш сайт доступным для всех

Интернет глубоко интегрирован в работу нашего мира, работая практически во всех секторах: от образования и политики до бизнеса и здравоохранения.

Когда вы просматриваете онлайн, вероятно, первое, что вы заметите на сайте, это его дизайн, за которым быстро следуют графика и элементы контента. Но вы, вероятно, не думаете о доступности WordPress.

Когда дело доходит до вашего бизнес-сайта, доступность должна стать более высоким приоритетом.

Итак, что такое доступность в WordPress?

Доступность WordPress относится к практике обеспечения доступности веб-сайта WordPress и его содержимого для всех пользователей, в том числе с ограниченными возможностями, особенно с нарушениями зрения.

Многие веб-сайты часто жертвуют доступностью WordPress для красивого дизайна. Хотя дизайн абсолютно важен, вы не хотите ставить под угрозу слишком много функций.

Как бренд, вы хотите обеспечить положительный пользовательский опыт для всех пользователей, в том числе с ограниченными возможностями. Кроме того, важно помнить, что проблемы доступности не ограничиваются только людьми с ограниченными возможностями.

Инициатива доступности веб-ресурсов указывает на то, что определенные изменения в дизайне вашего сайта могут принести пользу многим различным группам людей:

  • Люди, использующие устройства с маленькими экранами, различными режимами ввода и т. д.
  • Старшие
  • Люди с «временной нетрудоспособностью», включая сломанную конечность или потерянные очки
  • Пользователи с «ситуативными ограничениями», такие как те, кто получает доступ к веб-сайту в ярком месте или в среде, где они не могут слушать аудио
  • Люди, у которых медленное интернет-соединение

Почему вы должны заботиться о доступности WordPress

В то время как законодатели стремятся изменить и усовершенствовать законы для людей с ограниченными возможностями, важно опередить путь, для улучшения репутации.

Кроме того, есть SEO преимущества для доступности. Google и другие поставщики поисковых систем поощряют веб-сайты, отвечающие требованиям доступности, чтобы побудить большее количество веб-сайтов повысить свою доступность.

Сделать ваш сайт WordPress более доступным

В Руководстве по обеспечению доступности веб-материалов 2.0 (WCAG) представлен широкий спектр идей о доступности. Использование доступных тем WordPress может упростить процесс.

Однако, если вы хотите внести ограниченные изменения в свой текущий веб-сайт на WordPress, вы можете посмотреть с помощью плагина доступности WordPress, а также изменить цвета, контрастность, текст ALT изображения, заголовки содержимого, альтернативы текста и многое другое.

Установите плагин доступности WordPress

Самый простой первый шаг, который вы можете сделать, это установить и активировать плагин WP Accessibility. Хотя большинство проблем с доступностью невозможно решить без непосредственного изменения темы, плагин предлагает множество полезных функций, позволяющих идти по правильному пути благодаря доступности WordPress.

Среди его возможностей — возможность пропустить ссылки, которые являются внутренними ссылками на страницы, которые позволяют пользователям переходить непосредственно к контенту. Это особенно полезно для людей, использующих программы чтения с экрана. Он также позволяет добавить панель инструментов, которая позволяет пользователям с нарушениями зрения изменять размер шрифта, контрастность и оттенки серого на вашем сайте.

Кроме того, он удаляет атрибуты заголовка из изображений, вставленных в контент, который большинство программ чтения с экрана не могут идентифицировать, часто вместо этого читая текст привязки.

Цветовой контраст

В мире более 2,7 миллионов дальтоников. Эти люди имеют один из трех типов дальтонизма: полный дальтонизм, двухцветное зрение и плохое цветовое зрение. Чтобы быть уверенным в том, что дизайн вашего сайта работает с цветом или без него, учитывайте соотношение цветов и контрастность.

Используйте высококонтрастные варианты цвета, такие как черный и белый, чтобы сделать ваш сайт более читабельным. WCAG 2.0 рекомендует контрастность 4,5: 1 для основного текста. Если вашему веб-сайту все еще нужно немного больше стиля, вы можете использовать узоры или текстуры для дальнейшего увеличения контраста.

Изображение ALT-текста

Изображение ALT текста описывает внешний вид и функцию изображения на странице.

Первоначально он был разработан для повышения доступности, поскольку программы чтения с экрана не могут интерпретировать изображение без текста ALT. Однако с тех пор он использовался как часть стратегий SEO с целевыми ключевыми словами, которые должны быть идентифицированы поисковыми системами.

Если вы привыкли использовать ALT-текст для вставки ключевых слов в ваш сайт, вам нужно остановить или, по крайней мере, изменить свой процесс, так как это может испортить опыт людей, использующих программы чтения с экрана. К счастью, четкое описание изображения (если оно имеет отношение к тому, что вы делаете) все равно должно содержать полезные ключевые слова. В общем, никакой текст ALT не лучше, чем несущественный текст ALT.

Заголовки содержимого

Гораздо больше людей будут просматривать ваш контент, чем дословно читать его. Заголовки содержимого не только позволяют пользователям переходить к интересующим их частям, но также могут разбивать большие текстовые блоки на более читаемые разделы, помогая программам чтения экрана определять контекст каждого раздела.

Альтернативный текст

Если у вас есть мультимедийный веб-сайт, который содержит видео, а также аудиофайлы, такие как подкасты и аудиокниги, лучше всего включать субтитры или стенограммы. Это может помочь тем, кто является глухим, а также тем, кто находится в общественном месте и не в состоянии воспроизводить медиафайлы вслух, чтобы получить удовольствие.

Явные поля формы

При создании форм для вашего сайта может возникнуть соблазн разместить метки полей внутри поля в эстетических целях. Однако некоторые программы чтения с экрана не могут получить доступ к тексту, когда он находится внутри поля. Так что будьте проще и поместите метки формы вне полей формы.

Доступные ссылки и меню с клавиатуры

Есть некоторые люди, которые не могут получить доступ к веб-сайтам с помощью мыши из-за нарушений двигательных навыков. Они используют клавиатуру для навигации по сайтам, используя клавишу табуляции для перемещения вперед и Shift + Tab для возврата назад.

Проблема, которая чаще всего возникает у этих пользователей, заключается в том, что верхние элементы раскрывающегося меню доступны, а подменю — нет. Вы можете исправить это, назначив ярлыки или возможности доступа к клавишам. Например, нажав «1», вы попадете на домашнюю страницу, «2» — на страницу «О нас» и так далее.

Тест на доступность WordPress

Если вы не уверены в качестве вашей доступности WordPress, вы можете проверить ее.

Хотя инициатива доступности веб-сайтов не поддерживает какой-либо конкретный инструмент, вы можете найти список инструментов доступности на их сайте: https://www.w3.org/WAI/ER/tools/. Возьмите пару из них попробовать и посмотрите, как ваш сайт показывается. Расширение Google Chrome, инструмент оценки доступности веб-сайтов (WAVE) — это еще один способ оценки доступности вашего веб-сайта.

Примеры сайтов, хорошо делающих доступность

Есть много сайтов, которые были разработаны с осторожностью и пониманием доступности. Веб-сайт для зимних Олимпийских игр 2018 года в Пхенчхане является примером такого веб-сайта с двумя ошибками и 264 правильно помеченными элементами. Apple делает доступность лучше, получая только одну ошибку WAVE.

Заключительные мысли: доступность WordPress: сделать ваш сайт доступным для всех

Интернет глубоко укоренился почти в каждой части нашей жизни, от покупок и общения до организации встреч с работниками здравоохранения и работы. Беспрепятственно из-за инвалидности, подавляющему большинству пользователей легко принять само собой разумеющееся, с какой легкостью они могут перемещаться по Интернету.

Однако не только для того, чтобы опередить возможные изменения в законодательстве, но и просто для того, чтобы обеспечить лучший пользовательский опыт для всех ваших потенциальных посетителей, важно разрабатывать или изменять свой веб-сайт с учетом доступности. В дополнение к тому, что вы откроете свои двери для этих людей, вы также сможете пожинать плоды лучшего SEO, следуя рекомендациям по доступности, предоставляемым Web Content Accessibility.

Как вы включаете доступность в свои дизайны сайтов на WordPress? Дайте нам знать об этом в комментариях!



2018-12-18T04:24:20
Лучшие учебники по Wodpress

MikroTik Radius Configuration with FreeRADIUS and MySQL

FreeRADIUS is a modular RADIUS suite. A lot of modules such as Perl, python, MySQL etc. can be integrated with freeRADIUS to enrich freeRADIUS features. MySQL is one of the best user and client sources in freeRADIUS server. One of the important advantages of MySQL with freeRADIUS server is that MySQL can easily be controlled with a lot of programming languages including PHP. So, freeRADIUS users and their authentication, authorization and accounting can easily be controlled graphically using MySQL database and PHP language. In my previous article, I discussed how to install and configure freeRADIUS on CentOS 7 Linux distribution and how to configure MikroTik Radius to use freeRADIUS as a MikroTik RADIUS server. In this article, I will discuss how to configure freeRADIUS MySQL (freeradius-mysql package) module with MariaDB database.




MikroTik Router with FreeRADIUS and MySQL Server
MikroTik Router with FreeRADIUS and MySQL Server




FreeRADIUS with MySQL (MariaDB) Database




To work with MySQL database, freeRADIUS provides freeradius-mysql package that contains necessary configuration file and SQL queries. So, we have to install freeradius-mysql package with our freeradius server package. To check whether freeradius-mysql package is installed or not, login to your CentOS server with root user and issue the following command from your command prompt.




[root@freeradius ~]# rpm -qa | grep freeradius

 

freeradius-utils-3.0.13-9.el7_5.x86_64

freeradius-perl-3.0.13-9.el7_5.x86_64

freeradius-3.0.13-9.el7_5.x86_64

freeradius-mysql-3.0.13-9.el7_5.x86_64




The above list is showing that the freeradius-mysql package is installed with freeradius server. If you don’t find freeradius-mysql package in this list, issue the following command to install freeradius-mysql package.




[root@freeradius ~]# yum install freeradius-mysql -y




The freeradius-mysql package is now available in your system. In the next section, we will install and configure MariaDB database in our CentOS 7 Linux distribution.




MariaDB Database Installation and Configuration




MariaDB is a most popular and open source database server made by the original developers of MySQL notably Wikipedia, WordPress and Google developers. To install MariaDB database server in your CentOS Linux, enter the following command from your CentOS 7 terminal.




[root@freeradius ~]# yum install mariadb mariadb-server –y




MariaDB package will be installed within few seconds. To ensure it is installed successfully, issue the following command from command prompt.




[root@freeradius ~]# rpm -qa | grep mariadb

mariadb-server-5.5.60-1.el7_5.x86_64

mariadb-libs-5.5.60-1.el7_5.x86_64

mariadb-5.5.60-1.el7_5.x86_64




It is desired that you will find the above list. If so, start the MariaDB service and enable starting MariaDB service automatically on every reboot with the following command.




[root@freeradius ~]# systemctl start mariadb
[root@freeradius ~]# systemctl enable mariadb

 




You can check your MariaDB status at any time with the following command.




[root@freeradius ~]# systemctl status mariadb

 

  • mariadb.service – MariaDB database server

Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor et: disabled)

Active: active (running) since Thu 2018-12-13 18:11:15 EST; 1 day 8h ago

Process: 21380 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)

Process: 21348 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exite                                                                                                 d, status=0/SUCCESS)

Main PID: 21379 (mysqld_safe)

Tasks: 20

CGroup: /system.slice/mariadb.service

├─21379 /bin/sh /usr/bin/mysqld_safe –basedir=/usr

└─21542 /usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysq…




To allow remote access to your mysql (mariadb) server with third party application, you should allow mysql service (to open port 3306) from your firewall with the following command. Keep in mind this opens port 3306 to all IPs.




[root@freeradius ~]# firewall-cmd –zone=public –add-service=mysql
[root@freeradius ~]# firewall-cmd –zone=public –permanent  –add-service=mysql

 




Setup MySQL root Password




By default, MariaDB does not set root user password. But to secure mariadb, we have to setup root user password. To set root user password, run the following command from your terminal and follow the instructions.




[root@webserver~]# mysql_secure_installation 

 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current

password for the root user.  If you’ve just installed MySQL, and

you haven’t set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none):     ## Press Enter ##

OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

 

Set root password? [Y/n]     ## Press Enter ##

New password:                ## Enter new password ##

Re-enter new password:       ## Re-enter new password ##

Password updated successfully!

Reloading privilege tables..

… Success!

 

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n]     ## Press Enter ##

… Success!

 

Normally, root should only be allowed to connect from ‘localhost’.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n]     ## Press Enter ##

… Success!

By default, MySQL comes with a database named ‘test’ that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n]     ## Press Enter ##

– Dropping test database…

… Success!

– Removing privileges on test database…

… Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n]     ## Press Enter ##

… Success!

 

Cleaning up…

 

All done!  If you’ve completed all of the above steps, your MySQL

installation should now be secure.

 

Thanks for using MySQL!




Root user password has been set and your MariaDB database is secure now. If you wish to allow root login remotely, provide no at Disallow root login remotely? [Y/n] option.

Login to MariaDB server with root user password with the following command.


[root@freeradius ~]# mysql -uroot -pPasskey85

 

Welcome to the MariaDB monitor.  Commands end with ; or g.

Your MariaDB connection id is 9

Server version: 5.5.60-MariaDB MariaDB Server

 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

 

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.




After login you can see available databases with the following command.




MariaDB [(none)]> show databases;

 

+——————–+

| Database           |

+——————–+

| information_schema |

| mysql              |

| performance_schema |

+——————–+

3 rows in set (0.00 sec)




You will find the default database and schema. We will now create a new database that will be used by freeRADIUS server to get user information and to keep accounting information. Issue the following command to create a new database named radius in MariaDB database.




MariaDB [(none)]> create database radius;

 

Query OK, 1 row affected (0.00 sec)




Now you will find your created database in your database server.




MariaDB [(none)]> show databases;

 

+——————–+

| Database           |

+——————–+

| information_schema |

| mysql              |

| performance_schema |

| radius             |

+——————–+

4 rows in set (0.00 sec)




To logout from your database, just issue quit command.




MariaDB [(none)]> quit
Bye

 




After creating database, we need to create database tables that will be used by freeRADIUS server to find RADIUS users and clients and to store accounting data. Fortunately, freeRADIUS MySQL package provides necessary query to create required tables in schema.sql file. The schema.sql file will be found at mods-config/sql/main/mysql directory. So, execute the following command to create required tables in radius database.




[root@freeradius raddb]# mysql -uroot -pPasskey85 radius < mods-config/sql/main/mysql/schema.sql




After creating tables, we need to create a database user who will be able to read authentication and authorization data as well as will be able to write accounting data. FreeRADIUS MySQL package also provides the necessary query to create a database user and its permission in setup.sql. This file will also be found at mods-config/sql/main/mysql directory. So, issue the following command to create database user and to provide required permission.




[root@freeradius raddb]# mysql -uroot -pPasskey85 radius < mods-config/sql/main/mysql/setup.sql




The default username and password defined in setup.sql is radius and radpass respectively. If you wish, you can change this username and password by editing this file.




If you wish to see created tables in your database, login to MariaDB Server and select radius database and then issue following command.




[root@freeradius ~]# mysql -uroot -pPasskey85 radius
MariaDB [radius]> show tables;

 

+——————+

| Tables_in_radius |

+——————+

| nas              |

| radacct          |

| radcheck         |

| radgroupcheck    |

| radgroupreply    |

| radpostauth      |

| radreply         |

| radusergroup     |

+——————+

8 rows in set (0.00 sec)




You can also see the columns defined in a table with the following command.




MariaDB [radius]> show columns from nas;

 

+————-+————–+——+—–+—————+—————-+

| Field       | Type         | Null | Key | Default       | Extra          |

+————-+————–+——+—–+—————+—————-+

| id          | int(10)      | NO   | PRI | NULL          | auto_increment |

| nasname     | varchar(128) | NO   | MUL | NULL          |                |

| shortname   | varchar(32)  | YES  |     | NULL          |                |

| type        | varchar(30)  | YES  |     | other         |                |

| ports       | int(5)       | YES  |     | NULL          |                |

| secret      | varchar(60)  | NO   |     | secret        |                |

| server      | varchar(64)  | YES  |     | NULL          |                |

| community   | varchar(50)  | YES  |     | NULL          |                |

| description | varchar(200) | YES  |     | RADIUS Client |                |

+————-+————–+——+—–+—————+—————-+

9 rows in set (0.00 sec)




After creating database, database user and tables, we will now create a RADIUS user who will be authenticated and authorized. The radchek table keeps username and password of a user. So, issue the following command to create a radius user.




MariaDB [radius]> insert into radcheck (username,attribute,op,value) values(“bob”, “Cleartext-Password”, “:=”, “password”);




The radreply table keeps the authorization information of a user. As our created bob user will be used to login to MikroTik Router, we will assign his group permission after successful login with the following command.




MariaDB [radius]> insert into radreply (username,attribute,op,value) values(“bob”, “MikroTik-Group”, “:=”, “full”);




Now issue quit command to logout from database.




MariaDB [(none)]> quit
Bye

 




So, till now we have installed MariaDB database server, created database and necessary tables and then created a test user. Now we will configure freeRADIUS server so that freeRADIUS can query its user and client information from database server.




Configuring FreeRADIUS to use MySQL




After configuring database, it is time to configure freeRADIUS server so that it can use database server. MySQL database configuration is defined in sql file located in mods-available directory. So, open sql file and edit the following options in this file.




[root@freeradius raddb]# vim mods-available/sql

 

driver = “rlm_sql_mysql”

dialect = “mysql”

server = “localhost”

port = 3306

login = “radius”

password = “radpass”

read_clients = yes




If you change username (login) and password in setup.sql file, don’t forget to change here also. Now create softlink for sql modules in mods-enabled directory so that freeRADIUS treats mysql is an enabled module with the following commands.




[root@freeradius raddb]# cd mods-enabled/
[root@freeradius mods-enabled]#   ln -s ../mods-available/sql sql

 




MySQL module is now enabled. We will now configure active site to use MySQL.




Active Site Configuration to Support sql




After enabling MySQL module, it is time to configure active site to use MySQL. So, open sites-available/default file (I am using default site. If you use custom site, enable sql on your custom site at the following sections) and enable sql at the following sections.




[root@freeradius raddb]# vim sites-available/default




  • Uncomment the line containing sql in the authorize{} section.
  • Uncomment the line saying ‘sql’ in the accounting{} section to tell FreeRADIUS to store accounting records in SQL as well.
  • Add or uncomment ‘sql’ to the session{} section if you want to do Simultaneous-Use detection.
  • Add or uncomment ‘sql’ to the post-auth{} section if you want to log all Authentication attempts to SQL.
  • Add or uncomment ‘sql’ to the Post-Auth-Type REJECT{} section.




Additionally, edit sites-available/inner-tunnel and uncomment the line containing ‘sql’ under “authorize {}” section.




FreeRADIUS configuration to use MySQL has been completed. Now restart your freeRADIUS server to load MySQL module and test your freeRADIUS and MySQL configuration.




[root@freeradius raddb]# systemctl restart radiusd




FreeRADIUS with MySQL Testing




Localhost (127.0.0.1) is a default radius client for freeRADIUS Server. So, we can check freeRADIUS configuration with radtest program from localhost. Issue the following command to check bob user.




[root@freeradius raddb]# radtest bob  password 127.0.0.1 100 testing123

 

Sent Access-Request Id 229 from 0.0.0.0:42190 to 127.0.0.1:1812 length 76

User-Name = “bob”

User-Password = “password”

NAS-IP-Address = 192.168.40.10

NAS-Port = 100

Message-Authenticator = 0x00

Cleartext-Password = “password”

Received Access-Accept Id 229 from 127.0.0.1:1812 to 0.0.0.0:0 length 32

Mikrotik-Group = “full”




If everything is OK, you will find the above response from your radtest program. That means, freeRADIUS and MySQL module is working fine. We will now check this user from MikroTik Router.




MikroTik Router with freeRADIUS and MySQL Server




We will now add our MikroTik Router (IP: 192.168.40.8) as a NAS device and then verify our test user from MikroTik login. The nas table keeps the necessary information for a RADIUS client. So, login to MariaDB server and select radius database and then issue the following command to add MikroTik Router as a RADIUS client.




[root@freeradius ~]# mysql -uroot -pPasskey85 radius

 

MariaDB [radius]> insert into nas (nasname,shortname,type,ports,secret,server,community,description) values(‘192.168.40.8’, ‘mikrotik-client’, ‘other’, NULL,’Passkey@85′,NULL,NULL,’MikroTik Client Router’);

MariaDB [(none)]> quit

Bye




After inserting nas device, make sure to restart freeRADIUS server. Otherwise, RADIUS client information will not be updated.




[root@freeradius ~]# systemctl restart radiusd




How to configure MikroTik Radius to connect with freeRADIUS Server and how to configure MikroTik login with freeRADIUS user was discussed in my previous article. If you are a newbie in MikroTik with freeRADIUS Server, read carefully that article and test bob user from your MikroTik Login. If everything is OK, you will be able to login with database user from your login prompt.




In this article I just show how to install and configure freeRADIUS with MySQL(MariaDB) database. In the next article, I will show how to create user group in MySQL and apply user limitation groupwise.




If you face any confusion to follow above procedure properly, watch the below video about freeRADIUS MySQL module configuration. I hope it will reduce your any confusion.