77% placeholder-images

Code Review | Placeholder images

WordPress plugin Placeholder images scored 77% from 54 tests.

About plugin

  • Plugin page: placeholder-images
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.7.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2017
  • Latest release: Mar 14, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: lolitaframework (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 509 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
Installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼1.95ms] Passed 4 tests

Analyzing server-side resources used by Placeholder images
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3642.53 ▲0.65
Dashboard /wp-admin3.63 ▲0.3345.43 ▼3.78
Posts /wp-admin/edit.php3.68 ▲0.3247.87 ▼5.46
Add New Post /wp-admin/post-new.php6.15 ▲0.2799.60 ▲0.79
Media Library /wp-admin/upload.php3.49 ▲0.2638.29 ▲5.15

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

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

Browser metrics Passed 4 tests

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,800 ▲6514.79 ▲0.431.73 ▼0.2743.49 ▼5.47
Dashboard /wp-admin2,203 ▲125.80 ▼0.1196.04 ▼8.2638.54 ▼5.84
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0140.12 ▲0.3634.42 ▼2.60
Add New Post /wp-admin/post-new.php1,514 ▼2817.97 ▼0.40659.50 ▲51.2163.88 ▲13.20
Media Library /wp-admin/upload.php1,388 ▲34.29 ▲0.0593.59 ▼10.3943.86 ▲0.73

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

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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/placeholder-images/LolitaFramework/Configuration/views/meta_box_with_controls.php
    • > /wp-content/plugins/placeholder-images/LolitaFramework/Controls/Repeater/views/template.php
    • > /wp-content/plugins/placeholder-images/LolitaFramework/Configuration/views/meta_box_default.php
    • > /wp-content/plugins/placeholder-images/LolitaFramework/Controls/Gallery/views/template.php
  • 86× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/placeholder-images/LolitaFramework/Controls/Repeater/views/template.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'placeholderimages\\LolitaFramework\\Configuration\\Init' not found in wp-content/plugins/placeholder-images/LolitaFramework/Configuration/Modules/Supports.php:8
    • > PHP Notice
      Undefined variable: me in wp-content/plugins/placeholder-images/LolitaFramework/Controls/Textarea/views/textarea.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'placeholderimages\\LolitaFramework\\Controls\\Control' not found in wp-content/plugins/placeholder-images/LolitaFramework/Controls/Radios/Radios.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'placeholderimages\\LolitaFramework\\Configuration\\IModule' not found in wp-content/plugins/placeholder-images/LolitaFramework/Configuration/Modules/ShortCodes.php:7
    • > PHP Notice
      Undefined variable: me in wp-content/plugins/placeholder-images/LolitaFramework/Controls/Icons/views/pack.php on line 1
    • > PHP Notice
      Undefined variable: controls in wp-content/plugins/placeholder-images/LolitaFramework/Configuration/views/meta_box_with_controls_side.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'placeholderimages\\LolitaFramework\\Configuration\\IModule' not found in wp-content/plugins/placeholder-images/LolitaFramework/Configuration/Modules/MetaBoxes.php:10
    • > PHP Notice
      Undefined variable: controls in wp-content/plugins/placeholder-images/LolitaFramework/Configuration/views/meta_box_with_controls.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function placeholderimages\\get_bloginfo() in wp-content/plugins/placeholder-images/LolitaFramework/LolitaFramework.php:62

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #1 is required in placeholder-images/assets to your readme.txt
  • Contributors: The plugin contributors field is not present
The official readme.txt might help

placeholder-images/placeholderimages.php 85% from 13 tests

The main PHP file in "Placeholder images" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("placeholder-images.php" instead of "placeholderimages.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
Good job! No executable or dangerous file extensions detected9,553 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP969943,9675,930
TypeScript104062,7651,332
JavaScript8152981960
JSON900721
Sass5731500
Markdown220050
PO File26834
YAML151314
XML1117
CSS5055

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.37
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces21
Interfaces3
Traits0
Classes68
▷ Abstract classes34.41%
▷ Concrete classes6595.59%
▷ Final classes00.00%
Methods460
▷ Static methods20344.13%
▷ Public methods40588.04%
▷ Protected methods122.61%
▷ Private methods439.35%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants27
▷ Global constants1140.74%
▷ Class constants1659.26%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.35MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
promo/icon-128x128.png7.86KB3.34KB▼ 57.48%
promo/download.png43.08KB16.03KB▼ 62.80%
promo/banner-1544x500.png106.19KB40.01KB▼ 62.32%
promo/icon-256x256.png17.00KB6.83KB▼ 59.82%
promo/icon-80x80.png4.43KB2.19KB▼ 50.45%