Skip to content

Commit 35b622c

Browse files
author
Blake Bertuccelli
authored
Merge pull request #78 from bbertucc/mvp-1.2
MVP 1.2
2 parents 06e8539 + 4faa81f commit 35b622c

58 files changed

Lines changed: 3852 additions & 2386 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.DS_Store
22
.vscode
33
login/
4-
config.php
4+
config.php
5+
vendor/
6+
test/

README.md

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,54 @@
11
# Equalify the web!
22

3-
**96.8% of homepages are inaccessible**, according to [WebAIM](https://webaim.org/projects/million/).
3+
**96.8% of homepages have WCAG conformance failures,** according to [WebAIM](https://webaim.org/projects/million/).
44

5-
That statistic is unacceptable.
6-
7-
Everyone should have access to online information.
5+
The internet must become more accessible!
86

97
## Support Equalify
108

11-
⭐ Star the repo to show your support.
12-
13-
⬇️ [Download and use](https://github.com/bbertucc/equalify#download-and-use) Equalify.
9+
**Star the repo** to show your support.
1410

15-
🛠️ Contribute with a pull request or [new issue](https://github.com/bbertucc/equalify/issues).
11+
🌸 **Try our managed service**, [equalify.app](https://equalify.app/).
1612

17-
## How will Equalify increase accessibility?
13+
🛠️ **Contribute a pull request** or [new issue](https://github.com/bbertucc/equalify/issues).
1814

19-
Equalify creates deep integrations with services that run your website.
15+
🎩 **[Donate](https://equalify.app/donate/)** to Equalify.
2016

21-
Imagine: You solve A11Y issues at their source - be that source the server or a CMS.
17+
## How will Equalify increase content accessibility?
2218

23-
Equalify will become your WebOps hub, designed to solve any accessibility issue.
19+
Equalify aims to:
20+
1. **Promote transparency** with a Open Source A11Y platform (✅ Done!).
21+
2. **Reduce the cost** of multi-page website scans (ongoing).
22+
3. **Improve automation** to simplify WCAG issue resolution (2023).
2423

25-
<img width="1375" alt="A screenshot of Equalify's Integrations page." src="https://user-images.githubusercontent.com/46652/185225047-9c1c2e0f-4c4d-490b-a253-f3172710f1b0.png">
24+
We will tackle these goals by integrating with existing web services, making Equalify your WebOps hub.
2625

26+
![equalify-integrations](https://user-images.githubusercontent.com/46652/188710874-e53ccb85-f542-46f3-a680-837aaf02ae92.png)
2727

2828
## What does Equalify currently do?
2929

30-
The app currently scans pages for WCAG errors.
31-
32-
Equalify supports [Little Forest](https://littleforest.co.uk/feature/web-accessibility/), a free WCAG 2.1 scan, and the popular [WAVE scan](https://wave.webaim.org/).
30+
The app currently scans websites for WCAG errors.
3331

34-
After selecting an integration, import any site.
32+
You can import pages from WordPress, XML sitemaps, and single URLs. Equalify then crawls all your pages for WCAG 2.1 errors using the popular [WAVE scan](https://wave.webaim.org/).
3533

36-
The app imports pages from XML sitemaps, the WordPress API, and single URLs.
34+
Every alert is reported on a filterable dashboard.
3735

38-
After all your pages are added, click "Scan" and Equalify reports WCAG errors as they are found.
39-
40-
The goal: **Equalify every website.**
41-
42-
![equalify-screenshot-1](https://user-images.githubusercontent.com/46652/185225467-de1114fc-8f96-4b41-8365-897de3b55d5f.png)
36+
![equalify-alerts](https://user-images.githubusercontent.com/46652/188710908-9bfb7da8-68ff-490c-8d6b-f9ce1f38d4c8.png)
4337

4438
## Download and Use
4539
1. Download or clone [the latest release](https://github.com/bbertucc/equalify/releases).
4640
2. Change `sample-config.php` to `config.php` and update info.
47-
3. Upload/run on a Linux server (PHP 8 + MySQL required).
48-
4. Report [issues](https://github.com/bbertucc/equalify/issues), questions, and patches.
49-
5. Checkout our [demo video](https://www.youtube.com/watch?v=yrsG32G3I0g) for usage tips.
50-
6. Report [issues](https://github.com/bbertucc/equalify/issues), questions, and patches.
41+
3. Run `composer install` to install Composer dependencies.
42+
4. Upload/run on a Linux server (PHP 8 + MySQL required).
43+
5. Report [issues](https://github.com/bbertucc/equalify/issues), questions, and patches.
5144

52-
Not a technical user? Signup for our early access program at [equalify.app](https://equalify.app/).
45+
**Not a technical user?** Use Equalify now at [equalify.app](https://equalify.app/).
5346

5447
## Special Thanks
55-
A chaos wizard 🧙 and many brilliant brains help Equalify. Special shoutout to [Pantheon](https://pantheon.io/) and [Little Forest](https://littleforest.co.uk/feature/web-accessibility/) for providing funding for Drupalcon tickets and other great resources that help this project grow. Yi, Kate, Bill, Dash, Sylvia, Anne, Doug, Matt, Nathan, and John- You are the braintrust behind any great idea. Brad- You push me to code better. [@ebertucc](https://github.com/ebertucc) and [@jrchamp](https://github.com/jrchamp)- I consider y'all first contributors - woot woot! & Grace- You are the 🔥 behind everything I do.
48+
A chaos wizard 🧙 and many brilliant brains help Equalify. Special shoutout to [Pantheon](https://pantheon.io/) and [Little Forest](https://littleforest.co.uk/feature/web-accessibility/) for providing funding for [bounties](https://github.com/bbertucc/equalify/issues?q=is%3Aopen+is%3Aissue+label%3Abountied). Yi, Kate, Bill, Dash, Sylvia, Anne, Doug, Matt, Nathan, and John- You are the brains behind any great idea. Brad- You push me to code better. [@ebertucc](https://github.com/ebertucc) and [@jrchamp](https://github.com/jrchamp) are the project's first contributors - woot woot! [Guzzle](https://github.com/guzzle/guzzle) makes multiple concurrent scans possible. [Composer](https://getcomposer.org/) makes Guzzle possible.
5649

57-
This project is Open Source to inspire new collaborations.
50+
This project is Open Source under [AGPL](https://github.com/bbertucc/equalify/blob/mvp-1.2/LICENSE) to inspire new collaborations.
5851

5952
Together, **we can equalify the internet**.
6053

6154
-[@bbertucc](https://github.com/bbertucc)
62-
63-
PS: For more information on the notions behind Equalify, see my [Ethical Business Notion page](https://bbertucc.notion.site/Ethical-Business-7d8cb00d2e5f4558998450d6e38a61b6).

actions/activate_alert.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**************!!EQUALIFY IS FOR EVERYONE!!***************
3+
* This document activates an alert.
4+
*
5+
* As always, we must remember that every function should
6+
* be designed to be as efficient as possible so that
7+
* Equalify works for everyone.
8+
**********************************************************/
9+
10+
// Info on DB must be declared to use db.php models.
11+
require_once '../config.php';
12+
require_once '../models/db.php';
13+
14+
// Let's get the ID that powers this action.
15+
$id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);
16+
if(empty($id))
17+
throw new Exception(
18+
'ID "'.$id.'" is invalid or missing'
19+
);
20+
21+
// We will redirect back to a specified to a preset.
22+
$preset = '';
23+
if (isset($_GET['preset']))
24+
$preset = '&preset='.$_GET['preset'];
25+
26+
// Set the entry to "active".
27+
$alert_arguments = array(
28+
array(
29+
30+
// What else? You can add arrays if you
31+
// want.
32+
'name' => 'status',
33+
'value'=> 'active'
34+
35+
)
36+
);
37+
DataAccess::update_db_entry(
38+
'alerts', $id, $alert_arguments
39+
);
40+
41+
// If a "referrer" session was create
42+
header('Location: ../index.php?view=alerts'.$preset);

actions/add_site.php

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,89 @@
11
<?php
2+
// ***************!!EQUALIFY IS FOR EVERYONE!!***************
23

34
// Info on DB must be declared to use db.php models.
45
require_once '../config.php';
56
require_once '../models/adders.php';
67
require_once '../models/db.php';
78

8-
// We don't validate the URLs here because cURL does
9-
// a better job of validating/redirecting in the adders.
10-
$site_url = $_GET['url'];
11-
if($site_url == false)
9+
// We don't validate the URLs here because cURL does a better
10+
// job of validating/redirecting in the adders.
11+
$url = $_POST['url'];
12+
if($url == false)
1213
throw new Exception('URL is missing');
1314

1415
// We need to check the type since a user could manually
1516
// update the URL string to something unsupported.
16-
$type = $_GET['type'];
17+
$type = $_POST['type'];
1718
if( $type == false)
18-
throw new Exception('Type is not specified for the URL "'.$site_url.'"');
19+
throw new Exception(
20+
'Type is not specified for the URL "'.$url.'"'
21+
);
22+
23+
// We also need to see if the site is of a unique URL.
24+
$filters = array(
25+
array(
26+
'name' => 'url',
27+
'value' => $url,
28+
'condition' => 'OR'
29+
),
30+
array(
31+
'name' => 'url',
32+
'value' => $url.'/',
33+
'condition' => 'OR'
34+
),
35+
array(
36+
'name' => 'url',
37+
'value' => 'https://'.$url.'/',
38+
'condition' => 'OR'
39+
),
40+
array(
41+
'name' => 'url',
42+
'value' => 'http://'.$url.'/',
43+
'condition' => 'OR'
44+
)
45+
);
46+
$sites_with_url = DataAccess::get_db_rows('sites', $filters)['content'];
47+
if( !empty($sites_with_url) )
48+
throw new Exception('"'.$url.'" already exists');
1949

2050
// Static pages are treated as sites in themselves.
2151
if($type == 'single_page' ){
22-
single_page_adder($site_url);
52+
$site = single_page_adder($url);
2353

2454
// WordPress sites are added via their API.
2555
}elseif($type == 'wordpress'){
26-
wordpress_site_adder($site_url);
56+
$site = wordpress_site_adder($url);
2757

2858
// .XML sites use the latest version of XML standards.
2959
}elseif($type == 'xml'){
30-
xml_site_adder($site_url);
60+
$site = xml_site_adder($url);
3161

3262
// Since we're passing type through a URL, we have a fallback
3363
// in case someone passes an unsupported 'type'.
3464
}else{
3565
throw new Exception('"'.$type.'" sites are unsupported');
3666
}
3767

68+
// If no errors occur, we can add these sites into the URL
69+
// with several default items.
70+
$fields = array(
71+
array(
72+
'name' => 'url',
73+
'value' => $url
74+
),
75+
array(
76+
'name' => 'type',
77+
'value' => $type
78+
),
79+
array(
80+
'name' => 'status',
81+
'value' => 'active'
82+
)
83+
);
84+
DataAccess::add_db_entry(
85+
'sites', $fields
86+
);
87+
3888
// Back home we go.
3989
header('Location: ../index.php?view=sites&status=success');

actions/delete_alert.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

actions/delete_alert_tab.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

actions/delete_label.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**************!!EQUALIFY IS FOR EVERYONE!!***************
3+
* This document deletes labels.
4+
*
5+
* As always, we must remember that every function should
6+
* be designed to be as efficient as possible so that
7+
* Equalify works for everyone.
8+
**********************************************************/
9+
10+
// Info on DB must be declared to use db.php models.
11+
require_once '../config.php';
12+
require_once '../models/db.php';
13+
14+
// Setup variables.
15+
$alert_label = $_GET['name'];
16+
17+
// Delete DB
18+
$filtered_to_label = array(
19+
array(
20+
'name' => 'meta_name',
21+
'value' => $_GET['name'],
22+
)
23+
);
24+
DataAccess::delete_db_entries(
25+
'meta', $filtered_to_label
26+
);
27+
28+
// Reload alerts page.
29+
header('Location: ../index.php?view=alerts');

actions/get_alert_count.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**************!!EQUALIFY IS FOR EVERYONE!!***************
3+
* This script gets scan_log from the DB.
4+
*
5+
* As always, we must remember that every function should
6+
* be designed to be as efficient as possible so that
7+
* Equalify works for everyone.
8+
**********************************************************/
9+
10+
// Since this file can run in the CLI, we must set the
11+
// directory if it isn't already set.
12+
if(!defined('__ROOT__'))
13+
define('__ROOT__', dirname(dirname(__FILE__)));
14+
15+
// Info on DB must be declared to use db.php models.
16+
require_once(__ROOT__.'/config.php');
17+
require_once(__ROOT__.'/models/db.php');
18+
19+
// Return the scan log.
20+
$filtered_to_active_status = array(
21+
array(
22+
'name' => 'status',
23+
'value' => 'active'
24+
),
25+
array(
26+
'name' => 'archived',
27+
'value' => 0
28+
)
29+
);
30+
echo number_format(DataAccess::count_db_rows(
31+
'alerts', $filtered_to_active_status
32+
));

actions/get_alerts.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

actions/get_scan_log.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**************!!EQUALIFY IS FOR EVERYONE!!***************
3+
* This script gets scan_log from the DB.
4+
*
5+
* As always, we must remember that every function should
6+
* be designed to be as efficient as possible so that
7+
* Equalify works for everyone.
8+
**********************************************************/
9+
10+
// Since this file can run in the CLI, we must set the
11+
// directory if it isn't already set.
12+
if(!defined('__ROOT__'))
13+
define('__ROOT__', dirname(dirname(__FILE__)));
14+
15+
// Info on DB must be declared to use db.php models.
16+
require_once(__ROOT__.'/config.php');
17+
require_once(__ROOT__.'/models/db.php');
18+
19+
// Return the scan log.
20+
echo DataAccess::get_meta_value('scan_log');

0 commit comments

Comments
 (0)