Git Product home page Git Product logo

slick-carousel-reloaded's Introduction

About me

With over 10 years of experience in product management, user experience and business development, I transform ideas into digital products that people want to use.

Combining analytical skills, creative thinking and effective communication, I deliver value to both customers and users. I'm goal-oriented, curious and loves to learn new things.

I'm currently working for Nimble as Lead Product Manager. In recent experiences, I got the opportunity to improve agile processes and craft product strategy for various PropTech companies.

Get in touch

Recent certifications

Julien Vernet AWS Certification! I gave myself 30 days to learn, prepare and get this certification. I successfully passed on February 11th, 2021. View badge

slick-carousel-reloaded's People

Contributors

julien731 avatar siamkreative avatar

Watchers

 avatar  avatar  avatar

Forkers

julien731

slick-carousel-reloaded's Issues

Shortcode - Should they have all attributes or just ID?

The plugin's shortcode currently looks like this: [slick_carousel id="85" width="400" height="200" slidetoshow="3" slidetoscroll="1" infinite="true" arrows="true" adaptiveheight="true" lazyload="ondemand"].

But we actually parameters passed to JS Object actually do NOT come from the shortcode attributes. They come directly from the options attached to a post.

Do we really need all shortcode attributes then?

It could just be [slick_carousel id="85"], since the user can modify the shortcode using the options. And every slider should be tailored for a specific use, so that images are re-sized, etc.

PHP Permission denied

Warning: unlink(D:\www\wordpress/wp-content/uploads/): Permission denied in D:\www\wordpress\wp-content\plugins\slick-carousel-reloaded\includes\functions-resize.php on line 64

@julien731

Lazy load option not working

HTML needs to be updated accordingly... http://kenwheeler.github.io/slick/

// To use lazy loading, set a data-lazy attribute
// on your img tags and leave off the src

<img data-lazy="img/lazyfonz1.png"/>

$('.lazy').slick({
  lazyLoad: 'ondemand',
  slidesToShow: 3,
  slidesToScroll: 1
});

Figure out what is the best way to pass parameters to JavaScript

It seems complex to load a script only if the shortcode is used. I see a few options:

  • Create an inline script tag manually for each slider (the shortcode will then output HTML + script tag at the same level)
  • Get all sliders parameters and pass them using wp_localize_script. Is this possible?
  • Pass the parameters as data attribute of the slider markup. With a declarative markup, we can then read those using jQuery and initialize each slider individually.

Titan Framework Loaded Twice

The Titan Framework is currently loaded twice. First by the autoloader in the plugin, second with the Titan Framework plugin that is required to run Slick Carousel Reloaded.

This actually triggers an error (in my environment at least).

image

Solutions

Obviously, one version of TF must be removed. Best practices would suggest keeping the version that's autoloaded but any one version can be removed.

Removing the Autoloaded Version

Because this version seems to be used solely for checking if TF is present, what's really useful is the TitanFrameworkChecker class. This class could simply be extracted and added in the plugin. It doesn't really need to be updated anyways.

Removing the Plugin Version

In this case, the only thing needed is to remove the call to titan-framework-checker.php.

Custom parameters aren't working properly

Adding custom parameters generates the following:

var wpscr = {"sliders":{"220":{"width":480,"height":300,"slidetoshow":1,"slidetoscroll":1,"infinite":true,"dots":false,"arrows":true,"adaptiveheight":false,"lazyload":"false","customparameters":""},"213":{"width":1500,"height":400,"slidetoshow":1,"slidetoscroll":1,"infinite":true,"dots":false,"arrows":true,"adaptiveheight":false,"lazyload":"false","customparameters":"nextArrow: '<div class=\"glyph-icon flaticon-next\"><\/div>',\r\nprevArrow: '<div class=\"glyph-icon flaticon-prev\"><\/div>'"}}};

Need to remove the 'customparameters' and append value like index: value to the existing parameters. Also remove the line breaks and sanitization.

Hide wp_editor when creating a new slider

We need to hide the editor and add a notice "You need to specify the slider size before uploading pictures.".

The size needs to be defined first, so that the images are correctly re-sized.

Add Caption Support

If gallery has captions, display them: vertically centered, horizontally centered to the left.

Add slider option: Enable/Disable captions

Resize function does not work as expected

It currently resizes proportionally, which leads to inconsistency between the slider size in the Dashboard, and the actual slider size on the front-end.

Dashboard Slider Settings

screenshot-wordpress dev 2016-05-15 14-16-14

Chrome Dev Tools (Front-End)

image

@julien731

Lock Slider Image Size

At the moment, once a slider is created and images are uploaded, the size can be changed.

However, if the size is changed after images were uploaded, those images won't be resized. Using a plugin the regenerate image sizes won't work. That's the drawback of using conditional image sizes.

I think it would make sense the lock the slider size after it's created so that the user can't change it. For changing the size, the user would have to create a different slider.

Cloudinary integration

There is one option in the general settings of the plugin, but it's not used yet...

Is there a need for "on-the-fly image manipulation" settings?

Improve Dashboard Slider List View

In the end, I don't think it's useful to show all parameters of the slider. It's actually counter productive.

The amount of images, size and the shortcode should be enough.

Custom Upload Directory

In my opinion, slider images should be uploaded in its own folder. Maybe using something like this:

<?php

/**
 * Change Upload Directory for Custom Post-Type
 *
 * This will change the upload directory for a custom post-type. Attachments will
 * now be uploaded to an 'uploads' directory within the folder of your plugin. Make
 * sure you swap out 'post-type' in the if-statement with the appropriate value...
 */
function custom_upload_directory($args) {

    $id     = $_REQUEST['post_id'];
    $parent = get_post($id)->post_parent;

    // Check the post-type of the current post
    if ('slider' == get_post_type($id) || 'slider' == get_post_type($parent)) {
        $args['path']    = plugin_dir_path(__FILE__) . 'slider_uploads';
        $args['url']     = plugin_dir_url(__FILE__) . 'slider_uploads';
        $args['basedir'] = plugin_dir_path(__FILE__) . 'slider_uploads';
        $args['baseurl'] = plugin_dir_url(__FILE__) . 'slider_uploads';
    }
    return $args;
}
add_filter('upload_dir', 'custom_upload_directory');

Load Slick via JavaScript

Detect is the plugin is already loaded (from theme or plugin). If it is, then use it, otherwise load it.

if ($.fn.slick) { ... }

Will this be accepted on WordPress.org?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.