-
Notifications
You must be signed in to change notification settings - Fork 19
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
Don't show rate limits if the reset time has passed. #356
base: develop
Are you sure you want to change the base?
Conversation
if ( $reset && $reset < time() ) { | ||
return sprintf( | ||
'<p>%s</p>', | ||
esc_html__( 'No X/Twitter rate limit available yet. Make a post to X/Twitter first.', 'autoshare-for-twitter' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as the message here goes, do we want to still refer to things as X/Twitter
or should we start just using X
? Not sure how we refer to things in other places right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are still using X/Twitter
in most places, but I think X
is now well-known enough that we can drop Twitter
from all places. @jeffpaul, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, my opinion here is for any new strings we introduce, we should just use X
and can look to update existing strings in a separate PR. I'm also fine though if we want to continue to use X/Twitter
, just noting that reads a little awkwardly and the change has been in place long enough that I think anyone using this plugin would understand what just X
means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably fine now to update to just "Autopost for X" and "X" throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good here.
While not related, both E2E tests and PHPUnit tests are failing because SVN is no longer installed by default in GitHub Actions.
The E2E tests should be fixed once 10up/action-wordpress-plugin-build-zip#8 is merged and a new release is put out.
For PHPUnit tests, we'll need to fix that on our end. Doesn't have to be done as part of this PR (could be a separate PR if you want) but would be great to resolve those. Can see how we fixed this on ClassifAI for an example
E2E tests are fixed now with the upstream release. I've also fixed the PHPUnit tests in #358, so should be good on both once that is merged in |
Description of the Change
In #354, we added an API rate limits widget to display the remaining API rate limits for the user and app. This PR makes a minor improvement by not showing the rate limits if the reset time has passed until the latest data is available.
How to test the Change
autoshare_for_twitter_accounts
option to set the reset time to a past value for one of the user accounts.Changelog Entry
Credits
Props @iamdharmesh
Checklist: