78% dreamstime-stock-photos

Code Review | Dreamstime Stock Photos

WordPress plugin Dreamstime Stock Photos scored78%from 54 tests.

About plugin

  • Plugin page: dreamstime-stock-...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 26, 2014
  • Latest release: Aug 28, 2023
  • Number of updates: 47
  • Update frequency: every 74.1 days
  • Top authors: dreamstime (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

400+ active /31,078 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
Install script ran successfully

Server metrics [RAM: ▼0.82MB] [CPU: ▼28.22ms] Passed 4 tests

A check of server-side resources used by Dreamstime Stock Photos
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1144.93 ▲2.63
Dashboard /wp-admin3.42 ▲0.0750.70 ▼15.10
Posts /wp-admin/edit.php3.53 ▲0.1746.84 ▼7.67
Add New Post /wp-admin/post-new.php2.32 ▼3.576.20 ▼90.55
Media Library /wp-admin/upload.php3.34 ▲0.1139.53 ▲0.46

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Dreamstime Stock Photos
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.351.73 ▼0.0744.56 ▲2.35
Dashboard /wp-admin2,206 ▲155.80 ▼0.1198.14 ▼15.7440.14 ▼4.03
Posts /wp-admin/edit.php2,089 ▲32.02 ▲0.0234.09 ▼2.6835.31 ▲2.41
Add New Post /wp-admin/post-new.php1,683 ▲16923.29 ▲5.81677.42 ▼12.2645.07 ▼6.76
Media Library /wp-admin/upload.php1,382 ▼34.23 ▲0.0595.45 ▼19.2040.15 ▼10.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dreamstime-stock-photos/images.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'Image' of non-object in wp-content/plugins/dreamstime-stock-photos/image.php on line 23
    • > PHP Notice
      Trying to get property 'Licenses' of non-object in wp-content/plugins/dreamstime-stock-photos/image.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dreamstime-stock-photos/search.php:5
    • > PHP Notice
      Undefined index: dt_tab_index in wp-content/plugins/dreamstime-stock-photos/interface.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dreamstime-stock-photos/image.php:25
    • > PHP Notice
      Undefined variable: images in wp-content/plugins/dreamstime-stock-photos/images.php on line 13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dreamstime-stock-photos/lightboxes.php:9
    • > PHP Notice
      Trying to get property 'ImageId' of non-object in wp-content/plugins/dreamstime-stock-photos/image.php on line 23
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dreamstime-stock-photos/account.php:1
    • > PHP Notice
      Undefined variable: image in wp-content/plugins/dreamstime-stock-photos/image.php on line 3

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
You can look at the official readme.txt

dreamstime-stock-photos/dreamstime.php 92% from 13 tests

The principal PHP file in "Dreamstime Stock Photos" v. 4.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dreamstime-stock-photos.php" instead of "dreamstime.php")

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
There were no executable files found in this plugin1,873 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9263431,340
JavaScript26020393
CSS12810140

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity54.00
▷ Minimum class complexity22.00
▷ Maximum class complexity86.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods67
▷ Static methods11.49%
▷ Public methods5277.61%
▷ Protected methods1522.39%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin