78% stockpack

Code Review | StockPack – Stock photos from Unsplash, Adobe Stock and more

WordPress plugin StockPack – Stock photos from Unsplash, Adobe Stock and more scored78%from 54 tests.

About plugin

  • Plugin page: stockpack
  • Plugin version: 3.3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2019
  • Latest release: Sep 13, 2023
  • Number of updates: 131
  • Update frequency: every 10.5 days
  • Top authors: stockpack (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

6,000+ active /82,784 total downloads

Benchmarks

Plugin footprint 83% 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.48MB] [CPU: ▲3.17ms] Passed 4 tests

This is a short check of server-side resources used by StockPack – Stock photos from Unsplash, Adobe Stock and more
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.72 ▼6.99
Dashboard /wp-admin3.94 ▲0.6460.69 ▲10.20
Posts /wp-admin/edit.php3.98 ▲0.6252.63 ▼1.49
Add New Post /wp-admin/post-new.php6.51 ▲0.62101.82 ▲13.90
Media Library /wp-admin/upload.php3.83 ▲0.6044.13 ▲10.97
StockPack /wp-admin/options-general.php?page=stockpack3.8341.65

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 65 new files
Database: no new tables, 9 new options
New WordPress options
stockpack_basics
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
stockpack_debug
db_upgraded
stockpack_advanced

Browser metrics Passed 4 tests

This is an overview of browser requirements for StockPack – Stock photos from Unsplash, Adobe Stock and more
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,984 ▲22315.30 ▲0.951.92 ▲0.2043.57 ▼4.15
Dashboard /wp-admin2,387 ▲2106.86 ▲1.26115.89 ▲16.5837.09 ▼5.44
Posts /wp-admin/edit.php2,321 ▲2183.66 ▲1.6951.15 ▲11.6332.57 ▼3.92
Add New Post /wp-admin/post-new.php1,587 ▲6118.51 ▼4.74588.95 ▼100.9847.44 ▼13.87
Media Library /wp-admin/upload.php1,470 ▲704.84 ▲0.5483.00 ▼23.9443.04 ▼5.12
StockPack /wp-admin/options-general.php?page=stockpack1,3743.7654.0726.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • stockpack_advanced
    • stockpack_basics
    • widget_recent-posts
    • theysaidso_admin_options
    • stockpack_debug

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/stockpack/templates/dialog.php
    • > /wp-content/plugins/stockpack/templates/empty.php
    • > /wp-content/plugins/stockpack/templates/attribution.php
    • > /wp-content/plugins/stockpack/templates/details.php
    • > /wp-content/plugins/stockpack/templates/attachment.php
    • > /wp-content/plugins/stockpack/templates/downloader.php
    • > /wp-content/plugins/stockpack/templates/no-search.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stockpack/vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stockpack/extra/captions.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stockpack/extra/captions.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/stockpack/extra/captions.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stockpack/vendor/tareq1988/wordpress-settings-api-class/example/procedural-example.php:270

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 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: A description for screenshot #4 is required in stockpack/assets to your readme.txt
You can look at the official readme.txt

stockpack/stockpack.php Passed 13 tests

The principal PHP file in "StockPack – Stock photos from Unsplash, Adobe Stock and more" v. 3.3.7 is loaded by WordPress automatically on each request
116 characters long description:
Direct image search in WordPress for Unsplash, Adobe Stock, Getty Images, iStock, Pixabay, Pexels and Deposit Photos

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected16,558 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JSON60013,027
PHP296218573,345
Markdown3590155
JavaScript47326
CSS5005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity21.46
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods174
▷ Static methods169.20%
▷ Public methods14382.18%
▷ Protected methods63.45%
▷ Private methods2514.37%
Functions16
▷ Named functions1381.25%
▷ Anonymous functions318.75%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.49MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/balloons.png16.98KB7.03KB▼ 58.60%
vendor/tareq1988/wordpress-settings-api-class/screenshot-1.png389.59KB115.93KB▼ 70.24%
images/unicorn.png13.73KB7.00KB▼ 49.03%
images/icecream.png17.16KB7.11KB▼ 58.60%
images/moon.png10.88KB5.11KB▼ 53.00%