10% cy-express-for-woocommerce

Code Review | CY.express for WooCommerce: ship to Russia with ease

WordPress plugin CY.express for WooCommerce: ship to Russia with ease scored 10% from 54 tests.

About plugin

  • Plugin page: cy-express-for-wo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8
  • WordPress version: 6.3.1
  • First release: Sep 21, 2021
  • Latest release: Sep 28, 2021
  • Number of updates: 4
  • Update frequency: every 8.5 days
  • Top authors: daniilcy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 277 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/includes/class-cyfw-api-client.php+19
    Undefined offset: 0

Server metrics [RAM: ▼1.96MB] [CPU: ▼50.89ms] Passed 4 tests

This is a short check of server-side resources used by CY.express for WooCommerce: ship to Russia with ease
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.77 ▼34.83
Dashboard /wp-admin2.05 ▼1.258.01 ▼40.02
Posts /wp-admin/edit.php2.05 ▼1.318.53 ▼36.20
Add New Post /wp-admin/post-new.php2.05 ▼3.846.66 ▼92.52
Media Library /wp-admin/upload.php2.05 ▼1.187.54 ▼23.90
Add new manifests /wp-admin/admin.php?page=cy-express-manifests-create2.056.34
Edit manifest /wp-admin/admin.php?page=cy-express-manifest2.056.56
Manifests /wp-admin/admin.php?page=cy-express-manifests2.057.30

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 34 new files
Database: 3 new tables, 7 new options
New tables
wp_cyexpress_parcels
wp_cyexpress_manifests_to_parcels
wp_cyexpress_manifests
New WordPress options
widget_recent-comments
cy_callback_key
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by CY.express for WooCommerce: ship to Russia with ease
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.19 ▼1.191.61 ▼0.1237.34 ▼7.48
Dashboard /wp-admin2,211 ▲464.83 ▼1.02107.54 ▼7.1041.60 ▼10.12
Posts /wp-admin/edit.php2,091 ▲22.03 ▼0.0039.29 ▲0.2833.48 ▼1.07
Add New Post /wp-admin/post-new.php1,539 ▲618.35 ▼4.93628.02 ▼39.8459.60 ▲8.70
Media Library /wp-admin/upload.php1,384 ▼44.17 ▼0.0199.59 ▲3.4045.22 ▼0.30
Add new manifests /wp-admin/admin.php?page=cy-express-manifests-create9582.0222.2523.12
Edit manifest /wp-admin/admin.php?page=cy-express-manifest1,1352.0322.6528.00
Manifests /wp-admin/admin.php?page=cy-express-manifests9422.0325.0124.31

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/includes/class-cyfw-api-client.php+19
    Undefined offset: 0
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_cyexpress_manifests_to_parcels
    • wp_cyexpress_manifests
    • wp_cyexpress_parcels
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • cy_callback_key
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cy-express-manifests
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/includes/class-cyfw-api-client.php+19
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+5
    Undefined index: mawb
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+251
    Trying to get property 'status' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+219
    Trying to get property 'master_way_bill' of non-object
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+282
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+229
    Trying to get property 'voyage_number' of non-object
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+233
    Trying to get property 'gross_weight' of non-object
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+237
    Trying to get property 'net_weight' of non-object
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+243
    Trying to get property 'etd_date' of non-object
    • > GET request to /wp-admin/admin.php?page=cy-express-manifest
    • > Notice in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php+247
    Trying to get property 'eta_date' of non-object

SRP 50% 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_redirect() in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifest.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifests.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-table-manifest-to-parcel.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-table-manifests.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/cy-express-for-woocommerce/admin/partials/class-cyfw-admin-page-manifests-create.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: russia shipping, shipping, cyexpress, cdek, russia...

cy-express-for-woocommerce/cy-for-woocommerce.php 85% from 13 tests

The main PHP file in "CY.express for WooCommerce: ship to Russia with ease" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cy-express-for-woocommerce.php" instead of "cy-for-woocommerce.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 detected2,853 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP24475962,015
PO File2360414811
CSS15027

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods112
▷ Static methods43.57%
▷ Public methods9181.25%
▷ Protected methods00.00%
▷ Private methods2118.75%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin