Plugin Directory

Changeset 2198596


Ignore:
Timestamp:
11/22/2019 05:54:37 AM (6 years ago)
Author:
devlucasmendes
Message:

add v.2.7.9

Location:
fastdee/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • fastdee/trunk/assets/js/dev/src/coupons-page.js

    r2198571 r2198596  
    9292                if (
    9393                    !dataReturn || !dataReturn.requestInfo || !dataReturn.requestInfo.message ||
    94                     (dataReturn.requestInfo.message.toLowerCase() !== 'success' || dataReturn.requestInfo.message.indexOf('DEPRECATED')===-1)
     94                    dataReturn.requestInfo.message.toLowerCase() !== 'success'
    9595                ) {
    9696                    showNotify('Ops... Houve um erro ao buscar na Lomadee!<br><br>Tente Novamente!<br><br>Caso o erro ainda continue após alguns minutos, contate nosso suporte. <br> contato@fastdee.com', 10000, 'center', 'error');
  • fastdee/trunk/assets/js/dev/src/import-page.js

    r2198553 r2198596  
    153153
    154154                if (dataReturn && dataReturn.requestInfo && dataReturn.requestInfo.status == 'NOT_FOUND') {
    155                     showNotify('Nenhuma oferta encontrada :(', 5000, 'center', 'information');
     155                    showNotify('Nenhuma ofertas encontrada :(', 5000, 'center', 'information');
    156156                    return;
    157157                }
     
    166166                }
    167167
    168                 if (dataReturn.requestInfo.message.toLowerCase() === 'success' || dataReturn.requestInfo.message.indexOf('DEPRECATED') !== -1) {
     168                if (dataReturn.requestInfo.message.toLowerCase() === 'success') {
    169169
    170170                    if (dataReturn.pagination.size > 0) {
  • fastdee/trunk/fastdee.php

    r2198553 r2198596  
    44 * Plugin URI: http://fastdee.com/?ref=wp-admin-plugins.php
    55 * Description: Com o plugin Fastdee! Afiliados podem realizar a importação automatizada de ofertas da Lomadee. E também buscar Cupons comissionados.
    6  * Version: 2.7.8
     6 * Version: 2.7.9
    77 * Author: Lucas Mendes Mota da Fonseca
    88 * Author URI: http://devlucasmendes.com
     
    2828    final class Fastdee {
    2929
    30         public $version = '2.7.8';
     30        public $version = '2.7.9';
    3131
    3232        protected static $_instance = null;
  • fastdee/trunk/includes/core/class-fd-ofertas.php

    r2198553 r2198596  
    286286     */
    287287    private function offersDataReturnIsValid( $offersData ) {
    288         try {
    289             if ($offersData && property_exists($offersData, 'requestInfo') &&
    290                 property_exists($offersData, 'offers') &&
    291                 $offersData->offers) {
    292                 return true;
    293             }
    294 
    295         } catch (Exception $e) {
    296             return false;
    297         }
     288        if ( $offersData && property_exists( $offersData, 'requestInfo' ) &&
     289             $offersData->requestInfo->message === 'SUCCESS' && property_exists( $offersData, 'offers' ) &&
     290             $offersData->offers ) {
     291            return true;
     292        }
    298293
    299294        return false;
  • fastdee/trunk/includes/core/class-fd-pages.php

    r2198571 r2198596  
    1010        parent::__construct();
    1111
    12         add_action('in_admin_footer', array($this, 'add_btn_doar'));
     12         add_action('in_admin_footer', array($this, 'add_btn_doar'));
    1313    }
    1414
    1515    public function add_btn_doar(){
    16         global $fd_doe_footer_printed,$hook_suffix;
     16        global $fd_doe_footer_printed,$hook_suffix;
    1717
    18         if (!$fd_doe_footer_printed&&in_array( $hook_suffix, array(
    19                 'toplevel_page_fastdee',
    20                 'fastdee_page_fd_atualizar',
    21                 'fastdee_page_fd_opcoes',
    22                 'fastdee_page_fd_aprenda',
    23                 'fastdee_page_importar',
     18        if (!$fd_doe_footer_printed&&in_array( $hook_suffix, array(
     19                'toplevel_page_fastdee',
     20                'fastdee_page_fd_atualizar',
     21                'fastdee_page_fd_opcoes',
     22                'fastdee_page_fd_aprenda',
     23                'fastdee_page_importar',
    2424//                'fastdee_page_fastdee_cupons'
    25             )  ) ) {
    26             $fd_doe_footer_printed=true;
    27             //TODO arrumar estilo
    28             ?>
     25            )  ) ) {
     26            $fd_doe_footer_printed=true;
     27            //TODO arrumar estilo
     28            ?>
    2929            <!-- INICIO FORMULARIO BOTAO PAGSEGURO -->
    3030            <div class="btn-doar-container">
     
    4545            </div>
    4646            <!-- FINAL FORMULARIO BOTAO PAGSEGURO -->
    47             <?php
    48         }
    49     }
     47            <?php
     48        }
     49    }
    5050
    5151    public function fd_getCategorias() {
    5252        //'hasProduct' => true
    5353
    54         $strRetorno = $this->getLomadeAccess()->findCategories(alv2::_ALL, array('size' => 1000,));
    55         $arrRetorno = json_decode($strRetorno);
    56         if (!$arrRetorno) {
    57             $arrRetorno = json_decode(utf8_decode($strRetorno));
     54        $strRetorno = $this->getLomadeAccess()->findCategories( alv2::_ALL, array( 'size' => 1000, ) );
     55        $arrRetorno = json_decode( $strRetorno );
     56        if ( ! $arrRetorno ) {
     57            $arrRetorno = json_decode( utf8_decode( $strRetorno ) );
    5858        }
    5959
    60         if (!$arrRetorno || !property_exists($arrRetorno, 'requestInfo') || ($arrRetorno->requestInfo->message !== 'SUCCESS' ||
    61                 strpos('DEPRECATED', $arrRetorno->requestInfo->message) === FALSE) || !property_exists($arrRetorno, 'categories')) {
    62             $strRetorno = $this->getLomadeAccess()->findCategories(alv2::_BESTSELLERS, array('size' => 1000,));
    63             $arrRetorno = json_decode($strRetorno);
    64             if (!$arrRetorno) {
    65                 $arrRetorno = json_decode(utf8_decode($strRetorno));
     60        if ( ! $arrRetorno || ! property_exists( $arrRetorno, 'requestInfo' ) || $arrRetorno->requestInfo->message !== 'SUCCESS' || ! property_exists( $arrRetorno, 'categories' ) ) {
     61            $strRetorno = $this->getLomadeAccess()->findCategories( alv2::_BESTSELLERS, array( 'size' => 1000, ) );
     62            $arrRetorno = json_decode( $strRetorno );
     63            if ( ! $arrRetorno ) {
     64                $arrRetorno = json_decode( utf8_decode( $strRetorno ) );
    6665            }
    6766        }
    6867
    69         try {
    70             if ($arrRetorno && property_exists($arrRetorno, 'requestInfo') && ($arrRetorno->requestInfo->message === 'SUCCESS' ||
    71                     strpos('DEPRECATED', $arrRetorno->requestInfo->message) !== FALSE)
    72                 && property_exists($arrRetorno, 'categories')) {
     68        if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && $arrRetorno->requestInfo->message === 'SUCCESS' && property_exists( $arrRetorno, 'categories' ) ) {
    7369
    74                 $arrCategories = $arrRetorno->categories;
     70            $arrCategories = $arrRetorno->categories;
    7571
    76                 if (is_array($arrCategories)) {
     72            if ( is_array( $arrCategories ) ) {
    7773
    78                     function _fd_compair_cat($a, $b) {
    79                         return strcmp($a->name, $b->name);
    80                     }
     74                function _fd_compair_cat( $a, $b ) {
     75                    return strcmp( $a->name, $b->name );
     76                }
    8177
    82                     usort($arrCategories, '_fd_compair_cat');
     78                usort( $arrCategories, '_fd_compair_cat' );
    8379
    84                     return $arrCategories;
    85                 }
     80                return $arrCategories;
    8681            }
    87         } catch (Exception $e) {
    88             //todo
    8982        }
    9083
    91         return array((object)array('id' => '0', 'name' => 'Erro ao buscar categorias. Sistema Lomadee indisponível. Tente novamente em alguns minutos.'));
     84        return array( (object) array( 'id' => '0', 'name' => 'Erro ao buscar categorias. Sistema Lomadee indisponível. Tente novamente em alguns minutos.' ) );
    9285    }
    9386
     
    10295        }
    10396
    104         if ($arrRetorno && property_exists($arrRetorno, 'requestInfo') && ($arrRetorno->requestInfo->message === 'SUCCESS' ||
    105                 strpos('DEPRECATED', $arrRetorno->requestInfo->message) !== FALSE)
    106             && property_exists($arrRetorno, 'stores')) {
     97        if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && $arrRetorno->requestInfo->message === 'SUCCESS' && property_exists( $arrRetorno, 'stores' ) ) {
    10798
    10899            $arrStores = $arrRetorno->stores;
     
    160151            <?php endif; ?>
    161152        </div>
    162         <!--    TEMP disabled    -->
    163         <?php
     153<!--    Todo fTEMP  --><?php
    164154//      if ( ! FdOptions::bool_has_email() ):
    165155//          $text = 'Insira aqui seu email para aproveitar todos os recursos que o Fastdee tem a te oferecer!';
     
    167157//      endif;
    168158//      $nonce = wp_create_nonce( '_nonce_fd_get_email_ldk154' );
    169 //
    170         ?>
    171         <!--        <input type="hidden" id="fd_get_email_nonce" value="--><?php //echo esc_attr( $nonce )
    172         ?><!--">-->
    173         <?php
     159//      ?>
     160<!--        <input type="hidden" id="fd_get_email_nonce" value="--><?php //echo esc_attr( $nonce ) ?><!--">-->
     161<!--        --><?php
    174162    }
    175163
  • fastdee/trunk/includes/libraries/alv2/alv2.php

    r2198571 r2198596  
    221221        return
    222222            ! empty( $response ) &&
    223             property_exists( $response, 'requestInfo' ) && property_exists( $response->requestInfo, 'message' ) && ($response->requestInfo->message === 'SUCCESS' ||
    224                 strpos('DEPRECATED', $response->requestInfo->message) !== FALSE) && //TODO fix
     223            property_exists( $response, 'requestInfo' ) && property_exists( $response->requestInfo, 'message' ) && $response->requestInfo->message === 'SUCCESS' &&
    225224            property_exists( $response, 'requestInfo' ) && property_exists( $response->requestInfo, 'status' ) && $response->requestInfo->status === 'OK';
    226225    }
  • fastdee/trunk/includes/pages/class-fd-coupons-page.php

    r2198571 r2198596  
    3535        $arrRetorno = json_decode( $strRetorno );
    3636
    37         if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && ($arrRetorno->requestInfo->message === 'SUCCESS' ||
    38                 strpos('DEPRECATED', $arrRetorno->requestInfo->message) !== FALSE) ) {
     37        if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && $arrRetorno->requestInfo->message === 'SUCCESS' ) {
    3938            $arrCategories = $arrRetorno->categories;
    4039
     
    5857        $arrRetorno = json_decode( $strRetorno );
    5958
    60         if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && ($arrRetorno->requestInfo->message === 'SUCCESS' ||
    61                 strpos('DEPRECATED', $arrRetorno->requestInfo->message) !== FALSE) ) {
     59        if ( $arrRetorno && property_exists( $arrRetorno, 'requestInfo' ) && $arrRetorno->requestInfo->message === 'SUCCESS' ) {
    6260            $arrCategories = $arrRetorno->stores;
    6361
Note: See TracChangeset for help on using the changeset viewer.