Changeset 1694073
- Timestamp:
- 07/10/2017 10:11:10 PM (9 years ago)
- Location:
- web-hosting/trunk
- Files:
-
- 3 edited
-
index.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wh_functions.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
web-hosting/trunk/index.php
r1686232 r1694073 4 4 Plugin URI: http://www.web-uk.co.uk/wp_plugins/web-hosting/ 5 5 Description: Web Hosting plugin using resellerclub and WHM. 6 Version: 1.4. 76 Version: 1.4.8 7 7 Text Domain: web-hosting 8 8 Domain Path: language/ -
web-hosting/trunk/readme.txt
r1686232 r1694073 4 4 Tags: web, hosting, domain names, domains, whm, resellerclub 5 5 Requires at least: 3.0.1 6 Tested up to: 4. 7.57 Stable tag: 1.4. 76 Tested up to: 4.8 7 Stable tag: 1.4.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 create hosting accounts through WHM 19 19 This plugin will also automatically create and email invoices monthly or annually to customers. 20 has been tested on Version 3. 0.8of WooCommerce20 has been tested on Version 3.1.0 of WooCommerce 21 21 == Installation == 22 22 … … 60 60 == Changelog == 61 61 62 == 1.4.8 == 63 64 checked compatibility with WordPress 4.8 65 fix: occassional white screen when adding product to cart 66 fix: ensure when creating accounts through WHM passwords have a minimum of 3 special characters 67 fix: stop more than one product type being added to cart 68 fix: prevent new account details been sent in email when subscription creates new order. 69 62 70 == 1.4.7 == 63 71 64 fix stopped new order being created every day for domain renewal72 fix: stopped new order being created every day for domain renewal 65 73 66 74 67 75 == 1.4.6 == 68 76 69 fix display currency symbol correctly70 71 fix added Text Domain: to index.php for language translation77 fix: display currency symbol correctly 78 79 fix: added Text Domain: to index.php for language translation 72 80 73 81 == 1.4.5 == -
web-hosting/trunk/wh_functions.php
r1686232 r1694073 1 1 <?php 2 // ***** version 1.4. 7*****2 // ***** version 1.4.8 ***** 3 3 // create a scheduled event (if it does not exist already) 4 4 function wh_cronstarter_activation() { … … 344 344 $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#~!()+"; 345 345 $randpassword = substr( str_shuffle( $chars ), 0, $length ); 346 if (preg_match('/[()\[\]#~!-+]+/',$randpassword )) { 347 } else { 346 if (preg_match('/[()\[\]#~!-+]{3}+/',$randpassword )) { 347 return $randpassword; 348 } 349 else { 348 350 $count++; 349 if ($count > 100 ){return $randpassword;}351 if ($count > 1000){return $randpassword;} 350 352 goto tryagain; 351 353 } … … 435 437 436 438 $orderdate= $order->get_date_created(); 439 $d1 = new DateTime($today); 440 $d2 = new DateTime($orderdate); 441 if ($d2 > $d1){return;} 437 442 $customer_id = $order->get_customer_id(); 438 443 $user_id = $customer_id; … … 622 627 $checkcostyear = strpos($monthoryear, 'per year'); 623 628 624 if($checkcostyear >0){$newdate->modify( '+ 1 year' );} 629 if($checkcostyear >0){$newdate->modify( '+ 1 year' );} else {$newdate->modify( '+ 1 month' );$a = true;} 625 630 626 631 … … 1042 1047 { 1043 1048 $accountpassword = ''; 1044 $random = random_password( $length = 1 2);1049 $random = random_password( $length = 15); 1045 1050 if($random) 1046 1051 { … … 1184 1189 { 1185 1190 global $woocommerce; 1186 $lang='';1187 $hosting_lang = new lang($lang);1191 //$lang=''; 1192 //$hosting_lang = new lang($lang); 1188 1193 $added_to_cart_product = $product_id; 1189 $added_to_cart_type = get_post_meta($product_id , 'package', true); 1194 $_product = wc_get_product( $product_id ); 1195 $parent_id = $_product->get_parent_id(); 1196 1197 if (isset($parent_id) && ($parent_id >0)) 1198 { 1199 $added_to_cart_type = get_post_meta($parent_id , 'package', true); 1200 } 1201 else 1202 { 1203 $added_to_cart_type = get_post_meta($product_id , 'package', true); 1204 } 1190 1205 $hosting_count = 0; $domain_count = 0; $ssl_count = 0; 1191 1206 foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) … … 1217 1232 if(isset($hosting_count) && ($hosting_count == 2)) 1218 1233 { 1219 wc_add_notice( sprintf( __( htmlentities($hosting_lang->error_you_cannot_add_more_than_one_hosting, ENT_COMPAT,'ISO-8859-1', true) ,'woocommerce' ) ) ,'error' ); 1234 wc_add_notice( sprintf( __( "error you cannot add more than one hosting package at a time","web-hosting") ) ,'error' ); 1235 1220 1236 return false; 1221 1237 } … … 1229 1245 </script> 1230 1246 <?php 1231 wc_add_notice( sprintf( __( htmlentities($hosting_lang->error_you_cannot_add_more_than_one_domain, ENT_COMPAT,'ISO-8859-1', true) ,'woocommerce' ) ) ,'error' );1247 wc_add_notice( sprintf( __( "error you cannot add more than one domain at a time",'web-hosting' ) ) ,'error' ); 1232 1248 return false; 1233 1249 } 1234 1250 if(isset($ssl_count) && ($ssl_count == 2)) 1235 1251 { 1236 wc_add_notice( sprintf( __( htmlentities($hosting_lang->error_you_cannot_add_more_than_one_ssl, ENT_COMPAT,'ISO-8859-1', true),'woocommerce' ) ) ,'error' );1252 wc_add_notice( sprintf( __( "error you cannot add more than one ssl at a time",'web-hosting' ) ) ,'error' ); 1237 1253 return false; 1238 1254 // } … … 1240 1256 return $passed; 1241 1257 } // end of function 1242 add_action('woocommerce_add_to_cart_validation', 'check_hosting_in_cart',1 2,5);1258 add_action('woocommerce_add_to_cart_validation', 'check_hosting_in_cart',15,2); 1243 1259 function CheckDomainCallAPI($method, $url, $data = false,$httpResponse){ 1244 1260 global $url,$data,$httpResponse,$method,$str; … … 2139 2155 2140 2156 2141 $email_details_already_sent = get_post_meta($order_id, 'previous_order_id',true); 2142 2143 2144 $invoice_type = get_post_meta($order_id, '_invoice_type', true); 2157 //$email_details_already_sent = get_post_meta($order_id, 'previous_order_id',true); 2158 2159 2160 //$invoice_type = get_post_meta($order_id, '_invoice_type', true); 2161 $invoice_type = get_post_meta($order_id, 'previous_order_id', true); // changed from _invoice_type to previous_order_id so account info only gets sent the once 2162 2145 2163 if ($invoice_type == false) 2146 2164 { 2147 update_post_meta($order_id, '_invoice_type', '1');2165 // update_post_meta($order_id, '_invoice_type', '1'); 2148 2166 if (isset($paid) && ($paid == 'completed') || ($paid == 'wc-completed')) 2149 2167 { … … 2261 2279 { 2262 2280 2263 // ***** add check here to see if email details have already been sent **** 2264 $temp = get_post_meta($email_details_already_sent,'_invoice_type',true);2281 // ***** add check here to see if email details have already been sent **** *** 10-07-2017 This has now been moved up above 2282 // $temp = get_post_meta($email_details_already_sent,'_invoice_type',true); 2265 2283 2266 if ($temp == false){2284 // if ($temp == false){ 2267 2285 2268 2286 if( $plain_text ){ … … 2312 2330 echo htmlentities($email_customer->email_smtp_host_address, ENT_COMPAT,'ISO-8859-1', true) . ': mail.' . esc_html ($domain1) . '<br /></b>'; 2313 2331 } 2314 }2332 // } 2315 2333 } 2316 2334 if (isset($producttype) && ($producttype == "ssl")){
Note: See TracChangeset
for help on using the changeset viewer.