72% gallery-photo-gallery

Code Review | Photo Gallery by Ays - Responsive Image Gallery

WordPress plugin Photo Gallery by Ays - Responsive Image Gallery scored72%from 54 tests.

About plugin

  • Plugin page: gallery-photo-gal...
  • Plugin version: 5.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 524
  • Update frequency: every 5.2 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /67,961 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.12MB] [CPU: ▲2.22ms] Passed 4 tests

An overview of server-side resources used by Photo Gallery by Ays - Responsive Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.56 ▲1.0945.97 ▲1.81
Dashboard /wp-admin4.45 ▲1.1058.86 ▼2.44
Posts /wp-admin/edit.php4.49 ▲1.1356.02 ▲7.39
Add New Post /wp-admin/post-new.php7.17 ▲1.2897.62 ▲2.11
Media Library /wp-admin/upload.php4.39 ▲1.1643.11 ▲7.54
Add new /wp-admin/admin.php?page=gallery-photo-gallery-add-new4.4264.29
PRO Features /wp-admin/admin.php?page=gallery-photo-gallery-pro-features4.4546.60
All Galleries /wp-admin/admin.php?page=gallery-photo-gallery4.4550.27
Our products /wp-admin/admin.php?page=gallery-photo-gallery-featured-plugins4.4458.37
How to use /wp-admin/admin.php?page=gallery-photo-gallery-dashboard4.4252.71
General Settings /wp-admin/admin.php?page=gallery-photo-gallery-settings4.5249.75
Categories /wp-admin/admin.php?page=gallery-photo-gallery-categories4.4564.66

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 174 new files
Database: 3 new tables, 10 new options
New tables
wp_ays_gallery_settings
wp_ays_gallery
wp_ays_gallery_categories
New WordPress options
ays_gpg_sale_btn
ays_gallery_db_version
ays_gpg_banner_time
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
ays_gpg_sale_btn_for_two_months
widget_recent-posts

Browser metrics Passed 4 tests

Photo Gallery by Ays - Responsive Image Gallery: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲20813.41 ▼0.937.64 ▲6.0027.06 ▼16.87
Dashboard /wp-admin2,239 ▲645.62 ▼0.0795.48 ▼18.3587.91 ▲37.87
Posts /wp-admin/edit.php2,159 ▲561.99 ▼0.0240.20 ▲0.3641.96 ▲5.31
Add New Post /wp-admin/post-new.php6,239 ▲4,71319.03 ▼3.84884.94 ▲234.6434.92 ▼27.36
Media Library /wp-admin/upload.php1,453 ▲504.18 ▼0.08100.69 ▲2.5682.44 ▲40.29
Add new /wp-admin/admin.php?page=gallery-photo-gallery-add-new6,6538.02333.03261.25
PRO Features /wp-admin/admin.php?page=gallery-photo-gallery-pro-features2,1515.61103.82146.94
All Galleries /wp-admin/admin.php?page=gallery-photo-gallery2,28711.47324.75165.99
Our products /wp-admin/admin.php?page=gallery-photo-gallery-featured-plugins1,7455.6574.85152.29
How to use /wp-admin/admin.php?page=gallery-photo-gallery-dashboard1,6175.5370.19145.12
General Settings /wp-admin/admin.php?page=gallery-photo-gallery-settings2,3385.8274.83121.42
Categories /wp-admin/admin.php?page=gallery-photo-gallery-categories1,7435.6376.31114.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • ays_gpg_banner_time
    • widget_recent-comments
    • ays_gpg_sale_btn
    • ays_gpg_sale_btn_for_two_months
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gallery-photo-gallery/public/partials/gallery-photo-gallery-public-display.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gallery-photo-gallery/admin/partials/features/gallery-photo-gallery-featured-plugins.php:7
    • > PHP Warning
      Use of undefined constant AYS_GPG_ADMIN_URL - assumed 'AYS_GPG_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/gallery-photo-gallery/admin/partials/categories/gallery-photo-gallery-categories-display.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/gallery-photo-gallery/includes/lists/class-gallery-photo-gallery-categories-list-table.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gallery-photo-gallery/admin/partials/features/gallery-photo-gallery-features-display.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gallery-photo-gallery/admin/partials/categories/gallery-photo-gallery-categories-display.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/gallery-photo-gallery/admin/partials/actions/gallery-photo-gallery-admin-actions.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gallery-photo-gallery/admin/partials/settings/gallery-photo-gallery-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Gallery_Settings_Actions' not found in wp-content/plugins/gallery-photo-gallery/admin/partials/categories/actions/gallery-photo-gallery-categories-actions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/gallery-photo-gallery/includes/lists/class-gallery-photo-gallery-list-table.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Gallery_Photo_Gallery_Admin' not found in wp-content/plugins/gallery-photo-gallery/admin/partials/gallery-photo-gallery-admin-display.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=gallery-photo-gallery
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=gallery-photo-gallery 314 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: free gallery, gallery, photo gallery, responsive gallery, image gallery...

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

This is the main PHP file of "Photo Gallery by Ays - Responsive Image Gallery" version 5.4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
118 characters long description:
If you want to be different and represent your photos in a cool way, then our Photo Gallery plugin is perfect for you.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin18,310 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,2011,2318,781
CSS127298453,778
JavaScript162541692,703
PO File29191,3002,373
SVG2330675

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 294)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity63.80
▷ Minimum class complexity1.00
▷ Maximum class complexity412.00
Average method complexity6.41
▷ Minimum method complexity1.00
▷ Maximum method complexity294.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods174
▷ Static methods3117.82%
▷ Public methods16091.95%
▷ Protected methods42.30%
▷ Private methods105.75%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.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
71 PNG files occupy 1.23MB with 0.43MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/view_22.png0.35KB0.14KB▼ 58.82%
admin/images/remove-normal.png0.43KB0.43KB0.00%
admin/images/icons/survey-128x128.png11.02KB4.53KB▼ 58.87%
admin/images/features/pro4-compressor.png67.27KB71.02KB0.00%
admin/images/view_2.png0.31KB0.14KB▼ 56.21%