61% photo-gallery-portfolio

Code Review | WordPress Photo Gallery - Portfolio, Image Gallery & Video Gallery

WordPress plugin WordPress Photo Gallery - Portfolio, Image Gallery & Video Gallery scored61%from 54 tests.

About plugin

  • Plugin page: photo-gallery-por...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.3.2
  • WordPress version: 6.3.1
  • First release: Apr 26, 2019
  • Latest release: Jan 21, 2020
  • Number of updates: 12
  • Update frequency: every 22.8 days
  • Top authors: adamlabs (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /12,022 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.95MB] [CPU: ▲8.92ms] Passed 4 tests

Analyzing server-side resources used by WordPress Photo Gallery - Portfolio, Image Gallery & Video Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.80 ▲3.3461.02 ▲17.34
Dashboard /wp-admin7.62 ▲4.2773.11 ▲6.98
Posts /wp-admin/edit.php8.31 ▲4.9676.20 ▲25.17
Add New Post /wp-admin/post-new.php9.13 ▲3.2476.69 ▼13.81
Media Library /wp-admin/upload.php8.22 ▲4.9969.61 ▲33.37
Templates (Pro) /wp-admin/admin.php?page=adamlabsgallery-item-skin8.1862.56
Portfolio Gallery /wp-admin/admin.php?page=adamlabsgallery7.6367.00
Global Settings (Pro) /wp-admin/admin.php?page=adamlabsgallery-global-settings7.7066.14
Import/Export /wp-admin/admin.php?page=adamlabsgallery-import-export8.2372.18

Server storage [IO: ▲6.16MB] [DB: ▲0.11MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 209 new files
Database: 4 new tables, 13 new options
New tables
wp_adamlabsgallery_navigation_skins
wp_adamlabsgallery_item_elements
wp_adamlabsgallery_grids
wp_adamlabsgallery_item_skins
New WordPress options
db_upgraded
widget_recent-posts
adamlabsgallery_grids_version
adamlabsgallery_role
adamlabsgallery_custom_css_imported
adamlabs-google-fonts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_adamlabsgallery-widget
...

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Photo Gallery - Portfolio, Image Gallery & Video Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲16113.44 ▼0.938.59 ▲6.6537.22 ▼6.79
Dashboard /wp-admin2,237 ▲605.52 ▼0.0194.52 ▼10.1890.25 ▲47.75
Posts /wp-admin/edit.php3,271 ▲1,1712.00 ▲0.0435.53 ▼1.0834.43 ▼0.29
Add New Post /wp-admin/post-new.php7,413 ▲5,88721.74 ▼1.02893.06 ▲263.3875.80 ▲13.89
Media Library /wp-admin/upload.php2,580 ▲1,1774.26 ▲0.07100.92 ▼4.4975.52 ▲32.50
Templates (Pro) /wp-admin/admin.php?page=adamlabsgallery-item-skin1,6715.75124.40111.98
Portfolio Gallery /wp-admin/admin.php?page=adamlabsgallery1,1794.7461.3938.42
Global Settings (Pro) /wp-admin/admin.php?page=adamlabsgallery-global-settings1,8024.6361.5881.28
Import/Export /wp-admin/admin.php?page=adamlabsgallery-import-export1,3384.8463.4342.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 4 tables
    • wp_adamlabsgallery_grids
    • wp_adamlabsgallery_item_elements
    • wp_adamlabsgallery_item_skins
    • wp_adamlabsgallery_navigation_skins
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • adamlabsgallery_grids_version
    • adamlabsgallery-current-sorting
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • adamlabs-google-fonts
    • db_upgraded
    • adamlabsgallery_custom_css
    • widget_recent-posts
    • adamlabsgallery_custom_css_imported
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adamlabsgallery-item-skin
    • > Notice in wp-content/plugins/photo-gallery-portfolio/com/core/class-item-skin.php+4218
    Undefined index: ID
    • > GET request to /wp-admin/admin.php?page=adamlabsgallery-item-skin
    • > Notice in wp-content/plugins/photo-gallery-portfolio/com/class-adamlabsgallery.php+1302
    Undefined index: settings
    • > GET request to /wp-admin/admin.php?page=adamlabsgallery-item-skin
    • > Notice in wp-content/plugins/photo-gallery-portfolio/com/class-adamlabsgallery.php+1303
    Undefined index: last_modified
    • > GET request to /wp-admin/admin.php?page=adamlabsgallery-item-skin
    • > Deprecated in wp-content/plugins/photo-gallery-portfolio/com/class-adamlabsgallery.php+4261
    implode(): Passing glue string after array is deprecated. Swap the parameters
    • > GET request to /wp-admin/admin.php?page=adamlabsgallery
    • > Notice in wp-content/plugins/photo-gallery-portfolio/com/admin/views/grid-overview.php+53
    Undefined index: limit

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/photo-gallery-portfolio/com/admin/views/skin-pe-icon-7-stroke-list.php
    • > /wp-content/plugins/photo-gallery-portfolio/com/admin/views/skin-font-awesome-list.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Tag.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Media.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Like.php:6
    • > PHP Notice
      Undefined variable: grid in wp-content/plugins/photo-gallery-portfolio/com/admin/views/elements/general-info.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Account.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/photo-gallery-portfolio/com/admin/views/elements/add-item.php:3
    • > PHP Notice
      Undefined variable: grid in wp-content/plugins/photo-gallery-portfolio/com/admin/views/elements/general-info.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/photo-gallery-portfolio/com/admin/views/elements/source.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Comment.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'InstagramScraper\\Model\\AbstractModel' not found in wp-content/plugins/photo-gallery-portfolio/com/core/InstagramScraper/Model/Location.php:6

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 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #5 in photo-gallery-portfolio/assets to your readme.txt
  • Screenshots: These screenshots have no corresponding images in /assets: #12 (Masonry), #13 (Masonry with Lightbox)
You can look at the official readme.txt

photo-gallery-portfolio/index.php 85% from 13 tests

The main file in "WordPress Photo Gallery - Portfolio, Image Gallery & Video Gallery" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("photo-gallery-portfolio.php" instead of "index.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected74,832 lines of code in 123 files:
LanguageFilesBlank linesComment linesLines of code
PHP827,5414,74832,193
JavaScript236,2252,44822,175
CSS131,8195009,296
JSON2008,245
SVG2002,885
Sass19038

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,337)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 389)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity71.77
▷ Minimum class complexity1.00
▷ Maximum class complexity1,337.00
Average method complexity6.49
▷ Minimum method complexity1.00
▷ Maximum method complexity389.00
Code structure
Namespaces6
Interfaces1
Traits2
Classes66
▷ Abstract classes11.52%
▷ Concrete classes6598.48%
▷ Final classes00.00%
Methods890
▷ Static methods31134.94%
▷ Public methods80990.90%
▷ Protected methods232.58%
▷ Private methods586.52%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants124
▷ Global constants32.42%
▷ Class constants12197.58%
▷ Public constants121100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
44 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
com/admin/assets/images/adamlabscolorpicker/delete.png3.07KB0.31KB▼ 89.97%
com/admin/assets/images/adamlabscolorpicker/save.png2.97KB0.31KB▼ 89.68%
com/admin/includes/gutenberg-blocks/assets/images/adamlabsgallerylogo.png6.12KB3.47KB▼ 43.21%
com/public/assets/images/adamlabsgallerybox_sprite.png1.33KB1.42KB0.00%
com/admin/assets/images/icon-not-registered.png1.10KB0.30KB▼ 73.03%