77% wp-fancy-gallery

Code Review | WP Fancy Gallery

WordPress plugin WP Fancy Gallery scored 77% from 53 tests.

About plugin

  • Plugin page: wp-fancy-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7+
  • WordPress version: 5.8.1
  • First release: Nov 29, 2017
  • Latest release: Jan 31, 2018
  • Number of updates: 4
  • Update frequency: every 16.0 days
  • Top authors: hireukraineco (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,083 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼260.80ms] Passed 4 tests

An overview of server-side resources used by WP Fancy Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1742.15 ▲21.51
Dashboard /wp-admin3.20 ▲0.1448.17 ▲7.47
Posts /wp-admin/edit.php3.25 ▲0.1444.85 ▲2.65
Add New Post /wp-admin/post-new.php5.48 ▲0.0589.18 ▼1,050.11
Media Library /wp-admin/upload.php3.06 ▲0.0533.73 ▼3.19

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 62 new files
Database: 2 new tables, no new options
New tables
wp_wpfancygallery_hu_fancy_images
wp_wpfancygallery_hu_fancy_gallery

Browser metrics Passed 4 tests

WP Fancy Gallery: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,894 ▲28817.63 ▲2.1012.49 ▲4.1559.02 ▲12.80
Dashboard /wp-admin3,162 ▲3127.98 ▲2.14158.36 ▲19.3688.65 ▼8.47
Posts /wp-admin/edit.php2,967 ▲2614.35 ▲1.6582.54 ▲13.2971.99 ▼18.98
Add New Post /wp-admin/post-new.php1,606 ▼4718.91 ▲0.10359.59 ▼27.09137.03 ▲32.91
Media Library /wp-admin/upload.php1,811 ▲394.87 ▼0.13118.36 ▼36.31120.10 ▲6.41

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
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method WpFancyGallery\inc\WpFancyGalleryManagerGallery::dropTables() should not be called statically

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 9× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/finish_wrap_item.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/start_wrap_item.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/finish_wrap_items.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/front/item_image.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/nav_menu_start_wrap.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/start_wrap_items.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/nav_menu_list.php
    • > /wp-content/plugins/wp-fancy-gallery/inc/templates/admin/nav_menu_finish_wrap.php
  • 68× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/nav_menu_list.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WpFancyGallery\\inc\\Controllers\\WpFancyGalleryController' not found in wp-content/plugins/wp-fancy-gallery/inc/Controllers/WpFancyGalleryShortcodeGalleryController.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 28
    • > PHP Warning
      Use of undefined constant WPFANCYGALLERY_GALLERY_ASSETS_ADMIN_IMAGES_URL - assumed 'WPFANCYGALLERY_GALLERY_ASSETS_ADMIN_IMAGES_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-fancy-gallery/inc/templates/front/item_image.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WpFancyGallery\\inc\\Controllers\\WpFancyGalleryAdminGalleryTemplateController' not found in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/admin_settings.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 5
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 33
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 13
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-fancy-gallery/inc/templates/admin/item_gallery.php on line 20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: A description for screenshot #1 is missing in wp-fancy-gallery/assets to your readme.txt
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

wp-fancy-gallery/index.php 92% from 13 tests

This is the main PHP file of "WP Fancy Gallery" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-fancy-gallery.php" instead of "index.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
Everything looks great! No dangerous files found in this plugin2,968 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript95281982,020
PHP2411665565
CSS76823383

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity3.09
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods3882.61%
▷ Protected methods36.52%
▷ Private methods510.87%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
20 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/assets/frontend/css/fancybox/fancy_shadow_sw.png0.33KB0.48KB0.00%
inc/assets/frontend/css/fancybox/fancybox.png14.93KB8.47KB▼ 43.29%
inc/assets/frontend/css/fancybox/fancy_shadow_n.png0.10KB0.19KB0.00%
inc/assets/frontend/css/fancybox/fancy_title_over.png0.07KB0.09KB0.00%
inc/assets/frontend/css/fancybox/fancy_title_right.png0.49KB0.82KB0.00%