84% infinite-masonry-gallery

Code Review | Infinite Masonry Gallery

WordPress plugin Infinite Masonry Gallery scored 84% from 54 tests.

About plugin

  • Plugin page: infinite-masonry-...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.2.2
  • WordPress version: 5.9.2
  • First release: Jun 16, 2016
  • Latest release: Jul 5, 2019
  • Number of updates: 12
  • Update frequency: every 92.8 days
  • Top authors: denis_golovin (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active / 7,551 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼293.21ms] Passed 4 tests

Analyzing server-side resources used by Infinite Masonry Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.2956.03 ▲5.98
Dashboard /wp-admin3.68 ▲0.2736.31 ▲2.67
Posts /wp-admin/edit.php3.91 ▲0.2740.33 ▲3.34
Add New Post /wp-admin/post-new.php7.24 ▲0.2499.26 ▼1,181.05
Media Library /wp-admin/upload.php3.63 ▲0.3326.89 ▲2.19
Settings /wp-admin/edit.php?post_type=cc_img_gallery&page=options3.6328.44
Add new gallery /wp-admin/post-new.php?post_type=cc_img_gallery3.8646.35
Support /wp-admin/edit.php?post_type=cc_img_gallery&page=support3.6328.25
All galleries /wp-admin/edit.php?post_type=cc_img_gallery3.7134.40

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 2 new options
New WordPress options
cc_img_id
cc_img_curr_version

Browser metrics Passed 4 tests

A check of browser resources used by Infinite Masonry Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,844 ▲8715.85 ▲0.306.15 ▼0.382.59 ▲0.15
Dashboard /wp-admin2,939 ▲786.17 ▲0.02114.48 ▼18.60156.88 ▼9.61
Posts /wp-admin/edit.php2,702 ▲113.25 ▲0.0363.08 ▼0.91144.40 ▲1.10
Add New Post /wp-admin/post-new.php1,789 ▲3116.99 ▼5.07421.58 ▼69.98159.42 ▲6.51
Media Library /wp-admin/upload.php1,742 ▲445.51 ▲0.05140.59 ▼0.38191.79 ▲5.52
Settings /wp-admin/edit.php?post_type=cc_img_gallery&page=options1,2914.3070.61111.12
Add new gallery /wp-admin/post-new.php?post_type=cc_img_gallery2,2847.62147.28133.69
Support /wp-admin/edit.php?post_type=cc_img_gallery&page=support1,2654.2865.6999.54
All galleries /wp-admin/edit.php?post_type=cc_img_gallery1,6315.0874.10112.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • cc_img_id
    • cc_img_curr_version

Smoke tests 75% 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)
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/infinite-masonry-gallery/admin/shortcode.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === infinite-masonry-gallery === )
You can take inspiration from this readme.txt

infinite-masonry-gallery/infinite-masonry-gallery.php Passed 13 tests

The main PHP script in "Infinite Masonry Gallery" version 1.0.3 is automatically included on every request by WordPress
63 characters long description:
Dispaly infinitely scrollable galleries in a beautiful masonry.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,405 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP217248861,256
JavaScript50126148
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.56
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods81
▷ Static methods1417.28%
▷ Public methods7693.83%
▷ Protected methods00.00%
▷ Private methods56.17%
Functions6
▷ Named functions6100.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
9 PNG files occupy 0.40MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/denis_eyes.png80.51KB79.31KB▼ 1.49%
public/placeholder.png6.84KB1.92KB▼ 72.00%
assets/paypal.png3.07KB2.98KB▼ 3.08%
assets/watermark_OUT.png11.64KB5.77KB▼ 50.42%
assets/denis.png277.56KB100.13KB▼ 63.93%