89% before-after-image-comparison-slider-block

Code Review | Before After Image Comparison Slider Block

WordPress plugin Before After Image Comparison Slider Block scored89%from 54 tests.

About plugin

  • Plugin page: before-after-imag...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Jan 16, 2023
  • Latest release: Jan 16, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: alinoormeraj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Before After Image Comparison Slider Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.22 ▼0.24
Dashboard /wp-admin3.32 ▼0.0347.35 ▼15.57
Posts /wp-admin/edit.php3.37 ▲0.0145.02 ▼3.13
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.62 ▼8.76
Media Library /wp-admin/upload.php3.24 ▲0.0136.84 ▲3.82

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Before After Image Comparison Slider Block
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.35 ▼1.011.76 ▼0.1543.68 ▼1.08
Dashboard /wp-admin2,209 ▲215.05 ▼0.05111.91 ▼6.9142.87 ▼2.30
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0434.50 ▼3.0835.33 ▼1.02
Add New Post /wp-admin/post-new.php6,352 ▲4,83227.56 ▲4.35870.38 ▲176.8954.87 ▼4.74
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.0397.64 ▲0.8942.18 ▼6.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: compariosn, before-after, block, gutenberg, image

before-after-image-comparison-slider-block/index.php 92% from 13 tests

"Before After Image Comparison Slider Block" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("before-after-image-comparison-slider-block.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected776 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript56198589
CSS2114146
PHP36929
Sass11112

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.81MB with 0.57MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/img/frontend.png460.41KB141.11KB▼ 69.35%
lib/img/backend.png369.10KB107.74KB▼ 70.81%