johndigital / funkstagram Goto Github PK
View Code? Open in Web Editor NEWA simple Instagram image importer for Wordpress
License: GNU General Public License v2.0
A simple Instagram image importer for Wordpress
License: GNU General Public License v2.0
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);
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';
}
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.