aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/statsController.php
AgeCommit message (Collapse)Author
2025-08-11Put CSP everywhere (#7810)Gravatar Inverle
* Puts CSP everywhere in `p/api` * including the HTML query page ❗ * Also in `p/ext.php` * Puts `X-Content-Type-Options: nosniff` everywhere * Fixes custom icon configuration not showing `blob:` icon in statsController (idle feeds) * Also removes `style-src 'unsafe-inline'` since it doesn't seem to be needed * Improves CSP of `p/f.php` * Add `sandbox` directive
2025-07-25Update chart.js from 3.5.1 to 4.5.0 (#7752)Gravatar Inverle
2025-06-18frame-ancestors CSP (#7677)Gravatar Inverle
2025-01-10Reduce undeeded use of elvis operator ?: (#7204)Gravatar Alexandre Alapetite
2024-12-27PHPStan 2.0 (#7131)Gravatar Alexandre Alapetite
* PHPStan 2.0 fix https://github.com/FreshRSS/FreshRSS/issues/6989 https://github.com/phpstan/phpstan/releases/tag/2.0.0 https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * More * More * Done * fix i18n CLI * Restore a PHPStan Next test For work towards PHPStan Level 10 * 4 more on Level 10 * fix getTagsForEntry * API at Level 10 * More Level 10 * Finish Minz at Level 10 * Finish CLI at Level 10 * Finish Controllers at Level 10 * More Level 10 * More * Pass bleedingEdge * Clean PHPStan options and add TODOs * Level 10 for main config * More * Consitency array vs. list * Sanitize themes get_infos * Simplify TagDAO->getTagsForEntries() * Finish reportAnyTypeWideningInVarTag * Prepare checkBenevolentUnionTypes and checkImplicitMixed * Fixes * Refix * Another fix * Casing of __METHOD__ constant
2024-04-10PHP 8.3 #[\Override] (#6273)Gravatar Alexandre Alapetite
* PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly
2024-02-26New feature: shareable user query (#6052)Gravatar Alexandre Alapetite
* New feature: shareable user query Share the output of a user query by RSS / HTML / OPML with other people through unique URLs. Replaces the global admin token, which was the only option (but unsafe) to share RSS outputs with other people. Also add a new HTML output for people without an RSS reader. fix https://github.com/FreshRSS/FreshRSS/issues/3066#issuecomment-648977890 fix https://github.com/FreshRSS/FreshRSS/issues/3178#issuecomment-769435504 * Remove unused method * Fix token saving * Implement HTML view * Update i18n for master token * Revert i18n get_favorite * Fix missing i18n for user queries from before this PR * Remove irrelevant tests * Add link to RSS version * Fix getGet * Fix getState * Fix getSearch * Alternative getSearch * Default getOrder * Explicit default state * Fix test * Add OPML sharing * Remove many redundant SQL queries from original implementation of user queries * Fix article tags * Use default user settings * Prepare public search * Fixes * Allow user search on article tags * Implement user search * Revert filter bug * Revert wrong SQL left outer join change * Implement checkboxes * Safe check of OPML * Fix label * Remove RSS button to favour new sharing method That sharing button was using a global admin token * First version of HTTP 304 * Disallow some recusrivity fix https://github.com/FreshRSS/FreshRSS/issues/6086 * Draft of nav * Minor httpConditional * Add support for offset for pagination * Fix offset pagination * Fix explicit order ASC * Add documentation * Help links i18n * Note about deprecated master token * Typo * Doc about format
2023-12-27More robust assignment of categories to feeds (#5986)Gravatar Alexandre Alapetite
Several minor cases, none of which should really be necessary Might help: https://github.com/FreshRSS/FreshRSS/issues/5981 https://github.com/FreshRSS/FreshRSS/issues/5982
2023-12-14Remove variable default_category (#5945)Gravatar Alexandre Alapetite
Not really used, and causing bug in https://github.com/FreshRSS/FreshRSS/pull/5942 ``` Fatal error: Uncaught Error: Typed property FreshRSS_View::$default_category must not be accessed before initialization in /var/www/FreshRSS/app/views/helpers/category/update.phtml:218 Stack trace: #0 /var/www/FreshRSS/lib/Minz/View.php(93): include() #1 /var/www/FreshRSS/lib/Minz/View.php(143): Minz_View->includeFile() #2 /var/www/FreshRSS/app/views/category/update.phtml(9): Minz_View->renderHelper() #3 /var/www/FreshRSS/lib/Minz/View.php(93): include('...') #4 /var/www/FreshRSS/lib/Minz/View.php(115): Minz_View->includeFile() #5 /var/www/FreshRSS/lib/Minz/View.php(75): Minz_View->render() #6 /var/www/FreshRSS/lib/Minz/Dispatcher.php(59): Minz_View->build() #7 /var/www/FreshRSS/lib/Minz/FrontController.php(61): Minz_Dispatcher->run() #8 /var/www/FreshRSS/p/i/index.php(59): Minz_FrontController->run() #9 {main} thrown in /var/www/FreshRSS/app/views/helpers/category/update.phtml on line 218 ```
2023-11-24Fix types for extensions (#5901)Gravatar Alexandre Alapetite
* Fix types for extensions To accompany https://github.com/FreshRSS/Extensions/pull/185 * Avoid bug redeclared function
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-06Remove obsolete TTL migration code (#5625)Gravatar Alexandre Alapetite
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 https://github.com/FreshRSS/FreshRSS/pull/1750 This function contributed to locking the database https://github.com/FreshRSS/FreshRSS/pull/5574 Subset of https://github.com/FreshRSS/FreshRSS/pull/3558
2023-07-07Chore/processing of depreciations and updating code to php72 minimum (#5504)Gravatar Luc SANCHEZ
* processing of depreciations and updating of code to php7.2 minimum * Autoformat many strange array indenting And revert a few unwanted changes --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-11A few additional PHPStan rules (#5388)Gravatar Alexandre Alapetite
A subset of https://github.com/phpstan/phpstan-strict-rules
2023-05-11Typed view model classes (#5380)Gravatar Alexandre Alapetite
* Typed view model classes * Add ability to provide a typed view model class to a controller * Use `::class` instead of string for referring to classes * Examplified with `stats` and `javascript` controllers / views (more to do) * Also useful for extensions (my usecase today), which did not have the ability to define own view model attributes before. * Typo
2023-05-02PHPStan Level 7 complete DAOs (#5354)Gravatar Alexandre Alapetite
* PHPStan Level 7 complete DAOs * Finalise PHPStan Level 7 for CategoryDAO * PHPStan Level 7 for Context and Search * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-04-28PHPStan Level 7 for more DAO PDO (#5328)Gravatar Alexandre Alapetite
* PHPStan Level 7 for more DAO PDO With new function to address common type and check problems * A bit more * PHPStan Level 7 for FreshRSS_Entry
2023-04-17Complete PHPStan Level 6 (#5305)Gravatar Alexandre Alapetite
* Complete PHPStan Level 6 Fix https://github.com/FreshRSS/FreshRSS/issues/4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251 * A few more PHPStan Level 7 preparations * A few last details
2023-04-07Use typed access to request parameters (#5267)Gravatar Alexandre Alapetite
* Use typed access to request parameters This was a big source of mixed datatypes in many places * Fix notifications * Fix bookmarkAction
2023-03-26Fix repartitionAction (#5228)Gravatar Alexandre Alapetite
* Fix repartitionAction Fix https://github.com/FreshRSS/FreshRSS/issues/5227 * Better types * PHPStan level 6
2023-03-21Typehint some Controllers (#5106)Gravatar Luc SANCHEZ
* Typehint to Controllers * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-01-21statsController at phpStan level 9 (#5028)Gravatar Alexandre Alapetite
Follow up of https://github.com/FreshRSS/FreshRSS/pull/5024 ``` vendor/bin/phpstan analyse --level 9 app/Controllers/statsController.php ``` Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-01-20Type hinting statsController.php (#5024)Gravatar Luc SANCHEZ
2022-05-23Custom logo HTML (#4369)Gravatar Alexandre Alapetite
* Custom logo HTML Add option for custom HTML logo/title in the main Web UI view. Can potentially be different per user. #fix https://github.com/FreshRSS/FreshRSS/pull/3830/files#r850472247 * logo_html in main config With new `./data/config.custom.php` to provide custom values before install * Docker documentation * whitespace * Auto relax CSP to allow images for HTML logo * Documentation
2022-05-15fix preview (#4291)Gravatar maTh
* fix * Update extra.js * reorga the scripts * Update extra.js * Several fixes https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1125472321 * More fixes * Cleaning * fix pr 4291 * Reorganise some script functions * Remove unused popup-txt And associated function openPopupWithMessage * Fix archiving categories https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126924602 * Fix stats https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126983134 * Fix direct subscription E.g. http://localhost/i/?c=subscription&id=735 * Fix subscription add https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126991621 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-03-21Show errored, empty, muted feeds in statistics (#4276)Gravatar Alexandre Alapetite
2022-02-05Improved: Idle feeds list in a new layout (#4192)Gravatar maTh
* that should work fine * fixed phpcs * fixed phpcs
2022-01-09Add spell checking with typos (#4138)Gravatar Alexandre Alapetite
* Add spell checking with typos Implement https://github.com/FreshRSS/FreshRSS/pull/4134#issuecomment-1008027558 * GitHub Actions attempt * Quiet wget * Makefile
2022-01-04PHPStan level 5 (#4110)Gravatar Alexandre Alapetite
* Fix most PHPDocs errors Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 https://phpstan.org/writing-php-code/phpdoc-types * Avoid func_get_args Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list And avoid dynamic functions names when possible to more easily identify calls and unused functions. Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 * PHPStan level 3 * PHPStand level 4 * Update default to PHPStan level 4 * Towards level 5 * Fix level 4 regression * Towards level 5 * Pass PHPStan level 5 * Towards level 6 * Remove erronenous regression from changelog https://github.com/FreshRSS/FreshRSS/pull/4116
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
2021-10-16Stats: replace flotr2 with chart.js (#3858)Gravatar maTh
* include Chart.js * page: main statistics. Flotr.js replaced with Chart.js * main stats + repartition * Delete: repartition.js + stats.js * delete flotr2 * add libs in README * polish * code polish * fixed amount of week days and months * added manget link for LibreJS * added: @license-end * phpcbf + jshint formatting * delete old code * fix stats * fix Comments * finally I found the issue and fixed its best * fix the month stats * Whitespace fixes * Remove flotr2 * Rename to chart.min.js * Remove console.log Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-09-13Delete jQuery (#3847)Gravatar maTh
* delete jquery.min.js lib
2020-03-22More inactive cutoffs (#2831)Gravatar Anton Smirnov
* Fill additional cutoffs * Update phpdoc * Add translation strings * Update app/i18n/fr/gen.php Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr> * Add Dutch translation Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2019-12-22tec: Allow to change CSP header from controllersGravatar Marien Fressinaud
For an extension, I needed to call a script from an external domain. Unfortunately, the CSP headers didn't allow this domain and I had to patch manually the FreshRSS FrontController for my extension. It's obviously not a long-term solution since it has nothing to do in the core of FRSS, and I don't want to apply this patch manually at each update. With this patch, I allow changing the CSP header from inside the controller actions. It allows extensions to modify headers. It's also an opportunity to remove a bit of code from the FrontController. I wasn't happy with the previous implementation anyhow. Reference: https://github.com/flusio/xExtension-Flus/commit/ed12d56#diff-ff12e33ed31b23bda327499fa6e84eccR143
2019-02-13Less jQuery (#2234)Gravatar Alexandre Alapetite
* Less jQuery Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199 * Even less jQuery + global view unread title fix * Even less jQuery * Yet even less jQuery * Even less jQuery * Reduce some events * Even less jQuery * jQuery gone from main view +Fixed English i18n * Fix feed folded view * Remove Firefox 64 workaround Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox 65 * Split to extra.js Avoid loading unneeded JavaScript code for the main view. + several adjustements * Improve CSS transition fold category * Rewrite shortcuts Remove library. Much faster, shorter, one listener instead of many. Control of the shortcut context. Fix https://github.com/FreshRSS/FreshRSS/issues/2215 * Remove debug * Minor syntax * Filter out unwanted shortcut modifiers * Menu overflow fix * Typo * Fix unfolding in mobile view * Remove jQuery from category.js * Remove jQuery from Global view
2018-09-29Custom labels (#2027)Gravatar Alexandre Alapetite
* First draft of custom tags https://github.com/FreshRSS/FreshRSS/issues/928 https://github.com/FreshRSS/FreshRSS/issues/1367 * SMALLINT to BIGINT for id_entry And uppercase SQL types * Fix layout for unreads * Start UI menu * Change menu order * Clean database helpers https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535 * Travis rules do not understand PostgreSQL constants Grrr * Tag controller + UI * Add column attributes to tags * Use only favicon for now, for label * Fix styling for different themes * Constant for maximum InnoDB index length in Unicode https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200 (I would have personnally prefered keeping the readability of a real value instead of a constant, in this case of many SQL fields) * Use FreshRSS_Factory::createCategoryDao * Add view of all articles containing any tag * Fix search in tags * Mark as read tags * Partial auto-update unread tags * More auto update tag unreads * Add tag deletion * Do not purge tagged articles * Minor comment * Fix SQLite and UI bug * Google Reader API support for user tags Add SQL check that tag names must be distinct from category names * whitespace * Add missing API for EasyRSS * Compatibility SQLite Problematic parentheses * Add SQL DISTINCT for cases with multiple tags * Fix for PostgreSQL PostgreSQL needs some additional type hint to avoid "could not determine data type of parameter $1" http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2016-09-11Simplify SQL in statisticsGravatar Alexandre Alapetite
Reduce the use of product-specific date functions. Improve performances. Remove redundant functions.
2014-12-11Update i18n for statisticsGravatar Marien Fressinaud
2014-11-08Add more info in article repartition pageGravatar Alexis Degrugillier
I added the same information than on the main stat page (total, read, unread and favorite) on the repartition page. Some refactoring was needed.
2014-10-30Fix Minz_Error::error() -> use default valuesGravatar Marien Fressinaud
2014-10-06Refactor authentication system.Gravatar Marien Fressinaud
Big work, not finished. A lot of features have been removed. See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05Coding styleGravatar Marien Fressinaud
Remove spaces before parenthesis. See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05Let's begin the big refactoring!Gravatar Marien Fressinaud
Minz_Translate::t\s? replaces by _t See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-09-29Add an average per day for the 30 day periodGravatar Alexis Degrugillier
2014-09-21Change todo alignGravatar Alexis Degrugillier
2014-09-21Add comments on the stat controllerGravatar Alexis Degrugillier
2014-09-01Add average on repartition charts.Gravatar Alexis Degrugillier
It needs some verification on the value used to calculate the averages.
2014-08-19Syntax 581Gravatar Alexandre Alapetite
#581
2014-08-19Add a feed selector in repartition statistics.Gravatar Alexis Degrugillier
Before we could choose the feed in the statistics only from the feed options in the main view. Now with the new drop-down list, it is possible to choose it from the statistics page. The rendering needs to be polished to be nicer.
2014-07-24Add article repartition in statsGravatar Alexis Degrugillier
Add article repartition per hour, per day of week, per month for all feeds but also for individual feeds.