Skip to content

Commit 35c7526

Browse files
bainternetKingYesnirbhayelDinetsVpkniazevych
authored
[Version] Bumped V3.2.0 (#263)
* Bump WP version * ♻️ Initial Refactor commit [APP-687] (#109) * Initial refactor commit * ✅ Added build and tests CI/CD * PR Rejects * Rejects leftover * Setup base (#110) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: settings variable * update: removed duplicate css import * Update modules/settings/assets/js/api/index.js Co-authored-by: VasylD <[email protected]> --------- Co-authored-by: Ohad <[email protected]> Co-authored-by: VasylD <[email protected]> * [Infra] ✅ updated Github actions (#114) * updated github actions * removed composer github auth * PHPCS * removed package-lock.json from ignore to allow `npm ci` * added missing husky * ignore legacy * removed unused non existing import * Add connect modal (#111) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: add rule to move jsx props to multiline imporving readability * add: connect modal * update: hooks import for better readability * update: replace functions with hooks * fix: alignment and style * update: imports * update: removed conflicting imports * fix: add compatibility for mobile devices --------- Co-authored-by: Ohad <[email protected]> * [APP 705] add connect module, settings and notification component (#112) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: add rule to move jsx props to multiline imporving readability * add: connect modal * update: hooks import for better readability * update: replace functions with hooks * add: connect module * add: settings and get settings route * add: hooks and contexts to get settings * add: hooks * add: notification component * add: data api * add: settings provider and connect settings * add: husky * fix: formatting and text-domain * update: filter names * fix: hook import * add: set function for settings * add: prop-types package * update: refactor notification component and context * update: remove filter for authorize url * update: imports and exports of hooks * update: plugin settings context filename and relevant imports --------- Co-authored-by: Ohad <[email protected]> * [APP 707] general setting components (#113) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: add rule to move jsx props to multiline imporving readability * add: connect modal * update: hooks import for better readability * update: replace functions with hooks * add: connect module * add: settings and get settings route * add: hooks and contexts to get settings * add: hooks * add: notification component * add: data api * add: settings provider and connect settings * add: husky * add: icon size control * fix: icon size control labels * add: icon select component * add: color picker component * add: accessibility icons * add: icon export * update: add icons to the component * fix: styling for the icon select control * update: color picker with react-colorful component * update: icon size component with live icon design * fix: styling of radio boxes * add: icon design settings layout * add: position settings layout * add: layout exports * add: alignment matrix and position control components * add: position settings & position settings for mobile layout * fix: formatting and text-domain * update: filter names * fix: hook import * add: set function for settings * add: prop-types package * update: refactor notification component and context * update: remove filter for authorize url * Update modules/settings/assets/js/components/color-picker/style.css Co-authored-by: Raz Ohad <[email protected]> * update: color picker class name --------- Co-authored-by: Ohad <[email protected]> Co-authored-by: Raz Ohad <[email protected]> * [App 780] Navigation Sidebar (#115) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: add rule to move jsx props to multiline imporving readability * add: connect modal * update: hooks import for better readability * update: replace functions with hooks * add: connect module * add: settings and get settings route * add: hooks and contexts to get settings * add: hooks * add: notification component * add: data api * add: settings provider and connect settings * add: husky * fix: formatting and text-domain * update: filter names * fix: hook import * add: set function for settings * add: prop-types package * update: refactor notification component and context * update: remove filter for authorize url * update: imports and exports of hooks * update: plugin settings context filename and relevant imports * update: icons and icon imports * add: sidebar(wip) * update: fix width of connect screen on mobile * update: sidebar layout * add: credit card and user arrow icons * update: hidden wpfooter and fixed sidebar height * update: sidebar layout * add: basic page layouts * update: sidebar layout * add: sidebar menu, sidebar app bar and my account menu components * update: add sidebar and menu settings * update: add page layouts * update: admin top bar * add: bottom bar * add: bottom bar and top bar * add: bottom bar and top bar * update: page content styling * fix: styling * fix: styling * update: text domain * update: added translations * fix: admin top bar layout * update: exports of icons * update: exports of components * add: aliases for imports and fix exports * fix: height and styling of the layout * fix: unhide wp footer * update: keep widget menu open on page load (default) * update: linter rules to move first prop to new line * update: linter rules to move first prop to new line --------- Co-authored-by: Ohad <[email protected]> * Fix error on install plugin, add prettier (#116) * Feature/app 810 assemble icon settings page (#117) * Initial refactor commit * ✅ Added build and tests CI/CD * update: add src for admin settings * update: incorrect constant names * update: namespace * add: accessibility settings * update: webpack to output files inside a folder * update: build output folders * update: removed commented code * update: npm scripts * add: webpack config * add: hooks * update: move admin setting to the module folder * update: assets loading logic * update: add rule to move jsx props to multiline imporving readability * add: connect modal * update: hooks import for better readability * update: replace functions with hooks * add: connect module * add: settings and get settings route * add: hooks and contexts to get settings * add: hooks * add: notification component * add: data api * add: settings provider and connect settings * add: husky * add: icon size control * fix: icon size control labels * add: icon select component * add: color picker component * add: accessibility icons * add: icon export * update: add icons to the component * fix: styling for the icon select control * update: color picker with react-colorful component * update: icon size component with live icon design * fix: styling of radio boxes * add: icon design settings layout * add: position settings layout * add: layout exports * add: alignment matrix and position control components * add: position settings & position settings for mobile layout * fix: formatting and text-domain * update: filter names * fix: hook import * add: set function for settings * add: prop-types package * update: refactor notification component and context * update: remove filter for authorize url * update: imports and exports of hooks * update: plugin settings context filename and relevant imports * update: icons and icon imports * add: sidebar(wip) * update: fix width of connect screen on mobile * update: sidebar layout * Update modules/settings/assets/js/components/color-picker/style.css Co-authored-by: Raz Ohad <[email protected]> * update: color picker class name * add: credit card and user arrow icons * update: hidden wpfooter and fixed sidebar height * update: sidebar layout * add: basic page layouts * update: sidebar layout * add: sidebar menu, sidebar app bar and my account menu components * update: add sidebar and menu settings * update: add page layouts * update: admin top bar * add: bottom bar * add: bottom bar and top bar * add: bottom bar and top bar * update: page content styling * fix: styling * fix: styling * update: text domain * add: props to wrapper * add: icon design and position setting layouts * add: in page scroll behaviour to the settings * add: widget icons and getter function * update: icon design settings getter and setter functions * update: imports * add: mobile layout for position settings * add: icon position settings * add: icon position settings hooks and handlers * fix: alignment of controls in AlignmentMatrixControl * update: useSettings and usePositionSetting hooks and relevant functions * fix: colors of AlignmentMatrixControl * fix: styling of components and layouts * add: aliases * add: container wrapper to page * update: accessibility options rendering logic * fix: order of the icons * add: aliases for components and hooks imports * fix: styling of settings panel * fix: container height for settings page * update: toggle control states * add: widget icon settings * add: load saved widget icon settings * update: move layout to page for different designs per page * update: add changes tracking and disable button logic * add: async/await to save settings * update: convert options to array of objects * Update modules/settings/assets/js/components/bottom-bar/index.js Co-authored-by: VasylD <[email protected]> * Update modules/settings/assets/js/app.js Co-authored-by: VasylD <[email protected]> * fix: remove duplicate entries --------- Co-authored-by: Ohad <[email protected]> Co-authored-by: Raz Ohad <[email protected]> Co-authored-by: VasylD <[email protected]> * Feature/app 708 widget menu settings (#118) * add: icons for menu settings * add: placeholder layout for widget preview in menu settings * update: load saved settings and updated imports * add: logics for handling and saving menu settings * add: useSavedSettings hook * update: set export as default for Sidebar layout * add: widget menu settings layout and settings * update: add widget menu settings and widget preview layouts * add: hide/show minimum option alert notification * update: styling of the save button * update: save settings logic to use async/await * fix: accessibility text icon * update: app type (#119) * [APP-834] Update account menu buttons (#121) * update: account menu buttons * update: billing link * add: error handling for switch account * [APP-835] add service data (#122) * add: client functions * add: site register and site info endpoints * update: add plan data settings * update: add support for 201 response code * update: add plan data key * update: store the plan data on the once the site is registered * update: add filter for client url * add: retry registering in there is any error after connect * update: setting prefix * add: plan data * update: add account details to menu * fix: lint issues * update: add data checkbox support (#123) * [APP-928] Settings pointer (#125) * add: settings pointer * update: add alias for the settings * [APP-837] Add post connect modal (#120) * add: post connect modal * update: settings prefix * fix: connect modal design * update: connect modal text * add: connect modal graphics * update: connect modal icon * update: post connect modal * update: sidebar menu text * update: text of icon settings * update: text * update: php compatibility with return types * add: accessibility statement page structure (#126) * [APP-721] Render widget and global settings (#124) * add: webhook endpoint * add: widget module * add: default widget settings on successful registration * update: name of global object to ea11yWidget * update: remove json encoding to make objects available on the frontend * update: widget url, filter and enqueuing method * update: removed obsolete code * update: enqueue script only when connected * update: add check for valid plan data and key * update: conditional check * update: conditional check * fix: widget loading error (#128) * [Legacy] Upgrade To New [APP-949] (#127) * Added `Notice_Base` and `Notices` component to core module * Always load core module and load all other modules based on legacy status * added filter in customizer settings * added bubble / pimple in admin menu to indicate upgrade * added `Dismissible_Deprecated_Nag` notice to none legacy pages * added `Dismissible_Deprecated_Nag` notice to legacy pages * Added `Upgrade` component to legacy module includes: * loading of notices * introduction modal * admin menu pimple * customizer notice * pointer * confirmation modal * upgrade logic and handler * ✅ Fixed legacy module test * added `local:quick-run` command to run in browser mode * update phpunit workflow * ensure wp.ajax is loaded * wrong translations * Updated strings * added "Equally" * remove unused test * ✅ use custom version of wp test library (#129) * ✅ use custom version of wp test library * cleanup * update WP versions for testing * [APP-711] Widget preview (#130) * add: dynamic script loader for widget * update: settings name * update: settings save function and comments * update: tools settings object structure * add: widget preview section * update: added setting page slug as a constant * update: enqueue widget for preview in the settings * add: widget icon assets link * add: widget icon svgs * update: store widget url in a constant * update: store widget url in a constant * update: trigger widget preview update on menu item changes * update: remove the icon option from the frontend. * update: add widget URL * update: plan data setting type * update: widget plan url * update: widget plan url and parse plan data * fix: phpcs error ext-json missing * fix: widget url * fix: save and use plan data as a serialized option * fix: use template string for widget url * [APP-908] Accessibility generator (#131) * add: accessibility statement radio icons * update: add form group on radio buttons * add: statement generator * add: statement generator * add: accessibility statement data option * update: create page in WordPress and save it to the option * update: exclude zip file from the git * update: render statement page conditionally * add: statement link layout and settings * add: preload statement data * update: publish the created page and add link for it * update: changed Dynamic Script Loader to WidgetLoader * add: accessibility statement url * update: text and styling * update: styling of the preview text * update: restructure statement generator * add: support for dynamic update in statement links * update: remove index.css file for widget loader * add: widget styling for settings page * add: empty link when hide link is enabled * update: statement page structure and logic * fix: typo * update: convert component into a styled component * fix: styling and layout * update: icons * update: convert radio buttons to styled component * fix: typo and style * add: fading for the link preview * update: import * update: styling and spacing * fix: sidebar layout * update: wpcs to latest version * fix: spacing * fix: wpcs version * add: check for valid statement page * fix: jitters on rendering * fix: use escape attribute * update: settings menu slug and plugin name * fix: menu item rendering * update: definition of the styled text field * add: addPage function to the API * fix: add notification on page creation * add: copy link icon * update: optimize SVGs * [APP-908] Additional fixes (#133) * fix: text domains * updated: styled component syntax * update: use await instead of then * fix: prevent application crash in case widget fails to load * add: generated info tip card * update: refactor function * Fix: Fix the QA bugs [n/a] (#135) * [APP-830] Add mixpanel events (#134) * [APP-830] Add mixpanel events * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * [APP-830] Add user to init Mixpanel (#136) * [APP-830] Add mixpanel events * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * Merge branch 'develop' into feature/APP-830-add-mixpanel # Conflicts: # .gitignore # modules/settings/assets/js/components/sidebar-menu/index.js # modules/settings/assets/js/pages/accessibility-statement.js * [APP-830] Add user to init Mixpanel * [APP-830] Add user to init Mixpanel * [APP-830] Add user to init Mixpanel * [APP-830] rename events (#137) * Connect and Preview Fixes (#139) * updated connect admin page * Use unified widget URL instead of hardcoded Js to support envs * Removed enqueue of fictional widget.js and reuse settings `admin` handle * Fix: Fix the QA bugs [n/a] (#138) * New: Finish the BE integration [n/a] * Fix: Fix some bugs [n/a] * upgrade flow UI and design tweaks [app-949] (#141) * Updated Learn More links with UTM's * Tweaked Pointer strings Icon and CTA * dismissible notice strings * sticky notice strings * updated upgrade flow design for pointer, notices, introduction modal, and confirmation modal * added build script * [APP-979] Update links and plugin name (#140) * Ensure loading of legacy widget based on any saved data and fixed legacy JS * Bug/app 1002 (#143) * Bug: Update the logo in the "Hide Widget" modal [APP-1001] * Fix: Update the side menu spaces [APP-1002] * [APP-991] Add translation for statement (#142) * [APP-979] Update links and plugin name * [APP-991] Add translation for statement * Set Prod Widget URL * [APP-1004][APP-1005][APP-1006] Fix generator UI and logic, fix statement UI, fix copy link (#144) * [APP-1004] Fix generator UI and logic * [APP-1005] Fix statement UI * [APP-1005] Fix statement UI * Mixpanel record session * Fix: Enhance position values validation [APP-1009] (#146) * Bug/app 1003 (#147) * Fix: Add a border to the preview [n/a] * Fix: Fix Capabilities screen UI [APP-1003] * [APP-1020] add missed events (#148) * [APP-1015] fix switch account (#149) * [APP-1015] fix switch account (#150) * [APP-1021] Fix switch modal ui (#151) * fix: ui issues * fix: translation strings * [APP-912] add default settings for RTL (#152) * [APP-912] add default settings for RTL * [APP-912] add default settings for RTL * [APP-912] add default settings for RTL * [APP-1026] Remove HTML breaking <style> tag & update pointer logic (#153) * fix: remove extra closing tag * update: hide settings pointer when plugin settings is opened * update: remove unused functions * update: add help text to mobile position settings * Bug/app 1003 (#157) * Fix: Add missed translations [n/a] * Fix: Refresh the plan data on page load [n/a] * New: Add loader to the settings [n/a] * update: delete lock key after each check (#160) * New: Update dashboard icon size [n/a] (#158) * New: Update dashboard icon size [n/a] * Fix: Fix widget previews [n/a] * [APP-1018] Help menu change (#155) * update: remove accessibility word from menu items * update: remove top bar * update: add help button to the sidebar * update: re-add spacing in styled css code * update: create styled components * [APP-973] Add an UTM for users upgrading from one click to the new widget (#165) * update: ui of the statement preview (#166) * [APP-1011][APP-1013] focus outline and sitemap settings (#161) * [APP-1011][APP-1013] focus outline and sitemap settings * [APP-1011][APP-1013] focus outline and sitemap settings * [APP-1011][APP-1013] focus outline and sitemap settings * [APP-1011][APP-1013] focus outline and sitemap settings * update: video link (#167) * [APP-1051] Fix layout on the small and medium devices (#156) * fix: layout on the small and medium devices * update: change components to styled components * refactor: position settings wrapper into a separate component * [APP-1012][APP-1085] Add skip to content settings and event for Mixpanel (#169) * [APP-1012][APP-1085] Add skip to content settings and event for Mixpanel * [APP-1012][APP-1085] Add skip to content settings and event for Mixpanel * [APP-1012][APP-1085] Add skip to content settings and event for Mixpanel * [APP-1012][APP-1085] Add skip to content settings and event for Mixpanel * [APP-1048] Add tooltip to accessibility statement (#159) * add: tooltip to accessibility statement * update: hide infotip when statement link is set * update: infotip's text * fix: infotip naming and logic * [APP-1049] Add back button accessibility statement (#164) * add: back button to the statement link section * add: Edit link button to statement page section * update: add admin_url and generate query args properly * update: learn more link for accessibility statement page (#168) * Fix: Update overlay height [n/a] (#171) * Fix settings and connect issues (#170) * fix: token fails to refresh after expiry * update: add 12 hour time for plan data refresh and fix missing subscription id * update: add check to refresh plan data * fix: decoding errors and alignment and add logging for errors * update: refresh logic and formatting * Update/app 1029 app name (#173) * update: plugin name * update: default menu option * update: menu structure * update: add inline checks * update: reduce padding on app icon in menu * fix: height of the modal * update: app menu icon color * update: menu icon colors * fix: menu icon size * update: plugin names * update: HELP_LINK * update: app name * update: icon background color * update: icon size * fix: admin icon size * fix: width of the sidebar * Fix/toggle not working properly (#174) * fix: toggles not working properly in some cases * fix: saving of the settings was not working * add: missing adminUrl in settings data * fix: switch was not working properly in some cases (#175) * Fix/app 1093 incorrect position on default (#176) * fix: switch was not working properly in some cases * fix: default setting structure for the icon position * [APP-1096] Text changes (#177) * fix: switch was not working properly in some cases * update: plugin name and action buttons title * fix: revert change to is_active function * fix: button color * New: Add the skip link [APP-1012] (#179) * [APP-1097] Fix preview load (#178) * [APP-1097] Fix preview load * [APP-1097] Fix preview load * [APP-1097] Fix preview load * Update modules/settings/assets/js/components/widget-loader/index.js --------- Co-authored-by: Raz Ohad <[email protected]> * [APP-1123] Accessibility statement text (#181) * fix: switch was not working properly in some cases * update: accessibility statement content * [APP-1121] Add support for react-jsx-runtime for older WP versions (#180) * fix: switch was not working properly in some cases * update: revert wp-scripts version to 28.0.0 to add support for older WordPress versions * update: revert wp-scripts to 27.9.0 * add: support for react-jsx-runtime in older versions of WordPress * update: version to the latest wp-scripts 30.3.0 * update: add lib/ to gitignore * update: plugin name * Fix: Fix admin widget previews [n/a] (#183) * [APP-1061] change mixpanel user id (#184) * [APP-1129] change toggle_event for mixpanel (#186) * Remove skip to content btn if anchor does not exist (#187) * fix: hide wp notices to keep the layout from shifting (#189) * [APP-1143] fix bug with capability display (#195) * [APP-1143] fix bug with capability display * [APP-1143] fix bug with capability display * [APP-1143] fix bug with capability display * [APP-1143] fix bug with capability display * add: loading text to widget preview (#196) * [APP-1142] add 'appType' super props, change identify key (#191) * [APP-1108][APP-1109][APP-1110] Add analytics backend logic * [APP-1142] Add 'appType' super props * [APP-1144] Accessibility statement tooltip text update (#198) * update: text * update: switch design * Tweak: Update widget loaders [n/a] (#197) * added images to readme (#172) * added images to readme * updated readme * V3.0.0 * updated readme * updated tested up to * Fix: Update the skip link rendering hook [APP-1157] (#203) * bumped v3.0.1 (#206) * Fix: Adapt widget preview to smaller height viewports [APP-1130] (#217) * update: convert menu icon to base64 svg (#199) * update: convert menu icon to base64 svg * update: logo to svg logo with base64 encoded * update: svg app icon * [APP-1201] Improve admin panel accessibility (#220) * [APP-1201] add accessibility rules * [APP-1201] add accessibility rules * [APP-1210] add prop to Mixpanel, move event names to const (#225) * [APP-1159] Add mismatch URL flow (#210) * update: convert imports to named imports * add: function to check if current screen is settings page * update: rename elementor logo to app logo * add: url mismatch flow and components * update: remove obsolete code * Update modules/connect/rest/authorize.php Co-authored-by: Pavlo Kniazevych <[email protected]> * Update modules/settings/module.php Co-authored-by: Pavlo Kniazevych <[email protected]> * fix: modal was not closing * update: remove url mismatch notice * update: mismatch modal and rendering logic * add: toast notifications for errors * update: convert components into styled components * update: remove bottom border from the dialog * update: text copy * fix: logo alignment * update: renamed styled component --------- Co-authored-by: Pavlo Kniazevych <[email protected]> * [APP-1108][APP-1109][APP-1110] Add analytics backend logic (#190) * [APP-1108][APP-1109][APP-1110] Add analytics backend logic * [APP-1108][APP-1109][APP-1110] Add analytics backend logic * Add nonce to the widget settings * Update routes and DB table * Fix comments * Fix comments * Fix comments * Fix comments * Fix comments * Fix comments * [APP-1101] Move action button to footer (#208) * update: add save changes footer to the bottom and remove it from capabilities * add: logic to save settings for skiptocontent using footer * update: text * update: convert component to styled component * [APP-1198] [APP-1199] Quota bar and notices (#219) * add: quota bar * add: openLink helper function * add: styled elements and visits link placeholder * update: remove hover state from the box * add: quota notices * update: quota access and usage calculations * add: logic to calculate plan usage * update: move logic to calculate plan usage to hook * add: todo note * add: todos * add: mixpanel events * fix: hide quota bar when sidebar is minimized * fix: settings panel was not expanding when sidebar is minimized * update: text and structure of the bar * update: quota calculation logic * update: remove TODOs * update: text and values * fix: height of the container for icon settings * update: golinks * update: golinks * fix: prevent icon options from wrapping on smaller screen sizes (#229) * [APP-1107] Add dashboard for analytics (#204) * [APP-1108][APP-1109][APP-1110] Add analytics backend logic * [APP-1108][APP-1109][APP-1110] Add analytics backend logic * Add nonce to the widget settings * Update routes and DB table * Fix comments * Fix comments * Fix comments * Fix comments * Fix comments * Fix comments * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1107] Add dashboard for analytics * [APP-1201] add accessibility rules * [APP-1107] fixed API endpoint * [APP-1107] fixed API endpoint * [APP-1107] fixed API endpoint * [APP-1107] add check for is_active * update to the latest * update to the latest * update to the latest * fix bugs, add changes * fix bugs, add changes * fix bugs, add changes * fix bugs, add changes * [APP-1105] Add pro capabilities (#205) * add: volume and solid crown icon * add: volume and crown icons to export * update: refactor menu item to a new component * add: screen reader to the menu items and reorganize them * add: pro item infotip content * add: capabilities item and pro info tip to exports * update: import ProInfoTip component and change disabled logic * update: imports * update: refactor pro item infotip into the separate component * update: refactor infotip and add comments * add: custom switch component * add: logo settings layout * update: switch component * add: useToggleSetting hook to manage widget settings. * update: move pro feature key to a separate constant * fix: pro icon style * update: remove branding key * update: pro enable check structure * update: pro enabled check structure * update: key name * update: update key before checking for it * fix: null error * add: update logic to get the tools settings based on plan * update: exclude remove-elementor-label from the minimum option rule * update: add formlabel and eventnames * add: logic to deactivate the features which are disabled for the plan * fix: PHP warning * fix: keyword name * add: GOLINKS * add: open link function * fix: PHP warning undefined key * update: logic to show the icon and added golinks * [APP-1045] Add billing tab (#223) * add: plan name and subscription link * update: refactor my account menu * update: move truncate email to a helper file * update: simplify truncation logic * [APP-1270] Delete transient and force info update (#236) * add: force update site/info on mismatch url * update: add a constant for the transient * add: delete_transient for switch account as well * add: delete_transient for disconnect as well * [APP-1267] Quota bar undefined (#234) * fix: undefined was shown when there is no quota data * add: preloader * fix: make bottom bar sticky on the settings pages (#237) * [APP-1268] Pro tip spacing (#235) * fix: pro tip spacing * fix: pro icon * [APP-1271] Align menu icons (#238) * update: hide info button on minimized sidebar * fix: alignment of quota bar icon * fix: conditional logic * update: improve sidebar motion * fix: switch account issue * update: upgrade link for analytics popup (#239) * [APP-1281] fix usage percentage formatting (#240) * fix: format display of percentage correctly. * update: fraction conversion logic * Force referer and lower transient time to 15 minutes [APP-1286] (#242) * reduce transient timeout * force referrer in script tags * [APP-1262] Enable routes for get statistic on disabled analytics (#233) * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1262] Enable routes for get statistic on disabled analytics * [APP-1243] Admin upgrade notices (#241) * add: admin quota notices * add: fix function name and phpcs issues * fix: formatting issues * [APP-1287] change Mixpanel check for free trial (#243) * Fix/quota text (#244) * fix: wp notice close logic plus banner text * update: banner text * [APP-1292] missing mixpanel events (#245) * add: missing mixpanel events * update: use variable for hardcoded names * update: use variable for hardcoded names * [APP-1293] Add additional checks (#246) * update: add additional check to prevent fatal error * fix: formatting * [APP-1312] minimize client css (#252) * [APP-1168] widget icon radius * add: icon radius component * add: icon radius component * update: add support for widget radius * fix: minor ui fixes * fix: resolve comments * fix: alignment of the icon * update: add styled components * add: corner radius mixpanel event * fix: corner radius should have default values when no value is set based on icon * fix: icon radius input style * add: accessibility attributes * fix: active states color * add: logic to control invalid inputs * update: make aria attributes translatable * update: styled component names * add: spacing between the components * [APP-1342] add super props, store plan scope after register/switch (#250) * [APP-0000] store plan scope after register/switch * Update modules/settings/module.php Co-authored-by: Pavlo Kniazevych <[email protected]> * remove deprecated method * remove deprecated method * [1342] Add super prop to mixpanel * [1342] Add super prop to mixpanel * [1342] Add super prop to mixpanel --------- Co-authored-by: Pavlo Kniazevych <[email protected]> * [Legacy] Added strict settings sanitization (#257) * [Legacy] Added strict settings sanitization * use correct esc_x method * hardcoded 6.8.0 * added svn for wp test library * fix: default border radius (#258) * fix: default border radius * add: default corner radius for new users * update: add support for default values for users with saved style settings * updated phpunit workflow * revert to master * hardcode 6.8.x * update: default values for existing users * update: remove saving default corner radius for new users * fix: update default radius for text icon * fix: PHPUnit tests for WP 6.8.0 * align with develop * set to latest --------- Co-authored-by: Raz Ohad <[email protected]> Co-authored-by: Raz Ohad <[email protected]> * fix: widget icon spacing (#262) * [Version] bumped V3.2.0 * Remove unnecessary --------- Co-authored-by: Yakir Sitbon <[email protected]> Co-authored-by: Nirbhay Singh <[email protected]> Co-authored-by: VasylD <[email protected]> Co-authored-by: Pavlo Kniazevych <[email protected]>
1 parent 52f1911 commit 35c7526

File tree

27 files changed

+1832
-787
lines changed

27 files changed

+1832
-787
lines changed

.github/workflows/phpunit.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
php: [7.4, 8.0, 8.1, 8.2]
26-
wp: [6.5.x, 6.6.x, latest, nightly]
26+
wp: [6.5.x, 6.6.x, 6.7.x, latest, nightly]
2727
ms: [no, yes]
2828
coverage: [no]
2929
phpunit: [9]
@@ -53,6 +53,13 @@ jobs:
5353
- name: Checkout repository
5454
uses: actions/checkout@v4
5555

56+
- name: Install SVN
57+
run: |
58+
sudo apt-get update -y
59+
sudo apt-get install -y subversion
60+
which svn
61+
svn --version
62+
5663
- name: Matrix variables
5764
id: matrix
5865
run: |
@@ -104,7 +111,7 @@ jobs:
104111
run: npm run build
105112

106113
- name: Set up WordPress and WordPress Test Library
107-
uses: bainternet/setup-wordpress-test-library@master
114+
uses: sjinks/setup-wordpress-test-library@master
108115
with:
109116
version: ${{ matrix.wp }}
110117

@@ -132,4 +139,4 @@ jobs:
132139
if [ "${{ steps.coverage.outputs.coverage }}" != 'none' ]; then
133140
OPTIONS="$OPTIONS --coverage-clover=clover.xml"
134141
fi
135-
phpunit --order-by=random ${OPTIONS}
142+
phpunit --order-by=random ${OPTIONS}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ coverage/
1818
.vscode
1919
.env
2020
*.zip
21+
.qodo

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
**Contributors:** elemntor \
44
**Tags:** Web Accessibility, Accessibility, A11Y, WCAG, Accessibility Statement \
55
**Requires at least:** 6.5 \
6-
**Tested up to:** 6.7 \
6+
**Tested up to:** 6.8 \
77
**Requires PHP:** 7.4 \
8-
**Stable tag:** 3.1.0 \
8+
**Stable tag:** 3.2.0 \
99
**License:** GPLv2 or later
1010

1111
Ally is a web accessibility plugin that enhances usability, offers custom controls, and auto-generates accessibility statements to help meet WCAG guidelines.
@@ -197,6 +197,13 @@ An accessibility statement is a declaration of your commitment to providing an i
197197

198198
## Changelog
199199

200+
### 3.2.0 - 2025-04-20
201+
202+
New: Added border radius controls for the new icon widget
203+
Tweak: Added Hungarian translations to the new widget
204+
Fix: Improved German translations in the new widget
205+
Fix: Enhanced sanitization in the legacy widget to prevent potential security issues
206+
200207
### 3.1.0 2025-03-25
201208

202209
* New: Screen Reader – Improved accessibility with screen reader compatibility.

modules/core/components/skip-link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function get_name(): string {
1818
public function enqueue_skip_link_styles() {
1919
wp_enqueue_style(
2020
'ea11y-skip-link',
21-
EA11Y_ASSETS_URL . '/css/skip-link.css',
21+
EA11Y_ASSETS_URL . 'build/skip-link.css',
2222
[],
2323
EA11Y_VERSION
2424
);

modules/legacy/components/frontend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,21 @@ public function print_toolbar() {
204204
<ul class="pojo-a11y-toolbar-items pojo-a11y-links">
205205
<?php if ( ! empty( $sitemap_link ) ) : ?>
206206
<li class="pojo-a11y-toolbar-item">
207-
<a href="<?php echo esc_attr( $sitemap_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-sitemap" tabindex="-1" role="button">
207+
<a href="<?php echo esc_url( $sitemap_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-sitemap" tabindex="-1" role="button">
208208
<?php echo $this->get_toolbar_button_title( 'sitemap' ); ?>
209209
</a>
210210
</li>
211211
<?php endif; ?>
212212
<?php if ( ! empty( $help_link ) ) : ?>
213213
<li class="pojo-a11y-toolbar-item">
214-
<a href="<?php echo esc_attr( $help_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-help" tabindex="-1" role="button">
214+
<a href="<?php echo esc_url( $help_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-help" tabindex="-1" role="button">
215215
<?php echo $this->get_toolbar_button_title( 'help' ); ?>
216216
</a>
217217
</li>
218218
<?php endif; ?>
219219
<?php if ( ! empty( $feedback_link ) ) : ?>
220220
<li class="pojo-a11y-toolbar-item">
221-
<a href="<?php echo esc_attr( $feedback_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-feedback" tabindex="-1" role="button">
221+
<a href="<?php echo esc_url( $feedback_link ); ?>" class="pojo-a11y-toolbar-link pojo-a11y-link-feedback" tabindex="-1" role="button">
222222
<?php echo $this->get_toolbar_button_title( 'feedback' ); ?>
223223
</a>
224224
</li>

modules/legacy/components/settings.php

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function section_a11y_toolbar( $sections = [] ) {
5454
'disable' => __( 'Disable', 'pojo-accessibility' ),
5555
],
5656
'std' => 'enable',
57+
'sanitize_callback' => [ $this, 'sanitize_toolbar_display' ],
5758
];
5859

5960
$toolbar_options_classes = 'pojo-a11y-toolbar-button';
@@ -65,6 +66,7 @@ public function section_a11y_toolbar( $sections = [] ) {
6566
'desc' => __( 'Title top of the toolbar (recommended).', 'pojo-accessibility' ),
6667
'class' => $toolbar_options_classes,
6768
'std' => __( 'Accessibility Tools', 'pojo-accessibility' ),
69+
'sanitize_callback' => 'sanitize_text_field',
6870
];
6971

7072
$fields[] = [
@@ -77,6 +79,7 @@ public function section_a11y_toolbar( $sections = [] ) {
7779
'disable' => __( 'Disable', 'pojo-accessibility' ),
7880
],
7981
'std' => 'enable',
82+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
8083
];
8184

8285
$fields[] = [
@@ -85,6 +88,7 @@ public function section_a11y_toolbar( $sections = [] ) {
8588
'type' => self::FIELD_TEXT,
8689
'class' => $toolbar_options_classes . ' pojo-settings-child-row no-border',
8790
'std' => __( 'Increase Text', 'pojo-accessibility' ),
91+
'sanitize_callback' => 'sanitize_text_field',
8892
];
8993

9094
$fields[] = [
@@ -93,6 +97,7 @@ public function section_a11y_toolbar( $sections = [] ) {
9397
'type' => self::FIELD_TEXT,
9498
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
9599
'std' => __( 'Decrease Text', 'pojo-accessibility' ),
100+
'sanitize_callback' => 'sanitize_text_field',
96101
];
97102

98103
$fields[] = [
@@ -105,6 +110,7 @@ public function section_a11y_toolbar( $sections = [] ) {
105110
'disable' => __( 'Disable', 'pojo-accessibility' ),
106111
],
107112
'std' => 'enable',
113+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
108114
];
109115

110116
$fields[] = [
@@ -113,6 +119,7 @@ public function section_a11y_toolbar( $sections = [] ) {
113119
'type' => self::FIELD_TEXT,
114120
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
115121
'std' => __( 'Grayscale', 'pojo-accessibility' ),
122+
'sanitize_callback' => 'sanitize_text_field',
116123
];
117124

118125
$fields[] = [
@@ -125,6 +132,7 @@ public function section_a11y_toolbar( $sections = [] ) {
125132
'disable' => __( 'Disable', 'pojo-accessibility' ),
126133
],
127134
'std' => 'enable',
135+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
128136
];
129137

130138
$fields[] = [
@@ -133,6 +141,7 @@ public function section_a11y_toolbar( $sections = [] ) {
133141
'type' => self::FIELD_TEXT,
134142
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
135143
'std' => __( 'High Contrast', 'pojo-accessibility' ),
144+
'sanitize_callback' => 'sanitize_text_field',
136145
];
137146

138147
$fields[] = [
@@ -145,6 +154,7 @@ public function section_a11y_toolbar( $sections = [] ) {
145154
'disable' => __( 'Disable', 'pojo-accessibility' ),
146155
],
147156
'std' => 'enable',
157+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
148158
];
149159

150160
$fields[] = [
@@ -153,6 +163,7 @@ public function section_a11y_toolbar( $sections = [] ) {
153163
'type' => self::FIELD_TEXT,
154164
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
155165
'std' => __( 'Negative Contrast', 'pojo-accessibility' ),
166+
'sanitize_callback' => 'sanitize_text_field',
156167
];
157168

158169
$fields[] = [
@@ -165,6 +176,7 @@ public function section_a11y_toolbar( $sections = [] ) {
165176
'disable' => __( 'Disable', 'pojo-accessibility' ),
166177
],
167178
'std' => 'enable',
179+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
168180
];
169181

170182
$fields[] = [
@@ -173,6 +185,7 @@ public function section_a11y_toolbar( $sections = [] ) {
173185
'type' => self::FIELD_TEXT,
174186
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
175187
'std' => __( 'Light Background', 'pojo-accessibility' ),
188+
'sanitize_callback' => 'sanitize_text_field',
176189
];
177190

178191
$fields[] = [
@@ -185,6 +198,7 @@ public function section_a11y_toolbar( $sections = [] ) {
185198
'disable' => __( 'Disable', 'pojo-accessibility' ),
186199
],
187200
'std' => 'enable',
201+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
188202
];
189203

190204
$fields[] = [
@@ -193,6 +207,7 @@ public function section_a11y_toolbar( $sections = [] ) {
193207
'type' => self::FIELD_TEXT,
194208
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
195209
'std' => __( 'Links Underline', 'pojo-accessibility' ),
210+
'sanitize_callback' => 'sanitize_text_field',
196211
];
197212

198213
$fields[] = [
@@ -205,6 +220,7 @@ public function section_a11y_toolbar( $sections = [] ) {
205220
'disable' => __( 'Disable', 'pojo-accessibility' ),
206221
],
207222
'std' => 'enable',
223+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
208224
];
209225

210226
$fields[] = [
@@ -213,6 +229,7 @@ public function section_a11y_toolbar( $sections = [] ) {
213229
'type' => self::FIELD_TEXT,
214230
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
215231
'std' => __( 'Readable Font', 'pojo-accessibility' ),
232+
'sanitize_callback' => 'sanitize_text_field',
216233
];
217234

218235
$fields[] = [
@@ -221,17 +238,18 @@ public function section_a11y_toolbar( $sections = [] ) {
221238
'type' => self::FIELD_TEXT,
222239
'class' => $toolbar_options_classes,
223240
'std' => __( 'Sitemap', 'pojo-accessibility' ),
241+
'sanitize_callback' => 'sanitize_text_field',
224242
];
225243

226244
$fields[] = [
227245
'id' => 'pojo_a11y_toolbar_button_sitemap_link',
228246
'title' => __( 'Sitemap Link', 'pojo-accessibility' ),
229247
'type' => self::FIELD_TEXT,
230248
'placeholder' => 'https://your-domain.com/sitemap',
231-
'desc' => __( 'Link for sitemap page in your website. Leave blank to disable.',
232-
'pojo-accessibility' ),
249+
'desc' => __( 'Link for sitemap page in your website. Leave blank to disable.', 'pojo-accessibility' ),
233250
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
234251
'std' => '',
252+
'sanitize_callback' => 'sanitize_url',
235253
];
236254

237255
$fields[] = [
@@ -240,6 +258,7 @@ public function section_a11y_toolbar( $sections = [] ) {
240258
'type' => self::FIELD_TEXT,
241259
'class' => $toolbar_options_classes,
242260
'std' => __( 'Help', 'pojo-accessibility' ),
261+
'sanitize_callback' => 'sanitize_text_field',
243262
];
244263

245264
$fields[] = [
@@ -250,6 +269,7 @@ public function section_a11y_toolbar( $sections = [] ) {
250269
'desc' => __( 'Link for help page in your website. Leave blank to disable.', 'pojo-accessibility' ),
251270
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
252271
'std' => '',
272+
'sanitize_callback' => 'sanitize_url',
253273
];
254274

255275
$fields[] = [
@@ -258,17 +278,18 @@ public function section_a11y_toolbar( $sections = [] ) {
258278
'type' => self::FIELD_TEXT,
259279
'class' => $toolbar_options_classes,
260280
'std' => __( 'Feedback', 'pojo-accessibility' ),
281+
'sanitize_callback' => 'sanitize_text_field',
261282
];
262283

263284
$fields[] = [
264285
'id' => 'pojo_a11y_toolbar_button_feedback_link',
265286
'title' => __( 'Feedback Link', 'pojo-accessibility' ),
266287
'type' => self::FIELD_TEXT,
267288
'placeholder' => 'https://your-domain.com/feedback',
268-
'desc' => __( 'Link for feedback page in your website. Leave blank to disable.',
269-
'pojo-accessibility' ),
289+
'desc' => __( 'Link for feedback page in your website. Leave blank to disable.', 'pojo-accessibility' ),
270290
'class' => $toolbar_options_classes . ' pojo-settings-child-row',
271291
'std' => '',
292+
'sanitize_callback' => 'sanitize_url',
272293
];
273294

274295
$sections[] = [
@@ -305,6 +326,7 @@ public function section_a11y_settings( $sections ) {
305326
'disable' => __( 'Disable', 'pojo-accessibility' ),
306327
],
307328
'std' => 'disable',
329+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
308330
];
309331

310332
$fields[] = [
@@ -317,6 +339,7 @@ public function section_a11y_settings( $sections ) {
317339
'disable' => __( 'Disable', 'pojo-accessibility' ),
318340
],
319341
'std' => 'enable',
342+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
320343
];
321344

322345
$fields[] = [
@@ -325,6 +348,7 @@ public function section_a11y_settings( $sections ) {
325348
'placeholder' => 'content',
326349
'type' => self::FIELD_TEXT,
327350
'std' => 'content',
351+
'sanitize_callback' => 'sanitize_text_field',
328352
];
329353

330354
$fields[] = [
@@ -338,32 +362,33 @@ public function section_a11y_settings( $sections ) {
338362
'disable' => __( 'Disable', 'pojo-accessibility' ),
339363
],
340364
'std' => 'disable',
365+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
341366
];
342367

343368
$fields[] = [
344369
'id' => 'pojo_a11y_add_role_links',
345370
'title' => __( 'Add landmark roles to all links', 'pojo-accessibility' ),
346371
'type' => self::FIELD_SELECT,
347-
'desc' => __( 'This option will add <code>role="link"</code> to all links on the page.',
348-
'pojo-accessibility' ),
372+
'desc' => __( 'This option will add <code>role="link"</code> to all links on the page.', 'pojo-accessibility' ),
349373
'options' => [
350374
'enable' => __( 'Enable', 'pojo-accessibility' ),
351375
'disable' => __( 'Disable', 'pojo-accessibility' ),
352376
],
353377
'std' => 'enable',
378+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
354379
];
355380

356381
$fields[] = [
357382
'id' => 'pojo_a11y_save',
358383
'title' => __( 'Sitewide Accessibility', 'pojo-accessibility' ),
359-
'desc' => __( 'Consistent accessibility throughout your site visit. Site remembers you and stays accessible.',
360-
'pojo-accessibility' ),
384+
'desc' => __( 'Consistent accessibility throughout your site visit. Site remembers you and stays accessible.', 'pojo-accessibility' ),
361385
'type' => self::FIELD_SELECT,
362386
'options' => [
363387
'enable' => __( 'Enable', 'pojo-accessibility' ),
364388
'disable' => __( 'Disable', 'pojo-accessibility' ),
365389
],
366390
'std' => 'enable',
391+
'sanitize_callback' => [ $this, 'sanitize_enabled_disabled' ],
367392
];
368393

369394
$fields[] = [
@@ -382,6 +407,7 @@ public function section_a11y_settings( $sections ) {
382407
'720' => __( '1 Month', 'pojo-accessibility' ),
383408
],
384409
'std' => '12',
410+
'sanitize_callback' => [ $this, 'sanitize_expiration' ],
385411
];
386412

387413
$sections[] = [
@@ -544,6 +570,30 @@ public static function field_html( $input ) {
544570
return stripslashes( wp_filter_post_kses( addslashes( $input ) ) );
545571
}
546572

573+
public function sanitize_toolbar_display( $input ) {
574+
if ( empty( $input ) ) {
575+
return $input;
576+
}
577+
578+
return in_array( $input, [ 'enable', 'visible-desktop', 'visible-tablet', 'visible-phone', 'hidden-desktop', 'hidden-tablet', 'hidden-phone', 'disable' ] ) ? $input : 'enable';
579+
}
580+
581+
public function sanitize_enabled_disabled( $input ) {
582+
if ( empty( $input ) ) {
583+
return $input;
584+
}
585+
586+
return in_array( $input, [ 'enable', 'disable' ] ) ? $input : '';
587+
}
588+
589+
public function sanitize_expiration( $input ) {
590+
if ( empty( $input ) ) {
591+
$input = [];
592+
}
593+
594+
return in_array( $input, [ '1' , '6' , '12', '24', '48', '72' , '168', '720' ] ) ? $input : '12';
595+
}
596+
547597
public static function field_checkbox_list( $input ) {
548598
if ( empty( $input ) ) {
549599
$input = [];

0 commit comments

Comments
 (0)