Making WordPress.org

Ticket #3003: 3003.1.diff

File 3003.1.diff, 2.5 KB (added by dipesh.kakadiya, 8 years ago)

Fixed issue of reset setting on new data fetch

  • classes/tggr-source-flickr.php

    diff --git a/classes/tggr-source-flickr.php b/classes/tggr-source-flickr.php
    index 4847d62..45033af 100755
    a b if ( ! class_exists( 'TGGRSourceFlickr' ) ) { 
    137137                 * @param string $hashtag
    138138                 */
    139139                public function import_new_items( $hashtag ) {
     140                        if ( empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['api_key'] )  ){
     141                                return;
     142                        }
    140143                        $media = self::get_new_media(
    141144                                TGGRSettings::get_instance()->settings[ __CLASS__ ]['api_key'],
    142145                                $hashtag,
  • classes/tggr-source-google.php

    diff --git a/classes/tggr-source-google.php b/classes/tggr-source-google.php
    index 883bf75..e770f60 100755
    a b if ( ! class_exists( 'TGGRSourceGoogle' ) ) { 
    135135                 * @param string $hashtag
    136136                 */
    137137                public function import_new_items( $hashtag ) {
     138                        if ( empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['api_key'] )  ){
     139                                return;
     140                        }
     141
    138142                        $activities = self::get_new_activities(
    139143                                TGGRSettings::get_instance()->settings[ __CLASS__ ]['api_key'],
    140144                                $hashtag
  • classes/tggr-source-instagram.php

    diff --git a/classes/tggr-source-instagram.php b/classes/tggr-source-instagram.php
    index bdd6097..4d67e84 100755
    a b if ( ! class_exists( 'TGGRSourceInstagram' ) ) { 
    136136                 * @param string $hashtag
    137137                 */
    138138                public function import_new_items( $hashtag ) {
     139                        if ( empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['client_id'] )
     140                             || empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['access_token'] ) ){
     141                                return;
     142                        }
    139143                        $media = self::get_new_media(
    140144                                TGGRSettings::get_instance()->settings[ __CLASS__ ]['client_id'],
    141145                                $hashtag,
  • classes/tggr-source-twitter.php

    diff --git a/classes/tggr-source-twitter.php b/classes/tggr-source-twitter.php
    index 624222c..ca4c8ea 100755
    a b if ( ! class_exists( 'TGGRSourceTwitter' ) ) { 
    217217                 * @param string $hashtag
    218218                 */
    219219                public function import_new_items( $hashtag ) {
     220
     221                        if ( empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['consumer_key'] )
     222                             || empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['consumer_secret'] )
     223                             || empty( TGGRSettings::get_instance()->settings[ __CLASS__ ]['consumer_key'] ) ){
     224                                return;
     225                        }
     226
    220227                        $tweets = self::get_new_hashtagged_tweets(
    221228                                TGGRSettings::get_instance()->settings[ __CLASS__ ]['_bearer_token'],
    222229                                $hashtag,