Changeset 2832199
- Timestamp:
- 12/12/2022 08:58:32 AM (3 years ago)
- Location:
- wp-profitshare
- Files:
-
- 44 added
- 6 edited
-
tags/1.4.9 (added)
-
tags/1.4.9/changelog.txt (added)
-
tags/1.4.9/css (added)
-
tags/1.4.9/css/admin-history-links-batch.css (added)
-
tags/1.4.9/css/admin.css (added)
-
tags/1.4.9/css/normalize.css (added)
-
tags/1.4.9/css/public.css (added)
-
tags/1.4.9/css/taggd.css (added)
-
tags/1.4.9/fonts (added)
-
tags/1.4.9/fonts/taggd.eot (added)
-
tags/1.4.9/fonts/taggd.svg (added)
-
tags/1.4.9/fonts/taggd.ttf (added)
-
tags/1.4.9/fonts/taggd.woff (added)
-
tags/1.4.9/images (added)
-
tags/1.4.9/images/button.png (added)
-
tags/1.4.9/images/button_green.png (added)
-
tags/1.4.9/images/button_red.png (added)
-
tags/1.4.9/images/profitshare-conversion.png (added)
-
tags/1.4.9/images/tooltip-bg-dark.png (added)
-
tags/1.4.9/images/tooltip-point-dark.gif (added)
-
tags/1.4.9/images/tooltip-point-light.gif (added)
-
tags/1.4.9/includes (added)
-
tags/1.4.9/includes/class-campaigns.php (added)
-
tags/1.4.9/includes/class-conversions.php (added)
-
tags/1.4.9/includes/class-history-links.php (added)
-
tags/1.4.9/includes/class-keywords-list.php (added)
-
tags/1.4.9/includes/class-tag-images-list.php (added)
-
tags/1.4.9/includes/functions.php (added)
-
tags/1.4.9/js (added)
-
tags/1.4.9/js/admin-history-links-batch.js (added)
-
tags/1.4.9/js/admin-tag-image.js (added)
-
tags/1.4.9/js/admin.js (added)
-
tags/1.4.9/js/jquery-1.11.2.min.js (added)
-
tags/1.4.9/js/jquery.taggd.js (added)
-
tags/1.4.9/js/public.js (added)
-
tags/1.4.9/readme.txt (added)
-
tags/1.4.9/screenshot-1.png (added)
-
tags/1.4.9/screenshot-2.png (added)
-
tags/1.4.9/screenshot-3.png (added)
-
tags/1.4.9/screenshot-4.png (added)
-
tags/1.4.9/screenshot-5.png (added)
-
tags/1.4.9/screenshot-6.png (added)
-
tags/1.4.9/screenshot-7.png (added)
-
tags/1.4.9/wp-profitshare.php (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/css/admin.css (modified) (1 diff)
-
trunk/includes/class-conversions.php (modified) (3 diffs)
-
trunk/includes/functions.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-profitshare.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-profitshare/trunk/changelog.txt
r2648394 r2832199 67 67 = 1.4.8 = 68 68 Fix: Add option to change experimental links 69 70 = 1.4.9 = 71 Fix: Update to latest Wordpress Version and PHP 8.x compatibility -
wp-profitshare/trunk/css/admin.css
r2648394 r2832199 91 91 width: 320px; 92 92 } 93 93 .ps-button-sticky-to-input .ps-important-padding{ 94 padding: 11px; 95 line-height: inherit; 96 } 94 97 .ps-hide{ 95 98 display: none; -
wp-profitshare/trunk/includes/class-conversions.php
r1799049 r2832199 147 147 148 148 $selected = ''; 149 if( $_GET['conversions-status-filter'] == $conv_status){149 if( isset($_GET['conversions-status-filter']) && $_GET['conversions-status-filter'] == $conv_status){ 150 150 $selected = ' selected = "selected"'; 151 151 } ?> … … 185 185 186 186 $selected = ''; 187 if( $_GET['conversions-min-sum-filter'] == $min_sum){187 if( isset($_GET['conversions-min-sum-filter']) && $_GET['conversions-min-sum-filter'] == $min_sum){ 188 188 $selected = ' selected = "selected"'; 189 189 } ?> … … 229 229 $query_has_where = false; 230 230 231 if( $_GET['advertisers-filter']){231 if(isset($_GET['advertisers-filter'])){ 232 232 $query_has_where = true; 233 233 $query = $query . ' where advertiser_id=' . $_GET['advertisers-filter']; 234 234 } 235 235 236 if( $_GET['conversions-status-filter']){236 if(isset($_GET['conversions-status-filter'])){ 237 237 $query = $query . (($query_has_where) ? " and" : " where") . " order_status='" . $_GET['conversions-status-filter']."'"; 238 238 $query_has_where = true; 239 239 } 240 240 241 if( $_GET['conversions-min-sum-filter']){241 if(isset($_GET['conversions-min-sum-filter'])){ 242 242 $query = $query . (($query_has_where) ? " and" : " where") . " items_commision >= " . $_GET['conversions-min-sum-filter']; 243 243 $query_has_where = true; -
wp-profitshare/trunk/includes/functions.php
r2648394 r2832199 23 23 */ 24 24 global $ps_api_config; 25 25 26 $current_user = wp_get_current_user(); 26 27 $country = get_user_meta($current_user->ID, 'ps_api_country', true); 27 return $ps_api_config[$country][$param]; 28 if($country){ 29 return $ps_api_config[$country][$param]; 30 } 31 28 32 } 29 33 … … 121 125 122 126 // update db 123 if( get_user_meta($current_user->ID, 'ps_is_api_connected', true)) {127 if(isset($current_user) && get_user_meta($current_user->ID, 'ps_is_api_connected', true)) { 124 128 ps_update_advertisers_db(true); 125 129 ps_update_conversions(true); … … 191 195 if (get_option('ps_last_check_account_balance') + 60 * 60 < time()) { 192 196 $json = ps_api_connect('affiliate-info', 'GET', array()); 193 $total = number_format($json['result']['current_affiliate_earnings'], 2); 197 $total = number_format(0,2); 198 if ($json['result'] && $json['result']['current_affiliate_earnings']){ 199 $total = number_format($json['result']['current_affiliate_earnings'], 2); 200 } 194 201 update_option('ps_account_balance', $total); 195 202 update_option('ps_last_check_account_balance', time() + 60 * 60); … … 416 423 global $wpdb; 417 424 $current_user = wp_get_current_user(); 418 425 419 426 if ((get_option('ps_last_advertisers_update') + 60 * 60 * 24 < time() || true && get_user_meta($current_user->ID, 'ps_is_api_connected', true)) || $force_update) { 420 427 update_option('ps_last_advertisers_update', time()); 421 428 $json = ps_api_connect('affiliate-advertisers', 'GET'); 422 429 423 foreach ($json['result'] as $res) { 424 $adv_id = (int) $res['id']; 425 426 $check = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ps_advertisers WHERE advertiser_id='" . $adv_id . "'", OBJECT); 427 if (!$check) { 428 429 $insert_data = array( 430 'advertiser_id' => $res['id'], 431 'name' => $res['name'], 432 'link' => ps_clear_url($res['url']) 433 ); 434 $try = $wpdb->insert($wpdb->prefix . "ps_advertisers", $insert_data); 435 } 436 } 430 if ($json && $json['result']){ 431 foreach ($json['result'] as $res) { 432 $adv_id = (int) $res['id']; 433 434 $check = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "ps_advertisers WHERE advertiser_id='" . $adv_id . "'", OBJECT); 435 if (!$check) { 436 437 $insert_data = array( 438 'advertiser_id' => $res['id'], 439 'name' => $res['name'], 440 'link' => ps_clear_url($res['url']) 441 ); 442 $try = $wpdb->insert($wpdb->prefix . "ps_advertisers", $insert_data); 443 } 444 } 445 } 446 437 447 } 438 448 } … … 548 558 $links = ps_get_html_links($content); 549 559 $count_links = count($links); 550 551 560 if ($limit_shorten_links == 'none') { 552 561 $count_links = 0; … … 578 587 update_post_meta($postid, '_ps_limit_shorten_links', $limit_shorten_links); 579 588 } 580 589 581 590 if (isset($_POST['ps_limit_keyword_links'])) { 582 591 $limit_keywords_links = sanitize_text_field($_POST['ps_limit_keyword_links']); … … 635 644 $links = array(); 636 645 foreach ($DOMDoc->getElementsByTagName('a') as $link) { 637 $check_advertiser = $wpdb->get_results("SELECT COUNT(*) as count FROM " . $wpdb->prefix . "ps_advertisers WHERE link='" . ps_clear_url($link->getAttribute('href')) . "'", OBJECT); 646 $linkAttribute = $link->getAttribute('href'); 647 if (is_array($linkAttribute)){ 648 continue; 649 } 650 $check_advertiser = $wpdb->get_results("SELECT COUNT(*) as count FROM " . $wpdb->prefix . "ps_advertisers WHERE link='" . ps_clear_url($linkAttribute) . "'", OBJECT); 638 651 if ($check_advertiser[0]->count || strpos($link->getAttribute('href'), 'm.')) 639 652 $links[] = array( … … 720 733 */ 721 734 $url = parse_url($url); 722 $url = str_replace('www.', '', $url['host']);723 return $url;735 $url = isset($url['host']) ? $url['host'] : ''; 736 return str_replace('www.', '', $url); 724 737 } 725 738 -
wp-profitshare/trunk/readme.txt
r2648394 r2832199 4 4 Requires at least: 4.0 5 5 Tested up to: 5.8.2 6 Stable tag: 1.4. 86 Stable tag: 1.4.9 7 7 Contributors: Conversion.ro 8 8 License: GPLv2 … … 128 128 = 1.4.8 = 129 129 Fix: Add option to change experimental links 130 131 = 1.4.9 = 132 Fix: Update to latest Wordpress Version and PHP 8.x compatibility -
wp-profitshare/trunk/wp-profitshare.php
r2648394 r2832199 4 4 * Plugin URI: https://www.profitshare.ro 5 5 * Description: Converts all your direct links into affiliate links in order for you to earn commissions through Profitshare. 6 * Version: 1.4. 86 * Version: 1.4.9 7 7 * Author: Conversion 8 8 * Author URI: https://www.conversion.ro … … 10 10 */ 11 11 defined('ABSPATH') || exit; 12 define('PS_VERSION', '1.4. 8');13 define('PS_DB_VERSION', '1.4. 8');12 define('PS_VERSION', '1.4.9'); 13 define('PS_DB_VERSION', '1.4.9'); 14 14 15 15 require_once( 'includes/functions.php' ); … … 144 144 $newText .= "<img alt='CSS tooltip image' style='float:right; width:90px; margin:0 0 10px 10px;' src='" . $link->tip_image . "'>"; 145 145 } 146 $newText .= $link->tip_description . "<div class='ttlast'>WP Profitshare 1.4. 4</div></span></a>";146 $newText .= $link->tip_description . "<div class='ttlast'>WP Profitshare 1.4.9</div></span></a>"; 147 147 } else { 148 148 $newText = "<a class='pslinks' href='" . $link->link . "' title='" . $link->title . "' target='" . $openin . "'>" . $link->keyword . "</a>"; … … 1054 1054 $(this).select(); 1055 1055 }); 1056 1057 $('#ps-advertisers-filter'). live('change', function(){1056 1057 $('#ps-advertisers-filter').on('change', function(){ 1058 1058 var advertiser_filter = $(this).val(); 1059 1059 … … 1066 1066 }); 1067 1067 1068 $('#status-filter'). live('change', function(){1068 $('#status-filter').on('change', function(){ 1069 1069 var status_filter = $(this).val(); 1070 1070 … … 1164 1164 <td class="p0"> 1165 1165 <div class="ps-button-sticky-to-input ps-right"> 1166 <input type="text" class="ps-input " name="link" placeholder="https://" id="link" class="regular-text" />1166 <input type="text" class="ps-input regular-text ps-important-padding" name="link" placeholder="https://" id="link" /> 1167 1167 <input type="submit" name="submit_link" class="ps-new-btn ps-green ps-inline" value="Get link" /> 1168 1168 <div class="ps_checkbox_big"> … … 1177 1177 // generate link 1178 1178 if (isset($_POST['submit_link'])) { 1179 $protocol_post = $_POST['link_type'];1179 $protocol_post = isset( $_POST['link_type']) ? $_POST['link_type'] : null; 1180 1180 $url_protocol = 'https'; 1181 1181 … … 1183 1183 $url_protocol = 'http'; 1184 1184 } 1185 1186 $link = esc_sql($ _POST['link']);1185 $rawLink = isset($_POST['link']) ? $_POST['link'] : ''; 1186 $link = esc_sql($rawLink); 1187 1187 $ps_shorten_link = ps_shorten_link('WP Profitshare', $link); 1188 1188 if (!$ps_shorten_link['result']) { … … 1196 1196 <div class="ps-generated-link ps-right"> 1197 1197 <div class="ps-button-sticky-to-input ps-right"> 1198 <input onClick="this.setSelectionRange(0, this.value.length)" class="ps-input ps-generated-link-input " type="text" id="generated_link" value="<?php echo $url_protocol.':'.$ps_shorten_link['shorted']; ?>" />1198 <input onClick="this.setSelectionRange(0, this.value.length)" class="ps-input ps-generated-link-input ps-important-padding" type="text" id="generated_link" value="<?php echo $url_protocol.':'.$ps_shorten_link['shorted']; ?>" /> 1199 1199 <input type="submit" name="submit_link" class="ps-new-btn ps-green ps-inline" id="copy_link" value="Copy" /> 1200 1200 </div> … … 1237 1237 $("[name='link_type']").bootstrapSwitch(); 1238 1238 1239 $('#ps-advertisers-filter'). live('change', function(){1239 $('#ps-advertisers-filter').on('change', function(){ 1240 1240 var advertiser_filter = $(this).val(); 1241 1241 … … 1248 1248 }); 1249 1249 1250 $('#ps-status-filter'). live('change', function(){1250 $('#ps-status-filter').on('change', function(){ 1251 1251 var status_filter = $(this).val(); 1252 1252 … … 1259 1259 }); 1260 1260 1261 $('#conversions-min-sum-filter'). live('change', function(){1261 $('#conversions-min-sum-filter').on('change', function(){ 1262 1262 var min_sum = $(this).val(); 1263 1263
Note: See TracChangeset
for help on using the changeset viewer.