84% etsy-importer

Code Review | Etsy Importer

WordPress plugin Etsy Importer scored84%from 54 tests.

About plugin

  • Plugin page: etsy-importer
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Jan 1, 2014
  • Latest release: Feb 13, 2023
  • Number of updates: 23
  • Update frequency: every 144.9 days
  • Top authors: tw2113 (52.17%)coreymcollins (52.17%)

Code review

54 tests

User reviews

12 reviews

Install metrics

200+ active /12,139 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼1.06ms] Passed 4 tests

Server-side resources used by Etsy Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1842.36 ▲1.39
Dashboard /wp-admin3.55 ▲0.25294.20 ▲244.87
Posts /wp-admin/edit.php3.59 ▲0.2349.33 ▼3.15
Add New Post /wp-admin/post-new.php6.08 ▲0.1985.82 ▼4.69
Media Library /wp-admin/upload.php3.40 ▲0.1734.86 ▲2.22
Categories /wp-admin/edit-tags.php?taxonomy=etsy_category&post_type=etsy_products3.4842.70
Add New /wp-admin/post-new.php?post_type=etsy_products4.0658.80
Products /wp-admin/edit.php?post_type=etsy_products3.4436.04
Etsy Importer Settings /wp-admin/edit.php?post_type=etsy_products&page=etsy_options3.4434.04
Tags /wp-admin/edit-tags.php?taxonomy=etsy_tag&post_type=etsy_products3.3932.14

Server storage [IO: ▲3.95MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 188 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Etsy Importer: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9813.25 ▼1.041.95 ▲0.2439.43 ▼1.62
Dashboard /wp-admin2,241 ▲535.85 ▲0.0197.78 ▼7.3639.45 ▼1.41
Posts /wp-admin/edit.php2,138 ▲522.04 ▲0.0341.72 ▲2.3037.87 ▲2.45
Add New Post /wp-admin/post-new.php1,592 ▲5623.46 ▲0.35609.38 ▼68.3934.21 ▼20.44
Media Library /wp-admin/upload.php1,437 ▲554.23 ▼0.0593.57 ▼2.2343.27 ▲1.78
Categories /wp-admin/edit-tags.php?taxonomy=etsy_category&post_type=etsy_products1,3132.2726.2728.37
Add New /wp-admin/post-new.php?post_type=etsy_products2,5488.12186.2871.14
Products /wp-admin/edit.php?post_type=etsy_products1,1271.9938.6128.35
Etsy Importer Settings /wp-admin/edit.php?post_type=etsy_products&page=etsy_options1,1293.4441.9871.45
Tags /wp-admin/edit-tags.php?taxonomy=etsy_tag&post_type=etsy_products1,3102.1929.0328.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/etsy-importer/CMB2/tests/cmb-tests-base.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/etsy-importer/CMB2/tests/cmb-tests-base.php:3
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/etsy-importer/CMB2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/etsy-importer/CMB2/tests/cmb-tests-base.php:3
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/etsy-importer/CMB2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/etsy-importer/etsy-importer.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/etsy-importer/CMB2/init.php:80
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/etsy-importer/CMB2/tests/cmb-tests-base.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/etsy-importer/includes/fields.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/etsy-importer/CMB2/bootstrap.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (In order to import your products, you first need to register an application with Etsy here: https://www.etsy.com/developers/register), #2 (Once you have created your app, click "Apps You've Made" in the sidebar and select your new app. On the app detail page, copy the value in the Keystring input field. This is your API Key.), #3 (To retrieve your shop's ID, begin by visiting the front page of your shop and viewing the source.), #4 (We want one specific line, whose meta name is "apple-itunes-app". The number you see below following "etsy://shop/" is your store ID.)
The official readme.txt is a good inspiration

etsy-importer/etsy-importer.php Passed 13 tests

The primary PHP file in "Etsy Importer" version 1.4.2 is used by WordPress to initiate all plugin functionality
65 characters long description:
Import your Etsy store's products as posts in a custom post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin77,265 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File948,84811,76420,245
PHP241,4342,2824,673
CSS39664982,040
Sass9158241,069
JavaScript4180159786
Markdown41400378
YAML290148
JSON300118
Bourne Shell117667

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.68
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes00.00%
Methods336
▷ Static methods175.06%
▷ Public methods32697.02%
▷ Protected methods51.49%
▷ Private methods51.49%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
CMB2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
CMB2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
CMB2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%