83% gallery-one

Code Review | Gallery One

WordPress plugin Gallery One scored 83% from 54 tests.

About plugin

  • Plugin page: gallery-one
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.5
  • WordPress version: 6.3.1
  • First release: May 24, 2016
  • Latest release: May 28, 2016
  • Number of updates: 14
  • Update frequency: every 0.4 days
  • Top authors: shrimp2t (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 2,546 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.16MB] [CPU: ▼18.37ms] Passed 4 tests

Server-side resources used by Gallery One
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.91 ▼0.90
Dashboard /wp-admin3.21 ▼0.1030.38 ▼19.39
Posts /wp-admin/edit.php3.28 ▼0.0732.90 ▼16.50
Add New Post /wp-admin/post-new.php5.49 ▼0.4071.76 ▼31.03
Media Library /wp-admin/upload.php3.18 ▼0.0527.11 ▼6.57
Add New /wp-admin/post-new.php?post_type=go_album3.4039.05
All Galleries /wp-admin/edit.php?post_type=go_album3.2632.32

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

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

Browser metrics Passed 4 tests

Gallery One: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲25714.69 ▲0.391.83 ▲0.1846.90 ▲7.26
Dashboard /wp-admin2,380 ▲1926.50 ▲1.66116.22 ▲10.5436.56 ▼6.11
Posts /wp-admin/edit.php2,283 ▲1943.50 ▲1.5044.66 ▲9.7829.91 ▼3.91
Add New Post /wp-admin/post-new.php1,543 ▲2317.82 ▼5.36644.31 ▼39.6837.57 ▼20.03
Media Library /wp-admin/upload.php1,419 ▲344.11 ▼0.1278.43 ▼24.1539.51 ▼5.24
Add New /wp-admin/post-new.php?post_type=go_album2,0474.0371.1631.06
All Galleries /wp-admin/edit.php?post_type=go_album1,2863.4243.2327.52

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=go_album
    • > Warning in wp-admin/includes/file.php+152
    opendir(wp-content/themes/twentytwentyone/gallery-one/): failed to open dir: No such file or directory

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
  • Screenshots: A description for screenshot #9 is missing in gallery-one/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === gallery-one === )
The official readme.txt is a good inspiration

gallery-one/init.php 92% from 13 tests

The main PHP file in "Gallery One" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gallery-one.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected11,695 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript209153994,300
Sass17551882,802
CSS151591032,335
PHP16223861,457
HTML1110349
JSON100226
Markdown1410117
SVG4350109

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity23.80
▷ Minimum class complexity5.00
▷ Maximum class complexity34.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods42
▷ Static methods511.90%
▷ Public methods3992.86%
▷ Protected methods37.14%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lightgallery/img/vimeo-play.png5.30KB1.56KB▼ 70.65%
assets/lightslider/img/controls.png2.19KB0.95KB▼ 56.49%
assets/lightgallery/img/video-play.png4.42KB1.05KB▼ 76.27%
assets/lightgallery/img/youtube-play.png5.06KB2.37KB▼ 53.04%