83% block-for-masonry-gallery

Code Review | CTC Gallery

WordPress plugin CTC Gallery scored83%from 54 tests.

About plugin

  • Plugin page: block-for-masonry...
  • Plugin version: 2.6.0
  • PHP compatiblity: 7.4.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.2-6.2.2
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: Jul 8, 2023
  • Number of updates: 18
  • Update frequency: every 43.3 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,586 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼13.60ms] Passed 4 tests

Analyzing server-side resources used by CTC Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.81 ▼1.12
Dashboard /wp-admin3.31 ▼0.0345.50 ▼19.15
Posts /wp-admin/edit.php3.37 ▲0.0149.14 ▲3.56
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.69 ▼11.28
Media Library /wp-admin/upload.php3.24 ▲0.0135.29 ▼22.84

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for CTC Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲3213.10 ▼1.251.65 ▼0.3041.38 ▼0.40
Dashboard /wp-admin2,206 ▲184.85 ▼0.01108.63 ▲2.8542.47 ▲3.17
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0239.23 ▲2.5133.36 ▼3.71
Add New Post /wp-admin/post-new.php6,354 ▲4,81927.70 ▲9.61861.75 ▲242.2050.25 ▼1.70
Media Library /wp-admin/upload.php1,388 ▲64.25 ▲0.0894.49 ▼4.0241.43 ▼1.21

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-for-masonry-gallery/ctc-gal-block.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Gutenberg Block), #2 (Block Setting), #3 (Frontend display), #4 (Image in overlay)
You can take inspiration from this readme.txt

block-for-masonry-gallery/ctc-gal-block.php 77% from 13 tests

"CTC Gallery" version 2.6.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Git Repository: A Git repository was detected inside this plugin
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("block-for-masonry-gallery.php" instead of "ctc-gal-block.php")

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 plugin16,421 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON40016,190
JavaScript672102173
Sass218049
PHP31207
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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
5 PNG files occupy 5.38MB with 3.98MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png1,540.60KB422.66KB▼ 72.57%
screenshot-1.png935.22KB228.82KB▼ 75.53%
screenshot-2..png999.21KB263.61KB▼ 73.62%
screenshot-2.PNG1,039.31KB263.58KB▼ 74.64%
screenshot-2.png999.21KB263.61KB▼ 73.62%