84% gallery-class

Code Review | Gallery Class

WordPress plugin Gallery Class scored84%from 54 tests.

About plugin

  • Plugin page: gallery-class
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Dec 1, 2016
  • Latest release: Dec 7, 2016
  • Number of updates: 10
  • Update frequency: every 1.3 days
  • Top authors: santerref (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,008 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.76ms] Passed 4 tests

This is a short check of server-side resources used by Gallery Class
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.73 ▼3.67
Dashboard /wp-admin3.32 ▲0.0252.05 ▲3.48
Posts /wp-admin/edit.php3.37 ▲0.0148.29 ▲0.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.74 ▼3.32
Media Library /wp-admin/upload.php3.24 ▲0.0235.43 ▼0.86

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Gallery Class
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.021.73 ▼0.1646.99 ▲5.73
Dashboard /wp-admin2,195 ▲155.62 ▼0.0797.09 ▲3.0338.82 ▼4.19
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0241.16 ▲3.5035.12 ▼3.59
Add New Post /wp-admin/post-new.php1,535 ▲923.58 ▼0.03660.46 ▼35.2459.57 ▲7.11
Media Library /wp-admin/upload.php1,394 ▼64.22 ▲0.1298.04 ▼31.1041.62 ▼10.84

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-class/gallery-class.php:88

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

gallery-class/gallery-class.php Passed 13 tests

The main PHP file in "Gallery Class" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
74 characters long description:
Add a new setting in the media gallery settings to set a custom CSS class.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin74 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP123962
JavaScript11012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods571.43%
▷ Protected methods228.57%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin