62% tz-plus-gallery

Code Review | TZ Plus Gallery

WordPress plugin TZ Plus Gallery scored62%from 54 tests.

About plugin

  • Plugin page: tz-plus-gallery
  • Plugin version: 1.5.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Jul 21, 2015
  • Latest release: Oct 18, 2020
  • Number of updates: 56
  • Update frequency: every 34.3 days
  • Top authors: tuyennv (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

600+ active /14,393 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by TZ Plus Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.18 ▼5.74
Dashboard /wp-admin3.38 ▲0.0852.18 ▼2.07
Posts /wp-admin/edit.php3.42 ▲0.0649.05 ▼0.97
Add New Post /wp-admin/post-new.php6.07 ▲0.1989.39 ▼10.77
Media Library /wp-admin/upload.php3.32 ▲0.0935.70 ▼2.10
Go Pro /wp-admin/admin.php?page=tz_plusgallery_pro3.2534.19
About TZ Plus Gallery /wp-admin/admin.php?page=tz_plusgallery_about3.2531.48
All Albums /wp-admin/admin.php?page=tz_plusgallery3.5248.71

Server storage [IO: ▲0.76MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 90 new files
Database: 4 new tables, 6 new options
New tables
wp_tz_plusgallery_images
wp_tz_plusgallery_options
wp_tz_plusgallery_type
wp_tz_plusgallery_item
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by TZ Plus Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9313.65 ▼0.761.60 ▼1.3243.81 ▼1.43
Dashboard /wp-admin2,256 ▲565.80 ▲0.94110.36 ▼6.9276.32 ▲34.04
Posts /wp-admin/edit.php2,138 ▲382.02 ▼0.0137.84 ▲0.0234.54 ▲0.27
Add New Post /wp-admin/post-new.php1,715 ▲18424.50 ▲1.30703.30 ▲18.6256.25 ▲1.46
Media Library /wp-admin/upload.php1,423 ▲234.28 ▲0.06100.29 ▼11.1879.56 ▲30.61
Go Pro /wp-admin/admin.php?page=tz_plusgallery_pro1,1152.0126.8953.89
About TZ Plus Gallery /wp-admin/admin.php?page=tz_plusgallery_about3,80528.04865.2838.09
All Albums /wp-admin/admin.php?page=tz_plusgallery1,3543.2449.67107.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_tz_plusgallery_type
    • wp_tz_plusgallery_item
    • wp_tz_plusgallery_images
    • wp_tz_plusgallery_options
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tz-plus-gallery/wp_album_front_end.html.php
    • > /wp-content/plugins/tz-plus-gallery/gallery.php
    • > /wp-content/plugins/tz-plus-gallery/album_front_end.html.php
    • > /wp-content/plugins/tz-plus-gallery/tz_plusgallery.html.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tz-plus-gallery/tz_gallery.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/swift.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/elegant.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/lania.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/everline.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/aragon.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/pinme.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/mirror.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/zumi.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/rolly.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/ming.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/lily.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/folio.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/simple.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tz_plusgallery_about
    • > Network (severe)
    http://plusgallery.templaza.net/wp-content/themes/tz_extension/images/black.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

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: gallery, facebook album, flickr album, google album, wordpress albums...

tz-plus-gallery/tz_gallery.php 92% from 13 tests

The main PHP file in "TZ Plus Gallery" ver. 1.5.5 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tz-plus-gallery.php" instead of "tz_gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin6,309 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS6418882,993
PHP5217421,739
JavaScript83882631,576
HTML1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions24
▷ Named functions24100.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
46 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/facebook/sprite.png4.13KB2.26KB▼ 45.33%
images/prettyPhoto/dark_square/contentPattern.png0.12KB0.09KB▼ 20.66%
images/prettyPhoto/default/sprite_prev.png1.34KB0.38KB▼ 71.73%
images/prettyPhoto/light_square/sprite.png3.42KB2.13KB▼ 37.67%
images/prettyPhoto/dark_rounded/contentPattern.png0.13KB0.09KB▼ 25.38%