88% kento-simple-fancy-gallery

Code Review | Kento Simple Fancy Gallery

WordPress plugin Kento Simple Fancy Gallery scored 88% from 54 tests.

About plugin

  • Plugin page: kento-simple-fanc...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.2.2
  • WordPress version: 5.8.1
  • First release: Nov 20, 2014
  • Latest release: Jun 9, 2015
  • Number of updates: 6
  • Update frequency: every 33.8 days
  • Top authors: kentothemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,083 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼132.32ms] Passed 4 tests

An overview of server-side resources used by Kento Simple Fancy Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1635.31 ▲14.10
Dashboard /wp-admin3.12 ▲0.0647.42 ▲3.05
Posts /wp-admin/edit.php3.16 ▲0.0546.81 ▲10.43
Add New Post /wp-admin/post-new.php5.48 ▲0.0492.59 ▼537.17
Media Library /wp-admin/upload.php3.06 ▲0.0529.63 ▼5.58
Fancy Gallery /wp-admin/edit.php?post_type=lazy_gallery3.1034.73
Fancy Gallery Option /wp-admin/edit.php?post_type=lazy_gallery&page=kt_lazy_photo_gallery_option_settings3.0429.50
Add New Photo /wp-admin/post-new.php?post_type=lazy_gallery3.1346.43

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Kento Simple Fancy Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,925 ▲31916.82 ▲1.2819.95 ▲11.3245.44 ▼8.05
Dashboard /wp-admin3,036 ▲1056.62 ▲0.63133.54 ▼8.65126.83 ▲17.79
Posts /wp-admin/edit.php2,797 ▲583.13 ▲0.4167.07 ▲0.4383.30 ▼7.48
Add New Post /wp-admin/post-new.php1,721 ▲5118.76 ▼0.37362.73 ▼30.92114.44 ▼5.82
Media Library /wp-admin/upload.php1,818 ▲85.41 ▲0.38128.23 ▼28.23157.22 ▲38.39
Fancy Gallery /wp-admin/edit.php?post_type=lazy_gallery1,4683.0466.3081.92
Fancy Gallery Option /wp-admin/edit.php?post_type=lazy_gallery&page=kt_lazy_photo_gallery_option_settings1,3342.6656.3289.79
Add New Photo /wp-admin/post-new.php?post_type=lazy_gallery2,2524.6899.74106.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/kento-simple-fancy-gallery/fancy-gallery-admin.php:5
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/kento-simple-fancy-gallery/fancy-photo-gallery.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/kento-simple-fancy-gallery/fancy-photo-gallery.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lazy_gallery
    • > Javascript (severe) in unknown
    /wp-content/plugins/kento-simple-fancy-gallery/js/jquery.fancybox-1.3.4.pack.js?ver=1.0 17:218 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Gallery Screenshot), #2 (Admin admin panel)
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

kento-simple-fancy-gallery/fancy-photo-gallery.php 92% from 13 tests

The entry point to "Kento Simple Fancy Gallery" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("kento-simple-fancy-gallery.php" instead of "fancy-photo-gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin3,557 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
CSS5583403,195
PHP27817207
JavaScript32933155

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.06MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/menu-icons.png0.94KB0.09KB▼ 90.10%
screenshot-1.png57.21KB18.03KB▼ 68.50%