83% k2-core-block-image-styles

Code Review | Image Styles for Core Block

WordPress plugin Image Styles for Core Block scored83%from 54 tests.

About plugin

  • Plugin page: k2-core-block-ima...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8.3
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: Jan 19, 2022
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: Mahesh901122 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,624 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Image Styles for Core Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.08 ▲0.18
Dashboard /wp-admin3.32 ▼0.0345.71 ▼14.23
Posts /wp-admin/edit.php3.37 ▲0.0144.43 ▲1.31
Add New Post /wp-admin/post-new.php6.16 ▲0.2784.72 ▼19.05
Media Library /wp-admin/upload.php3.24 ▲0.0137.07 ▲3.64

Server storage [IO: ▲0.01MB] [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: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Styles for Core Block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4614.31 ▼0.251.73 ▲0.2843.91 ▲2.13
Dashboard /wp-admin2,192 ▲145.54 ▼0.1082.43 ▼18.1339.26 ▼1.57
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0433.51 ▲0.0735.69 ▲2.58
Add New Post /wp-admin/post-new.php1,546 ▲2018.34 ▼5.00633.83 ▼51.5653.74 ▲1.68
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.0795.46 ▼3.2143.87 ▼2.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× 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/k2-core-block-image-styles/classes/class-k2cbis.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/k2-core-block-image-styles/k2-core-block-image-styles.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: You can look at the official readme.txt

k2-core-block-image-styles/k2-core-block-image-styles.php 85% from 13 tests

Analyzing the main PHP file in "Image Styles for Core Block" version 1.0.0
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 159 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
No dangerous file extensions were detected181 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21555181

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected