90% image-gallery-custom-post-type

Code Review | Image Gallery Custom Post Type

WordPress plugin Image Gallery Custom Post Type scored90%from 54 tests.

About plugin

  • Plugin page: image-gallery-cus...
  • Plugin version: 2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.1
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: May 29, 2019
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: nziniwal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,029 total downloads

Benchmarks

Plugin footprint 83% from 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: ▼3.93ms] Passed 4 tests

An overview of server-side resources used by Image Gallery Custom Post Type
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.30 ▼1.67
Dashboard /wp-admin3.34 ▲0.0447.66 ▲1.72
Posts /wp-admin/edit.php3.39 ▲0.0346.20 ▼4.57
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.37 ▼11.21
Media Library /wp-admin/upload.php3.26 ▲0.0337.18 ▲4.76
All item /wp-admin/edit.php?post_type=gallerylist3.3037.07
Add New /wp-admin/post-new.php?post_type=gallerylist3.4050.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 56 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Image Gallery Custom Post Type
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.63 ▼0.743.27 ▲1.4650.12 ▲9.57
Dashboard /wp-admin2,236 ▲544.85 ▼0.09111.23 ▲7.5543.18 ▼3.86
Posts /wp-admin/edit.php2,116 ▲271.98 ▼0.0533.23 ▼9.7931.91 ▼3.73
Add New Post /wp-admin/post-new.php1,537 ▲2317.45 ▲0.07611.56 ▼21.6250.71 ▼7.05
Media Library /wp-admin/upload.php1,415 ▲274.26 ▲0.0995.49 ▼2.7042.32 ▼4.14
All item /wp-admin/edit.php?post_type=gallerylist1,1312.0035.5033.85
Add New /wp-admin/post-new.php?post_type=gallerylist2,7057.82179.5576.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: gallery, featured gallery, show gallery, image gallery, post type featured image...

image-gallery-custom-post-type/gallery.php 92% from 13 tests

"Image Gallery Custom Post Type" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("image-gallery-custom-post-type.php" instead of "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
Everything looks great! No dangerous files found in this plugin10,647 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS418249,163
SVG2001,300
PHP21833182
JavaScript1052

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin