83% zengo-custom-thumbnail-image

Code Review | Zengo Custom Thumbnail Image Gallery

WordPress plugin Zengo Custom Thumbnail Image Gallery scored 83% from 54 tests.

About plugin

  • Plugin page: zengo-custom-thum...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4
  • WordPress version: 5.8.1
  • First release: Sep 1, 2015
  • Latest release: Jan 25, 2016
  • Number of updates: 56
  • Update frequency: every 12.7 days
  • Top authors: zengowebservices (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active / 2,116 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼138.80ms] Passed 4 tests

This is a short check of server-side resources used by Zengo Custom Thumbnail Image Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1940.37 ▲11.53
Dashboard /wp-admin3.13 ▲0.0844.50 ▲6.86
Posts /wp-admin/edit.php3.18 ▲0.0843.03 ▲1.11
Add New Post /wp-admin/post-new.php5.49 ▲0.0685.68 ▼562.97
Media Library /wp-admin/upload.php3.07 ▲0.0734.11 ▼0.18
Zengo Custom Thumbnail Image /wp-admin/options-general.php?page=zengo-gallery3.0227.75

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Zengo Custom Thumbnail Image Gallery: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.90 ▲0.3212.12 ▲1.7646.73 ▼4.65
Dashboard /wp-admin2,978 ▲446.06 ▲0.08123.86 ▼17.15109.93 ▼5.95
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0065.40 ▲1.4995.09 ▲1.61
Add New Post /wp-admin/post-new.php1,679 ▲8818.78 ▲0.05358.98 ▼17.74110.33 ▲7.32
Media Library /wp-admin/upload.php1,812 ▲55.01 ▼0.03153.92 ▲1.09126.42 ▼29.86
Zengo Custom Thumbnail Image /wp-admin/options-general.php?page=zengo-gallery2,0343.6677.23163.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=zengo-gallery
    • > Notice in wp-content/plugins/zengo-custom-thumbnail-image/image.php+225
    Undefined variable: success
    • > GET request to /wp-admin/options-general.php?page=zengo-gallery
    • > Notice in wp-content/plugins/zengo-custom-thumbnail-image/image.php+229
    Undefined variable: empty
    • > GET request to /wp-admin/options-general.php?page=zengo-gallery
    • > Notice in wp-content/plugins/zengo-custom-thumbnail-image/image.php+233
    Undefined variable: deleted
    • > GET request to /wp-admin/options-general.php?page=zengo-gallery
    • > Notice in wp-content/plugins/zengo-custom-thumbnail-image/image.php+238
    Undefined variable: save
    • > GET request to /wp-admin/options-general.php?page=zengo-gallery
    • > Notice in wp-content/plugins/zengo-custom-thumbnail-image/image.php+243
    Undefined variable: edit

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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/zengo-custom-thumbnail-image/shortcode.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/zengo-custom-thumbnail-image/display.php:280
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zengo-custom-thumbnail-image/image.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: custom gallery, display image, separate thumbnail, thumbnail gallery, custom thumbnail...

zengo-custom-thumbnail-image/image.php 92% from 13 tests

The main file in "Zengo Custom Thumbnail Image Gallery" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("zengo-custom-thumbnail-image.php" instead of "image.php")

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
Success! There were no dangerous files found in this plugin1,835 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP57159954
CSS52742658
SVG100188
JavaScript21626
XML1009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity11.33
▷ Minimum method complexity4.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/arrows.png1.98KB1.01KB▼ 49.21%