Git Product home page Git Product logo

funkstagram's People

Contributors

drewbaker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

funkstagram's Issues

Use post_status' => 'any' on existing_posts check

Noticed a bug with this today, but it's edge case. But it would be worth adding a 'post_status' => 'any' parameter to the following query, in the off chance someone sets a attachment/post to draft (which I did programmatically on Exposure).

https://github.com/jrobson153/funkstagram/blob/master/funkstagram-class.php#L266-L272

                    $args = array(
                        'posts_per_page'    => 1,
                        'meta_key'          => 'instagram_id',
                        'meta_value'        => $gram_post["id"],
                        'post_type'         => 'attachment'
                    );
                    $existing_posts = get_posts($args);

Error Report Too Generic

John, Drew changed these lines to better report the actual error:

// No response, remove from array and log
} else {
unset( $user_ids[$i] );
$this->error_log[] = $response['meta']['error_message'];
}

Lines 64-68 of funkstagram-class.php

Funkstagram issues

The plugin is being used on my site to allow my client to take images and upload them to their media library easily so from there they can easily add them to products in their woo commerce store.

The plugin doesn't seem to be automatically adding them in and only adds in some images when I click the import now button.

Initially it was working fine but now its very intermittant.
I have a very tech unsavvy client so I set this up to make their product set ups very easy.

We also have a pro instagram feed on the site and a instagram autoposter to post final products in the store to their live instagram account.

Hoping you can help to trouble shoot why its not loading these images into the library.

Site is using latest Wordpress and current version of the Salient theme with rolled back woo to accomodate Salient

Make username to ID conversion more robust

Today we re-wrote the username to ID conversion to be case insensitive and work if the search result order came back not what we expected.

https://github.com/jrobson153/funkstagram/blob/master/funkstagram-class.php#L40-L52

                        // Decode JSON response
                        $response = json_decode( wp_remote_retrieve_body( $serach_user ), true );

                        // Go through serach results and find matching username
                        $found_id = false;
                        foreach($response['data'] as $key => $found_user) {
                            if(strtolower($found_user['username']) == strtolower($user)) {
                                $found_id = $response['data'][$key]['id'];
                                break;
                            }
                        }

                        // If username matches, switch username to be id instead
                        if ( $found_id ) {
                            $user_ids[$i] = $found_id;

                        // Otherwise remove from array and log
                        } else {
                            unset( $user_ids[$i] );
                            $this->error_log[] = 'User ' . $user . ' does not exist';
                        }

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.