Plugin Directory

Changeset 3475361


Ignore:
Timestamp:
03/05/2026 09:22:26 AM (4 weeks ago)
Author:
codecanel
Message:

License check condition modified for old pro version

Location:
wp-before-after-image-slider
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-before-after-image-slider/tags/2.2.0/includes/admin/CarouselUpgrade.php

    r3473372 r3475361  
    4848        }
    4949
    50         // Check if license class exists and is active.
    51         if ( class_exists( '\COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License' ) ) {
    52             $license = \COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License::get_instance();
    53             if ( method_exists( $license, 'is_license_active' ) ) {
    54                 return $license->is_license_active();
    55             }
    56         }
    57 
    58         return false;
     50        // Check if license class exists, has get_instance(), and license is active.
     51        $license_class = '\COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License';
     52        if (
     53            class_exists( $license_class ) &&
     54            method_exists( $license_class, 'get_instance' ) &&
     55            method_exists( $license_class, 'is_license_active' )
     56        ) {
     57            $license = call_user_func( array( $license_class, 'get_instance' ) );
     58            return (bool) $license->is_license_active();
     59        }
     60
     61        // Pro is active but the license class is incompatible (older pro version).
     62        // Treat as licensed so the site does not break — the pro plugin itself will
     63        // enforce the license check on its own.
     64        return true;
    5965    }
    6066
  • wp-before-after-image-slider/trunk/includes/admin/CarouselUpgrade.php

    r3473372 r3475361  
    4848        }
    4949
    50         // Check if license class exists and is active.
    51         if ( class_exists( '\COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License' ) ) {
    52             $license = \COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License::get_instance();
    53             if ( method_exists( $license, 'is_license_active' ) ) {
    54                 return $license->is_license_active();
    55             }
    56         }
    57 
    58         return false;
     50        // Check if license class exists, has get_instance(), and license is active.
     51        $license_class = '\COCA\WP_Before_After_Image_Slider_Pro\Features\Admin\License';
     52        if (
     53            class_exists( $license_class ) &&
     54            method_exists( $license_class, 'get_instance' ) &&
     55            method_exists( $license_class, 'is_license_active' )
     56        ) {
     57            $license = call_user_func( array( $license_class, 'get_instance' ) );
     58            return (bool) $license->is_license_active();
     59        }
     60
     61        // Pro is active but the license class is incompatible (older pro version).
     62        // Treat as licensed so the site does not break — the pro plugin itself will
     63        // enforce the license check on its own.
     64        return true;
    5965    }
    6066
Note: See TracChangeset for help on using the changeset viewer.