78% masonry-post-gallery

Code Review | Cactus Masonry Classic

WordPress plugin Cactus Masonry Classic scored78%from 54 tests.

About plugin

  • Plugin page: masonry-post-gallery
  • Plugin version: 1.1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Jun 28, 2014
  • Latest release: Jul 9, 2016
  • Number of updates: 55
  • Update frequency: every 13.8 days
  • Top authors: bortpress (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

600+ active /36,526 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼7.52ms] Passed 4 tests

An overview of server-side resources used by Cactus Masonry Classic
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1637.57 ▲1.47
Dashboard /wp-admin3.46 ▲0.1245.59 ▼14.86
Posts /wp-admin/edit.php3.58 ▲0.2247.77 ▼2.22
Add New Post /wp-admin/post-new.php6.05 ▲0.1682.41 ▼14.14
Media Library /wp-admin/upload.php3.39 ▲0.1633.63 ▲1.16

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cactus Masonry Classic
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16214.01 ▼0.165.84 ▲3.9339.74 ▼1.23
Dashboard /wp-admin2,207 ▲165.82 ▲0.9495.81 ▼4.7137.88 ▼5.64
Posts /wp-admin/edit.php2,093 ▲42.12 ▲0.1040.33 ▲0.5135.85 ▼0.17
Add New Post /wp-admin/post-new.php1,541 ▲823.37 ▲0.10638.34 ▲46.6155.84 ▼4.57
Media Library /wp-admin/upload.php1,392 ▲74.23 ▲0.0392.23 ▼3.0441.61 ▼1.26
Cactus Masonry /wp-admin/cactus-masonry-options.php260.440.0715.27

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/masonry-post-gallery/masonry-post-gallery.php:69

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/cactus-masonry-options.php
    • > Network (severe)
    wp-admin/cactus-masonry-options.php - Failed to load resource: the server responded with a status of 404 (Not Found)

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 to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === masonry-post-gallery === )
The official readme.txt is a good inspiration

masonry-post-gallery/masonry-post-gallery.php 92% from 13 tests

The main PHP file in "Cactus Masonry Classic" ver. 1.1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,221 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP241109721
CSS42925332
JavaScript61738168

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity154.00
▷ Minimum class complexity154.00
▷ Maximum class complexity154.00
Average method complexity9.50
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods18100.00%
▷ Public methods527.78%
▷ Protected methods00.00%
▷ Private methods1372.22%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
close.png0.27KB0.29KB0.00%
prev.png1.33KB1.59KB0.00%
next.png1.32KB1.58KB0.00%