71% ai-responsive-gallery-album

Code Review | AI Responsive Gallery Album

WordPress plugin AI Responsive Gallery Album scored71%from 54 tests.

About plugin

  • Plugin page: ai-responsive-gal...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 19, 2013
  • Latest release: Jul 12, 2020
  • Number of updates: 24
  • Update frequency: every 105.0 days
  • Top authors: augustinfotech (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

200+ active /29,994 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.40ms] Passed 4 tests

This is a short check of server-side resources used by AI Responsive Gallery Album
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0539.65 ▲1.21
Dashboard /wp-admin3.37 ▲0.0644.06 ▼6.26
Posts /wp-admin/edit.php3.42 ▲0.0649.85 ▲1.47
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.08 ▼14.01
Media Library /wp-admin/upload.php3.29 ▲0.0635.84 ▲4.41
Add New Album /wp-admin/admin.php?page=ai_album3.3531.07
Add New Photos /wp-admin/admin.php?page=ai_new_photos3.3530.34
Photos /wp-admin/admin.php?page=ai_listing_photos3.3130.02
AI Gallery /wp-admin/admin.php?page=ai_gallery3.3532.18

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 54 new files
Database: 2 new tables, 6 new options
New tables
wp_ai_photos
wp_ai_album
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AI Responsive Gallery Album
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8013.24 ▼1.071.71 ▲0.0839.86 ▼2.58
Dashboard /wp-admin2,232 ▲444.87 ▼0.02108.55 ▲2.1243.64 ▼0.84
Posts /wp-admin/edit.php2,118 ▲262.06 ▲0.0141.05 ▼1.3334.93 ▼5.07
Add New Post /wp-admin/post-new.php1,559 ▲1618.41 ▲0.06644.37 ▼12.6954.78 ▼12.89
Media Library /wp-admin/upload.php1,411 ▲294.19 ▼0.0392.09 ▼8.4542.29 ▼1.44
Add New Album /wp-admin/admin.php?page=ai_album9011.9625.2729.08
Add New Photos /wp-admin/admin.php?page=ai_new_photos8851.7225.4822.08
Photos /wp-admin/admin.php?page=ai_listing_photos9282.2730.4926.28
AI Gallery /wp-admin/admin.php?page=ai_gallery9371.9531.0028.20

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
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ai_album
    • > Notice in wp-content/plugins/ai-responsive-gallery-album/newalbum.php+304
    Undefined variable: ai_edit_res
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ai_listing_photos
    • > Notice in wp-content/plugins/ai-responsive-gallery-album/photolist.php+195
    Trying to access array offset on value of type null
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ai_new_photos
    • > Notice in wp-content/plugins/ai-responsive-gallery-album/newphoto.php+592
    Undefined variable: ai_photo_res
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ai_listing_photos
    • > Notice in wp-content/plugins/ai-responsive-gallery-album/photolist.php+415
    Undefined index: album_id
    • > GET request to /wp-admin/admin.php?page=ai_listing_photos
    • > Notice in wp-content/plugins/ai-responsive-gallery-album/photolist.php+195
    Undefined offset: 0

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_verify_nonce() in wp-content/plugins/ai-responsive-gallery-album/newalbum.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_verify_nonce() in wp-content/plugins/ai-responsive-gallery-album/newphoto.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ai-responsive-gallery-album/ai-gallery.php:21
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/ai-responsive-gallery-album/newalbum.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/ai-responsive-gallery-album/css/wp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/ai-responsive-gallery-album/css/wp-trackback.php on line 12
    • > PHP Warning
      require_once(wp-content/plugins/ai-responsive-gallery-album/css/wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/ai-responsive-gallery-album/css/wp-trackback.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ai-responsive-gallery-album/album-shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/ai-responsive-gallery-album/albumlist.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/ai-responsive-gallery-album/newphoto.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/ai-responsive-gallery-album/photolist.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=ai_album
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).validate is not a function" "TypeError: jQuery(...).validate is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=ai_album:151:25)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ai_new_photos
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).validate is not a function
    • > GET request to /wp-admin/admin.php?page=ai_new_photos
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).validate is not a function" "TypeError: jQuery(...).validate is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=ai_new_photos:154:25)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Album Listing.), #2 (Gallery Listing.), #3 (Add New Album.), #4 (Add New Gallery.), #5 (Dragand Drop Album.), #6 (Dragand Drop Gallery.), #7 (Edit Album.), #8 (Edit Gallery.), #9 (Shortcode Put In Page Or Post Or Template File.), #10 (Front End : Album Display.), #11 (Front End : Selected Album Open.), #12 (Front End : Selected Image Open In Colorbox.), #13 (Micro Image Gallery)
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

ai-responsive-gallery-album/ai-gallery.php 85% from 13 tests

The main PHP file in "AI Responsive Gallery Album" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ai-responsive-gallery-album.php" instead of "ai-gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected3,010 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61631311,395
PHP79781141,304
CSS325819311

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
29 PNG files occupy 3.04MB with 1.60MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/man_gal.png0.88KB1.06KB0.00%
screenshot-6.png218.43KB54.33KB▼ 75.13%
images/bullet-red.png1.50KB0.80KB▼ 46.49%
screenshot-7.png118.91KB33.25KB▼ 72.04%
screenshot-3.png58.32KB18.04KB▼ 69.07%