79% snippets-block

Code Review | Snippets Block

WordPress plugin Snippets Block scored79%from 54 tests.

About plugin

  • Plugin page: snippets-block
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2
  • WordPress version: 6.3.1
  • First release: Apr 4, 2019
  • Latest release: Apr 30, 2019
  • Number of updates: 16
  • Update frequency: every 1.6 days
  • Top authors: displaynone (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /3,373 total downloads

Benchmarks

Plugin footprint 65% 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.05MB] [CPU: ▼6.80ms] Passed 4 tests

Server-side resources used by Snippets Block
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.64 ▲6.70
Dashboard /wp-admin3.34 ▼0.0051.49 ▼9.10
Posts /wp-admin/edit.php3.46 ▲0.1044.26 ▼8.07
Add New Post /wp-admin/post-new.php7.25 ▲1.37102.54 ▼7.21
Media Library /wp-admin/upload.php3.27 ▲0.0433.41 ▼2.81

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

Browser metrics Passed 4 tests

An overview of browser requirements for Snippets Block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11214.66 ▲0.2818.39 ▲16.6544.76 ▲0.42
Dashboard /wp-admin2,203 ▲125.85 ▼0.02106.07 ▲2.2844.17 ▲3.00
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0637.68 ▼5.8833.88 ▼5.81
Add New Post /wp-admin/post-new.php6,184 ▲4,66520.57 ▼2.48882.77 ▲211.3536.43 ▼20.76
Media Library /wp-admin/upload.php1,385 ▼34.16 ▼0.1398.83 ▼13.0943.05 ▼7.48

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
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'SentidoWeb\Blocks\Uninstaller' not found
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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 require attention:
  • Screenshots: These screenshots do not have images: #1 (/snippets-block/assets/step1.png), #2 (/snippets-block/assets/step2.png), #3 (/snippets-block/assets/step3.png), #4 (/snippets-block/assets/step4.png)
Please take inspiration from this readme.txt

snippets-block/index.php 85% from 13 tests

The principal PHP file in "Snippets Block" v. 1.3.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("snippets-block.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin22,677 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript474479315,125
CSS1081,3208637,081
PHP654188164
Markdown344090
JSON50088
PO File1222458
XML1162255
make15016

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.21
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
node_modules/highlightjs/styles/school_book.png0.47KB0.34KB▼ 27.37%
node_modules/highlightjs/styles/school-book.png0.47KB0.34KB▼ 27.37%
node_modules/highlightjs/styles/brown_papersq.png17.77KB9.92KB▼ 44.16%
node_modules/highlightjs/styles/brown-papersq.png17.77KB9.92KB▼ 44.16%