# Changelog for Client Power Tools

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and uses [semantic versioning](https://semver.org/).

### 1.11.8 - 2026-04-19

#### Changed
- Removed references to CPT website URL


### 1.11.7 - 2026-04-17

#### Added
- PHPCS ruleset with custom capabilities

#### Fixed
- Fix select field rendering and processing (e.g., in the the edit client and edit project forms)
- Replace custom settings saved notification with `settings_errors()`


### 1.11.6 - 2025-11-15

#### Fixed
- Fixed a Javascript error on non-client-dashboard pages


### 1.11.5 - 2025-10-26

#### Changed
- Now uses updated icons from cpt-theme


### 1.11.4 - 2025-09-29

#### Changed
- Convert status update request button label to sentence case


### 1.11.3 - 2025-09-01

#### Added
- New `/assets/js/cpt-prevent-offscreen-submenus.js` prevents submenus from appearing offscreen

#### Changed
- Inactive clients are now dimmed in the admin client list. [See note.](https://github.com/samglover/client-power-tools/pull/87)
- Margins removed from menu items and sub-menus by default to help with theme compatibility
- Drop-down menus updated with improvements from `cpt-theme`: [samglover/cpt-theme@aaf14d1](https://github.com/samglover/cpt-theme/commit/aaf14d172983e220f9034f55f5d1bedcd8cff622) & [samglover/cpt-theme@9c6d62a](https://github.com/samglover/cpt-theme/commit/9c6d62a787cb7f4acc58c09e62b066a54f1e3f92)


### 1.11.2 - 2025-08-31

#### Changed
- Migrated `@import` SCSS rules to `@use`


### 1.11.1 - 2025-03-17

#### Added
-  POT file for localization


### 1.11.0 - 2025-03-16

#### Added
- PHP documentation according to the WordPress Coding Standards
- New functions in /common/cpt-common.php for retrieving and sanitizing user data and user meta from `$_POST`:
  - `cpt_get_client_userdata_keys()`
  - `cpt_get_sanitized_userdata_from_post()`
  - `cpt_get_client_usermeta_keys()`
  - `cpt_get_sanitized_usermeta_from_post()`
- Sanitize `$_POST` variables in /common/cpt-status-update-request-button.php

#### Changed
- Tidied up in general while adding documentation
- Rename `cpt_days_since_last_request()` to `cpt_get_days_since_last_request()`, and now it returns false instead of null
- Clear location before reloading the page on successful login
- Refactor and simplify `cpt_is_client_dashboard()` function
- Rename files according to WP Coding Standards:
  - cpt-clients-table.php -> class-client-list-table.php
  - cpt-projects-table.php -> class-project-list-table.php
  - cpt-admin-messages-table.php -> class-project-list-table.php
  - cpt-project-types-table.php -> class-project-types-list-table.php
- Replace `wp_redirect( $_POST['_wp_http_referer'] )` with `wp_safe_redirect( wp_get_referer() )` throughout
- Refactor deleting a project type

#### Removed
- `cpt_admin_actions()` because it wasn't actually doing anything
- `cpt_remove_client_manager()` because it was simple enough to handle in `cpt_process_client_manager_actions()`


### 1.10.3 - 2025-01-19

#### Added
* Modal pop-ups now scroll into view when triggered.
* Error notices in the login modal now fade out after a short delay.

#### Fixed
* AJAX error was preventing the "login failed" notice when trying to log in with a non-user email address.


### 1.10.2 - 2024-12-08

#### Added
* The modal dismiss button now has a screen reader text element within it for improved accessibility.


### 1.10.1 - 2024-11-15

#### Added
- Default login modal styles.

#### Changed
- Added space between project type edit form fields.


### 1.10.0 - 2024-10-28

#### Added
- Default styles for the navigation menu. These should be overidden by themes that include styles for regular WordPress menus, and have low specificity so they are easy to override with custom CSS. (The default styles are not applied to the [Client Power Tools theme](https://github.com/samglover/cpt-theme).)


### 1.9.3 - 2024-10-27

#### Changed
- Reorganized and streamlined some code.

#### Fixed
- Fixed duplicate dashboard output and message output.


### 1.9.2 - 2024-10-27

#### Added
- \[client-dashboard] shortcode allows the dashboard to be placed manually on the dashboard page.

#### Changed
- Abstracted several dashboard functions to make the code easier to follow and to make it easier to implement the new shortcode.

#### Fixed
- Content added to the dashboard page in the WordPress editor no longer shows up on the Messages and Projects pages/tabs.
- Enforced strict type comparison and Yoda condition checks for the cpt_is_client_dashboard() and related functions.


### 1.9.1 - 2024-10-25

#### Changed
- References to WP_User_Query now use the correct case (WP_User_Query instead of WP_USER_QUERY).

#### Fixed
- Fixed potential cross-site scripting (XSS) vulnerability.


### 1.9.0 - 2024-10-24

#### Added
- Installed Composer in order to use WordPress Coding Standards formatting aids.
- Added notes for translators.

#### Changed
- Include WP_List_Table from core instead of including the file.
- Reformatted PHP according to the WordPress Coding Standards.
- Switch the SVG logo used in the admin for a PNG to fix a Plugin Check alert.

#### Removed
- /includes
- /includes/class/wp-list-table.php

#### Fixed
- Added escape functions for all output to resolve Plugin Check alerts. In many cases this resulted in minor changes to the output, some of which would impact existing translations. As a result this release merits a minor version increment to 1.9.0, but since there are no actual translations (that I am aware of, at least) I don't think it will impact any existing users.


### 1.8.6 - 2024-08-25

#### Fixed
- Fixed a bug in cpt_messages() where calling get_the_ID() after cpt_messages() would return the last message ID instead of the main post ID.
- Fixed a bug in cpt_get_notices() where WordPress would add a second, unstyled dismiss button to notices on the frontend.


### 1.8.5 - 2024-06-09

#### Changed
- Admin styles and scripts are now loaded only on CPT admin pages.
- Removed cpt_redirect_clients() function from /admin/cpt-admin.php because it wasn't actually doing anything.

#### Fixed
- The guard statements in the cpt_admin_actions() function in /admin/cpt-admin.php were over-inclusive and allowing some processes through only to cause them to fail. See [issue #40](https://github.com/samglover/client-power-tools/issues/40) for an example where WP All Import uploads were failing. This is now fixed.


### 1.8.4 - 2024-01-23

#### Changed
- Name updated to Client Power Tools Portal since there is also a Client Power Tools theme and several helper plugins.
- Split up /assets/js/cpt-frontend.js into /assets/js/cpt-login-modal.js and /assets/js/cpt-notices.js.
- Simplified the login modal and notices functionality and styling. The CSS styling has been simplified with the idea that it should be relatively easy to customize. (Here is how I customize Client Power Tools for my own theme: https://github.com/samglover/cpt-theme/blob/main/assets/scss/_customize-cpt.scss. Each SCSS variable pulls in a corresponding CSS variable from theme.json that applies my styles for things like borders and shadows so that Client Power Tools looks as much a part of the theme as possible.)
- The client dashboard nav menu now uses the same classes as regular WordPress menus, so it should inherit styling and dropdown behavior, as well. This drastically reduces the amount of styling added by this plugin.
- Enabling breadcrumb navigation now applies to additional pages as well as the knowledge base.

### Fixed
- Fixed error when sending messages from the front end.
- Fixed login modal animation.

### Removed
- Removed the /frontend/images folder and its contents, which were not used anywhere.


### 1.8.3 - 2024-01-11

#### Changed
- Added .wp-element-button to all buttons for better theme.json compatibility.


### 1.8.2 - 2024-01-08

#### Changed
- Client manager and custom fields are wider.
- Disabled project type taxonomy archive pages.
- Disabled autocomplete on the new- and edit-client forms.


### 1.8.1 - 2023-10-13

#### Fixed
- Get client name for the admin client list table.
- Don't show recipients if they weren't stored when sending the message.


### 1.8.0 - 2023-10-13

#### Added
- Separate client name and primary contact name.
- Add additional contacts to be CCed on messages.


### 1.7.8 - 2023-08-08

#### Fixed
- The login form would sometimes fail under unusual conditions. Now it should happily log you in as expected, or else deliver error messages instead of just sitting there opaquely.


### 1.7.7 - 2023-08-03

#### Changed
- Renamed the primary dashboard page in the navigation tabs to "Home.'
- Moved the page title filter from /common/cpt-common.php to /frontend/cpt-frontend.php.

#### Fixed
- The home page title would show as "Client Dashboard: Client Dashboard" which was dumb. Fixed.


### 1.7.6 - 2023-07-27

#### Added
- cpt_is_additional_page()
- cpt_add_nav_to_addl_pages()

#### Changed
- No longer shows projects in the client list table if the Projects module is not active.
- Consolidated Knowledge Base breadcrumbs logic in the cpt_breadcrumbs function.
- Clarified cpt_is_knowledge_base() logic.
- cpt_is_client_dashboard() now functions more intuitively. If no arguments are given, it returns true if any dashboard page is being shown. Arguments may also be given in the form of an array.
- Page titles within the client dashboard now include both the dashboard title and the name of the page for all pages.

#### Deprecated
- Deprecated the confusingly named cpt_is_cpt() function from /frontend/frontend.php. cpt_is_client_dashboard() does the same job. (cpt_is_cpt() still works; it just returns the output of cpt_is_client_dashboard()).


### 1.7.5 - 2023-07-24

#### Added
- cpt_is_client_dashboard('additional page') now returns true on additional pages and their descendants.


### 1.7.4 - 2023-05-22

#### Changed
- Capitalize project labels just in case the user doesn't.
- Add body classes for the primary dashboard tabs (dashboard, projects, and messages).
- Updated front-end project page.


### 1.7.3 - 2023-05-10

#### Changed
- TinyMCE editor toolbar simplified.
- Restore message background color.

#### Fixed
- Prevent multiple CPT nav menus from showing up on the knowledge base.


### 1.7.2 - 2023-05-08

#### Changed
- Added a "no projects found" message when a client does not have any projects.

#### Removed
- Removed custom fields from project forms.

#### Fixed
- Fixed a bug that was causing messages to be sent to the sender rather than the intended recipient, which is obviously not how it is supposed to work.


### 1.7.1 - 2023-05-08

#### Changed
- Defaults for new project-related settings.
- Updated readme.txt.


### 1.7.0 - 2023-05-08

#### Added
- NEW MODULE: Projects & Stages! Organize your client projects and assign stages to different project types.
- The new project widget and progress bar give a visual representation of your client's projects on their profile and dashboard.
- Customize the projects label to whatever makes sense for your industry (e.g., files, accounts, matters, cases, dossiers).

#### Changed
- Change capability names (replaced hyphens with underscores).
- Removed the default client manager.
- Show an error if a page requests a nonexistent client.
- Lots of small user experience improvements and updates.
- All forms updated with an improved layout.
- Reorganized stylesheets.

#### Removed
- /assets/js/messages.js (It was empty.)

#### Fixed
- When one expander is active, clicking another expander now closes it and restores the button label.
- Fixed page titles not showing up on empty dashboard pages.
- Lots of smaller fixes in the course of adding the Projects & Stages module.


### 1.6.5 - 2023-02-10

#### Changed
- Status update request button background color no longer set to inherit.
- Updated readme.txt.


### 1.6.4 - 2023-01-25

#### Fixed
- Fixed a variable type bug in the CPT nav menu that apparently could prevent the login code from sending.


### 1.6.3 - 2023-01-17

#### Fixed
- Fixed an error generated by the client manager drop-down menu.


### 1.6.2 - 2022-12-21

#### Changed
- Don't try to show a client manager when one hasn't been set, yet.

#### Fixed
- Fixed an activation error thrown when there is no default client manager.


### 1.6.1 - 2022-12-10

#### Fixed
- Fixed bug that would display the Client Dashboard twice in the CPT nav menu, and would not tolerate an empty additional pages field.
- Fixed a bug that displayed the CPT nav menu twice on additional pages on some sites.


### 1.6.0 - 2022-12-10

#### Added
- It's now possible to add pages to the client dashboard navigation. Additional pages will be restricted to logged-in clients.
- Optionally, include child pages of additional pages in the client dashboard navigation.


### 1.5.6 - 2022-11-23

#### Fixed
- Fixed login link on client dashboard.


### 1.5.5 - 2022-11-21

#### Added
- New filter: It is now possible to add fields to the Edit Clients dialog using the cpt_custom_fields filter.


### 1.5.3 - 2022-11-20

#### Fixed
- Status update request button now inherits its background color.


### 1.5.2 - 2022-11-07

#### Added
- Knowledge base breadcrumbs are now optional.
- Reminder to clients to check their spam folder for the login code.
- [status-update-request-button] shortcode.
- Show last activity in the admin client list.

#### Changed
- Status update request message now makes sense when messaging is disabled.
- Status update request button is now disabled with "Status Update Requested" instead of invisible when an update has been requested.
- Change knowledge base submenu drop-down animation.

#### Removed
- Somehow a number of files had gotten duplicated in the wrong directories. They're gone now.
- Consolidated /frontend/cpt-knowledge-base.php with /frontend/cpt-client-dashboard.php since it was basically just a duplicate anyway.


### 1.5.1 - 2022-11-04

#### Fixed
- The navigation tabs now fold up nicely at narrow widths.


### 1.5.0 - 2022-11-03

#### Added
- IMPORTANT: Passwordless login. The default frontend login process is now passwordless. Instead of entering a username and password, clients request a login code by email. (Username and password is still available.)

#### Changed
- Updated the new-client welcome message for passwordless login.
- The frontend login form now uses AJAX rather than reloading the page with each submission.
- Adjusted login modal max width.
- Move the new and edit client forms to their own files, /admin/cpt-new-client-form.php and /admin/cpt-edit-client-form.php.
- Simplified notices in the admin and on the front end.
- Numerous minor formatting changes, tweaks, cleanup, and reorganizing, as usual.

#### Fixed
- Fix the modal dismiss button display.
- Restore button code style to email cards.
- Added overflow scrolling for modals.


### 1.4.11 - 2022-09-16

#### Fixed
- Restored client manager access to WP admin.


### 1.4.10 - 2022-09-15

#### Added
- Added version numbers to to all enqueued scripts and styles as cachebusters.
- Added a New Message button to message lists.

#### Changed
- Lots of code cleanup and reformatting.
- Reduced output buffering.
- Simplified message meta.

#### Fixed
- Removed overflow: scroll from modal cards.
- Expanders in the admin now work as expected.


### 1.4.8 & 1.4.9 - 2022-03-14

#### Changed
- Moved CSS, JS, and image files to /assets.
- Configured for SASS.
- Replaced all icons with SVG images using file_get_contents() instead of <img> tags.
- Updated various styles to be more flexible and consistent across themes.

#### Fixed
- Fixed an error that prevented the login/logout modal from displaying.


### 1.4.7 - 2022-01-12

#### Changed
- Specify border for modal dismiss button for themes that might try to add a border.
- Add .button class to the password reset submit button so it's more likely to pick up the button style from the theme.

#### Fixed
- Fixed the cpt_is_client() function for users with no roles.
- Fixed the modal dismiss button when there are more than two modals on the page.


### 1.4.6 - 2022-01-01

#### Fixed
- Fixed a JS error when the page is not a client page.


### 1.4.5 - 2021-12-31

#### Changed
- Added nofollow to the login modal links.

#### Fixed
- Fixed a PHP error when the page does not have an ID.


### 1.4.4 - 2021-12-28

#### Changed
- Clarified the additional status update request notification instructions on the settings page.
- Clarified the new client account activation email message body instructions on the settings page.
- Don't know messages on client profiles in the admin if messaging is disabled.


### 1.4.3 - 2021-10-08

#### Added
- Message links in the admin message list now go to the page on which the message appears.


### 1.4.2 - 2021-06-06

#### Changed
- Removed jQuery from cpt-admin.js.
- Removed jQuery from cpt-frontend.js.


### 1.4.1 - 2021-02-12

#### Added
- Added a wrapper for the status request update button.


### 1.4.0 - 2021-01-12

#### Added
- NEW MODULE: Knowledge Base! The knowledge base is a restricted page you can use to share information and resources with your clients. Add as many sub-pages as you like; they will be nicely organized in an index for your clients.
- Client dashboard pages now have navigation tabs, including breadcrumbs and a drop-down index to help clients navigate your knowledge base.

#### Changed
- The settings page is better organized, with general/core settings, then settings for each module.
- Each of the non-core modules can be disabled. Currently the non-core modules are the Status Update Request Button, Messaging, and Knowledge Base.
- You can now add content to the main client dashboard page, which will be shown below the welcome message and status update request button (if it is enabled).

#### Fixed
- Untitled messages no longer show "Untitled" as the title.


### 1.3.1 - 2020-12-18

#### Added
- Welcome message.

#### Changed
- Only show the SSL warning on CPT admin pages.


### 1.3.0 - 2020-11-24

#### Added
- Client managers can now be added and removed from the new **Managers** submenu, and are also shown in the client list and client profile. As you can when adding a client, you can add a new or existing WordPress user.
- Assign a default client manager in the settings.
- Filter the client list by clients assigned to you ("Mine").

#### Changed
- The add-client form is now on the Clients page.
- Messages and status update requests now go to the client manager. (The email will be CC'd to the now-optional status update request notification email address, if you have set one.)
- New client emails will now come from the client manager instead of a default name and email address.
- Update the element expander script so it can handle multiple expanders on the same page. Also, form elements within an expander with data-required="true" will have the required attributes removed when hidden.
- Make cpt_get_notices() easier to use by changing the argument to an array so it only needs to be called once.

#### Fixed
- The standard login form no longer redirects to a blank page when a redirect is present.


### 1.2.1 - 2020-10-24

#### Fixed
- Adding an existing user as a client now works as it should.


### 1.2.0 - 2020-10-23

#### Added
- Setting to disable the status request button entirely.
- Setting to change the default email behavior to include the full message, rather than just a notification.
- Override the default email behavior on individual messages.

#### Changed
- Creating a new client with an existing user's email address now adds the Client role to the existing user instead of returning an error.


### 1.1.0 - 2020-10-20

#### Added
- Delete a client from the client's profile page, under **Edit Client**.


### 1.0.5 - 2020-10-07

#### Changed
- Handle frontend login error on the front end.
- General tidying up.

#### Removed
- Remove unused capabilities from Client Manager role (for now).
- Remove unused functions cpt_get_client_profile_link and cpt_get_client_id.

#### Fixed
- Email notifications should now deliver with the intended formatting.
- Implemented a simpler fix for the client dashboard's the_content filter infinite nesting of messages.


### 1.0.4 - 2020-10-05

#### Fixed
- Prevent not-logged-in messages from displaying in the head when the_content filter is called (by Yoast SEO, for example).


### 1.0.3 - 2020-10-05

#### Fixed
- Center the modal dismiss button.
- Fix false negatives from cpt_is_client if the user is not logged in but the user ID is provided.
- Prevent Client Power Tools from intercepting the password reset workflow for non-clients.


### 1.0.2 - 2020-10-02

#### Fixed
- Fixed URL encoding.


### 1.0.1 - 2020-10-02

#### Fixed
- Check for main query on client dashboard.
- Fixed set/change password key sanitization.


### 1.0.0 - 2020-10-02

#### Added
- Added some frontend form styles for greater compatibility with different themes.

#### Changed
- Override default button display style on dismiss button.
- Change constant prefix from CPT_ to CLIENT_POWER_TOOLS_.
- Data sanitization and validation.


### 0.1.0 (Beta) - 2020-09-23

#### Added
- Everything.
