HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/woocommerce-perfect-seo-url/includes/compatibility/amp.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}

if ( ! class_exists( 'PSU_Compatibility_AMP' ) ) :

class PSU_Compatibility_AMP {

    public function __construct() {
        add_filter( 'psu_rewrite_product_rewrites', array( $this, 'product_amp_rewrite_rule' ), 10, 5 );
    }

    /**
     * Add rewrite rule for AMP products.
     *
     * @return array
     */
    public function product_amp_rewrite_rule( $product_rewrites, $category, $product_prefix, $category_nicename, $url_suffix ) {
        $product_rewrites[$product_prefix . $category_nicename . '/([^/]+)/amp(/(.*))?/?$'] = 'index.php?product=$matches[1]&=$matches[3]';

        return $product_rewrites;
    }

}

endif;

new PSU_Compatibility_AMP();