83% mhr-gallery

Code Review | Mhr Gallery

WordPress plugin Mhr Gallery scored83%from 54 tests.

About plugin

  • Plugin page: mhr-gallery
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Mar 13, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 50
  • Update frequency: every 24.9 days
  • Top authors: mdhadid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /868 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
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.51ms] Passed 4 tests

This is a short check of server-side resources used by Mhr Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.1348.80 ▲3.45
Dashboard /wp-admin3.71 ▲0.1555.36 ▼3.64
Posts /wp-admin/edit.php3.77 ▲0.0956.84 ▲6.19
Add New Post /wp-admin/post-new.php6.25 ▲0.1188.31 ▼10.48
Media Library /wp-admin/upload.php3.58 ▲0.0942.98 ▲4.62
PhotoGallery /wp-admin/edit.php?post_type=photogallery3.6239.15
VideoGallery /wp-admin/edit.php?post_type=videogallery3.6240.26
Add New /wp-admin/post-new.php?post_type=videogallery3.6149.84
Add New /wp-admin/post-new.php?post_type=photogallery3.7051.97

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Mhr Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,256 ▲51014.14 ▼0.2618.91 ▲16.6147.34 ▲5.08
Dashboard /wp-admin2,253 ▲735.67 ▼0.0291.21 ▼11.9442.27 ▼1.14
Posts /wp-admin/edit.php2,158 ▲582.03 ▲0.0338.15 ▲0.2934.54 ▼1.91
Add New Post /wp-admin/post-new.php1,576 ▲4323.06 ▼0.18653.77 ▼34.3062.00 ▼1.32
Media Library /wp-admin/upload.php1,449 ▲554.25 ▲0.0199.70 ▼2.5441.40 ▼7.02
PhotoGallery /wp-admin/edit.php?post_type=photogallery1,1222.0030.5730.66
VideoGallery /wp-admin/edit.php?post_type=videogallery1,1221.9934.8429.31
Add New /wp-admin/post-new.php?post_type=videogallery1,4392.4849.1552.69
Add New /wp-admin/post-new.php?post_type=photogallery2,2197.54170.7564.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mhr-gallery/includes/class-mhr-gallery.php:251

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2 in mhr-gallery/assets to your readme.txt
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

mhr-gallery/mhr-gallery.php 92% from 13 tests

The main PHP file in "Mhr Gallery" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected27,876 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS616,10218,757
JavaScript53,531598,887
PHP12146475211
PO File12221

PHP code Passed 2 tests

Analyzing 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.08
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin