Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter nzfade

    (@nzfade)

    It works! Thank you!

    • This reply was modified 6 months, 2 weeks ago by nzfade.
    Thread Starter nzfade

    (@nzfade)

    Hi again, I don’t understand how this is marked as resolved when it’s not?

    Thread Starter nzfade

    (@nzfade)

    Morning, I bought the pro version, and added the

    { “images”: { “regex”: /https?:\/\/.?\/.?.(jpg|jpeg|png|gif|bmp|webp|svg|avif)/i } }

    to the Custom JS Options

    It didn’t work. All the foobox lightbox images stopped working, if i remove the regex they work again.

    Cheers, Shaun

    Thread Starter nzfade

    (@nzfade)

    Here’s the fix, in the data.php file this fixed the importing of the file.

    public static function new_get_freight( $args, $freight_ext ) {
    $response = array(
    ‘status’ => ‘error’,
    ‘freight’ => array(),
    ‘code’ => ”,
    ‘from’ => ”,
    );

    try {
        $_m_h5_tk     = get_option( 'ald_token_m_h5_tk', 'xxxxxxxxxxxxxxxxxxxxxxxxxx' );
        $_m_h5_tk_enc = get_option( 'ald_token_m_h5_tk_enc', 'xxxxxxxxxxxxxxxxxxxx' );
    
        $args['ext']        = $freight_ext;
        $args['quantity']   = $args['count'];
        $args['clientType'] = 'pc';
        $args['userScene'] = 'PC_DETAIL';
    
        $freight = [];
    
        $token = explode( '_', $_m_h5_tk )[0] ?? '';
        $data  = wp_json_encode( $args );
    
        $sign_response = wp_remote_post( 'https://ald.villatheme.com/villatheme-ald-get-signature', [
            'body' => [
                'data'  => $data,
                'token' => $token,
            ]
        ] );
    
        if ( is_wp_error( $sign_response ) ) {
            error_log( 'Sign response error: ' . $sign_response->get_error_message() );
            return $response;
        }
    
        $sign_response_body = wp_remote_retrieve_body( $sign_response );
        $sign_response = json_decode( $sign_response_body, true );
    
        if ( !is_array( $sign_response ) || empty( $sign_response['sign'] ) || empty( $sign_response['time'] ) ) {
            error_log( 'Invalid sign response format or missing data.' );
            return $response;
        }
    
        $sign = $sign_response['sign'];
        $time = $sign_response['time'];
    
        $url = "https://acs.aliexpress.com/h5/mtop.aliexpress.itemdetail.queryexpression/1.0/?jsv=2.5.1&appKey=12574478&t={$time}&sign={$sign}&api=mtop.aliexpress.itemdetail.queryExpression&v=1.0&type=originaljson&dataType=jsonp";
    
        $cookies = [new WP_Http_Cookie( array( 'name' => '_m_h5_tk', 'value' => $_m_h5_tk ) ),
                    new WP_Http_Cookie( array( 'name' => '_m_h5_tk_enc', 'value' => $_m_h5_tk_enc ) )];
    
        $request = wp_remote_post( $url, [
            'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
            'headers'    => array(
                'Content-Type' => 'application/x-www-form-urlencoded',
                "Accept"       => 'application/json',
            ),
            'body'       => [ 'data' => $data ],
            'cookies'    => $cookies,
        ] );
    
        if ( is_wp_error( $request ) ) {
            error_log( 'Request error: ' . $request->get_error_message() );
            return $response;
        }
    
        $body = wp_remote_retrieve_body( $request );
        if ( is_wp_error( $body ) ) {
            error_log( 'Body retrieval error: ' . $body->get_error_message() );
            return $response;
        }
    
        $body = json_decode( $body, true );
        if ( !is_array( $body ) || empty( $body['data'] ) ) {
            error_log( 'Invalid response body format or missing data.' );
            return $response;
        }
    
        $data = $body['data'] ?? [];
        // Continue with your logic after ensuring $data is properly set...
    
        // Your existing logic for processing $data...
    
    } catch ( \Exception $e ) {
        error_log( print_r( $e->getMessage(), true ) );
    }
    
    return $response;

    }

    • This reply was modified 11 months, 3 weeks ago by nzfade.
    Thread Starter nzfade

    (@nzfade)

    I’ve encountered a PHP fatal error related to the woo-alidropship plugin on my WordPress site. The issue arises when attempting to use a function tied to freight data handling within the plugin. Below is the relevant error message:

    vbnetCopy code

    PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/woo-alidropship/includes/data.php on line 2655

    This error is triggered during an operation in the admin area, specifically when trying to access freight information through the plugin’s import list functionality.

    Could you provide guidance on resolving this issue or inform me if a patch is available? The error significantly impacts the plugin’s functionality and my site’s operations.

    Thank you for your assistance.

    Thread Starter nzfade

    (@nzfade)

    Updated – Got it working

    Thread Starter nzfade

    (@nzfade)

    Hey, after a week of problem solving, I worked out the problem.

    Ajax wasn’t working on the site, add to cart buttons, check out etc…..in chrome developer mode, I slowed it right down and noticed that the wc-ajax commands were being 301 redirected.

    After moving the site to a staging site, it all worked….which lead me into looking more closely at the .htaccess file.

    # Include trailing slash on non-filepath URLs with fragment
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.+)/$
    RewriteRule ^(.+)\#(.+)$ https://www.kiwistrippers.co.nz/$1/#$2 [R=301,L]

    Once I removed code like this from the .htaccess file, woo commerce works perfectly.

    Hopefully that might help someone else with the same issue.

    cheers, Shaun

    Forum: Plugins
    In reply to: [NewStatPress] Vistors
    nzfade

    (@nzfade)

    I have the same problem, Last visitors show, Visitors doesn’t

    Any updates with this, avif is such an amazing file type that it should be allowed in wordpress. 500kb jpgs are 250 kb webp files, but avif you get the file compressed to 50kb…..

Viewing 9 replies - 1 through 9 (of 9 total)