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

Rename Blog.isHostedAtWPcom for clarity #15089

Open
guarani opened this issue Oct 13, 2020 · 3 comments
Open

Rename Blog.isHostedAtWPcom for clarity #15089

guarani opened this issue Oct 13, 2020 · 3 comments

Comments

@guarani
Copy link
Contributor

guarani commented Oct 13, 2020

Expected behavior

By its name alone, one would expect Blog.isHostedAtWPcom to be true for all WordPress.com sites, whether or not they have plugins installed. It's not true in this scenario, because it's actually just an indication of whether or not Jetpack is installed. So it would be better to rename it to make this clearer.

Actual behavior

Blog.isHostedAtWPcom is false for WordPress.com sites with plugins installed because it's actually just the negation of !blog.jetpack.

The current naming is likely the reason @-mentions is disabled on WordPress.com sites with plugins installed. So there are likely real negative consequences to keeping the current naming.

Steps to reproduce the behavior

  1. Log into WPiOS and choose a WordPress.com site that has plugins installed (requires paid plan).
  2. Put a breakpoint on the following line and observe that isHostedOnWPcom is false/0:
    blog.isHostedAtWPcom = !remoteBlog.jetpack;

Proposed solution

I think we should rename it to Blog.isWPComSimpleSite. This would involve renaming the variable in code as well as in the Core Data data model.

Tested on iPhone, iOS 14, WPiOS 6895ab8
@guarani guarani changed the title Rename isHostedAtWPcom for clarity Rename Blog.isHostedAtWPcom for clarity Oct 13, 2020
@guarani
Copy link
Contributor Author

guarani commented Oct 13, 2020

I've also noticed WordPress.com sites with plugins installed can't be switched to private using WPiOS but can be switched using WPAndroid. This happens because of:

case BlogFeaturePrivate:
// Private visibility is only supported by wpcom blogs
return [self isHostedAtWPcom];

Tested on WPiOS 15.8 and WPAndroid 15.9 (beta)

@guarani
Copy link
Contributor Author

guarani commented Oct 13, 2020

WPiOS doesn't show a Language option on the Settings screen (I'd expect to see it under the GENERAL section, below Time Zone) for WordPress.com sites with plugins installed.
Interestingly, neither does WPAndroid.

Based on the following comment though, I think the fact that the Language option is not present might be an oversight:

// Privacy and Language are only available for WordPress.com admins
if (!self.blog.supportsSiteManagementServices) {
rowCount -= 2;
}

@stale
Copy link

stale bot commented Apr 30, 2022

This issue has been marked as stale because:

  • It has been inactive for the past year.
  • It isn't in a project or a milestone.
  • It hasn’t been labeled [Pri] Blocker, [Pri] High, or good first issue.

Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions.

@stale stale bot added the [Status] Stale label Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants