+13
Progress - 75%

Optimization for performance

lefaek 3 years ago updated by Andrei S. (Developer) 5 months ago 17

ToDo

- caching system (save complex queries in transients and automatically flush them on dependent data instances have been changed)

- optimize scripts and styles and load them optionally on selected pages (Swiper, ECharts, Datatables, FlatPicker Calendar)

- image optimization (logos and player photos) - can be used 3d party plugins

- LIVE performance improvements

- load some content later by ajax (in hidden tabs, in hidden slides, in the list of games)

- image optimization plugin (in progress) - reduce small logos to 50*50 with tinypng API

- optimize DB structure (PRO version - player stats) to reduce the size and improve performance: maybe create statistic columns dynamically on save config

====

--- Original post ---

This script is amazing but too heavy. It could be lighter. Some tips for speed are:

1. All of anwp scripts and css loads in every page even not used. I use asset clean up and unload scripts that are not used in every pages. You can unload js/css by page/post or by post type ex. From all matches/clubs/etc pages.

I find what some js do. Echarts is for charts of course, easytimer is for livescore, datatables for player stats. But I don't know what propper/polyfilled/modal/airbnb does.

2. The script loads the original club image which is 150x150px (api import) and about 30kb. Is it possible to select to use the thumb of that image because now each of my pages has 1-1.5 mb just for club images


+4
Under review

What about a special Settings page with the possibility to enable/disable scripts/styles.

Maybe a solution like on the screenshot below will be cool?

Image 2659

Hi Andrei, 

I had the same problem, kindly help me how to get into this setting page. Thank you

that would be great. Similar to asset clean up. But also include some info for what each JS does/used in. So we know where to disable

Planned

--

Best Regards

Andrei S.

+2

v0.13.7 - Swiper (slider) and ECharts (charts) scripts are loading only on pages where needed

+1

v0.14.0

- loading scripts (Justified gallery + Featherlight) - only on required pages; 

- removed OverlayScrollbars

- optimized and removed unused CSS styles (main CSS file size is reduced appr. 300%)

- removed IE support (CSS styles and some scripts)

since v0.14.0 

- image lazy loading plugins work properly with team logos and player photos. Now they use <img> tag, before - background image.

Андрей, приветствую! Планируются ли еще какие то работы по оптимизации для ускорения процессов? Все еще наблюдается тяжесть загрузки страниц, хотя сделано не мало. 


Было бы здорово дотянуть до показателей 70+.
Заранее благодарен за ответ.

Progress - 50%

--

Best Regards

Andrei S.

+3

v0.14.8

- loading scripts (DataTables + Flatpickr) - only on required pages;


v0.14.8

- added optimized Swiper library (twice smaller). If you have a problem with it, disable it in FL+ Customizer


v0.14.10

- LIVE Import - changed import logic and rewritten code for better performance


v0.14.11

- img tag: added loading="lazy" attribute and width and height attributes

When will you do the DB optimization?

Later. 

It is a bit tricky and risky because it requires database manipulation. 

Maybe it will be a special plugin for advanced users.

--

Best Regards

Andrei S.

+3

v0.15.0

- JavaScript files have been rewritten in order to remove the jQuery dependency (frontend only)

- load scripts only on required pages (Plyr)

- changed game kickoff flipped countdown to a simple one (removed old jQuery script)