68% gallery-album

Code Review | Gallery - Image and Video Gallery with Thumbnails

WordPress plugin Gallery - Image and Video Gallery with Thumbnails scored68%from 54 tests.

About plugin

  • Plugin page: gallery-album
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 10, 2017
  • Latest release: Mar 31, 2023
  • Number of updates: 249
  • Update frequency: every 8.9 days
  • Top authors: wpdevart (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active /58,985 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.34MB] [CPU: ▲3.71ms] Passed 4 tests

An overview of server-side resources used by Gallery - Image and Video Gallery with Thumbnails
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.3345.33 ▲0.91
Dashboard /wp-admin4.65 ▲1.3553.58 ▲4.81
Posts /wp-admin/edit.php4.70 ▲1.3555.03 ▲8.59
Add New Post /wp-admin/post-new.php7.23 ▲1.3591.97 ▲0.51
Media Library /wp-admin/upload.php4.57 ▲1.3446.76 ▲14.92
Themes /wp-admin/admin.php?page=wpdevart_gallery_themes4.4841.38
Gallery /wp-admin/admin.php?page=Wpdevart_gallery_menu4.5742.98
Crope /wp-admin/admin.php?page=Wpdevart_gallery_crop4.4837.75
Shortcode Generator /wp-admin/admin.php?page=Wpdevart_gallery_shordcode_generator4.4540.16
Featured Plugins /wp-admin/admin.php?page=Wpdevart_gallery_featured_plugins4.4738.34
Hire an Expert /wp-admin/admin.php?page=Wpdevart_gallery_hire_expert4.4839.88
Popup /wp-admin/admin.php?page=wpdevart_gallery_popup4.4841.99

Server storage [IO: ▲4.08MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • The plugin illegally modified 5 files (0.00KB) outside of "wp-content/plugins/gallery-album/" and "wp-content/uploads/"
    • (new file) wp-content/wpdevart_gallery/attachment/.empty
    • (new file) wp-content/wpdevart_gallery/original/.empty
    • (new file) wp-content/wpdevart_gallery/width/.empty
    • (new file) wp-content/wpdevart_gallery/main/.empty
    • (new file) wp-content/wpdevart_gallery/height/.empty
Filesystem: 111 new files
Database: 4 new tables, 6 new options
New tables
wp_wpdevart_gallery_popup_theme
wp_wpdevart_images
wp_wpdevart_gallery_theme
wp_wpdevart_gallery
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gallery - Image and Video Gallery with Thumbnails
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,975 ▲24013.66 ▼1.086.54 ▲4.5436.43 ▼6.83
Dashboard /wp-admin2,259 ▲714.91 ▲0.0598.47 ▼19.0039.46 ▼6.39
Posts /wp-admin/edit.php2,142 ▲502.03 ▲0.0335.07 ▼1.6935.53 ▲1.52
Add New Post /wp-admin/post-new.php1,575 ▲4223.23 ▲0.10644.44 ▼4.4662.11 ▲14.20
Media Library /wp-admin/upload.php1,444 ▲624.21 ▼0.1097.14 ▼7.2243.07 ▼0.71
Themes /wp-admin/admin.php?page=wpdevart_gallery_themes1,0822.6454.8848.75
Gallery /wp-admin/admin.php?page=Wpdevart_gallery_menu1,3821.9033.1358.97
Crope /wp-admin/admin.php?page=Wpdevart_gallery_crop9542.0328.6841.13
Shortcode Generator /wp-admin/admin.php?page=Wpdevart_gallery_shordcode_generator9792.3024.7927.90
Featured Plugins /wp-admin/admin.php?page=Wpdevart_gallery_featured_plugins1,1242.0123.4340.59
Hire an Expert /wp-admin/admin.php?page=Wpdevart_gallery_hire_expert8962.0223.5229.55
Popup /wp-admin/admin.php?page=wpdevart_gallery_popup1,0892.6958.2739.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 4 tables
    • wp_wpdevart_gallery_theme
    • wp_wpdevart_gallery_popup_theme
    • wp_wpdevart_gallery
    • wp_wpdevart_images
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 846
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 829
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/gallery-album/includes/install_databese.php on line 180
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 842
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/gallery-album/includes/install_databese.php on line 179
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 852
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 834
    • > PHP Warning
      mkdir(): No such file or directory in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 849
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 839
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-album/includes/admin/gallery_page_class.php on line 847

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpdevart_gallery_popup
    • > Network (severe)
    wp-content/plugins/gallery-album/includes/admin/images/default%7B%7Brows.default%7D%7D.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: photo gallery, image gallery, gallery, responsive gallery, wordpress gallery plugin

gallery-album/gallery-album.php 92% from 13 tests

The main PHP script in "Gallery - Image and Video Gallery with Thumbnails" version 2.0.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 177 characters long)

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 plugin15,182 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP136783477,342
JavaScript103183374,104
CSS9224763,051
SVG100685

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity34.53
▷ Minimum class complexity1.00
▷ Maximum class complexity123.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods185
▷ Static methods147.57%
▷ Public methods10255.14%
▷ Protected methods00.00%
▷ Private methods8344.86%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/images/featured_plugins/coming_soon.png12.40KB5.21KB▼ 57.98%
includes/admin/images/gallery_img.png1.59KB0.58KB▼ 63.39%
includes/admin/images/featured_plugins/Pricing-table.png12.94KB4.08KB▼ 68.44%
includes/admin/images/featured_plugins/facebook-comments-icon.png35.59KB9.23KB▼ 74.06%
includes/admin/images/icon_bt_40.png1.19KB0.38KB▼ 67.90%