56% dataplans-esims-for-woocommerce

Code Review | DataPlans eSIMs for WooCommerce

WordPress plugin DataPlans eSIMs for WooCommerce scored56%from 54 tests.

About plugin

  • Plugin page: dataplans-esims-f...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 16, 2022
  • Latest release: Aug 16, 2022
  • Number of updates: 2
  • Update frequency: every 2.5 days
  • Top authors: dataplans (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /202 total downloads

Benchmarks

Plugin footprint 65% 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.64MB] [CPU: ▼30.39ms] Passed 4 tests

A check of server-side resources used by DataPlans eSIMs for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2240.10 ▲0.82
Dashboard /wp-admin3.30 ▼0.0024.91 ▼25.78
Posts /wp-admin/edit.php3.30 ▼0.0529.06 ▼24.26
Add New Post /wp-admin/post-new.php3.30 ▼2.5826.74 ▼65.79
Media Library /wp-admin/upload.php3.30 ▲0.0727.97 ▼5.74
Settings /wp-admin/admin.php?page=dataplans3.3026.66
Order History /wp-admin/admin.php?page=dpio-history3.3029.74

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 86 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
dpio_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for DataPlans eSIMs for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.62 ▼0.915.28 ▲3.5442.56 ▲1.11
Dashboard /wp-admin2,214 ▲434.99 ▼0.6787.84 ▼2.2972.59 ▲27.46
Posts /wp-admin/edit.php2,132 ▲292.35 ▲0.3834.49 ▼4.9533.49 ▼0.61
Add New Post /wp-admin/post-new.php1,554 ▲2623.24 ▼0.00629.76 ▼49.28130.31 ▲75.68
Media Library /wp-admin/upload.php1,428 ▲284.54 ▲0.34106.42 ▼5.0284.84 ▲42.79
Settings /wp-admin/admin.php?page=dataplans8771.9026.9333.19
Order History /wp-admin/admin.php?page=dpio-history1,0042.6746.7528.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/dataplans-esims-for-woocommerce/admin/class-dataplans-admin.php+432
    Undefined index: class
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • dpio_options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dpio-history
    • > Notice in wp-content/plugins/dataplans-esims-for-woocommerce/admin/class-dataplans-admin.php+432
    Undefined index: class
    • > GET request to /wp-admin/admin.php?page=dataplans
    • > Notice in wp-content/plugins/dataplans-esims-for-woocommerce/admin/class-dataplans-admin.php+574
    Undefined index: balancelimit_alert

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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dataplans-esims-for-woocommerce/public/partials/dataplans-public-display.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DataPlansObject' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/Resource/DataPlansApiResource.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DPWC_DataPlansApiResource' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/DataPlansRegion.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/tests/DataPlans/TestConfig.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'DPWC_DataPlansApiResource' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/DataPlansCountry.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/tests/DataPlans/TestConfig.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'DPWC_DataPlansApiResource' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/DataPlansOperator.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'DPWC_DataPlansApiResource' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/DataPlansPurchase.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'DPWC_DataPlansApiResource' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/lib/DataPlans/DataPlansPlan.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/tests/DataPlans/TestConfig.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/dataplans-esims-for-woocommerce/vendor/dataplans/dataplans-php/tests/DataPlans/TestConfig.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=dpio-history
    • > Network (severe)
    wp-content/plugins/dataplans-esims-for-woocommerce/admin/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=dpio-history
    • > Network (severe)
    wp-content/plugins/dataplans-esims-for-woocommerce/admin/images/sort_desc.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: woo, virtual, sim, digital, travel...

dataplans-esims-for-woocommerce/dataplans.php 85% from 13 tests

"DataPlans eSIMs for WooCommerce" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dataplans-esims-for-woocommerce.php" instead of "dataplans.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,758 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP415391,2671,962
JavaScript31267196
Sass13112176
CSS324156
JSON1300101
YAML214085
Markdown228042
XML23040

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.31
Average class complexity5.25
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes44
▷ Abstract classes12.27%
▷ Concrete classes4397.73%
▷ Final classes12.33%
Methods160
▷ Static methods2716.88%
▷ Public methods13584.38%
▷ Protected methods159.38%
▷ Private methods106.25%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants28
▷ Global constants1035.71%
▷ Class constants1864.29%
▷ Public constants18100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 2.21MB with 0.98MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/menu_icon.png0.58KB0.65KB0.00%
assets/screenshot-2.png515.62KB159.76KB▼ 69.02%
admin/img/menu_icon_colored.png0.57KB0.62KB0.00%
assets/screenshot-1.png991.75KB179.70KB▼ 81.88%
assets/banner-772x250.png208.75KB60.44KB▼ 71.05%