Plugin Directory

Changeset 2570360


Ignore:
Timestamp:
07/22/2021 07:31:58 PM (5 years ago)
Author:
mottodesignstudio
Message:

Preparing for 1.2 release

Location:
social-media-library/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • social-media-library/trunk/index.php

    r2567475 r2570360  
    44 * Plugin URI:        https://github.com/wpmotto/wp-instagram-media-library
    55 * Description:       Save images from a public Instagram account to your WordPress library.
    6  * Version:           1.1.0
     6 * Version:           1.2
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.2
     
    1616require __DIR__ . '/vendor/autoload.php';
    1717
    18 define('MOTTO_IGML_VERSION', '1.0.0' );
     18define('MOTTO_IGML_VERSION', '1.2.0' );
    1919
    2020use Motto\InstagramMediaLibrary\MediaUploads;
     
    3838     * Initial Run when settings are updated.
    3939     */
    40     add_action(
    41         'update_option_igml_settings', [$remote, 'uploadUnsavedMedia']
    42     );
     40    add_action( 'update_option_igml_settings', [$remote, 'uploadUnsavedMedia']);
    4341
    4442    if ( !wp_next_scheduled( 'igml_cron_hook' ) )
     
    4846// Add Shortcode
    4947add_shortcode( 'social_feed', function( $atts ) {
     48
     49    $link = false;
     50    if( isset($atts['link']) ) {
     51        $link = $atts['link'];
     52        unset($atts['link']);
     53    }
     54
    5055    $media = new MediaUploads( $atts );
    51     $images = implode('', array_map( function( $item ) {
    52         return "<li>{$item->html()}</li>";
     56    $images = implode('', array_map( function( $item ) use ($link) {
     57        $html = "<li>";
     58        if( $link ) {
     59            $href = ($link == "social") ? $item->social('link') : $item->attachment_url();
     60            $html .= "<a href=\"$href\">";
     61        }
     62        $html .= $item->html();
     63        if( $link ) $html .= "</a>";
     64        $html .= "</li>";
     65        return $html;
    5366    }, $media->get() ));
    5467
  • social-media-library/trunk/readme.txt

    r2567475 r2570360  
    1 === Social Media Library ===
     1=== Social Media Downloader ===
    22Contributors: mottodesignstudio
    3 Tags: instagram, media library, feed, social
     3Tags: instagram, media library, feed, social, media downloader
    44Donate link: https://motto.ca
    55Requires at least: 4.8
    66Tested up to: 5.8
    77Requires PHP: 7.2
    8 Stable tag: 1.1.0
     8Stable tag: 1.2
    99License: GPLv2
    1010License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
    1111
    12 This plugin allows you to save images from a public Instagram account to your WordPress library.
     12Download images from public social media accounts to your WordPress image library. This is a great way to embed Instagram posts on your site without it breaking in the future.
    1313
    1414== Description ==
    15 There are many Instagram feed plugins for WordPress available. Unfortunately, Instagram would rather users not embed their media feeds on external websites. Therefore there isn\'t any official open API to do so and the unoffocial APIs are very error prone. Even if an API is working today, it will likely fail in the near future.
    1615
    17 That\'s why this plugin doesn\'t embed external images. Instead it\'ll sync your media library with Instagram by downloading them when available. If the API eventually breaks, the only side-effect is an out-of-date but still working instagram feed; as opposed to other plugins which will produce broken feeds while the authors work to update code to work with the breaking API changes.
     16There are many Instagram feed plugins for WordPress available. Unfortunately, Instagram would rather users not embed their media feeds on external websites. Therefore there isn't any official open API to do so and the unoffocial APIs are very error prone. Even if an API is working today, it will likely fail in the near future.
     17
     18That's why this plugin doesn't embed external images. Instead it'll sync your media library with Instagram by downloading them when available. If the API eventually breaks, the only side-effect is an out-of-date but still working instagram feed; as opposed to other plugins which will produce broken feeds while the authors work to update code to work with the breaking API changes.
    1819
    1920== Installation ==
    2021- Install and activate the plugin
    2122- In Settings > Media > Social Media Library, enter and save the account username you want to download from
    22 - Use the included shortcode to output your most recent images `[igml posts_per_page=\"5\"]`
     23- Use the included shortcode to output your most recent images `[igml posts_per_page="5"]`
     24    - Attributes map directly to `WP_Query` arguments.
     25    - Use `link="social"` or `link="attachment"` to link the image.
     26- Currently, requests from your server may occasionally get blocked and so it's best to use a proxy. [Signup here](https://rapidapi.com/restyler/api/instagram40) and enter your API key.
    2327
    2428== Changelog ==
     29
     30= 1.2 =
     31* Added option to run sync immediately.
     32* Added url ink to the shortcode.
    2533
    2634= 1.1 =
  • social-media-library/trunk/src/Image.php

    r2567475 r2570360  
    1919    {
    2020        return $this->post;
     21    }
     22
     23    public function attachment_url()
     24    {
     25        return get_permalink($this->post->ID);
    2126    }
    2227
  • social-media-library/trunk/src/Settings.php

    r2555949 r2570360  
    7373
    7474        add_settings_field(
     75            'igml_run_now',
     76            __( 'Run Now', 'motto-igml' ),
     77            function() {
     78                ?>
     79                <input type="<?php echo esc_attr('checkbox') ?>" name="<?php echo esc_attr('igml_settings[run_now]') ?>" value="<?php echo esc_attr('1') ?>">
     80                <?php
     81            },
     82            'media',
     83            'igml_media_section'
     84        );
     85
     86        add_settings_field(
    7587            'igml_frequency',
    7688            __( 'Sync Frequency', 'motto-igml' ),
Note: See TracChangeset for help on using the changeset viewer.