Changeset 3442720
- Timestamp:
- 01/19/2026 05:56:41 PM (2 months ago)
- Location:
- consignment-store-for-woocommerce
- Files:
-
- 32 added
- 8 edited
-
tags/2.8 (added)
-
tags/2.8/README.txt (added)
-
tags/2.8/admin (added)
-
tags/2.8/admin/class-cws-consignment-admin.php (added)
-
tags/2.8/admin/css (added)
-
tags/2.8/admin/css/cws-consignment-admin.css (added)
-
tags/2.8/admin/index.php (added)
-
tags/2.8/admin/js (added)
-
tags/2.8/admin/js/cws-consignment-admin.js (added)
-
tags/2.8/admin/partials (added)
-
tags/2.8/admin/partials/cws-consignment-admin-display.php (added)
-
tags/2.8/admin/partials/cwscs-consignment.jpg (added)
-
tags/2.8/cws-consignment.php (added)
-
tags/2.8/includes (added)
-
tags/2.8/includes/class-cws-consignment-activator.php (added)
-
tags/2.8/includes/class-cws-consignment-deactivator.php (added)
-
tags/2.8/includes/class-cws-consignment-loader.php (added)
-
tags/2.8/includes/class-cws-consignment.php (added)
-
tags/2.8/includes/index.php (added)
-
tags/2.8/index.php (added)
-
tags/2.8/languages (added)
-
tags/2.8/languages/cws-consignment.pot (added)
-
tags/2.8/public (added)
-
tags/2.8/public/class-cws-consignment-public.php (added)
-
tags/2.8/public/css (added)
-
tags/2.8/public/css/cws-consignment-public.css (added)
-
tags/2.8/public/index.php (added)
-
tags/2.8/public/js (added)
-
tags/2.8/public/js/cws-consignment-public.js (added)
-
tags/2.8/public/partials (added)
-
tags/2.8/public/partials/cws-consignment-public-display.php (added)
-
tags/2.8/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/class-cws-consignment-admin.php (modified) (19 diffs)
-
trunk/admin/partials/cws-consignment-admin-display.php (modified) (6 diffs)
-
trunk/cws-consignment.php (modified) (2 diffs)
-
trunk/includes/class-cws-consignment-loader.php (modified) (1 diff)
-
trunk/includes/class-cws-consignment.php (modified) (3 diffs)
-
trunk/public/class-cws-consignment-public.php (modified) (6 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
consignment-store-for-woocommerce/trunk/README.txt
r3412523 r3442720 4 4 Tags: consignment store, consignment for WooCommerce 5 5 Tested up to: 6.9 6 Stable tag: 2. 76 Stable tag: 2.8 7 7 License: GPLv2 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 75 75 76 76 == Changelog == 77 = 2.8 = 78 * Fix form submission error. 79 77 80 = 2.7 = 78 81 * Fix scrollintoview and error messaging. … … 169 172 170 173 == Upgrade Notice == 174 = 2.8 = 175 * Fix form submission error. Upgrade as soon as possible. 176 171 177 = 2.7 = 172 178 * Fix scrollintoview and error messaging. Upgrade when possible. -
consignment-store-for-woocommerce/trunk/admin/class-cws-consignment-admin.php
r3335016 r3442720 21 21 * @author Charlene Copeland <charlene@charlenesweb.ca> 22 22 */ 23 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 24 23 25 #[AllowDynamicProperties] 26 24 27 class cws_consignment_Admin { 25 28 … … 99 102 //add_shortcode( 'cwscs_additemform', array($this, 'additemform_func') ); 100 103 } 101 // Log errors 102 public function cwscsLogError($system, $file, $fcn, $url, $msg) { 103 global $wpdb; 104 $query = $wpdb->insert( $wpdb->prefix.'cwscs_errorlog', array( 'system' => sanitize_text_field($system), 'file' => sanitize_text_field($file), 'fcn' => sanitize_text_field($fcn), 'url' => esc_url_raw($url), 'msg' => sanitize_text_field($msg) ), array('%s', '%s', '%s', '%s', '%s') ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery 105 $result = $wpdb->insert_id; 106 return $result; 107 } // END cwscsLogError 104 108 105 /** 109 106 * create menu structure … … 330 327 $results = '<p class="cwscs_failmsg">'.$tmp.'. </p>'; 331 328 $url = get_site_url(); 332 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetInventory", $url, $tmp);333 329 $ok = false; 334 330 } … … 361 357 $item = '<p class="cwscs_failmsg">'.$tmp.'.</p>'; 362 358 $url = get_site_url(); 363 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetInventoryByID", $url, $tmp.'ID: '.$id);364 359 } else { 365 360 $item = $results[0]; … … 380 375 $item = '<p class="cwscs_failmsg">'.$tmp.'. Error emailed to Charlene. </p>'; 381 376 $url = get_site_url(); 382 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetInventoryBySKU", $url, $tmp.'SKU: '.$sku);383 377 } else { 384 378 $item = $results; // only 1 … … 402 396 $results = '<p class="cwscs_failmsg">'.$tmp.'. </p>'; 403 397 $url = get_site_url(); 404 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetInventoryBySKU", $url, $tmp.'SKU: '.$sku);405 398 } 406 399 return $results; … … 439 432 440 433 if (!is_object($items) && !is_array($items)) { 441 $tmp = 'Failed to find inventory. Error is '.$wpdb->last_error.'. Search criteria are '.$show.' store tag: '.$search_sku.', keywords: '.$search_kw.'. WHERE is '.$where; 442 $results = array(); 443 $url = get_site_url(); 444 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetInventorySold", $url, $tmp); 434 $tmp = 'Failed to find inventory. Error is '.$wpdb->last_error.'. Search criteria are '.$show.' store tag: '.$search_sku.', keywords: '.$search_kw; 445 435 } elseif (count($items) == 0) 446 436 $results = array(); … … 528 518 $to = sanitize_email(wp_unslash($_POST['approved-email'])); 529 519 $from = $emails[0]; 520 $from = str_replace("<", "<", $from); 521 $from = str_replace(">", ">", $from); 530 522 531 523 if (isset($_POST['approved_subject'])) { … … 546 538 echo '<p class="cwscs_successmsg">An email was sent successfully. </p>'; 547 539 else 548 echo '<p class="cwscs_failmsg">Could not send email .</p>';540 echo '<p class="cwscs_failmsg">Could not send email</p>'; 549 541 } 550 542 } … … 585 577 $post_id = "Unknown ID"; 586 578 } 587 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsRejectItem", $url, "Could not delete inventory ".$post_id.'. Error: '.$wpdb->last_error);588 579 $ok = false; 589 580 } … … 596 587 $to = sanitize_email(wp_unslash($_POST['rejected-email'])); 597 588 $from = $emails[0]; 589 $from = str_replace("<", "<", $from); 590 $from = str_replace(">", ">", $from); 598 591 if (isset($_POST['rejected_subject'])) { 599 592 $subject = wp_unslash( $_POST['rejected_subject'] ); … … 608 601 echo '<p class="cwscs_successmsg">An email was sent. </p>'; 609 602 else { 610 echo '<p class="cwscs_failmsg">Could not send email .</p>';603 echo '<p class="cwscs_failmsg">Could not send email</p>'; 611 604 $ok = false; 612 605 } … … 667 660 $results = array("status"=>0, "msg"=>$tmp); 668 661 $url = get_site_url(); 669 $test = cwscsLogError("admin", "class-cws-consignment-admin-php", "cwscsGetSettingByKey", $url, $tmp);670 662 } elseif (count($values) == 0) { 671 663 $results = array("status"=>0, "data"=>"", "msg"=>""); … … 697 689 698 690 $url = get_site_url(); 699 691 if ($cwscs_key = "emails") { 692 $cwscs_value = str_replace("<", "<", $cwscs_value); 693 $cwscs_value = str_replace(">", ">", $cwscs_value); 694 } 700 695 if (!isset($cwscs_key) || $cwscs_key == "") { 701 696 $msg .= 'There was a problem saving the settings because the key was not set. Please refresh and try again.'; … … 705 700 // Update or insert? 706 701 $values = cwscsGetSettingByKey($cwscs_key); 707 if ($values['status'] == 0) 702 if ($values['status'] == 0) { 708 703 $action = "insert"; 709 else704 } else { 710 705 $action = "update"; 706 } 711 707 if ($action == "update") { 712 708 // if value is blank then delete … … 732 728 $file = "class-cws-consignment-admin.php"; 733 729 $url = get_site_url(); 734 //cwscsLogError($system, $file, $fcn, $url, $tmp);735 730 $results = array("status"=>0, "msg"=>$msg); 736 731 } … … 1011 1006 'width' => array(), 1012 1007 ), 1008 'input' => array( 1009 'aria-describedby' => array(), 1010 'type' => array(), 1011 'class' => array(), 1012 'name' => array(), 1013 'id' => array(), 1014 'value' => array(), 1015 'checked' => array(), 1016 'style' => array(), 1017 ), 1013 1018 'li' => array( 1014 1019 'class' => array(), … … 1026 1031 'span' => array( 1027 1032 'class' => array(), 1033 'id' => array(), 1028 1034 'title' => array(), 1029 1035 'style' => array(), … … 1049 1055 'style' => array(), 1050 1056 ), 1057 'textarea' => array( 1058 'class' => array(), 1059 'name' => array(), 1060 'id' => array(), 1061 ), 1051 1062 'ul' => array( 1052 1063 'class' => array(), -
consignment-store-for-woocommerce/trunk/admin/partials/cws-consignment-admin-display.php
r3335016 r3442720 12 12 * @subpackage cws_consignment/admin/partials 13 13 */ 14 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 14 15 /////////////////////////////////////// 15 16 // SUBMITTED ITEMS display functions … … 127 128 'textarea_rows' => 15, 128 129 'editor_height' => 300, 129 'quicktags' => true,130 130 'tinymce' => true, 131 131 ); … … 166 166 'textarea_rows' => 15, 167 167 'editor_height' => 300, 168 'quicktags' => true,169 168 'tinymce' => true, 170 169 ); … … 320 319 $icons = array("dashicons-admin-tools", "dashicons-category", "dashicons-edit", "dashicons-chart-pie", "dashicons-admin-generic", "dashicons-admin-generic", "dashicons-email-alt"); 321 320 $content = cwscsGetSettingsContent(); 322 323 321 echo ' 324 322 <div class="cwscs_tab">'; … … 338 336 echo ' 339 337 <div id="contenttab_'.esc_html($i).'" class="cwscs_tabcontent cwshidden"> 340 <h3>'.esc_html($tab).'</h3>'. 341 $content[$i].' 338 <h3>'.esc_html($tab).'</h3>'.wp_kses($content[$i], cwscs_allowed_html() ).' 342 339 </div>'; 343 340 … … 540 537 } 541 538 $ct = ' 542 <p> 543 <label for="cwscs_from_email">Send emails to customers from this email address:</label> 544 <br /> 545 <input type="email" name="cwscs_from_email" id="cwscs_from_email" value="'.$cwscs_from_email.'" style="width:350px" aria-describedby="descriptionFromEmail"/><br /> 546 <span id="descriptionFromEmail" class="cwscs_small">Send from email adress (Example: Name <name@domain.com>). Leave blank to use default address.</span> 547 </p> 548 <p> 549 <label for="cwscs_to_email">Send notification emails to:</label><br /> 550 <input type="email" name="cwscs_to_email" id="cwscs_to_email" value="'.$cwscs_to_email.'" style="width:350px" aria-describedby="descriptionToEmail" /><br /> 551 <span id="descriptionToEmail" class="cwscs_small">Send to email adress (Example: Name <name@domain.com>). To notify of an item submitted to the consignment store. If blank, a notification email will not be sent.</span> 552 </p> 539 <p><label for="cwscs_from_email">Send emails to customers from this email address:</label></p> 540 <input type="text" name="cwscs_from_email" id="cwscs_from_email" value="'.$cwscs_from_email.'" style="width:350px" aria-describedby="descriptionFromEmail"/><br /> 541 <span id="descriptionFromEmail" class="cwscs_small">Send from email adress (Example: name <name@domain.com>). Leave blank to use default address.</span> 542 <p><label for="cwscs_to_email">Send notification emails to:</label></p> 543 <input type="text" name="cwscs_to_email" id="cwscs_to_email" value="'.$cwscs_to_email.'" style="width:350px" aria-describedby="descriptionToEmail" /><br /> 544 <span id="descriptionToEmail" class="cwscs_small">Send to email adress (Example: name <name@domain.com>). To notify of an item submitted to the consignment store. If blank, a notification email will not be sent.</span> 553 545 <div class="clear"></div>'; 554 546 return $ct; -
consignment-store-for-woocommerce/trunk/cws-consignment.php
r3412523 r3442720 19 19 * Requires at least: 6.3 20 20 * Requires PHP: 8.0 21 * Version: 2. 721 * Version: 2.8 22 22 * Author: Charlene's Web Services 23 23 * Author URI: https://charlenesweb.ca … … 36 36 * First release 1.0.0 and then using SemVer - https://semver.org X.Y.Z (Major.Minor.Patch) 37 37 */ 38 define( 'CWS_CONSIGNMENT_VERSION', '2. 7' );38 define( 'CWS_CONSIGNMENT_VERSION', '2.8' ); 39 39 define('CWSCS_SRC_DIR', dirname(__FILE__) ); 40 40 /** -
consignment-store-for-woocommerce/trunk/includes/class-cws-consignment-loader.php
r2600130 r3442720 22 22 * @author Charlene Copeland <charlene@charlenesweb.ca> 23 23 */ 24 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 25 24 26 class cws_consignment_Loader { 25 27 -
consignment-store-for-woocommerce/trunk/includes/class-cws-consignment.php
r3412523 r3442720 28 28 * @author Charlene Copeland <charlene@charlenesweb.ca> 29 29 */ 30 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 31 30 32 #[AllowDynamicProperties] 33 31 34 class cws_consignment { 32 35 … … 72 75 $this->version = CWS_CONSIGNMENT_VERSION; 73 76 } else { 74 $this->version = '2. 7';77 $this->version = '2.8'; 75 78 } 76 79 $this->plugin_name = 'cws-consignment'; … … 191 194 } 192 195 } 196 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly -
consignment-store-for-woocommerce/trunk/public/class-cws-consignment-public.php
r3336736 r3442720 21 21 * @author Charlene Copeland <charlene@charlenesweb.ca> 22 22 */ 23 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 24 23 25 #[AllowDynamicProperties] 26 24 27 class cws_consignment_Public { 25 28 … … 145 148 146 149 // Was additem form submitted? 147 if (isset($_POST ['item_cat'])) {150 if (isset($_POST) && is_array($_POST) && isset($_POST['item_cat']) && $_POST['item_cat'] != "") { 148 151 $ok = true; 149 152 // check sku if admin … … 236 239 if (is_array($email_settings) && count($email_settings) == 2 && $email_settings[1] != "") { 237 240 $from = $email_settings[0]; 241 $from = str_replace("<", "<", $from); 242 $from = str_replace(">", ">", $from); 238 243 $to = $email_settings[1]; 239 244 if (isset($_POST['item_retail'])) { … … 341 346 $splits = cwscsGetMySplits(); 342 347 $policy = cwscsGetMyPolicy(); 343 344 unset($_POST); // prevent double submission 348 345 349 $ct .= '<br /> 346 350 <div class="additemform" id="cwscs_additemdiv">'; … … 661 665 $status = 0; 662 666 } 663 if (isset($post['sku']) && $post['sku'] |= "") {667 if (isset($post['sku']) && $post['sku'] != "") { 664 668 $woo = cwscsGetWooBySku($post['sku']); 665 669 if (isset($woo['status']) && $woo['status'] == 1) { … … 697 701 $file = "class-cws-consignment-public.php"; 698 702 $url = get_site_url(); 699 cwscsLogErrror($system, $file, $fcn, $url, $tmp);700 703 } else { 701 704 $result = $wpdb->insert_id; -
consignment-store-for-woocommerce/trunk/uninstall.php
r3312681 r3442720 26 26 */ 27 27 28 // If uninstall not called from WordPress, then exit.28 // if uninstall.php is not called by WordPress, die 29 29 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 30 exit;30 die; 31 31 } 32 32 33 global $wpdb; 33 34 $wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix . "cwscs_inventory"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
Note: See TracChangeset
for help on using the changeset viewer.