reduxframework / redux-framework-4

Redux v4
https://redux.io/redux-4/
Other
97 stars 32 forks source link

website slow down after redux plugin activation #202

Closed mohammedeisa closed 3 years ago

mohammedeisa commented 3 years ago

Issue description:

A client mentioned that Redux causes a slow down in his website.

He changed the code in function is_inside_theme in \redux-core\inc\classes\class-redux-functions-ex.php to fix this issue.

Existing code:

                if ( count( $theme_paths ) > 1 ) {
                    $key = array_search( $theme_path, $theme_paths, true );

                    if ( false !== $key ) {
                        unset( $theme_paths[ $key ] );
                    }
                    $data['parent_slug'] = end( $theme_paths );
                    $data['parent_slug'] = explode( '/', $data['parent_slug'] );
                    $data['parent_slug'] = end( $data['parent_slug'] );
                }

Client code:

                if ( count( $theme_paths ) > 1 ) {
                    $key = array_search( $theme_path, $theme_paths, true );

                    if ( false !== $key ) {
                        unset( $theme_paths[ $key ] );
                    }

                    $theme_paths_end= end( $theme_paths );
                    $parent_slug_end= explode( '/', $theme_paths_end );
                    $parent_slug_end = end( $parent_slug_end);

                    $data['parent_slug'] =$theme_paths_end ;
                    $data['parent_slug'] = $parent_slug_end;
                }

This needs to be investigated.

kprovance commented 3 years ago

This fix for this is available from this repo. It'll be available on the wp.org repo for the July update. Thanks!