78% gallery-plugin

Code Review | Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress

WordPress plugin Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: gallery-plugin
  • Plugin version: 4.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2011
  • Latest release: Oct 23, 2023
  • Number of updates: 166
  • Update frequency: every 26.6 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

158 reviews

Install metrics

10,000+ active /1,866,837 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
Install script ran successfully

Server metrics [RAM: ▲1.64MB] [CPU: ▲11.99ms] Passed 4 tests

Analyzing server-side resources used by Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.11 ▲1.6555.39 ▲14.44
Dashboard /wp-admin4.96 ▲1.6161.60 ▲5.15
Posts /wp-admin/edit.php5.00 ▲1.6468.39 ▲21.33
Add New Post /wp-admin/post-new.php7.56 ▲1.6798.41 ▲7.05
Media Library /wp-admin/upload.php4.88 ▲1.6555.72 ▲24.98
Add New /wp-admin/post-new.php?post_type=bws-gallery5.5074.44
Gallery Categories /wp-admin/edit-tags.php?taxonomy=gallery_categories&post_type=bws-gallery5.0553.77
BWS Panel /wp-admin/edit.php?post_type=bws-gallery&page=gllr-bws-panel5.1955.96
Galleries /wp-admin/edit.php?post_type=bws-gallery4.9255.23

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 246 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
gllr_options
gallery_categories_children
bstwbsftwppdtplgns_options
widget_recent-comments
db_upgraded
widget_gllr_latest_galleries_widget
can_compress_scripts
widget_gallery_categories_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲11514.17 ▼0.181.87 ▲0.2736.11 ▼6.27
Dashboard /wp-admin2,240 ▲595.61 ▼0.0185.49 ▼10.9637.81 ▼5.30
Posts /wp-admin/edit.php2,215 ▲1182.20 ▲0.1833.43 ▼2.4532.78 ▼4.38
Add New Post /wp-admin/post-new.php1,633 ▲10722.99 ▼0.91657.90 ▼21.1963.91 ▲5.19
Media Library /wp-admin/upload.php1,448 ▲454.20 ▲0.0196.16 ▼1.6742.45 ▼2.87
Global Settings /wp-admin/gallery-plugin.php260.420.1112.65
Add New /wp-admin/post-new.php?post_type=bws-gallery3,0078.24189.32125.19
Gallery Categories /wp-admin/edit-tags.php?taxonomy=gallery_categories&post_type=bws-gallery1,5842.0530.2851.23
BWS Panel /wp-admin/edit.php?post_type=bws-gallery&page=gllr-bws-panel2,9201.9836.4974.58
Galleries /wp-admin/edit.php?post_type=bws-gallery1,2482.0032.5330.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_gllr_latest_galleries_widget
    • gallery_categories_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 items
  • 10× PHP files trigger server errors when accessed directly:
    • > 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-plugin/includes/class-gllr-media-table.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/gallery-plugin/templates/gallery-single-template.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gallery-plugin/includes/class-gllr-widgets.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/gallery-plugin/includes/class-gllr-settings.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/gallery-plugin/includes/class-gllr-media-table.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-plugin/bws_menu/class-bws-settings.php:1453
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/gallery-plugin/templates/gallery-template.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gallery-plugin/bws_menu/product_list.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/gallery-plugin/includes/class-gllr-media-table.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gallery-plugin/includes/class-gllr-widgets.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/gallery-plugin.php
    • > Network (severe)
    wp-admin/gallery-plugin.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=bws-gallery&page=gllr-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-admin-page/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Gallery albums page in the front-end.), #2 (Single Gallery page in the front-end.), #3 (The pop-up window containing the album images.), #4 (Displaying Gallery Categories Widget in the Sidebar on your WordPress website.), #5 ("Latest Galleries" widget displaying in the footer.), #6 (Edit Gallery page.), #7 (Edit Gallery Image Info.), #8 (Gallery Categories page.), #9 (Gallery Global Settings page.), #10 (Adding Gallery Categories Widget.), #11 (The adding of the Latest Galleries widget.)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The entry point to "Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress" version 4.7.1 is a PHP file that has certain tags in its header comment area
81 characters long description:
Add beautiful galleries, albums & images to your WordPress website in few clicks.

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
No dangerous file extensions were detected47,528 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
PO File2912,67422,90630,127
PHP158881,01410,291
CSS101652666,097
JavaScript857135846
SVG400167

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity73.38
▷ Minimum class complexity3.00
▷ Maximum class complexity210.00
Average method complexity9.51
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods68
▷ Static methods00.00%
▷ Public methods6291.18%
▷ Protected methods00.00%
▷ Private methods68.82%
Functions119
▷ Named functions119100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
75 PNG files occupy 7.29MB with 3.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/icons/plugins/bike-rental.png6.86KB2.68KB▼ 60.89%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
bws_menu/icons/themes/unity.png412.66KB167.67KB▼ 59.37%
bws_menu/icons/themes/renty.png657.95KB198.11KB▼ 69.89%