one-click-accessibility/modules/scanner/components/top-bar-link.php
VasylD beb8deda2e
[APP-907] Accessibility assistant (#326)
* PHPCS and remediation POC WIP

* WIP Wizard module

* Added scanner module

* [APP-929][APP-930] Add initial setup for wizard, added btn to the topbar (#230)

* [APP-929][APP-930]

* [APP-929][APP-930]

* update logic

* update init app

* [APP-0000] store plan scope after register/switch

* change return of load

* add header

* Move into shadow dom, add context, add headers components

* add UI components

* add UI components

* add UI components

* merge current develop

* merge current develop

* Add AltText Form

* Add scroll to current element

* Align with current design, add loader, added preview for svg

* Align with current design, add loader, added preview for svg

* Resolve comments

* Resolve comments

* Resolve comments

* [APP-934] add submit logic (#259)

* [APP-934] add submit logic

* [APP-934] add submit logic

* [APP-934] add submit logic

* [APP-934] add submit logic

* Added replace remediation action

* Add submit logic

* Add submit alt text logic, generate AI alt text

* Add AI generate request, add convert from SVG to png base64, added manual fix block

* Add AI generate request, add convert from SVG to png base64, added manual fix block

* Add texts, add remediation submit, fix logic to store remediation

* Add texts, add remediation submit, fix logic to store remediation

* Add texts, add remediation submit, fix logic to store remediation

* Add texts, add remediation submit, fix logic to store remediation

* Add texts, add remediation submit, fix logic to store remediation

* Add texts, add remediation submit, fix logic to store remediation

---------

Co-authored-by: Raz Ohad <admin@bainternet.info>

* Add texts, add remediation submit, fix logic to store remediation

* [APP-0000] add store request to the Service API (#268)

* [APP-0000] add store request to the Service API

* [APP-0000] add store request to the Service API

* [APP-0000] add store request to the Service API

* [APP-0000] add store request to the Service API

* [APP-0000] add request to store scanner summary

* [APP-0000] add request to store scanner summary

* [APP-0000] add request to store scanner summary

* [APP-1432] fix with AI flow (#275)

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1446] sidebar menu update (#276)

* update: simplify menu

* add: headings and scanner menu options

* [APP-945] add column for tables (#282)

* [APP-945] add column for tables

* [APP-945] add column for tables

* [APP-945] add column for tables

* [APP-945] add column for tables

* [APP-1447] Updated quota bar designs (#278)

* update: quota bar designs

* fix: the popover was partially visible

* update: AI credits name

* update: usage calculation logic

* add: quota indicators

* update: quotas tooltip text

* update: quotas notices text

* update: make toggle icon dynamic

* fix: @elementor/ui imports

* Update modules/settings/assets/js/layouts/quota-bar.js

Co-authored-by: VasylD <vasyld@elementor.red>

* update: styling of component

---------

Co-authored-by: VasylD <vasyld@elementor.red>

* [APP-1507] add UI changes (#286)

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1507] add UI changes

* [APP-1387] add mixpanel events (#288)

* [APP-1387] add mixpanel events

* [APP-1387] add mixpanel events

* New: Add the a11y assistant dashboard's UI [APP-1445] (#289)

* [APP-1513] add disconnected msg (#290)

* [APP-1513] add disconnected msg

* [APP-1513] add disconnected msg

* [APP-1513] add disconnected msg

* [APP-1547][APP-1548][APP-948] update alt text view, fix list issues (#291)

* [APP-1547][APP-1548][APP-948] update alt text view, fix list issues, add rest route for update status

* [APP-1547][APP-1548][APP-948] update alt text view, fix list issues, add rest route for update status

* fix: infotip icon padding and font style (#293)

* fix: infotip icon padding and font style

* fix: infotip icon padding and font style

* update: caniuse database

* [APP-1525] add edit mode (#294)

* [APP-1525] add edit mode

* [APP-1525] add edit mode

* [APP-1525] add edit mode

* Bug/app 1544 (#295)

* Fix: Resolve QA comments [APP-1544]

* New: Add beta tags [APP-1555]

* New: Add the "no results" state [APP-1544]

* [APP-1554] rename violations (#297)

* [APP-1512] add backend logic for remediation management (#298)

* [APP-1512] add backend logic for remediation management

* [APP-1512] add backend logic for remediation management

* Update modules/remediation/database/remediation-entry.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* Update modules/remediation/rest/items.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* [APP-1512] add backend logic for remediation management

---------

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* Fix: Resolve QA comments [n/a] (#299)

* [APP-1512] add FE remediation management (#300)

* [APP-1512] add backend logic for remediation management

* [APP-1512] add backend logic for remediation management

* Update modules/remediation/database/remediation-entry.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* Update modules/remediation/rest/items.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* [APP-1512] add backend logic for remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

* [APP-1512] add FE remediation management

---------

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* [APP-1609] fix tooltip

* [APP-1609] fix resolved btn click

* [APP-1401] clear cache on update (#302)

* [APP-1401] clear cache on update

* [APP-1401] clear cache on update

* [APP-1401] clear cache on update

* [APP-1401] clear cache on update

* [APP-1401] clear cache on update

* update with latest develop branch

* fix copies

* [APP-1619] add mixpanel event (#303)

* [APP-1619] add mixpanel event

* [APP-1619] add mixpanel event

* [APP-1593] Add locked variant for quota bar (#301)

* update: add locked version of quota status bar

* fix: text color for infotip

* fix: width issues

* fix: add check for 0

* [APP-1637][APP-1643] add UI fixes, add excluded rules array (#307)

* fix: make sidebar collapsible (#306)

* Merge current dev

* [APP-1603] Add dashboard menu (#309)

* [APP-1603] Add dashboard menu

* [APP-1603] Add dashboard menu

* [APP-1603] Add dashboard menu

* [APP-1603] Add dashboard menu

* Bug/app 1607 (#311)

* Fix: Update stats calculation logic [APP-1607]

* Fix: Set fixed width for the results table [APP-1650]

* Fix: Update filter rules [APP-1634]

* New: Add the no search results state [APP-1651]

* Fix: Convert indents [n/a]

* [APP-1670] add menu on Manage Fixes (#315)

* [APP-1670] add menu on Manage Fixes

* [APP-1670] update menu

* [APP-1611] fix comments

* fix: direction of snippet (#313)

* [APP-1561] New menu layout (#308)

* update: app menu and layout

* merge: latest changes from feature/remediation

* add: alert indicator to the closed sidebar

* fix: page layout for statement page

* update: menu display names

* fix: topbar menu layout

* update: sidebar menu width

* update: sidebar menu width

* fix: popup menu layout

* add: hover action to the toggle button

* update: my account menu

* fix: quota indicator for closed sidebar

* fix: icon alignments

* fix: scroll behaviour

* fix: page scroll behaviour

* fix: popup menu hover state

* update: quota bar and group layouts

* add: tooltips to the menu items

* update: make scans page fixed height and scrollable

* update: styles with theme references and added new styled components

* fix: make sidebar smoother

* update: accessibility page heading

* Merge latest develop

* [APP-1611] trigger save entry for clean cache (#314)

* [APP-1611] trigger save entry for clean cache

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-0000] call trigger save async (#319)

* [APP-1611] trigger save entry for clean cache

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-0000] call trigger save async

* fix: scrollbar issues (#318)

* [APP-1615] add remediation for wp image (#321)

* POC - FrontEnd remediations to handle Dynamic Data [APP-1644] (#312)

* POC - FrontEnd remediations to handle Dynamic Data

* Update modules/remediation/components/remediation-runner.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* added MutationObserver to cover elements that are added later on the page

runs until remediations are all done, and disconnect

* added $use_frontend flag instead of using "false"

* Update modules/remediation/components/remediation-runner.php

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* WIP on poc/fe-remediations

* [APP-0000] call trigger save async

* [APP-1644] apply FE remediation

* [APP-1644] apply FE remediation

* [APP-1644] apply FE remediation

* Add timeout (wait for FE remediation timeout)

* Add timeout (wait for FE remediation timeout)

* Add timeout (wait for FE remediation timeout)

* Add timeout (wait for FE remediation timeout)

* Add timeout (wait for FE remediation timeout)

* Small fixes

* Small fixes

* Small fixes

* Small fixes

---------

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>
Co-authored-by: vasyldinets <vasyld@elementor.red>

* [APP-1611] Fix cache issue (#324)

* [APP-1611] trigger save entry for clean cache

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-1611] fix comments

* [APP-0000] call trigger save async

* [APP-1611] clear cache

* [APP-1657] upgrade cta (#323)

* update: added logic to show button based on plan

* Update modules/settings/assets/js/components/quota-bar/quota-bar-group.js

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* fix: eslint error

---------

Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>

* [APP-1658] Update accessibility admin column design (#322)

* update: wpadmin column layout

* update: move icon to assets

* Fix: Resolve remediation encoding issue [APP-1646] (#325)

---------

Co-authored-by: Ohad <ohad@elementor.com>
Co-authored-by: Raz Ohad <admin@bainternet.info>
Co-authored-by: Nirbhay Singh <121793120+nirbhayel@users.noreply.github.com>
Co-authored-by: Pavlo Kniazevych <139438463+pkniazevych@users.noreply.github.com>
Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>
2025-07-07 16:25:11 +07:00

43 lines
3 KiB
PHP

<?php
namespace EA11y\Modules\Scanner\Components;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Top_Bar_Link {
public function get_name(): string {
return 'top-bar-link';
}
public function add_bar_link() {
if ( is_admin() ) {
return;
}
add_action( 'admin_bar_menu', function ( \WP_Admin_Bar $wp_admin_bar ) {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
// Define the SVG icon
$svg_icon = '
<svg xmlns="http://www.w3.org/2000/svg" class="ea11y-scanner-wizard-icon" role="presentation" width="16" height="16" viewBox="0 0 14 14" fill="none">
<path d="M10.334 1.22529C11.3395 1.80586 12.1759 2.63898 12.7605 3.64216C13.3451 4.64534 13.6576 5.78381 13.6669 6.94485C13.6763 8.1059 13.3823 9.24926 12.814 10.2618C12.2457 11.2743 11.4228 12.1208 10.4268 12.7175C9.43081 13.3142 8.29623 13.6405 7.13538 13.664C5.97454 13.6875 4.82768 13.4074 3.80835 12.8515C2.78902 12.2955 1.93257 11.483 1.32376 10.4943C0.714959 9.50563 0.374924 8.3751 0.337318 7.21463L0.333984 6.99863L0.337318 6.78263C0.374653 5.63129 0.709683 4.50927 1.30974 3.52595C1.90981 2.54264 2.75442 1.73159 3.76125 1.17188C4.76807 0.612168 5.90275 0.322891 7.05466 0.332251C8.20656 0.341612 9.33639 0.649291 10.334 1.22529ZM9.63332 5.78796C9.58168 5.63299 9.47495 5.50238 9.33338 5.4209C9.19181 5.33942 9.02525 5.31276 8.86532 5.34596L8.78998 5.36596L7.00065 5.96263L5.21132 5.36596L5.13598 5.34596C4.9762 5.31307 4.80991 5.33992 4.66858 5.4214C4.52726 5.50289 4.42072 5.63336 4.36914 5.78812C4.31755 5.94288 4.3245 6.11119 4.38866 6.26117C4.45283 6.41115 4.56976 6.5324 4.71732 6.60196L4.78998 6.63129L6.33398 7.14529V7.79596L5.11265 9.62929L5.07265 9.69596C5.00506 9.82874 4.98389 9.98033 5.01253 10.1265C5.04117 10.2728 5.11796 10.4052 5.23065 10.5026L5.29732 10.5533L5.36465 10.5933C5.49743 10.6609 5.64902 10.682 5.79523 10.6534C5.94145 10.6248 6.07385 10.548 6.17132 10.4353L6.22198 10.3686L7.00065 9.20063L7.77932 10.3686L7.82598 10.4306C7.93176 10.5553 8.07966 10.6368 8.24157 10.6595C8.40348 10.6823 8.5681 10.6447 8.70414 10.554C8.84018 10.4633 8.93815 10.3258 8.97942 10.1676C9.02069 10.0094 9.00239 9.84155 8.92798 9.69596L8.88865 9.62929L7.66732 7.79596V7.14463L9.21132 6.63063L9.28399 6.60129C9.43179 6.53193 9.549 6.41074 9.61339 6.2607C9.67778 6.11066 9.68487 5.94221 9.63332 5.78729V5.78796ZM7.00065 2.99863C6.73543 2.99863 6.48108 3.10398 6.29354 3.29152C6.10601 3.47906 6.00065 3.73341 6.00065 3.99863C6.00065 4.26384 6.10601 4.5182 6.29354 4.70573C6.48108 4.89327 6.73543 4.99863 7.00065 4.99863C7.26587 4.99863 7.52022 4.89327 7.70776 4.70573C7.89529 4.5182 8.00065 4.26384 8.00065 3.99863C8.00065 3.73341 7.89529 3.47906 7.70776 3.29152C7.52022 3.10398 7.26587 2.99863 7.00065 2.99863Z" fill="#9DA1A7"/>
</svg>';
$wp_admin_bar->add_node( [
'id' => 'ea11y-scanner-wizard',
'title' => $svg_icon . esc_html__( 'Accessibility Assistant', 'pojo-accessibility' ),
'href' => '#', // Click event is handled by JS.
] );
}, 200 );
}
/**
* Component constructor.
*/
public function __construct() {
$this->add_bar_link();
}
}