Code Monkey home page Code Monkey logo

wordpress-ios's Introduction

WordPress for iOS

Build Instructions

Please refer to the sections below for more detailed information. The instructions assume the work is performed from a command line inside the repository.

Getting Started

  1. Download and install Xcode. Refer to the .xcode-version file for the minimum required version.
  2. Clone this repository in the folder of your preference.

Create WordPress.com API Credentials

  1. Create a WordPress.com account at https://wordpress.com/start/user (if you don't already have one).
  2. Create an application at https://developer.wordpress.com/apps/.
  3. Set Website URL to any valid host, Redirect URLs to https://localhost, and Type to Native.
  4. Click "Create" then "Update".
  5. Copy the Client ID and Client Secret from the OAuth Information.

Configure Your WordPress App Development Environment

  1. Check that your local version of Ruby matches the one in .ruby-version. We recommend installing a tool like rbenv so your system will always use the version defined in that file. Once installed, simply run rbenv install in the repo to match the version.
  2. Return to the command line and run rake init:oss to configure your computer and WordPress app to be able to run and login to WordPress.com
  3. Once completed, run rake xcode to open the project in Xcode.

If all went well you can now compile to your iOS device or simulator, and log into the WordPress app.

Note: You can only log in with the WordPress.com account that you used to create the WordPress application.

Configuration Details

The steps above will help you configure the WordPress app to run and compile. But you may sometimes need to update or re-run specific parts of the initial setup (like updating the dependencies.) To see how to do that, please check out the steps below.

Third party tools

We use a few tools to help with development. Running rake dependencies will configure or update them for you.

CocoaPods

WordPress for iOS uses CocoaPods to manage third party libraries. Third party libraries and resources managed by CocoaPods will be installed by the rake dependencies command above.

SwiftLint

We use SwiftLint to enforce a common style for Swift code. The app should build and work without it, but if you plan to write code, you are encouraged to install it. No commit should have lint warnings or errors.

You can set up a Git pre-commit hook to run SwiftLint automatically when committing by running:

rake git:install_hooks

This is the recommended way to include SwiftLint in your workflow, as it catches lint issues locally before your code makes its way to Github.

Alternately, a SwiftLint scheme is exposed within the project; Xcode will show a warning if you don't have SwiftLint installed.

Finally, you can also run SwiftLint manually from the command line with:

rake lint

If your code has any style violations, you can try to automatically correct them by running:

rake lint:autocorrect

Otherwise you have to fix them manually.

Open Xcode

Launch the workspace by running the following from the command line:

rake xcode

This will ensure any dependencies are ready before launching Xcode.

You can also open the project by double clicking on WordPress.xcworkspace file, or launching Xcode and choose File > Open and browse to WordPress.xcworkspace.

Setup Credentials

In order to login to WordPress.com with the app you need to create an account over at the WordPress.com Developer Portal.

After you create an account you can create an application on the WordPress.com applications manager.

When creating your application, you should select "Native client" for the application type. The "Website URL", "Redirect URLs", and "Javascript Origins" fields are required but not used for the mobile apps. Just use https://localhost.

Your new application will have an associated client ID and a client secret key. These are used to authenticate the API calls made by your application.

Next, run the command rake credentials:setup you will be prompted for your Client ID and your Client Secret. Once added you will be able to log into the WordPress app

Remember the only WordPress.com account you will be able to login in with is the one used to create your client ID and client secret.

Read more about OAuth2 and the WordPress.com REST endpoint.

Contributing

Read our Contributing Guide to learn about reporting issues, contributing code, and more ways to contribute.

Security

If you happen to find a security vulnerability, we would appreciate you letting us know at https://hackerone.com/automattic and allowing us to respond before disclosing the issue publicly.

Getting in Touch

If you have questions about getting setup or just want to say hi, join the WordPress Slack and drop a message on the #mobile channel.

Resources

License

WordPress for iOS is an Open Source project covered by the GNU General Public License version 2.

wordpress-ios's People

Contributors

aerych avatar alpavanoglu avatar astralbodies avatar bjtitus avatar bummytime avatar crazytonyli avatar ctarda avatar danielebogo avatar diegoreymendez avatar dvdchr avatar elibud avatar etoledom avatar frosty avatar hassaanelgarem avatar jklausa avatar jkmassel avatar jleandroperez avatar kean avatar koke avatar kurzee avatar leandroalonso avatar loremattei avatar mokagio avatar momo-ozawa avatar nheagy avatar scoutharris avatar sendhil avatar sergioestevao avatar staskus avatar twstokes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-ios's Issues

List of non-localizable strings

Went through what I think is most of the app, but please have a look at the Crash Report screen as well. These strings really should be translateable since it makes the app broken if you don't know English -- and look funny either way.

Set up:
"This account has two step authentication enabled. Please configure an application-specific password to use with this application."

Old set up (add blogs): All strings as far as I can tell -- both for the old set up if you don't have any blogs (display intro text, logo, etc) and if you already have blogs in there (only 3 buttons and 2 descriptions).

About:"WordPress for iOS", "Publisher", "Copyright", "Terms of Service", "Privacy Policy"

Notification settings: all the main toggles, "Follows", "Achievements", "Comments", etc

Post Editor: Settings: "Format" and all post formats, "Set Featured Image"

Media: long strings uploading message are cut off (only one line here) and there's really no way around a long string in at least swedish.

Notifications:
Overview: all the text in the actual notifications, but maybe this can only be done WPcom side?
Comment: "Tap to reply", "Replying...", "Reply"
Lists: "These people liked your post:", "This person liked your post:", "to see them all, visit the post.", "x people liked it so far. Nice!", re-blogs and follow lists are out of order too, e.g. "view all followers"

Reader:
Overview: "on X" ("on BlogNameHere")
Commenting: "on X" ("on BlogNameHere" in navbar), "to X" ("to UserNameHere" in navbar), "Comment" button needs to be a new string since it's a verb here, not a noun - which are different strings in non-english languages.
Friend Finder: all of it, but I'm guessing this is because it's not native and should be fixed with the code clean up and refactoring -- ?

Infinite scroll stops working after "empty" sync

If you pull to refresh on the reader and there's no new content, the onSyncSuccess:response: callback sets _hasMoreContent = NO.

After that, infinite scroll is never triggered until you change topics

Reblog might crash if blogs list isn't downloaded

-[ReaderReblogFormView handleSendButtonTapped:] calls self.post reblogPostToSite:_siteId ....

_siteId is set by setDestinationBlog:, which is called when the user switches blog or when the reblog form is initialized:

- (id)initWithFrame:(CGRect)frame {
//...       
        NSArray *blogs = [[NSUserDefaults standardUserDefaults] arrayForKey:@"wpcom_users_blogs"];
        if ([blogs count] > 1) {
//...
            NSNumber *primaryBlogId = [[NSUserDefaults standardUserDefaults] objectForKey:@"wpcom_users_prefered_blog_id"];
            [blogs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                if ([[obj numberForKey:@"blogid"] isEqualToNumber:primaryBlogId]) {
                    [self setDestinationBlog:obj];
                    stop = YES;
                }
            }];
        } else if ([blogs count]) {
            [self setDestinationBlog:[blogs objectAtIndex:0]];
        }
//...
}

wpcom_users_blogs is populated by -[ReaderPostsViewController fetchBlogsAndPrimaryBlog], but a user might tap a reblog button before that request is finished, _siteId will be nil, and this will crash:

- (void)reblogPostToSite:(id)site note:(NSString *)note success:(void (^)())success failure:(void (^)(NSError *error))failure {
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:site forKey:@"destination_site_id"];

Crash 1276

Turning off notifications should hide/disable notification settings

The expected behaviour for turning off notifications would be for all the fields to disappear -- you turned it off, none of that matters now. If you only turned it off for a limited period of time we could instead disable all toggles but the best option may be to, again, hide all the fields.

Limit the length of a post title

It doesn’t appear that there’s a limit to the length of a title for a post – might want to ellipsize them after a couple of lines so they take up less space

Crash on -[PostSettingsViewController viewDidLoad]

PostSettingsViewController.m line 144
__41-[PostSettingsViewController viewDidLoad]_block_invoke

Fatal Exception NSInvalidArgumentException
-[__NSCFBoolean length]: unrecognized selector sent to instance 0x3ab41538

Relevant code:

            [self.post getFeaturedImageURLWithSuccess:^{
                if (self.post.featuredImageURL) {
                    NSURL *imageURL = [[NSURL alloc] initWithString:self.post.featuredImageURL];

Feels unlikely that self.post.featuredImageURL can be a boolean, so maybe related to memory-management

Stats timeout triggered "wrong password" procedure

Not sure I'll ever be able to reproduce, but I'm on a connection that drops a lot of packets today. I got timout errors and when I tried viewing Stats once it said the password was out of date and redirected to an Edit Blog screen to update - ouch. After I tried to reproduce a few times it randomly just worked again (I never changed the password).

Needs investigating, we shouldn't ever ask people to update passwords unless that's really the issue. FYI I have 2fa enabled and an app-specific pass in the app.

Crash on -[EditPostViewController autosaveContent]

EditPostViewController.m line 673
-[EditPostViewController autosaveContent]

Fatal Exception NSObjectInaccessibleException
CoreData could not fulfill a fault for '0x1cda2e40 x-coredata://6E653FA8-CC77-4648-A029-5998E6681583/Post/p78'

Enable some sort of paging or infinite scroll to show all comments.

Kind of a bug, kind of an enhancement. The reader comment list should load more and this is broken. A problem with loading more while scrolling is what we do with previously orphaned comments now that fresh content that includes their parent. If they would appear above the current scroll position its a bad experience.

Some sort of paging vs scrolling might be an angle of attack but the underlying issue is we get the data chronologically and flat vs chronologically and nested.

Fetching primary blog doesn't work

From ReaderPostsViewController fetchBlogsAndPrimaryBlog:

__block NSNumber *preferredBlogId; // We store the primary blog here
//...
// This queues a network call
[[WordPressComApi sharedApi] getPath:@"me"
                          parameters:nil
                             success:^(AFHTTPRequestOperation *operation, id responseObject) {
                                 NSDictionary *dict = (NSDictionary *)responseObject;
                                 NSNumber *primaryBlog = [dict objectForKey:@"primary_blog"];
                                 [usersBlogs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                                     if ([primaryBlog isEqualToNumber:[obj numberForKey:@"blogid"]]) {
// At this point, nothing is going to read what's in preferredBlogId
                                            preferredBlogId = [obj numberForKey:@"blogid"];
                                         *stop = YES;
                                     }
                                 }];
                             } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                             }];
// but continues right away
//...

// Network call hasn't finished yet, so this is nil
if (!preferredBlogId) {
    NSDictionary *dict = [usersBlogs objectAtIndex:0];
    preferredBlogId = [dict numberForKey:@"blogid"];
}

I haven't really tested but I remember seeing the wrong blog pre-selected on reblog.

Problem here is that we rely on the success block to set the block variable preferredBlogId, but the API call is async and by the time preferredBlogId is set the rest of the method has been executed already.

Edit blogs in Settings is visually broken

Tapping Edit in Settings causes strange animations to the tableview cells containing your currently added blogs -- this is on iOS7 with two WPcom blogs only if that matters.

  1. Open Settings
  2. Tap Edit, animations are broken
  3. Tapping Edit again causes the button to get a broken styling (bg changes back to secondary but text still has primary button styling)

Friend finder isn't loading

I'm still not sure if it's iOS7 only, but:

  • The xib was missing
  • loadURL: is called before the view/webBridge are available

No way to exit add blogs screen if you've tapped (i)

Just noticed this in the current live version (3.7). My set up is: logged in to a WordPress.com account only (with 2fa if that matters), no blogs added, swedish localization. On iPhone 5 with iOS7 beta 6.

Steps to reproduce:

  1. Go to Settings > Add a Blog
  2. Tap info button (flip to About screen)
  3. Tap Close
  4. Navbar never reappears

No visual indicator of multiple selected blogs in new NUX

Haven't reproduced yet, but it seems as if you can't (at least visually) add more than one blog running 3.7 final.

  1. Go through set up and log in to an account with multiple blogs
  2. Select blogs screen shows 1st blog selected and the button has an updated count
  3. Select another blog and that is now highlighted but the previous blog looses the check mark and highlighting, however the button count is correct.

Improve image loading

Most of the times it feels the image loading is slow while scrolling. Once scrolling stops the image might take a few seconds until it appears.

Some ideas to consider:

  • Cache more aggressively on disk
  • When decelerating, calculate where the list will land and prioritize that image
  • Other ways to reprioritize downloads so whatever is (or will be) visible is downloaded first

Improve two-step log in flow

UX rough patch: if you have two-step authentication enabled for your WordPress.com blog, the process to add it in is all but smooth.

1.Sign into a WordPress.com account with two-step authentication enabled
2. A popup tells you you can't log in because you have two-step enabled, and that you need to generate an app specific password (but this seems to display in the Select Blogs screen on iPad so if you dismiss it you end up with an "empty" list and have to tap Back)
4. Go Back
5. Figure out what an app-specific password is
6. Generate app-specific password on desktop
7. Enter in all your details again

The expected process would most likely look like this instead:
(0.) A check on username is performed when entered to see if they're WPcom and if they have two-step enabled. If both are true, the description of the password field changes and there's info text about two-step below it, including a link to an FAQ entry and/or a WordPress.com support page

  1. Enter your credentials
  2. Learn what an app-specific password is
  3. Generate app-specific password on desktop
  4. Enter it into the field, log in

If we can't check for two-step like this I think we can at least do some work on the error message -- maybe use the new error messages, exchange the field description to also include a link to an FAQ entry or similar.

Spousal Reader Feedback!

My spouse is a big reader user, and she had some thoughts about the native release:

  • It refreshes very slowly, which I've confirmed. Seems to take a good 10 seconds or so. Is our REST API to blame?
  • It doesn't appear to grab the latest content straight away. She noticed a friend's publicized post on fb and went to the reader to check it out, but the post wasn't there yet after a refresh. After a few minutes it finally showed. Again, a REST issue?

cc @aerych

Reader pull-to-refresh doesn't update

The Reader is the only place I've noticed this: wait for it to refresh by itself, then pull to refresh. The message never changes to "Release...". It still works, but feels buggy.

Infinite scroll doesn't work while syncing

WPTableViewController checks this before triggering infinite scroll:

if (![self isSyncing] && [self hasMoreContent])

While we shouldn't duplicate "load more" requests, isSyncing might be YES because of a regular pull to refresh

Notifications UI bugs

Notifications is rough in 3.7.

When a comment has parents and the first parent finishes loading, the arrow animates in on top of the top section of the child comment (don't have a screenshot for this but it's easy to replicate and has been persistent for a while).

Comments with parent comments always display a double arrow until the parent comment has loaded, and the avatar height changes when the parent is loaded as well, see these two:
notifsarrow
notifsarrow2

The grandparent has the arrow graphics overlaying the entire top of the comment:
notifsarrow3

Reader detail view link view stacking

As reported by koke from the road:

"Open an article with a link on the reader, tap the link and it opens a browser. Tap it again and a second browser is stacked. Each tap keeps opening new panels."

Don't capitalize translated reader sections

The reader view controller sets its title:

self.title = [[[ReaderPost currentTopic] objectForKey:@"title"] capitalizedString];

This might be necessary for topics, but strings that are translated look weird when capitalized, at least in Spanish ("Blogs Que Sigo").

Improve reblog form

The UI of this form was intended to be similar to the notifications reply forms, but the interaction gets a little klunky, especially when rotating on the phone. The ipad also let's you have multiple forms open, one on the list and one on the detail, which is confusing.

Try to adopt the input accessory method of the new reply interface.

Add option to report badly rendered article

It's going to be hard to catch every possible rendering issue by testing. Add a share option to report "this post looks wrong", so the whole reader post object is sent, and maybe a screenshot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.