Coder Social home page Coder Social logo

Comments (6)

steffenbew avatar steffenbew commented on May 23, 2024 1

@hussainImran We just released v1.1.1 with the fix for theContentFix.php: https://github.com/flyntwp/flynt/releases/tag/v1.1.1

from flynt.

hussainImran avatar hussainImran commented on May 23, 2024

Also images which I added in slider are not showing their path is
/uploads/dynamic/2019/11/imageName.jpg

When I checked /uploads/ directory, didn't found folder dynamic

Testing locally on window 7, XAMP, php7.1*

from flynt.

domtra avatar domtra commented on May 23, 2024

hi @hussainImran,
you are totally correct about the in_array() bug. A fix is already on the way.

For the images:
Is your .htaccess writeable? Could you paste it here? This part is a bit tricky and might not work on all environments yet. In general, it is correct, that the url is /uploads/dynamic/2019/11/imageName.jpg. First the dynamic folder in uploads will not exists. But this should be created the first time you request a file in there.

from flynt.

hussainImran avatar hussainImran commented on May 23, 2024

hi @hussainImran,
you are totally correct about the in_array() bug. A fix is already on the way.

For the images:
Is your .htaccess writeable? Could you paste it here? This part is a bit tricky and might not work on all environments yet. In general, it is correct, that the url is /uploads/dynamic/2019/11/imageName.jpg. First the dynamic folder in uploads will not exists. But this should be created the first time you request a file in there.

Also there are some notices when using Grid Posts component

Notice: Undefined index: dirname in \flynt-1.1.0\inc\timberDynamicResize.php on line 63

Yes my .htaccess file is writeable. Here it's content

# BEGIN WordPress
# BEGIN Flynt dynamic images
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/dynamic/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /dynamic-images?src=$1 [L,R]

<IfModule mod_setenvif.c>
# Vary: Accept for all the requests to jpeg and png
SetEnvIf Request_URI "\.(jpe?g|png)$" REQUEST_image
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On

# Check if browser supports WebP images
RewriteCond %{HTTP_ACCEPT} image/webp

# Check if WebP replacement image exists
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f

# Serve WebP image instead
RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp]
</IfModule>

<IfModule mod_headers.c>
Header append Vary Accept env=REQUEST_image
</IfModule>

<IfModule mod_mime.c>
AddType image/webp .webp
</IfModule>
# END Flynt dynamic images

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-5.0/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp-5.0/index.php [L]
</IfModule>

# END WordPress

from flynt.

domtra avatar domtra commented on May 23, 2024

@hussainImran so our code is added to the .htaccess but something is wrong with it.
I am quite certain, that this is related to WordPress living in the subfolder wp-5.0.

First we should check if the issue is introduced by Flynt, or if it comes from Timber.

To do so, replace the content of inc/timberDynamicResize.php with

<?php

namespace Flynt\TimberDynamicResize;

use Twig\TwigFilter;

add_action('timber/twig/filters', function ($twig) {
    $twig->addFilter(
        new TwigFilter('resizeDynamic', ['Timber\ImageHelper', 'resize'])
    );
    return $twig;
});

With that, you would use the regular Timber resize functionality.

If this does serve the images, we need to do some further debugging. It has most likely todo either with getRelativeUploadDir() or the home_url() call in generateImage(). Could you then provide some more info about your setup? Folder structure, non-standard WordPress constants, plugins used.

We will add some further info about the setup issues for different environments. I am sure we get this sorted out.

from flynt.

hussainImran avatar hussainImran commented on May 23, 2024

Yes that resolved the issue of images.

I have a common WordPress setup on http://localhost/wp-5.0/ with only ACF PRO, WordPress importer and wp reset plugin active.

Thank You

from flynt.

Related Issues (20)

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.