78% devexhub-gallery

Code Review | Devexhub Gallery

WordPress plugin Devexhub Gallery scored78%from 54 tests.

About plugin

  • Plugin page: devexhub-gallery
  • Plugin version: 1.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Nov 25, 2022
  • Latest release: Apr 13, 2023
  • Number of updates: 63
  • Update frequency: every 2.2 days
  • Top authors: devexhub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /910 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.66ms] Passed 4 tests

An overview of server-side resources used by Devexhub Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1035.92 ▼0.00
Dashboard /wp-admin3.40 ▲0.0945.50 ▼2.62
Posts /wp-admin/edit.php3.51 ▲0.1546.47 ▼1.06
Add New Post /wp-admin/post-new.php6.06 ▲0.1790.72 ▼6.93
Media Library /wp-admin/upload.php3.32 ▲0.0935.31 ▼0.01
Gallery Categories /wp-admin/edit-tags.php?taxonomy=dh_category&post_type=dh_gallery3.3232.55
Add New /wp-admin/post-new.php?post_type=dh_gallery3.4051.39
All Galleries /wp-admin/edit.php?post_type=dh_gallery3.3732.60

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
dh-gallery-plugin
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Devexhub Gallery: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲20013.56 ▼0.828.06 ▲6.2140.91 ▼1.89
Dashboard /wp-admin2,241 ▲504.89 ▼1.01108.77 ▲5.0942.78 ▼3.56
Posts /wp-admin/edit.php2,124 ▲352.01 ▲0.0140.97 ▼2.8735.96 ▲1.58
Add New Post /wp-admin/post-new.php1,544 ▲1023.28 ▲0.08611.09 ▼50.8159.27 ▲6.14
Media Library /wp-admin/upload.php1,420 ▲324.21 ▼0.0398.40 ▼3.1243.10 ▲0.62
Gallery Categories /wp-admin/edit-tags.php?taxonomy=dh_category&post_type=dh_gallery1,2972.1428.4327.67
Add New /wp-admin/post-new.php?post_type=dh_gallery1,7263.6368.4144.93
All Galleries /wp-admin/edit.php?post_type=dh_gallery1,0942.0028.6925.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • dh-gallery-plugin
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 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 0% from 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/devexhub-gallery/public/partials/devexhub-gallery-public-display.php
    • > /wp-content/plugins/devexhub-gallery/admin/partials/devexhub-gallery-admin-display.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/devexhub-gallery/includes/gallery_page_template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/devexhub-gallery/includes/class-devexhub-gallery-functions.php:13

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 88% 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 need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (assets/first.png), #2 (assets/second.png)
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt might help

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

The primary PHP file in "Devexhub Gallery" version 1.5 is used by WordPress to initiate all plugin functionality
75 characters long description:
This plugin allows you to create a responsive gallery page in the frontend.

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
Good job! No executable or dangerous file extensions detected495 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP15139585443
CSS302446
JavaScript24546

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity3.14
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/first.png9.71KB5.80KB▼ 40.26%
assets/second.png18.14KB8.33KB▼ 54.06%