78% woo-gls-print-label-and-tracking-code

Code Review | Print Label and Tracking Code for GLS

WordPress plugin Print Label and Tracking Code for GLS scored78%from 54 tests.

About plugin

  • Plugin page: woo-gls-print-lab...
  • Plugin version: 4.12.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Nov 4, 2019
  • Latest release: Nov 4, 2023
  • Number of updates: 115
  • Update frequency: every 12.8 days
  • Top authors: krunoslavris (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /7,347 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.93ms] Passed 4 tests

Server-side resources used by Print Label and Tracking Code for GLS
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.87 ▼3.54
Dashboard /wp-admin3.31 ▲0.0147.15 ▲2.00
Posts /wp-admin/edit.php3.36 ▲0.0047.98 ▲0.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.54 ▼2.86
Media Library /wp-admin/upload.php3.23 ▲0.0035.70 ▲1.82

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 116 new files
Database: no new tables, 7 new options
New WordPress options
activate_admin
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Print Label and Tracking Code for GLS
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.23 ▲0.101.84 ▲0.1544.30 ▲1.45
Dashboard /wp-admin2,195 ▲215.55 ▼0.0586.76 ▼15.2039.40 ▼2.48
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0240.84 ▲3.2436.90 ▲3.07
Add New Post /wp-admin/post-new.php1,526 ▼022.86 ▼0.43662.74 ▼26.9264.63 ▼6.04
Media Library /wp-admin/upload.php1,400 ▲64.19 ▲0.0599.69 ▲3.7943.35 ▲1.74

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • activate_admin
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-gls-print-label-and-tracking-code/admin/template/gopremium.php
  • 69× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Schedule' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php:10
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/markosirec/gls-italy-sdk/samples/ListParcels.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_YearField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/markosirec/gls-italy-sdk/tests/GlsItaly/Tests/Parcel/BaseAdapterTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/WP_CLI/Migration_Command.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_FinishedAction' not found in wp-content/plugins/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_CanceledAction.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/woo-gls-print-label-and-tracking-code/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: gls, package tracking, print label, delivery plugin, shipping

woo-gls-print-label-and-tracking-code/wp-gls-print-label.php 85% from 13 tests

This is the main PHP file of "Print Label and Tracking Code for GLS" version 4.12.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • 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 ("woo-gls-print-label-and-tracking-code.php" instead of "wp-gls-print-label.php")

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
No dangerous file extensions were detected23,408 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP1242,5646,89720,545
PO File74704541,130
CSS15218199980
JavaScript26020321
Markdown3900201
JSON300135
HTML1341192
SVG1004

PHP code Passed 2 tests

This is a very shot 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.34
Average class complexity13.64
▷ Minimum class complexity1.00
▷ Maximum class complexity381.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity99.00
Code structure
Namespaces11
Interfaces3
Traits0
Classes104
▷ Abstract classes1615.38%
▷ Concrete classes8884.62%
▷ Final classes1213.64%
Methods872
▷ Static methods13915.94%
▷ Public methods70380.62%
▷ Protected methods13915.94%
▷ Private methods303.44%
Functions36
▷ Named functions2672.22%
▷ Anonymous functions1027.78%
Constants41
▷ Global constants512.20%
▷ Class constants3687.80%
▷ Public constants36100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
34 PNG files occupy 0.23MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) _help/__MACOSX/assets/blueprint-css/plugins/link-icons/icons/._external.png0.23KB0.00KB▼ 100.00%
_help/assets/blueprint-css/plugins/link-icons/icons/doc.png0.76KB0.92KB0.00%
(invalid) _help/__MACOSX/assets/blueprint-css/plugins/buttons/icons/._tick.png0.23KB0.00KB▼ 100.00%
(invalid) _help/__MACOSX/assets/blueprint-css/plugins/link-icons/icons/._pdf.png0.23KB0.00KB▼ 100.00%
_help/assets/blueprint-css/plugins/link-icons/icons/external.png45.75KB0.11KB▼ 99.77%