Plugin Directory

Changeset 1694073


Ignore:
Timestamp:
07/10/2017 10:11:10 PM (9 years ago)
Author:
davidgennoe
Message:

commit to 1.4.8

Location:
web-hosting/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • web-hosting/trunk/index.php

    r1686232 r1694073  
    44Plugin URI: http://www.web-uk.co.uk/wp_plugins/web-hosting/
    55Description: Web Hosting plugin using resellerclub and WHM.
    6 Version: 1.4.7
     6Version: 1.4.8
    77Text Domain: web-hosting
    88Domain Path: language/
  • web-hosting/trunk/readme.txt

    r1686232 r1694073  
    44Tags: web, hosting, domain names, domains, whm, resellerclub
    55Requires at least: 3.0.1
    6 Tested up to: 4.7.5
    7 Stable tag: 1.4.7
     6Tested up to: 4.8
     7Stable tag: 1.4.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818create hosting accounts through WHM
    1919This plugin will also automatically create and email invoices monthly or annually to customers.
    20 has been tested on Version 3.0.8 of WooCommerce
     20has been tested on Version 3.1.0 of WooCommerce
    2121== Installation ==
    2222
     
    6060== Changelog ==
    6161
     62== 1.4.8 ==
     63
     64checked compatibility with WordPress 4.8
     65fix: occassional white screen when adding product to cart
     66fix: ensure when creating accounts through WHM passwords have a minimum of 3 special characters
     67fix: stop more than one product type being added to cart
     68fix: prevent new account details been sent in email when subscription creates new order.
     69
    6270== 1.4.7 ==
    6371
    64 fix stopped new order being created every day for domain renewal
     72fix: stopped new order being created every day for domain renewal
    6573
    6674
    6775== 1.4.6 ==
    6876
    69 fix display currency symbol correctly
    70 
    71 fix added Text Domain: to index.php for language translation
     77fix: display currency symbol correctly
     78
     79fix: added Text Domain: to index.php for language translation
    7280
    7381== 1.4.5 ==
  • web-hosting/trunk/wh_functions.php

    r1686232 r1694073  
    11<?php
    2 // ***** version 1.4.7 *****
     2// ***** version 1.4.8 *****
    33// create a scheduled event (if it does not exist already)
    44function wh_cronstarter_activation() {
     
    344344$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#~!()+";
    345345$randpassword = substr( str_shuffle( $chars ), 0, $length );
    346 if (preg_match('/[()\[\]#~!-+]+/',$randpassword )) {
    347 } else {
     346if (preg_match('/[()\[\]#~!-+]{3}+/',$randpassword )) {
     347    return $randpassword;
     348}
     349else {
    348350$count++;
    349 if ($count > 100){return $randpassword;}
     351if ($count > 1000){return $randpassword;}
    350352goto tryagain;
    351353}
     
    435437
    436438$orderdate= $order->get_date_created();
     439$d1 = new DateTime($today);
     440$d2 = new DateTime($orderdate);
     441if ($d2 > $d1){return;}
    437442$customer_id = $order->get_customer_id();
    438443$user_id  = $customer_id;
     
    622627    $checkcostyear = strpos($monthoryear, 'per year');
    623628   
    624     if($checkcostyear >0){$newdate->modify( '+ 1 year' );}
     629    if($checkcostyear >0){$newdate->modify( '+ 1 year' );} else {$newdate->modify( '+ 1 month' );$a = true;}
    625630   
    626631
     
    10421047{
    10431048$accountpassword = '';
    1044 $random = random_password( $length = 12);
     1049$random = random_password( $length = 15);
    10451050if($random)
    10461051{
     
    11841189{
    11851190global $woocommerce;
    1186 $lang='';
    1187 $hosting_lang = new lang($lang);
     1191//$lang='';
     1192//$hosting_lang = new lang($lang);
    11881193$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                }
    11901205$hosting_count = 0; $domain_count = 0; $ssl_count = 0;
    11911206foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values )
     
    12171232if(isset($hosting_count) && ($hosting_count == 2))
    12181233{
    1219 wc_add_notice( sprintf( __( htmlentities($hosting_lang->error_you_cannot_add_more_than_one_hosting, ENT_COMPAT,'ISO-8859-1', true) ,'woocommerce' ) ) ,'error' );
     1234wc_add_notice( sprintf( __( "error you cannot add more than one hosting package at a time","web-hosting") ) ,'error' );
     1235
    12201236return false;
    12211237}
     
    12291245</script>
    12301246<?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' );
     1247wc_add_notice( sprintf( __( "error you cannot add more than one domain at a time",'web-hosting' ) ) ,'error' );
    12321248return false;
    12331249}
    12341250if(isset($ssl_count) && ($ssl_count == 2))
    12351251{
    1236 wc_add_notice( sprintf( __( htmlentities($hosting_lang->error_you_cannot_add_more_than_one_ssl, ENT_COMPAT,'ISO-8859-1', true),'woocommerce' ) ) ,'error' );
     1252wc_add_notice( sprintf( __( "error you cannot add more than one ssl at a time",'web-hosting' ) ) ,'error' );
    12371253return false;
    12381254//  }
     
    12401256return $passed;
    12411257} // end of function
    1242 add_action('woocommerce_add_to_cart_validation', 'check_hosting_in_cart',12,5);
     1258add_action('woocommerce_add_to_cart_validation', 'check_hosting_in_cart',15,2);
    12431259function CheckDomainCallAPI($method, $url, $data = false,$httpResponse){
    12441260global $url,$data,$httpResponse,$method,$str;
     
    21392155
    21402156
    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
    21452163if ($invoice_type == false)
    21462164{
    2147     update_post_meta($order_id, '_invoice_type', '1');
     2165//  update_post_meta($order_id, '_invoice_type', '1');
    21482166if (isset($paid) && ($paid == 'completed') || ($paid == 'wc-completed'))
    21492167{
     
    22612279{
    22622280   
    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);
    22652283   
    2266     if ($temp == false){
     2284//  if ($temp == false){
    22672285   
    22682286if( $plain_text ){
     
    23122330echo htmlentities($email_customer->email_smtp_host_address, ENT_COMPAT,'ISO-8859-1', true) . ': mail.' . esc_html ($domain1) . '<br /></b>';
    23132331}
    2314     }
     2332//  }
    23152333}
    23162334if (isset($producttype) && ($producttype == "ssl")){
Note: See TracChangeset for help on using the changeset viewer.