Changeset 3046710
- Timestamp:
- 03/07/2024 05:25:11 AM (2 years ago)
- Location:
- couponapi/trunk
- Files:
-
- 4 edited
-
couponapi.php (modified) (3 diffs)
-
js/scripts.min.js (modified) (1 diff)
-
pull-feed.php (modified) (28 diffs)
-
save-import-config.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
couponapi/trunk/couponapi.php
r3034488 r3046710 5 5 * Plugin URI: https://couponapi.org 6 6 * Description: Automatically import Coupons & Deals from popular Affiliate Networks into your WordPress Coupon Website. 7 * Version: 6.1. 07 * Version: 6.1.1 8 8 * Author: CouponAPI.org 9 9 * Author URI: https://couponapi.org … … 259 259 $troubleshooting[__('WP-Cron', 'couponapi')] = array( 260 260 "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), 262 262 ); 263 263 } else { 264 264 $troubleshooting[__('WP-Cron', 'couponapi')] = array( 265 265 "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), 267 267 ); 268 268 } … … 537 537 register_rest_route("feedcallback/v1", "posts", [ 538 538 'callback' => 'pull_full_feed', 539 'permission_callback' => '__return_true', 539 540 ]); 540 541 }); -
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();});1 var 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 358 358 359 359 $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; 360 361 361 362 $post_data = array( … … 365 366 'post_status' => 'publish', 366 367 'post_type' => 'coupon', 368 'post_date' => $post_date, 367 369 'post_author' => get_current_user_id() 368 370 ); … … 530 532 531 533 $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 533 536 $post_data = array( 534 537 'ID' => '', … … 537 540 'post_status' => 'publish', 538 541 'post_type' => 'coupons', 542 'post_date' => $post_date, 539 543 'post_author' => get_current_user_id() 540 544 ); … … 734 738 735 739 $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; 736 741 737 742 $post_data = array( … … 741 746 'post_status' => 'publish', 742 747 'post_type' => 'coupon', 748 'post_date' => $post_date, 743 749 'post_author' => get_current_user_id() 744 750 ); … … 895 901 896 902 $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; 897 904 898 905 $post_data = array( … … 902 909 'post_status' => 'publish', 903 910 'post_type' => 'offer', 911 'post_date' => $post_date, 904 912 'post_author' => get_current_user_id() 905 913 ); … … 1106 1114 1107 1115 $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; 1108 1117 1109 1118 $post_data = array( … … 1113 1122 'post_status' => 'publish', 1114 1123 'post_type' => 'offer', 1124 'post_date' => $post_date, 1115 1125 'post_author' => get_current_user_id() 1116 1126 ); … … 1316 1326 1317 1327 $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; 1318 1329 1319 1330 $post_data = array( … … 1323 1334 'post_status' => 'publish', 1324 1335 'post_type' => 'code', 1336 'post_date' => $post_date, 1325 1337 'post_author' => get_current_user_id() 1326 1338 ); … … 1489 1501 1490 1502 $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; 1491 1504 1492 1505 $post_data = array( … … 1496 1509 'post_status' => 'publish', 1497 1510 'post_type' => 'listing_type', 1511 'post_date' => $post_date, 1498 1512 'post_author' => get_current_user_id() 1499 1513 ); … … 1705 1719 1706 1720 $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; 1707 1722 1708 1723 $post_data = array( … … 1712 1727 'post_status' => 'publish', 1713 1728 'post_type' => 'post', 1729 'post_date' => $post_date, 1714 1730 'post_author' => get_current_user_id() 1715 1731 ); … … 1861 1877 1862 1878 $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 1864 1881 $post_data = array( 1865 1882 'ID' => '', … … 1868 1885 'post_status' => 'publish', 1869 1886 'post_type' => 'coupon', 1887 'post_date' => $post_date, 1870 1888 'post_author' => get_current_user_id() 1871 1889 ); … … 2023 2041 2024 2042 $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; 2025 2044 2026 2045 $post_data = array( … … 2030 2049 'post_status' => 'publish', 2031 2050 'post_type' => 'coupons', 2051 'post_date' => $post_date, 2032 2052 'post_author' => get_current_user_id() 2033 2053 ); … … 2164 2184 2165 2185 $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; 2166 2187 2167 2188 $post_data = array( … … 2171 2192 'post_status' => 'publish', 2172 2193 'post_type' => 'coupon', 2194 'post_date' => $post_date, 2173 2195 'post_author' => get_current_user_id() 2174 2196 ); … … 2321 2343 2322 2344 $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; 2323 2346 2324 2347 $post_data = array( … … 2328 2351 'post_status' => 'publish', 2329 2352 'post_type' => 'deal', 2353 'post_date' => $post_date, 2330 2354 'post_author' => get_current_user_id() 2331 2355 ); … … 2506 2530 global $wpdb; 2507 2531 $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 } 2509 2539 2510 2540 $count_new = $count_suspended = $count_updated = 0; … … 2548 2578 if($coupon->status == 'new' or $coupon->status == ''){ 2549 2579 $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; 2550 2581 2551 2582 $post_data = array( … … 2554 2585 'post_content' => '', 2555 2586 'post_status' => 'publish', 2556 'post_excerpt' => $coupon->description, 2587 'post_excerpt' => $coupon->description, 2588 'post_date' => $post_date, 2557 2589 'post_author' => get_current_user_id() 2558 2590 ); … … 2662 2694 } else if($coupon->status == 'updated'){ 2663 2695 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"); 2665 2697 2666 2698 if (!$post_id) { -
couponapi/trunk/save-import-config.php
r3015468 r3046710 29 29 $generic_import_image = sanitize_text_field($_POST['generic_import_image']??'off'); 30 30 $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'] ?? ''; 33 33 $store = isset($_POST['store'])?$_POST['store']:'store'; 34 34 $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'] ?? ''; 37 37 38 38 if (empty($batch_size)) $batch_size = 500;
Note: See TracChangeset
for help on using the changeset viewer.