83% image-display-control

Code Review | Image Display Control

WordPress plugin Image Display Control scored83%from 54 tests.

About plugin

  • Plugin page: image-display-con...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.2
  • WordPress version: 6.3.1
  • First release: Nov 5, 2022
  • Latest release: Jun 28, 2023
  • Number of updates: 11
  • Update frequency: every 21.5 days
  • Top authors: lourot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.48ms] Passed 4 tests

Server-side resources used by Image Display Control
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1445.80 ▼0.29
Dashboard /wp-admin3.43 ▲0.1353.80 ▼1.80
Posts /wp-admin/edit.php3.55 ▲0.1948.77 ▼0.55
Add New Post /wp-admin/post-new.php6.02 ▲0.1387.82 ▼22.90
Media Library /wp-admin/upload.php3.36 ▲0.1340.86 ▼0.66

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 51 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Image Display Control
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲814.38 ▲0.012.33 ▼0.3446.03 ▲1.72
Dashboard /wp-admin2,195 ▲155.63 ▲0.0596.03 ▼3.1638.55 ▼4.27
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0235.50 ▼3.1234.81 ▼5.12
Add New Post /wp-admin/post-new.php1,528 ▼023.18 ▲0.10683.27 ▼7.7854.83 ▼1.10
Media Library /wp-admin/upload.php1,394 ▼34.16 ▼0.05105.77 ▼2.9046.01 ▼2.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'CSD\\Image\\Image' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Format/JPEG.php:12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-display-control/src/global-functions.php on line 25
    • > PHP Fatal error
      Uncaught Error: Class 'CSD\\Image\\Image' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Format/WebP.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CSD\\Image\\Image' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Format/PNG.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'CSD\\Image\\Format\\WebP\\Chunk' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Format/WebP/VP8XChunk.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CSD\\Image\\Image' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Format/PSD.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/image-display-control/src/global-functions.php on line 25
    • > PHP Fatal error
      Uncaught Error: Interface 'CSD\\Image\\ImageInterface' not found in wp-content/plugins/image-display-control/src/vendor/frameright/image-metadata-parser/src/Image.php:16
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/image-display-control/src/global-functions.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

image-display-control/frameright.php 85% from 13 tests

This is the main PHP file of "Image Display Control" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("image-display-control.php" instead of "frameright.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected3,538 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP377982,0693,274
Markdown5780179
JSON10080
JavaScript2295
CSS1010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.97
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces14
Interfaces1
Traits0
Classes29
▷ Abstract classes310.34%
▷ Concrete classes2689.66%
▷ Final classes00.00%
Methods274
▷ Static methods4817.52%
▷ Public methods23585.77%
▷ Protected methods20.73%
▷ Private methods3713.50%
Functions8
▷ Named functions562.50%
▷ Anonymous functions337.50%
Constants23
▷ Global constants00.00%
▷ Class constants23100.00%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected