72% shutterstock

Code Review | Shutterstock

WordPress plugin Shutterstock scored72%from 54 tests.

About plugin

  • Plugin page: shutterstock
  • Plugin version: 1.3.12
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Nov 13, 2020
  • Latest release: Jul 25, 2022
  • Number of updates: 27
  • Update frequency: every 23.0 days
  • Top authors: shutterstockplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /9,265 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
Install script ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼3.16ms] Passed 4 tests

A check of server-side resources used by Shutterstock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2641.19 ▲2.23
Dashboard /wp-admin3.63 ▲0.3246.88 ▲1.15
Posts /wp-admin/edit.php3.68 ▲0.3248.01 ▲4.08
Add New Post /wp-admin/post-new.php6.18 ▲0.2982.11 ▼19.54
Media Library /wp-admin/upload.php3.49 ▲0.2636.85 ▲3.51
Shutterstock /wp-admin/upload.php?page=shutterstock_media_page3.4637.14
Shutterstock /wp-admin/options-general.php?page=shutterstock_options_page3.4728.70

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 131 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Shutterstock
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15514.56 ▲0.1625.82 ▲24.2773.00 ▲31.11
Dashboard /wp-admin2,207 ▲305.51 ▼0.1781.16 ▼6.0039.66 ▼4.48
Posts /wp-admin/edit.php2,109 ▲302.14 ▲0.1235.32 ▲0.4132.38 ▼2.90
Add New Post /wp-admin/post-new.php6,219 ▲4,69319.84 ▼3.28959.10 ▲314.3447.86 ▼19.42
Media Library /wp-admin/upload.php1,415 ▲184.17 ▼0.0895.28 ▼18.9661.70 ▲15.03
Shutterstock /wp-admin/upload.php?page=shutterstock_media_page9488.40176.4141.57
Shutterstock /wp-admin/options-general.php?page=shutterstock_options_page1,0322.0022.2225.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/shutterstock/admin/partials/shutterstock-media-shutterstock.php
    • > /wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-display.php
    • > /wp-content/plugins/shutterstock/public/partials/shutterstock-public-display.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-user-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-settings-page.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-text.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-textarea.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-shutterstock-login-button.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-network-settings-page.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-shutterstock-login-button.php:40
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/shutterstock/admin/partials/shutterstock-admin-field-shutterstock-login-button.php on line 14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/upload.php?page=shutterstock_media_page
    • > Network (severe)
    https://api.shutterstock.com/v2/images/search?api_key=&sort=popular&image_type[]=photo&page=1&per_page=26&language=en - Failed to load resource: the server responded with a status of 401 (Invalid auth credentials)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: media library, editorial images, stock photography, licensing, shutterstock...

shutterstock/shutterstock.php Passed 13 tests

The main file in "Shutterstock" v. 1.3.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
65 characters long description:
Access exceptional, royalty-free content straight from WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin6,059 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
JSON42002,646
PO File218401,1552,085
PHP233726691,232
CSS49861
SVG10027
JavaScript44548

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity11.11
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods68
▷ Static methods22.94%
▷ Public methods5479.41%
▷ Protected methods00.00%
▷ Private methods1420.59%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.53MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/browse_button.png20.51KB8.23KB▼ 59.89%
assets/icon-128x128.png4.64KB1.34KB▼ 71.09%
assets/icon-256x256.png6.83KB2.45KB▼ 64.22%
assets/inserted_image.png70.68KB25.45KB▼ 64.00%
assets/plugin-settings.png38.04KB15.52KB▼ 59.21%