72% ald-image-gallery

Code Review | ALD Image Gallery

WordPress plugin ALD Image Gallery scored72%from 54 tests.

About plugin

  • Plugin page: ald-image-gallery
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-5.6
  • WordPress version: 6.3.1
  • First release: Feb 27, 2016
  • Latest release: Jan 2, 2021
  • Number of updates: 49
  • Update frequency: every 36.2 days
  • Top authors: hossainawlad (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,468 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.56ms] Passed 4 tests

An overview of server-side resources used by ALD Image Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0842.17 ▲1.01
Dashboard /wp-admin3.41 ▲0.1151.99 ▲3.96
Posts /wp-admin/edit.php3.52 ▲0.1653.56 ▲3.37
Add New Post /wp-admin/post-new.php5.99 ▲0.1087.91 ▼6.75
Media Library /wp-admin/upload.php3.31 ▲0.0834.45 ▲0.12
Add New Gallery /wp-admin/admin.php?page=add-new-ald-gallery3.3134.90
ALD Gallery /wp-admin/admin.php?page=ald-gallery3.3037.27
/wp-admin/admin.php?page=ald-gallery-images3.2833.48

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for ALD Image Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,160 ▲41415.46 ▲1.067.43 ▲5.7538.95 ▼3.22
Dashboard /wp-admin2,452 ▲2646.64 ▲0.74136.36 ▲37.45100.60 ▲58.82
Posts /wp-admin/edit.php2,358 ▲2693.71 ▲1.7252.62 ▲12.9056.96 ▲20.83
Add New Post /wp-admin/post-new.php1,615 ▲10117.55 ▼0.18654.08 ▼0.9637.12 ▼14.88
Media Library /wp-admin/upload.php1,500 ▲1094.41 ▲0.2390.23 ▼7.4081.90 ▲36.48
Add New Gallery /wp-admin/admin.php?page=add-new-ald-gallery1,0923.3040.9570.74
ALD Gallery /wp-admin/admin.php?page=ald-gallery1,2123.3041.6075.42
/wp-admin/admin.php?page=ald-gallery-images1,1563.3041.4071.06

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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 errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=ald-gallery-images
    • > Notice in wp-content/plugins/ald-image-gallery/ald-gallery.php+175
    Undefined index: gallery

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ald-image-gallery/js/img_show_js.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/ald-image-gallery/ald-gallery.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ald-image-gallery/inc/add-new-gallery.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ald-image-gallery/inc/shortcode.php:44
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/ald-image-gallery/ald-gallery.php on line 28
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ald-image-gallery/ald-gallery.php on line 28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/ald-image-gallery/inc/gallery-list-class.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ald-image-gallery/inc/image-add.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ald-image-gallery/inc/image-delete.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ald-image-gallery/inc/delete-gallery.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

ald-image-gallery/ald-gallery.php 85% from 13 tests

The main PHP file in "ALD Image Gallery" ver. 2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 259 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ald-image-gallery.php" instead of "ald-gallery.php")

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
Good job! No executable or dangerous file extensions detected2,853 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42134141,181
PHP94479557
Sass1411734502
CSS218112481
JSON20069
SVG20157
Markdown1206

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods571.43%
▷ Protected methods00.00%
▷ Private methods228.57%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin