78% nokaut-offers-box

Code Review | Nokaut Offers Box

WordPress plugin Nokaut Offers Box scored78%from 54 tests.

About plugin

  • Plugin page: nokaut-offers-box
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: May 5, 2016
  • Latest release: May 16, 2022
  • Number of updates: 62
  • Update frequency: every 35.5 days
  • Top authors: nokautpl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,891 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼7.39ms] Passed 4 tests

This is a short check of server-side resources used by Nokaut Offers Box
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3245.67 ▲0.03
Dashboard /wp-admin3.67 ▲0.3353.49 ▼14.30
Posts /wp-admin/edit.php3.72 ▲0.3750.48 ▼1.61
Add New Post /wp-admin/post-new.php6.21 ▲0.3389.75 ▼13.69
Media Library /wp-admin/upload.php3.53 ▲0.3139.10 ▲4.29
Nokaut Offers Box /wp-admin/options-general.php?page=nokaut-offers-box-config3.6540.22

Server storage [IO: ▲4.59MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 781 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Nokaut Offers Box: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12713.51 ▼0.479.35 ▲7.0543.52 ▲1.13
Dashboard /wp-admin2,211 ▲365.63 ▼0.0186.95 ▼13.6439.26 ▼2.82
Posts /wp-admin/edit.php2,113 ▲132.02 ▲0.0336.42 ▼4.8836.47 ▼3.47
Add New Post /wp-admin/post-new.php1,538 ▼723.47 ▲0.35672.33 ▲63.0956.73 ▲4.39
Media Library /wp-admin/upload.php1,413 ▲104.25 ▼0.03106.82 ▲3.8147.39 ▲5.57
Nokaut Offers Box /wp-admin/options-general.php?page=nokaut-offers-box-config1,3221.9034.1443.97

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/nokaut-offers-box/nokaut-offers-box.php
  • 486× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/nokaut-offers-box/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/nokaut-offers-box/vendor/twig/twig/src/Node/Expression/ArrayExpression.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Nokaut\\ApiKit\\Ext\\Data\\Decorator\\Products\\Callback\\CallbackInterface' not found in wp-content/plugins/nokaut-offers-box/vendor/nokaut/api-kit/src/Ext/Data/Decorator/Products/Callback/SetProductsCategory.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/nokaut-offers-box/vendor/twig/twig/src/Node/SetNode.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Nokaut\\ApiKit\\Ext\\Data\\Converter\\ConverterInterface' not found in wp-content/plugins/nokaut-offers-box/vendor/nokaut/api-kit/src/Ext/Data/Converter/Filters/ShopsConverter.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Nokaut\\ApiKit\\Ext\\Data\\Converter\\Filters\\Callback\\Producers\\CallbackInterface' not found in wp-content/plugins/nokaut-offers-box/vendor/nokaut/api-kit/src/Ext/Data/Converter/Filters/Callback/Producers/SortByTotal.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Error\\Error' not found in wp-content/plugins/nokaut-offers-box/vendor/twig/twig/src/Error/SyntaxError.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nokaut-offers-box/vendor/nokaut/api-kit/tests/Repository/ProducersRepositoryTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/nokaut-offers-box/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Nokaut\\ApiKit\\Collection\\CollectionAbstract' not found in wp-content/plugins/nokaut-offers-box/vendor/nokaut/api-kit/src/Ext/Data/Collection/Filters/FiltersAbstract.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Konfiguracja pluginu. (Plugin configuration.)), #2 (Oferty w szablonie `box`, duży rozmiar obrazków. (Offers in `box` template with big images.)), #3 (Oferty w szablonie `box`, standardowy rozmiar obrazków. (Offers in `box` template with standard images.)), #4 (Oferty w szablonie `boxes`, w dwóch wierszach. (Offers in `boxes` template in two rows.)), #5 (Oferty w szablonie `fullbox`. (Offers in `full` template.)), #6 (Oferty w szablonie `list`, duży rozmiar obrazków. (Offers in `list` template with big images.)), #7 (Oferty w szablonie `list`, standardowy rozmiar obrazków. (Offers in `list` template with standard images.)), #8 (Oferty w szablonie `carrusel`. (Offers in `carrusel` template.))
You can take inspiration from this readme.txt

nokaut-offers-box/nokaut-offers-box.php Passed 13 tests

The main PHP script in "Nokaut Offers Box" version 1.4.0 is automatically included on every request by WordPress
59 characters long description:
Nokaut.pl provides offers boxes for your wordpress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected66,699 lines of code in 743 files:
LanguageFilesBlank linesComment linesLines of code
PHP6548,84916,33740,347
JSON371019,362
Markdown221,33803,922
CSS223991,321
JavaScript45731660
Twig9530504
LESS120196
YAML44933176
Ant1180109
XML53261
Dockerfile23022
reStructuredText18510
make1409

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.35
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces103
Interfaces55
Traits5
Classes570
▷ Abstract classes244.21%
▷ Concrete classes54695.79%
▷ Final classes9116.67%
Methods3,109
▷ Static methods2859.17%
▷ Public methods2,62984.56%
▷ Protected methods1705.47%
▷ Private methods3109.97%
Functions347
▷ Named functions18653.60%
▷ Anonymous functions16146.40%
Constants183
▷ Global constants147.65%
▷ Class constants16992.35%
▷ Public constants15792.90%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 1.04MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png92.73KB27.24KB▼ 70.62%
screenshot-6.png50.77KB24.45KB▼ 51.83%
screenshot-8.png59.42KB21.21KB▼ 64.31%
screenshot-1.png163.13KB46.34KB▼ 71.59%
screenshot-5.png143.70KB43.10KB▼ 70.01%