68% my-album-gallery

Code Review | My Album Gallery

WordPress plugin My Album Gallery scored68%from 54 tests.

About plugin

  • Plugin page: my-album-gallery
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6.2
  • WordPress version: 6.3.1
  • First release: Feb 23, 2021
  • Latest release: Aug 16, 2023
  • Number of updates: 20
  • Update frequency: every 45.2 days
  • Top authors: ruhul080 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,030 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.07MB] [CPU: ▼3.91ms] Passed 4 tests

A check of server-side resources used by My Album Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.46 ▲1.0033.45 ▼8.77
Dashboard /wp-admin4.43 ▲1.0859.69 ▼5.29
Posts /wp-admin/edit.php4.46 ▲1.1064.32 ▲12.73
Add New Post /wp-admin/post-new.php7.00 ▲1.1192.62 ▼13.79
Media Library /wp-admin/upload.php4.43 ▲1.2047.04 ▲12.20
Album Category /wp-admin/edit-tags.php?taxonomy=mygallery_category&post_type=mygallery4.4345.47
All Album /wp-admin/edit.php?post_type=mygallery4.4346.74
Add New Album /wp-admin/post-new.php?post_type=mygallery4.4962.31
Album options /wp-admin/admin.php?page=algal_admin_page4.4344.63

Server storage [IO: ▲1.84MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • You have illegally modified 1 file (4.00KB) outside of "wp-content/plugins/my-album-gallery/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 202 new files
Database: 2 new tables, 6 new options
New tables
wp_myg_comments
wp_myg_likes
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for My Album Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲19213.89 ▼0.4911.79 ▲10.0041.19 ▼2.47
Dashboard /wp-admin2,269 ▲694.83 ▼1.04110.07 ▲7.1340.76 ▼2.97
Posts /wp-admin/edit.php2,148 ▲482.06 ▲0.0136.58 ▼0.2034.38 ▼4.66
Add New Post /wp-admin/post-new.php1,566 ▲3317.68 ▼5.60711.33 ▲95.7848.31 ▼3.21
Media Library /wp-admin/upload.php1,448 ▲514.28 ▲0.00106.65 ▲4.3246.17 ▲0.65
Album Category /wp-admin/edit-tags.php?taxonomy=mygallery_category&post_type=mygallery1,3222.1432.0434.07
All Album /wp-admin/edit.php?post_type=mygallery1,1802.0352.3741.05
Add New Album /wp-admin/post-new.php?post_type=mygallery2,7037.83172.1971.71
Album options /wp-admin/admin.php?page=algal_admin_page2,9284.0197.6582.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_myg_likes
    • wp_myg_comments
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/my-album-gallery/controllers/admin/metaboxes/style.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/my-album-gallery/controllers/functions.php:42
    • > PHP Fatal error
      require_once(): Failed opening required 'MYG_PATHcontrollers/constants.php' (include_path='.:/usr/share/php') in wp-content/plugins/my-album-gallery/controllers/includes.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/my-album-gallery/mygallery-single.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/my-album-gallery/controllers/admin/metaboxes/mygallery_options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/my-album-gallery/mygallery-archive.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/my-album-gallery/my-album-gallery.php:13
    • > PHP Warning
      Use of undefined constant MYG_PATH - assumed 'MYG_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-album-gallery/controllers/includes.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-album-gallery/admin/class-mygallery-options.php:8
    • > PHP Warning
      require_once(MYG_PATHcontrollers/constants.php): failed to open stream: No such file or directory in wp-content/plugins/my-album-gallery/controllers/includes.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === my-album-gallery === )
You can take inspiration from this readme.txt

my-album-gallery/my-album-gallery.php 92% from 13 tests

The main PHP script in "My Album Gallery" version 1.0.4 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 325 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin23,807 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript251,6011,23613,058
PHP271,0691,9635,994
CSS124432784,062
PO File4276352659
SVG20034

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity47.26
▷ Minimum class complexity1.00
▷ Maximum class complexity380.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods256
▷ Static methods83.12%
▷ Public methods24595.70%
▷ Protected methods00.00%
▷ Private methods114.30%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16100.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
110 PNG files occupy 0.44MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/g8Duj.png2.09KB1.67KB▼ 20.00%
images/bg/bg45.png2.55KB1.38KB▼ 45.79%
images/bg/bg15.png2.83KB0.13KB▼ 95.51%
admin/js/FancyCheckbox/images/iphone.png6.26KB2.56KB▼ 59.13%
images/bg/bg44.png2.54KB1.44KB▼ 43.37%