wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.68k stars 1.12k forks source link

Rename Blog.isHostedAtWPcom for clarity #15089

Open guarani opened 4 years ago

guarani commented 4 years ago

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: https://github.com/wordpress-mobile/WordPress-iOS/blob/b347ef8c2488401c1df006e548cc2d5aee42c8d8/WordPress/Classes/Services/BlogService.m#L723

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 https://github.com/wordpress-mobile/WordPress-iOS/commit/6895ab8995432202b0aa5ab0ebe96939c49ff2b6
guarani commented 4 years ago

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:

https://github.com/wordpress-mobile/WordPress-iOS/blob/8bfca4663f4beeab131ec1d67e2d4cf6f946f5a0/WordPress/Classes/Models/Blog.m#L504-L506

Tested on WPiOS 15.8 and WPAndroid 15.9 (beta)

guarani commented 4 years ago

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:

https://github.com/wordpress-mobile/WordPress-iOS/blob/50e1647c52304eef6b84fd330729d03be9796040/WordPress/Classes/ViewRelated/Blog/Site%20Settings/SiteSettingsViewController.m#L237-L240

stale[bot] commented 2 years ago

This issue has been marked as stale because:

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.