78% 2j-slideshow

Code Review | Slideshow, Image Slider by 2J

WordPress plugin Slideshow, Image Slider by 2J scored 78% from 54 tests.

About plugin

  • Plugin page: 2j-slideshow
  • Plugin version: 1.3.54
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 5.9.2
  • First release: Oct 22, 2015
  • Latest release: Jul 16, 2021
  • Number of updates: 728
  • Update frequency: every 2.9 days
  • Top authors: 2J-Slideshow (99.86%)

Code review

54 tests

User reviews

63 reviews

Install metrics

2,000+ active / 107,898 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.42MB] [CPU: ▼291.20ms] Passed 4 tests

Analyzing server-side resources used by Slideshow, Image Slider by 2J
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4358.79 ▲10.30
Dashboard /wp-admin3.83 ▲0.4239.33 ▲5.55
Posts /wp-admin/edit.php4.06 ▲0.4239.63 ▲1.80
Add New Post /wp-admin/post-new.php7.36 ▲0.39102.36 ▼1,170.62
Media Library /wp-admin/upload.php3.77 ▲0.4726.98 ▼1.51
SlideShows /wp-admin/edit.php?post_type=twoj_slideshow_post3.8531.71
Help /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-support3.7126.30
Add Slideshow /wp-admin/post-new.php?post_type=twoj_slideshow_post4.8949.79
Report /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-report3.7826.17
2J Slideshow Demo /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-demo3.7123.93

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 227 new files
Database: no new tables, 3 new options
New WordPress options
twojSlideshowVersion
widget_twoj_widget
photonic_options

Browser metrics Passed 4 tests

Slideshow, Image Slider by 2J: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,836 ▲8216.20 ▲0.145.70 ▼0.012.52 ▼0.09
Dashboard /wp-admin2,949 ▲916.24 ▼0.03118.20 ▼15.46157.06 ▼2.72
Posts /wp-admin/edit.php2,749 ▲613.24 ▲0.0064.44 ▲2.55141.30 ▲1.09
Add New Post /wp-admin/post-new.php1,704 ▲4317.77 ▼3.65411.71 ▲41.83152.17 ▼8.41
Media Library /wp-admin/upload.php1,755 ▲605.56 ▲0.11135.54 ▼6.80183.06 ▼6.57
SlideShows /wp-admin/edit.php?post_type=twoj_slideshow_post1,5003.2062.15129.37
Help /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-support4182.6617.8146.44
Add Slideshow /wp-admin/post-new.php?post_type=twoj_slideshow_post5,7297.48185.17265.40
Report /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-report1,1022.7653.99118.71
2J Slideshow Demo /wp-admin/edit.php?post_type=twoj_slideshow_post&page=twoj-slideshow-demo1,8625.9297.59120.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 3 options in the database
    • twojSlideshowVersion
    • photonic_options
    • widget_twoj_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=twoj_slideshow_post
    • > Notice in wp-content/plugins/2j-slideshow/cmb2/fields/padding/twojPadding.php+44
    Undefined index: enable

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function new_cmb2_box() in wp-content/plugins/2j-slideshow/inc/options/images.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/2j-slideshow/cmb2/bootstrap.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/2j-slideshow/cmb2/fields/twojtext/cmb-field-twojtext.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/2j-slideshow/inc/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function new_cmb2_box() in wp-content/plugins/2j-slideshow/inc/options/premium_version.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/2j-slideshow/inc/addons/report/report.init.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/2j-slideshow/cmb2/fields/multisize/twojMultiSize.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/2j-slideshow/inc/addons/block/init.php:19
    • > PHP Warning
      Use of undefined constant TWOJ_SLIDESHOW_PATH - assumed 'TWOJ_SLIDESHOW_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/2j-slideshow/inc/addons/block/init.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function new_cmb2_box() in wp-content/plugins/2j-slideshow/inc/options/size.php:8

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

2j-slideshow/2jslideshow.php 92% from 13 tests

The main file in "Slideshow, Image Slider by 2J" v. 1.3.54 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("2j-slideshow.php" instead of "2jslideshow.php")

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
There were no executable files found in this plugin30,704 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
CSS241,15766112,578
JavaScript392,5581,19210,865
PHP571,3942,0345,273
PO File55395401,171
SVG200792
Markdown13021
HTML1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods240
▷ Static methods177.08%
▷ Public methods23296.67%
▷ Protected methods31.25%
▷ Private methods52.08%
Functions92
▷ Named functions92100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants2592.59%
▷ Class constants27.41%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cmb2/images/ico-delete.png0.70KB0.72KB0.00%
cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
css/twoj_slideshow.png3.15KB3.22KB0.00%
cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%