67% posturinn

Code Review | Pósturinn\'s Shipping with WooCommerce

WordPress plugin Pósturinn\'s Shipping with WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: posturinn
  • Plugin version: 1.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Oct 16, 2023
  • Number of updates: 22
  • Update frequency: every 57.6 days
  • Top authors: posturinn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /5,478 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.54ms] Passed 4 tests

Server-side resources used by Pósturinn\'s Shipping with WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0225.16 ▼11.23
Dashboard /wp-admin3.36 ▲0.0249.73 ▼6.83
Posts /wp-admin/edit.php3.42 ▲0.0644.94 ▼1.06
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.55 ▼12.14
Media Library /wp-admin/upload.php3.29 ▲0.0633.22 ▼3.94

Server storage [IO: ▲4.09MB] [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: 295 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Pósturinn\'s Shipping with WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,454 ▼30714.26 ▼0.300.55 ▼1.1417.56 ▼20.55
Dashboard /wp-admin2,195 ▲145.63 ▼0.0882.00 ▼17.6137.53 ▼4.56
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0433.04 ▼2.5331.51 ▼4.80
Add New Post /wp-admin/post-new.php1,526 ▼223.73 ▲0.64629.23 ▼47.0165.79 ▲12.81
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.1397.79 ▼8.2045.43 ▲0.45

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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
Even though no errors were found, this is by no means 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
Please fix the following
  • 84× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_042.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_036.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_012.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_055.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_png.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_061.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_html.php
    • > /wp-content/plugins/posturinn/inc/api.class.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_046.php
    • > /wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/example_004.php
  • 35× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/FpdfTpl.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function postis_get_settings() in wp-content/plugins/posturinn/inc/checkout-fields.class.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/Type/PdfHexString.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/CrossReference/LineReader.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bcadd() in wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/tcpdf_barcodes_1d.php:2081
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\AbstractReader' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/CrossReference/FixedReader.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/posturinn/lib/fpdi/vendor/setasign/fpdi/src/PdfParser/Type/PdfDictionary.php:21

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 Passed 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
5 plugin tags: shipping rates, icelandic post shipping, woocommerce, posturinn, shipping

posturinn/wc-posturinn-shipping-api.php 85% from 13 tests

The main PHP script in "Pósturinn\'s Shipping with WooCommerce" version 1.1.7 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("posturinn.php" instead of "wc-posturinn-shipping-api.php")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/posturinn/lib/fpdi/vendor/tecnickcom/tcpdf/examples/data/cert/tcpdf.crt
61,958 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP2285,98220,67657,374
SVG3111,882
PO File3418403894
CSS315666608
JavaScript4194219585
JSON800368
Markdown4710247

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,382)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity93.84
▷ Minimum class complexity1.00
▷ Maximum class complexity4,382.00
Average method complexity8.17
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces11
Interfaces2
Traits2
Classes75
▷ Abstract classes22.67%
▷ Concrete classes7397.33%
▷ Final classes00.00%
Methods1,028
▷ Static methods15715.27%
▷ Public methods70968.97%
▷ Protected methods31330.45%
▷ Private methods60.58%
Functions63
▷ Named functions5384.13%
▷ Anonymous functions1015.87%
Constants178
▷ Global constants14179.21%
▷ Class constants3720.79%
▷ Public constants37100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.56MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/fpdi/vendor/tecnickcom/tcpdf/examples/images/_blank.png0.13KB0.09KB▼ 30.66%
lib/fpdi/vendor/tecnickcom/tcpdf/examples/images/img.png190.57KB64.69KB▼ 66.06%
lib/fpdi/vendor/tecnickcom/tcpdf/examples/images/tcpdf_cell.png37.51KB36.62KB▼ 2.39%
lib/fpdi/vendor/tecnickcom/tcpdf/examples/images/logo_example.png18.96KB17.68KB▼ 6.71%
lib/fpdi/vendor/tecnickcom/tcpdf/examples/images/alpha.png23.33KB30.34KB0.00%