83% mosaic-gallery-by-widgetic

Code Review | Mosaic Gallery

WordPress plugin Mosaic Gallery scored83%from 54 tests.

About plugin

  • Plugin page: mosaic-gallery-by...
  • Plugin version: 1.0.40
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0
  • WordPress version: 6.3.1
  • First release: May 3, 2022
  • Latest release: Jul 4, 2022
  • Number of updates: 36
  • Update frequency: every 1.7 days
  • Top authors: widgetic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /890 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▲283.84ms] 75% from 4 tests

An overview of server-side resources used by Mosaic Gallery
The following require your attention
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 283.84ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.27304.24 ▲261.20
Dashboard /wp-admin3.57 ▲0.22384.05 ▲320.98
Posts /wp-admin/edit.php3.62 ▲0.26350.71 ▲308.38
Add New Post /wp-admin/post-new.php6.15 ▲0.27343.56 ▲244.79
Media Library /wp-admin/upload.php3.49 ▲0.26581.54 ▲551.17

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widgetic/secret
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Mosaic Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,006 ▲2,24528.79 ▲14.1793.72 ▲92.0128.12 ▼16.32
Dashboard /wp-admin3,579 ▲1,40212.57 ▲6.95213.07 ▲115.2172.93 ▲31.19
Posts /wp-admin/edit.php3,180 ▲1,08010.44 ▲8.42164.30 ▲125.9037.50 ▲0.51
Add New Post /wp-admin/post-new.php2,706 ▲1,17130.32 ▲12.30792.40 ▲175.1065.57 ▲7.30
Media Library /wp-admin/upload.php1,795 ▲39812.07 ▲7.89237.52 ▲145.8444.33 ▲2.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widgetic/secret

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mosaic-gallery-by-widgetic/dashboard.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mosaic-gallery-by-widgetic/block.php:110
    • > PHP Notice
      Undefined variable: blockPath in wp-content/plugins/mosaic-gallery-by-widgetic/block.php on line 29
    • > PHP Notice
      Undefined variable: widgetMeta in wp-content/plugins/mosaic-gallery-by-widgetic/block.php on line 29
    • > PHP Notice
      Undefined variable: blockWidgetId in wp-content/plugins/mosaic-gallery-by-widgetic/block.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 34 tag instead of maximum 10
You can look at the official readme.txt

mosaic-gallery-by-widgetic/index.php 92% from 13 tests

The principal PHP file in "Mosaic Gallery" v. 1.0.40 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mosaic-gallery-by-widgetic.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,547 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JSON5001,919
CSS37458432
PHP43055170
SVG10024
JavaScript2012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.72MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/widgetic_icon.png1.94KB2.03KB0.00%
assets/banner-1544x500.png32.38KB10.29KB▼ 68.23%
assets/custom_skin.png8.56KB3.23KB▼ 62.32%
assets/screenshot-1.png370.29KB404.96KB0.00%
assets/icon-128x128.png2.40KB0.89KB▼ 63.00%