83% ctcl-image-gallery

Code Review | CTCL Image Gallery

WordPress plugin CTCL Image Gallery scored83%from 54 tests.

About plugin

  • Plugin page: ctcl-image-gallery
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2.2-6.4.1
  • WordPress version: 6.3.1
  • First release: May 28, 2021
  • Latest release: Nov 19, 2023
  • Number of updates: 22
  • Update frequency: every 41.1 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,083 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.88ms] Passed 4 tests

This is a short check of server-side resources used by CTCL Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.96 ▼5.89
Dashboard /wp-admin3.31 ▲0.0142.27 ▼8.98
Posts /wp-admin/edit.php3.36 ▲0.0149.42 ▲4.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.83 ▲2.36
Media Library /wp-admin/upload.php3.24 ▲0.0134.73 ▲0.99

Server storage [IO: ▲3.07MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by CTCL Image Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.25 ▼0.091.82 ▲0.0636.06 ▼7.83
Dashboard /wp-admin2,192 ▲115.62 ▼0.0892.79 ▼19.9337.69 ▼6.11
Posts /wp-admin/edit.php2,103 ▲31.96 ▲0.0238.88 ▲2.2136.42 ▲1.39
Add New Post /wp-admin/post-new.php1,540 ▼023.28 ▲0.08663.50 ▲22.3746.36 ▼5.30
Media Library /wp-admin/upload.php1,403 ▲34.14 ▼0.1596.34 ▼0.6347.01 ▲4.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • 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
Good news, no errors were detected

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ctcl-image-gallery/ctcl-image-gallery.php:26

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Gutenberg block), #2 (Block setting), #3 (Post display of gallery), #4 (Image album in overlay)
You can look at the official readme.txt

ctcl-image-gallery/ctcl-image-gallery.php 85% from 13 tests

Analyzing the main PHP file in "CTCL Image Gallery" version 2.1.1
Please make the necessary changes and fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.4.9" instead of "7.0")
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin16,439 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON42016,268
JavaScript66266128
Sass210035
PHP31207
CSS2101

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 2.37MB with 1.67MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png878.93KB257.94KB▼ 70.65%
screenshot-1.png777.80KB227.59KB▼ 70.74%
screenshot-3.png770.08KB229.72KB▼ 70.17%