78% zz-image-slider

Code Review | ZZ Image Slider

WordPress plugin ZZ Image Slider scored 78% from 54 tests.

About plugin

  • Plugin page: zz-image-slider
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.4.2
  • WordPress version: 6.3.1
  • First release: Jul 29, 2015
  • Latest release: Jun 15, 2020
  • Number of updates: 36
  • Update frequency: every 49.5 days
  • Top authors: zudikas-zveris (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 4,412 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.03ms] Passed 4 tests

A check of server-side resources used by ZZ Image Slider
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.61 ▲0.75
Dashboard /wp-admin3.34 ▲0.0447.45 ▲0.49
Posts /wp-admin/edit.php3.39 ▲0.0348.52 ▼2.18
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.67 ▼12.00
Media Library /wp-admin/upload.php3.26 ▲0.0333.50 ▼2.42
All Image Sliders /wp-admin/edit.php?post_type=zzis_gallery3.3134.39
Add New Image Slider /wp-admin/post-new.php?post_type=zzis_gallery3.3547.31

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

ZZ Image Slider: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9614.47 ▲0.091.77 ▲0.0445.25 ▼2.73
Dashboard /wp-admin2,237 ▲494.85 ▼1.00102.52 ▼17.2936.64 ▼7.33
Posts /wp-admin/edit.php2,120 ▲312.05 ▲0.0535.54 ▼0.6434.78 ▼1.37
Add New Post /wp-admin/post-new.php1,563 ▲2423.22 ▼0.14673.73 ▲9.7864.72 ▲8.90
Media Library /wp-admin/upload.php1,416 ▲344.23 ▲0.03103.44 ▲2.4545.03 ▼1.08
All Image Sliders /wp-admin/edit.php?post_type=zzis_gallery1,0971.9330.6629.39
Add New Image Slider /wp-admin/post-new.php?post_type=zzis_gallery4,5414.6393.2152.65

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 51× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-19.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/bullet-11.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/bullet-17.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/bullet-02.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/thumbnail-05.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/thumbnail-11.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/thumbnail-08.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/thumbnail-09.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/thumbnail-03.php
    • > /wp-content/plugins/zz-image-slider/lib/views/frontend/bullet-04.php
  • 56× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/zz-image-slider/lib/views/backend/settings_meta_box.php on line 17
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/backend/image_block.php on line 2
    • > PHP Warning
      require(ZZIS_PLUGIN_DIR/lib/controlers/JSSOR_Settings.php): failed to open stream: No such file or directory in wp-content/plugins/zz-image-slider/lib/controlers/zzis.php on line 3
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-05.php on line 19
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-04.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zz-image-slider/lib/views/backend/shortcode_meta_box.php:1
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-06.php on line 19
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-01.php on line 19
    • > PHP Warning
      Use of undefined constant ZZIS_PLUGIN_URL - assumed 'ZZIS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zz-image-slider/lib/views/frontend/arrow-15.php on line 19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/zz-image-slider/lib/views/frontend/slider.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: slideshow, vertical, carousel, slider, thumbnails...

zz-image-slider/zz-image-slider.php 92% from 13 tests

"ZZ Image Slider" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected3,332 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP614215302,693
PO File1151159362
CSS34717215
JavaScript48462

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity34.00
▷ Minimum class complexity15.00
▷ Maximum class complexity53.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods2367.65%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
38 PNG files occupy 0.11MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/a01.png3.65KB2.21KB▼ 39.44%
img/a19.png4.08KB2.64KB▼ 35.30%
img/b05.png1.38KB1.22KB▼ 11.73%
img/a08.png0.57KB0.27KB▼ 53.34%
img/b17.png0.78KB0.82KB0.00%