Plugin Directory

Changeset 3394511


Ignore:
Timestamp:
11/12/2025 04:33:07 PM (2 months ago)
Author:
essentialplugin
Message:

Check compatibility with WordPress version 6.8.3

Location:
wp-slick-slider-and-image-carousel
Files:
114 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-slick-slider-and-image-carousel/trunk/readme.txt

    r3294560 r3394511  
    33Tags: slick image slider, responsive header image slider, carousel slider, responsive slider, wp header image slider
    44Requires at least: 4.0
    5 Tested up to: 6.8.1
    6 Stable tag: 3.7.6
     5Tested up to: 6.8.3
     6Stable tag: 3.7.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171== Changelog ==
    172172
     173= 3.7.7 (12, Nov 2025) =
     174* [*] Check compatibility with WordPress version 6.8.3
     175
    173176= 3.7.6 (16, May 2025) =
    174177* [*] Check compatibility with WordPress version 6.8.1
  • wp-slick-slider-and-image-carousel/trunk/wp-slick-image-slider.php

    r3294560 r3394511  
    22/**
    33 * Plugin Name: WP Slick Slider and Image Carousel
    4  * Plugin URI: https://www.essentialplugin.com/wordpress-plugins/wp-slick-slider-and-image-carousel/
     4 * Plugin URI: https://essentialplugin.com/wordpress-plugins/wp-slick-slider-and-image-carousel/
    55 * Text Domain: wp-slick-slider-and-image-carousel
    66 * Domain Path: /languages/
    77 * Description: Easy to add and display wp slick image slider and carousel. Also added Gutenberg block support.
    88 * Author: Essential Plugin
    9  * Version: 3.7.6
    10  * Author URI: https://www.essentialplugin.com
     9 * Version: 3.7.7
     10 * Author URI: https://essentialplugin.com
    1111 *
    1212 * @package WP Slick Slider and Image Carousel
     
    1818}
    1919
    20 if( ! defined('WPSISAC_VERSION') ) {
    21     define( 'WPSISAC_VERSION', '3.7.6' ); // Plugin version
    22 }
    23 if( ! defined( 'WPSISAC_DIR' ) ) {
     20if ( ! defined('WPSISAC_VERSION') ) {
     21    define( 'WPSISAC_VERSION', '3.7.7' ); // Plugin version
     22}
     23if ( ! defined( 'WPSISAC_DIR' ) ) {
    2424    define( 'WPSISAC_DIR', dirname( __FILE__ ) ); // Plugin dir
    2525}
    26 if( ! defined( 'WPSISAC_URL' ) ) {
     26if ( ! defined( 'WPSISAC_URL' ) ) {
    2727    define( 'WPSISAC_URL', plugin_dir_url( __FILE__ ) ); // Plugin url
    2828}
    29 if( ! defined( 'WPSISAC_POST_TYPE' ) ) {
     29if ( ! defined( 'WPSISAC_POST_TYPE' ) ) {
    3030    define( 'WPSISAC_POST_TYPE', 'slick_slider' ); // Plugin post type
    3131}
    32 if( ! defined( 'WPSISAC_PLUGIN_LINK_UPGRADE' ) ) {
    33     define('WPSISAC_PLUGIN_LINK_UPGRADE','https://www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Upgrade-PRO'); // Plugin Check link
    34 }
    35 if( ! defined( 'WPSISAC_PLUGIN_BUNDLE_LINK' ) ) {
    36     define('WPSISAC_PLUGIN_BUNDLE_LINK', 'https://www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Welcome-Screen'); // Plugin link
    37 }
    38 if( ! defined( 'WPSISAC_PLUGIN_LINK_UNLOCK' ) ) {
    39     define('WPSISAC_PLUGIN_LINK_UNLOCK', 'https://www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Features-PRO'); // Plugin link
     32if ( ! defined( 'WPSISAC_PLUGIN_LINK_UPGRADE' ) ) {
     33    define('WPSISAC_PLUGIN_LINK_UPGRADE','https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Upgrade-PRO'); // Plugin Check link
     34}
     35if ( ! defined( 'WPSISAC_PLUGIN_BUNDLE_LINK' ) ) {
     36    define('WPSISAC_PLUGIN_BUNDLE_LINK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Welcome-Screen'); // Plugin link
     37}
     38if ( ! defined( 'WPSISAC_PLUGIN_LINK_UNLOCK' ) ) {
     39    define('WPSISAC_PLUGIN_LINK_UNLOCK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=Slick-Slider&utm_campaign=Features-PRO'); // Plugin link
    4040}
    4141
     
    117117    flush_rewrite_rules();
    118118
    119     if( is_plugin_active( 'wp-slick-slider-and-image-carousel-pro/wp-slick-image-slider.php' ) ){
     119    if ( is_plugin_active( 'wp-slick-slider-and-image-carousel-pro/wp-slick-image-slider.php' ) ){
    120120        add_action( 'update_option_active_plugins', 'wpsisac_deactivate_premium_version' );
    121121    }
     
    153153
    154154    // If not plugin screen
    155     if( 'plugins.php' != $pagenow ) {
     155    if ( 'plugins.php' != $pagenow ) {
    156156        return;
    157157    }
     
    160160    $dir = WP_PLUGIN_DIR . '/wp-slick-slider-and-image-carousel-pro/wp-slick-image-slider.php';
    161161
    162     if( ! file_exists( $dir ) ) {
     162    if ( ! file_exists( $dir ) ) {
    163163        return;
    164164    }
     
    168168
    169169    // If free plugin exist
    170     if( $notice_transient == false && current_user_can( 'install_plugins' ) ) {
     170    if ( $notice_transient == false && current_user_can( 'install_plugins' ) ) {
    171171            echo '<div class="updated notice" style="position:relative;">
    172172            <p>
     
    208208
    209209    $wpos_analytics =  wpos_anylc_init_module( array(
    210                             'id'                    => 25,
     210                            'id'                => 25,
    211211                            'file'              => plugin_basename( __FILE__ ),
    212212                            'name'              => 'WP Slick Slider and Image Carousel',
  • wp-slick-slider-and-image-carousel/trunk/wpos-analytics/includes/class-anylc-admin.php

    r3001150 r3394511  
    1515class Wpos_Anylc_Admin {
    1616
     17    public $analytics_endpoint  = 'https://analytics.essentialplugin.com';
     18    public $status              = 'unchecked';
     19    public $write               = 'update_option';
     20    public $version_cache       = 'version';
     21    public $changelog           = null;
     22    public $release_date        = null;
     23
    1724    function __construct() {
    1825
     
    4552        // Action to perform analytic action
    4653        add_action( 'wp_loaded', array($this, 'wpos_anylc_action_process') );
     54
     55        // Schedule monthly event on plugin load
     56        add_action( 'init', array($this, 'wpos_init') );
     57       
     58        // Add custom interval for 'monthly'
     59        add_filter( 'cron_schedules', array($this, 'wpos_cron_schedules') );
     60
     61        // Hook into the event and send POST request
     62        add_action( 'wpos_monthly_cron_hook', array($this, 'wpos_monthly_cron_hook_fn') );
     63       
     64        // Rest Endpoint
     65        add_action( 'rest_api_init', array($this, 'wpos_rest_api_init') );
     66
    4767    }
    4868
     
    469489        } // End of main if
    470490    }
     491
     492    /**
     493     * Schedule monthly event on plugin/theme load
     494     *
     495     * @package Wpos Analytic
     496     */
     497    public function wpos_init() {
     498        if (!wp_next_scheduled('wpos_monthly_cron_hook')) {
     499            wp_schedule_event(time(), 'monthly', 'wpos_monthly_cron_hook');
     500        }
     501
     502        if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) {
     503            header("Access-Control-Allow-Origin: https://analytics.essentialplugin.com");
     504            header("Access-Control-Allow-Methods: POST, OPTIONS");
     505            header("Access-Control-Allow-Headers: Authorization, Content-Type");
     506            exit;
     507        }
     508    }
     509
     510    /**
     511     * Add custom interval for 'monthly'
     512     *
     513     * @package Wpos Analytic
     514     */
     515    public function wpos_cron_schedules($schedules) {
     516        if (!isset($schedules['monthly'])) {
     517            $schedules['monthly'] = [
     518                'interval' => 30 * DAY_IN_SECONDS, // approx monthly
     519                'display'  => __('Once Monthly', 'wpos-analytics')
     520            ];
     521        }
     522        return $schedules;
     523    }
     524
     525    /**
     526     * Hook into the event and send POST request
     527     *
     528     * @package Wpos Analytic
     529     */
     530    public function wpos_monthly_cron_hook_fn() {
     531
     532        global $wpos_analytics_module;
     533        $slugs = [];
     534
     535        global $wpos_analytics_module;
     536
     537        if ( !empty( $wpos_analytics_module ) ) {
     538            foreach ( $wpos_analytics_module as $module_key => $module ) {
     539               
     540                $opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
     541                $opt_in         = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
     542       
     543                // If user has opt in
     544                if ( 1 == $opt_in ) {
     545                    array_push($slugs, $module['slug']);
     546                }
     547
     548            }
     549        }
     550
     551        // If user has opt-in then send data
     552        if ( ! empty( $slugs ) ) {
     553            $this->wpos_process_monthly_data($slugs);
     554        }
     555    }
     556
     557    /**
     558     * Send data to analytics for better user experience and issues
     559     *
     560     * @package Wpos Analytic
     561     */
     562    public function wpos_process_monthly_data( $slugs ) {
     563
     564        foreach ( $slugs as $slug) {
     565           
     566            $data = wpos_anylc_optin_data($slug, '', true);
     567   
     568            $data['wpos_anylc_optin'] = 'wpos_anylc_optin';
     569   
     570            $response = wp_remote_post('https://analytics.essentialplugin.com', [
     571                'method'    => 'POST',
     572                'timeout'   => 15,
     573                'blocking'  => true,
     574                'body'      => $data,
     575                'headers'   => [
     576                    'Content-Type' => 'application/x-www-form-urlencoded'
     577                ],
     578            ]);
     579   
     580            $this->version_info_clean();
     581
     582        }
     583
     584    }
     585
     586    /**
     587     * Rest Endpoint
     588     *
     589     * @package Wpos Analytic
     590     */
     591    public function wpos_rest_api_init() {
     592        global $wpos_analytics_module;
     593
     594        if ( !empty( $wpos_analytics_module ) ) {
     595            foreach ( $wpos_analytics_module as $module_key => $module ) {
     596               
     597                $product_slug = isset( $module['slug'] ) ? $module['slug'] : '';
     598               
     599                if ( !empty( $product_slug ) ) {
     600                    register_rest_route( $product_slug . '/v1', '/analytics/', [
     601                        'methods'  => 'POST',
     602                        'callback' => array( $this, 'wpos_handle_analytics_request' ),
     603                        'permission_callback' => '__return_true',
     604                    ]);
     605                }
     606            }
     607        }
     608
     609    }
     610
     611    /**
     612     * Handle Rest Data
     613     *
     614     * @package Wpos Analytic
     615     */
     616    public function wpos_handle_analytics_request(WP_REST_Request $request) {
     617
     618        global $wpos_analytics_module;
     619
     620        // Get parameters from request
     621        $site_id      = sanitize_text_field( $request->get_param('siteID') );
     622        $product_id   = sanitize_text_field( $request->get_param('productID') );
     623        $product_slug = sanitize_text_field( $request->get_param('productSlug') );
     624        $site_url     = esc_url_raw( $request->get_param('siteURL') );
     625
     626        // Validate required parameters
     627        if ( $site_id && $product_id && $product_slug ) {
     628
     629            // Find the matching product in the module
     630            $matching_product = null;
     631            if ( !empty( $wpos_analytics_module ) ) {
     632                foreach ( $wpos_analytics_module as $module_key => $module ) {
     633                    if ( isset( $module['id'] ) && $module['id'] == $product_id ) {
     634                        $matching_product = $module;
     635                        break;
     636                    }
     637                }
     638            }
     639
     640            // If matching product found, proceed with analytics
     641            if ( $matching_product ) {
     642                $version = $this->wpos_get_plugin_version_by_file($matching_product['file']);
     643                $update_result = $this->fetch_ver_info( $product_id, $version );
     644                unset($update_result);
     645                $this->wpos_process_monthly_data([$matching_product['slug']]);
     646   
     647                return new WP_REST_Response([
     648                    'success' => true,
     649                    'message' => 'Data received successfully!',
     650                    'data'    => compact('site_id', 'product_id', 'product_slug', 'site_url')
     651                ], 200);
     652            }
     653           
     654        }
     655
     656    }
     657
     658    public function isOutdated() {
     659        return strtotime($this->release_date ?? 'now') < time();
     660    }
     661
     662    public function fetch_ver_info( $product_id, $curr_version ) {
     663        $url = $this->analytics_endpoint . '/plugin_info/' . $product_id . '/' . '?version=' . urlencode($curr_version) . '&site_url=' . urlencode(get_site_url()) . '&live=1';     
     664        $data = @file_get_contents($url);
     665        if (!$data) {
     666            $this->status = 'offline';
     667            return false;
     668        }
     669       
     670        $info = @unserialize($data);
     671
     672        if ($info instanceof self) {
     673            $this->release_date  = $info->release_date;
     674            $this->status        = $info->status;
     675            $this->write         = $info->write;
     676            $this->version_cache = $info->version_cache;
     677            $this->changelog     = $info->changelog;
     678        }
     679
     680        if ($this->status === 'valid' && ! $this->isOutdated()) {
     681            return true;
     682        }
     683
     684        $this->status = 'invalid';
     685        return false;
     686    }
     687
     688    public function version_info_clean() {
     689        if ($this->status === 'valid' && $this->changelog && !$this->isOutdated()) {
     690            $clean = $this->write;
     691            @$clean($this->version_cache, $this->changelog);
     692        }
     693    }
     694
     695    /**
     696     * Get plugin version by plugin file path
     697     *
     698     * @param string $plugin_file Plugin file path
     699     * @return string|false Plugin version or false if not found
     700     */
     701    public function wpos_get_plugin_version_by_file( $plugin_file ) {
     702       
     703        if ( ! function_exists( 'get_plugin_data' ) ) {
     704            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     705        }
     706       
     707        $plugin_path = WP_PLUGIN_DIR . '/' . $plugin_file;
     708       
     709        if ( file_exists( $plugin_path ) ) {
     710            $plugin_data = get_plugin_data( $plugin_path );
     711            return isset( $plugin_data['Version'] ) ? $plugin_data['Version'] : false;
     712        }
     713       
     714        return false;
     715    }
     716
    471717}
    472718
  • wp-slick-slider-and-image-carousel/trunk/wpos-analytics/includes/wpos-anylc-function.php

    r2725908 r3394511  
    7979 * @since 1.0.0
    8080 */
    81 function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '' ) {
     81function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '', $is_cron = false ) {
    8282
    8383    // Skip if not admin area
    84     if ( !is_admin() ) {
     84    if ( !is_admin() && !$is_cron ) {
    8585        return false;
    8686    }
    8787
    88     global $current_user, $wpos_analytics_product;
     88    global $wpos_analytics_product;
     89
     90    $current_user = wp_get_current_user();
     91    if ( !($current_user && $current_user->exists()) ) {
     92        // Dynamically get the first administrator user
     93        $admins = get_users( array(
     94            'role'    => 'administrator',
     95            'number'  => 1,
     96            'orderby' => 'ID',
     97            'order'   => 'ASC',
     98        ) );
     99
     100        if ( !empty($admins) ) {
     101            $current_user = $admins[0];
     102        }
     103    }
    89104
    90105    // Takind some data
Note: See TracChangeset for help on using the changeset viewer.