78% we-gallery

Code Review | weGallery

WordPress plugin weGallery scored78%from 54 tests.

About plugin

  • Plugin page: we-gallery
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.4
  • WordPress version: 6.3.1
  • First release: May 15, 2014
  • Latest release: Mar 14, 2020
  • Number of updates: 8
  • Update frequency: every 266.1 days
  • Top authors: tareq1988 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /3,223 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.11MB] [CPU: ▼8.09ms] Passed 4 tests

Analyzing server-side resources used by weGallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0841.86 ▼3.55
Dashboard /wp-admin3.47 ▲0.0954.72 ▼10.28
Posts /wp-admin/edit.php3.59 ▲0.1949.40 ▼1.81
Add New Post /wp-admin/post-new.php6.08 ▲0.1590.45 ▼16.70
Media Library /wp-admin/upload.php3.40 ▲0.1339.46 ▲3.18
Add New /wp-admin/post-new.php?post_type=we_gallery3.4949.40
All Galleries /wp-admin/edit.php?post_type=we_gallery3.4439.69

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by weGallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲14713.94 ▼0.6010.49 ▲8.5142.06 ▼9.95
Dashboard /wp-admin2,222 ▲425.65 ▲0.0698.80 ▲1.8542.61 ▲3.18
Posts /wp-admin/edit.php2,127 ▲302.00 ▼0.0236.58 ▼3.8935.14 ▼4.30
Add New Post /wp-admin/post-new.php1,749 ▲22123.67 ▲0.75680.07 ▼6.3557.15 ▼5.11
Media Library /wp-admin/upload.php1,430 ▲304.25 ▲0.0795.42 ▼8.9346.06 ▼0.74
Add New /wp-admin/post-new.php?post_type=we_gallery1,5763.6174.5332.67
All Galleries /wp-admin/edit.php?post_type=we_gallery1,1041.9732.9330.88

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/we-gallery/templates/gallery-grid.php
    • > /wp-content/plugins/we-gallery/templates/gallery-slider.php
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/we-gallery/includes/views/image-details-popup.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/we-gallery/templates/gallery-grid.php on line 14
    • > PHP Notice
      Undefined variable: direction in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 55
    • > PHP Notice
      Undefined variable: gallery_images in wp-content/plugins/we-gallery/templates/gallery-grid.php on line 14
    • > PHP Notice
      Undefined variable: gallery_images in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 14
    • > PHP Notice
      Undefined variable: animation in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 53
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/we-gallery/templates/gallery-grid.php on line 12
    • > PHP Notice
      Undefined variable: nav in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 54
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/we-gallery/templates/gallery-slider.php on line 52

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

we-gallery/gallery.php 92% from 13 tests

The main PHP script in "weGallery" version 1.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("we-gallery.php" instead of "gallery.php")

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected2,665 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71811711,036
LESS39128733
PHP8218308713
CSS200164
SVG10019

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity18.67
▷ Minimum class complexity12.00
▷ Maximum class complexity28.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2890.32%
▷ Protected methods00.00%
▷ Private methods39.68%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/bg_play_pause.png1.51KB0.52KB▼ 65.52%