78% spocket

Code Review | Spocket ‑ US & EU Dropshipping

WordPress plugin Spocket ‑ US & EU Dropshipping scored78%from 54 tests.

About plugin

  • Plugin page: spocket
  • Plugin version: 1.7.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Oct 4, 2018
  • Latest release: Aug 29, 2023
  • Number of updates: 141
  • Update frequency: every 12.7 days
  • Top authors: tomspocket (100%)

Code review

54 tests

User reviews

44 reviews

Install metrics

1,000+ active /58,232 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.01MB] [CPU: ▼8.60ms] Passed 4 tests

This is a short check of server-side resources used by Spocket ‑ US & EU Dropshipping
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.42 ▼5.59
Dashboard /wp-admin3.31 ▼0.0443.34 ▼17.77
Posts /wp-admin/edit.php3.36 ▲0.0045.60 ▲0.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.93 ▼9.44
Media Library /wp-admin/upload.php3.23 ▲0.0032.01 ▼1.58

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 223 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Spocket ‑ US & EU Dropshipping: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼1.074.63 ▲2.9241.40 ▼1.38
Dashboard /wp-admin2,203 ▲155.90 ▲1.02101.54 ▼21.0738.37 ▼5.31
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0438.89 ▲1.2435.53 ▲3.03
Add New Post /wp-admin/post-new.php1,514 ▼2817.66 ▼0.61614.44 ▲6.0048.18 ▼7.35
Media Library /wp-admin/upload.php1,385 ▼64.19 ▼0.0397.36 ▼4.4042.81 ▼2.04

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 detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/spocket/vendor/nategood/httpful/examples/github.php
    • > /wp-content/plugins/spocket/vendor/nategood/httpful/examples/showclix.php
    • > /wp-content/plugins/spocket/vendor/nategood/httpful/tests/bootstrap-server.php
  • 132× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/spocket/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Httpful\\Handlers\\MimeHandlerAdapter' not found in wp-content/plugins/spocket/vendor/nategood/httpful/src/Httpful/Handlers/JsonHandler.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/spocket/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/spocket/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/spocket/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/spocket/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/spocket/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/spocket/vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/spocket/vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/spocket/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in spocket/assets to your readme.txt
The official readme.txt might help

spocket/index.php 92% from 13 tests

The primary PHP file in "Spocket ‑ US & EU Dropshipping" version 1.7.9 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("spocket.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin23,593 lines of code in 204 files:
LanguageFilesBlank linesComment linesLines of code
JSON91015,258
PHP1631,2282,8726,534
Vuejs Component6715785
Markdown51440459
JavaScript7158227
YAML5170138
Bourne Shell2291988
XML38369
SVG10114
TOML14011
CSS28110

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.38
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces16
Interfaces1
Traits0
Classes150
▷ Abstract classes21.33%
▷ Concrete classes14898.67%
▷ Final classes10.68%
Methods458
▷ Static methods5712.45%
▷ Public methods38283.41%
▷ Protected methods5010.92%
▷ Private methods265.68%
Functions21
▷ Named functions29.52%
▷ Anonymous functions1990.48%
Constants48
▷ Global constants510.42%
▷ Class constants4389.58%
▷ Public constants43100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/img/white-logo.png3.81KB2.01KB▼ 47.17%
dist/images/white-logo.png3.81KB2.01KB▼ 47.17%