77% nitropack

Code Review | NitroPack – Cache & Speed Optimization for Core Web Vitals, Defer CSS & JavaScript, Lazy load Images

WordPress plugin NitroPack – Cache & Speed Optimization for Core Web Vitals, Defer CSS & JavaScript, Lazy load Images scored77%from 54 tests.

About plugin

  • Plugin page: nitropack
  • Plugin version: 1.10.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: Dec 1, 2023
  • Number of updates: 84
  • Update frequency: every 18.6 days
  • Top authors: nitropack (100%)

Code review

54 tests

User reviews

288 reviews

Install metrics

100,000+ active /2,426,704 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.20MB] [CPU: ▼3.71ms] Passed 4 tests

A check of server-side resources used by NitroPack – Cache & Speed Optimization for Core Web Vitals, Defer CSS & JavaScript, Lazy load Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2241.41 ▼8.83
Dashboard /wp-admin3.51 ▲0.2155.25 ▲3.59
Posts /wp-admin/edit.php4.04 ▲0.6855.44 ▲1.98
Add New Post /wp-admin/post-new.php6.14 ▲0.2589.52 ▼8.05
Media Library /wp-admin/upload.php3.37 ▲0.1433.19 ▲0.06
NitroPack /wp-admin/options-general.php?page=nitropack3.3737.62

Server storage [IO: ▲2.08MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • You have illegally modified 3 files (8.35KB) outside of "wp-content/plugins/nitropack/" and "wp-content/uploads/"
    • (new file) wp-content/cache/747e685-nitropack/.htaccess
    • (modified) wp-config.php
    • (new file) wp-content/advanced-cache.php
Filesystem: 218 new files
Database: no new tables, 8 new options
New WordPress options
nitropack-safeModeStatus
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
nitropack-distribution
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for NitroPack – Cache & Speed Optimization for Core Web Vitals, Defer CSS & JavaScript, Lazy load Images
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲19513.88 ▼0.868.37 ▲6.4237.59 ▼13.83
Dashboard /wp-admin2,229 ▲495.55 ▼0.0998.17 ▼2.3744.73 ▲2.99
Posts /wp-admin/edit.php2,138 ▲352.02 ▼0.0641.30 ▼0.4837.64 ▲4.57
Add New Post /wp-admin/post-new.php6,255 ▲4,72926.18 ▲5.18815.44 ▲185.3166.04 ▲10.62
Media Library /wp-admin/upload.php1,435 ▲324.21 ▼0.01104.04 ▲4.7545.28 ▲2.19
NitroPack /wp-admin/options-general.php?page=nitropack1,0001.9437.7385.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/nitropack/advanced-cache.php
    • > /wp-content/plugins/nitropack/diagnostics.php
    • > /wp-content/plugins/nitropack/main.php
    • > /wp-content/plugins/nitropack/functions.php
    • > /wp-content/plugins/nitropack/constants.php
    • > /wp-content/plugins/nitropack/wp-cli.php
    • > /wp-content/plugins/nitropack/helpers.php
  • 94× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\SDK\\Api\\Base' not found in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Api/RequestMaker.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\Integration\\Hosting\\Hosting' not found in wp-content/plugins/nitropack/classes/Integration/Hosting/WPmudev.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\SDK\\FileHandle' not found in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/StorageDriver/RedisFileHandle.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\SDK\\Api\\SignedBase' not found in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Api/VariationCookie.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\HttpClient\\Exceptions\\HttpClientException' not found in wp-content/plugins/nitropack/nitropack-sdk/vendor/nitropack/httpclient/src/Exceptions/URLUnsupportedProtocolException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\Integration\\Hosting\\Hosting' not found in wp-content/plugins/nitropack/classes/Integration/Hosting/RocketNet.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\SDK\\Api\\SignedBase' not found in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Api/Url.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nitropack/nitropack-sdk/vendor/nitropack/httpclient/tests/ResponseHandlingTest.php:9
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/nitropack/classes/Integration/Plugin/AdvancedMathCaptcha.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'NitroPack\\SDK\\FileHandle' not found in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/StorageDriver/DiskFileHandle.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

nitropack/main.php 85% from 13 tests

The primary PHP file in "NitroPack – Cache & Speed Optimization for Core Web Vitals, Defer CSS & JavaScript, Lazy load Images" version 1.10.4 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("nitropack.php" instead of "main.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin20,872 lines of code in 198 files:
LanguageFilesBlank linesComment linesLines of code
PHP1773,1601,44216,217
CSS6152333,054
SVG100655
PO File1219253453
JavaScript116716396
JSON20097

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity13.09
▷ Minimum class complexity1.00
▷ Maximum class complexity333.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces15
Interfaces0
Traits1
Classes150
▷ Abstract classes00.00%
▷ Concrete classes150100.00%
▷ Final classes00.00%
Methods885
▷ Static methods16919.10%
▷ Public methods79289.49%
▷ Protected methods141.58%
▷ Private methods798.93%
Functions306
▷ Named functions24780.72%
▷ Anonymous functions5919.28%
Constants149
▷ Global constants5536.91%
▷ Class constants9463.09%
▷ Public constants94100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
view/images/slider-thumb-medium.png0.65KB0.38KB▼ 41.33%
view/images/slider-thumb-strong.png0.72KB0.42KB▼ 42.01%
view/images/slider-thumb-manual.png0.59KB0.34KB▼ 42.55%
view/images/slider-thumb-turbo.png0.62KB0.35KB▼ 43.82%
view/images/slider-thumb-standard.png0.68KB0.37KB▼ 45.91%