99% cs-gallery

Code Review | CS Gallery

WordPress plugin CS Gallery scored 99% from 54 tests.

About plugin

  • Plugin page: cs-gallery
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2
  • WordPress version: 5.8.1
  • First release: Dec 18, 2018
  • Latest release: May 10, 2019
  • Number of updates: 9
  • Update frequency: every 16.0 days
  • Top authors: connysparr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 391 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼151.33ms] Passed 4 tests

An overview of server-side resources used by CS Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1434.47 ▲12.84
Dashboard /wp-admin3.09 ▲0.0340.75 ▼5.97
Posts /wp-admin/edit.php3.14 ▲0.0342.14 ▼2.06
Add New Post /wp-admin/post-new.php5.45 ▲0.0186.68 ▼595.39
Media Library /wp-admin/upload.php3.03 ▲0.0333.05 ▼1.89

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: 3 new tables, no new options
New tables
wp_csgalleryimages
wp_csgallerycategories
wp_csgalleryplaces

Browser metrics Passed 4 tests

An overview of browser requirements for CS Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.24 ▲0.659.58 ▲0.4044.83 ▼1.71
Dashboard /wp-admin2,970 ▲396.01 ▼0.18143.21 ▼0.31106.34 ▼18.16
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0066.00 ▼21.9177.32 ▼18.02
Add New Post /wp-admin/post-new.php1,498 ▼18518.83 ▲0.58392.91 ▼42.62110.83 ▼6.23
Media Library /wp-admin/upload.php1,810 ▲35.05 ▲0.04152.20 ▼33.79117.00 ▲1.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (CS Gallery), #2 (Popup dialog with responsive image size and description. Click the image for fullsize scrollable image.), #3 (Logged in Administrator or Editor.), #4 (Upload files and edit descriptions.), #5 (Add new, remove and edit Categories.)
You can take inspiration from this readme.txt

cs-gallery/csgallery.php 92% from 13 tests

The main PHP file in "CS Gallery" 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: Name the main plugin file the same as the plugin slug ("cs-gallery.php" instead of "csgallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,210 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP474641,291
JavaScript13231805
CSS1317114

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity119.00
▷ Minimum class complexity2.00
▷ Maximum class complexity236.00
Average method complexity9.74
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods1451.85%
▷ Public methods2177.78%
▷ Protected methods00.00%
▷ Private methods622.22%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/volume1600.png31.14KB22.97KB▼ 26.24%
images/film256.png9.35KB4.08KB▼ 56.35%
images/volume200.png6.70KB3.38KB▼ 49.49%
images/sound256.png19.08KB12.89KB▼ 32.45%
images/dokument256.png2.17KB1.20KB▼ 44.79%