83% photo-gallery-builder

Code Review | Photo Gallery Builder

WordPress plugin Photo Gallery Builder scored83%from 54 tests.

About plugin

  • Plugin page: photo-gallery-bui...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 6, 2020
  • Latest release: Nov 22, 2023
  • Number of updates: 29
  • Update frequency: every 43.6 days
  • Top authors: wpdiscover (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /37,830 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.37MB] [CPU: ▼3.79ms] 75% from 4 tests

A check of server-side resources used by Photo Gallery Builder
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 640.90ms on /wp-admin/edit.php?post_type=pg_builder&page=pgbp-dashboard)
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3640.58 ▼0.72
Dashboard /wp-admin3.73 ▲0.3847.01 ▼13.70
Posts /wp-admin/edit.php3.76 ▲0.4148.79 ▼1.60
Add New Post /wp-admin/post-new.php6.29 ▲0.4196.77 ▲0.86
Media Library /wp-admin/upload.php3.58 ▲0.3637.50 ▲3.70
Install Popular Plugins From WPdiscover /wp-admin/edit.php?post_type=pg_builder&page=pgbp-dashboard3.64640.90
Add New /wp-admin/post-new.php?post_type=pg_builder3.7750.63
Galleries /wp-admin/edit.php?post_type=pg_builder3.6335.43
Upgrade To Premium /wp-admin/edit.php?post_type=pg_builder&page=pgbp-premium3.5632.66
Documentation /wp-admin/edit.php?post_type=pg_builder&page=pgbp-designs3.5635.40

Server storage [IO: ▲3.83MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 118 new files
Database: no new tables, 11 new options
New WordPress options
photo-gallery-v
db_upgraded
photo-gallery-type
widget_recent-posts
theysaidso_admin_options
pgbp_cns_review
can_compress_scripts
photo-gallery-installDate
pgb-photo-gallery-images-default
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Photo Gallery Builder
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲26613.52 ▼0.6715.47 ▲13.7843.99 ▲1.41
Dashboard /wp-admin2,244 ▲645.58 ▼0.0594.12 ▲9.1340.90 ▲5.51
Posts /wp-admin/edit.php2,150 ▲502.00 ▲0.0538.88 ▼3.5935.47 ▼3.79
Add New Post /wp-admin/post-new.php1,569 ▲4323.57 ▲0.35590.54 ▼76.4051.87 ▲2.98
Media Library /wp-admin/upload.php1,546 ▲1494.41 ▲0.18103.27 ▲2.8239.97 ▼2.42
Install Popular Plugins From WPdiscover /wp-admin/edit.php?post_type=pg_builder&page=pgbp-dashboard1,6312.0528.0532.44
Add New /wp-admin/post-new.php?post_type=pg_builder3,2744.96181.6875.70
Galleries /wp-admin/edit.php?post_type=pg_builder1,1221.9234.0630.50
Upgrade To Premium /wp-admin/edit.php?post_type=pg_builder&page=pgbp-premium1,1482.0024.1551.21
Documentation /wp-admin/edit.php?post_type=pg_builder&page=pgbp-designs1,1182.0023.6735.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 11 options
    • photo-gallery-type
    • pgb-photo-gallery-images-default
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • pgbp_cns_review
    • photo-gallery-v
    • widget_recent-comments
    • theysaidso_admin_options
    • photo-gallery-installDate
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-includes/pluggable.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/photo-gallery-builder/default_image.php on line 9
    • > PHP Warning
      Use of undefined constant PHOTO_GALLERY_BUILDER_LIBRARIES - assumed 'PHOTO_GALLERY_BUILDER_LIBRARIES' (this will throw an Error in a future version of PHP) in wp-content/plugins/photo-gallery-builder/includes/libraries/class-photo-gallery-template-loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/photo-gallery-builder/includes/install/installation.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_bits() in wp-content/plugins/photo-gallery-builder/default_image.php: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/photo-gallery-builder/default_image.php on line 9
    • > PHP Warning
      require(PHOTO_GALLERY_BUILDER_LIBRARIESclass-gamajo-template-loader.php): failed to open stream: No such file or directory in wp-content/plugins/photo-gallery-builder/includes/libraries/class-photo-gallery-template-loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/photo-gallery-builder/photo-gallery-builder.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/photo-gallery-builder/includes/public/templates/photo-gallery.php:3
    • > PHP Warning
      include(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/photo-gallery-builder/default_image.php on line 9
    • > PHP Warning
      Use of undefined constant PHOTO_GALLERY_BUILDER_IMAGES - assumed 'PHOTO_GALLERY_BUILDER_IMAGES' (this will throw an Error in a future version of PHP) in wp-content/plugins/photo-gallery-builder/default_image.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6, #7, #8, #9 in photo-gallery-builder/assets to your readme.txt
  • Donate link: Invalid url: "#"
The official readme.txt might help

photo-gallery-builder/photo-gallery-builder.php 92% from 13 tests

The entry point to "Photo Gallery Builder" version 3.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin21,212 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
SVG50135,563
CSS171,9841745,224
JavaScript131,1101,1423,670
PHP258435672,982
Sass1643341,903
LESS1641511,870

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.90
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods62
▷ Static methods812.90%
▷ Public methods4775.81%
▷ Protected methods34.84%
▷ Private methods1219.35%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 compressed PNG files occupy 0.04MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/prev.png1.33KB1.59KB0.00%
assets/images/close.png0.27KB0.29KB0.00%
assets/images/icon-128x128.png41.95KB21.23KB▼ 49.38%
assets/images/next.png1.32KB1.58KB0.00%