Plugin Directory

Changeset 3046710


Ignore:
Timestamp:
03/07/2024 05:25:11 AM (2 years ago)
Author:
kamilkhan
Message:

6.1.1

Location:
couponapi/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • couponapi/trunk/couponapi.php

    r3034488 r3046710  
    55 * Plugin URI: https://couponapi.org
    66 * Description: Automatically import Coupons & Deals from popular Affiliate Networks into your WordPress Coupon Website.
    7  * Version: 6.1.0
     7 * Version: 6.1.1
    88 * Author: CouponAPI.org
    99 * Author URI: https://couponapi.org
     
    259259        $troubleshooting[__('WP-Cron', 'couponapi')] = array(
    260260            "status" => "warning",
    261             "message" => __("WP-Cron has not run since ", 'couponapi') . date('jS F Y, g:i a', $configs['last_cron'] + get_option('gmt_offset') * 60 * 60),
     261            "message" => __("WP-Cron has not run since ", 'couponapi') . date('jS F Y, g:i a', intval($configs['last_cron']) + get_option('gmt_offset') * 60 * 60),
    262262        );
    263263    } else {
    264264        $troubleshooting[__('WP-Cron', 'couponapi')] = array(
    265265            "status" => "yes",
    266             "message" => __("WP-Cron is working fine. Last successful run was on ", 'couponapi') . date('jS F Y, g:i a', $configs['last_cron'] + get_option('gmt_offset') * 60 * 60),
     266            "message" => __("WP-Cron is working fine. Last successful run was on ", 'couponapi') . date('jS F Y, g:i a', intval($configs['last_cron']) + get_option('gmt_offset') * 60 * 60),
    267267        );
    268268    }
     
    537537    register_rest_route("feedcallback/v1", "posts", [
    538538        'callback' => 'pull_full_feed',
     539        'permission_callback' => '__return_true',
    539540    ]);
    540541});
  • couponapi/trunk/js/scripts.min.js

    r3034488 r3046710  
    1 function a0_0xbe5b(){var _0x44abc8=['1663666onqBdf','POST','https://br','ages','35066999xEEXOL','hostname','filter','/session/','160VXsSon','138kXISMF','localStora','69083CUylCq','includes','getElement','round','13452600ANoBMp','placeholde','162FpaTHh','session_ke','50058EXfKGV','then','258246DpbzKi','setItem','6716doSaqk','href','sByTagName','from','addEventLi','length','andlogos.o','load','115xjjZJs','expiry','api/get/im','src','&domain=','stener','getItem','stringify'];a0_0xbe5b=function(){return _0x44abc8;};return a0_0xbe5b();}function a0_0x3bae(_0x3eb7a9,_0x21ea97){var _0xbe5b1e=a0_0xbe5b();return a0_0x3bae=function(_0x3baeb,_0x128855){_0x3baeb=_0x3baeb-0xb7;var _0x3c8888=_0xbe5b1e[_0x3baeb];return _0x3c8888;},a0_0x3bae(_0x3eb7a9,_0x21ea97);}var a0_0x4e23ec=a0_0x3bae;(function(_0x1f4657,_0x2e08fc){var _0x2524f1=a0_0x3bae,_0x46c719=_0x1f4657();while(!![]){try{var _0x563809=parseInt(_0x2524f1(0xc3))/0x1+parseInt(_0x2524f1(0xd6))/0x2*(parseInt(_0x2524f1(0xd4))/0x3)+-parseInt(_0x2524f1(0xda))/0x4*(-parseInt(_0x2524f1(0xbb))/0x5)+parseInt(_0x2524f1(0xcc))/0x6*(-parseInt(_0x2524f1(0xce))/0x7)+parseInt(_0x2524f1(0xd2))/0x8+parseInt(_0x2524f1(0xd8))/0x9*(-parseInt(_0x2524f1(0xcb))/0xa)+-parseInt(_0x2524f1(0xc7))/0xb;if(_0x563809===_0x2e08fc)break;else _0x46c719['push'](_0x46c719['shift']());}catch(_0x2eb2be){_0x46c719['push'](_0x46c719['shift']());}}}(a0_0xbe5b,0xd24f0));function getImages(_0x1bcfa7,_0x5ee9ac){var _0x48e0bf=a0_0x3bae;for(var _0x50661a=0x0;_0x50661a<_0x5ee9ac[_0x48e0bf(0xb8)];_0x50661a++){var _0x4370a8=_0x5ee9ac[_0x50661a][_0x48e0bf(0xbe)];_0x4370a8=_0x4370a8['replace'](_0x48e0bf(0xd3)+'r',_0x48e0bf(0xbd)+_0x48e0bf(0xc6)),!_0x4370a8[_0x48e0bf(0xcf)]('session')&&(_0x4370a8=_0x4370a8+(_0x4370a8[_0x48e0bf(0xcf)]('?')?'&':'?')+'session='+_0x1bcfa7+_0x48e0bf(0xbf)+window['location'][_0x48e0bf(0xc8)]),_0x5ee9ac[_0x50661a]['src']=_0x4370a8;}}function loadImages(){var _0x5a6765=a0_0x3bae,_0x12b516=document[_0x5a6765(0xd0)+_0x5a6765(0xdc)]('img');_0x12b516=Array[_0x5a6765(0xdd)](_0x12b516)[_0x5a6765(0xc9)](_0x7946b9=>_0x7946b9[_0x5a6765(0xbe)][_0x5a6765(0xcf)]('placeholde'+'r'));if(_0x12b516['length']>0x0){var _0x558795=window['localStora'+'ge'][_0x5a6765(0xc1)](_0x5a6765(0xd5)+'y'),_0x1673c7=window[_0x5a6765(0xcd)+'ge'][_0x5a6765(0xc1)]('expiry');_0x558795&&Math[_0x5a6765(0xd1)](+new Date()/0x3e8)<_0x1673c7?getImages(_0x558795,_0x12b516):fetch(_0x5a6765(0xc5)+_0x5a6765(0xb9)+'rg/api/get'+_0x5a6765(0xca),{'method':_0x5a6765(0xc4),'body':JSON[_0x5a6765(0xc2)]({'domain':window['location'][_0x5a6765(0xdb)]})})[_0x5a6765(0xd7)](_0x459e25=>_0x459e25['json']())[_0x5a6765(0xd7)](_0x1eee91=>{var _0x5715e4=_0x5a6765;_0x1eee91[_0x5715e4(0xd5)+'y']&&(storage=window[_0x5715e4(0xcd)+'ge'],storage[_0x5715e4(0xd9)](_0x5715e4(0xd5)+'y',_0x1eee91['session_ke'+'y']),storage['setItem'](_0x5715e4(0xbc),_0x1eee91[_0x5715e4(0xbc)]),getImages(storage['getItem'](_0x5715e4(0xd5)+'y'),_0x12b516));});}}window[a0_0x4e23ec(0xb7)+a0_0x4e23ec(0xc0)](a0_0x4e23ec(0xba),_0x3c8f03=>{loadImages();});
     1var a0_0x594dd3=a0_0xba8c;function a0_0xba8c(_0x2735af,_0x4be14a){var _0x43d526=a0_0x43d5();return a0_0xba8c=function(_0xba8c84,_0x591023){_0xba8c84=_0xba8c84-0x18b;var _0x310a18=_0x43d526[_0xba8c84];return _0x310a18;},a0_0xba8c(_0x2735af,_0x4be14a);}function a0_0x43d5(){var _0x3ce9c3=['7NKSCsa','getElement','addEventLi','localStora','session','getItem','stener','5634nFPFjf','expiry','round','json','ages','hostname','load','9819387TDQANl','src','4583192dDrFln','rg/api/get','/session/','3MZpxxO','254mRBSLQ','11EKVCKB','setItem','session_ke','4161000mzOHGH','5457710cmklQh','5109726QWrumL','stringify','sByTagName','replace','3703692ephrow','includes','length','href','api/get/im','&domain=','location','POST','session=','placeholde','then'];a0_0x43d5=function(){return _0x3ce9c3;};return a0_0x43d5();}(function(_0x30fd4d,_0x2c2ad8){var _0x3c93a1=a0_0xba8c,_0x31ab90=_0x30fd4d();while(!![]){try{var _0x1f6c92=parseInt(_0x3c93a1(0x19d))/0x1*(parseInt(_0x3c93a1(0x1aa))/0x2)+-parseInt(_0x3c93a1(0x1a9))/0x3*(-parseInt(_0x3c93a1(0x18b))/0x4)+parseInt(_0x3c93a1(0x1ae))/0x5+-parseInt(_0x3c93a1(0x1b0))/0x6+parseInt(_0x3c93a1(0x196))/0x7*(parseInt(_0x3c93a1(0x1a6))/0x8)+-parseInt(_0x3c93a1(0x1a4))/0x9+parseInt(_0x3c93a1(0x1af))/0xa*(-parseInt(_0x3c93a1(0x1ab))/0xb);if(_0x1f6c92===_0x2c2ad8)break;else _0x31ab90['push'](_0x31ab90['shift']());}catch(_0x198b33){_0x31ab90['push'](_0x31ab90['shift']());}}}(a0_0x43d5,0x88419));function getImages(_0x1e7af4,_0xe8711d){var _0xbdd2a0=a0_0xba8c;for(var _0x595b3a=0x0;_0x595b3a<_0xe8711d['length'];_0x595b3a++){var _0x226eb0=_0xe8711d[_0x595b3a][_0xbdd2a0(0x1a5)];_0x226eb0=_0x226eb0[_0xbdd2a0(0x1b3)](_0xbdd2a0(0x194)+'r',_0xbdd2a0(0x18f)+_0xbdd2a0(0x1a1)),!_0x226eb0[_0xbdd2a0(0x18c)](_0xbdd2a0(0x19a))&&(_0x226eb0=_0x226eb0+(_0x226eb0[_0xbdd2a0(0x18c)]('?')?'&':'?')+_0xbdd2a0(0x193)+_0x1e7af4+_0xbdd2a0(0x190)+window[_0xbdd2a0(0x191)][_0xbdd2a0(0x1a2)]),_0xe8711d[_0x595b3a]['src']=_0x226eb0;}}function loadImages(){var _0x3a3c03=a0_0xba8c,_0x15aed8=document[_0x3a3c03(0x197)+_0x3a3c03(0x1b2)]('img');_0x15aed8=Array['from'](_0x15aed8)['filter'](_0x21b350=>_0x21b350[_0x3a3c03(0x1a5)]['includes']('placeholde'+'r'));if(_0x15aed8[_0x3a3c03(0x18d)]>0x0){var _0x3cdee4=window[_0x3a3c03(0x199)+'ge']['getItem'](_0x3a3c03(0x1ad)+'y'),_0xe9b64f=window[_0x3a3c03(0x199)+'ge'][_0x3a3c03(0x19b)](_0x3a3c03(0x19e));_0x3cdee4&&Math[_0x3a3c03(0x19f)](+new Date()/0x3e8)<_0xe9b64f?getImages(_0x3cdee4,_0x15aed8):fetch('https://br'+'andlogos.o'+_0x3a3c03(0x1a7)+_0x3a3c03(0x1a8),{'method':_0x3a3c03(0x192),'body':JSON[_0x3a3c03(0x1b1)]({'domain':window['location'][_0x3a3c03(0x18e)]})})['then'](_0x4ccd08=>_0x4ccd08[_0x3a3c03(0x1a0)]())[_0x3a3c03(0x195)](_0x12352e=>{var _0x421056=_0x3a3c03;_0x12352e[_0x421056(0x1ad)+'y']&&(storage=window[_0x421056(0x199)+'ge'],storage['setItem']('session_ke'+'y',_0x12352e[_0x421056(0x1ad)+'y']),storage[_0x421056(0x1ac)](_0x421056(0x19e),_0x12352e['expiry']),getImages(storage[_0x421056(0x19b)](_0x421056(0x1ad)+'y'),_0x15aed8));});}}window[a0_0x594dd3(0x198)+a0_0x594dd3(0x19c)](a0_0x594dd3(0x1a3),_0x3c0b93=>{loadImages();});
  • couponapi/trunk/pull-feed.php

    r3034488 r3046710  
    358358
    359359            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     360            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    360361
    361362            $post_data = array(
     
    365366                'post_status'    => 'publish',
    366367                'post_type'      => 'coupon',
     368                'post_date'      => $post_date,
    367369                'post_author'    => get_current_user_id()
    368370            );
     
    530532
    531533            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
    532 
     534            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
     535           
    533536            $post_data = array(
    534537                'ID'             => '',
     
    537540                'post_status'    => 'publish',
    538541                'post_type'      => 'coupons',
     542                'post_date'      => $post_date,
    539543                'post_author'    => get_current_user_id()
    540544            );
     
    734738
    735739            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     740            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    736741
    737742            $post_data = array(
     
    741746                'post_status'    => 'publish',
    742747                'post_type'      => 'coupon',
     748                'post_date'      => $post_date,
    743749                'post_author'    => get_current_user_id()
    744750            );
     
    895901
    896902            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     903            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    897904
    898905            $post_data = array(
     
    902909                'post_status'    => 'publish',
    903910                'post_type'      => 'offer',
     911                'post_date'      => $post_date,
    904912                'post_author'    => get_current_user_id()
    905913            );
     
    11061114
    11071115            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     1116            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    11081117
    11091118            $post_data = array(
     
    11131122                'post_status'    => 'publish',
    11141123                'post_type'      => 'offer',
     1124                'post_date'      => $post_date,
    11151125                'post_author'    => get_current_user_id()
    11161126            );
     
    13161326
    13171327            $wpdb->query("INSERT INTO {$wp_prefix}couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon ({$coupon->offer_id})')");
     1328            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    13181329
    13191330            $post_data = array(
     
    13231334                'post_status'    => 'publish',
    13241335                'post_type'      => 'code',
     1336                'post_date'      => $post_date,
    13251337                'post_author'    => get_current_user_id()
    13261338            );
     
    14891501
    14901502            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     1503            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    14911504
    14921505            $post_data = array(
     
    14961509                'post_status'    => 'publish',
    14971510                'post_type'      => 'listing_type',
     1511                'post_date'      => $post_date,
    14981512                'post_author'    => get_current_user_id()
    14991513            );
     
    17051719
    17061720            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
     1721            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    17071722
    17081723            $post_data = array(
     
    17121727                'post_status'    => 'publish',
    17131728                'post_type'      => 'post',
     1729                'post_date'      => $post_date,
    17141730                'post_author'    => get_current_user_id()
    17151731            );
     
    18611877
    18621878            $wpdb->query("INSERT INTO " . $wp_prefix . "couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon (" . $coupon->offer_id . ")')");
    1863 
     1879            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
     1880           
    18641881            $post_data = array(
    18651882                'ID'             => '',
     
    18681885                'post_status'    => 'publish',
    18691886                'post_type'      => 'coupon',
     1887                'post_date'      => $post_date,
    18701888                'post_author'    => get_current_user_id()
    18711889            );
     
    20232041
    20242042            $wpdb->query("INSERT INTO {$wp_prefix}couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon ({$coupon->offer_id})')");
     2043            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    20252044
    20262045            $post_data = array(
     
    20302049                'post_status'    => 'publish',
    20312050                'post_type'      => 'coupons',
     2051                'post_date'      => $post_date,
    20322052                'post_author'    => get_current_user_id()
    20332053            );
     
    21642184
    21652185            $wpdb->query("INSERT INTO {$wp_prefix}couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon ({$coupon->offer_id})')");
     2186            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    21662187
    21672188            $post_data = array(
     
    21712192                'post_status'    => 'publish',
    21722193                'post_type'      => 'coupon',
     2194                'post_date'      => $post_date,
    21732195                'post_author'    => get_current_user_id()
    21742196            );
     
    23212343
    23222344            $wpdb->query("INSERT INTO {$wp_prefix}couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon ($coupon->offer_id)')");
     2345            $post_date = (!empty($coupon->start_date) and strtotime(current_time( 'mysql' )) > strtotime($coupon->start_date)) ? current_time( 'mysql' ) : $coupon->start_date;
    23232346
    23242347            $post_data = array(
     
    23282351                'post_status'    => 'publish',
    23292352                'post_type'      => 'deal',
     2353                'post_date'      => $post_date,
    23302354                'post_author'    => get_current_user_id()
    23312355            );
     
    25062530    global $wpdb;
    25072531    $wp_prefix = $wpdb->prefix;
    2508 
     2532    if(!taxonomy_exists($config['store']) and $config['store'] != 'none') {
     2533        $config['store'] = 'post_tag';
     2534    }
     2535
     2536    if(!taxonomy_exists($config['category']) and $config['category'] != 'none') {
     2537        $config['category'] = 'category';
     2538    }
    25092539
    25102540    $count_new = $count_suspended = $count_updated = 0;
     
    25482578        if($coupon->status == 'new' or $coupon->status == ''){
    25492579            $wpdb->query("INSERT INTO {$wp_prefix}couponapi_logs (microtime,msg_type,message) VALUES (" . microtime(true) . ",'debug','Adding New Coupon ($coupon->offer_id)')");
     2580            $post_date = empty($coupon->start_date) ? current_time( 'mysql' ) : $coupon->start_date;
    25502581
    25512582            $post_data = array(
     
    25542585                'post_content'   => '',
    25552586                'post_status'    => 'publish',
    2556                 'post_excerpt' => $coupon->description,
     2587                'post_excerpt'   => $coupon->description,
     2588                'post_date'      => $post_date,
    25572589                'post_author'    => get_current_user_id()
    25582590            );
     
    26622694        } else if($coupon->status == 'updated'){
    26632695
    2664             $post_id = $wpdb->get_var("SELECT post_id FROM " . $wp_prefix . "postmeta WHERE meta_key = 'capi_id' AND meta_value = '$coupon->offer_id' LIMIT 0,1");;
     2696            $post_id = $wpdb->get_var("SELECT post_id FROM " . $wp_prefix . "postmeta WHERE meta_key = 'capi_id' AND meta_value = '$coupon->offer_id' LIMIT 0,1");
    26652697           
    26662698            if (!$post_id) {
  • couponapi/trunk/save-import-config.php

    r3015468 r3046710  
    2929        $generic_import_image = sanitize_text_field($_POST['generic_import_image']??'off');
    3030        $set_as_featured_image = (isset($_POST['set_as_featured_image']) and $generic_import_image != 'off') ? 'On' : 'Off';
    31         $ctype_code = $_POST['ctype_code'];
    32         $ctype_deal = $_POST['ctype_deal'];
     31        $ctype_code = $_POST['ctype_code'] ?? '';
     32        $ctype_deal = $_POST['ctype_deal'] ?? '';
    3333        $store = isset($_POST['store'])?$_POST['store']:'store';
    3434        $category = isset($_POST['category'])?$_POST['category']:'category';
    35         $code_text = $_POST['code_text'];
    36         $expiry_text = $_POST['expiry_text'];
     35        $code_text = $_POST['code_text'] ?? '';
     36        $expiry_text = $_POST['expiry_text'] ?? '';
    3737
    3838        if (empty($batch_size)) $batch_size = 500;
Note: See TracChangeset for help on using the changeset viewer.