diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a03dd4f913..517c55ad6d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -40,6 +40,11 @@ parameters: count: 1 path: inc/Engine/Admin/Deactivation/DeactivationIntent.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: inc/Engine/Admin/DomainChange/Subscriber.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -50,6 +55,11 @@ parameters: count: 12 path: inc/Engine/Admin/Settings/Page.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: inc/Engine/Admin/Settings/Page.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 2 @@ -80,6 +90,11 @@ parameters: count: 1 path: inc/Engine/CDN/RocketCDN/DataManagerSubscriber.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 3 + path: inc/Engine/CDN/RocketCDN/DataManagerSubscriber.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 2 @@ -110,6 +125,11 @@ parameters: count: 1 path: inc/Engine/Cache/PurgeExpired/PurgeExpiredCache.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/Engine/Cache/PurgeExpired/PurgeExpiredCache.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 6 @@ -135,6 +155,11 @@ parameters: count: 1 path: inc/Engine/Common/JobManager/APIHandler/APIClient.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/Engine/Common/JobManager/APIHandler/APIClient.php + - message: "#^One or more @param tags has an invalid name or invalid syntax\\.$#" count: 1 @@ -160,6 +185,11 @@ parameters: count: 1 path: inc/Engine/CriticalPath/Admin/Admin.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: inc/Engine/CriticalPath/Admin/Settings.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 5 @@ -190,6 +220,11 @@ parameters: count: 3 path: inc/Engine/Media/AboveTheFold/AJAX/Controller.php + - + message: "#^Hooks should not be used in ORM classes\\: WP_Rocket\\\\Engine\\\\Media\\\\AboveTheFold\\\\Database\\\\Queries\\\\AboveTheFold\\:\\:apply_filters$#" + count: 1 + path: inc/Engine/Media/AboveTheFold/Database/Queries/AboveTheFold.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -255,11 +290,21 @@ parameters: count: 3 path: inc/Engine/Optimization/DeferJS/DeferJS.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/Engine/Optimization/DeferJS/DeferJS.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: inc/Engine/Optimization/DelayJS/Admin/SiteList.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/Engine/Optimization/DelayJS/Admin/SiteList.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -270,11 +315,21 @@ parameters: count: 1 path: inc/Engine/Optimization/GoogleFonts/Admin/Settings.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/Engine/Optimization/GoogleFonts/Admin/Settings.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: inc/Engine/Optimization/LazyRenderContent/AJAX/Controller.php + - + message: "#^Hooks should not be used in ORM classes\\: WP_Rocket\\\\Engine\\\\Optimization\\\\LazyRenderContent\\\\Database\\\\Queries\\\\LazyRenderContent\\:\\:apply_filters$#" + count: 1 + path: inc/Engine/Optimization/LazyRenderContent/Database/Queries/LazyRenderContent.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -315,6 +370,11 @@ parameters: count: 1 path: inc/Engine/Optimization/Minify/JS/Subscriber.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: inc/Engine/Optimization/RUCSS/Admin/Settings.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 2 @@ -325,6 +385,11 @@ parameters: count: 13 path: inc/Engine/Optimization/RUCSS/Controller/UsedCSS.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: inc/Engine/Optimization/RUCSS/Frontend/Subscriber.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 7 @@ -360,6 +425,11 @@ parameters: count: 5 path: inc/Engine/Preload/Cron/Subscriber.php + - + message: "#^Hooks should not be used in ORM classes\\: WP_Rocket\\\\Engine\\\\Preload\\\\Database\\\\Queries\\\\Cache\\:\\:apply_filters$#" + count: 4 + path: inc/Engine/Preload/Database/Queries/Cache.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 4 @@ -380,6 +450,16 @@ parameters: count: 2 path: inc/Engine/Preload/Subscriber.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/ThirdParty/Hostings/Godaddy.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/ThirdParty/Plugins/Ads/Adthrive.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -395,6 +475,11 @@ parameters: count: 1 path: inc/ThirdParty/Plugins/ModPagespeed.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/ThirdParty/Plugins/Optimization/WPMeteor.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 2 @@ -415,6 +500,11 @@ parameters: count: 1 path: inc/ThirdParty/Plugins/WPGeotargeting.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: inc/ThirdParty/Plugins/WPGeotargeting.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -450,6 +540,11 @@ parameters: count: 1 path: tests/Integration/bootstrap.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 5 + path: tests/Integration/bootstrap.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -570,6 +665,21 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Admin/Settings/Subscriber/asyncWistiaScript.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Admin/Settings/Subscriber/enableMobileCache.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Admin/Settings/Subscriber/enableSeparateCacheFilesMobile.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CDN/RocketCDN/AdminPageSubscriber/displayRocketcdnStatus.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -580,6 +690,21 @@ parameters: count: 1 path: tests/Integration/inc/Engine/CDN/RocketCDN/AdminPageSubscriber/rocketcdnField.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CDN/RocketCDN/CDNOptionsManager/TestCase.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CDN/RocketCDN/NoticesSubscriber/displayRocketcdnCta.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CDN/RocketCDN/RESTSubscriber/disable.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -640,6 +765,21 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Cache/Config/ConfigSubscriber/changeCacheRejectUriWithPermalink.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: tests/Integration/inc/Engine/Cache/PurgeActionsSubscriber/purgeCacheOnPublicSettingChange.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 3 + path: tests/Integration/inc/Engine/Cache/PurgeExpired/Subscriber/getCacheLifespan.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: tests/Integration/inc/Engine/Cache/PurgeExpired/Subscriber/scheduleEvent.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -710,11 +850,21 @@ parameters: count: 1 path: tests/Integration/inc/Engine/CriticalPath/CriticalCSS/getCriticalCssContent.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CriticalPath/CriticalCSS/getCriticalCssContent.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: tests/Integration/inc/Engine/CriticalPath/CriticalCSS/getCurrentPageCriticalCss.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CriticalPath/CriticalCSSSubscriber/deleteCpcss.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -730,6 +880,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/CriticalPath/CriticalCSSSubscriber/insertCriticalCssBuffer.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: tests/Integration/inc/Engine/CriticalPath/CriticalCSSSubscriber/insertCriticalCssBuffer.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -740,6 +895,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/CriticalPath/CriticalCSSSubscriber/stopCpcssProcess.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/CriticalPath/CriticalCSSSubscriber/stopCpcssProcess.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -890,21 +1050,41 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Optimization/DeferJS/AdminSubscriber/addDeferJsOption.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/DeferJS/AdminSubscriber/excludeJqueryDefer.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/deferInlineJs.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/deferInlineJs.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/deferJs.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/deferJs.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/excludeJqueryCombine.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/DeferJS/Subscriber/excludeJqueryCombine.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -930,6 +1110,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Optimization/DelayJS/Subscriber/delayJs.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/DelayJS/Subscriber/delayJs.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -980,6 +1165,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Optimization/DynamicLists/Subscriber/updateLists.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/GoogleFonts/Admin/Subscriber/enableGoogleFonts.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1070,6 +1260,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/Optimization/RUCSS/Frontend/Subscriber/maybeDisablePreloadFonts.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/Optimization/RUCSS/Frontend/Subscriber/maybeDisablePreloadFonts.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1100,6 +1295,11 @@ parameters: count: 1 path: tests/Integration/inc/Engine/WPRocketUninstall/uninstall.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/Engine/WPRocketUninstall/uninstall.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1280,6 +1480,16 @@ parameters: count: 1 path: tests/Integration/inc/ThirdParty/Plugins/Optimization/AMP/isAmpCompatibleCallback.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 3 + path: tests/Integration/inc/ThirdParty/Plugins/Optimization/Autoptimize/warnWhenAggregateInlineCssAndCPCSSActive.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: tests/Integration/inc/ThirdParty/Plugins/Optimization/Autoptimize/warnWhenJsAggregationAndDelayJsActive.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1290,6 +1500,11 @@ parameters: count: 1 path: tests/Integration/inc/ThirdParty/Plugins/Optimization/Ezoic/addExplanations.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/ThirdParty/Plugins/Optimization/Hummingbird/warningNotice.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1365,11 +1580,21 @@ parameters: count: 1 path: tests/Integration/inc/ThirdParty/Plugins/SEO/TheSEOFramework/addTsfSitemapToPreload.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/ThirdParty/Plugins/SimpleCustomCss/updateCacheFile.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 path: tests/Integration/inc/ThirdParty/Plugins/Smush/SmushSubscriberTestCase.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/ThirdParty/Plugins/Smush/maybeDeactivateRocketLazyload.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 1 @@ -1475,6 +1700,21 @@ parameters: count: 2 path: tests/Integration/inc/ThirdParty/Themes/Xstore/excludeInlineContent.php + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/admin/rocketAfterSaveOptions.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 2 + path: tests/Integration/inc/admin/rocketFirstInstall.php + + - + message: "#^Usage of update_option\\(\\) is discouraged\\. Use the Option object instead\\.$#" + count: 1 + path: tests/Integration/inc/functions/rocketIsPluginActive.php + - message: "#^Usage of apply_filters\\(\\) is discouraged\\. Use wpm_apply_filters_typed\\(\\) instead\\.$#" count: 5