10% gallery-slice

Code Review | Gallery Slice

WordPress plugin Gallery Slice scored 10% from 54 tests.

About plugin

  • Plugin page: gallery-slice
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.6
  • WordPress version: 6.3.1
  • First release: May 17, 2014
  • Latest release: Aug 18, 2016
  • Number of updates: 41
  • Update frequency: every 20.1 days
  • Top authors: honza.skypala (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 3,847 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/gallery-slice/gallery-slice.php+23
    Function create_function() is deprecated

Server metrics [RAM: ▼1.75MB] [CPU: ▼51.04ms] Passed 4 tests

An overview of server-side resources used by Gallery Slice
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.24 ▼1.225.21 ▼34.50
Dashboard /wp-admin2.26 ▼1.057.65 ▼40.91
Posts /wp-admin/edit.php2.26 ▼1.108.03 ▼35.41
Add New Post /wp-admin/post-new.php2.26 ▼3.636.29 ▼93.33
Media Library /wp-admin/upload.php2.26 ▼0.977.49 ▼27.51

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
gallery_slice_version
gallery_slice_link2full
db_upgraded
gallery_slice_waiting_img
gallery_slice_downto
widget_recent-comments
gallery_slice_threshold
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Gallery Slice: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.196.21 ▲4.3444.84 ▲1.56
Dashboard /wp-admin2,203 ▲155.85 ▼0.0498.10 ▼3.0038.55 ▼1.97
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0341.52 ▲6.9535.41 ▲3.34
Add New Post /wp-admin/post-new.php6,490 ▲4,97020.23 ▼3.14924.86 ▲231.0466.42 ▲11.10
Media Library /wp-admin/upload.php1,385 ▼34.20 ▲0.0199.96 ▲4.8644.02 ▲1.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/gallery-slice/gallery-slice.php+23
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 11 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • gallery_slice_waiting_img
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • gallery_slice_downto
    • gallery_slice_link2full
    • gallery_slice_threshold
    • gallery_slice_version
    • ...

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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 fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/gallery-slice/gallery-slice.php:395
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gallery-slice/gallery-slice.php on line 12
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/gallery-slice/gallery-slice.php on line 12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-slice/gallery-slice.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: images, image, gallery, ajax

gallery-slice/gallery-slice.php Passed 13 tests

"Gallery Slice" version 1.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
119 characters long description:
Slices gallery to a "preview" on archive pages (date, category, tag and author based lists, usually including homepage)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin520 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP15121349
JavaScript41614135
PO File118236

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity70.00
▷ Minimum class complexity70.00
▷ Maximum class complexity70.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods520.83%
▷ Public methods1875.00%
▷ Protected methods416.67%
▷ Private methods28.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected