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

Quicker way to look for FBIA warnings #871

Closed
Kluny opened this issue Jan 31, 2018 · 5 comments
Closed

Quicker way to look for FBIA warnings #871

Kluny opened this issue Jan 31, 2018 · 5 comments

Comments

@Kluny
Copy link
Contributor

@Kluny Kluny commented Jan 31, 2018

We have a client telling us that sometimes in the past they have seen errors/warnings from the FBIA plugin that result in articles not going through to facebook or having missing content. However, they're not able to give me any examples at the moment.

As far as I can tell, the only way to see if an article has a warning is to open the post editor and check the FBIA metabox. This is inefficient since they have thousands of posts.

Is there a way to get a list or log of articles that may have FBIA warnings?

Steps required to reproduce the problem

  1. Go to posts index in wp-admin
  2. Open posts for editing one at a time
  3. Look for FBIA warnings
  4. Slowly die of old age

Expected Result

A log, CLI tool or dashboard area with a list of FBIA warnings.

Actual Result

I haven't yet found anything like that.

Version Info

  • Plugin version: 4.0 in VIP plugins repository.
  • WordPress version: 4.92
  • PHP version: 7.xx
@vkama
Copy link
Collaborator

@vkama vkama commented Feb 2, 2018

Hi @Kluny, we do not have such functionality in the plugin.

I feel your pain and this is something I will talk to the team and see if we can come up with a solution.

Thanks for the idea :)

@Kluny
Copy link
Contributor Author

@Kluny Kluny commented Feb 2, 2018

Fair enough, I'll share something I found while I was reading the code base -

It looks like there is a method in FBIA conveniently called InstantArticlesPost::has_warnings_after_transformation(). Using that I can add, within the post index loop -

while(has_posts()) {
    $fbia = new Instant_Articles_Post($post_id);

    if($fbia->has_warnings_after_transformation()) {
        // this value is cached so hopefully it's not too resource-intensive
        // output an error message
    }
}

That will give us a little green or red light in the posts index to indicate whether FBIA is throwing errors or not.

If I get to it before you guys do I'll make a pull request.

@Kluny
Copy link
Contributor Author

@Kluny Kluny commented Mar 21, 2018

@mburak or @vkama, wondering if I could get a review or merge?

@jerclarke
Copy link

@jerclarke jerclarke commented Mar 22, 2018

Just want to say I love the concept of this patch so much! Will really help admins who want to quickly audit how things are going (and be a useful red flag for managing editors if they see any red or a lot of yellow).

(would test it myself but waiting for feedback about a composer bug)

@Kluny Kluny closed this as completed Jun 9, 2018
@Kluny
Copy link
Contributor Author

@Kluny Kluny commented Jun 9, 2018

Closed with #898, thanks for encouragement @jerclarke!

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

3 participants