78% nokautwl

Code Review | NokautWL

WordPress plugin NokautWL scored78%from 54 tests.

About plugin

  • Plugin page: nokautwl
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.5
  • WordPress version: 6.3.1
  • First release: Nov 20, 2014
  • Latest release: Apr 23, 2018
  • Number of updates: 28
  • Update frequency: every 44.7 days
  • Top authors: nokautpl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,543 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲1.19ms] Passed 4 tests

This is a short check of server-side resources used by NokautWL
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.86 ▼4.25
Dashboard /wp-admin3.38 ▲0.0857.64 ▲4.18
Posts /wp-admin/edit.php3.44 ▲0.0960.66 ▲10.13
Add New Post /wp-admin/post-new.php5.98 ▲0.1094.32 ▼4.89
Media Library /wp-admin/upload.php3.31 ▲0.0847.78 ▲9.73
NokautWL /wp-admin/options-general.php?page=nokautwl-config3.3341.02

Server storage [IO: ▲9.81MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,523 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for NokautWL
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲15913.63 ▼0.7512.03 ▲10.2442.51 ▼3.96
Dashboard /wp-admin2,208 ▲345.81 ▲0.2495.36 ▲3.2743.85 ▲0.91
Posts /wp-admin/edit.php2,110 ▲102.23 ▲0.2434.43 ▼2.1434.45 ▼3.25
Add New Post /wp-admin/post-new.php1,547 ▲1223.35 ▲4.93676.33 ▲39.8558.56 ▼6.76
Media Library /wp-admin/upload.php1,413 ▲194.35 ▲0.1499.35 ▼4.0141.92 ▲0.03
NokautWL /wp-admin/options-general.php?page=nokautwl-config1,2461.8730.3340.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/nokautwl/nokaut-wl.php
  • 794× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/nokautwl/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\Service\\Command\\LocationVisitor\\Request\\AbstractVisitorTestCase' not found in wp-content/plugins/nokautwl/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/JsonVisitorTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Nokaut\\ApiKit\\Ext\\Data\\Converter\\Filters\\Callback\\Categories\\CallbackInterface' not found in wp-content/plugins/nokautwl/vendor/nokaut/api-kit/src/Ext/Data/Converter/Filters/Callback/Categories/SortByTotal.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Http\\Client' not found in wp-content/plugins/nokautwl/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/nokautwl/vendor/twig/twig/lib/Twig/Node/Spaceless.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/nokautwl/vendor/guzzle/guzzle/tests/Guzzle/Tests/Http/Curl/CurlHandleTest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Nokaut\\ApiKit\\ClientApi\\Rest\\Query\\QueryBuilderInterface' not found in wp-content/plugins/nokautwl/vendor/nokaut/api-kit/src/ClientApi/Rest/Query/QueryBuilderAbstract.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nokautwl/vendor/nokaut/api-kit/tests/Converters/Metadata/OffersMetadataConverterTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/nokautwl/vendor/twig/twig/lib/Twig/Error/Syntax.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/nokautwl/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ServiceDescriptionFactoryTest.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Konfiguracja pluginu. (Plugin configuration.)), #2 (ShortTag - link tekstowy do produktu. (ShortTag - Text link to product.)), #3 (ShortTag - boks z jednym produktem. (ShortTag - single product box.)), #4 (ShortTag - boks z wieloma produktami w jednym wierszu. (ShortTag - multiple products box in one row.)), #5 (ShortTag - boks z wieloma produktami w dwóch wierszach. (ShortTag - multiple products box in two rows.)), #6 (Pasaż handlowy. (Shopping mall.))
The official readme.txt might help

nokautwl/nokaut-wl.php 92% from 13 tests

"NokautWL" version 1.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("nokautwl.php" instead of "nokaut-wl.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin132,040 lines of code in 1,250 files:
LanguageFilesBlank linesComment linesLines of code
PHP94719,00057,34388,520
JSON6013017,058
CSS111936512,776
reStructuredText1183,4383,7764,896
JavaScript521,1178264,610
Markdown1138801,633
C1166150793
Twig174214688
XML103313295
SVG100229
Ant2281143
make1245124
HTML12160108
Bourne Shell124055
Python1222350
YAML310046
C/C++ Header171311
m41215

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.85
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces154
Interfaces89
Traits2
Classes876
▷ Abstract classes404.57%
▷ Concrete classes83695.43%
▷ Final classes10.12%
Methods5,283
▷ Static methods2304.35%
▷ Public methods4,77790.42%
▷ Protected methods3767.12%
▷ Private methods1302.46%
Functions220
▷ Named functions5424.55%
▷ Anonymous functions16675.45%
Constants171
▷ Global constants95.26%
▷ Class constants16294.74%
▷ Public constants162100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.70MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png6.59KB3.04KB▼ 53.90%
vendor/guzzle/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
screenshot-5.png117.97KB35.22KB▼ 70.14%
screenshot-4.png107.04KB38.82KB▼ 63.74%
vendor/guzzle/guzzle/docs/_static/logo.png242.92KB69.68KB▼ 71.32%