78% new-photo-gallery

Code Review | Photo Gallery - Responsive Photo Gallery, Image Gallery, Portfolio Gallery, Logo Gallery And Team Gallery

WordPress plugin Photo Gallery - Responsive Photo Gallery, Image Gallery, Portfolio Gallery, Logo Gallery And Team Gallery scored78%from 54 tests.

About plugin

  • Plugin page: new-photo-gallery
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 3, 2016
  • Latest release: Oct 20, 2023
  • Number of updates: 176
  • Update frequency: every 14.7 days
  • Top authors: awordpresslife (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

3,000+ active /126,818 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.53MB] [CPU: ▲0.53ms] 75% from 4 tests

A check of server-side resources used by Photo Gallery - Responsive Photo Gallery, Image Gallery, Portfolio Gallery, Logo Gallery And Team Gallery
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 647.45ms on /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-plugins)
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5543.26 ▲4.94
Dashboard /wp-admin3.88 ▲0.5351.31 ▼4.19
Posts /wp-admin/edit.php3.93 ▲0.5750.18 ▲4.47
Add New Post /wp-admin/post-new.php6.40 ▲0.5194.84 ▼3.11
Media Library /wp-admin/upload.php3.74 ▲0.5139.14 ▲6.05
Add New Gallery /wp-admin/post-new.php?post_type=_light_image_gallery3.9752.10
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.9637.05
Docs /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-doc-page3.7232.98
Upgrade Premium /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-upgrade-premium3.7231.91
Our Themes /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-themes3.7134.16
Our Plugins /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-plugins3.99647.45
All Photo Gallery /wp-admin/edit.php?post_type=_light_image_gallery3.7435.93

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 79 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Photo Gallery - Responsive Photo Gallery, Image Gallery, Portfolio Gallery, Logo Gallery And Team Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲21613.85 ▼0.748.54 ▲6.8145.51 ▲5.47
Dashboard /wp-admin2,276 ▲955.64 ▼0.0296.30 ▼0.4346.46 ▲3.77
Posts /wp-admin/edit.php2,190 ▲902.06 ▲0.1037.15 ▲1.3940.45 ▲3.79
Add New Post /wp-admin/post-new.php1,604 ▲7618.33 ▼4.92586.59 ▼73.5171.96 ▲21.44
Media Library /wp-admin/upload.php1,489 ▲924.25 ▲0.1094.07 ▼9.9145.31 ▼1.17
Add New Gallery /wp-admin/post-new.php?post_type=_light_image_gallery2,4013.6165.8395.18
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0882.0522.4829.91
Docs /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-doc-page9392.0725.4135.26
Upgrade Premium /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-upgrade-premium1,0112.0627.6535.23
Our Themes /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-themes1,0322.4427.06101.50
Our Plugins /wp-admin/edit.php?post_type=_light_image_gallery&page=npg-plugins3,9761.3429.96107.35
All Photo Gallery /wp-admin/edit.php?post_type=_light_image_gallery1,1711.9634.3435.41

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=_light_image_gallery
    • > Notice in wp-content/plugins/new-photo-gallery/new-photo-gallery.php+95
    Undefined variable: columns
    • > GET request to /wp-admin/edit.php?post_type=_light_image_gallery
    • > Notice in wp-content/plugins/new-photo-gallery/new-photo-gallery.php+95
    Trying to access array offset on value of type null

SRP 50% 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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/new-photo-gallery/our-plugins/awplife-plugins.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/new-photo-gallery/our-themes/awplife-themes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/new-photo-gallery/docs.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/new-photo-gallery/class-tgm-plugin-activation.php:2129

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: image gallery, album gallery, responsive gallery, photo gallery, portfolio gallery

new-photo-gallery/new-photo-gallery.php Passed 13 tests

This is the main PHP file of "Photo Gallery - Responsive Photo Gallery, Image Gallery, Portfolio Gallery, Logo Gallery And Team Gallery" version 1.3.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
60 characters long description:
new photo gallery plugin with lightbox preview for WordPress

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 plugin30,743 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
CSS172,9626,93016,505
JavaScript122,3581,6478,809
PHP95961,7193,339
SVG4001,675
PO File2290448415

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity44.00
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods120
▷ Static methods54.17%
▷ Public methods9579.17%
▷ Protected methods2520.83%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 1.10MB with 0.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
our-themes/img/aneeq-premium.png165.42KB57.84KB▼ 65.04%
img/pricing-table.png49.13KB19.57KB▼ 60.17%
css/new-slide.png2.54KB1.19KB▼ 53.21%
lightbox/light-gallery/img/video-play.png4.42KB1.05KB▼ 76.27%
lightbox/light-gallery/img/vimeo-play.png5.30KB1.56KB▼ 70.65%