77% dynamic-placeholder-images

Code Review | Dynamic Placeholder Images

WordPress plugin Dynamic Placeholder Images scored 77% from 54 tests.

About plugin

  • Plugin page: dynamic-placehold...
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Mar 8, 2015
  • Latest release: Dec 13, 2016
  • Number of updates: 16
  • Update frequency: every 60.1 days
  • Top authors: GunGeekATX (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,127 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.08ms] Passed 4 tests

Server-side resources used by Dynamic Placeholder Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1536.50 ▼6.62
Dashboard /wp-admin3.46 ▲0.1645.02 ▼5.02
Posts /wp-admin/edit.php3.49 ▲0.1447.40 ▼2.42
Add New Post /wp-admin/post-new.php5.96 ▲0.0892.81 ▲2.31
Media Library /wp-admin/upload.php3.30 ▲0.0835.33 ▲1.73
Dynamic Placeholder Images /wp-admin/options-general.php?page=gga-dynamic-images-settings3.2931.59

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

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

Browser metrics Passed 4 tests

Dynamic Placeholder Images: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲13913.34 ▼0.971.61 ▼0.2538.95 ▼4.76
Dashboard /wp-admin2,266 ▲744.87 ▼0.07107.64 ▼12.5542.05 ▼3.00
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0538.68 ▼1.6234.83 ▼3.15
Add New Post /wp-admin/post-new.php1,539 ▲2523.28 ▲5.74589.19 ▼61.8054.35 ▼1.94
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0694.99 ▼1.8641.68 ▼1.64
Dynamic Placeholder Images /wp-admin/options-general.php?page=gga-dynamic-images-settings7972.0323.2126.50

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_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-attachment-meta.php
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-settings.php
    • > /wp-content/plugins/dynamic-placeholder-images/admin/partials/admin-api-header.php
    • > /wp-content/plugins/dynamic-placeholder-images/admin/partials/admin-general-header.php
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-dashboard-widgets.php
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-cache.php
    • > /wp-content/plugins/dynamic-placeholder-images/gga-dynamic-placeholder-images.php
    • > /wp-content/plugins/dynamic-placeholder-images/admin/partials/admin-cache-header.php
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-stats.php
    • > /wp-content/plugins/dynamic-placeholder-images/includes/class-gga-dynamic-placeholder-images-attribution.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/dynamic-placeholder-images/public/partials/image-attribution-item.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/dynamic-placeholder-images/uninstall.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: images, media

dynamic-placeholder-images/gga-dynamic-placeholder-images.php 69% from 13 tests

"Dynamic Placeholder Images" version 2.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 155 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dynamic-placeholder-images.php" instead of "gga-dynamic-placeholder-images.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/lang")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,303 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP15530611,272
CSS110031

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.12
▷ Minimum class complexity3.00
▷ Maximum class complexity48.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods96
▷ Static methods11.04%
▷ Public methods5759.38%
▷ Protected methods00.00%
▷ Private methods3940.62%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/cc-non-commercial.png1.37KB0.31KB▼ 77.30%
public/images/cc-attribution.png1.25KB0.24KB▼ 81.06%
public/images/cc-share-alike.png1.29KB0.28KB▼ 78.67%
admin/partials/image-meta-01.png18.16KB6.90KB▼ 62.01%