83% simple-masonry-layout

Code Review | Simple Masonry Layout

WordPress plugin Simple Masonry Layout scored83%from 54 tests.

About plugin

  • Plugin page: simple-masonry-la...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 22, 2016
  • Latest release: Oct 4, 2023
  • Number of updates: 44
  • Update frequency: every 58.4 days
  • Top authors: Razzu (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /36,992 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.88ms] Passed 4 tests

Analyzing server-side resources used by Simple Masonry Layout
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.92 ▲0.80
Dashboard /wp-admin3.41 ▲0.0647.11 ▼12.73
Posts /wp-admin/edit.php3.46 ▲0.1046.84 ▲2.24
Add New Post /wp-admin/post-new.php6.00 ▲0.1187.91 ▼9.03
Media Library /wp-admin/upload.php3.34 ▲0.1032.18 ▼2.56
Add New Layout /wp-admin/post-new.php?post_type=sm-masonry-layout3.3861.01
All Layouts /wp-admin/edit.php?post_type=sm-masonry-layout3.3836.29

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Simple Masonry Layout: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20213.56 ▼1.0012.51 ▲10.8638.15 ▲0.31
Dashboard /wp-admin2,222 ▲425.62 ▼0.0992.05 ▲5.6443.75 ▲1.30
Posts /wp-admin/edit.php2,124 ▲241.94 ▼0.0040.41 ▲4.7135.80 ▼0.46
Add New Post /wp-admin/post-new.php1,558 ▲3218.14 ▼4.88584.46 ▼97.7664.14 ▼7.07
Media Library /wp-admin/upload.php1,427 ▲304.20 ▲0.0196.82 ▼2.5942.14 ▼1.83
Add New Layout /wp-admin/post-new.php?post_type=sm-masonry-layout1,7502.4950.3861.84
All Layouts /wp-admin/edit.php?post_type=sm-masonry-layout1,1011.9729.4331.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: wp_query in wp-content/plugins/simple-masonry-layout/views/shortcode-template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/simple-masonry-layout/views/metaboxes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/simple-masonry-layout/views/shortcode-template.php:1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === simple-masonry-layout === )
Please take inspiration from this readme.txt

simple-masonry-layout/simple-masonry-layout.php Passed 13 tests

"Simple Masonry Layout" version 2.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
48 characters long description:
With simple shortcode, Masonry Layout in action.

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
There were no executable files found in this plugin1,118 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP510151505
CSS327357
JavaScript64347256

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity16.50
▷ Minimum class complexity13.00
▷ Maximum class complexity20.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1280.00%
▷ Protected methods00.00%
▷ Private methods320.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 1.40MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png359.74KB96.16KB▼ 73.27%
assets/images/arrow.png0.24KB0.19KB▼ 21.95%
screenshot-2.png329.14KB84.74KB▼ 74.25%
screenshot-3.png457.03KB109.74KB▼ 75.99%
(invalid) screenshot-1.png282.88KB0.00KB▼ 100.00%