Plugin Directory

Changeset 3235295


Ignore:
Timestamp:
02/05/2025 10:26:50 AM (13 months ago)
Author:
gothamdev
Message:

filter for auto-optimize

Location:
gothamazon/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gothamazon/trunk/gothamzone.php

    r3234959 r3235295  
    44 * Plugin URI:        https://gothamazon.com
    55 * Description:       Parse Amazon Product Advertising API Feed in 30 seconds
    6  * Version:           3.4.1
     6 * Version:           3.4.2
    77 * Requires PHP:      7.4
    88 * Author:            Kapsule Network
     
    14961496       
    14971497        if ($amp != true) {
     1498           
    14981499            if (! function_exists('kapsule_cloaking_rewritee')) {
    14991500                function kapsule_cloaking_rewritee() {
    15001501                    wp_enqueue_script( 'gothamazon-js-obf', plugins_url('js/obf.js', __FILE__ ), array(), NULL );   
    15011502                }
    1502                 add_action( 'wp_enqueue_scripts', 'kapsule_cloaking_rewritee' );   
     1503                add_action( 'wp_enqueue_scripts', 'kapsule_cloaking_rewritee' );
     1504               
     1505            }       
     1506               
     1507            if (! function_exists('gtz_my_exclude_obf_from_autoptimize')) {
     1508                function gtz_my_exclude_obf_from_autoptimize($exclude) {
     1509                    $exclude .= '|js/obf.js';
     1510                    return $exclude;
     1511                }
     1512                add_filter('autoptimize_filter_js_exclude', 'gtz_my_exclude_obf_from_autoptimize');
    15031513            }
    1504            
    1505             function gtz_noaccesstoobf( $output, $public ) {
    1506                
    1507                  $plugin_url = plugin_dir_url( __FILE__ );
    1508 
    1509                 // Extraire le chemin relatif à partir de l'URL absolue
    1510                 $relative_path = parse_url( $plugin_url, PHP_URL_PATH );
    1511 
    1512                 // Ajoute une ligne personnalisée au fichier robots.txt avec le chemin relatif
    1513                 $output .= "Disallow: " . $relative_path . "js/obf.js\n";
    1514 
    1515                 return $output;
     1514               
     1515            if (! function_exists('gtz_noaccesstoobf')) {   
     1516                function gtz_noaccesstoobf( $output, $public ) {
     1517                   
     1518                     $plugin_url = plugin_dir_url( __FILE__ );
     1519
     1520                    // Extraire le chemin relatif à partir de l'URL absolue
     1521                    $relative_path = parse_url( $plugin_url, PHP_URL_PATH );
     1522
     1523                    // Ajoute une ligne personnalisée au fichier robots.txt avec le chemin relatif
     1524                    $output .= "Disallow: " . $relative_path . "js/obf.js\n";
     1525
     1526                    return $output;
     1527                }
     1528                add_filter( 'robots_txt', 'gtz_noaccesstoobf', 10, 2 );
    15161529            }
    1517             add_filter( 'robots_txt', 'gtz_noaccesstoobf', 10, 2 );
    1518            
    15191530           
    15201531        }
  • gothamazon/trunk/readme.txt

    r3234959 r3235295  
    44Tags: amazon affiliate, affiliate, affiliation, amazon, ecommerce, amazon product api
    55
    6 Stable tag: 3.4.1
     6Stable tag: 3.4.2
    77
    88Tested up to: 6.7
     
    180180== Changelog ==
    181181
     182= 3.4.2 =
     183
     184- Filter for Auto-optimize
     185
    182186= 3.4.1 =
    183187
Note: See TracChangeset for help on using the changeset viewer.