Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branded notices to inform users when AspireUpdate is in operation on a screen. #142

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Nov 5, 2024

Pull Request

What changed?

  1. A new class, AspireUpdate\Branding, has been introduced which will output an admin notice on certain screens when AP_ENABLE is true and AP_REMOVE_UI is undefined or false.
    • Dashboard > Updates
    • Plugins > Installed plugins
    • Plugins > Add New Plugin
    • Appearance > Themes
    • Appearance > Themes > Add New Theme
  2. Styles have been added for .aspireupdate-notice.
    • Example: <div class="notice aspireupdate-notice"><p>I am a notice</p></div>
  3. Tests have been added for AspireUpdate\Branding.

Dashboard > Updates
image

Plugins > Installed plugins
image

Plugins > Add New Plugin
image

Appearance > Themes
image

Appearance > Themes > Add New Theme
image

Line/Branch Coverage
image

Why did it change?

To inform users when AspireUpdate is in operation on these screens.

Did you fix any specific issues?

Fixes #72

CERTIFICATION

By opening this pull request, I do agree to abide by
the CODE OF CONDUCT and be bound by the terms
of the Contribution Guidelines in effect on the date and time
of my contribution as proven by the
revision information in GitHub. I also agree that any previous contributions shall be deemed subject to the terms of the
version in effect on the date and time of this pull request, or any future revisions for pull requests I may submit.
Further, I certify that this work is my own, is original, does not violate the intellectual property of any other person
or entity, and I am not violating any license agreements or contracts I have with any person or entity. Finally, I agree
that this code may be licensed under any license deemed appropraite by AspirePress, including but not
limited to open source, closed source, proprietary or custom licenses, and that such license terms neither violate my
rights or my copyright to this code.

@costdev costdev force-pushed the add_branding branch 2 times, most recently from 1e55241 to d3f81c6 Compare November 5, 2024 22:03
@asirota asirota requested review from asirota and namithj November 5, 2024 22:26
@ipajen
Copy link
Collaborator

ipajen commented Nov 5, 2024

Don’t forget the to add the flag to the docs https://github.com/aspirepress/AspireUpdate/blob/main/README.md

So it should not be possible to set in the GUi to close branding? Is it possible close the notice ? (Can’t see in the picture)

@asirota
Copy link
Member

asirota commented Nov 5, 2024

This is a brand so it will not have a close link or ui control. Then config parameter can be used to turn it off.

@costdev costdev force-pushed the add_branding branch 4 times, most recently from b514623 to a15ec65 Compare November 5, 2024 22:42
@ipajen
Copy link
Collaborator

ipajen commented Nov 5, 2024

This is a brand so it will not have a close link or ui control. Then config parameter can be used to turn it off.

understand, but why do we want to offer it from a config parameter to turn it off but not in GUI?

@asirota
Copy link
Member

asirota commented Nov 5, 2024

We should eliminate the config parameter? Branding is not something you can easily remove. It's not a notice.

@costdev
Copy link
Contributor Author

costdev commented Nov 5, 2024

It's not a notice.

That raises the question of whether an admin notice is a suitable approach.

We could, for example, simply remove the notice wrapper and show this:
image

Or still use the notice area, but style it differently, like:
image

@namithj
Copy link
Contributor

namithj commented Nov 6, 2024

  1. We should remove the new config parameter and connect this to the AP_NO_UI config parameter.

  2. Lets get rid of that inline svg and move it to CSS.

@namithj
Copy link
Contributor

namithj commented Nov 6, 2024

It's not a notice.

That raises the question of whether an admin notice is a suitable approach.

We could, for example, simply remove the notice wrapper and show this:

image

Or still use the notice area, but style it differently, like:

image

I like the second option.

Copy link
Contributor

@namithj namithj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We should remove the new config parameter and connect this to the AP_NO_UI config parameter.

  2. Lets get rid of that inline svg and move it to CSS.

includes/class-branding.php Outdated Show resolved Hide resolved
@costdev
Copy link
Contributor Author

costdev commented Nov 7, 2024

@namithj PR has been updated.

  1. Uses AP_REMOVE_UI instead of AP_REMOVE_BRANDING.
  2. AP_REMOVE_BRANDING has been removed.
  3. CSS is used for the SVG rather than file_get_contents(). - Nicely spotted on this one!

New screenshots are in the description.

Copy link
Member

@asirota asirota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are new strings that will need to be updated. Can you the .pot file?

@costdev
Copy link
Contributor Author

costdev commented Nov 7, 2024

@asirota Done in 76998d4.

@ipajen
Copy link
Collaborator

ipajen commented Nov 7, 2024

Maybe worth updating docs to include branding as it’s not only settings anymore

today:
Disables plugin settings user interface, defaults to config parameters set in wp-config.php

@costdev
Copy link
Contributor Author

costdev commented Nov 7, 2024

@ipajen Done in e5c4335.

@costdev costdev changed the title Add branded notices. Add branded notices to inform users when AspireUpdate is in operation on a screen. Nov 7, 2024
@namithj
Copy link
Contributor

namithj commented Nov 7, 2024

Do we need to translate the URLs?

includes/class-branding.php Show resolved Hide resolved
includes/class-branding.php Show resolved Hide resolved
includes/class-branding.php Show resolved Hide resolved
@asirota asirota merged commit b0593eb into aspirepress:main Nov 7, 2024
3 checks passed
@costdev costdev deleted the add_branding branch November 12, 2024 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support branded screens in AspireUpdate powered sites
5 participants