10% yumjam-masonry-layout-for-posts-and-custom-post-types

Code Review | YumJam Masonry Layout for Posts and Custom Post Types

WordPress plugin YumJam Masonry Layout for Posts and Custom Post Types scored10%from 54 tests.

About plugin

  • Plugin page: yumjam-masonry-la...
  • Plugin version: 0.8.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Mar 28, 2018
  • Latest release: Jul 10, 2018
  • Number of updates: 8
  • Update frequency: every 13.1 days
  • Top authors: matt.burnett (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /747 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/class/masonry_custom_cpt.php+56
    Trying to access array offset on value of type null

Server metrics [RAM: ▼1.49MB] [CPU: ▼47.67ms] Passed 4 tests

A check of server-side resources used by YumJam Masonry Layout for Posts and Custom Post Types
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.50 ▼0.976.69 ▼31.95
Dashboard /wp-admin2.52 ▼0.799.94 ▼42.52
Posts /wp-admin/edit.php2.52 ▼0.848.09 ▼37.60
Add New Post /wp-admin/post-new.php2.52 ▼3.378.56 ▼78.59
Media Library /wp-admin/upload.php2.52 ▼0.716.82 ▼25.19
Colours /wp-admin/edit-tags.php?taxonomy=color&post_type=custom2.528.72
YumJam Masonry /wp-admin/admin.php?page=yumjam_masonry2.526.96
Shortcode Builder /wp-admin/admin.php?page=yumjam_masonry_2.527.52
All Bricks /wp-admin/edit.php?post_type=custom2.526.22
Add New /wp-admin/post-new.php?post_type=custom2.527.20

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by YumJam Masonry Layout for Posts and Custom Post Types
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,244 ▲49816.15 ▲1.478.55 ▲6.5047.74 ▲5.76
Dashboard /wp-admin2,533 ▲3427.00 ▲1.08133.86 ▲15.3440.36 ▼8.85
Posts /wp-admin/edit.php2,447 ▲3613.40 ▲1.3564.10 ▲26.1031.47 ▼3.07
Add New Post /wp-admin/post-new.php6,812 ▲5,29826.63 ▲8.96984.20 ▲298.5442.13 ▼9.16
Media Library /wp-admin/upload.php1,572 ▲1874.72 ▲0.5285.55 ▼13.0445.33 ▲1.31
Colours /wp-admin/edit-tags.php?taxonomy=color&post_type=custom1,6163.7954.4128.37
YumJam Masonry /wp-admin/admin.php?page=yumjam_masonry1,2693.6346.8325.97
Shortcode Builder /wp-admin/admin.php?page=yumjam_masonry_2,6474.45116.2638.12
All Bricks /wp-admin/edit.php?post_type=custom1,4743.6154.4427.24
Add New /wp-admin/post-new.php?post_type=custom3,3038.30222.4763.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/class/masonry_custom_cpt.php+56
    Trying to access array offset on value of type null
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=custom
    • > Notice in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/class/masonry_custom_cpt.php+56
    Trying to access array offset on value of type null

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 fix the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/format-image.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function edit_post_link() in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/format-video.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/template-brick.php:1
    • > PHP Notice
      Trying to get property 'post_content' of non-object in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/format-video.php on line 9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/format-standard.php:6
    • > PHP Notice
      Undefined variable: video in wp-content/plugins/yumjam-masonry-layout-for-posts-and-custom-post-types/templates/format-video.php on line 37

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

yumjam-masonry-layout-for-posts-and-custom-post-types/yumjam_masonry.php 92% from 13 tests

This is the main PHP file of "YumJam Masonry Layout for Posts and Custom Post Types" version 0.8.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("yumjam-masonry-layout-for-posts-and-custom-post-types.php" instead of "yumjam_masonry.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected5,570 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52931032,012
PHP102553241,535
SVG200973
CSS613469916
LESS1133125
Sass1109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity54.67
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods59
▷ Static methods58.47%
▷ Public methods5084.75%
▷ Protected methods11.69%
▷ Private methods813.56%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/grid-template-6.png0.77KB0.17KB▼ 77.65%
lib/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/grid-template-7.png0.74KB0.15KB▼ 79.76%
assets/images/grid-template-8.png0.75KB0.16KB▼ 78.15%
assets/images/grid-template-2.png0.75KB0.16KB▼ 78.39%